diff --git a/.buildkite/pipelines/hourly.yml b/.buildkite/pipelines/hourly.yml index bc9644820784d..c3ab2c0b4ffb9 100644 --- a/.buildkite/pipelines/hourly.yml +++ b/.buildkite/pipelines/hourly.yml @@ -158,7 +158,7 @@ steps: - command: .buildkite/scripts/steps/checks.sh label: 'Checks' agents: - queue: c2-4 + queue: c2-8 key: checks timeout_in_minutes: 120 diff --git a/.buildkite/scripts/build_kibana.sh b/.buildkite/scripts/build_kibana.sh index 84d66a30ea213..e811af224e9af 100755 --- a/.buildkite/scripts/build_kibana.sh +++ b/.buildkite/scripts/build_kibana.sh @@ -12,13 +12,19 @@ else fi if [[ "${GITHUB_PR_LABELS:-}" == *"ci:deploy-cloud"* ]]; then - echo "--- Build Kibana Cloud Distribution" + echo "--- Build and push Kibana Cloud Distribution" + + echo "$KIBANA_DOCKER_PASSWORD" | docker login -u "$KIBANA_DOCKER_USERNAME" --password-stdin docker.elastic.co + trap 'docker logout docker.elastic.co' EXIT + node scripts/build \ --skip-initialize \ --skip-generic-folders \ --skip-platform-folders \ --skip-archives \ --docker-images \ + --docker-tag-qualifier="$GIT_COMMIT" \ + --docker-push \ --skip-docker-ubi \ --skip-docker-centos \ --skip-docker-contexts diff --git a/.buildkite/scripts/common/env.sh b/.buildkite/scripts/common/env.sh index b5acfe140df24..f80e551395a4e 100755 --- a/.buildkite/scripts/common/env.sh +++ b/.buildkite/scripts/common/env.sh @@ -34,6 +34,8 @@ export TEST_BROWSER_HEADLESS=1 export ELASTIC_APM_ENVIRONMENT=ci export ELASTIC_APM_TRANSACTION_SAMPLE_RATE=0.1 +export ELASTIC_APM_SERVER_URL=https://kibana-ci-apm.apm.us-central1.gcp.cloud.es.io +export ELASTIC_APM_SECRET_TOKEN=7YKhoXsO4MzjhXjx2c if is_pr; then if [[ "${GITHUB_PR_LABELS:-}" == *"ci:collect-apm"* ]]; then diff --git a/.buildkite/scripts/lifecycle/pre_command.sh b/.buildkite/scripts/lifecycle/pre_command.sh index 7016cf41d79e9..1eeb47f3a2472 100755 --- a/.buildkite/scripts/lifecycle/pre_command.sh +++ b/.buildkite/scripts/lifecycle/pre_command.sh @@ -72,6 +72,12 @@ export GITHUB_TOKEN KIBANA_CI_REPORTER_KEY=$(retry 5 5 vault read -field=value secret/kibana-issues/dev/kibanamachine-reporter) export KIBANA_CI_REPORTER_KEY +KIBANA_DOCKER_USERNAME="$(retry 5 5 vault read -field=username secret/kibana-issues/dev/container-registry)" +export KIBANA_DOCKER_USERNAME + +KIBANA_DOCKER_PASSWORD="$(retry 5 5 vault read -field=password secret/kibana-issues/dev/container-registry)" +export KIBANA_DOCKER_PASSWORD + # Setup Failed Test Reporter Elasticsearch credentials { TEST_FAILURES_ES_CLOUD_ID=$(retry 5 5 vault read -field=cloud_id secret/kibana-issues/dev/failed_tests_reporter_es) diff --git a/.buildkite/scripts/steps/checks/type_check_plugin_public_api_docs.sh b/.buildkite/scripts/steps/checks/type_check_plugin_public_api_docs.sh index 5827fd5eb2284..e2a4bd9d9d427 100755 --- a/.buildkite/scripts/steps/checks/type_check_plugin_public_api_docs.sh +++ b/.buildkite/scripts/steps/checks/type_check_plugin_public_api_docs.sh @@ -11,6 +11,9 @@ checks-reporter-with-killswitch "Build TS Refs" \ --no-cache \ --force +set +e; +echo "--- running check types and build api docs in parallel"; + checks-reporter-with-killswitch "Check Types" \ node scripts/type_check &> target/check_types.log & check_types_pid=$! diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 61348b03c2a37..9b8fee1bd5612 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -24,7 +24,6 @@ /x-pack/plugins/lens/ @elastic/kibana-vis-editors /src/plugins/advanced_settings/ @elastic/kibana-vis-editors /src/plugins/charts/ @elastic/kibana-vis-editors -/src/plugins/kibana_legacy/ @elastic/kibana-vis-editors /src/plugins/vis_default_editor/ @elastic/kibana-vis-editors /src/plugins/vis_types/metric/ @elastic/kibana-vis-editors /src/plugins/vis_types/table/ @elastic/kibana-vis-editors @@ -68,7 +67,7 @@ /src/plugins/embeddable/ @elastic/kibana-app-services /src/plugins/expressions/ @elastic/kibana-app-services /src/plugins/field_formats/ @elastic/kibana-app-services -/src/plugins/index_pattern_editor/ @elastic/kibana-app-services +/src/plugins/data_view_editor/ @elastic/kibana-app-services /src/plugins/inspector/ @elastic/kibana-app-services /src/plugins/kibana_react/ @elastic/kibana-app-services /src/plugins/kibana_react/public/code_editor @elastic/kibana-presentation @@ -76,10 +75,10 @@ /src/plugins/navigation/ @elastic/kibana-app-services /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/data_view_field_editor @elastic/kibana-app-services /src/plugins/screenshot_mode @elastic/kibana-app-services /src/plugins/bfetch/ @elastic/kibana-app-services -/src/plugins/index_pattern_management/ @elastic/kibana-app-services +/src/plugins/data_view_management/ @elastic/kibana-app-services /src/plugins/inspector/ @elastic/kibana-app-services /x-pack/examples/ui_actions_enhanced_examples/ @elastic/kibana-app-services /x-pack/plugins/data_enhanced/ @elastic/kibana-app-services diff --git a/.i18nrc.json b/.i18nrc.json index 63e4cf6d2fbb9..80dbfee949a6c 100644 --- a/.i18nrc.json +++ b/.i18nrc.json @@ -19,7 +19,6 @@ "home": "src/plugins/home", "flot": "packages/kbn-ui-shared-deps-src/src/flot_charts", "charts": "src/plugins/charts", - "customIntegrations": "src/plugins/custom_integrations", "esUi": "src/plugins/es_ui_shared", "devTools": "src/plugins/dev_tools", "expressions": "src/plugins/expressions", @@ -42,12 +41,11 @@ "monaco": "packages/kbn-monaco/src", "esQuery": "packages/kbn-es-query/src", "presentationUtil": "src/plugins/presentation_util", - "indexPatternEditor": "src/plugins/index_pattern_editor", - "indexPatternFieldEditor": "src/plugins/index_pattern_field_editor", - "indexPatternManagement": "src/plugins/index_pattern_management", + "indexPatternEditor": "src/plugins/data_view_editor", + "indexPatternFieldEditor": "src/plugins/data_view_field_editor", + "indexPatternManagement": "src/plugins/data_view_management", "interactiveSetup": "src/plugins/interactive_setup", "advancedSettings": "src/plugins/advanced_settings", - "kibana_legacy": "src/plugins/kibana_legacy", "kibanaOverview": "src/plugins/kibana_overview", "kibana_react": "src/legacy/core_plugins/kibana_react", "kibana-react": "src/plugins/kibana_react", diff --git a/api_docs/advanced_settings.json b/api_docs/advanced_settings.json index ba157c8326940..882c6f2dba988 100644 --- a/api_docs/advanced_settings.json +++ b/api_docs/advanced_settings.json @@ -122,13 +122,14 @@ "type": "Function", "tags": [], "label": "register", - "description": [], + "description": [ + "/**\n * Attempts to register the provided component, with the ability to optionally allow\n * the component to override an existing one.\n *\n * If the intent is to override, then `allowOverride` must be set to true, otherwise an exception is thrown.\n *\n * @param id the id of the component to register\n * @param component the component\n * @param allowOverride (default: false) - optional flag to allow this component to override a previously registered component\n */" + ], "signature": [ "(id: Id, component: React.ComponentType | undefined>, allowOverride?: boolean) => void" ], "path": "src/plugins/advanced_settings/public/component_registry/component_registry.ts", "deprecated": false, - "returnComment": [], "children": [ { "parentPluginId": "advancedSettings", @@ -138,10 +139,11 @@ "label": "id", "description": [], "signature": [ - "\"advanced_settings_page_title\" | \"advanced_settings_page_subtitle\" | \"advanced_settings_page_footer\"" + "Id" ], "path": "src/plugins/advanced_settings/public/component_registry/component_registry.ts", - "deprecated": false + "deprecated": false, + "isRequired": true }, { "parentPluginId": "advancedSettings", @@ -151,10 +153,11 @@ "label": "component", "description": [], "signature": [ - "React.ComponentClass | undefined, any> | React.FunctionComponent | undefined>" + "React.ComponentType | undefined>" ], "path": "src/plugins/advanced_settings/public/component_registry/component_registry.ts", - "deprecated": false + "deprecated": false, + "isRequired": true }, { "parentPluginId": "advancedSettings", @@ -163,10 +166,15 @@ "tags": [], "label": "allowOverride", "description": [], + "signature": [ + "boolean" + ], "path": "src/plugins/advanced_settings/public/component_registry/component_registry.ts", - "deprecated": false + "deprecated": false, + "isRequired": true } - ] + ], + "returnComment": [] } ] }, @@ -199,13 +207,14 @@ "type": "Function", "tags": [], "label": "get", - "description": [], + "description": [ + "/**\n * Retrieve a registered component by its ID.\n * If the component does not exist, then an exception is thrown.\n *\n * @param id the ID of the component to retrieve\n */" + ], "signature": [ "(id: Id) => React.ComponentType | undefined>" ], "path": "src/plugins/advanced_settings/public/component_registry/component_registry.ts", "deprecated": false, - "returnComment": [], "children": [ { "parentPluginId": "advancedSettings", @@ -215,12 +224,14 @@ "label": "id", "description": [], "signature": [ - "\"advanced_settings_page_title\" | \"advanced_settings_page_subtitle\" | \"advanced_settings_page_footer\"" + "Id" ], "path": "src/plugins/advanced_settings/public/component_registry/component_registry.ts", - "deprecated": false + "deprecated": false, + "isRequired": true } - ] + ], + "returnComment": [] } ] } diff --git a/api_docs/advanced_settings.mdx b/api_docs/advanced_settings.mdx index 2dd45d7d3c5eb..8dfbd0a7306fd 100644 --- a/api_docs/advanced_settings.mdx +++ b/api_docs/advanced_settings.mdx @@ -18,7 +18,7 @@ Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 23 | 0 | 22 | 1 | +| 23 | 0 | 20 | 1 | ## Client diff --git a/api_docs/alerting.json b/api_docs/alerting.json index 41ac8743fc8d1..7677f39658074 100644 --- a/api_docs/alerting.json +++ b/api_docs/alerting.json @@ -3552,7 +3552,13 @@ "label": "executionDuration", "description": [], "signature": [ - "{ average: number; values: number[]; }" + { + "pluginId": "alerting", + "scope": "common", + "docId": "kibAlertingPluginApi", + "section": "def-common.ExecutionDuration", + "text": "ExecutionDuration" + } ], "path": "x-pack/plugins/alerting/common/alert_summary.ts", "deprecated": false @@ -3764,6 +3770,42 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "alerting", + "id": "def-common.ExecutionDuration", + "type": "Interface", + "tags": [], + "label": "ExecutionDuration", + "description": [], + "path": "x-pack/plugins/alerting/common/alert_summary.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "alerting", + "id": "def-common.ExecutionDuration.average", + "type": "number", + "tags": [], + "label": "average", + "description": [], + "path": "x-pack/plugins/alerting/common/alert_summary.ts", + "deprecated": false + }, + { + "parentPluginId": "alerting", + "id": "def-common.ExecutionDuration.valuesWithTimestamp", + "type": "Object", + "tags": [], + "label": "valuesWithTimestamp", + "description": [], + "signature": [ + "{ [x: string]: number; }" + ], + "path": "x-pack/plugins/alerting/common/alert_summary.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "alerting", "id": "def-common.IntervalSchedule", diff --git a/api_docs/alerting.mdx b/api_docs/alerting.mdx index 546516399e54d..b4e423889e3be 100644 --- a/api_docs/alerting.mdx +++ b/api_docs/alerting.mdx @@ -18,7 +18,7 @@ Contact [Kibana Alerting](https://github.com/orgs/elastic/teams/kibana-alerting- | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 260 | 0 | 252 | 18 | +| 263 | 0 | 255 | 18 | ## Client diff --git a/api_docs/apm.json b/api_docs/apm.json index 8e4a40501f6a3..4e55013ef9754 100644 --- a/api_docs/apm.json +++ b/api_docs/apm.json @@ -4510,7 +4510,7 @@ "section": "def-common.PackagePolicy", "text": "PackagePolicy" }, - " | undefined; }, ", + " | undefined; has_apm_integrations: boolean; }, ", "APMRouteCreateOptions", ">; } & { \"POST /internal/apm/fleet/cloud_apm_package_policy\": ", { diff --git a/api_docs/cases.json b/api_docs/cases.json index ff2fd8e755fa6..84125b5a24dac 100644 --- a/api_docs/cases.json +++ b/api_docs/cases.json @@ -226,755 +226,319 @@ "initialIsOpen": false } ], - "functions": [], - "interfaces": [ + "functions": [ { "parentPluginId": "cases", - "id": "def-public.AllCasesProps", - "type": "Interface", + "id": "def-public.generateCaseViewPath", + "type": "Function", "tags": [], - "label": "AllCasesProps", + "label": "generateCaseViewPath", "description": [], "signature": [ - { - "pluginId": "cases", - "scope": "public", - "docId": "kibCasesPluginApi", - "section": "def-public.AllCasesProps", - "text": "AllCasesProps" - }, - " extends ", - "Owner" + "(params: ", + "CaseViewPathParams", + ") => string" ], - "path": "x-pack/plugins/cases/public/components/all_cases/index.tsx", + "path": "x-pack/plugins/cases/public/common/navigation/paths.ts", "deprecated": false, "children": [ { "parentPluginId": "cases", - "id": "def-public.AllCasesProps.caseDetailsNavigation", - "type": "Object", - "tags": [], - "label": "caseDetailsNavigation", - "description": [], - "signature": [ - "CasesNavigation", - "<", - "CaseDetailsHrefSchema", - ", \"configurable\">" - ], - "path": "x-pack/plugins/cases/public/components/all_cases/index.tsx", - "deprecated": false - }, - { - "parentPluginId": "cases", - "id": "def-public.AllCasesProps.configureCasesNavigation", + "id": "def-public.generateCaseViewPath.$1", "type": "Object", "tags": [], - "label": "configureCasesNavigation", + "label": "params", "description": [], "signature": [ - "CasesNavigation", - " | null, null>" + "CaseViewPathParams" ], - "path": "x-pack/plugins/cases/public/components/all_cases/index.tsx", - "deprecated": false - }, - { - "parentPluginId": "cases", - "id": "def-public.AllCasesProps.createCaseNavigation", - "type": "Object", - "tags": [], - "label": "createCaseNavigation", - "description": [], - "signature": [ - "CasesNavigation", - " | null, null>" - ], - "path": "x-pack/plugins/cases/public/components/all_cases/index.tsx", - "deprecated": false - }, - { - "parentPluginId": "cases", - "id": "def-public.AllCasesProps.disableAlerts", - "type": "CompoundType", - "tags": [], - "label": "disableAlerts", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "x-pack/plugins/cases/public/components/all_cases/index.tsx", - "deprecated": false - }, - { - "parentPluginId": "cases", - "id": "def-public.AllCasesProps.showTitle", - "type": "CompoundType", - "tags": [], - "label": "showTitle", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "x-pack/plugins/cases/public/components/all_cases/index.tsx", - "deprecated": false - }, - { - "parentPluginId": "cases", - "id": "def-public.AllCasesProps.userCanCrud", - "type": "boolean", - "tags": [], - "label": "userCanCrud", - "description": [], - "path": "x-pack/plugins/cases/public/components/all_cases/index.tsx", - "deprecated": false + "path": "x-pack/plugins/cases/public/common/navigation/paths.ts", + "deprecated": false, + "isRequired": true } ], + "returnComment": [], "initialIsOpen": false }, { "parentPluginId": "cases", - "id": "def-public.AllCasesSelectorModalProps", - "type": "Interface", + "id": "def-public.getCasesConfigurePath", + "type": "Function", "tags": [], - "label": "AllCasesSelectorModalProps", + "label": "getCasesConfigurePath", "description": [], "signature": [ - { - "pluginId": "cases", - "scope": "public", - "docId": "kibCasesPluginApi", - "section": "def-public.AllCasesSelectorModalProps", - "text": "AllCasesSelectorModalProps" - }, - " extends ", - "Owner" + "(casesBasePath: string) => string" ], - "path": "x-pack/plugins/cases/public/components/all_cases/selector_modal/index.tsx", + "path": "x-pack/plugins/cases/public/common/navigation/paths.ts", "deprecated": false, "children": [ { "parentPluginId": "cases", - "id": "def-public.AllCasesSelectorModalProps.alertData", - "type": "Object", - "tags": [], - "label": "alertData", - "description": [], - "signature": [ - "Pick<{ 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; }, \"index\" | \"rule\" | \"alertId\" | \"owner\"> | undefined" - ], - "path": "x-pack/plugins/cases/public/components/all_cases/selector_modal/index.tsx", - "deprecated": false - }, - { - "parentPluginId": "cases", - "id": "def-public.AllCasesSelectorModalProps.createCaseNavigation", - "type": "Object", - "tags": [], - "label": "createCaseNavigation", - "description": [], - "signature": [ - "CasesNavigation", - " | null, null>" - ], - "path": "x-pack/plugins/cases/public/components/all_cases/selector_modal/index.tsx", - "deprecated": false - }, - { - "parentPluginId": "cases", - "id": "def-public.AllCasesSelectorModalProps.hiddenStatuses", - "type": "Array", - "tags": [], - "label": "hiddenStatuses", - "description": [], - "signature": [ - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseStatusWithAllStatus", - "text": "CaseStatusWithAllStatus" - }, - "[] | undefined" - ], - "path": "x-pack/plugins/cases/public/components/all_cases/selector_modal/index.tsx", - "deprecated": false - }, - { - "parentPluginId": "cases", - "id": "def-public.AllCasesSelectorModalProps.onRowClick", - "type": "Function", - "tags": [], - "label": "onRowClick", - "description": [], - "signature": [ - "(theCase?: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.Case", - "text": "Case" - }, - " | ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.SubCase", - "text": "SubCase" - }, - " | undefined) => void" - ], - "path": "x-pack/plugins/cases/public/components/all_cases/selector_modal/index.tsx", - "deprecated": false, - "children": [ - { - "parentPluginId": "cases", - "id": "def-public.AllCasesSelectorModalProps.onRowClick.$1", - "type": "CompoundType", - "tags": [], - "label": "theCase", - "description": [], - "signature": [ - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.Case", - "text": "Case" - }, - " | ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.SubCase", - "text": "SubCase" - }, - " | undefined" - ], - "path": "x-pack/plugins/cases/public/components/all_cases/selector_modal/index.tsx", - "deprecated": false, - "isRequired": false - } - ], - "returnComment": [] - }, - { - "parentPluginId": "cases", - "id": "def-public.AllCasesSelectorModalProps.updateCase", - "type": "Function", - "tags": [], - "label": "updateCase", - "description": [], - "signature": [ - "((newCase: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.Case", - "text": "Case" - }, - ") => void) | undefined" - ], - "path": "x-pack/plugins/cases/public/components/all_cases/selector_modal/index.tsx", - "deprecated": false, - "children": [ - { - "parentPluginId": "cases", - "id": "def-public.AllCasesSelectorModalProps.updateCase.$1", - "type": "Object", - "tags": [], - "label": "newCase", - "description": [], - "signature": [ - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.Case", - "text": "Case" - } - ], - "path": "x-pack/plugins/cases/public/components/all_cases/selector_modal/index.tsx", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "cases", - "id": "def-public.AllCasesSelectorModalProps.userCanCrud", - "type": "boolean", - "tags": [], - "label": "userCanCrud", - "description": [], - "path": "x-pack/plugins/cases/public/components/all_cases/selector_modal/index.tsx", - "deprecated": false - }, - { - "parentPluginId": "cases", - "id": "def-public.AllCasesSelectorModalProps.onClose", - "type": "Function", + "id": "def-public.getCasesConfigurePath.$1", + "type": "string", "tags": [], - "label": "onClose", + "label": "casesBasePath", "description": [], "signature": [ - "(() => void) | undefined" + "string" ], - "path": "x-pack/plugins/cases/public/components/all_cases/selector_modal/index.tsx", + "path": "x-pack/plugins/cases/public/common/navigation/paths.ts", "deprecated": false, - "children": [], - "returnComment": [] + "isRequired": true } ], + "returnComment": [], "initialIsOpen": false }, { "parentPluginId": "cases", - "id": "def-public.CaseViewProps", - "type": "Interface", + "id": "def-public.getCasesDeepLinks", + "type": "Function", "tags": [], - "label": "CaseViewProps", + "label": "getCasesDeepLinks", "description": [], "signature": [ + " void) | undefined" - ], - "path": "x-pack/plugins/cases/public/components/case_view/index.tsx", - "deprecated": false, - "children": [ - { - "parentPluginId": "cases", - "id": "def-public.CaseViewProps.onCaseDataSuccess.$1", - "type": "Object", - "tags": [], - "label": "data", - "description": [], - "signature": [ - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.Case", - "text": "Case" - } - ], - "path": "x-pack/plugins/cases/public/components/case_view/index.tsx", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "cases", - "id": "def-public.CaseViewProps.timelineIntegration", - "type": "Object", - "tags": [], - "label": "timelineIntegration", - "description": [], - "signature": [ - "CasesTimelineIntegration", - " | undefined" - ], - "path": "x-pack/plugins/cases/public/components/case_view/index.tsx", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "cases", - "id": "def-public.ConfigureCasesProps", - "type": "Interface", - "tags": [], - "label": "ConfigureCasesProps", - "description": [], - "signature": [ + " = ", { - "pluginId": "cases", + "pluginId": "core", "scope": "public", - "docId": "kibCasesPluginApi", - "section": "def-public.ConfigureCasesProps", - "text": "ConfigureCasesProps" + "docId": "kibCoreApplicationPluginApi", + "section": "def-public.AppDeepLink", + "text": "AppDeepLink" }, - " extends ", - "Owner" - ], - "path": "x-pack/plugins/cases/public/components/configure_cases/index.tsx", - "deprecated": false, - "children": [ - { - "parentPluginId": "cases", - "id": "def-public.ConfigureCasesProps.userCanCrud", - "type": "boolean", - "tags": [], - "label": "userCanCrud", - "description": [], - "path": "x-pack/plugins/cases/public/components/configure_cases/index.tsx", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "cases", - "id": "def-public.CreateCaseProps", - "type": "Interface", - "tags": [], - "label": "CreateCaseProps", - "description": [], - "signature": [ + ">({ basePath, extend, }: { basePath?: string | undefined; extend?: Partial>> | undefined; }) => { id: \"cases\"; path: string; deepLinks: ({ id: \"cases_create\"; path: string; title: string | T[\"title\"]; keywords?: T[\"keywords\"] | undefined; navLinkStatus?: T[\"navLinkStatus\"] | undefined; searchable?: T[\"searchable\"] | undefined; order?: T[\"order\"] | undefined; tooltip?: T[\"tooltip\"] | undefined; euiIconType?: T[\"euiIconType\"] | undefined; icon?: T[\"icon\"] | undefined; deepLinks?: T[\"deepLinks\"] | undefined; } | { id: \"cases_configure\"; path: string; title: string | T[\"title\"]; keywords?: T[\"keywords\"] | undefined; navLinkStatus?: T[\"navLinkStatus\"] | undefined; searchable?: T[\"searchable\"] | undefined; order?: T[\"order\"] | undefined; tooltip?: T[\"tooltip\"] | undefined; euiIconType?: T[\"euiIconType\"] | undefined; icon?: T[\"icon\"] | undefined; deepLinks?: T[\"deepLinks\"] | undefined; })[]; title: string | T[\"title\"]; keywords?: T[\"keywords\"] | undefined; navLinkStatus?: T[\"navLinkStatus\"] | undefined; searchable?: T[\"searchable\"] | undefined; order?: T[\"order\"] | undefined; tooltip?: T[\"tooltip\"] | undefined; euiIconType?: T[\"euiIconType\"] | undefined; icon?: T[\"icon\"] | undefined; }" ], - "path": "x-pack/plugins/cases/public/components/create/index.tsx", + "path": "x-pack/plugins/cases/public/common/navigation/deep_links.ts", "deprecated": false, "children": [ { "parentPluginId": "cases", - "id": "def-public.CreateCaseProps.afterCaseCreated", - "type": "Function", + "id": "def-public.getCasesDeepLinks.$1", + "type": "Object", "tags": [], - "label": "afterCaseCreated", + "label": "{\n basePath = DEFAULT_BASE_PATH,\n extend = {},\n}", "description": [], - "signature": [ - "((theCase: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.Case", - "text": "Case" - }, - ", postComment: (args: ", - "PostComment", - ") => Promise) => Promise) | undefined" - ], - "path": "x-pack/plugins/cases/public/components/create/index.tsx", + "path": "x-pack/plugins/cases/public/common/navigation/deep_links.ts", "deprecated": false, "children": [ { "parentPluginId": "cases", - "id": "def-public.CreateCaseProps.afterCaseCreated.$1", - "type": "Object", - "tags": [], - "label": "theCase", - "description": [], - "signature": [ - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.Case", - "text": "Case" - } - ], - "path": "x-pack/plugins/cases/public/components/create/index.tsx", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "cases", - "id": "def-public.CreateCaseProps.afterCaseCreated.$2", - "type": "Function", + "id": "def-public.getCasesDeepLinks.$1.basePath", + "type": "string", "tags": [], - "label": "postComment", + "label": "basePath", "description": [], "signature": [ - "(args: ", - "PostComment", - ") => Promise" + "string | undefined" ], - "path": "x-pack/plugins/cases/public/components/create/index.tsx", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "cases", - "id": "def-public.CreateCaseProps.caseType", - "type": "CompoundType", - "tags": [], - "label": "caseType", - "description": [], - "signature": [ - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CaseType", - "text": "CaseType" - }, - " | undefined" - ], - "path": "x-pack/plugins/cases/public/components/create/index.tsx", - "deprecated": false - }, - { - "parentPluginId": "cases", - "id": "def-public.CreateCaseProps.disableAlerts", - "type": "CompoundType", - "tags": [], - "label": "disableAlerts", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "x-pack/plugins/cases/public/components/create/index.tsx", - "deprecated": false - }, - { - "parentPluginId": "cases", - "id": "def-public.CreateCaseProps.hideConnectorServiceNowSir", - "type": "CompoundType", - "tags": [], - "label": "hideConnectorServiceNowSir", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "x-pack/plugins/cases/public/components/create/index.tsx", - "deprecated": false - }, - { - "parentPluginId": "cases", - "id": "def-public.CreateCaseProps.onCancel", - "type": "Function", - "tags": [], - "label": "onCancel", - "description": [], - "signature": [ - "() => void" - ], - "path": "x-pack/plugins/cases/public/components/create/index.tsx", - "deprecated": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "cases", - "id": "def-public.CreateCaseProps.onSuccess", - "type": "Function", - "tags": [], - "label": "onSuccess", - "description": [], - "signature": [ - "(theCase: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.Case", - "text": "Case" + "path": "x-pack/plugins/cases/public/common/navigation/deep_links.ts", + "deprecated": false }, - ") => Promise" - ], - "path": "x-pack/plugins/cases/public/components/create/index.tsx", - "deprecated": false, - "children": [ { "parentPluginId": "cases", - "id": "def-public.CreateCaseProps.onSuccess.$1", + "id": "def-public.getCasesDeepLinks.$1.extend", "type": "Object", "tags": [], - "label": "theCase", + "label": "extend", "description": [], "signature": [ + "Partial>> | undefined" + ], + "path": "x-pack/plugins/cases/public/common/navigation/deep_links.ts", + "deprecated": false + } + ] } ], + "returnComment": [], "initialIsOpen": false }, { "parentPluginId": "cases", - "id": "def-public.RecentCasesProps", - "type": "Interface", + "id": "def-public.getCaseViewPath", + "type": "Function", "tags": [], - "label": "RecentCasesProps", + "label": "getCaseViewPath", "description": [], "signature": [ - { - "pluginId": "cases", - "scope": "public", - "docId": "kibCasesPluginApi", - "section": "def-public.RecentCasesProps", - "text": "RecentCasesProps" - }, - " extends ", - "Owner" + "(casesBasePath: string) => string" ], - "path": "x-pack/plugins/cases/public/components/recent_cases/index.tsx", + "path": "x-pack/plugins/cases/public/common/navigation/paths.ts", "deprecated": false, "children": [ { "parentPluginId": "cases", - "id": "def-public.RecentCasesProps.allCasesNavigation", - "type": "Object", - "tags": [], - "label": "allCasesNavigation", - "description": [], - "signature": [ - "CasesNavigation", - " | null, null>" - ], - "path": "x-pack/plugins/cases/public/components/recent_cases/index.tsx", - "deprecated": false - }, - { - "parentPluginId": "cases", - "id": "def-public.RecentCasesProps.caseDetailsNavigation", - "type": "Object", + "id": "def-public.getCaseViewPath.$1", + "type": "string", "tags": [], - "label": "caseDetailsNavigation", + "label": "casesBasePath", "description": [], "signature": [ - "CasesNavigation", - "<", - "CaseDetailsHrefSchema", - ", \"configurable\">" + "string" ], - "path": "x-pack/plugins/cases/public/components/recent_cases/index.tsx", - "deprecated": false - }, + "path": "x-pack/plugins/cases/public/common/navigation/paths.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-public.getCreateCasePath", + "type": "Function", + "tags": [], + "label": "getCreateCasePath", + "description": [], + "signature": [ + "(casesBasePath: string) => string" + ], + "path": "x-pack/plugins/cases/public/common/navigation/paths.ts", + "deprecated": false, + "children": [ { "parentPluginId": "cases", - "id": "def-public.RecentCasesProps.createCaseNavigation", - "type": "Object", + "id": "def-public.getCreateCasePath.$1", + "type": "string", "tags": [], - "label": "createCaseNavigation", + "label": "casesBasePath", "description": [], "signature": [ - "CasesNavigation", - " | null, null>" + "string" ], - "path": "x-pack/plugins/cases/public/components/recent_cases/index.tsx", - "deprecated": false - }, - { - "parentPluginId": "cases", - "id": "def-public.RecentCasesProps.hasWritePermissions", - "type": "boolean", - "tags": [], - "label": "hasWritePermissions", - "description": [], - "path": "x-pack/plugins/cases/public/components/recent_cases/index.tsx", - "deprecated": false - }, - { - "parentPluginId": "cases", - "id": "def-public.RecentCasesProps.maxCasesToShow", - "type": "number", - "tags": [], - "label": "maxCasesToShow", - "description": [], - "path": "x-pack/plugins/cases/public/components/recent_cases/index.tsx", - "deprecated": false + "path": "x-pack/plugins/cases/public/common/navigation/paths.ts", + "deprecated": false, + "isRequired": true } ], + "returnComment": [], "initialIsOpen": false } ], + "interfaces": [], "enums": [], - "misc": [], - "objects": [], + "misc": [ + { + "parentPluginId": "cases", + "id": "def-public.GetAllCasesSelectorModalProps", + "type": "Type", + "tags": [], + "label": "GetAllCasesSelectorModalProps", + "description": [], + "signature": [ + "AllCasesSelectorModalProps", + " & ", + "CasesContextProps" + ], + "path": "x-pack/plugins/cases/public/methods/get_all_cases_selector_modal.tsx", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-public.GetCasesProps", + "type": "Type", + "tags": [], + "label": "GetCasesProps", + "description": [], + "signature": [ + "CasesRoutesProps", + " & ", + "CasesContextProps" + ], + "path": "x-pack/plugins/cases/public/methods/get_cases.tsx", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-public.GetCreateCaseFlyoutProps", + "type": "Type", + "tags": [], + "label": "GetCreateCaseFlyoutProps", + "description": [], + "signature": [ + "CreateCaseFlyoutProps", + " & ", + "CasesContextProps" + ], + "path": "x-pack/plugins/cases/public/methods/get_create_case_flyout.tsx", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-public.GetRecentCasesProps", + "type": "Type", + "tags": [], + "label": "GetRecentCasesProps", + "description": [], + "signature": [ + "RecentCasesProps", + " & ", + "CasesContextProps" + ], + "path": "x-pack/plugins/cases/public/methods/get_recent_cases.tsx", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "cases", + "id": "def-public.ICasesDeepLinkId", + "type": "Type", + "tags": [], + "label": "ICasesDeepLinkId", + "description": [], + "signature": [ + "\"cases\" | \"cases_create\" | \"cases_configure\"" + ], + "path": "x-pack/plugins/cases/public/common/navigation/deep_links.ts", + "deprecated": false, + "initialIsOpen": false + } + ], + "objects": [ + { + "parentPluginId": "cases", + "id": "def-public.CasesDeepLinkId", + "type": "Object", + "tags": [], + "label": "CasesDeepLinkId", + "description": [], + "signature": [ + "{ readonly cases: \"cases\"; readonly casesCreate: \"cases_create\"; readonly casesConfigure: \"cases_configure\"; }" + ], + "path": "x-pack/plugins/cases/public/common/navigation/deep_links.ts", + "deprecated": false, + "initialIsOpen": false + } + ], "start": { "parentPluginId": "cases", "id": "def-public.CasesUiStart", @@ -987,12 +551,14 @@ "children": [ { "parentPluginId": "cases", - "id": "def-public.CasesUiStart.getAllCases", + "id": "def-public.CasesUiStart.getCases", "type": "Function", - "tags": [], - "label": "getAllCases", + "tags": [ + "return" + ], + "label": "getCases", "description": [ - "\nGet the all cases table" + "\nGet cases" ], "signature": [ "(props: ", @@ -1000,16 +566,16 @@ "pluginId": "cases", "scope": "public", "docId": "kibCasesPluginApi", - "section": "def-public.AllCasesProps", - "text": "AllCasesProps" + "section": "def-public.GetCasesProps", + "text": "GetCasesProps" }, ") => React.ReactElement<", { "pluginId": "cases", "scope": "public", "docId": "kibCasesPluginApi", - "section": "def-public.AllCasesProps", - "text": "AllCasesProps" + "section": "def-public.GetCasesProps", + "text": "GetCasesProps" }, ">" ], @@ -1018,20 +584,20 @@ "children": [ { "parentPluginId": "cases", - "id": "def-public.CasesUiStart.getAllCases.$1", - "type": "Object", + "id": "def-public.CasesUiStart.getCases.$1", + "type": "CompoundType", "tags": [], "label": "props", "description": [ - "AllCasesProps" + "GetCasesProps" ], "signature": [ { "pluginId": "cases", "scope": "public", "docId": "kibCasesPluginApi", - "section": "def-public.AllCasesProps", - "text": "AllCasesProps" + "section": "def-public.GetCasesProps", + "text": "GetCasesProps" } ], "path": "x-pack/plugins/cases/public/types.ts", @@ -1039,9 +605,7 @@ "isRequired": true } ], - "returnComment": [ - "A react component that displays all cases" - ] + "returnComment": [] }, { "parentPluginId": "cases", @@ -1050,7 +614,7 @@ "tags": [], "label": "getAllCasesSelectorModal", "description": [ - "\nuse Modal hook for all cases selector" + "\nModal to select a case in a list of all owner cases" ], "signature": [ "(props: ", @@ -1058,16 +622,16 @@ "pluginId": "cases", "scope": "public", "docId": "kibCasesPluginApi", - "section": "def-public.AllCasesSelectorModalProps", - "text": "AllCasesSelectorModalProps" + "section": "def-public.GetAllCasesSelectorModalProps", + "text": "GetAllCasesSelectorModalProps" }, ") => React.ReactElement<", { "pluginId": "cases", "scope": "public", "docId": "kibCasesPluginApi", - "section": "def-public.AllCasesSelectorModalProps", - "text": "AllCasesSelectorModalProps" + "section": "def-public.GetAllCasesSelectorModalProps", + "text": "GetAllCasesSelectorModalProps" }, ">" ], @@ -1077,19 +641,19 @@ { "parentPluginId": "cases", "id": "def-public.CasesUiStart.getAllCasesSelectorModal.$1", - "type": "Object", + "type": "CompoundType", "tags": [], "label": "props", "description": [ - "UseAllCasesSelectorModalProps" + "GetAllCasesSelectorModalProps" ], "signature": [ { "pluginId": "cases", "scope": "public", "docId": "kibCasesPluginApi", - "section": "def-public.AllCasesSelectorModalProps", - "text": "AllCasesSelectorModalProps" + "section": "def-public.GetAllCasesSelectorModalProps", + "text": "GetAllCasesSelectorModalProps" } ], "path": "x-pack/plugins/cases/public/types.ts", @@ -1103,128 +667,12 @@ }, { "parentPluginId": "cases", - "id": "def-public.CasesUiStart.getCaseView", - "type": "Function", - "tags": [], - "label": "getCaseView", - "description": [ - "\nGet the case view component" - ], - "signature": [ - "(props: ", - { - "pluginId": "cases", - "scope": "public", - "docId": "kibCasesPluginApi", - "section": "def-public.CaseViewProps", - "text": "CaseViewProps" - }, - ") => React.ReactElement<", - { - "pluginId": "cases", - "scope": "public", - "docId": "kibCasesPluginApi", - "section": "def-public.CaseViewProps", - "text": "CaseViewProps" - }, - ">" - ], - "path": "x-pack/plugins/cases/public/types.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "cases", - "id": "def-public.CasesUiStart.getCaseView.$1", - "type": "Object", - "tags": [], - "label": "props", - "description": [ - "CaseViewProps" - ], - "signature": [ - { - "pluginId": "cases", - "scope": "public", - "docId": "kibCasesPluginApi", - "section": "def-public.CaseViewProps", - "text": "CaseViewProps" - } - ], - "path": "x-pack/plugins/cases/public/types.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [ - "A react component for viewing a specific case" - ] - }, - { - "parentPluginId": "cases", - "id": "def-public.CasesUiStart.getConfigureCases", - "type": "Function", - "tags": [], - "label": "getConfigureCases", - "description": [ - "\nGet the configure case component" - ], - "signature": [ - "(props: ", - { - "pluginId": "cases", - "scope": "public", - "docId": "kibCasesPluginApi", - "section": "def-public.ConfigureCasesProps", - "text": "ConfigureCasesProps" - }, - ") => React.ReactElement<", - { - "pluginId": "cases", - "scope": "public", - "docId": "kibCasesPluginApi", - "section": "def-public.ConfigureCasesProps", - "text": "ConfigureCasesProps" - }, - ">" - ], - "path": "x-pack/plugins/cases/public/types.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "cases", - "id": "def-public.CasesUiStart.getConfigureCases.$1", - "type": "Object", - "tags": [], - "label": "props", - "description": [ - "ConfigureCasesProps" - ], - "signature": [ - { - "pluginId": "cases", - "scope": "public", - "docId": "kibCasesPluginApi", - "section": "def-public.ConfigureCasesProps", - "text": "ConfigureCasesProps" - } - ], - "path": "x-pack/plugins/cases/public/types.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [ - "A react component for configuring a specific case" - ] - }, - { - "parentPluginId": "cases", - "id": "def-public.CasesUiStart.getCreateCase", + "id": "def-public.CasesUiStart.getCreateCaseFlyout", "type": "Function", "tags": [], - "label": "getCreateCase", + "label": "getCreateCaseFlyout", "description": [ - "\nGet the create case form" + "\nFlyout with the form to create a case for the owner" ], "signature": [ "(props: ", @@ -1232,16 +680,16 @@ "pluginId": "cases", "scope": "public", "docId": "kibCasesPluginApi", - "section": "def-public.CreateCaseProps", - "text": "CreateCaseProps" + "section": "def-public.GetCreateCaseFlyoutProps", + "text": "GetCreateCaseFlyoutProps" }, ") => React.ReactElement<", { "pluginId": "cases", "scope": "public", "docId": "kibCasesPluginApi", - "section": "def-public.CreateCaseProps", - "text": "CreateCaseProps" + "section": "def-public.GetCreateCaseFlyoutProps", + "text": "GetCreateCaseFlyoutProps" }, ">" ], @@ -1250,20 +698,20 @@ "children": [ { "parentPluginId": "cases", - "id": "def-public.CasesUiStart.getCreateCase.$1", - "type": "Object", + "id": "def-public.CasesUiStart.getCreateCaseFlyout.$1", + "type": "CompoundType", "tags": [], "label": "props", "description": [ - "CreateCaseProps" + "GetCreateCaseFlyoutProps" ], "signature": [ { "pluginId": "cases", "scope": "public", "docId": "kibCasesPluginApi", - "section": "def-public.CreateCaseProps", - "text": "CreateCaseProps" + "section": "def-public.GetCreateCaseFlyoutProps", + "text": "GetCreateCaseFlyoutProps" } ], "path": "x-pack/plugins/cases/public/types.ts", @@ -1272,7 +720,7 @@ } ], "returnComment": [ - "A react component for creating a new case" + "A react component that is a flyout for creating a case" ] }, { @@ -1290,16 +738,16 @@ "pluginId": "cases", "scope": "public", "docId": "kibCasesPluginApi", - "section": "def-public.RecentCasesProps", - "text": "RecentCasesProps" + "section": "def-public.GetRecentCasesProps", + "text": "GetRecentCasesProps" }, ") => React.ReactElement<", { "pluginId": "cases", "scope": "public", "docId": "kibCasesPluginApi", - "section": "def-public.RecentCasesProps", - "text": "RecentCasesProps" + "section": "def-public.GetRecentCasesProps", + "text": "GetRecentCasesProps" }, ">" ], @@ -1309,19 +757,19 @@ { "parentPluginId": "cases", "id": "def-public.CasesUiStart.getRecentCases.$1", - "type": "Object", + "type": "CompoundType", "tags": [], "label": "props", "description": [ - "RecentCasesProps" + "GetRecentCasesProps" ], "signature": [ { "pluginId": "cases", "scope": "public", "docId": "kibCasesPluginApi", - "section": "def-public.RecentCasesProps", - "text": "RecentCasesProps" + "section": "def-public.GetRecentCasesProps", + "text": "GetRecentCasesProps" } ], "path": "x-pack/plugins/cases/public/types.ts", @@ -6955,15 +6403,7 @@ "label": "Comment", "description": [], "signature": [ - "({ type: ", - { - "pluginId": "cases", - "scope": "common", - "docId": "kibCasesPluginApi", - "section": "def-common.CommentType", - "text": "CommentType" - }, - ".alert | ", + "({ comment: string; type: ", { "pluginId": "cases", "scope": "common", @@ -6971,7 +6411,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { associationType: ", + ".user; owner: string; } & { associationType: ", { "pluginId": "cases", "scope": "common", @@ -6995,7 +6435,7 @@ "section": "def-common.ElasticUser", "text": "ElasticUser" }, - " | null; version: string; }) | ({ comment: string; type: ", + " | null; version: string; }) | ({ type: ", { "pluginId": "cases", "scope": "common", @@ -7003,7 +6443,15 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; owner: string; } & { associationType: ", + ".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", @@ -7189,7 +6637,7 @@ "label": "CommentPatchRequest", "description": [], "signature": [ - "({ type: ", + "({ comment: string; type: ", { "pluginId": "cases", "scope": "common", @@ -7197,7 +6645,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".alert | ", + ".user; owner: string; } & { id: string; version: string; }) | ({ type: ", { "pluginId": "cases", "scope": "common", @@ -7205,7 +6653,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { id: string; version: string; }) | ({ comment: string; type: ", + ".alert | ", { "pluginId": "cases", "scope": "common", @@ -7213,7 +6661,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; owner: string; } & { id: string; version: string; }) | ({ type: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } & { id: string; version: string; }) | ({ type: ", { "pluginId": "cases", "scope": "common", @@ -7235,7 +6683,7 @@ "label": "CommentRequest", "description": [], "signature": [ - "{ type: ", + "{ comment: string; type: ", { "pluginId": "cases", "scope": "common", @@ -7243,7 +6691,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".alert | ", + ".user; owner: string; } | { type: ", { "pluginId": "cases", "scope": "common", @@ -7251,7 +6699,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } | { comment: string; type: ", + ".alert | ", { "pluginId": "cases", "scope": "common", @@ -7259,7 +6707,7 @@ "section": "def-common.CommentType", "text": "CommentType" }, - ".user; owner: string; } | { type: ", + ".generatedAlert; alertId: string | string[]; index: string | string[]; rule: { id: string | null; name: string | null; }; owner: string; } | { type: ", { "pluginId": "cases", "scope": "common", diff --git a/api_docs/cases.mdx b/api_docs/cases.mdx index b9e4d1c7d7567..59aa571e25548 100644 --- a/api_docs/cases.mdx +++ b/api_docs/cases.mdx @@ -18,18 +18,24 @@ Contact [Security Solution Threat Hunting](https://github.com/orgs/elastic/teams | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 478 | 0 | 434 | 15 | +| 451 | 0 | 411 | 15 | ## Client ### Start +### Objects + + +### Functions + + ### Classes -### Interfaces - +### Consts, variables and types + ## Server diff --git a/api_docs/charts.json b/api_docs/charts.json index 0fc469bf82674..143c3e1d06e8b 100644 --- a/api_docs/charts.json +++ b/api_docs/charts.json @@ -942,12 +942,19 @@ { "parentPluginId": "charts", "id": "def-public.ColorMap.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: RawColorSchema", "description": [], "signature": [ - "any" + "[key: string]: ", + { + "pluginId": "charts", + "scope": "common", + "docId": "kibChartsPluginApi", + "section": "def-common.RawColorSchema", + "text": "RawColorSchema" + } ], "path": "src/plugins/charts/common/static/color_maps/color_maps.ts", "deprecated": false @@ -3283,12 +3290,19 @@ { "parentPluginId": "charts", "id": "def-common.ColorMap.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: RawColorSchema", "description": [], "signature": [ - "any" + "[key: string]: ", + { + "pluginId": "charts", + "scope": "common", + "docId": "kibChartsPluginApi", + "section": "def-common.RawColorSchema", + "text": "RawColorSchema" + } ], "path": "src/plugins/charts/common/static/color_maps/color_maps.ts", "deprecated": false diff --git a/api_docs/charts.mdx b/api_docs/charts.mdx index 5f906789d65e8..dcfc63c3ac6ea 100644 --- a/api_docs/charts.mdx +++ b/api_docs/charts.mdx @@ -18,7 +18,7 @@ Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 310 | 4 | 278 | 3 | +| 310 | 2 | 278 | 3 | ## Client diff --git a/api_docs/core.json b/api_docs/core.json index 08d1c27ddf8e9..3ff47b6638a8c 100644 --- a/api_docs/core.json +++ b/api_docs/core.json @@ -947,14 +947,14 @@ { "parentPluginId": "core", "id": "def-public.Capabilities.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: Record>", "description": [ "Custom capabilities, registered by plugins." ], "signature": [ - "any" + "[key: string]: Record>" ], "path": "src/core/types/capabilities.ts", "deprecated": false @@ -1672,7 +1672,7 @@ "label": "links", "description": [], "signature": [ - "{ readonly settings: string; readonly elasticStackGetStarted: string; readonly upgrade: { readonly upgradingElasticStack: string; }; readonly apm: { readonly kibanaSettings: string; readonly supportedServiceMaps: string; readonly customLinks: string; readonly droppedTransactionSpans: string; readonly upgrading: string; readonly metaData: string; }; readonly canvas: { readonly guide: string; }; readonly dashboard: { readonly guide: string; readonly drilldowns: string; readonly drilldownsTriggerPicker: string; readonly urlDrilldownTemplateSyntax: string; readonly urlDrilldownVariables: string; }; readonly discover: Record; readonly filebeat: { readonly base: string; readonly installation: string; readonly configuration: string; readonly elasticsearchOutput: string; readonly elasticsearchModule: string; readonly startup: string; readonly exportedFields: string; readonly suricataModule: string; readonly zeekModule: string; }; readonly auditbeat: { readonly base: string; readonly auditdModule: string; readonly systemModule: string; }; readonly metricbeat: { readonly base: string; readonly configure: string; readonly httpEndpoint: string; readonly install: string; readonly start: string; }; readonly enterpriseSearch: { readonly base: string; readonly appSearchBase: string; readonly workplaceSearchBase: string; }; readonly heartbeat: { readonly base: string; }; readonly libbeat: { readonly getStarted: string; }; readonly logstash: { readonly base: string; }; readonly functionbeat: { readonly base: string; }; readonly winlogbeat: { readonly base: string; }; readonly aggs: { readonly composite: string; readonly composite_missing_bucket: string; readonly date_histogram: string; readonly date_range: string; readonly date_format_pattern: string; readonly filter: string; readonly filters: string; readonly geohash_grid: string; readonly histogram: string; readonly ip_range: string; readonly range: string; readonly significant_terms: string; readonly terms: string; readonly terms_doc_count_error: string; readonly avg: string; readonly avg_bucket: string; readonly max_bucket: string; readonly min_bucket: string; readonly sum_bucket: string; readonly cardinality: string; readonly count: string; readonly cumulative_sum: string; readonly derivative: string; readonly geo_bounds: string; readonly geo_centroid: string; readonly max: string; readonly median: string; readonly min: string; readonly moving_avg: string; readonly percentile_ranks: string; readonly serial_diff: string; readonly std_dev: string; readonly sum: string; readonly top_hits: string; }; readonly runtimeFields: { readonly overview: string; readonly mapping: string; }; readonly scriptedFields: { readonly scriptFields: string; readonly scriptAggs: string; readonly painless: string; readonly painlessApi: string; readonly painlessLangSpec: string; readonly painlessSyntax: string; readonly painlessWalkthrough: string; readonly luceneExpressions: string; }; readonly search: { readonly sessions: string; readonly sessionLimits: string; }; readonly indexPatterns: { readonly introduction: string; readonly fieldFormattersNumber: string; readonly fieldFormattersString: string; readonly runtimeFields: string; }; readonly addData: string; readonly kibana: string; readonly upgradeAssistant: { readonly overview: string; readonly batchReindex: string; readonly remoteReindex: string; }; readonly rollupJobs: string; readonly elasticsearch: Record; readonly siem: { readonly privileges: string; readonly guide: string; readonly gettingStarted: string; readonly ml: string; readonly ruleChangeLog: string; readonly detectionsReq: string; readonly networkMap: string; readonly troubleshootGaps: string; }; readonly securitySolution: { readonly trustedApps: string; }; readonly query: { readonly eql: string; readonly kueryQuerySyntax: string; readonly luceneQuerySyntax: string; readonly percolate: string; readonly queryDsl: string; }; readonly date: { readonly dateMath: string; readonly dateMathIndexNames: string; }; readonly management: Record; readonly ml: Record; readonly transforms: Record; readonly visualize: Record; readonly apis: Readonly<{ bulkIndexAlias: string; byteSizeUnits: string; createAutoFollowPattern: string; createFollower: string; createIndex: string; createSnapshotLifecyclePolicy: string; createRoleMapping: string; createRoleMappingTemplates: string; createRollupJobsRequest: string; createApiKey: string; createPipeline: string; createTransformRequest: string; cronExpressions: string; executeWatchActionModes: string; indexExists: string; openIndex: string; putComponentTemplate: string; painlessExecute: string; painlessExecuteAPIContexts: string; putComponentTemplateMetadata: string; putSnapshotLifecyclePolicy: string; putIndexTemplateV1: string; putWatch: string; simulatePipeline: string; timeUnits: string; updateTransform: string; }>; readonly observability: Readonly<{ guide: string; infrastructureThreshold: string; logsThreshold: string; metricsThreshold: string; monitorStatus: string; monitorUptime: string; tlsCertificate: string; uptimeDurationAnomaly: string; }>; readonly alerting: Record; readonly maps: Readonly<{ guide: string; importGeospatialPrivileges: string; gdalTutorial: string; }>; readonly monitoring: Record; readonly security: Readonly<{ apiKeyServiceSettings: string; clusterPrivileges: string; elasticsearchSettings: string; elasticsearchEnableSecurity: string; elasticsearchEnableApiKeys: string; indicesPrivileges: string; kibanaTLS: string; kibanaPrivileges: string; mappingRoles: string; mappingRolesFieldRules: string; runAsPrivilege: string; }>; readonly spaces: Readonly<{ kibanaLegacyUrlAliases: string; kibanaDisableLegacyUrlAliasesApi: string; }>; readonly watcher: Record; readonly ccs: Record; readonly plugins: Record; readonly snapshotRestore: Record; readonly ingest: Record; readonly fleet: Readonly<{ datastreamsILM: string; beatsAgentComparison: string; guide: string; fleetServer: string; fleetServerAddFleetServer: string; settings: string; settingsFleetServerHostSettings: string; settingsFleetServerProxySettings: string; troubleshooting: string; elasticAgent: string; datastreams: string; datastreamsNamingScheme: string; installElasticAgent: string; upgradeElasticAgent: string; upgradeElasticAgent712lower: string; learnMoreBlog: string; apiKeysLearnMore: string; onPremRegistry: string; }>; readonly ecs: { readonly guide: string; }; readonly clients: { readonly guide: string; readonly goOverview: string; readonly javaIndex: string; readonly jsIntro: string; readonly netGuide: string; readonly perlGuide: string; readonly phpGuide: string; readonly pythonGuide: string; readonly rubyOverview: string; readonly rustGuide: string; }; readonly endpoints: { readonly troubleshooting: string; }; }" + "{ readonly settings: string; readonly elasticStackGetStarted: string; readonly upgrade: { readonly upgradingElasticStack: string; }; readonly apm: { readonly kibanaSettings: string; readonly supportedServiceMaps: string; readonly customLinks: string; readonly droppedTransactionSpans: string; readonly upgrading: string; readonly metaData: string; }; readonly canvas: { readonly guide: string; }; readonly dashboard: { readonly guide: string; readonly drilldowns: string; readonly drilldownsTriggerPicker: string; readonly urlDrilldownTemplateSyntax: string; readonly urlDrilldownVariables: string; }; readonly discover: Record; readonly filebeat: { readonly base: string; readonly installation: string; readonly configuration: string; readonly elasticsearchOutput: string; readonly elasticsearchModule: string; readonly startup: string; readonly exportedFields: string; readonly suricataModule: string; readonly zeekModule: string; }; readonly auditbeat: { readonly base: string; readonly auditdModule: string; readonly systemModule: string; }; readonly metricbeat: { readonly base: string; readonly configure: string; readonly httpEndpoint: string; readonly install: string; readonly start: string; }; readonly enterpriseSearch: { readonly base: string; readonly appSearchBase: string; readonly workplaceSearchBase: string; }; readonly heartbeat: { readonly base: string; }; readonly libbeat: { readonly getStarted: string; }; readonly logstash: { readonly base: string; }; readonly functionbeat: { readonly base: string; }; readonly winlogbeat: { readonly base: string; }; readonly aggs: { readonly composite: string; readonly composite_missing_bucket: string; readonly date_histogram: string; readonly date_range: string; readonly date_format_pattern: string; readonly filter: string; readonly filters: string; readonly geohash_grid: string; readonly histogram: string; readonly ip_range: string; readonly range: string; readonly significant_terms: string; readonly terms: string; readonly terms_doc_count_error: string; readonly avg: string; readonly avg_bucket: string; readonly max_bucket: string; readonly min_bucket: string; readonly sum_bucket: string; readonly cardinality: string; readonly count: string; readonly cumulative_sum: string; readonly derivative: string; readonly geo_bounds: string; readonly geo_centroid: string; readonly max: string; readonly median: string; readonly min: string; readonly moving_avg: string; readonly percentile_ranks: string; readonly serial_diff: string; readonly std_dev: string; readonly sum: string; readonly top_hits: string; }; readonly runtimeFields: { readonly overview: string; readonly mapping: string; }; readonly scriptedFields: { readonly scriptFields: string; readonly scriptAggs: string; readonly painless: string; readonly painlessApi: string; readonly painlessLangSpec: string; readonly painlessSyntax: string; readonly painlessWalkthrough: string; readonly luceneExpressions: string; }; readonly search: { readonly sessions: string; readonly sessionLimits: string; }; readonly indexPatterns: { readonly introduction: string; readonly fieldFormattersNumber: string; readonly fieldFormattersString: string; readonly runtimeFields: string; }; readonly addData: string; readonly kibana: string; readonly upgradeAssistant: { readonly overview: string; readonly batchReindex: string; readonly remoteReindex: string; }; readonly rollupJobs: string; readonly elasticsearch: Record; readonly siem: { readonly privileges: string; readonly guide: string; readonly gettingStarted: string; readonly ml: string; readonly ruleChangeLog: string; readonly detectionsReq: string; readonly networkMap: string; readonly troubleshootGaps: string; }; readonly securitySolution: { readonly trustedApps: string; }; readonly query: { readonly eql: string; readonly kueryQuerySyntax: string; readonly luceneQuerySyntax: string; readonly percolate: string; readonly queryDsl: string; }; readonly date: { readonly dateMath: string; readonly dateMathIndexNames: string; }; readonly management: Record; readonly ml: Record; readonly transforms: Record; readonly visualize: Record; readonly apis: Readonly<{ bulkIndexAlias: string; byteSizeUnits: string; createAutoFollowPattern: string; createFollower: string; createIndex: string; createSnapshotLifecyclePolicy: string; createRoleMapping: string; createRoleMappingTemplates: string; createRollupJobsRequest: string; createApiKey: string; createPipeline: string; createTransformRequest: string; cronExpressions: string; executeWatchActionModes: string; indexExists: string; openIndex: string; putComponentTemplate: string; painlessExecute: string; painlessExecuteAPIContexts: string; putComponentTemplateMetadata: string; putSnapshotLifecyclePolicy: string; putIndexTemplateV1: string; putWatch: string; simulatePipeline: string; timeUnits: string; updateTransform: string; }>; readonly observability: Readonly<{ guide: string; infrastructureThreshold: string; logsThreshold: string; metricsThreshold: string; monitorStatus: string; monitorUptime: string; tlsCertificate: string; uptimeDurationAnomaly: string; }>; readonly alerting: Record; readonly maps: Readonly<{ guide: string; importGeospatialPrivileges: string; gdalTutorial: string; }>; readonly monitoring: Record; readonly security: Readonly<{ apiKeyServiceSettings: string; clusterPrivileges: string; elasticsearchSettings: string; elasticsearchEnableSecurity: string; elasticsearchEnableApiKeys: string; indicesPrivileges: string; kibanaTLS: string; kibanaPrivileges: string; mappingRoles: string; mappingRolesFieldRules: string; runAsPrivilege: string; }>; readonly spaces: Readonly<{ kibanaLegacyUrlAliases: string; kibanaDisableLegacyUrlAliasesApi: string; }>; readonly watcher: Record; readonly ccs: Record; readonly plugins: Record; readonly snapshotRestore: Record; readonly ingest: Record; readonly fleet: Readonly<{ beatsAgentComparison: string; guide: string; fleetServer: string; fleetServerAddFleetServer: string; settings: string; settingsFleetServerHostSettings: string; settingsFleetServerProxySettings: string; troubleshooting: string; elasticAgent: string; datastreams: string; datastreamsNamingScheme: string; installElasticAgent: string; upgradeElasticAgent: string; upgradeElasticAgent712lower: string; learnMoreBlog: string; apiKeysLearnMore: string; onPremRegistry: string; }>; readonly ecs: { readonly guide: string; }; readonly clients: { readonly guide: string; readonly goOverview: string; readonly javaIndex: string; readonly jsIntro: string; readonly netGuide: string; readonly perlGuide: string; readonly phpGuide: string; readonly pythonGuide: string; readonly rubyOverview: string; readonly rustGuide: string; }; readonly endpoints: { readonly troubleshooting: string; }; }" ], "path": "src/core/public/doc_links/doc_links_service.ts", "deprecated": false @@ -4457,12 +4457,13 @@ { "parentPluginId": "core", "id": "def-public.SavedObjectAttributes.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: SavedObjectAttribute", "description": [], "signature": [ - "any" + "[key: string]: ", + "SavedObjectAttribute" ], "path": "src/core/types/saved_objects.ts", "deprecated": false @@ -5912,12 +5913,12 @@ { "parentPluginId": "core", "id": "def-public.SavedObjectsMigrationVersion.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[pluginName: string]: string", "description": [], "signature": [ - "any" + "[pluginName: string]: string" ], "path": "src/core/types/saved_objects.ts", "deprecated": false @@ -6372,12 +6373,16 @@ { "parentPluginId": "core", "id": "def-public.UiSettingsState.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: Pick, \"name\" | \"type\" | \"description\" | \"options\" | \"order\" | \"value\" | \"category\" | \"optionLabels\" | \"requiresPageReload\" | \"readonly\" | \"sensitive\" | \"deprecation\" | \"metric\"> & UserProvidedValues<...>", "description": [], "signature": [ - "any" + "[key: string]: Pick<", + "UiSettingsParams", + ", \"name\" | \"type\" | \"description\" | \"options\" | \"order\" | \"value\" | \"category\" | \"optionLabels\" | \"requiresPageReload\" | \"readonly\" | \"sensitive\" | \"deprecation\" | \"metric\"> & ", + "UserProvidedValues", + "" ], "path": "src/core/public/ui_settings/types.ts", "deprecated": false @@ -7853,7 +7858,63 @@ "initialIsOpen": false } ], - "functions": [], + "functions": [ + { + "parentPluginId": "core", + "id": "def-server.pollEsNodesVersion", + "type": "Function", + "tags": [], + "label": "pollEsNodesVersion", + "description": [], + "signature": [ + "({ internalClient, log, kibanaVersion, ignoreVersionMismatch, esVersionCheckInterval: healthCheckInterval, }: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.PollEsNodesVersionOptions", + "text": "PollEsNodesVersionOptions" + }, + ") => ", + "Observable", + "<", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.NodesVersionCompatibility", + "text": "NodesVersionCompatibility" + }, + ">" + ], + "path": "src/core/server/elasticsearch/version_check/ensure_es_version.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "core", + "id": "def-server.pollEsNodesVersion.$1", + "type": "Object", + "tags": [], + "label": "{\n internalClient,\n log,\n kibanaVersion,\n ignoreVersionMismatch,\n esVersionCheckInterval: healthCheckInterval,\n}", + "description": [], + "signature": [ + { + "pluginId": "core", + "scope": "server", + "docId": "kibCorePluginApi", + "section": "def-server.PollEsNodesVersionOptions", + "text": "PollEsNodesVersionOptions" + } + ], + "path": "src/core/server/elasticsearch/version_check/ensure_es_version.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], "interfaces": [ { "parentPluginId": "core", @@ -8290,14 +8351,14 @@ { "parentPluginId": "core", "id": "def-server.Capabilities.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: Record>", "description": [ "Custom capabilities, registered by plugins." ], "signature": [ - "any" + "[key: string]: Record>" ], "path": "src/core/types/capabilities.ts", "deprecated": false @@ -15356,6 +15417,89 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "core", + "id": "def-server.PollEsNodesVersionOptions", + "type": "Interface", + "tags": [], + "label": "PollEsNodesVersionOptions", + "description": [], + "path": "src/core/server/elasticsearch/version_check/ensure_es_version.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "core", + "id": "def-server.PollEsNodesVersionOptions.internalClient", + "type": "CompoundType", + "tags": [], + "label": "internalClient", + "description": [], + "signature": [ + "Pick<", + "KibanaClient", + ", \"name\" | \"create\" | \"index\" | \"delete\" | \"get\" | \"update\" | \"closePointInTime\" | \"search\" | \"security\" | \"transform\" | \"eql\" | \"helpers\" | \"asyncSearch\" | \"autoscaling\" | \"bulk\" | \"cat\" | \"ccr\" | \"clearScroll\" | \"cluster\" | \"count\" | \"danglingIndices\" | \"deleteByQuery\" | \"deleteByQueryRethrottle\" | \"deleteScript\" | \"enrich\" | \"exists\" | \"existsSource\" | \"explain\" | \"features\" | \"fieldCaps\" | \"fleet\" | \"getScript\" | \"getScriptContext\" | \"getScriptLanguages\" | \"getSource\" | \"graph\" | \"ilm\" | \"indices\" | \"info\" | \"ingest\" | \"knnSearch\" | \"license\" | \"logstash\" | \"mget\" | \"migration\" | \"ml\" | \"monitoring\" | \"msearch\" | \"msearchTemplate\" | \"mtermvectors\" | \"nodes\" | \"openPointInTime\" | \"ping\" | \"putScript\" | \"rankEval\" | \"reindex\" | \"reindexRethrottle\" | \"renderSearchTemplate\" | \"rollup\" | \"scriptsPainlessExecute\" | \"scroll\" | \"searchMvt\" | \"searchShards\" | \"searchTemplate\" | \"searchableSnapshots\" | \"shutdown\" | \"slm\" | \"snapshot\" | \"sql\" | \"ssl\" | \"tasks\" | \"termsEnum\" | \"termvectors\" | \"textStructure\" | \"updateByQuery\" | \"updateByQueryRethrottle\" | \"watcher\" | \"xpack\"> & { transport: { request(params: ", + "TransportRequestParams", + ", options?: ", + "TransportRequestOptions", + " | undefined): Promise<", + "TransportResult", + ">; }; }" + ], + "path": "src/core/server/elasticsearch/version_check/ensure_es_version.ts", + "deprecated": false + }, + { + "parentPluginId": "core", + "id": "def-server.PollEsNodesVersionOptions.log", + "type": "Object", + "tags": [], + "label": "log", + "description": [], + "signature": [ + { + "pluginId": "@kbn/logging", + "scope": "server", + "docId": "kibKbnLoggingPluginApi", + "section": "def-server.Logger", + "text": "Logger" + } + ], + "path": "src/core/server/elasticsearch/version_check/ensure_es_version.ts", + "deprecated": false + }, + { + "parentPluginId": "core", + "id": "def-server.PollEsNodesVersionOptions.kibanaVersion", + "type": "string", + "tags": [], + "label": "kibanaVersion", + "description": [], + "path": "src/core/server/elasticsearch/version_check/ensure_es_version.ts", + "deprecated": false + }, + { + "parentPluginId": "core", + "id": "def-server.PollEsNodesVersionOptions.ignoreVersionMismatch", + "type": "boolean", + "tags": [], + "label": "ignoreVersionMismatch", + "description": [], + "path": "src/core/server/elasticsearch/version_check/ensure_es_version.ts", + "deprecated": false + }, + { + "parentPluginId": "core", + "id": "def-server.PollEsNodesVersionOptions.esVersionCheckInterval", + "type": "number", + "tags": [], + "label": "esVersionCheckInterval", + "description": [], + "path": "src/core/server/elasticsearch/version_check/ensure_es_version.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "core", "id": "def-server.PrebootPlugin", @@ -15944,12 +16088,13 @@ { "parentPluginId": "core", "id": "def-server.SavedObjectAttributes.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: SavedObjectAttribute", "description": [], "signature": [ - "any" + "[key: string]: ", + "SavedObjectAttribute" ], "path": "src/core/types/saved_objects.ts", "deprecated": false @@ -16017,12 +16162,12 @@ { "parentPluginId": "core", "id": "def-server.SavedObjectsMigrationVersion.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[pluginName: string]: string", "description": [], "signature": [ - "any" + "[pluginName: string]: string" ], "path": "src/core/types/saved_objects.ts", "deprecated": false diff --git a/api_docs/core.mdx b/api_docs/core.mdx index 4a7d32ebae214..957518c3b7173 100644 --- a/api_docs/core.mdx +++ b/api_docs/core.mdx @@ -18,7 +18,7 @@ Contact [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) for que | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 2318 | 26 | 1031 | 29 | +| 2326 | 15 | 1039 | 30 | ## Client @@ -36,6 +36,9 @@ Contact [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) for que ### Objects +### Functions + + ### Classes diff --git a/api_docs/core_application.mdx b/api_docs/core_application.mdx index b1d9899d5e445..6280d39c2cecd 100644 --- a/api_docs/core_application.mdx +++ b/api_docs/core_application.mdx @@ -18,7 +18,7 @@ Contact [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) for que | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 2318 | 26 | 1031 | 29 | +| 2326 | 15 | 1039 | 30 | ## Client diff --git a/api_docs/core_chrome.mdx b/api_docs/core_chrome.mdx index 60c48cfe97a7d..75751577d7011 100644 --- a/api_docs/core_chrome.mdx +++ b/api_docs/core_chrome.mdx @@ -18,7 +18,7 @@ Contact [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) for que | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 2318 | 26 | 1031 | 29 | +| 2326 | 15 | 1039 | 30 | ## Client diff --git a/api_docs/core_http.json b/api_docs/core_http.json index ac4ba937d9eaa..66b32fe774732 100644 --- a/api_docs/core_http.json +++ b/api_docs/core_http.json @@ -194,14 +194,14 @@ { "parentPluginId": "core", "id": "def-public.HttpFetchQuery.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: string | number | boolean | string[] | number[] | boolean[] | null | undefined", "description": [ "\nTypeScript note: Technically we should use this interface instead, but @types/node uses the below stricter\ndefinition, so to avoid TypeScript errors, we'll restrict our version.\n\n[key: string]:\n | string\n | number\n | boolean\n | Array\n | undefined\n | null;" ], "signature": [ - "any" + "[key: string]: string | number | boolean | string[] | number[] | boolean[] | null | undefined" ], "path": "src/core/public/http/types.ts", "deprecated": false @@ -291,12 +291,12 @@ { "parentPluginId": "core", "id": "def-public.HttpHeadersInit.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[name: string]: any", "description": [], "signature": [ - "any" + "[name: string]: any" ], "path": "src/core/public/http/types.ts", "deprecated": false diff --git a/api_docs/core_http.mdx b/api_docs/core_http.mdx index a7b9c1aeaa2d8..8243172a2e0f9 100644 --- a/api_docs/core_http.mdx +++ b/api_docs/core_http.mdx @@ -18,7 +18,7 @@ Contact [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) for que | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 2318 | 26 | 1031 | 29 | +| 2326 | 15 | 1039 | 30 | ## Client diff --git a/api_docs/core_saved_objects.json b/api_docs/core_saved_objects.json index 47e18a54bf5d0..a79e3d22bb7e6 100644 --- a/api_docs/core_saved_objects.json +++ b/api_docs/core_saved_objects.json @@ -9732,12 +9732,20 @@ { "parentPluginId": "core", "id": "def-server.SavedObjectMigrationMap.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[version: string]: SavedObjectMigrationFn", "description": [], "signature": [ - "any" + "[version: string]: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectMigrationFn", + "text": "SavedObjectMigrationFn" + }, + "" ], "path": "src/core/server/saved_objects/migrations/types.ts", "deprecated": false @@ -13249,12 +13257,19 @@ { "parentPluginId": "core", "id": "def-server.SavedObjectsMappingProperties.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[field: string]: SavedObjectsFieldMapping", "description": [], "signature": [ - "any" + "[field: string]: ", + { + "pluginId": "core", + "scope": "server", + "docId": "kibCoreSavedObjectsPluginApi", + "section": "def-server.SavedObjectsFieldMapping", + "text": "SavedObjectsFieldMapping" + } ], "path": "src/core/server/saved_objects/mappings/types.ts", "deprecated": false diff --git a/api_docs/core_saved_objects.mdx b/api_docs/core_saved_objects.mdx index f23c59ee296b9..9caa4135dc40c 100644 --- a/api_docs/core_saved_objects.mdx +++ b/api_docs/core_saved_objects.mdx @@ -18,7 +18,7 @@ Contact [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) for que | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 2318 | 26 | 1031 | 29 | +| 2326 | 15 | 1039 | 30 | ## Client diff --git a/api_docs/custom_integrations.mdx b/api_docs/custom_integrations.mdx index 2062d5b87232d..75377c39d7fe4 100644 --- a/api_docs/custom_integrations.mdx +++ b/api_docs/custom_integrations.mdx @@ -18,7 +18,7 @@ Contact [Fleet](https://github.com/orgs/elastic/teams/fleet) for questions regar | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 96 | 1 | 80 | 1 | +| 96 | 0 | 80 | 1 | ## Client diff --git a/api_docs/dashboard.json b/api_docs/dashboard.json index aa91ffaf0faeb..f423ae8824c93 100644 --- a/api_docs/dashboard.json +++ b/api_docs/dashboard.json @@ -738,6 +738,113 @@ "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", "deprecated": false }, + { + "parentPluginId": "dashboard", + "id": "def-public.DashboardContainerFactoryDefinition.inject", + "type": "Function", + "tags": [], + "label": "inject", + "description": [], + "signature": [ + "(state: ", + { + "pluginId": "embeddable", + "scope": "common", + "docId": "kibEmbeddablePluginApi", + "section": "def-common.EmbeddableStateWithType", + "text": "EmbeddableStateWithType" + }, + ", references: ", + "SavedObjectReference", + "[]) => ", + { + "pluginId": "embeddable", + "scope": "common", + "docId": "kibEmbeddablePluginApi", + "section": "def-common.EmbeddableStateWithType", + "text": "EmbeddableStateWithType" + } + ], + "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "dashboard", + "id": "def-public.DashboardContainerFactoryDefinition.inject.$1", + "type": "Uncategorized", + "tags": [], + "label": "state", + "description": [], + "signature": [ + "P" + ], + "path": "src/plugins/kibana_utils/common/persistable_state/types.ts", + "deprecated": false + }, + { + "parentPluginId": "dashboard", + "id": "def-public.DashboardContainerFactoryDefinition.inject.$2", + "type": "Array", + "tags": [], + "label": "references", + "description": [], + "signature": [ + "SavedObjectReference", + "[]" + ], + "path": "src/plugins/kibana_utils/common/persistable_state/types.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "dashboard", + "id": "def-public.DashboardContainerFactoryDefinition.extract", + "type": "Function", + "tags": [], + "label": "extract", + "description": [], + "signature": [ + "(state: ", + { + "pluginId": "embeddable", + "scope": "common", + "docId": "kibEmbeddablePluginApi", + "section": "def-common.EmbeddableStateWithType", + "text": "EmbeddableStateWithType" + }, + ") => { state: ", + { + "pluginId": "embeddable", + "scope": "common", + "docId": "kibEmbeddablePluginApi", + "section": "def-common.EmbeddableStateWithType", + "text": "EmbeddableStateWithType" + }, + "; references: ", + "SavedObjectReference", + "[]; }" + ], + "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "dashboard", + "id": "def-public.DashboardContainerFactoryDefinition.extract.$1", + "type": "Uncategorized", + "tags": [], + "label": "state", + "description": [], + "signature": [ + "P" + ], + "path": "src/plugins/kibana_utils/common/persistable_state/types.ts", + "deprecated": false + } + ] + }, { "parentPluginId": "dashboard", "id": "def-public.DashboardContainerFactoryDefinition.Unnamed", @@ -963,113 +1070,6 @@ } ], "returnComment": [] - }, - { - "parentPluginId": "dashboard", - "id": "def-public.DashboardContainerFactoryDefinition.inject", - "type": "Function", - "tags": [], - "label": "inject", - "description": [], - "signature": [ - "(state: ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableStateWithType", - "text": "EmbeddableStateWithType" - }, - ", references: ", - "SavedObjectReference", - "[]) => ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableStateWithType", - "text": "EmbeddableStateWithType" - } - ], - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "dashboard", - "id": "def-public.DashboardContainerFactoryDefinition.inject.$1", - "type": "Uncategorized", - "tags": [], - "label": "state", - "description": [], - "signature": [ - "P" - ], - "path": "src/plugins/kibana_utils/common/persistable_state/types.ts", - "deprecated": false - }, - { - "parentPluginId": "dashboard", - "id": "def-public.DashboardContainerFactoryDefinition.inject.$2", - "type": "Array", - "tags": [], - "label": "references", - "description": [], - "signature": [ - "SavedObjectReference", - "[]" - ], - "path": "src/plugins/kibana_utils/common/persistable_state/types.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "dashboard", - "id": "def-public.DashboardContainerFactoryDefinition.extract", - "type": "Function", - "tags": [], - "label": "extract", - "description": [], - "signature": [ - "(state: ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableStateWithType", - "text": "EmbeddableStateWithType" - }, - ") => { state: ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableStateWithType", - "text": "EmbeddableStateWithType" - }, - "; references: ", - "SavedObjectReference", - "[]; }" - ], - "path": "src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "dashboard", - "id": "def-public.DashboardContainerFactoryDefinition.extract.$1", - "type": "Uncategorized", - "tags": [], - "label": "state", - "description": [], - "signature": [ - "P" - ], - "path": "src/plugins/kibana_utils/common/persistable_state/types.ts", - "deprecated": false - } - ] } ], "initialIsOpen": false @@ -2870,12 +2870,19 @@ { "parentPluginId": "dashboard", "id": "def-common.migratePanelsTo730.$4.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: SerializableRecord", "description": [], "signature": [ - "any" + "[key: string]: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.SerializableRecord", + "text": "SerializableRecord" + } ], "path": "src/plugins/dashboard/common/migrate_to_730_panels.ts", "deprecated": false diff --git a/api_docs/dashboard.mdx b/api_docs/dashboard.mdx index 26b6125601aae..26e4609765aaf 100644 --- a/api_docs/dashboard.mdx +++ b/api_docs/dashboard.mdx @@ -18,7 +18,7 @@ Contact [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-prese | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 153 | 1 | 140 | 12 | +| 153 | 0 | 140 | 12 | ## Client diff --git a/api_docs/data.json b/api_docs/data.json index 3fc551003c1d8..343f61fe670c9 100644 --- a/api_docs/data.json +++ b/api_docs/data.json @@ -2930,11 +2930,11 @@ }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx" + "path": "src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx" + "path": "src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx" }, { "plugin": "discover", @@ -3693,72 +3693,12 @@ "path": "src/plugins/discover/public/services/doc_views/doc_views_types.ts" }, { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/shared_imports.ts" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx" }, { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_context.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_context.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/lib/remove_fields.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/lib/remove_fields.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/delete_field_provider.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/delete_field_provider.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx" }, { "plugin": "discover", @@ -4092,22 +4032,6 @@ "plugin": "observability", "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/components/filter_label.tsx" }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, { "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" @@ -4156,6 +4080,22 @@ "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/sources/es_agg_source/es_agg_source.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" @@ -4685,176 +4625,168 @@ "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/common.test.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/shared_imports.ts" - }, - { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/open_editor.tsx" - }, - { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/open_editor.tsx" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/shared_imports.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/types.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/open_editor.tsx" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/types.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/open_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/breadcrumbs.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/breadcrumbs.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/breadcrumbs.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/breadcrumbs.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/tabs.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/tabs.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/components/scripting_help/test_script.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/components/scripting_help/test_script.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/help_flyout.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/components/scripting_help/help_flyout.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/help_flyout.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/components/scripting_help/help_flyout.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" }, { "plugin": "inputControlVis", @@ -5069,20 +5001,12 @@ "path": "src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/target/types/public/types.d.ts" - }, - { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/target/types/public/types.d.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts" }, { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts" }, { "plugin": "inputControlVis", @@ -5117,44 +5041,44 @@ "path": "src/plugins/vis_default_editor/target/types/public/components/utils/editor_config.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/anchor.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.test.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/anchor.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.test.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/target/types/public/application/doc/components/doc.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/target/types/public/application/doc/components/doc.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/context/services/anchor.test.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/context/services/anchor.test.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/doc/components/doc.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/doc/components/doc.d.ts" }, { "plugin": "inputControlVis", @@ -5233,20 +5157,20 @@ "path": "src/plugins/discover/target/types/public/application/main/utils/nested_fields.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/target/types/public/application/main/components/sidebar/discover_index_pattern.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/edit_index_pattern/source_filters_table/components/table/table.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/target/types/public/application/main/components/sidebar/discover_index_pattern.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/edit_index_pattern/source_filters_table/components/table/table.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/source_filters_table/components/table/table.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/main/components/sidebar/discover_index_pattern.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/source_filters_table/components/table/table.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/main/components/sidebar/discover_index_pattern.d.ts" }, { "plugin": "visTypeTimeseries", @@ -5339,15 +5263,15 @@ }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx" + "path": "src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx" + "path": "src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx" + "path": "src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx" }, { "plugin": "discover", @@ -5597,42 +5521,6 @@ "plugin": "dataViews", "path": "src/plugins/data_views/public/index.ts" }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/shared_imports.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" - }, { "plugin": "discover", "path": "src/plugins/discover/public/components/field_name/field_name.tsx" @@ -5863,19 +5751,19 @@ }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" }, { "plugin": "maps", @@ -5915,19 +5803,19 @@ }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { "plugin": "maps", @@ -5975,31 +5863,31 @@ }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" + "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" + "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" + "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" }, { "plugin": "maps", @@ -6402,112 +6290,112 @@ "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.d.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/shared_imports.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/shared_imports.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/lib/extract_time_fields.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/lib/extract_time_fields.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/types.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/types.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/tabs.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/tabs.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/tabs.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" }, { "plugin": "inputControlVis", @@ -6630,16 +6518,16 @@ "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/lib/extract_time_fields.test.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/lib/extract_time_fields.test.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/lib/extract_time_fields.test.ts" }, { "plugin": "visDefaultEditor", @@ -6650,12 +6538,12 @@ "path": "src/plugins/vis_default_editor/target/types/public/components/agg_param_props.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.test.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.test.ts" }, { "plugin": "visDefaultEditor", @@ -8004,12 +7892,12 @@ "removeBy": "8.1", "references": [ { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx" }, { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx" } ], "returnComment": [], @@ -8204,12 +8092,12 @@ "removeBy": "8.1", "references": [ { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/constants/index.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/constants/index.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/constants/index.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/constants/index.ts" } ], "returnComment": [], @@ -12290,20 +12178,20 @@ "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/metric_control/index.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { "plugin": "stackAlerts", @@ -12740,36 +12628,36 @@ "path": "x-pack/plugins/monitoring/target/types/public/alerts/components/param_details_form/use_derived_index_pattern.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/index_header/index_header.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/index_header/index_header.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts" }, { "plugin": "stackAlerts", @@ -15314,27 +15202,27 @@ }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/selectors/map_selectors.ts" + "path": "x-pack/plugins/maps/public/classes/tooltips/join_tooltip_property.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/selectors/map_selectors.ts" + "path": "x-pack/plugins/maps/public/classes/tooltips/join_tooltip_property.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/actions/map_actions.ts" + "path": "x-pack/plugins/maps/public/selectors/map_selectors.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/actions/map_actions.ts" + "path": "x-pack/plugins/maps/public/selectors/map_selectors.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/join_tooltip_property.tsx" + "path": "x-pack/plugins/maps/public/actions/map_actions.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/join_tooltip_property.tsx" + "path": "x-pack/plugins/maps/public/actions/map_actions.ts" }, { "plugin": "maps", @@ -16445,36 +16333,36 @@ "path": "src/plugins/data_views/common/index.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" } ], "initialIsOpen": false @@ -16986,12 +16874,12 @@ "path": "x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { "plugin": "inputControlVis", @@ -17026,12 +16914,12 @@ "path": "src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.test.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.test.ts" }, { "plugin": "visTypeTimelion", @@ -17098,12 +16986,12 @@ "path": "src/plugins/vis_types/timelion/public/components/timelion_expression_input_helpers.test.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" } ], "initialIsOpen": false @@ -17150,28 +17038,28 @@ "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/shared_imports.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/shared_imports.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/components/index_pattern_editor_flyout_content.tsx" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/components/data_view_editor_flyout_content.tsx" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/components/index_pattern_editor_flyout_content.tsx" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/components/data_view_editor_flyout_content.tsx" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/components/index_pattern_editor_flyout_content.tsx" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/components/data_view_editor_flyout_content.tsx" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/components/index_pattern_flyout_content_container.tsx" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/components/data_view_flyout_content_container.tsx" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/components/index_pattern_flyout_content_container.tsx" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/components/data_view_flyout_content_container.tsx" } ], "initialIsOpen": false @@ -20850,16 +20738,16 @@ "path": "x-pack/plugins/transform/public/app/hooks/use_search_items/common.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/components/scripting_help/test_script.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/components/scripting_help/test_script.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/components/scripting_help/test_script.tsx" }, { "plugin": "visTypeTimelion", @@ -23269,14 +23157,6 @@ "plugin": "fleet", "path": "x-pack/plugins/fleet/public/applications/fleet/components/search_bar.tsx" }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/plugin.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/plugin.ts" - }, { "plugin": "discover", "path": "src/plugins/discover/public/build_services.ts" @@ -23534,48 +23414,40 @@ "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.test.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/plugin.tsx" - }, - { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/plugin.tsx" - }, - { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/tabs.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" }, { "plugin": "inputControlVis", @@ -23649,10 +23521,6 @@ "plugin": "visTypeVega", "path": "src/plugins/vis_types/vega/public/data_model/search_api.ts" }, - { - "plugin": "visTypeVega", - "path": "src/plugins/vis_types/vega/public/vega_request_handler.ts" - }, { "plugin": "visTypeVega", "path": "src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts" @@ -23748,28 +23616,20 @@ "path": "x-pack/plugins/fleet/public/applications/fleet/sections/data_stream/list_page/index.tsx" }, { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_context.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/public/components/field_editor_context.tsx" }, { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx" }, { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx" }, { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/plugin.ts" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/public/components/field_editor_flyout_content_container.tsx" }, { "plugin": "discover", @@ -23804,28 +23664,28 @@ "path": "x-pack/plugins/ml/target/types/public/application/util/dependency_cache.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { "plugin": "visTypePie", @@ -23880,16 +23740,16 @@ "path": "src/plugins/vis_types/vislib/public/plugin.ts" }, { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts" }, { "plugin": "visTypePie", "path": "src/plugins/vis_types/pie/public/utils/get_layers.test.ts" }, { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/__jest__/client_integration/helpers/setup_environment.tsx" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/__jest__/client_integration/helpers/setup_environment.tsx" }, { "plugin": "visTypePie", @@ -24843,7 +24703,6 @@ ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": true, - "removeBy": "8.1", "references": [ { "plugin": "dataViews", @@ -24924,15 +24783,14 @@ ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": true, - "removeBy": "8.1", "references": [ { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { "plugin": "dataViews", @@ -24981,7 +24839,6 @@ ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": true, - "removeBy": "8.1", "references": [ { "plugin": "visTypeTimeseries", @@ -25004,20 +24861,20 @@ "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { "plugin": "dataViews", @@ -25055,7 +24912,6 @@ ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": true, - "removeBy": "8.1", "references": [ { "plugin": "dataViews", @@ -25078,8 +24934,8 @@ "path": "src/plugins/data_views/server/register_index_pattern_usage_collection.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" }, { "plugin": "dataViews", @@ -25117,7 +24973,14 @@ "label": "isTimeBased", "description": [], "signature": [ - "() => boolean" + "() => this is ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.TimeBasedDataView", + "text": "TimeBasedDataView" + } ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false, @@ -25132,7 +24995,14 @@ "label": "isTimeNanosBased", "description": [], "signature": [ - "() => boolean" + "() => this is ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.TimeBasedDataView", + "text": "TimeBasedDataView" + } ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false, @@ -26042,11 +25912,11 @@ }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx" + "path": "src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx" + "path": "src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx" }, { "plugin": "discover", @@ -26805,72 +26675,12 @@ "path": "src/plugins/discover/public/services/doc_views/doc_views_types.ts" }, { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/shared_imports.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_context.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_context.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/lib/remove_fields.ts" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx" }, { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/lib/remove_fields.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/delete_field_provider.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/delete_field_provider.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx" }, { "plugin": "discover", @@ -27204,22 +27014,6 @@ "plugin": "observability", "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/components/filter_label.tsx" }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, { "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" @@ -27268,6 +27062,22 @@ "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/sources/es_agg_source/es_agg_source.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" @@ -27797,176 +27607,168 @@ "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/common.test.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/shared_imports.ts" - }, - { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/open_editor.tsx" - }, - { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/open_editor.tsx" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/shared_imports.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/types.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/open_editor.tsx" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/types.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/open_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/breadcrumbs.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/breadcrumbs.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/breadcrumbs.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/breadcrumbs.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/tabs.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/tabs.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/components/scripting_help/test_script.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/components/scripting_help/test_script.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/help_flyout.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/components/scripting_help/help_flyout.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/help_flyout.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/components/scripting_help/help_flyout.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" }, { "plugin": "inputControlVis", @@ -28181,20 +27983,12 @@ "path": "src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/target/types/public/types.d.ts" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/target/types/public/types.d.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts" }, { "plugin": "inputControlVis", @@ -28229,44 +28023,44 @@ "path": "src/plugins/vis_default_editor/target/types/public/components/utils/editor_config.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/anchor.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.test.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/anchor.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.test.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/target/types/public/application/doc/components/doc.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/target/types/public/application/doc/components/doc.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/context/services/anchor.test.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/context/services/anchor.test.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/doc/components/doc.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/doc/components/doc.d.ts" }, { "plugin": "inputControlVis", @@ -28345,20 +28139,20 @@ "path": "src/plugins/discover/target/types/public/application/main/utils/nested_fields.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/target/types/public/application/main/components/sidebar/discover_index_pattern.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/edit_index_pattern/source_filters_table/components/table/table.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/target/types/public/application/main/components/sidebar/discover_index_pattern.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/edit_index_pattern/source_filters_table/components/table/table.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/source_filters_table/components/table/table.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/main/components/sidebar/discover_index_pattern.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/source_filters_table/components/table/table.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/main/components/sidebar/discover_index_pattern.d.ts" }, { "plugin": "visTypeTimeseries", @@ -28451,15 +28245,15 @@ }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx" + "path": "src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx" + "path": "src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx" + "path": "src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx" }, { "plugin": "discover", @@ -28709,42 +28503,6 @@ "plugin": "dataViews", "path": "src/plugins/data_views/public/index.ts" }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/shared_imports.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" - }, { "plugin": "discover", "path": "src/plugins/discover/public/components/field_name/field_name.tsx" @@ -28975,19 +28733,19 @@ }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" }, { "plugin": "maps", @@ -29027,19 +28785,19 @@ }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { "plugin": "maps", @@ -29087,31 +28845,31 @@ }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" + "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" + "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" + "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" }, { "plugin": "maps", @@ -29514,112 +29272,112 @@ "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.d.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/shared_imports.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/shared_imports.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/lib/extract_time_fields.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/lib/extract_time_fields.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/types.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/types.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/tabs.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/tabs.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/tabs.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" }, { "plugin": "inputControlVis", @@ -29742,16 +29500,16 @@ "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/lib/extract_time_fields.test.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/lib/extract_time_fields.test.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/lib/extract_time_fields.test.ts" }, { "plugin": "visDefaultEditor", @@ -29762,12 +29520,12 @@ "path": "src/plugins/vis_default_editor/target/types/public/components/agg_param_props.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.test.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.test.ts" }, { "plugin": "visDefaultEditor", @@ -30617,12 +30375,12 @@ "removeBy": "8.1", "references": [ { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx" }, { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx" } ], "returnComment": [], @@ -31470,20 +31228,20 @@ "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/metric_control/index.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { "plugin": "stackAlerts", @@ -32456,27 +32214,27 @@ }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/selectors/map_selectors.ts" + "path": "x-pack/plugins/maps/public/classes/tooltips/join_tooltip_property.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/selectors/map_selectors.ts" + "path": "x-pack/plugins/maps/public/classes/tooltips/join_tooltip_property.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/actions/map_actions.ts" + "path": "x-pack/plugins/maps/public/selectors/map_selectors.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/actions/map_actions.ts" + "path": "x-pack/plugins/maps/public/selectors/map_selectors.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/join_tooltip_property.tsx" + "path": "x-pack/plugins/maps/public/actions/map_actions.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/join_tooltip_property.tsx" + "path": "x-pack/plugins/maps/public/actions/map_actions.ts" }, { "plugin": "maps", @@ -35814,7 +35572,6 @@ ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": true, - "removeBy": "8.1", "references": [ { "plugin": "dataViews", @@ -35895,15 +35652,14 @@ ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": true, - "removeBy": "8.1", "references": [ { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { "plugin": "dataViews", @@ -35952,7 +35708,6 @@ ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": true, - "removeBy": "8.1", "references": [ { "plugin": "visTypeTimeseries", @@ -35975,20 +35730,20 @@ "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { "plugin": "dataViews", @@ -36026,7 +35781,6 @@ ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": true, - "removeBy": "8.1", "references": [ { "plugin": "dataViews", @@ -36049,8 +35803,8 @@ "path": "src/plugins/data_views/server/register_index_pattern_usage_collection.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" }, { "plugin": "dataViews", @@ -36088,7 +35842,14 @@ "label": "isTimeBased", "description": [], "signature": [ - "() => boolean" + "() => this is ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.TimeBasedDataView", + "text": "TimeBasedDataView" + } ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false, @@ -36103,7 +35864,14 @@ "label": "isTimeNanosBased", "description": [], "signature": [ - "() => boolean" + "() => this is ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.TimeBasedDataView", + "text": "TimeBasedDataView" + } ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false, @@ -38892,11 +38660,11 @@ }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx" + "path": "src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx" + "path": "src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx" }, { "plugin": "discover", @@ -39655,72 +39423,12 @@ "path": "src/plugins/discover/public/services/doc_views/doc_views_types.ts" }, { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/shared_imports.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_context.tsx" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx" }, { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_context.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/lib/remove_fields.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/lib/remove_fields.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/delete_field_provider.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/delete_field_provider.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx" }, { "plugin": "discover", @@ -40054,22 +39762,6 @@ "plugin": "observability", "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/components/filter_label.tsx" }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, { "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" @@ -40118,6 +39810,22 @@ "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/sources/es_agg_source/es_agg_source.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" @@ -40647,176 +40355,168 @@ "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/common.test.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/shared_imports.ts" - }, - { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/open_editor.tsx" - }, - { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/open_editor.tsx" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/shared_imports.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/types.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/open_editor.tsx" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/types.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/open_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/breadcrumbs.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/breadcrumbs.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/breadcrumbs.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/breadcrumbs.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/tabs.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/tabs.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/components/scripting_help/test_script.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/components/scripting_help/test_script.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/help_flyout.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/components/scripting_help/help_flyout.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/help_flyout.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/components/scripting_help/help_flyout.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" }, { "plugin": "inputControlVis", @@ -41031,20 +40731,12 @@ "path": "src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/target/types/public/types.d.ts" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/target/types/public/types.d.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts" }, { "plugin": "inputControlVis", @@ -41079,44 +40771,44 @@ "path": "src/plugins/vis_default_editor/target/types/public/components/utils/editor_config.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/anchor.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.test.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/anchor.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.test.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/target/types/public/application/doc/components/doc.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/target/types/public/application/doc/components/doc.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/context/services/anchor.test.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/context/services/anchor.test.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/doc/components/doc.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/doc/components/doc.d.ts" }, { "plugin": "inputControlVis", @@ -41195,20 +40887,20 @@ "path": "src/plugins/discover/target/types/public/application/main/utils/nested_fields.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/target/types/public/application/main/components/sidebar/discover_index_pattern.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/edit_index_pattern/source_filters_table/components/table/table.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/target/types/public/application/main/components/sidebar/discover_index_pattern.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/edit_index_pattern/source_filters_table/components/table/table.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/source_filters_table/components/table/table.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/main/components/sidebar/discover_index_pattern.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/source_filters_table/components/table/table.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/main/components/sidebar/discover_index_pattern.d.ts" }, { "plugin": "visTypeTimeseries", @@ -41301,15 +40993,15 @@ }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx" + "path": "src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx" + "path": "src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx" + "path": "src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx" }, { "plugin": "discover", @@ -41559,42 +41251,6 @@ "plugin": "dataViews", "path": "src/plugins/data_views/public/index.ts" }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/shared_imports.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" - }, { "plugin": "discover", "path": "src/plugins/discover/public/components/field_name/field_name.tsx" @@ -41825,19 +41481,19 @@ }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" }, { "plugin": "maps", @@ -41877,19 +41533,19 @@ }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { "plugin": "maps", @@ -41937,31 +41593,31 @@ }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" + "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" + "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" + "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" }, { "plugin": "maps", @@ -42364,112 +42020,112 @@ "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.d.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/shared_imports.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/shared_imports.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/lib/extract_time_fields.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/lib/extract_time_fields.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/types.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/types.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/tabs.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/tabs.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/tabs.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" }, { "plugin": "inputControlVis", @@ -42592,16 +42248,16 @@ "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/lib/extract_time_fields.test.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/lib/extract_time_fields.test.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/lib/extract_time_fields.test.ts" }, { "plugin": "visDefaultEditor", @@ -42612,12 +42268,12 @@ "path": "src/plugins/vis_default_editor/target/types/public/components/agg_param_props.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.test.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.test.ts" }, { "plugin": "visDefaultEditor", @@ -44185,12 +43841,12 @@ "removeBy": "8.1", "references": [ { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx" }, { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx" } ], "returnComment": [], @@ -45166,12 +44822,12 @@ "removeBy": "8.1", "references": [ { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/constants/index.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/constants/index.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/constants/index.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/constants/index.ts" } ], "returnComment": [], @@ -47098,12 +46754,19 @@ { "parentPluginId": "data", "id": "def-common.FieldAttrs.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: FieldAttrSet", "description": [], "signature": [ - "any" + "[key: string]: ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.FieldAttrSet", + "text": "FieldAttrSet" + } ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false @@ -48292,20 +47955,20 @@ "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/metric_control/index.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { "plugin": "stackAlerts", @@ -48742,36 +48405,36 @@ "path": "x-pack/plugins/monitoring/target/types/public/alerts/components/param_details_form/use_derived_index_pattern.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/index_header/index_header.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/index_header/index_header.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts" }, { "plugin": "stackAlerts", @@ -51225,27 +50888,27 @@ }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/selectors/map_selectors.ts" + "path": "x-pack/plugins/maps/public/classes/tooltips/join_tooltip_property.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/selectors/map_selectors.ts" + "path": "x-pack/plugins/maps/public/classes/tooltips/join_tooltip_property.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/actions/map_actions.ts" + "path": "x-pack/plugins/maps/public/selectors/map_selectors.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/actions/map_actions.ts" + "path": "x-pack/plugins/maps/public/selectors/map_selectors.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/join_tooltip_property.tsx" + "path": "x-pack/plugins/maps/public/actions/map_actions.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/join_tooltip_property.tsx" + "path": "x-pack/plugins/maps/public/actions/map_actions.ts" }, { "plugin": "maps", @@ -52420,36 +52083,36 @@ "path": "src/plugins/data_views/common/index.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" } ], "initialIsOpen": false @@ -52961,12 +52624,12 @@ "path": "x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { "plugin": "inputControlVis", @@ -53001,12 +52664,12 @@ "path": "src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.test.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.test.ts" }, { "plugin": "visTypeTimelion", @@ -53073,12 +52736,12 @@ "path": "src/plugins/vis_types/timelion/public/components/timelion_expression_input_helpers.test.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" } ], "initialIsOpen": false @@ -53125,28 +52788,28 @@ "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/shared_imports.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/shared_imports.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/components/index_pattern_editor_flyout_content.tsx" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/components/data_view_editor_flyout_content.tsx" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/components/index_pattern_editor_flyout_content.tsx" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/components/data_view_editor_flyout_content.tsx" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/components/index_pattern_editor_flyout_content.tsx" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/components/data_view_editor_flyout_content.tsx" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/components/index_pattern_flyout_content_container.tsx" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/components/data_view_flyout_content_container.tsx" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/components/index_pattern_flyout_content_container.tsx" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/components/data_view_flyout_content_container.tsx" } ], "initialIsOpen": false diff --git a/api_docs/data.mdx b/api_docs/data.mdx index e464b55190043..788e7a53c2d2d 100644 --- a/api_docs/data.mdx +++ b/api_docs/data.mdx @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3245 | 40 | 2853 | 48 | +| 3245 | 39 | 2853 | 48 | ## Client diff --git a/api_docs/data_autocomplete.mdx b/api_docs/data_autocomplete.mdx index fbb865d4c3f8f..6e9dde9192a2b 100644 --- a/api_docs/data_autocomplete.mdx +++ b/api_docs/data_autocomplete.mdx @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3245 | 40 | 2853 | 48 | +| 3245 | 39 | 2853 | 48 | ## Client diff --git a/api_docs/data_query.mdx b/api_docs/data_query.mdx index 78567a5cebb24..be6aa6914281b 100644 --- a/api_docs/data_query.mdx +++ b/api_docs/data_query.mdx @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3245 | 40 | 2853 | 48 | +| 3245 | 39 | 2853 | 48 | ## Client diff --git a/api_docs/data_search.mdx b/api_docs/data_search.mdx index 0e9cacaae2723..9035c7cb63319 100644 --- a/api_docs/data_search.mdx +++ b/api_docs/data_search.mdx @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3245 | 40 | 2853 | 48 | +| 3245 | 39 | 2853 | 48 | ## Client diff --git a/api_docs/data_ui.mdx b/api_docs/data_ui.mdx index 3be20731ae26c..f1324865005d2 100644 --- a/api_docs/data_ui.mdx +++ b/api_docs/data_ui.mdx @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3245 | 40 | 2853 | 48 | +| 3245 | 39 | 2853 | 48 | ## Client diff --git a/api_docs/index_pattern_editor.json b/api_docs/data_view_editor.json similarity index 64% rename from api_docs/index_pattern_editor.json rename to api_docs/data_view_editor.json index dd20a2907338f..fd2a8166663dd 100644 --- a/api_docs/index_pattern_editor.json +++ b/api_docs/data_view_editor.json @@ -1,22 +1,22 @@ { - "id": "indexPatternEditor", + "id": "dataViewEditor", "client": { "classes": [], "functions": [], "interfaces": [ { - "parentPluginId": "indexPatternEditor", - "id": "def-public.IndexPatternEditorProps", + "parentPluginId": "dataViewEditor", + "id": "def-public.DataViewEditorProps", "type": "Interface", "tags": [], - "label": "IndexPatternEditorProps", + "label": "DataViewEditorProps", "description": [], - "path": "src/plugins/index_pattern_editor/public/types.ts", + "path": "src/plugins/data_view_editor/public/types.ts", "deprecated": false, "children": [ { - "parentPluginId": "indexPatternEditor", - "id": "def-public.IndexPatternEditorProps.onSave", + "parentPluginId": "dataViewEditor", + "id": "def-public.DataViewEditorProps.onSave", "type": "Function", "tags": [], "label": "onSave", @@ -24,38 +24,36 @@ "\nHandler for the \"save\" footer button" ], "signature": [ - "(indexPattern: ", + "(dataView: ", { "pluginId": "dataViews", "scope": "common", "docId": "kibDataViewsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "section": "def-common.DataView", + "text": "DataView" }, ") => void" ], - "path": "src/plugins/index_pattern_editor/public/types.ts", + "path": "src/plugins/data_view_editor/public/types.ts", "deprecated": false, "children": [ { - "parentPluginId": "indexPatternEditor", - "id": "def-public.IndexPatternEditorProps.onSave.$1", + "parentPluginId": "dataViewEditor", + "id": "def-public.DataViewEditorProps.onSave.$1", "type": "Object", "tags": [], - "label": "indexPattern", - "description": [ - "- newly created index pattern" - ], + "label": "dataView", + "description": [], "signature": [ { "pluginId": "dataViews", "scope": "common", "docId": "kibDataViewsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "section": "def-common.DataView", + "text": "DataView" } ], - "path": "src/plugins/index_pattern_editor/public/types.ts", + "path": "src/plugins/data_view_editor/public/types.ts", "deprecated": false, "isRequired": true } @@ -63,8 +61,8 @@ "returnComment": [] }, { - "parentPluginId": "indexPatternEditor", - "id": "def-public.IndexPatternEditorProps.onCancel", + "parentPluginId": "dataViewEditor", + "id": "def-public.DataViewEditorProps.onCancel", "type": "Function", "tags": [], "label": "onCancel", @@ -74,14 +72,14 @@ "signature": [ "(() => void) | undefined" ], - "path": "src/plugins/index_pattern_editor/public/types.ts", + "path": "src/plugins/data_view_editor/public/types.ts", "deprecated": false, "children": [], "returnComment": [] }, { - "parentPluginId": "indexPatternEditor", - "id": "def-public.IndexPatternEditorProps.defaultTypeIsRollup", + "parentPluginId": "dataViewEditor", + "id": "def-public.DataViewEditorProps.defaultTypeIsRollup", "type": "CompoundType", "tags": [], "label": "defaultTypeIsRollup", @@ -91,12 +89,12 @@ "signature": [ "boolean | undefined" ], - "path": "src/plugins/index_pattern_editor/public/types.ts", + "path": "src/plugins/data_view_editor/public/types.ts", "deprecated": false }, { - "parentPluginId": "indexPatternEditor", - "id": "def-public.IndexPatternEditorProps.requireTimestampField", + "parentPluginId": "dataViewEditor", + "id": "def-public.DataViewEditorProps.requireTimestampField", "type": "CompoundType", "tags": [], "label": "requireTimestampField", @@ -106,7 +104,7 @@ "signature": [ "boolean | undefined" ], - "path": "src/plugins/index_pattern_editor/public/types.ts", + "path": "src/plugins/data_view_editor/public/types.ts", "deprecated": false } ], @@ -117,17 +115,17 @@ "misc": [], "objects": [], "start": { - "parentPluginId": "indexPatternEditor", + "parentPluginId": "dataViewEditor", "id": "def-public.PluginStart", "type": "Interface", "tags": [], "label": "PluginStart", "description": [], - "path": "src/plugins/index_pattern_editor/public/types.ts", + "path": "src/plugins/data_view_editor/public/types.ts", "deprecated": false, "children": [ { - "parentPluginId": "indexPatternEditor", + "parentPluginId": "dataViewEditor", "id": "def-public.PluginStart.openEditor", "type": "Function", "tags": [], @@ -136,19 +134,19 @@ "signature": [ "(options: ", { - "pluginId": "indexPatternEditor", + "pluginId": "dataViewEditor", "scope": "public", - "docId": "kibIndexPatternEditorPluginApi", - "section": "def-public.IndexPatternEditorProps", - "text": "IndexPatternEditorProps" + "docId": "kibDataViewEditorPluginApi", + "section": "def-public.DataViewEditorProps", + "text": "DataViewEditorProps" }, ") => () => void" ], - "path": "src/plugins/index_pattern_editor/public/types.ts", + "path": "src/plugins/data_view_editor/public/types.ts", "deprecated": false, "children": [ { - "parentPluginId": "indexPatternEditor", + "parentPluginId": "dataViewEditor", "id": "def-public.PluginStart.openEditor.$1", "type": "Object", "tags": [], @@ -156,14 +154,14 @@ "description": [], "signature": [ { - "pluginId": "indexPatternEditor", + "pluginId": "dataViewEditor", "scope": "public", - "docId": "kibIndexPatternEditorPluginApi", - "section": "def-public.IndexPatternEditorProps", - "text": "IndexPatternEditorProps" + "docId": "kibDataViewEditorPluginApi", + "section": "def-public.DataViewEditorProps", + "text": "DataViewEditorProps" } ], - "path": "src/plugins/index_pattern_editor/public/types.ts", + "path": "src/plugins/data_view_editor/public/types.ts", "deprecated": false, "isRequired": true } @@ -171,7 +169,7 @@ "returnComment": [] }, { - "parentPluginId": "indexPatternEditor", + "parentPluginId": "dataViewEditor", "id": "def-public.PluginStart.IndexPatternEditorComponent", "type": "Function", "tags": [], @@ -180,20 +178,20 @@ "signature": [ "React.FunctionComponent<", { - "pluginId": "indexPatternEditor", + "pluginId": "dataViewEditor", "scope": "public", - "docId": "kibIndexPatternEditorPluginApi", - "section": "def-public.IndexPatternEditorProps", - "text": "IndexPatternEditorProps" + "docId": "kibDataViewEditorPluginApi", + "section": "def-public.DataViewEditorProps", + "text": "DataViewEditorProps" }, ">" ], - "path": "src/plugins/index_pattern_editor/public/types.ts", + "path": "src/plugins/data_view_editor/public/types.ts", "deprecated": false, "returnComment": [], "children": [ { - "parentPluginId": "indexPatternEditor", + "parentPluginId": "dataViewEditor", "id": "def-public.PluginStart.IndexPatternEditorComponent.$1", "type": "CompoundType", "tags": [], @@ -206,7 +204,7 @@ "deprecated": false }, { - "parentPluginId": "indexPatternEditor", + "parentPluginId": "dataViewEditor", "id": "def-public.PluginStart.IndexPatternEditorComponent.$2", "type": "Any", "tags": [], @@ -221,16 +219,16 @@ ] }, { - "parentPluginId": "indexPatternEditor", + "parentPluginId": "dataViewEditor", "id": "def-public.PluginStart.userPermissions", "type": "Object", "tags": [], "label": "userPermissions", "description": [], "signature": [ - "{ editIndexPattern: () => boolean; }" + "{ editDataView: () => boolean; }" ], - "path": "src/plugins/index_pattern_editor/public/types.ts", + "path": "src/plugins/data_view_editor/public/types.ts", "deprecated": false } ], diff --git a/api_docs/index_pattern_editor.mdx b/api_docs/data_view_editor.mdx similarity index 51% rename from api_docs/index_pattern_editor.mdx rename to api_docs/data_view_editor.mdx index 1be236e05e2c7..c73ae9b41afc1 100644 --- a/api_docs/index_pattern_editor.mdx +++ b/api_docs/data_view_editor.mdx @@ -1,16 +1,16 @@ --- -id: kibIndexPatternEditorPluginApi -slug: /kibana-dev-docs/api/indexPatternEditor -title: "indexPatternEditor" +id: kibDataViewEditorPluginApi +slug: /kibana-dev-docs/api/dataViewEditor +title: "dataViewEditor" image: https://source.unsplash.com/400x175/?github -summary: API docs for the indexPatternEditor plugin +summary: API docs for the dataViewEditor plugin date: 2020-11-16 -tags: ['contributor', 'dev', 'apidocs', 'kibana', 'indexPatternEditor'] +tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewEditor'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- -import indexPatternEditorObj from './index_pattern_editor.json'; +import dataViewEditorObj from './data_view_editor.json'; -This plugin provides the ability to create index patterns via a modal flyout from any kibana app +This plugin provides the ability to create data views via a modal flyout from any kibana app Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) for questions regarding this plugin. @@ -18,13 +18,13 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 13 | 1 | 8 | 0 | +| 13 | 0 | 9 | 0 | ## Client ### Start - + ### Interfaces - + diff --git a/api_docs/index_pattern_field_editor.json b/api_docs/data_view_field_editor.json similarity index 70% rename from api_docs/index_pattern_field_editor.json rename to api_docs/data_view_field_editor.json index e95d84e832fe9..fd18abd0bb86e 100644 --- a/api_docs/index_pattern_field_editor.json +++ b/api_docs/data_view_field_editor.json @@ -1,9 +1,9 @@ { - "id": "indexPatternFieldEditor", + "id": "dataViewFieldEditor", "client": { "classes": [ { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.DefaultFormatEditor", "type": "Class", "tags": [], @@ -11,17 +11,17 @@ "description": [], "signature": [ { - "pluginId": "indexPatternFieldEditor", + "pluginId": "dataViewFieldEditor", "scope": "public", - "docId": "kibIndexPatternFieldEditorPluginApi", + "docId": "kibDataViewFieldEditorPluginApi", "section": "def-public.DefaultFormatEditor", "text": "DefaultFormatEditor" }, " extends React.PureComponent<", { - "pluginId": "indexPatternFieldEditor", + "pluginId": "dataViewFieldEditor", "scope": "public", - "docId": "kibIndexPatternFieldEditorPluginApi", + "docId": "kibDataViewFieldEditorPluginApi", "section": "def-public.FormatEditorProps", "text": "FormatEditorProps" }, @@ -29,21 +29,21 @@ "FormatEditorState", " & S, any>" ], - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/default/default.tsx", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/editors/default/default.tsx", "deprecated": false, "children": [ { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.DefaultFormatEditor.formatId", "type": "string", "tags": [], "label": "formatId", "description": [], - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/default/default.tsx", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/editors/default/default.tsx", "deprecated": false }, { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.DefaultFormatEditor.state", "type": "CompoundType", "tags": [], @@ -53,11 +53,11 @@ "FormatEditorState", " & S" ], - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/default/default.tsx", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/editors/default/default.tsx", "deprecated": false }, { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.DefaultFormatEditor.getDerivedStateFromProps", "type": "Function", "tags": [], @@ -66,9 +66,9 @@ "signature": [ "(nextProps: ", { - "pluginId": "indexPatternFieldEditor", + "pluginId": "dataViewFieldEditor", "scope": "public", - "docId": "kibIndexPatternFieldEditorPluginApi", + "docId": "kibDataViewFieldEditorPluginApi", "section": "def-public.FormatEditorProps", "text": "FormatEditorProps" }, @@ -78,11 +78,11 @@ "Sample", "[]; }" ], - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/default/default.tsx", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/editors/default/default.tsx", "deprecated": false, "children": [ { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.DefaultFormatEditor.getDerivedStateFromProps.$1", "type": "Object", "tags": [], @@ -90,20 +90,20 @@ "description": [], "signature": [ { - "pluginId": "indexPatternFieldEditor", + "pluginId": "dataViewFieldEditor", "scope": "public", - "docId": "kibIndexPatternFieldEditorPluginApi", + "docId": "kibDataViewFieldEditorPluginApi", "section": "def-public.FormatEditorProps", "text": "FormatEditorProps" }, "<{}>" ], - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/default/default.tsx", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/editors/default/default.tsx", "deprecated": false, "isRequired": true }, { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.DefaultFormatEditor.getDerivedStateFromProps.$2", "type": "Object", "tags": [], @@ -112,7 +112,7 @@ "signature": [ "FormatEditorState" ], - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/default/default.tsx", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/editors/default/default.tsx", "deprecated": false, "isRequired": true } @@ -120,7 +120,7 @@ "returnComment": [] }, { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.DefaultFormatEditor.onChange", "type": "Function", "tags": [], @@ -129,11 +129,11 @@ "signature": [ "(newParams?: {}) => void" ], - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/default/default.tsx", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/editors/default/default.tsx", "deprecated": false, "children": [ { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.DefaultFormatEditor.onChange.$1", "type": "Object", "tags": [], @@ -142,7 +142,7 @@ "signature": [ "{}" ], - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/default/default.tsx", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/editors/default/default.tsx", "deprecated": false, "isRequired": true } @@ -150,7 +150,7 @@ "returnComment": [] }, { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.DefaultFormatEditor.render", "type": "Function", "tags": [], @@ -159,7 +159,7 @@ "signature": [ "() => JSX.Element" ], - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/default/default.tsx", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/editors/default/default.tsx", "deprecated": false, "children": [], "returnComment": [] @@ -171,7 +171,7 @@ "functions": [], "interfaces": [ { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.FormatEditorProps", "type": "Interface", "tags": [], @@ -181,29 +181,29 @@ ], "signature": [ { - "pluginId": "indexPatternFieldEditor", + "pluginId": "dataViewFieldEditor", "scope": "public", - "docId": "kibIndexPatternFieldEditorPluginApi", + "docId": "kibDataViewFieldEditorPluginApi", "section": "def-public.FormatEditorProps", "text": "FormatEditorProps" }, "

" ], - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/types.ts", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/editors/types.ts", "deprecated": false, "children": [ { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.FormatEditorProps.fieldType", "type": "string", "tags": [], "label": "fieldType", "description": [], - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/types.ts", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/editors/types.ts", "deprecated": false }, { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.FormatEditorProps.format", "type": "Object", "tags": [], @@ -218,11 +218,11 @@ "text": "FieldFormat" } ], - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/types.ts", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/editors/types.ts", "deprecated": false }, { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.FormatEditorProps.formatParams", "type": "CompoundType", "tags": [], @@ -231,11 +231,11 @@ "signature": [ "{ type?: string | undefined; } & P" ], - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/types.ts", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/editors/types.ts", "deprecated": false }, { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.FormatEditorProps.onChange", "type": "Function", "tags": [], @@ -244,30 +244,30 @@ "signature": [ "(newParams: { [key: string]: any; }) => void" ], - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/types.ts", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/editors/types.ts", "deprecated": false, "children": [ { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.FormatEditorProps.onChange.$1", "type": "Object", "tags": [], "label": "newParams", "description": [], - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/types.ts", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/editors/types.ts", "deprecated": false, "children": [ { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.FormatEditorProps.onChange.$1.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: any", "description": [], "signature": [ - "any" + "[key: string]: any" ], - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/types.ts", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/editors/types.ts", "deprecated": false } ] @@ -276,7 +276,7 @@ "returnComment": [] }, { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.FormatEditorProps.onError", "type": "Function", "tags": [], @@ -285,12 +285,12 @@ "signature": [ "(error?: string | undefined) => void" ], - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/types.ts", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/editors/types.ts", "deprecated": false, "returnComment": [], "children": [ { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.FormatEditorProps.onError.$1", "type": "string", "tags": [], @@ -299,7 +299,7 @@ "signature": [ "string | undefined" ], - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx", "deprecated": false } ] @@ -308,38 +308,38 @@ "initialIsOpen": false }, { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.OpenFieldDeleteModalOptions", "type": "Interface", "tags": [], "label": "OpenFieldDeleteModalOptions", "description": [], - "path": "src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx", + "path": "src/plugins/data_view_field_editor/public/open_delete_modal.tsx", "deprecated": false, "children": [ { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.OpenFieldDeleteModalOptions.ctx", "type": "Object", "tags": [], "label": "ctx", "description": [], "signature": [ - "{ indexPattern: ", + "{ dataView: ", { "pluginId": "dataViews", "scope": "common", "docId": "kibDataViewsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "section": "def-common.DataView", + "text": "DataView" }, "; }" ], - "path": "src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx", + "path": "src/plugins/data_view_field_editor/public/open_delete_modal.tsx", "deprecated": false }, { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.OpenFieldDeleteModalOptions.onDelete", "type": "Function", "tags": [], @@ -348,11 +348,11 @@ "signature": [ "((fieldNames: string[]) => void) | undefined" ], - "path": "src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx", + "path": "src/plugins/data_view_field_editor/public/open_delete_modal.tsx", "deprecated": false, "children": [ { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.OpenFieldDeleteModalOptions.onDelete.$1", "type": "Array", "tags": [], @@ -361,7 +361,7 @@ "signature": [ "string[]" ], - "path": "src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx", + "path": "src/plugins/data_view_field_editor/public/open_delete_modal.tsx", "deprecated": false, "isRequired": true } @@ -369,7 +369,7 @@ "returnComment": [] }, { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.OpenFieldDeleteModalOptions.fieldName", "type": "CompoundType", "tags": [], @@ -378,45 +378,45 @@ "signature": [ "string | string[]" ], - "path": "src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx", + "path": "src/plugins/data_view_field_editor/public/open_delete_modal.tsx", "deprecated": false } ], "initialIsOpen": false }, { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.OpenFieldEditorOptions", "type": "Interface", "tags": [], "label": "OpenFieldEditorOptions", "description": [], - "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx", + "path": "src/plugins/data_view_field_editor/public/open_editor.tsx", "deprecated": false, "children": [ { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.OpenFieldEditorOptions.ctx", "type": "Object", "tags": [], "label": "ctx", "description": [], "signature": [ - "{ indexPattern: ", + "{ dataView: ", { "pluginId": "dataViews", "scope": "common", "docId": "kibDataViewsPluginApi", - "section": "def-common.IndexPattern", - "text": "IndexPattern" + "section": "def-common.DataView", + "text": "DataView" }, "; }" ], - "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx", + "path": "src/plugins/data_view_field_editor/public/open_editor.tsx", "deprecated": false }, { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.OpenFieldEditorOptions.onSave", "type": "Function", "tags": [], @@ -428,16 +428,16 @@ "pluginId": "dataViews", "scope": "common", "docId": "kibDataViewsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" + "section": "def-common.DataViewField", + "text": "DataViewField" }, ") => void) | undefined" ], - "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx", + "path": "src/plugins/data_view_field_editor/public/open_editor.tsx", "deprecated": false, "children": [ { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.OpenFieldEditorOptions.onSave.$1", "type": "Object", "tags": [], @@ -448,11 +448,11 @@ "pluginId": "dataViews", "scope": "common", "docId": "kibDataViewsPluginApi", - "section": "def-common.IndexPatternField", - "text": "IndexPatternField" + "section": "def-common.DataViewField", + "text": "DataViewField" } ], - "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx", + "path": "src/plugins/data_view_field_editor/public/open_editor.tsx", "deprecated": false, "isRequired": true } @@ -460,7 +460,7 @@ "returnComment": [] }, { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.OpenFieldEditorOptions.fieldName", "type": "string", "tags": [], @@ -469,7 +469,7 @@ "signature": [ "string | undefined" ], - "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx", + "path": "src/plugins/data_view_field_editor/public/open_editor.tsx", "deprecated": false } ], @@ -479,7 +479,7 @@ "enums": [], "misc": [ { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.FieldFormatEditor", "type": "Type", "tags": [], @@ -490,28 +490,28 @@ "signature": [ "(React.ComponentClass<", { - "pluginId": "indexPatternFieldEditor", + "pluginId": "dataViewFieldEditor", "scope": "public", - "docId": "kibIndexPatternFieldEditorPluginApi", + "docId": "kibDataViewFieldEditorPluginApi", "section": "def-public.FormatEditorProps", "text": "FormatEditorProps" }, ", any> & { formatId: string; }) | (React.FunctionComponent<", { - "pluginId": "indexPatternFieldEditor", + "pluginId": "dataViewFieldEditor", "scope": "public", - "docId": "kibIndexPatternFieldEditorPluginApi", + "docId": "kibDataViewFieldEditorPluginApi", "section": "def-public.FormatEditorProps", "text": "FormatEditorProps" }, "> & { formatId: string; })" ], - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/types.ts", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/editors/types.ts", "deprecated": false, "initialIsOpen": false }, { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.FieldFormatEditorFactory", "type": "Type", "tags": [], @@ -522,15 +522,15 @@ "signature": [ "(() => Promise<", { - "pluginId": "indexPatternFieldEditor", + "pluginId": "dataViewFieldEditor", "scope": "public", - "docId": "kibIndexPatternFieldEditorPluginApi", + "docId": "kibDataViewFieldEditorPluginApi", "section": "def-public.FieldFormatEditor", "text": "FieldFormatEditor" }, ">) & { formatId: string; }" ], - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/types.ts", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/editors/types.ts", "deprecated": false, "returnComment": [], "children": [], @@ -539,17 +539,17 @@ ], "objects": [], "setup": { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.PluginSetup", "type": "Interface", "tags": [], "label": "PluginSetup", "description": [], - "path": "src/plugins/index_pattern_field_editor/public/types.ts", + "path": "src/plugins/data_view_field_editor/public/types.ts", "deprecated": false, "children": [ { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.PluginSetup.fieldFormatEditors", "type": "Object", "tags": [], @@ -558,15 +558,15 @@ "signature": [ "{ register: (editor: ", { - "pluginId": "indexPatternFieldEditor", + "pluginId": "dataViewFieldEditor", "scope": "public", - "docId": "kibIndexPatternFieldEditorPluginApi", + "docId": "kibDataViewFieldEditorPluginApi", "section": "def-public.FieldFormatEditorFactory", "text": "FieldFormatEditorFactory" }, ") => void; }" ], - "path": "src/plugins/index_pattern_field_editor/public/types.ts", + "path": "src/plugins/data_view_field_editor/public/types.ts", "deprecated": false } ], @@ -574,17 +574,17 @@ "initialIsOpen": true }, "start": { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.PluginStart", "type": "Interface", "tags": [], "label": "PluginStart", "description": [], - "path": "src/plugins/index_pattern_field_editor/public/types.ts", + "path": "src/plugins/data_view_field_editor/public/types.ts", "deprecated": false, "children": [ { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.PluginStart.openEditor", "type": "Function", "tags": [], @@ -593,19 +593,19 @@ "signature": [ "(options: ", { - "pluginId": "indexPatternFieldEditor", + "pluginId": "dataViewFieldEditor", "scope": "public", - "docId": "kibIndexPatternFieldEditorPluginApi", + "docId": "kibDataViewFieldEditorPluginApi", "section": "def-public.OpenFieldEditorOptions", "text": "OpenFieldEditorOptions" }, ") => () => void" ], - "path": "src/plugins/index_pattern_field_editor/public/types.ts", + "path": "src/plugins/data_view_field_editor/public/types.ts", "deprecated": false, "children": [ { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.PluginStart.openEditor.$1", "type": "Object", "tags": [], @@ -613,14 +613,14 @@ "description": [], "signature": [ { - "pluginId": "indexPatternFieldEditor", + "pluginId": "dataViewFieldEditor", "scope": "public", - "docId": "kibIndexPatternFieldEditorPluginApi", + "docId": "kibDataViewFieldEditorPluginApi", "section": "def-public.OpenFieldEditorOptions", "text": "OpenFieldEditorOptions" } ], - "path": "src/plugins/index_pattern_field_editor/public/types.ts", + "path": "src/plugins/data_view_field_editor/public/types.ts", "deprecated": false, "isRequired": true } @@ -628,7 +628,7 @@ "returnComment": [] }, { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.PluginStart.openDeleteModal", "type": "Function", "tags": [], @@ -637,19 +637,19 @@ "signature": [ "(options: ", { - "pluginId": "indexPatternFieldEditor", + "pluginId": "dataViewFieldEditor", "scope": "public", - "docId": "kibIndexPatternFieldEditorPluginApi", + "docId": "kibDataViewFieldEditorPluginApi", "section": "def-public.OpenFieldDeleteModalOptions", "text": "OpenFieldDeleteModalOptions" }, ") => () => void" ], - "path": "src/plugins/index_pattern_field_editor/public/types.ts", + "path": "src/plugins/data_view_field_editor/public/types.ts", "deprecated": false, "children": [ { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.PluginStart.openDeleteModal.$1", "type": "Object", "tags": [], @@ -657,14 +657,14 @@ "description": [], "signature": [ { - "pluginId": "indexPatternFieldEditor", + "pluginId": "dataViewFieldEditor", "scope": "public", - "docId": "kibIndexPatternFieldEditorPluginApi", + "docId": "kibDataViewFieldEditorPluginApi", "section": "def-public.OpenFieldDeleteModalOptions", "text": "OpenFieldDeleteModalOptions" } ], - "path": "src/plugins/index_pattern_field_editor/public/types.ts", + "path": "src/plugins/data_view_field_editor/public/types.ts", "deprecated": false, "isRequired": true } @@ -672,7 +672,7 @@ "returnComment": [] }, { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.PluginStart.fieldFormatEditors", "type": "Object", "tags": [], @@ -681,27 +681,27 @@ "signature": [ "{ getAll: () => ", { - "pluginId": "indexPatternFieldEditor", + "pluginId": "dataViewFieldEditor", "scope": "public", - "docId": "kibIndexPatternFieldEditorPluginApi", + "docId": "kibDataViewFieldEditorPluginApi", "section": "def-public.FieldFormatEditorFactory", "text": "FieldFormatEditorFactory" }, "[]; getById: (id: string) => ", { - "pluginId": "indexPatternFieldEditor", + "pluginId": "dataViewFieldEditor", "scope": "public", - "docId": "kibIndexPatternFieldEditorPluginApi", + "docId": "kibDataViewFieldEditorPluginApi", "section": "def-public.FieldFormatEditorFactory", "text": "FieldFormatEditorFactory" }, " | undefined; }" ], - "path": "src/plugins/index_pattern_field_editor/public/types.ts", + "path": "src/plugins/data_view_field_editor/public/types.ts", "deprecated": false }, { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.PluginStart.userPermissions", "type": "Object", "tags": [], @@ -710,11 +710,11 @@ "signature": [ "{ editIndexPattern: () => boolean; }" ], - "path": "src/plugins/index_pattern_field_editor/public/types.ts", + "path": "src/plugins/data_view_field_editor/public/types.ts", "deprecated": false }, { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.PluginStart.DeleteRuntimeFieldProvider", "type": "Function", "tags": [], @@ -725,12 +725,12 @@ "Props", ">" ], - "path": "src/plugins/index_pattern_field_editor/public/types.ts", + "path": "src/plugins/data_view_field_editor/public/types.ts", "deprecated": false, "returnComment": [], "children": [ { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.PluginStart.DeleteRuntimeFieldProvider.$1", "type": "CompoundType", "tags": [], @@ -743,7 +743,7 @@ "deprecated": false }, { - "parentPluginId": "indexPatternFieldEditor", + "parentPluginId": "dataViewFieldEditor", "id": "def-public.PluginStart.DeleteRuntimeFieldProvider.$2", "type": "Any", "tags": [], diff --git a/api_docs/data_view_field_editor.mdx b/api_docs/data_view_field_editor.mdx new file mode 100644 index 0000000000000..36bbc70b3041e --- /dev/null +++ b/api_docs/data_view_field_editor.mdx @@ -0,0 +1,39 @@ +--- +id: kibDataViewFieldEditorPluginApi +slug: /kibana-dev-docs/api/dataViewFieldEditor +title: "dataViewFieldEditor" +image: https://source.unsplash.com/400x175/?github +summary: API docs for the dataViewFieldEditor plugin +date: 2020-11-16 +tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewFieldEditor'] +warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. +--- +import dataViewFieldEditorObj from './data_view_field_editor.json'; + +Reusable data view field editor across Kibana + +Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 42 | 0 | 39 | 3 | + +## Client + +### Setup + + +### Start + + +### Classes + + +### Interfaces + + +### Consts, variables and types + + diff --git a/api_docs/index_pattern_management.json b/api_docs/data_view_management.json similarity index 78% rename from api_docs/index_pattern_management.json rename to api_docs/data_view_management.json index c7b2abff93118..3406ca46de8e5 100644 --- a/api_docs/index_pattern_management.json +++ b/api_docs/data_view_management.json @@ -1,5 +1,5 @@ { - "id": "indexPatternManagement", + "id": "dataViewManagement", "client": { "classes": [], "functions": [], @@ -8,26 +8,26 @@ "misc": [], "objects": [], "setup": { - "parentPluginId": "indexPatternManagement", + "parentPluginId": "dataViewManagement", "id": "def-public.IndexPatternManagementSetup", "type": "Interface", "tags": [], "label": "IndexPatternManagementSetup", "description": [], - "path": "src/plugins/index_pattern_management/public/plugin.ts", + "path": "src/plugins/data_view_management/public/plugin.ts", "deprecated": false, "children": [], "lifecycle": "setup", "initialIsOpen": true }, "start": { - "parentPluginId": "indexPatternManagement", + "parentPluginId": "dataViewManagement", "id": "def-public.IndexPatternManagementStart", "type": "Interface", "tags": [], "label": "IndexPatternManagementStart", "description": [], - "path": "src/plugins/index_pattern_management/public/plugin.ts", + "path": "src/plugins/data_view_management/public/plugin.ts", "deprecated": false, "children": [], "lifecycle": "start", diff --git a/api_docs/index_pattern_management.mdx b/api_docs/data_view_management.mdx similarity index 54% rename from api_docs/index_pattern_management.mdx rename to api_docs/data_view_management.mdx index 68ff44c1143c7..4015d5c481837 100644 --- a/api_docs/index_pattern_management.mdx +++ b/api_docs/data_view_management.mdx @@ -1,16 +1,16 @@ --- -id: kibIndexPatternManagementPluginApi -slug: /kibana-dev-docs/api/indexPatternManagement -title: "indexPatternManagement" +id: kibDataViewManagementPluginApi +slug: /kibana-dev-docs/api/dataViewManagement +title: "dataViewManagement" image: https://source.unsplash.com/400x175/?github -summary: API docs for the indexPatternManagement plugin +summary: API docs for the dataViewManagement plugin date: 2020-11-16 -tags: ['contributor', 'dev', 'apidocs', 'kibana', 'indexPatternManagement'] +tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewManagement'] warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. --- -import indexPatternManagementObj from './index_pattern_management.json'; +import dataViewManagementObj from './data_view_management.json'; -Index pattern management app +Data view management app Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) for questions regarding this plugin. @@ -23,8 +23,8 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services ## Client ### Setup - + ### Start - + diff --git a/api_docs/data_views.json b/api_docs/data_views.json index 9e6e0265948f3..780d23b80ee6b 100644 --- a/api_docs/data_views.json +++ b/api_docs/data_views.json @@ -443,7 +443,6 @@ ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": true, - "removeBy": "8.1", "references": [], "children": [ { @@ -511,15 +510,14 @@ ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": true, - "removeBy": "8.1", "references": [ { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" } ], "children": [ @@ -564,7 +562,6 @@ ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": true, - "removeBy": "8.1", "references": [ { "plugin": "visTypeTimeseries", @@ -587,20 +584,20 @@ "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { "plugin": "visTypeTimeseries", @@ -634,11 +631,10 @@ ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": true, - "removeBy": "8.1", "references": [ { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" } ], "children": [], @@ -652,7 +648,14 @@ "label": "isTimeBased", "description": [], "signature": [ - "() => boolean" + "() => this is ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.TimeBasedDataView", + "text": "TimeBasedDataView" + } ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false, @@ -667,7 +670,14 @@ "label": "isTimeNanosBased", "description": [], "signature": [ - "() => boolean" + "() => this is ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.TimeBasedDataView", + "text": "TimeBasedDataView" + } ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false, @@ -1288,97 +1298,720 @@ "signature": [ "(fieldName: string, format: ", { - "pluginId": "fieldFormats", + "pluginId": "fieldFormats", + "scope": "common", + "docId": "kibFieldFormatsPluginApi", + "section": "def-common.SerializedFieldFormat", + "text": "SerializedFieldFormat" + }, + "<", + { + "pluginId": "fieldFormats", + "scope": "common", + "docId": "kibFieldFormatsPluginApi", + "section": "def-common.FieldFormatParams", + "text": "FieldFormatParams" + }, + ">) => void" + ], + "path": "src/plugins/data_views/common/data_views/data_view.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "dataViews", + "id": "def-public.DataView.setFieldFormat.$1", + "type": "string", + "tags": [], + "label": "fieldName", + "description": [], + "signature": [ + "string" + ], + "path": "src/plugins/data_views/common/data_views/data_view.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataView.setFieldFormat.$2", + "type": "Object", + "tags": [], + "label": "format", + "description": [], + "signature": [ + { + "pluginId": "fieldFormats", + "scope": "common", + "docId": "kibFieldFormatsPluginApi", + "section": "def-common.SerializedFieldFormat", + "text": "SerializedFieldFormat" + }, + "<", + { + "pluginId": "fieldFormats", + "scope": "common", + "docId": "kibFieldFormatsPluginApi", + "section": "def-common.FieldFormatParams", + "text": "FieldFormatParams" + }, + ">" + ], + "path": "src/plugins/data_views/common/data_views/data_view.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataView.deleteFieldFormat", + "type": "Function", + "tags": [], + "label": "deleteFieldFormat", + "description": [], + "signature": [ + "(fieldName: string) => void" + ], + "path": "src/plugins/data_views/common/data_views/data_view.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "dataViews", + "id": "def-public.DataView.deleteFieldFormat.$1", + "type": "string", + "tags": [], + "label": "fieldName", + "description": [], + "signature": [ + "string" + ], + "path": "src/plugins/data_views/common/data_views/data_view.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField", + "type": "Class", + "tags": [], + "label": "DataViewField", + "description": [], + "signature": [ + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewField", + "text": "DataViewField" + }, + " implements ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.IFieldType", + "text": "IFieldType" + } + ], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.spec", + "type": "Object", + "tags": [], + "label": "spec", + "description": [], + "signature": [ + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + } + ], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.Unnamed", + "type": "Function", + "tags": [], + "label": "Constructor", + "description": [], + "signature": [ + "any" + ], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.Unnamed.$1", + "type": "Object", + "tags": [], + "label": "spec", + "description": [], + "signature": [ + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + } + ], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.count", + "type": "number", + "tags": [], + "label": "count", + "description": [ + "\nCount is used for field popularity" + ], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.count", + "type": "number", + "tags": [], + "label": "count", + "description": [], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.runtimeField", + "type": "Object", + "tags": [], + "label": "runtimeField", + "description": [], + "signature": [ + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.RuntimeField", + "text": "RuntimeField" + }, + " | undefined" + ], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.runtimeField", + "type": "Object", + "tags": [], + "label": "runtimeField", + "description": [], + "signature": [ + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.RuntimeField", + "text": "RuntimeField" + }, + " | undefined" + ], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.script", + "type": "string", + "tags": [], + "label": "script", + "description": [ + "\nScript field code" + ], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.script", + "type": "string", + "tags": [], + "label": "script", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.lang", + "type": "CompoundType", + "tags": [], + "label": "lang", + "description": [ + "\nScript field language" + ], + "signature": [ + "\"painless\" | \"expression\" | \"mustache\" | \"java\" | undefined" + ], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.lang", + "type": "CompoundType", + "tags": [], + "label": "lang", + "description": [], + "signature": [ + "\"painless\" | \"expression\" | \"mustache\" | \"java\" | undefined" + ], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.customLabel", + "type": "string", + "tags": [], + "label": "customLabel", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.customLabel", + "type": "string", + "tags": [], + "label": "customLabel", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.conflictDescriptions", + "type": "Object", + "tags": [], + "label": "conflictDescriptions", + "description": [ + "\nDescription of field type conflicts across different indices in the same index pattern" + ], + "signature": [ + "Record | undefined" + ], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.conflictDescriptions", + "type": "Object", + "tags": [], + "label": "conflictDescriptions", + "description": [], + "signature": [ + "Record | undefined" + ], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.name", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.displayName", + "type": "string", + "tags": [], + "label": "displayName", + "description": [], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.esTypes", + "type": "Array", + "tags": [], + "label": "esTypes", + "description": [], + "signature": [ + "string[] | undefined" + ], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.scripted", + "type": "boolean", + "tags": [], + "label": "scripted", + "description": [], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.searchable", + "type": "boolean", + "tags": [], + "label": "searchable", + "description": [], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.aggregatable", + "type": "boolean", + "tags": [], + "label": "aggregatable", + "description": [], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.readFromDocValues", + "type": "boolean", + "tags": [], + "label": "readFromDocValues", + "description": [], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.subType", + "type": "CompoundType", + "tags": [], + "label": "subType", + "description": [], + "signature": [ + "IFieldSubTypeMultiOptional", + " | ", + "IFieldSubTypeNestedOptional", + " | undefined" + ], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.isMapped", + "type": "CompoundType", + "tags": [], + "label": "isMapped", + "description": [ + "\nIs the field part of the index mapping?" + ], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.sortable", + "type": "boolean", + "tags": [], + "label": "sortable", + "description": [], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.filterable", + "type": "boolean", + "tags": [], + "label": "filterable", + "description": [], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.visualizable", + "type": "boolean", + "tags": [], + "label": "visualizable", + "description": [], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.isSubtypeNested", + "type": "Function", + "tags": [], + "label": "isSubtypeNested", + "description": [], + "signature": [ + "() => boolean" + ], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.isSubtypeMulti", + "type": "Function", + "tags": [], + "label": "isSubtypeMulti", + "description": [], + "signature": [ + "() => boolean" + ], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.getSubtypeNested", + "type": "Function", + "tags": [], + "label": "getSubtypeNested", + "description": [], + "signature": [ + "() => ", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubTypeNested", + "text": "IFieldSubTypeNested" + }, + " | undefined" + ], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.getSubtypeMulti", + "type": "Function", + "tags": [], + "label": "getSubtypeMulti", + "description": [], + "signature": [ + "() => ", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.IFieldSubTypeMulti", + "text": "IFieldSubTypeMulti" + }, + " | undefined" + ], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.deleteCount", + "type": "Function", + "tags": [], + "label": "deleteCount", + "description": [], + "signature": [ + "() => void" + ], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.toJSON", + "type": "Function", + "tags": [], + "label": "toJSON", + "description": [], + "signature": [ + "() => { count: number; script: string | undefined; lang: \"painless\" | \"expression\" | \"mustache\" | \"java\" | undefined; conflictDescriptions: Record | undefined; name: string; type: string; esTypes: string[] | undefined; scripted: boolean; searchable: boolean; aggregatable: boolean; readFromDocValues: boolean; subType: ", + "IFieldSubTypeMultiOptional", + " | ", + "IFieldSubTypeNestedOptional", + " | undefined; customLabel: string | undefined; }" + ], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.toSpec", + "type": "Function", + "tags": [], + "label": "toSpec", + "description": [], + "signature": [ + "({ getFormatterForField, }?: { getFormatterForField?: ((field: ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.IFieldType", + "text": "IFieldType" + }, + " | ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + }, + " | ", + { + "pluginId": "dataViews", "scope": "common", - "docId": "kibFieldFormatsPluginApi", - "section": "def-common.SerializedFieldFormat", - "text": "SerializedFieldFormat" + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewField", + "text": "DataViewField" }, - "<", + ") => ", { "pluginId": "fieldFormats", "scope": "common", "docId": "kibFieldFormatsPluginApi", - "section": "def-common.FieldFormatParams", - "text": "FieldFormatParams" - }, - ">) => void" - ], - "path": "src/plugins/data_views/common/data_views/data_view.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "dataViews", - "id": "def-public.DataView.setFieldFormat.$1", - "type": "string", - "tags": [], - "label": "fieldName", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data_views/common/data_views/data_view.ts", - "deprecated": false, - "isRequired": true + "section": "def-common.FieldFormat", + "text": "FieldFormat" }, + ") | undefined; }) => ", { - "parentPluginId": "dataViews", - "id": "def-public.DataView.setFieldFormat.$2", - "type": "Object", - "tags": [], - "label": "format", - "description": [], - "signature": [ - { - "pluginId": "fieldFormats", - "scope": "common", - "docId": "kibFieldFormatsPluginApi", - "section": "def-common.SerializedFieldFormat", - "text": "SerializedFieldFormat" - }, - "<", - { - "pluginId": "fieldFormats", - "scope": "common", - "docId": "kibFieldFormatsPluginApi", - "section": "def-common.FieldFormatParams", - "text": "FieldFormatParams" - }, - ">" - ], - "path": "src/plugins/data_views/common/data_views/data_view.ts", - "deprecated": false, - "isRequired": true + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" } ], - "returnComment": [] - }, - { - "parentPluginId": "dataViews", - "id": "def-public.DataView.deleteFieldFormat", - "type": "Function", - "tags": [], - "label": "deleteFieldFormat", - "description": [], - "signature": [ - "(fieldName: string) => void" - ], - "path": "src/plugins/data_views/common/data_views/data_view.ts", + "path": "src/plugins/data_views/common/fields/data_view_field.ts", "deprecated": false, "children": [ { "parentPluginId": "dataViews", - "id": "def-public.DataView.deleteFieldFormat.$1", - "type": "string", + "id": "def-public.DataViewField.toSpec.$1", + "type": "Object", "tags": [], - "label": "fieldName", + "label": "{\n getFormatterForField,\n }", "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/data_views/common/data_views/data_view.ts", + "path": "src/plugins/data_views/common/fields/data_view_field.ts", "deprecated": false, - "isRequired": true + "children": [ + { + "parentPluginId": "dataViews", + "id": "def-public.DataViewField.toSpec.$1.getFormatterForField", + "type": "Function", + "tags": [], + "label": "getFormatterForField", + "description": [], + "signature": [ + "((field: ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.IFieldType", + "text": "IFieldType" + }, + " | ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.FieldSpec", + "text": "FieldSpec" + }, + " | ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewField", + "text": "DataViewField" + }, + ") => ", + { + "pluginId": "fieldFormats", + "scope": "common", + "docId": "kibFieldFormatsPluginApi", + "section": "def-common.FieldFormat", + "text": "FieldFormat" + }, + ") | undefined" + ], + "path": "src/plugins/data_views/common/fields/data_view_field.ts", + "deprecated": false + } + ] } ], "returnComment": [] @@ -3250,11 +3883,11 @@ }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx" + "path": "src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx" + "path": "src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx" }, { "plugin": "discover", @@ -4253,72 +4886,12 @@ "path": "src/plugins/discover/public/services/doc_views/doc_views_types.ts" }, { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/shared_imports.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_context.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_context.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/lib/remove_fields.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/lib/remove_fields.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx" }, { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/delete_field_provider.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/delete_field_provider.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx" }, { "plugin": "discover", @@ -4652,22 +5225,6 @@ "plugin": "observability", "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/components/filter_label.tsx" }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, { "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" @@ -4716,6 +5273,22 @@ "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/sources/es_agg_source/es_agg_source.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" @@ -5245,176 +5818,168 @@ "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/common.test.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/shared_imports.ts" - }, - { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/open_editor.tsx" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/shared_imports.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/open_editor.tsx" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/open_editor.tsx" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/types.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/open_editor.tsx" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/types.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/breadcrumbs.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/breadcrumbs.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/breadcrumbs.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/breadcrumbs.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/tabs.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/tabs.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/components/scripting_help/test_script.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/components/scripting_help/test_script.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/components/scripting_help/help_flyout.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/help_flyout.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/components/scripting_help/help_flyout.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/help_flyout.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" - }, - { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" }, { "plugin": "inputControlVis", @@ -5629,20 +6194,12 @@ "path": "src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/target/types/public/types.d.ts" - }, - { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/target/types/public/types.d.ts" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts" }, { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts" }, { "plugin": "inputControlVis", @@ -5677,44 +6234,44 @@ "path": "src/plugins/vis_default_editor/target/types/public/components/utils/editor_config.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/anchor.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.test.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/anchor.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.test.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/target/types/public/application/doc/components/doc.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/target/types/public/application/doc/components/doc.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/context/services/anchor.test.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/context/services/anchor.test.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/doc/components/doc.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/doc/components/doc.d.ts" }, { "plugin": "inputControlVis", @@ -5793,20 +6350,20 @@ "path": "src/plugins/discover/target/types/public/application/main/utils/nested_fields.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/target/types/public/application/main/components/sidebar/discover_index_pattern.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/edit_index_pattern/source_filters_table/components/table/table.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/target/types/public/application/main/components/sidebar/discover_index_pattern.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/edit_index_pattern/source_filters_table/components/table/table.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/source_filters_table/components/table/table.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/main/components/sidebar/discover_index_pattern.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/source_filters_table/components/table/table.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/main/components/sidebar/discover_index_pattern.d.ts" }, { "plugin": "visTypeTimeseries", @@ -5907,15 +6464,15 @@ }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx" + "path": "src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx" + "path": "src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx" + "path": "src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx" }, { "plugin": "discover", @@ -6201,42 +6758,6 @@ "plugin": "data", "path": "src/plugins/data/public/index.ts" }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/shared_imports.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" - }, { "plugin": "discover", "path": "src/plugins/discover/public/components/field_name/field_name.tsx" @@ -6467,19 +6988,19 @@ }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" }, { "plugin": "maps", @@ -6519,19 +7040,19 @@ }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { "plugin": "maps", @@ -6579,31 +7100,31 @@ }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" + "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" + "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" + "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" }, { "plugin": "maps", @@ -7006,112 +7527,112 @@ "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.d.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/shared_imports.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/shared_imports.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/lib/extract_time_fields.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/lib/extract_time_fields.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/types.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/types.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/tabs.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/tabs.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/tabs.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" }, { "plugin": "inputControlVis", @@ -7234,16 +7755,16 @@ "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/lib/extract_time_fields.test.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/lib/extract_time_fields.test.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/lib/extract_time_fields.test.ts" }, { "plugin": "visDefaultEditor", @@ -7254,12 +7775,12 @@ "path": "src/plugins/vis_default_editor/target/types/public/components/agg_param_props.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.test.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.test.ts" }, { "plugin": "visDefaultEditor", @@ -9929,12 +10450,12 @@ { "parentPluginId": "dataViews", "id": "def-server.mergeCapabilitiesWithFields.$1.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: any", "description": [], "signature": [ - "any" + "[key: string]: any" ], "path": "src/plugins/data_views/server/fetcher/lib/merge_capabilities_with_fields.ts", "deprecated": false @@ -11472,7 +11993,6 @@ ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": true, - "removeBy": "8.1", "references": [], "children": [ { @@ -11540,15 +12060,14 @@ ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": true, - "removeBy": "8.1", "references": [ { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" } ], "children": [ @@ -11593,7 +12112,6 @@ ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": true, - "removeBy": "8.1", "references": [ { "plugin": "visTypeTimeseries", @@ -11616,20 +12134,20 @@ "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { "plugin": "visTypeTimeseries", @@ -11663,11 +12181,10 @@ ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": true, - "removeBy": "8.1", "references": [ { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" } ], "children": [], @@ -11681,7 +12198,14 @@ "label": "isTimeBased", "description": [], "signature": [ - "() => boolean" + "() => this is ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.TimeBasedDataView", + "text": "TimeBasedDataView" + } ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false, @@ -11696,7 +12220,14 @@ "label": "isTimeNanosBased", "description": [], "signature": [ - "() => boolean" + "() => this is ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.TimeBasedDataView", + "text": "TimeBasedDataView" + } ], "path": "src/plugins/data_views/common/data_views/data_view.ts", "deprecated": false, @@ -14617,11 +15148,11 @@ }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx" + "path": "src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx" + "path": "src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx" }, { "plugin": "discover", @@ -15620,72 +16151,12 @@ "path": "src/plugins/discover/public/services/doc_views/doc_views_types.ts" }, { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/shared_imports.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_context.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_context.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/lib/remove_fields.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/lib/remove_fields.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx" }, { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/delete_field_provider.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/delete_field_provider.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx" }, { "plugin": "discover", @@ -16019,22 +16490,6 @@ "plugin": "observability", "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/components/filter_label.tsx" }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, - { - "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" - }, { "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" @@ -16083,6 +16538,22 @@ "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/sources/es_agg_source/es_agg_source.ts" }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, + { + "plugin": "maps", + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + }, { "plugin": "maps", "path": "x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts" @@ -16612,176 +17083,168 @@ "path": "x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/common.test.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/shared_imports.ts" - }, - { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/open_editor.tsx" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/shared_imports.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/open_editor.tsx" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/open_editor.tsx" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/types.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/open_editor.tsx" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/types.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/breadcrumbs.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/breadcrumbs.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/breadcrumbs.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/breadcrumbs.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/breadcrumbs.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/tabs.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/tabs.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/components/scripting_help/test_script.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/components/scripting_help/test_script.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/components/scripting_help/help_flyout.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/help_flyout.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/components/scripting_help/help_flyout.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/help_flyout.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" - }, - { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx" }, { "plugin": "inputControlVis", @@ -16996,20 +17459,12 @@ "path": "src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/target/types/public/types.d.ts" - }, - { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/target/types/public/types.d.ts" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts" }, { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts" + "plugin": "dataViewFieldEditor", + "path": "src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts" }, { "plugin": "inputControlVis", @@ -17044,44 +17499,44 @@ "path": "src/plugins/vis_default_editor/target/types/public/components/utils/editor_config.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/anchor.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.test.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/public/application/context/services/anchor.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.test.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/target/types/public/application/doc/components/doc.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/target/types/public/application/doc/components/doc.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/context/services/anchor.test.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/public/application/context/services/anchor.test.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/doc/components/doc.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/doc/components/doc.d.ts" }, { "plugin": "inputControlVis", @@ -17160,20 +17615,20 @@ "path": "src/plugins/discover/target/types/public/application/main/utils/nested_fields.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/target/types/public/application/main/components/sidebar/discover_index_pattern.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/edit_index_pattern/source_filters_table/components/table/table.d.ts" }, { - "plugin": "discover", - "path": "src/plugins/discover/target/types/public/application/main/components/sidebar/discover_index_pattern.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/edit_index_pattern/source_filters_table/components/table/table.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/source_filters_table/components/table/table.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/main/components/sidebar/discover_index_pattern.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/source_filters_table/components/table/table.d.ts" + "plugin": "discover", + "path": "src/plugins/discover/target/types/public/application/main/components/sidebar/discover_index_pattern.d.ts" }, { "plugin": "visTypeTimeseries", @@ -17274,15 +17729,15 @@ }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx" + "path": "src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx" + "path": "src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx" }, { "plugin": "discover", - "path": "src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx" + "path": "src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx" }, { "plugin": "discover", @@ -17568,42 +18023,6 @@ "plugin": "data", "path": "src/plugins/data/public/index.ts" }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/shared_imports.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/lib/serialization.ts" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" - }, - { - "plugin": "indexPatternFieldEditor", - "path": "src/plugins/index_pattern_field_editor/public/open_editor.tsx" - }, { "plugin": "discover", "path": "src/plugins/discover/public/components/field_name/field_name.tsx" @@ -17834,19 +18253,19 @@ }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" + "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" }, { "plugin": "maps", @@ -17886,19 +18305,19 @@ }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/index_pattern_util.ts" + "path": "x-pack/plugins/maps/public/components/single_field_select.tsx" }, { "plugin": "maps", @@ -17946,31 +18365,31 @@ }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" + "path": "x-pack/plugins/maps/public/index_pattern_util.ts" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts" + "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" + "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" }, { "plugin": "maps", - "path": "x-pack/plugins/maps/public/classes/fields/es_doc_field.ts" + "path": "x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx" }, { "plugin": "maps", @@ -18373,112 +18792,112 @@ "path": "x-pack/plugins/maps/target/types/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.d.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/shared_imports.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/shared_imports.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/lib/extract_time_fields.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/lib/extract_time_fields.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/types.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/types.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/tabs.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/tabs.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/tabs.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/field_editor/field_editor.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx" }, { "plugin": "inputControlVis", @@ -18601,16 +19020,16 @@ "path": "src/plugins/vis_default_editor/public/components/agg_params_helper.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/lib/extract_time_fields.test.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/lib/extract_time_fields.test.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/lib/extract_time_fields.test.ts" }, { "plugin": "visDefaultEditor", @@ -18621,12 +19040,12 @@ "path": "src/plugins/vis_default_editor/target/types/public/components/agg_param_props.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.test.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.test.ts" }, { "plugin": "visDefaultEditor", @@ -19744,12 +20163,19 @@ { "parentPluginId": "dataViews", "id": "def-common.FieldAttrs.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: FieldAttrSet", "description": [], "signature": [ - "any" + "[key: string]: ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.FieldAttrSet", + "text": "FieldAttrSet" + } ], "path": "src/plugins/data_views/common/types.ts", "deprecated": false @@ -20926,20 +21352,20 @@ "path": "x-pack/plugins/infra/target/types/public/pages/metrics/inventory_view/components/waffle/metric_control/index.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { "plugin": "data", @@ -21628,36 +22054,36 @@ "path": "x-pack/plugins/monitoring/target/types/public/alerts/components/param_details_form/use_derived_index_pattern.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/index_header/index_header.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/edit_index_pattern/index_header/index_header.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts" }, { "plugin": "stackAlerts", @@ -23056,6 +23482,70 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "dataViews", + "id": "def-common.TimeBasedDataView", + "type": "Interface", + "tags": [], + "label": "TimeBasedDataView", + "description": [ + "\nAn interface representing a data view that is time based." + ], + "signature": [ + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.TimeBasedDataView", + "text": "TimeBasedDataView" + }, + " extends ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataView", + "text": "DataView" + } + ], + "path": "src/plugins/data_views/common/data_views/data_view.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "dataViews", + "id": "def-common.TimeBasedDataView.timeFieldName", + "type": "string", + "tags": [], + "label": "timeFieldName", + "description": [], + "path": "src/plugins/data_views/common/data_views/data_view.ts", + "deprecated": false + }, + { + "parentPluginId": "dataViews", + "id": "def-common.TimeBasedDataView.getTimeField", + "type": "Function", + "tags": [], + "label": "getTimeField", + "description": [], + "signature": [ + "() => ", + { + "pluginId": "dataViews", + "scope": "common", + "docId": "kibDataViewsPluginApi", + "section": "def-common.DataViewField", + "text": "DataViewField" + } + ], + "path": "src/plugins/data_views/common/data_views/data_view.ts", + "deprecated": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false + }, { "parentPluginId": "dataViews", "id": "def-common.TypeMeta", @@ -23837,36 +24327,36 @@ "path": "src/plugins/data/public/index.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" } ], "initialIsOpen": false @@ -24494,12 +24984,12 @@ "path": "x-pack/plugins/stack_alerts/target/types/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.ts" }, { "plugin": "inputControlVis", @@ -24534,12 +25024,12 @@ "path": "src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.test.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/public/components/utils.test.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/public/components/utils.test.ts" }, { "plugin": "visTypeTimelion", @@ -24638,12 +25128,12 @@ "path": "src/plugins/vis_types/timelion/public/components/timelion_expression_input_helpers.test.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" }, { - "plugin": "indexPatternManagement", - "path": "src/plugins/index_pattern_management/target/types/public/components/utils.d.ts" + "plugin": "dataViewManagement", + "path": "src/plugins/data_view_management/target/types/public/components/utils.d.ts" } ], "initialIsOpen": false @@ -24686,28 +25176,28 @@ "path": "x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/shared_imports.ts" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/shared_imports.ts" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/components/index_pattern_editor_flyout_content.tsx" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/components/data_view_editor_flyout_content.tsx" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/components/index_pattern_editor_flyout_content.tsx" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/components/data_view_editor_flyout_content.tsx" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/components/index_pattern_editor_flyout_content.tsx" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/components/data_view_editor_flyout_content.tsx" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/components/index_pattern_flyout_content_container.tsx" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/components/data_view_flyout_content_container.tsx" }, { - "plugin": "indexPatternEditor", - "path": "src/plugins/index_pattern_editor/public/components/index_pattern_flyout_content_container.tsx" + "plugin": "dataViewEditor", + "path": "src/plugins/data_view_editor/public/components/data_view_flyout_content_container.tsx" } ], "initialIsOpen": false diff --git a/api_docs/data_views.mdx b/api_docs/data_views.mdx index cd2a24ba8f81c..bbce8c4dd4945 100644 --- a/api_docs/data_views.mdx +++ b/api_docs/data_views.mdx @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 668 | 5 | 526 | 5 | +| 709 | 3 | 561 | 5 | ## Client diff --git a/api_docs/data_visualizer.json b/api_docs/data_visualizer.json index 762ccaaab4fe6..9c226499aa7fc 100644 --- a/api_docs/data_visualizer.json +++ b/api_docs/data_visualizer.json @@ -484,12 +484,12 @@ { "parentPluginId": "dataVisualizer", "id": "def-common.DocumentCountBuckets.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: number", "description": [], "signature": [ - "any" + "[key: string]: number" ], "path": "x-pack/plugins/data_visualizer/common/types/field_request_config.ts", "deprecated": false diff --git a/api_docs/data_visualizer.mdx b/api_docs/data_visualizer.mdx index d3ea59bfd1371..7d335368d4be8 100644 --- a/api_docs/data_visualizer.mdx +++ b/api_docs/data_visualizer.mdx @@ -18,7 +18,7 @@ Contact [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) for q | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 84 | 5 | 84 | 0 | +| 84 | 2 | 84 | 0 | ## Client diff --git a/api_docs/deprecations_by_api.mdx b/api_docs/deprecations_by_api.mdx index 450098853a987..e4d2df978cc19 100644 --- a/api_docs/deprecations_by_api.mdx +++ b/api_docs/deprecations_by_api.mdx @@ -14,7 +14,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Referencing plugin(s) | Remove By | | ---------------|-----------|-----------| | | securitySolution | - | -| | home, savedObjects, security, fleet, indexPatternFieldEditor, discover, dashboard, lens, observability, maps, fileUpload, dataVisualizer, ml, infra, graph, monitoring, securitySolution, stackAlerts, transform, uptime, indexPatternEditor, indexPatternManagement, inputControlVis, kibanaOverview, savedObjectsManagement, visualize, visTypeTimelion, visTypeTimeseries, visTypeVega | - | +| | home, savedObjects, security, fleet, discover, dashboard, lens, observability, maps, fileUpload, dataVisualizer, ml, infra, graph, monitoring, securitySolution, stackAlerts, transform, uptime, dataViewManagement, inputControlVis, kibanaOverview, savedObjectsManagement, visualize, visTypeTimelion, visTypeTimeseries, visTypeVega | - | | | data, lens, visTypeTimeseries, infra, maps, securitySolution, timelines, visTypeTimelion | - | | | apm, security, securitySolution | - | | | apm, security, securitySolution | - | @@ -22,36 +22,45 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | dashboard, lens, maps, ml, securitySolution, security, visualize | - | | | securitySolution | - | | | dataViews, visTypeTimeseries, maps, lens, discover, data | - | -| | dataViews, discover, observability, savedObjects, security, dashboard, lens, maps, graph, stackAlerts, transform, indexPatternManagement, inputControlVis, savedObjectsManagement, visTypeTimelion, data | - | -| | dataViews, visTypeTimeseries, reporting, discover, observability, maps, dataVisualizer, apm, lens, transform, savedObjects, indexPatternFieldEditor, visualizations, dashboard, graph, stackAlerts, uptime, indexPatternEditor, indexPatternManagement, inputControlVis, savedObjectsManagement, visualize, visDefaultEditor, visTypeVega, data | - | -| | dataViews, discover, maps, dataVisualizer, lens, indexPatternFieldEditor, indexPatternEditor, indexPatternManagement, inputControlVis, visDefaultEditor, visTypeTimeseries, data | - | -| | dataViews, monitoring, indexPatternManagement, stackAlerts, transform | - | +| | dataViews, discover, observability, savedObjects, security, dashboard, lens, maps, graph, stackAlerts, transform, dataViewManagement, inputControlVis, savedObjectsManagement, visTypeTimelion, data | - | +| | dataViews, visTypeTimeseries, reporting, discover, observability, maps, dataVisualizer, apm, lens, transform, savedObjects, dataViewFieldEditor, visualizations, dashboard, graph, stackAlerts, uptime, dataViewEditor, dataViewManagement, inputControlVis, savedObjectsManagement, visualize, visDefaultEditor, visTypeVega, data | - | +| | dataViews, discover, maps, dataVisualizer, lens, dataViewEditor, dataViewManagement, inputControlVis, visDefaultEditor, visTypeTimeseries, data | - | +| | dataViews, monitoring, dataViewManagement, stackAlerts, transform | - | | | dataViews, discover, transform, canvas | - | -| | dataViews, observability, indexPatternEditor | - | -| | dataViews, indexPatternManagement | - | +| | dataViews, observability, dataViewEditor | - | +| | dataViews, dataViewManagement | - | | | dataViews | - | -| | dataViews, monitoring, indexPatternManagement, stackAlerts, transform, data | - | +| | dataViews, monitoring, dataViewManagement, stackAlerts, transform, data | - | | | dataViews, discover, transform, canvas, data | - | | | dataViews, data | - | | | dataViews, data | - | | | dataViews | - | -| | dataViews, observability, indexPatternEditor, data | - | -| | dataViews, discover, observability, savedObjects, security, dashboard, lens, maps, graph, stackAlerts, transform, indexPatternManagement, inputControlVis, savedObjectsManagement, visTypeTimelion, data | - | -| | dataViews, indexPatternManagement, data | - | +| | dataViews, observability, dataViewEditor, data | - | +| | dataViews, discover, observability, savedObjects, security, dashboard, lens, maps, graph, stackAlerts, transform, dataViewManagement, inputControlVis, savedObjectsManagement, visTypeTimelion, data | - | +| | dataViews, dataViewManagement, data | - | | | dataViews, visualizations, dashboard, data | - | -| | dataViews, discover, maps, dataVisualizer, lens, indexPatternFieldEditor, indexPatternEditor, indexPatternManagement, inputControlVis, visDefaultEditor, visTypeTimeseries, data | - | +| | dataViews, discover, maps, dataVisualizer, lens, dataViewEditor, dataViewManagement, inputControlVis, visDefaultEditor, visTypeTimeseries, data | - | | | dataViews, data | - | | | dataViews, visTypeTimeseries, maps, lens, discover, data | - | | | dataViews, discover, dashboard, lens, visualize | - | -| | dataViews, visTypeTimeseries, reporting, discover, observability, maps, dataVisualizer, apm, lens, transform, savedObjects, indexPatternFieldEditor, visualizations, dashboard, graph, stackAlerts, uptime, indexPatternEditor, indexPatternManagement, inputControlVis, savedObjectsManagement, visualize, visDefaultEditor, visTypeVega, data | - | +| | dataViews, visTypeTimeseries, reporting, discover, observability, maps, dataVisualizer, apm, lens, transform, savedObjects, dataViewFieldEditor, visualizations, dashboard, graph, stackAlerts, uptime, dataViewEditor, dataViewManagement, inputControlVis, savedObjectsManagement, visualize, visDefaultEditor, visTypeVega, data | - | | | dataViews, maps | - | +| | dataViews | - | +| | dataViewManagement, dataViews | - | +| | visTypeTimeseries, graph, dataViewManagement, dataViews | - | +| | dataViews, dataViewManagement | - | | | dataViews, discover, transform, canvas | - | -| | dataViews, discover, maps, dataVisualizer, lens, indexPatternFieldEditor, indexPatternEditor, indexPatternManagement, inputControlVis, visDefaultEditor, visTypeTimeseries | - | -| | dataViews, visTypeTimeseries, reporting, discover, observability, maps, dataVisualizer, apm, lens, transform, savedObjects, indexPatternFieldEditor, visualizations, dashboard, graph, stackAlerts, uptime, indexPatternEditor, indexPatternManagement, inputControlVis, savedObjectsManagement, visualize, visDefaultEditor, visTypeVega | - | +| | dataViews, discover, maps, dataVisualizer, lens, dataViewEditor, dataViewManagement, inputControlVis, visDefaultEditor, visTypeTimeseries | - | +| | dataViews, visTypeTimeseries, reporting, discover, observability, maps, dataVisualizer, apm, lens, transform, savedObjects, dataViewFieldEditor, visualizations, dashboard, graph, stackAlerts, uptime, dataViewEditor, dataViewManagement, inputControlVis, savedObjectsManagement, visualize, visDefaultEditor, visTypeVega | - | | | dataViews, visTypeTimeseries, maps, lens, discover | - | | | dataViews, maps | - | -| | fleet, indexPatternFieldEditor, discover, dashboard, lens, ml, stackAlerts, indexPatternManagement, visTypePie, visTypeTable, visTypeTimeseries, visTypeXy, visTypeVislib | - | +| | dataViews | - | +| | dataViewManagement, dataViews | - | +| | visTypeTimeseries, graph, dataViewManagement, dataViews | - | +| | dataViews, dataViewManagement | - | +| | fleet, dataViewFieldEditor, discover, dashboard, lens, ml, stackAlerts, dataViewManagement, visTypePie, visTypeTable, visTypeTimeseries, visTypeXy, visTypeVislib | - | | | reporting, visTypeTimeseries | - | +| | visTypeTimeseries, graph, dataViewManagement | - | | | maps | - | | | dashboard, maps, graph, visualize | - | | | spaces, security, reporting, actions, alerting, ml, fleet, remoteClusters, graph, indexLifecycleManagement, maps, painlessLab, rollup, searchprofiler, snapshotRestore, transform, upgradeAssistant | - | @@ -71,6 +80,8 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | dashboard | - | | | savedObjectsTaggingOss, dashboard | - | | | dashboard | - | +| | dataViewManagement | - | +| | dataViewManagement | - | | | spaces, savedObjectsManagement | - | | | spaces, savedObjectsManagement | - | | | reporting | - | @@ -96,47 +107,33 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | ml | - | | | actions | - | | | console | - | -| | security, reporting, apm, infra | 7.16 | -| | security, reporting, apm, infra | 7.16 | -| | security | 7.16 | -| | dataViews, fleet, infra, monitoring, stackAlerts, indexPatternManagement | 8.1 | -| | dataViews, fleet, infra, monitoring, stackAlerts, indexPatternManagement, data | 8.1 | +| | dataViews, fleet, infra, monitoring, stackAlerts, dataViewManagement | 8.1 | +| | dataViews, fleet, infra, monitoring, stackAlerts, dataViewManagement, data | 8.1 | | | dataViews | 8.1 | -| | dataViews | 8.1 | -| | indexPatternManagement, dataViews | 8.1 | -| | visTypeTimeseries, graph, indexPatternManagement, dataViews | 8.1 | -| | dataViews, indexPatternManagement | 8.1 | -| | dataViews, fleet, infra, monitoring, stackAlerts, indexPatternManagement | 8.1 | +| | dataViews, fleet, infra, monitoring, stackAlerts, dataViewManagement | 8.1 | | | dataViews | 8.1 | -| | dataViews | 8.1 | -| | indexPatternManagement, dataViews | 8.1 | -| | visTypeTimeseries, graph, indexPatternManagement, dataViews | 8.1 | -| | dataViews, indexPatternManagement | 8.1 | | | visTypeTimeseries | 8.1 | | | discover, visualizations, dashboard, lens, observability, maps, infra, dashboardEnhanced, discoverEnhanced, urlDrilldown, inputControlVis, visualize, visTypeTimelion, visTypeVega, ml, visTypeTimeseries | 8.1 | | | discover, visualizations, dashboard, lens, observability, maps, infra, dashboardEnhanced, discoverEnhanced, urlDrilldown, inputControlVis, visualize, visTypeTimelion, visTypeVega, ml, visTypeTimeseries | 8.1 | | | visTypeTimeseries | 8.1 | | | discover, visualizations, dashboard, lens, observability, maps, infra, dashboardEnhanced, discoverEnhanced, urlDrilldown, inputControlVis, visualize, visTypeTimelion, visTypeVega, ml, visTypeTimeseries | 8.1 | | | visTypeTimeseries | 8.1 | -| | visTypeTimeseries, graph, indexPatternManagement | 8.1 | | | discover, maps, inputControlVis | 8.1 | | | discover, visualizations, dashboard, lens, observability, maps, dashboardEnhanced, discoverEnhanced, visualize | 8.1 | | | discover, maps, inputControlVis | 8.1 | | | lens, infra, apm, graph, monitoring, stackAlerts, transform | 8.1 | -| | lens, stackAlerts, transform, indexPatternManagement, visTypeTimelion, visTypeVega | 8.1 | +| | lens, stackAlerts, transform, dataViewManagement, visTypeTimelion, visTypeVega | 8.1 | | | observability | 8.1 | | | observability | 8.1 | | | observability | 8.1 | | | observability | 8.1 | -| | indexPatternManagement | 8.1 | -| | indexPatternManagement | 8.1 | -| | indexPatternManagement | 8.1 | -| | indexPatternManagement | 8.1 | +| | dataViewManagement | 8.1 | +| | dataViewManagement | 8.1 | | | visTypeTimelion | 8.1 | | | visTypeTimelion | 8.1 | -| | indexPatternFieldEditor | 8.1 | -| | indexPatternFieldEditor | 8.1 | -| | indexPatternFieldEditor | 8.1 | +| | dataViewFieldEditor | 8.1 | +| | dataViewFieldEditor | 8.1 | +| | dataViewFieldEditor | 8.1 | | | visualizations, visDefaultEditor | 8.1 | | | visualizations, visDefaultEditor | 8.1 | | | visualize | 8.1 | @@ -230,7 +227,6 @@ Safe to remove. | | | | | | -| | | | | | | | diff --git a/api_docs/deprecations_by_plugin.mdx b/api_docs/deprecations_by_plugin.mdx index bce46bdee8533..c02a51628d653 100644 --- a/api_docs/deprecations_by_plugin.mdx +++ b/api_docs/deprecations_by_plugin.mdx @@ -54,8 +54,6 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode)+ 2 more | - | | | [license_context.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/public/context/license/license_context.tsx#:~:text=license%24) | - | | | [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode), [license_check.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/common/license_check.test.ts#:~:text=mode)+ 2 more | - | -| | [route.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/server/routes/data_view/route.ts#:~:text=spacesService) | 7.16 | -| | [route.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/apm/server/routes/data_view/route.ts#:~:text=getSpaceId) | 7.16 | @@ -182,6 +180,71 @@ warning: This document is auto-generated and is meant to be viewed inside our ex +## dataViewEditor + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/shared_imports.ts#:~:text=IndexPattern), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/open_editor.tsx#:~:text=IndexPattern), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/open_editor.tsx#:~:text=IndexPattern), [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/shared_imports.ts#:~:text=IndexPattern), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/open_editor.tsx#:~:text=IndexPattern), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/open_editor.tsx#:~:text=IndexPattern) | - | +| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/shared_imports.ts#:~:text=IndexPatternField), [extract_time_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/lib/extract_time_fields.ts#:~:text=IndexPatternField), [extract_time_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/lib/extract_time_fields.ts#:~:text=IndexPatternField), [extract_time_fields.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/lib/extract_time_fields.test.ts#:~:text=IndexPatternField), [extract_time_fields.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/lib/extract_time_fields.test.ts#:~:text=IndexPatternField), [extract_time_fields.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/lib/extract_time_fields.test.ts#:~:text=IndexPatternField), [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/shared_imports.ts#:~:text=IndexPatternField), [extract_time_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/lib/extract_time_fields.ts#:~:text=IndexPatternField), [extract_time_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/lib/extract_time_fields.ts#:~:text=IndexPatternField), [extract_time_fields.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/lib/extract_time_fields.test.ts#:~:text=IndexPatternField)+ 2 more | - | +| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/shared_imports.ts#:~:text=IndexPatternSpec), [data_view_editor_flyout_content.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/components/data_view_editor_flyout_content.tsx#:~:text=IndexPatternSpec), [data_view_editor_flyout_content.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/components/data_view_editor_flyout_content.tsx#:~:text=IndexPatternSpec), [data_view_editor_flyout_content.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/components/data_view_editor_flyout_content.tsx#:~:text=IndexPatternSpec), [data_view_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/components/data_view_flyout_content_container.tsx#:~:text=IndexPatternSpec), [data_view_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/components/data_view_flyout_content_container.tsx#:~:text=IndexPatternSpec) | - | +| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/shared_imports.ts#:~:text=IndexPatternSpec), [data_view_editor_flyout_content.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/components/data_view_editor_flyout_content.tsx#:~:text=IndexPatternSpec), [data_view_editor_flyout_content.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/components/data_view_editor_flyout_content.tsx#:~:text=IndexPatternSpec), [data_view_editor_flyout_content.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/components/data_view_editor_flyout_content.tsx#:~:text=IndexPatternSpec), [data_view_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/components/data_view_flyout_content_container.tsx#:~:text=IndexPatternSpec), [data_view_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/components/data_view_flyout_content_container.tsx#:~:text=IndexPatternSpec), [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/shared_imports.ts#:~:text=IndexPatternSpec), [data_view_editor_flyout_content.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/components/data_view_editor_flyout_content.tsx#:~:text=IndexPatternSpec), [data_view_editor_flyout_content.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/components/data_view_editor_flyout_content.tsx#:~:text=IndexPatternSpec), [data_view_editor_flyout_content.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/components/data_view_editor_flyout_content.tsx#:~:text=IndexPatternSpec)+ 2 more | - | +| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/shared_imports.ts#:~:text=IndexPatternField), [extract_time_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/lib/extract_time_fields.ts#:~:text=IndexPatternField), [extract_time_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/lib/extract_time_fields.ts#:~:text=IndexPatternField), [extract_time_fields.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/lib/extract_time_fields.test.ts#:~:text=IndexPatternField), [extract_time_fields.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/lib/extract_time_fields.test.ts#:~:text=IndexPatternField), [extract_time_fields.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/lib/extract_time_fields.test.ts#:~:text=IndexPatternField), [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/shared_imports.ts#:~:text=IndexPatternField), [extract_time_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/lib/extract_time_fields.ts#:~:text=IndexPatternField), [extract_time_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/lib/extract_time_fields.ts#:~:text=IndexPatternField), [extract_time_fields.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/lib/extract_time_fields.test.ts#:~:text=IndexPatternField)+ 2 more | - | +| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/shared_imports.ts#:~:text=IndexPattern), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/open_editor.tsx#:~:text=IndexPattern), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/open_editor.tsx#:~:text=IndexPattern), [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/shared_imports.ts#:~:text=IndexPattern), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/open_editor.tsx#:~:text=IndexPattern), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/open_editor.tsx#:~:text=IndexPattern) | - | +| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/shared_imports.ts#:~:text=IndexPatternField), [extract_time_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/lib/extract_time_fields.ts#:~:text=IndexPatternField), [extract_time_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/lib/extract_time_fields.ts#:~:text=IndexPatternField), [extract_time_fields.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/lib/extract_time_fields.test.ts#:~:text=IndexPatternField), [extract_time_fields.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/lib/extract_time_fields.test.ts#:~:text=IndexPatternField), [extract_time_fields.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/lib/extract_time_fields.test.ts#:~:text=IndexPatternField) | - | +| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/shared_imports.ts#:~:text=IndexPattern), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/open_editor.tsx#:~:text=IndexPattern), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_editor/public/open_editor.tsx#:~:text=IndexPattern) | - | + + + +## dataViewFieldEditor + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=IndexPattern), [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=IndexPattern), [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=IndexPattern), [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=IndexPattern), [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=IndexPattern), [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=IndexPattern), [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=IndexPattern), [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=IndexPattern) | - | +| | [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=castEsToKbnFieldTypeName), [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=castEsToKbnFieldTypeName) | 8.1 | +| | [field_editor_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_editor_context.tsx#:~:text=fieldFormats), [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=fieldFormats), [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=fieldFormats), [field_editor_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_editor_flyout_content_container.tsx#:~:text=fieldFormats), [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=fieldFormats), [setup_environment.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/__jest__/client_integration/helpers/setup_environment.tsx#:~:text=fieldFormats) | - | +| | [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=IndexPattern), [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=IndexPattern), [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=IndexPattern), [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=IndexPattern), [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=IndexPattern), [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=IndexPattern), [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=IndexPattern), [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=IndexPattern) | - | +| | [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=castEsToKbnFieldTypeName), [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=castEsToKbnFieldTypeName) | 8.1 | +| | [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=IndexPattern), [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=IndexPattern), [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=IndexPattern), [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=IndexPattern) | - | +| | [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=castEsToKbnFieldTypeName), [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=castEsToKbnFieldTypeName) | 8.1 | + + + +## dataViewManagement + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IndexPatternsContract), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IndexPatternsContract), [utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.test.ts#:~:text=IndexPatternsContract), [utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.test.ts#:~:text=IndexPatternsContract), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternsContract), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternsContract), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IndexPatternsContract), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IndexPatternsContract), [utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.test.ts#:~:text=IndexPatternsContract), [utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.test.ts#:~:text=IndexPatternsContract)+ 2 more | - | +| | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx#:~:text=IndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx#:~:text=IndexPattern)+ 82 more | - | +| | [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/types.ts#:~:text=IndexPatternField), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/types.ts#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField)+ 42 more | - | +| | [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx#:~:text=IIndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx#:~:text=IIndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx#:~:text=IIndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx#:~:text=IIndexPattern), [index_header.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/index_header/index_header.tsx#:~:text=IIndexPattern), [index_header.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/index_header/index_header.tsx#:~:text=IIndexPattern), [index_header.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts#:~:text=IIndexPattern), [index_header.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts#:~:text=IIndexPattern) | - | +| | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IFieldType), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IFieldType), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/target/types/public/components/utils.d.ts#:~:text=IFieldType), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/target/types/public/components/utils.d.ts#:~:text=IFieldType) | 8.1 | +| | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IndexPatternListItem), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IndexPatternListItem), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IndexPatternListItem), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IndexPatternListItem), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternListItem), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternListItem), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternListItem), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternListItem) | - | +| | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/field_editor/constants/index.ts#:~:text=getKbnTypeNames), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/field_editor/constants/index.ts#:~:text=getKbnTypeNames) | 8.1 | +| | [scripted_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx#:~:text=indexPatterns), [tabs.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/tabs/tabs.tsx#:~:text=indexPatterns), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=indexPatterns), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=indexPatterns), [edit_index_pattern_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx#:~:text=indexPatterns), [edit_index_pattern_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx#:~:text=indexPatterns), [create_edit_field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx#:~:text=indexPatterns), [create_edit_field_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx#:~:text=indexPatterns), [create_edit_field_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx#:~:text=indexPatterns) | - | +| | [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/field_editor/field_editor.tsx#:~:text=fieldFormats), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/field_editor/field_editor.tsx#:~:text=fieldFormats), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/field_editor/field_editor.tsx#:~:text=fieldFormats), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/field_editor/field_editor.tsx#:~:text=fieldFormats), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/field_editor/field_editor.tsx#:~:text=fieldFormats), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/field_editor/field_editor.tsx#:~:text=fieldFormats) | - | +| | [test_script.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/field_editor/components/scripting_help/test_script.tsx#:~:text=esQuery), [test_script.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/field_editor/components/scripting_help/test_script.tsx#:~:text=esQuery), [test_script.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/field_editor/components/scripting_help/test_script.tsx#:~:text=esQuery) | 8.1 | +| | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IFieldType), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IFieldType), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/target/types/public/components/utils.d.ts#:~:text=IFieldType), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/target/types/public/components/utils.d.ts#:~:text=IFieldType), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IFieldType), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IFieldType), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/target/types/public/components/utils.d.ts#:~:text=IFieldType), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/target/types/public/components/utils.d.ts#:~:text=IFieldType) | 8.1 | +| | [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx#:~:text=IIndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx#:~:text=IIndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx#:~:text=IIndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx#:~:text=IIndexPattern), [index_header.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/index_header/index_header.tsx#:~:text=IIndexPattern), [index_header.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/index_header/index_header.tsx#:~:text=IIndexPattern), [index_header.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts#:~:text=IIndexPattern), [index_header.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts#:~:text=IIndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx#:~:text=IIndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx#:~:text=IIndexPattern)+ 6 more | - | +| | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IndexPatternsContract), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IndexPatternsContract), [utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.test.ts#:~:text=IndexPatternsContract), [utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.test.ts#:~:text=IndexPatternsContract), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternsContract), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternsContract), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IndexPatternsContract), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IndexPatternsContract), [utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.test.ts#:~:text=IndexPatternsContract), [utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.test.ts#:~:text=IndexPatternsContract)+ 2 more | - | +| | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IndexPatternListItem), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IndexPatternListItem), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IndexPatternListItem), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IndexPatternListItem), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternListItem), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternListItem), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternListItem), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternListItem), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IndexPatternListItem), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IndexPatternListItem)+ 6 more | - | +| | [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/types.ts#:~:text=IndexPatternField), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/types.ts#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField)+ 42 more | - | +| | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx#:~:text=IndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx#:~:text=IndexPattern)+ 82 more | - | +| | [scripted_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx#:~:text=removeScriptedField), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/field_editor/field_editor.tsx#:~:text=removeScriptedField), [scripted_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx#:~:text=removeScriptedField), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/field_editor/field_editor.tsx#:~:text=removeScriptedField) | - | +| | [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields) | - | +| | [scripted_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx#:~:text=getScriptedFields), [scripted_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx#:~:text=getScriptedFields) | - | +| | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/field_editor/constants/index.ts#:~:text=getKbnTypeNames), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/field_editor/constants/index.ts#:~:text=getKbnTypeNames) | 8.1 | +| | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IFieldType), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IFieldType), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/target/types/public/components/utils.d.ts#:~:text=IFieldType), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/target/types/public/components/utils.d.ts#:~:text=IFieldType) | 8.1 | +| | [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/types.ts#:~:text=IndexPatternField), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/types.ts#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField)+ 16 more | - | +| | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/utils.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx#:~:text=IndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx#:~:text=IndexPattern)+ 36 more | - | +| | [scripted_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx#:~:text=removeScriptedField), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/field_editor/field_editor.tsx#:~:text=removeScriptedField) | - | +| | [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields) | - | +| | [scripted_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx#:~:text=getScriptedFields) | - | +| | [scripted_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx#:~:text=removeScriptedField), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/field_editor/field_editor.tsx#:~:text=removeScriptedField) | - | +| | [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields) | - | +| | [scripted_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx#:~:text=getScriptedFields) | - | + + + ## dataViews | Deprecated API | Reference location(s) | Remove By | @@ -213,10 +276,10 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/index.ts#:~:text=IndexPattern), [data_view_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.test.ts#:~:text=IndexPattern), [data_view_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.test.ts#:~:text=IndexPattern), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/public/index.ts#:~:text=IndexPattern), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=IndexPattern), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=IndexPattern), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=IndexPattern), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=IndexPattern) | - | | | [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=intervalName), [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=intervalName), [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=intervalName), [update_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/server/routes/update_index_pattern.ts#:~:text=intervalName), [update_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/server/routes/update_index_pattern.ts#:~:text=intervalName) | 8.1 | | | [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=flattenHit) | - | -| | [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=addScriptedField), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=addScriptedField), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=addScriptedField) | 8.1 | -| | [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=removeScriptedField) | 8.1 | -| | [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=getNonScriptedFields) | 8.1 | -| | [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=getScriptedFields), [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=getScriptedFields), [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=getScriptedFields), [data_views.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_views.ts#:~:text=getScriptedFields), [register_index_pattern_usage_collection.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/server/register_index_pattern_usage_collection.ts#:~:text=getScriptedFields), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=getScriptedFields), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=getScriptedFields), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=getScriptedFields), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=getScriptedFields), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=getScriptedFields)+ 1 more | 8.1 | +| | [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=addScriptedField), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=addScriptedField), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=addScriptedField) | - | +| | [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=removeScriptedField) | - | +| | [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=getNonScriptedFields) | - | +| | [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=getScriptedFields), [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=getScriptedFields), [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=getScriptedFields), [data_views.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_views.ts#:~:text=getScriptedFields), [register_index_pattern_usage_collection.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/server/register_index_pattern_usage_collection.ts#:~:text=getScriptedFields), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=getScriptedFields), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=getScriptedFields), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=getScriptedFields), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=getScriptedFields), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=getScriptedFields)+ 1 more | - | | | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/utils.ts#:~:text=IFieldType), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/utils.ts#:~:text=IFieldType), [data_view_field.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.ts#:~:text=IFieldType), [data_view_field.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [field_list.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/field_list.ts#:~:text=IFieldType), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/types.ts#:~:text=IFieldType), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/types.ts#:~:text=IFieldType)+ 13 more | 8.1 | | | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/index.ts#:~:text=IndexPatternAttributes), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/server/utils.ts#:~:text=IndexPatternAttributes), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/server/utils.ts#:~:text=IndexPatternAttributes), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/server/utils.ts#:~:text=IndexPatternAttributes), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/server/utils.ts#:~:text=IndexPatternAttributes), [scripted_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/server/deprecations/scripted_fields.ts#:~:text=IndexPatternAttributes), [scripted_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/server/deprecations/scripted_fields.ts#:~:text=IndexPatternAttributes) | - | | | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/index.ts#:~:text=IndexPatternField), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/public/index.ts#:~:text=IndexPatternField), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=IndexPatternField), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=IndexPatternField), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=IndexPatternField), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=IndexPatternField), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=IndexPatternField), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=IndexPatternField), [data_view_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.test.ts#:~:text=IndexPatternField), [data_view_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/fields/data_view_field.test.ts#:~:text=IndexPatternField)+ 2 more | - | @@ -224,10 +287,10 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/index.ts#:~:text=IndexPatternsService), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/public/index.ts#:~:text=IndexPatternsService), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/index.ts#:~:text=IndexPatternsService), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/public/index.ts#:~:text=IndexPatternsService) | - | | | [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=intervalName), [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=intervalName), [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=intervalName), [update_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/server/routes/update_index_pattern.ts#:~:text=intervalName), [update_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/server/routes/update_index_pattern.ts#:~:text=intervalName) | 8.1 | | | [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=flattenHit) | - | -| | [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=addScriptedField), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=addScriptedField), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=addScriptedField) | 8.1 | -| | [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=removeScriptedField) | 8.1 | -| | [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=getNonScriptedFields) | 8.1 | -| | [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=getScriptedFields), [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=getScriptedFields), [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=getScriptedFields), [data_views.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_views.ts#:~:text=getScriptedFields), [register_index_pattern_usage_collection.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/server/register_index_pattern_usage_collection.ts#:~:text=getScriptedFields), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=getScriptedFields), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=getScriptedFields), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=getScriptedFields), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=getScriptedFields), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=getScriptedFields)+ 1 more | 8.1 | +| | [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=addScriptedField), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=addScriptedField), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=addScriptedField) | - | +| | [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=removeScriptedField) | - | +| | [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=getNonScriptedFields) | - | +| | [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=getScriptedFields), [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=getScriptedFields), [data_view.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.ts#:~:text=getScriptedFields), [data_views.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_views.ts#:~:text=getScriptedFields), [register_index_pattern_usage_collection.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/server/register_index_pattern_usage_collection.ts#:~:text=getScriptedFields), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=getScriptedFields), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=getScriptedFields), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=getScriptedFields), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=getScriptedFields), [data_view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/data_views/common/data_views/data_view.test.ts#:~:text=getScriptedFields)+ 1 more | - | @@ -252,7 +315,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/utils/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/utils/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/utils/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/utils/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/utils/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/utils/popularize_field.test.ts#:~:text=IndexPatternsService), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService)+ 6 more | - | | | [use_data_grid_columns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/utils/use_data_grid_columns.ts#:~:text=IndexPatternsContract), [use_data_grid_columns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/utils/use_data_grid_columns.ts#:~:text=IndexPatternsContract), [use_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/utils/use_index_pattern.tsx#:~:text=IndexPatternsContract), [use_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/utils/use_index_pattern.tsx#:~:text=IndexPatternsContract), [resolve_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/utils/resolve_index_pattern.ts#:~:text=IndexPatternsContract), [resolve_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/utils/resolve_index_pattern.ts#:~:text=IndexPatternsContract), [use_data_grid_columns.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/utils/use_data_grid_columns.d.ts#:~:text=IndexPatternsContract), [use_data_grid_columns.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/utils/use_data_grid_columns.d.ts#:~:text=IndexPatternsContract), [resolve_index_pattern.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/main/utils/resolve_index_pattern.d.ts#:~:text=IndexPatternsContract), [resolve_index_pattern.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/main/utils/resolve_index_pattern.d.ts#:~:text=IndexPatternsContract)+ 26 more | - | | | [helpers.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/doc_table/components/table_header/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/doc_table/components/table_header/helpers.tsx#:~:text=IndexPattern), [discover_grid_flyout.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/discover_grid_flyout.tsx#:~:text=IndexPattern), [discover_grid_flyout.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/discover_grid_flyout.tsx#:~:text=IndexPattern), [discover_grid_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/discover_grid_context.tsx#:~:text=IndexPattern), [discover_grid_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/discover_grid_context.tsx#:~:text=IndexPattern), [get_render_cell_value.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/get_render_cell_value.tsx#:~:text=IndexPattern), [get_render_cell_value.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/get_render_cell_value.tsx#:~:text=IndexPattern), [discover_grid_columns.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/discover_grid_columns.tsx#:~:text=IndexPattern), [discover_grid_columns.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/discover_grid_columns.tsx#:~:text=IndexPattern)+ 382 more | - | -| | [discover_grid_cell_actions.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/discover_grid_cell_actions.tsx#:~:text=IndexPatternField), [discover_grid_cell_actions.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/discover_grid_cell_actions.tsx#:~:text=IndexPatternField), [doc_table_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/doc_table/doc_table_wrapper.tsx#:~:text=IndexPatternField), [doc_table_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/doc_table/doc_table_wrapper.tsx#:~:text=IndexPatternField), [field_stats_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx#:~:text=IndexPatternField), [field_stats_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx#:~:text=IndexPatternField), [field_stats_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx#:~:text=IndexPatternField), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=IndexPatternField), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=IndexPatternField), [context_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/context_app.tsx#:~:text=IndexPatternField)+ 198 more | - | +| | [discover_grid_cell_actions.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/discover_grid_cell_actions.tsx#:~:text=IndexPatternField), [discover_grid_cell_actions.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/discover_grid_cell_actions.tsx#:~:text=IndexPatternField), [doc_table_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/doc_table/doc_table_wrapper.tsx#:~:text=IndexPatternField), [doc_table_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/doc_table/doc_table_wrapper.tsx#:~:text=IndexPatternField), [field_stats_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx#:~:text=IndexPatternField), [field_stats_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx#:~:text=IndexPatternField), [field_stats_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx#:~:text=IndexPatternField), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=IndexPatternField), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=IndexPatternField), [context_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/context_app.tsx#:~:text=IndexPatternField)+ 198 more | - | | | [discover_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/sidebar/discover_index_pattern.tsx#:~:text=IndexPatternAttributes), [discover_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/sidebar/discover_index_pattern.tsx#:~:text=IndexPatternAttributes), [discover_index_pattern.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/main/components/sidebar/discover_index_pattern.d.ts#:~:text=IndexPatternAttributes), [discover_index_pattern.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/main/components/sidebar/discover_index_pattern.d.ts#:~:text=IndexPatternAttributes), [discover_sidebar_responsive.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.tsx#:~:text=IndexPatternAttributes), [discover_sidebar_responsive.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.tsx#:~:text=IndexPatternAttributes), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/layout/types.ts#:~:text=IndexPatternAttributes), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/layout/types.ts#:~:text=IndexPatternAttributes), [discover_main_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/discover_main_app.tsx#:~:text=IndexPatternAttributes), [discover_main_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/discover_main_app.tsx#:~:text=IndexPatternAttributes)+ 3 more | - | | | [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=create), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=create) | - | | | [anchor.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/services/anchor.ts#:~:text=fetch), [fetch_hits_in_interval.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/utils/fetch_hits_in_interval.ts#:~:text=fetch) | 8.1 | @@ -262,7 +325,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/types.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=Filter)+ 22 more | 8.1 | | | [discover_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/sidebar/discover_index_pattern.tsx#:~:text=IndexPatternAttributes), [discover_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/sidebar/discover_index_pattern.tsx#:~:text=IndexPatternAttributes), [discover_index_pattern.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/main/components/sidebar/discover_index_pattern.d.ts#:~:text=IndexPatternAttributes), [discover_index_pattern.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/main/components/sidebar/discover_index_pattern.d.ts#:~:text=IndexPatternAttributes), [discover_sidebar_responsive.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.tsx#:~:text=IndexPatternAttributes), [discover_sidebar_responsive.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.tsx#:~:text=IndexPatternAttributes), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/layout/types.ts#:~:text=IndexPatternAttributes), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/layout/types.ts#:~:text=IndexPatternAttributes), [discover_main_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/discover_main_app.tsx#:~:text=IndexPatternAttributes), [discover_main_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/discover_main_app.tsx#:~:text=IndexPatternAttributes)+ 16 more | - | | | [use_data_grid_columns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/utils/use_data_grid_columns.ts#:~:text=IndexPatternsContract), [use_data_grid_columns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/utils/use_data_grid_columns.ts#:~:text=IndexPatternsContract), [use_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/utils/use_index_pattern.tsx#:~:text=IndexPatternsContract), [use_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/utils/use_index_pattern.tsx#:~:text=IndexPatternsContract), [resolve_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/utils/resolve_index_pattern.ts#:~:text=IndexPatternsContract), [resolve_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/utils/resolve_index_pattern.ts#:~:text=IndexPatternsContract), [use_data_grid_columns.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/utils/use_data_grid_columns.d.ts#:~:text=IndexPatternsContract), [use_data_grid_columns.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/utils/use_data_grid_columns.d.ts#:~:text=IndexPatternsContract), [resolve_index_pattern.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/main/utils/resolve_index_pattern.d.ts#:~:text=IndexPatternsContract), [resolve_index_pattern.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/main/utils/resolve_index_pattern.d.ts#:~:text=IndexPatternsContract)+ 26 more | - | -| | [discover_grid_cell_actions.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/discover_grid_cell_actions.tsx#:~:text=IndexPatternField), [discover_grid_cell_actions.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/discover_grid_cell_actions.tsx#:~:text=IndexPatternField), [doc_table_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/doc_table/doc_table_wrapper.tsx#:~:text=IndexPatternField), [doc_table_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/doc_table/doc_table_wrapper.tsx#:~:text=IndexPatternField), [field_stats_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx#:~:text=IndexPatternField), [field_stats_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx#:~:text=IndexPatternField), [field_stats_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx#:~:text=IndexPatternField), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=IndexPatternField), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=IndexPatternField), [context_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/context_app.tsx#:~:text=IndexPatternField)+ 198 more | - | +| | [discover_grid_cell_actions.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/discover_grid_cell_actions.tsx#:~:text=IndexPatternField), [discover_grid_cell_actions.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/discover_grid_cell_actions.tsx#:~:text=IndexPatternField), [doc_table_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/doc_table/doc_table_wrapper.tsx#:~:text=IndexPatternField), [doc_table_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/doc_table/doc_table_wrapper.tsx#:~:text=IndexPatternField), [field_stats_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx#:~:text=IndexPatternField), [field_stats_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx#:~:text=IndexPatternField), [field_stats_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx#:~:text=IndexPatternField), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=IndexPatternField), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=IndexPatternField), [context_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/context_app.tsx#:~:text=IndexPatternField)+ 198 more | - | | | [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/utils/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/utils/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/utils/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/utils/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/utils/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/utils/popularize_field.test.ts#:~:text=IndexPatternsService), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService)+ 6 more | - | | | [discover_main_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/discover_main_route.tsx#:~:text=ensureDefaultDataView), [discover_main_route.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/discover_main_route.tsx#:~:text=ensureDefaultDataView) | - | | | [helpers.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/doc_table/components/table_header/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/doc_table/components/table_header/helpers.tsx#:~:text=IndexPattern), [discover_grid_flyout.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/discover_grid_flyout.tsx#:~:text=IndexPattern), [discover_grid_flyout.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/discover_grid_flyout.tsx#:~:text=IndexPattern), [discover_grid_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/discover_grid_context.tsx#:~:text=IndexPattern), [discover_grid_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/discover_grid_context.tsx#:~:text=IndexPattern), [get_render_cell_value.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/get_render_cell_value.tsx#:~:text=IndexPattern), [get_render_cell_value.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/get_render_cell_value.tsx#:~:text=IndexPattern), [discover_grid_columns.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/discover_grid_columns.tsx#:~:text=IndexPattern), [discover_grid_columns.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/discover_grid_columns.tsx#:~:text=IndexPattern)+ 382 more | - | @@ -270,7 +333,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=create), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=create) | - | | | [anchor.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/services/anchor.ts#:~:text=fetch), [fetch_hits_in_interval.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/utils/fetch_hits_in_interval.ts#:~:text=fetch) | 8.1 | | | [discover_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/sidebar/discover_index_pattern.tsx#:~:text=IndexPatternAttributes), [discover_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/sidebar/discover_index_pattern.tsx#:~:text=IndexPatternAttributes), [discover_index_pattern.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/main/components/sidebar/discover_index_pattern.d.ts#:~:text=IndexPatternAttributes), [discover_index_pattern.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/target/types/public/application/main/components/sidebar/discover_index_pattern.d.ts#:~:text=IndexPatternAttributes), [discover_sidebar_responsive.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.tsx#:~:text=IndexPatternAttributes), [discover_sidebar_responsive.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.tsx#:~:text=IndexPatternAttributes), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/layout/types.ts#:~:text=IndexPatternAttributes), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/layout/types.ts#:~:text=IndexPatternAttributes), [discover_main_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/discover_main_app.tsx#:~:text=IndexPatternAttributes), [discover_main_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/discover_main_app.tsx#:~:text=IndexPatternAttributes)+ 3 more | - | -| | [discover_grid_cell_actions.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/discover_grid_cell_actions.tsx#:~:text=IndexPatternField), [discover_grid_cell_actions.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/discover_grid_cell_actions.tsx#:~:text=IndexPatternField), [doc_table_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/doc_table/doc_table_wrapper.tsx#:~:text=IndexPatternField), [doc_table_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/doc_table/doc_table_wrapper.tsx#:~:text=IndexPatternField), [field_stats_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx#:~:text=IndexPatternField), [field_stats_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx#:~:text=IndexPatternField), [field_stats_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx#:~:text=IndexPatternField), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=IndexPatternField), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=IndexPatternField), [context_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/context_app.tsx#:~:text=IndexPatternField)+ 94 more | - | +| | [discover_grid_cell_actions.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/discover_grid_cell_actions.tsx#:~:text=IndexPatternField), [discover_grid_cell_actions.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/discover_grid_cell_actions.tsx#:~:text=IndexPatternField), [doc_table_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/doc_table/doc_table_wrapper.tsx#:~:text=IndexPatternField), [doc_table_wrapper.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/doc_table/doc_table_wrapper.tsx#:~:text=IndexPatternField), [field_stats_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx#:~:text=IndexPatternField), [field_stats_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx#:~:text=IndexPatternField), [field_stats_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx#:~:text=IndexPatternField), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=IndexPatternField), [saved_search_embeddable.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx#:~:text=IndexPatternField), [context_app.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/context/context_app.tsx#:~:text=IndexPatternField)+ 94 more | - | | | [helpers.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/doc_table/components/table_header/helpers.tsx#:~:text=IndexPattern), [helpers.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/doc_table/components/table_header/helpers.tsx#:~:text=IndexPattern), [discover_grid_flyout.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/discover_grid_flyout.tsx#:~:text=IndexPattern), [discover_grid_flyout.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/discover_grid_flyout.tsx#:~:text=IndexPattern), [discover_grid_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/discover_grid_context.tsx#:~:text=IndexPattern), [discover_grid_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/discover_grid_context.tsx#:~:text=IndexPattern), [get_render_cell_value.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/get_render_cell_value.tsx#:~:text=IndexPattern), [get_render_cell_value.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/get_render_cell_value.tsx#:~:text=IndexPattern), [discover_grid_columns.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/discover_grid_columns.tsx#:~:text=IndexPattern), [discover_grid_columns.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/components/discover_grid/discover_grid_columns.tsx#:~:text=IndexPattern)+ 186 more | - | | | [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/utils/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/utils/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/utils/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/utils/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/utils/popularize_field.test.ts#:~:text=IndexPatternsService), [popularize_field.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/utils/popularize_field.test.ts#:~:text=IndexPatternsService), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService), [index_patterns.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/__mocks__/index_patterns.ts#:~:text=IndexPatternsService)+ 6 more | - | | | [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [url_generator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/url_generator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [locator.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/locator.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/embeddable/types.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=Filter), [discover_state.ts](https://github.com/elastic/kibana/tree/master/src/plugins/discover/public/application/main/services/discover_state.ts#:~:text=Filter)+ 22 more | 8.1 | @@ -354,10 +417,10 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [search_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/components/search_bar.tsx#:~:text=esKuery), [search_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/components/search_bar.tsx#:~:text=esKuery), [search_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/components/search_bar.tsx#:~:text=esKuery) | 8.1 | | | [application.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/application.ts#:~:text=IndexPatternsContract), [application.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/application.ts#:~:text=IndexPatternsContract), [application.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/application.ts#:~:text=IndexPatternsContract), [application.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/application.ts#:~:text=IndexPatternsContract) | - | | | [app_state.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/types/app_state.ts#:~:text=IndexPattern), [app_state.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/types/app_state.ts#:~:text=IndexPattern), [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=IndexPattern), [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=IndexPattern), [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=IndexPattern), [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=IndexPattern), [datasource.sagas.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/state_management/datasource.sagas.ts#:~:text=IndexPattern), [datasource.sagas.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/state_management/datasource.sagas.ts#:~:text=IndexPattern), [search_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/components/search_bar.tsx#:~:text=IndexPattern), [search_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/components/search_bar.tsx#:~:text=IndexPattern)+ 44 more | - | -| | [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=getNonScriptedFields), [datasource.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/state_management/datasource.test.ts#:~:text=getNonScriptedFields), [deserialize.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.test.ts#:~:text=getNonScriptedFields), [deserialize.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.test.ts#:~:text=getNonScriptedFields), [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=getNonScriptedFields), [datasource.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/state_management/datasource.test.ts#:~:text=getNonScriptedFields), [deserialize.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.test.ts#:~:text=getNonScriptedFields), [deserialize.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.test.ts#:~:text=getNonScriptedFields) | 8.1 | +| | [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=getNonScriptedFields), [datasource.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/state_management/datasource.test.ts#:~:text=getNonScriptedFields), [deserialize.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.test.ts#:~:text=getNonScriptedFields), [deserialize.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.test.ts#:~:text=getNonScriptedFields), [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=getNonScriptedFields), [datasource.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/state_management/datasource.test.ts#:~:text=getNonScriptedFields), [deserialize.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.test.ts#:~:text=getNonScriptedFields), [deserialize.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.test.ts#:~:text=getNonScriptedFields) | - | | | [app_state.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/types/app_state.ts#:~:text=IndexPattern), [app_state.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/types/app_state.ts#:~:text=IndexPattern), [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=IndexPattern), [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=IndexPattern), [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=IndexPattern), [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=IndexPattern), [datasource.sagas.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/state_management/datasource.sagas.ts#:~:text=IndexPattern), [datasource.sagas.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/state_management/datasource.sagas.ts#:~:text=IndexPattern), [search_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/components/search_bar.tsx#:~:text=IndexPattern), [search_bar.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/components/search_bar.tsx#:~:text=IndexPattern)+ 17 more | - | -| | [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=getNonScriptedFields), [datasource.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/state_management/datasource.test.ts#:~:text=getNonScriptedFields), [deserialize.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.test.ts#:~:text=getNonScriptedFields), [deserialize.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.test.ts#:~:text=getNonScriptedFields) | 8.1 | -| | [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=getNonScriptedFields), [datasource.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/state_management/datasource.test.ts#:~:text=getNonScriptedFields), [deserialize.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.test.ts#:~:text=getNonScriptedFields), [deserialize.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.test.ts#:~:text=getNonScriptedFields) | 8.1 | +| | [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=getNonScriptedFields), [datasource.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/state_management/datasource.test.ts#:~:text=getNonScriptedFields), [deserialize.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.test.ts#:~:text=getNonScriptedFields), [deserialize.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.test.ts#:~:text=getNonScriptedFields) | - | +| | [deserialize.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.ts#:~:text=getNonScriptedFields), [datasource.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/state_management/datasource.test.ts#:~:text=getNonScriptedFields), [deserialize.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.test.ts#:~:text=getNonScriptedFields), [deserialize.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/services/persistence/deserialize.test.ts#:~:text=getNonScriptedFields) | - | | | [save_modal.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/components/save_modal.tsx#:~:text=SavedObjectSaveModal), [save_modal.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/components/save_modal.tsx#:~:text=SavedObjectSaveModal) | - | | | [listing_route.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/apps/listing_route.tsx#:~:text=settings), [listing_route.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/public/apps/listing_route.tsx#:~:text=settings) | - | | | [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/graph/server/plugin.ts#:~:text=license%24) | - | @@ -380,76 +443,6 @@ warning: This document is auto-generated and is meant to be viewed inside our ex -## indexPatternEditor - -| Deprecated API | Reference location(s) | Remove By | -| ---------------|-----------|-----------| -| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/shared_imports.ts#:~:text=IndexPattern), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/open_editor.tsx#:~:text=IndexPattern), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/open_editor.tsx#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/types.ts#:~:text=IndexPattern), [types.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/target/types/public/types.d.ts#:~:text=IndexPattern), [types.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/target/types/public/types.d.ts#:~:text=IndexPattern), [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/shared_imports.ts#:~:text=IndexPattern), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/open_editor.tsx#:~:text=IndexPattern), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/open_editor.tsx#:~:text=IndexPattern)+ 4 more | - | -| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/shared_imports.ts#:~:text=IndexPatternField), [extract_time_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts#:~:text=IndexPatternField), [extract_time_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts#:~:text=IndexPatternField), [extract_time_fields.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts#:~:text=IndexPatternField), [extract_time_fields.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts#:~:text=IndexPatternField), [extract_time_fields.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts#:~:text=IndexPatternField), [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/shared_imports.ts#:~:text=IndexPatternField), [extract_time_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts#:~:text=IndexPatternField), [extract_time_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts#:~:text=IndexPatternField), [extract_time_fields.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts#:~:text=IndexPatternField)+ 2 more | - | -| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/shared_imports.ts#:~:text=IndexPatternSpec), [index_pattern_editor_flyout_content.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/components/index_pattern_editor_flyout_content.tsx#:~:text=IndexPatternSpec), [index_pattern_editor_flyout_content.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/components/index_pattern_editor_flyout_content.tsx#:~:text=IndexPatternSpec), [index_pattern_editor_flyout_content.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/components/index_pattern_editor_flyout_content.tsx#:~:text=IndexPatternSpec), [index_pattern_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/components/index_pattern_flyout_content_container.tsx#:~:text=IndexPatternSpec), [index_pattern_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/components/index_pattern_flyout_content_container.tsx#:~:text=IndexPatternSpec) | - | -| | [plugin.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/plugin.tsx#:~:text=indexPatterns), [plugin.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/plugin.tsx#:~:text=indexPatterns) | - | -| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/shared_imports.ts#:~:text=IndexPatternSpec), [index_pattern_editor_flyout_content.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/components/index_pattern_editor_flyout_content.tsx#:~:text=IndexPatternSpec), [index_pattern_editor_flyout_content.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/components/index_pattern_editor_flyout_content.tsx#:~:text=IndexPatternSpec), [index_pattern_editor_flyout_content.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/components/index_pattern_editor_flyout_content.tsx#:~:text=IndexPatternSpec), [index_pattern_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/components/index_pattern_flyout_content_container.tsx#:~:text=IndexPatternSpec), [index_pattern_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/components/index_pattern_flyout_content_container.tsx#:~:text=IndexPatternSpec), [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/shared_imports.ts#:~:text=IndexPatternSpec), [index_pattern_editor_flyout_content.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/components/index_pattern_editor_flyout_content.tsx#:~:text=IndexPatternSpec), [index_pattern_editor_flyout_content.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/components/index_pattern_editor_flyout_content.tsx#:~:text=IndexPatternSpec), [index_pattern_editor_flyout_content.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/components/index_pattern_editor_flyout_content.tsx#:~:text=IndexPatternSpec)+ 2 more | - | -| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/shared_imports.ts#:~:text=IndexPatternField), [extract_time_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts#:~:text=IndexPatternField), [extract_time_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts#:~:text=IndexPatternField), [extract_time_fields.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts#:~:text=IndexPatternField), [extract_time_fields.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts#:~:text=IndexPatternField), [extract_time_fields.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts#:~:text=IndexPatternField), [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/shared_imports.ts#:~:text=IndexPatternField), [extract_time_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts#:~:text=IndexPatternField), [extract_time_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts#:~:text=IndexPatternField), [extract_time_fields.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts#:~:text=IndexPatternField)+ 2 more | - | -| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/shared_imports.ts#:~:text=IndexPattern), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/open_editor.tsx#:~:text=IndexPattern), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/open_editor.tsx#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/types.ts#:~:text=IndexPattern), [types.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/target/types/public/types.d.ts#:~:text=IndexPattern), [types.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/target/types/public/types.d.ts#:~:text=IndexPattern), [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/shared_imports.ts#:~:text=IndexPattern), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/open_editor.tsx#:~:text=IndexPattern), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/open_editor.tsx#:~:text=IndexPattern)+ 4 more | - | -| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/shared_imports.ts#:~:text=IndexPatternField), [extract_time_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts#:~:text=IndexPatternField), [extract_time_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.ts#:~:text=IndexPatternField), [extract_time_fields.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts#:~:text=IndexPatternField), [extract_time_fields.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts#:~:text=IndexPatternField), [extract_time_fields.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/lib/extract_time_fields.test.ts#:~:text=IndexPatternField) | - | -| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/shared_imports.ts#:~:text=IndexPattern), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/open_editor.tsx#:~:text=IndexPattern), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/open_editor.tsx#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/public/types.ts#:~:text=IndexPattern), [types.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/target/types/public/types.d.ts#:~:text=IndexPattern), [types.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_editor/target/types/public/types.d.ts#:~:text=IndexPattern) | - | - - - -## indexPatternFieldEditor - -| Deprecated API | Reference location(s) | Remove By | -| ---------------|-----------|-----------| -| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/shared_imports.ts#:~:text=IndexPattern), [field_editor_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_context.tsx#:~:text=IndexPattern), [field_editor_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_context.tsx#:~:text=IndexPattern), [serialization.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/serialization.ts#:~:text=IndexPattern), [serialization.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/serialization.ts#:~:text=IndexPattern), [remove_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/remove_fields.ts#:~:text=IndexPattern), [remove_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/remove_fields.ts#:~:text=IndexPattern), [open_delete_modal.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx#:~:text=IndexPattern), [open_delete_modal.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx#:~:text=IndexPattern), [delete_field_provider.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/delete_field_provider.tsx#:~:text=IndexPattern)+ 28 more | - | -| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/shared_imports.ts#:~:text=IndexPatternField), [serialization.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/serialization.ts#:~:text=IndexPatternField), [serialization.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/serialization.ts#:~:text=IndexPatternField), [field_editor_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx#:~:text=IndexPatternField), [field_editor_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx#:~:text=IndexPatternField), [field_editor_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx#:~:text=IndexPatternField), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_editor.tsx#:~:text=IndexPatternField), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_editor.tsx#:~:text=IndexPatternField), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_editor.tsx#:~:text=IndexPatternField), [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/shared_imports.ts#:~:text=IndexPatternField)+ 8 more | - | -| | [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=castEsToKbnFieldTypeName), [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=castEsToKbnFieldTypeName) | 8.1 | -| | [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/plugin.ts#:~:text=indexPatterns), [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/plugin.ts#:~:text=indexPatterns) | - | -| | [field_editor_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_context.tsx#:~:text=fieldFormats), [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=fieldFormats), [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=fieldFormats), [field_editor_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx#:~:text=fieldFormats), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_editor.tsx#:~:text=fieldFormats), [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/plugin.ts#:~:text=fieldFormats), [field_format_editor.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/target/types/public/components/field_format_editor/field_format_editor.d.ts#:~:text=fieldFormats), [setup_environment.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/__jest__/client_integration/helpers/setup_environment.tsx#:~:text=fieldFormats) | - | -| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/shared_imports.ts#:~:text=IndexPatternField), [serialization.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/serialization.ts#:~:text=IndexPatternField), [serialization.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/serialization.ts#:~:text=IndexPatternField), [field_editor_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx#:~:text=IndexPatternField), [field_editor_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx#:~:text=IndexPatternField), [field_editor_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx#:~:text=IndexPatternField), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_editor.tsx#:~:text=IndexPatternField), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_editor.tsx#:~:text=IndexPatternField), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_editor.tsx#:~:text=IndexPatternField), [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/shared_imports.ts#:~:text=IndexPatternField)+ 8 more | - | -| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/shared_imports.ts#:~:text=IndexPattern), [field_editor_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_context.tsx#:~:text=IndexPattern), [field_editor_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_context.tsx#:~:text=IndexPattern), [serialization.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/serialization.ts#:~:text=IndexPattern), [serialization.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/serialization.ts#:~:text=IndexPattern), [remove_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/remove_fields.ts#:~:text=IndexPattern), [remove_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/remove_fields.ts#:~:text=IndexPattern), [open_delete_modal.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx#:~:text=IndexPattern), [open_delete_modal.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx#:~:text=IndexPattern), [delete_field_provider.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/delete_field_provider.tsx#:~:text=IndexPattern)+ 28 more | - | -| | [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=castEsToKbnFieldTypeName), [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=castEsToKbnFieldTypeName) | 8.1 | -| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/shared_imports.ts#:~:text=IndexPatternField), [serialization.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/serialization.ts#:~:text=IndexPatternField), [serialization.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/serialization.ts#:~:text=IndexPatternField), [field_editor_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx#:~:text=IndexPatternField), [field_editor_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx#:~:text=IndexPatternField), [field_editor_flyout_content_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx#:~:text=IndexPatternField), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_editor.tsx#:~:text=IndexPatternField), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_editor.tsx#:~:text=IndexPatternField), [open_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_editor.tsx#:~:text=IndexPatternField) | - | -| | [shared_imports.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/shared_imports.ts#:~:text=IndexPattern), [field_editor_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_context.tsx#:~:text=IndexPattern), [field_editor_context.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_editor_context.tsx#:~:text=IndexPattern), [serialization.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/serialization.ts#:~:text=IndexPattern), [serialization.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/serialization.ts#:~:text=IndexPattern), [remove_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/remove_fields.ts#:~:text=IndexPattern), [remove_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/lib/remove_fields.ts#:~:text=IndexPattern), [open_delete_modal.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx#:~:text=IndexPattern), [open_delete_modal.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx#:~:text=IndexPattern), [delete_field_provider.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/delete_field_provider.tsx#:~:text=IndexPattern)+ 9 more | - | -| | [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=castEsToKbnFieldTypeName), [field_format_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_field_editor/public/components/field_format_editor/field_format_editor.tsx#:~:text=castEsToKbnFieldTypeName) | 8.1 | - - - -## indexPatternManagement - -| Deprecated API | Reference location(s) | Remove By | -| ---------------|-----------|-----------| -| | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternsContract), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternsContract), [utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.test.ts#:~:text=IndexPatternsContract), [utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.test.ts#:~:text=IndexPatternsContract), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternsContract), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternsContract), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternsContract), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternsContract), [utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.test.ts#:~:text=IndexPatternsContract), [utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.test.ts#:~:text=IndexPatternsContract)+ 2 more | - | -| | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx#:~:text=IndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx#:~:text=IndexPattern)+ 82 more | - | -| | [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts#:~:text=IndexPatternField), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField)+ 42 more | - | -| | [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx#:~:text=IIndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx#:~:text=IIndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx#:~:text=IIndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx#:~:text=IIndexPattern), [index_header.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx#:~:text=IIndexPattern), [index_header.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx#:~:text=IIndexPattern), [index_header.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts#:~:text=IIndexPattern), [index_header.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts#:~:text=IIndexPattern) | - | -| | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IFieldType), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IFieldType), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IFieldType), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IFieldType) | 8.1 | -| | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternListItem), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternListItem), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternListItem), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternListItem), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternListItem), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternListItem), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternListItem), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternListItem) | - | -| | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/constants/index.ts#:~:text=getKbnTypeNames), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/constants/index.ts#:~:text=getKbnTypeNames) | 8.1 | -| | [scripted_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx#:~:text=indexPatterns), [tabs.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx#:~:text=indexPatterns), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=indexPatterns), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=indexPatterns), [edit_index_pattern_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx#:~:text=indexPatterns), [edit_index_pattern_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx#:~:text=indexPatterns), [create_edit_field.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx#:~:text=indexPatterns), [create_edit_field_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx#:~:text=indexPatterns), [create_edit_field_container.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx#:~:text=indexPatterns) | - | -| | [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx#:~:text=fieldFormats), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx#:~:text=fieldFormats), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx#:~:text=fieldFormats), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx#:~:text=fieldFormats), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx#:~:text=fieldFormats), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx#:~:text=fieldFormats) | - | -| | [test_script.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx#:~:text=esQuery), [test_script.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx#:~:text=esQuery), [test_script.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx#:~:text=esQuery) | 8.1 | -| | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IFieldType), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IFieldType), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IFieldType), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IFieldType), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IFieldType), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IFieldType), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IFieldType), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IFieldType) | 8.1 | -| | [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx#:~:text=IIndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx#:~:text=IIndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx#:~:text=IIndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx#:~:text=IIndexPattern), [index_header.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx#:~:text=IIndexPattern), [index_header.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx#:~:text=IIndexPattern), [index_header.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts#:~:text=IIndexPattern), [index_header.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/edit_index_pattern/index_header/index_header.d.ts#:~:text=IIndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx#:~:text=IIndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx#:~:text=IIndexPattern)+ 6 more | - | -| | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternsContract), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternsContract), [utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.test.ts#:~:text=IndexPatternsContract), [utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.test.ts#:~:text=IndexPatternsContract), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternsContract), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternsContract), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternsContract), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternsContract), [utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.test.ts#:~:text=IndexPatternsContract), [utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.test.ts#:~:text=IndexPatternsContract)+ 2 more | - | -| | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternListItem), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternListItem), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternListItem), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternListItem), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternListItem), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternListItem), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternListItem), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IndexPatternListItem), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternListItem), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPatternListItem)+ 6 more | - | -| | [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts#:~:text=IndexPatternField), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField)+ 42 more | - | -| | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx#:~:text=IndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx#:~:text=IndexPattern)+ 82 more | - | -| | [scripted_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx#:~:text=removeScriptedField), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx#:~:text=removeScriptedField), [scripted_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx#:~:text=removeScriptedField), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx#:~:text=removeScriptedField) | 8.1 | -| | [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields) | 8.1 | -| | [scripted_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx#:~:text=getScriptedFields), [scripted_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx#:~:text=getScriptedFields) | 8.1 | -| | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/constants/index.ts#:~:text=getKbnTypeNames), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/constants/index.ts#:~:text=getKbnTypeNames) | 8.1 | -| | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IFieldType), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IFieldType), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IFieldType), [utils.d.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/target/types/public/components/utils.d.ts#:~:text=IFieldType) | 8.1 | -| | [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts#:~:text=IndexPatternField), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [indexed_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts#:~:text=IndexPatternField)+ 16 more | - | -| | [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPattern), [utils.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/utils.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [breadcrumbs.ts](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/breadcrumbs.ts#:~:text=IndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx#:~:text=IndexPattern), [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx#:~:text=IndexPattern)+ 36 more | - | -| | [scripted_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx#:~:text=removeScriptedField), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx#:~:text=removeScriptedField) | 8.1 | -| | [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields) | 8.1 | -| | [scripted_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx#:~:text=getScriptedFields) | 8.1 | -| | [scripted_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx#:~:text=removeScriptedField), [field_editor.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx#:~:text=removeScriptedField) | 8.1 | -| | [table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields), [edit_index_pattern.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx#:~:text=getNonScriptedFields) | 8.1 | -| | [scripted_fields_table.tsx](https://github.com/elastic/kibana/tree/master/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx#:~:text=getScriptedFields) | 8.1 | - - - ## infra | Deprecated API | Reference location(s) | Remove By | @@ -465,8 +458,6 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [kibana_framework_adapter.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts#:~:text=indexPatternsServiceFactory), [log_entries_search_strategy.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/server/services/log_entries/log_entries_search_strategy.ts#:~:text=indexPatternsServiceFactory), [log_entry_search_strategy.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/server/services/log_entries/log_entry_search_strategy.ts#:~:text=indexPatternsServiceFactory) | - | | | [module_list_card.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/components/logging/log_analysis_setup/setup_flyout/module_list_card.tsx#:~:text=getUrl) | - | | | [module_list_card.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/public/components/logging/log_analysis_setup/setup_flyout/module_list_card.tsx#:~:text=getUrl) | - | -| | [kibana_framework_adapter.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts#:~:text=spacesService), [kibana_framework_adapter.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts#:~:text=spacesService), [kibana_framework_adapter.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts#:~:text=spacesService), [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/server/plugin.ts#:~:text=spacesService) | 7.16 | -| | [kibana_framework_adapter.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts#:~:text=getSpaceId), [kibana_framework_adapter.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts#:~:text=getSpaceId), [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/infra/server/plugin.ts#:~:text=getSpaceId) | 7.16 | @@ -580,19 +571,19 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [kibana_server_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/kibana_server_services.ts#:~:text=IndexPatternsService), [kibana_server_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/kibana_server_services.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService), [kibana_server_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/kibana_server_services.ts#:~:text=IndexPatternsService), [kibana_server_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/kibana_server_services.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService) | - | | | [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract), [index.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/lazy_load_bundle/index.d.ts#:~:text=IndexPatternsContract), [index.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/lazy_load_bundle/index.d.ts#:~:text=IndexPatternsContract), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract), [index.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/lazy_load_bundle/index.d.ts#:~:text=IndexPatternsContract), [index.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/lazy_load_bundle/index.d.ts#:~:text=IndexPatternsContract) | - | | | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#:~:text=IndexPattern), [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPattern), [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPattern), [agg_field_types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/agg/agg_field_types.ts#:~:text=IndexPattern), [agg_field_types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/agg/agg_field_types.ts#:~:text=IndexPattern), [percentile_agg_field.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.ts#:~:text=IndexPattern), [percentile_agg_field.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.ts#:~:text=IndexPattern), [es_geo_grid_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx#:~:text=IndexPattern), [es_geo_grid_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx#:~:text=IndexPattern)+ 206 more | - | -| | [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPatternField), [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPatternField), [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPatternField), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPatternField), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPatternField), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField)+ 272 more | - | +| | [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPatternField), [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPatternField), [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPatternField), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPatternField), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPatternField), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPatternField), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=IndexPatternField), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=IndexPatternField), [es_doc_field.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#:~:text=IndexPatternField), [es_doc_field.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#:~:text=IndexPatternField)+ 272 more | - | | | [es_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts#:~:text=fetch), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=fetch), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=fetch) | 8.1 | | | [kibana_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/kibana_services.ts#:~:text=indexPatterns) | - | | | [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=esFilters), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=esFilters), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=esFilters), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=esFilters), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=esFilters), [es_geo_line_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_geo_line_source/es_geo_line_source.tsx#:~:text=esFilters), [es_geo_line_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_geo_line_source/es_geo_line_source.tsx#:~:text=esFilters), [es_geo_line_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_geo_line_source/es_geo_line_source.tsx#:~:text=esFilters), [app_sync.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/routes/map_page/url_state/app_sync.ts#:~:text=esFilters), [app_sync.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/routes/map_page/url_state/app_sync.ts#:~:text=esFilters)+ 9 more | 8.1 | | | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/reducers/map/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/reducers/map/types.ts#:~:text=Filter), [tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts#:~:text=Filter), [tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts#:~:text=Filter), [tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts#:~:text=Filter), [tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts#:~:text=Filter), [vector_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx#:~:text=Filter), [vector_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx#:~:text=Filter), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=Filter), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=Filter)+ 117 more | 8.1 | | | [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract), [index.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/lazy_load_bundle/index.d.ts#:~:text=IndexPatternsContract), [index.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/lazy_load_bundle/index.d.ts#:~:text=IndexPatternsContract), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/lazy_load_bundle/index.ts#:~:text=IndexPatternsContract), [index.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/lazy_load_bundle/index.d.ts#:~:text=IndexPatternsContract), [index.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/public/lazy_load_bundle/index.d.ts#:~:text=IndexPatternsContract) | - | -| | [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPatternField), [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPatternField), [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPatternField), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPatternField), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPatternField), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField)+ 272 more | - | +| | [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPatternField), [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPatternField), [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPatternField), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPatternField), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPatternField), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPatternField), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=IndexPatternField), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=IndexPatternField), [es_doc_field.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#:~:text=IndexPatternField), [es_doc_field.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#:~:text=IndexPatternField)+ 272 more | - | | | [kibana_server_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/kibana_server_services.ts#:~:text=IndexPatternsService), [kibana_server_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/kibana_server_services.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService), [kibana_server_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/kibana_server_services.ts#:~:text=IndexPatternsService), [kibana_server_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/kibana_server_services.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService) | - | | | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#:~:text=IndexPattern), [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPattern), [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPattern), [agg_field_types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/agg/agg_field_types.ts#:~:text=IndexPattern), [agg_field_types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/agg/agg_field_types.ts#:~:text=IndexPattern), [percentile_agg_field.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.ts#:~:text=IndexPattern), [percentile_agg_field.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.ts#:~:text=IndexPattern), [es_geo_grid_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx#:~:text=IndexPattern), [es_geo_grid_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx#:~:text=IndexPattern)+ 206 more | - | | | [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=flattenHit), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=flattenHit), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=flattenHit), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=flattenHit) | - | | | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/reducers/map/types.ts#:~:text=Filter), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/reducers/map/types.ts#:~:text=Filter), [tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts#:~:text=Filter), [tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts#:~:text=Filter), [tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts#:~:text=Filter), [tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/tooltip_property.ts#:~:text=Filter), [vector_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx#:~:text=Filter), [vector_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/vector_source/vector_source.tsx#:~:text=Filter), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=Filter), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=Filter)+ 117 more | 8.1 | | | [es_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_source/es_source.ts#:~:text=fetch), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=fetch), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=fetch) | 8.1 | -| | [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPatternField), [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPatternField), [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPatternField), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPatternField), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPatternField), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField), [single_field_select.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/components/single_field_select.tsx#:~:text=IndexPatternField)+ 131 more | - | +| | [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPatternField), [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPatternField), [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPatternField), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPatternField), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPatternField), [es_agg_utils.d.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/target/types/common/elasticsearch_util/es_agg_utils.d.ts#:~:text=IndexPatternField), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=IndexPatternField), [es_tooltip_property.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts#:~:text=IndexPatternField), [es_doc_field.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#:~:text=IndexPatternField), [es_doc_field.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/es_doc_field.ts#:~:text=IndexPatternField)+ 131 more | - | | | [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#:~:text=IndexPattern), [types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/embeddable/types.ts#:~:text=IndexPattern), [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPattern), [es_agg_utils.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts#:~:text=IndexPattern), [agg_field_types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/agg/agg_field_types.ts#:~:text=IndexPattern), [agg_field_types.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/agg/agg_field_types.ts#:~:text=IndexPattern), [percentile_agg_field.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.ts#:~:text=IndexPattern), [percentile_agg_field.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.ts#:~:text=IndexPattern), [es_geo_grid_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx#:~:text=IndexPattern), [es_geo_grid_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx#:~:text=IndexPattern)+ 98 more | - | | | [kibana_server_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/kibana_server_services.ts#:~:text=IndexPatternsService), [kibana_server_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/kibana_server_services.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService), [kibana_server_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/kibana_server_services.ts#:~:text=IndexPatternsService), [kibana_server_services.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/kibana_server_services.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService), [create_doc_source.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/server/data_indexing/create_doc_source.ts#:~:text=IndexPatternsService) | - | | | [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=flattenHit), [es_search_source.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx#:~:text=flattenHit) | - | @@ -614,8 +605,8 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [apply_influencer_filters_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/ui_actions/apply_influencer_filters_action.tsx#:~:text=Filter), [apply_influencer_filters_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/ui_actions/apply_influencer_filters_action.tsx#:~:text=Filter), [apply_entity_filters_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/ui_actions/apply_entity_filters_action.tsx#:~:text=Filter), [apply_entity_filters_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/ui_actions/apply_entity_filters_action.tsx#:~:text=Filter) | 8.1 | | | [apply_influencer_filters_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/ui_actions/apply_influencer_filters_action.tsx#:~:text=Filter), [apply_influencer_filters_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/ui_actions/apply_influencer_filters_action.tsx#:~:text=Filter), [apply_entity_filters_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/ui_actions/apply_entity_filters_action.tsx#:~:text=Filter), [apply_entity_filters_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/ui_actions/apply_entity_filters_action.tsx#:~:text=Filter) | 8.1 | | | [apply_influencer_filters_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/ui_actions/apply_influencer_filters_action.tsx#:~:text=Filter), [apply_influencer_filters_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/ui_actions/apply_influencer_filters_action.tsx#:~:text=Filter), [apply_entity_filters_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/ui_actions/apply_entity_filters_action.tsx#:~:text=Filter), [apply_entity_filters_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/ui_actions/apply_entity_filters_action.tsx#:~:text=Filter) | 8.1 | -| | [use_create_url.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/contexts/kibana/use_create_url.ts#:~:text=getUrl), [use_create_url.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/contexts/kibana/use_create_url.ts#:~:text=getUrl), [main_tabs.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/components/navigation_menu/main_tabs.tsx#:~:text=getUrl), [anomaly_detection_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/overview/components/anomaly_detection_panel/anomaly_detection_panel.tsx#:~:text=getUrl), [anomaly_detection_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/overview/components/anomaly_detection_panel/anomaly_detection_panel.tsx#:~:text=getUrl), [use_view_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_view/use_view_action.tsx#:~:text=getUrl), [use_map_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_map/use_map_action.tsx#:~:text=getUrl), [analytics_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/overview/components/analytics_panel/analytics_panel.tsx#:~:text=getUrl), [page.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx#:~:text=getUrl), [page.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/new_job/recognize/page.tsx#:~:text=getUrl)+ 15 more | - | -| | [use_create_url.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/contexts/kibana/use_create_url.ts#:~:text=getUrl), [use_create_url.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/contexts/kibana/use_create_url.ts#:~:text=getUrl), [main_tabs.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/components/navigation_menu/main_tabs.tsx#:~:text=getUrl), [anomaly_detection_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/overview/components/anomaly_detection_panel/anomaly_detection_panel.tsx#:~:text=getUrl), [anomaly_detection_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/overview/components/anomaly_detection_panel/anomaly_detection_panel.tsx#:~:text=getUrl), [use_view_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_view/use_view_action.tsx#:~:text=getUrl), [use_map_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_map/use_map_action.tsx#:~:text=getUrl), [analytics_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/overview/components/analytics_panel/analytics_panel.tsx#:~:text=getUrl), [page.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx#:~:text=getUrl), [page.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/new_job/recognize/page.tsx#:~:text=getUrl)+ 15 more | - | +| | [use_create_url.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/contexts/kibana/use_create_url.ts#:~:text=getUrl), [use_create_url.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/contexts/kibana/use_create_url.ts#:~:text=getUrl), [main_tabs.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/components/navigation_menu/main_tabs.tsx#:~:text=getUrl), [anomaly_detection_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/overview/components/anomaly_detection_panel/anomaly_detection_panel.tsx#:~:text=getUrl), [anomaly_detection_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/overview/components/anomaly_detection_panel/anomaly_detection_panel.tsx#:~:text=getUrl), [use_view_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_view/use_view_action.tsx#:~:text=getUrl), [use_map_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_map/use_map_action.tsx#:~:text=getUrl), [analytics_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/overview/components/analytics_panel/analytics_panel.tsx#:~:text=getUrl), [page.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx#:~:text=getUrl), [page.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/new_job/recognize/page.tsx#:~:text=getUrl)+ 14 more | - | +| | [use_create_url.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/contexts/kibana/use_create_url.ts#:~:text=getUrl), [use_create_url.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/contexts/kibana/use_create_url.ts#:~:text=getUrl), [main_tabs.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/components/navigation_menu/main_tabs.tsx#:~:text=getUrl), [anomaly_detection_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/overview/components/anomaly_detection_panel/anomaly_detection_panel.tsx#:~:text=getUrl), [anomaly_detection_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/overview/components/anomaly_detection_panel/anomaly_detection_panel.tsx#:~:text=getUrl), [use_view_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_view/use_view_action.tsx#:~:text=getUrl), [use_map_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_map/use_map_action.tsx#:~:text=getUrl), [analytics_panel.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/overview/components/analytics_panel/analytics_panel.tsx#:~:text=getUrl), [page.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx#:~:text=getUrl), [page.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/jobs/new_job/recognize/page.tsx#:~:text=getUrl)+ 14 more | - | | | [check_license.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/application/license/check_license.tsx#:~:text=license%24), [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/public/plugin.ts#:~:text=license%24) | - | | | [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/server/plugin.ts#:~:text=license%24), [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/server/plugin.ts#:~:text=license%24) | - | | | [annotations.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/ml/server/routes/annotations.ts#:~:text=authc) | - | @@ -713,8 +704,6 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [get_csv_panel_action.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/reporting/public/panel_actions/get_csv_panel_action.tsx#:~:text=license%24), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/reporting/public/share_context_menu/index.ts#:~:text=license%24), [index.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/reporting/public/management/index.ts#:~:text=license%24), [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/reporting/public/plugin.ts#:~:text=license%24), [get_csv_panel_action.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/reporting/public/panel_actions/get_csv_panel_action.test.ts#:~:text=license%24) | - | | | [reporting_usage_collector.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/reporting/server/usage/reporting_usage_collector.ts#:~:text=license%24), [core.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/reporting/server/core.ts#:~:text=license%24) | - | | | [get_user.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/reporting/server/routes/lib/get_user.ts#:~:text=authc) | - | -| | [core.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/reporting/server/core.ts#:~:text=spacesService), [core.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/reporting/server/core.ts#:~:text=spacesService), [core.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/reporting/server/core.ts#:~:text=spacesService) | 7.16 | -| | [core.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/reporting/server/core.ts#:~:text=getSpaceId) | 7.16 | @@ -792,9 +781,6 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [plugin.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/public/plugin.tsx#:~:text=license%24) | - | | | [license_service.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/common/licensing/license_service.test.ts#:~:text=mode), [license_service.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/common/licensing/license_service.test.ts#:~:text=mode) | - | | | [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/server/plugin.ts#:~:text=license%24) | - | -| | [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/server/plugin.ts#:~:text=spacesService), [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/server/plugin.ts#:~:text=spacesService), [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/server/plugin.ts#:~:text=spacesService), [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/server/plugin.ts#:~:text=spacesService) | 7.16 | -| | [audit_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/server/audit/audit_service.ts#:~:text=getSpaceId), [check_privileges_dynamically.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/server/authorization/check_privileges_dynamically.ts#:~:text=getSpaceId), [plugin.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/server/plugin.ts#:~:text=getSpaceId), [check_privileges_dynamically.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/server/authorization/check_privileges_dynamically.test.ts#:~:text=getSpaceId) | 7.16 | -| | [check_saved_objects_privileges.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/server/authorization/check_saved_objects_privileges.ts#:~:text=namespaceToSpaceId), [check_saved_objects_privileges.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/server/authorization/check_saved_objects_privileges.ts#:~:text=namespaceToSpaceId), [secure_saved_objects_client_wrapper.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/server/saved_objects/secure_saved_objects_client_wrapper.ts#:~:text=namespaceToSpaceId), [secure_saved_objects_client_wrapper.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/server/saved_objects/secure_saved_objects_client_wrapper.ts#:~:text=namespaceToSpaceId), [secure_saved_objects_client_wrapper.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/server/saved_objects/secure_saved_objects_client_wrapper.ts#:~:text=namespaceToSpaceId), [check_privileges_dynamically.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/server/authorization/check_privileges_dynamically.test.ts#:~:text=namespaceToSpaceId), [check_saved_objects_privileges.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/server/authorization/check_saved_objects_privileges.test.ts#:~:text=namespaceToSpaceId), [check_saved_objects_privileges.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/server/authorization/check_saved_objects_privileges.test.ts#:~:text=namespaceToSpaceId), [check_saved_objects_privileges.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/server/authorization/check_saved_objects_privileges.test.ts#:~:text=namespaceToSpaceId), [check_saved_objects_privileges.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/server/authorization/check_saved_objects_privileges.test.ts#:~:text=namespaceToSpaceId)+ 10 more | 7.16 | | | [account_management_app.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/public/account_management/account_management_app.test.ts#:~:text=appBasePath), [access_agreement_app.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/public/authentication/access_agreement/access_agreement_app.test.ts#:~:text=appBasePath), [logged_out_app.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/public/authentication/logged_out/logged_out_app.test.ts#:~:text=appBasePath), [login_app.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/public/authentication/login/login_app.test.ts#:~:text=appBasePath), [logout_app.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/public/authentication/logout/logout_app.test.ts#:~:text=appBasePath), [overwritten_session_app.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/public/authentication/overwritten_session/overwritten_session_app.test.ts#:~:text=appBasePath) | - | | | [account_management_app.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/public/account_management/account_management_app.test.ts#:~:text=onAppLeave), [access_agreement_app.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/public/authentication/access_agreement/access_agreement_app.test.ts#:~:text=onAppLeave), [logged_out_app.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/public/authentication/logged_out/logged_out_app.test.ts#:~:text=onAppLeave), [login_app.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/public/authentication/login/login_app.test.ts#:~:text=onAppLeave), [logout_app.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/public/authentication/logout/logout_app.test.ts#:~:text=onAppLeave), [overwritten_session_app.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/security/public/authentication/overwritten_session/overwritten_session_app.test.ts#:~:text=onAppLeave) | - | @@ -887,8 +873,8 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [external_links.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/upgrade_assistant/public/application/components/overview/fix_logs_step/external_links.tsx#:~:text=getUrl), [app_context.mock.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/upgrade_assistant/__jest__/client_integration/helpers/app_context.mock.ts#:~:text=getUrl) | - | -| | [external_links.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/upgrade_assistant/public/application/components/overview/fix_logs_step/external_links.tsx#:~:text=getUrl), [app_context.mock.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/upgrade_assistant/__jest__/client_integration/helpers/app_context.mock.ts#:~:text=getUrl) | - | +| | [external_links.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecation_logs/fix_deprecation_logs/external_links.tsx#:~:text=getUrl), [app_context.mock.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/upgrade_assistant/__jest__/client_integration/helpers/app_context.mock.ts#:~:text=getUrl) | - | +| | [external_links.tsx](https://github.com/elastic/kibana/tree/master/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecation_logs/fix_deprecation_logs/external_links.tsx#:~:text=getUrl), [app_context.mock.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/upgrade_assistant/__jest__/client_integration/helpers/app_context.mock.ts#:~:text=getUrl) | - | | | [reindex_service.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts#:~:text=license%24), [reindex_service.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.test.ts#:~:text=license%24), [reindex_service.test.ts](https://github.com/elastic/kibana/tree/master/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.test.ts#:~:text=license%24) | - | @@ -977,17 +963,17 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField)+ 2 more | - | | | [abstract_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts#:~:text=IndexPatternsService), [abstract_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts#:~:text=IndexPatternsService), [default_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/default_search_strategy.ts#:~:text=IndexPatternsService), [default_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/default_search_strategy.ts#:~:text=IndexPatternsService), [cached_index_pattern_fetcher.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.ts#:~:text=IndexPatternsService), [cached_index_pattern_fetcher.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.ts#:~:text=IndexPatternsService), [rollup_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts#:~:text=IndexPatternsService), [rollup_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts#:~:text=IndexPatternsService), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/types.ts#:~:text=IndexPatternsService), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/types.ts#:~:text=IndexPatternsService)+ 44 more | - | | | [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/types/index.ts#:~:text=IndexPattern), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/types/index.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern)+ 36 more | - | -| | [abstract_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts#:~:text=getNonScriptedFields), [fetch_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/lib/fetch_fields.ts#:~:text=getNonScriptedFields), [abstract_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts#:~:text=getNonScriptedFields), [fetch_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/lib/fetch_fields.ts#:~:text=getNonScriptedFields) | 8.1 | +| | [abstract_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts#:~:text=getNonScriptedFields), [fetch_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/lib/fetch_fields.ts#:~:text=getNonScriptedFields), [abstract_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts#:~:text=getNonScriptedFields), [fetch_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/lib/fetch_fields.ts#:~:text=getNonScriptedFields) | - | | | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/types/index.ts#:~:text=Filter), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/types/index.ts#:~:text=Filter) | 8.1 | | | [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/vis_data/request_processors/table/types.ts#:~:text=EsQueryConfig), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/vis_data/request_processors/table/types.ts#:~:text=EsQueryConfig) | 8.1 | | | [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField), [convert_series_to_datatable.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_datatable.test.ts#:~:text=IndexPatternField) | - | | | [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [cached_index_pattern_fetcher.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.test.ts#:~:text=IndexPattern), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/types/index.ts#:~:text=IndexPattern), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/types/index.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern), [index_patterns_utils.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/index_patterns_utils.test.ts#:~:text=IndexPattern)+ 13 more | - | | | [abstract_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts#:~:text=IndexPatternsService), [abstract_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts#:~:text=IndexPatternsService), [default_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/default_search_strategy.ts#:~:text=IndexPatternsService), [default_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/default_search_strategy.ts#:~:text=IndexPatternsService), [cached_index_pattern_fetcher.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.ts#:~:text=IndexPatternsService), [cached_index_pattern_fetcher.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/lib/cached_index_pattern_fetcher.ts#:~:text=IndexPatternsService), [rollup_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts#:~:text=IndexPatternsService), [rollup_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/rollup_search_strategy.ts#:~:text=IndexPatternsService), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/types.ts#:~:text=IndexPatternsService), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/types.ts#:~:text=IndexPatternsService)+ 44 more | - | -| | [abstract_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts#:~:text=getNonScriptedFields), [fetch_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/lib/fetch_fields.ts#:~:text=getNonScriptedFields) | 8.1 | +| | [abstract_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts#:~:text=getNonScriptedFields), [fetch_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/lib/fetch_fields.ts#:~:text=getNonScriptedFields) | - | | | [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/plugin.ts#:~:text=fieldFormats) | - | | | [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/types/index.ts#:~:text=Filter), [index.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/common/types/index.ts#:~:text=Filter) | 8.1 | | | [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/vis_data/request_processors/table/types.ts#:~:text=EsQueryConfig), [types.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/vis_data/request_processors/table/types.ts#:~:text=EsQueryConfig) | 8.1 | -| | [abstract_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts#:~:text=getNonScriptedFields), [fetch_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/lib/fetch_fields.ts#:~:text=getNonScriptedFields) | 8.1 | +| | [abstract_search_strategy.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts#:~:text=getNonScriptedFields), [fetch_fields.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/public/application/lib/fetch_fields.ts#:~:text=getNonScriptedFields) | - | | | [plugin.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/timeseries/server/plugin.ts#:~:text=indexPatternsServiceFactory) | - | @@ -997,7 +983,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| | | [extract_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts#:~:text=IndexPattern), [extract_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts#:~:text=IndexPattern), [extract_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts#:~:text=IndexPattern), [extract_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts#:~:text=IndexPattern), [extract_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts#:~:text=IndexPattern), [extract_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts#:~:text=IndexPattern) | - | -| | [search_api.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/data_model/search_api.ts#:~:text=indexPatterns), [vega_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/vega_request_handler.ts#:~:text=indexPatterns), [extract_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts#:~:text=indexPatterns), [search_api.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/data_model/search_api.test.ts#:~:text=indexPatterns), [search_api.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/data_model/search_api.test.ts#:~:text=indexPatterns), [search_api.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/data_model/search_api.test.ts#:~:text=indexPatterns), [view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/vega_view/vega_map_view/view.test.ts#:~:text=indexPatterns) | - | +| | [search_api.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/data_model/search_api.ts#:~:text=indexPatterns), [extract_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts#:~:text=indexPatterns), [search_api.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/data_model/search_api.test.ts#:~:text=indexPatterns), [search_api.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/data_model/search_api.test.ts#:~:text=indexPatterns), [search_api.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/data_model/search_api.test.ts#:~:text=indexPatterns), [view.test.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/vega_view/vega_map_view/view.test.ts#:~:text=indexPatterns) | - | | | [vega_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/vega_request_handler.ts#:~:text=esQuery), [vega_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/vega_request_handler.ts#:~:text=esQuery), [vega_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/vega_request_handler.ts#:~:text=esQuery) | 8.1 | | | [vega_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/vega_request_handler.ts#:~:text=Filter), [vega_request_handler.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/vega_request_handler.ts#:~:text=Filter) | 8.1 | | | [extract_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts#:~:text=IndexPattern), [extract_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts#:~:text=IndexPattern), [extract_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts#:~:text=IndexPattern), [extract_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts#:~:text=IndexPattern), [extract_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts#:~:text=IndexPattern), [extract_index_pattern.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/vega/public/lib/extract_index_pattern.ts#:~:text=IndexPattern) | - | diff --git a/api_docs/embeddable.json b/api_docs/embeddable.json index cda4be2d4d995..6852779989c7a 100644 --- a/api_docs/embeddable.json +++ b/api_docs/embeddable.json @@ -5492,12 +5492,12 @@ { "parentPluginId": "embeddable", "id": "def-public.Adapters.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: any", "description": [], "signature": [ - "any" + "[key: string]: any" ], "path": "src/plugins/inspector/common/adapters/types.ts", "deprecated": false @@ -7804,12 +7804,19 @@ { "parentPluginId": "embeddable", "id": "def-public.OutputSpec.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: PropertySpec", "description": [], "signature": [ - "any" + "[key: string]: ", + { + "pluginId": "embeddable", + "scope": "public", + "docId": "kibEmbeddablePluginApi", + "section": "def-public.PropertySpec", + "text": "PropertySpec" + } ], "path": "src/plugins/embeddable/public/lib/embeddables/embeddable_factory.ts", "deprecated": false diff --git a/api_docs/embeddable.mdx b/api_docs/embeddable.mdx index 3b6afd48b7d38..9d2fa0fe4b142 100644 --- a/api_docs/embeddable.mdx +++ b/api_docs/embeddable.mdx @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 469 | 5 | 393 | 3 | +| 469 | 0 | 393 | 3 | ## Client diff --git a/api_docs/es_ui_shared.json b/api_docs/es_ui_shared.json index 5560b8e52ba28..cd54d907a143e 100644 --- a/api_docs/es_ui_shared.json +++ b/api_docs/es_ui_shared.json @@ -708,7 +708,7 @@ "label": "WithPrivileges", "description": [], "signature": [ - "({ privileges: requiredPrivileges, children }: Props) => JSX.Element" + "({ privileges: requiredPrivileges, children }: Props) => JSX.Element | null" ], "path": "src/plugins/es_ui_shared/__packages_do_not_import__/authorization/components/with_privileges.tsx", "deprecated": false, @@ -1092,12 +1092,12 @@ { "parentPluginId": "esUiShared", "id": "def-public.MissingPrivileges.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: string[] | undefined", "description": [], "signature": [ - "any" + "[key: string]: string[] | undefined" ], "path": "src/plugins/es_ui_shared/__packages_do_not_import__/authorization/types.ts", "deprecated": false @@ -1739,12 +1739,12 @@ { "parentPluginId": "esUiShared", "id": "def-common.MissingPrivileges.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: string[] | undefined", "description": [], "signature": [ - "any" + "[key: string]: string[] | undefined" ], "path": "src/plugins/es_ui_shared/__packages_do_not_import__/authorization/types.ts", "deprecated": false diff --git a/api_docs/es_ui_shared.mdx b/api_docs/es_ui_shared.mdx index 977d88d0c66d9..a96265408384f 100644 --- a/api_docs/es_ui_shared.mdx +++ b/api_docs/es_ui_shared.mdx @@ -18,7 +18,7 @@ Contact [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-ma | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 110 | 5 | 106 | 3 | +| 110 | 3 | 106 | 3 | ## Client diff --git a/api_docs/expressions.mdx b/api_docs/expressions.mdx index 724b17051736b..1df898be0e6f0 100644 --- a/api_docs/expressions.mdx +++ b/api_docs/expressions.mdx @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 2102 | 27 | 1656 | 3 | +| 2102 | 26 | 1656 | 3 | ## Client diff --git a/api_docs/field_formats.json b/api_docs/field_formats.json index a1296107c65ef..db9f9604b0474 100644 --- a/api_docs/field_formats.json +++ b/api_docs/field_formats.json @@ -4669,12 +4669,12 @@ { "parentPluginId": "fieldFormats", "id": "def-common.FieldFormatParams.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[param: string]: any", "description": [], "signature": [ - "any" + "[param: string]: any" ], "path": "src/plugins/field_formats/common/types.ts", "deprecated": false diff --git a/api_docs/field_formats.mdx b/api_docs/field_formats.mdx index 630f25f3e37d7..9d52c2294a37a 100644 --- a/api_docs/field_formats.mdx +++ b/api_docs/field_formats.mdx @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 278 | 7 | 240 | 3 | +| 278 | 6 | 240 | 3 | ## Client diff --git a/api_docs/file_upload.json b/api_docs/file_upload.json index 783237a5a618c..27970f0233855 100644 --- a/api_docs/file_upload.json +++ b/api_docs/file_upload.json @@ -1822,12 +1822,12 @@ { "parentPluginId": "fileUpload", "id": "def-common.InputOverrides.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: string | undefined", "description": [], "signature": [ - "any" + "[key: string]: string | undefined" ], "path": "x-pack/plugins/file_upload/common/types.ts", "deprecated": false @@ -1923,12 +1923,12 @@ { "parentPluginId": "fileUpload", "id": "def-common.Settings.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: any", "description": [], "signature": [ - "any" + "[key: string]: any" ], "path": "x-pack/plugins/file_upload/common/types.ts", "deprecated": false diff --git a/api_docs/file_upload.mdx b/api_docs/file_upload.mdx index 25770622a25e4..c1dafcbc99bc3 100644 --- a/api_docs/file_upload.mdx +++ b/api_docs/file_upload.mdx @@ -18,7 +18,7 @@ Contact [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) for q | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 129 | 4 | 129 | 1 | +| 129 | 2 | 129 | 1 | ## Client diff --git a/api_docs/fleet.json b/api_docs/fleet.json index e99b0560d408e..1024aa69a59c8 100644 --- a/api_docs/fleet.json +++ b/api_docs/fleet.json @@ -1452,12 +1452,20 @@ { "parentPluginId": "fleet", "id": "def-public.UIExtensionsStorage.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: Partial>", "description": [], "signature": [ - "any" + "[key: string]: Partial>" ], "path": "x-pack/plugins/fleet/public/types/ui_extensions.ts", "deprecated": false @@ -8090,12 +8098,12 @@ { "parentPluginId": "fleet", "id": "def-common.AgentMetadata.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[x: string]: any", "description": [], "signature": [ - "any" + "[x: string]: any" ], "path": "x-pack/plugins/fleet/common/types/models/agent.ts", "deprecated": false @@ -10172,12 +10180,12 @@ { "parentPluginId": "fleet", "id": "def-common.FleetServerAgentAction.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[k: string]: unknown", "description": [], "signature": [ - "any" + "[k: string]: unknown" ], "path": "x-pack/plugins/fleet/common/types/models/agent.ts", "deprecated": false @@ -10224,12 +10232,12 @@ { "parentPluginId": "fleet", "id": "def-common.FleetServerAgentMetadata.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[k: string]: any", "description": [], "signature": [ - "any" + "[k: string]: any" ], "path": "x-pack/plugins/fleet/common/types/models/agent.ts", "deprecated": false @@ -10715,12 +10723,12 @@ { "parentPluginId": "fleet", "id": "def-common.FullAgentPolicyInput.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: any", "description": [], "signature": [ - "any" + "[key: string]: any" ], "path": "x-pack/plugins/fleet/common/types/models/agent_policy.ts", "deprecated": false @@ -10764,12 +10772,12 @@ { "parentPluginId": "fleet", "id": "def-common.FullAgentPolicyInputStream.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: any", "description": [], "signature": [ - "any" + "[key: string]: any" ], "path": "x-pack/plugins/fleet/common/types/models/agent_policy.ts", "deprecated": false @@ -10839,12 +10847,12 @@ { "parentPluginId": "fleet", "id": "def-common.FullAgentPolicyOutputPermissions.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[packagePolicyName: string]: { cluster?: string[] | undefined; indices?: { names: string[]; privileges: string[]; }[] | undefined; }", "description": [], "signature": [ - "any" + "[packagePolicyName: string]: { cluster?: string[] | undefined; indices?: { names: string[]; privileges: string[]; }[] | undefined; }" ], "path": "x-pack/plugins/fleet/common/types/models/agent_policy.ts", "deprecated": false @@ -12682,10 +12690,13 @@ { "parentPluginId": "fleet", "id": "def-common.Installation.keep_policies_up_to_date", - "type": "boolean", + "type": "CompoundType", "tags": [], "label": "keep_policies_up_to_date", "description": [], + "signature": [ + "boolean | undefined" + ], "path": "x-pack/plugins/fleet/common/types/models/epm.ts", "deprecated": false } @@ -17418,6 +17429,20 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "fleet", + "id": "def-common.AUTO_UPGRADE_POLICIES_PACKAGES", + "type": "Array", + "tags": [], + "label": "AUTO_UPGRADE_POLICIES_PACKAGES", + "description": [], + "signature": [ + "{ name: string; version: string; }[]" + ], + "path": "x-pack/plugins/fleet/common/constants/preconfiguration.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "fleet", "id": "def-common.autoUpdatePackages", @@ -17432,6 +17457,20 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "fleet", + "id": "def-common.autoUpgradePoliciesPackages", + "type": "Array", + "tags": [], + "label": "autoUpgradePoliciesPackages", + "description": [], + "signature": [ + "string[]" + ], + "path": "x-pack/plugins/fleet/common/constants/epm.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "fleet", "id": "def-common.BaseAgentActionSOAttributes", @@ -18252,6 +18291,20 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "fleet", + "id": "def-common.KEEP_POLICIES_UP_TO_DATE_PACKAGES", + "type": "Array", + "tags": [], + "label": "KEEP_POLICIES_UP_TO_DATE_PACKAGES", + "description": [], + "signature": [ + "{ name: string; version: string; }[]" + ], + "path": "x-pack/plugins/fleet/common/constants/preconfiguration.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "fleet", "id": "def-common.KibanaAssetParts", diff --git a/api_docs/fleet.mdx b/api_docs/fleet.mdx index 765e26fd45a03..bbaeba4bfa28f 100644 --- a/api_docs/fleet.mdx +++ b/api_docs/fleet.mdx @@ -18,7 +18,7 @@ Contact [Fleet](https://github.com/orgs/elastic/teams/fleet) for questions regar | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 1229 | 15 | 1127 | 10 | +| 1232 | 8 | 1130 | 10 | ## Client diff --git a/api_docs/home.json b/api_docs/home.json index a8dc02313ef3e..c80ab1a9841eb 100644 --- a/api_docs/home.json +++ b/api_docs/home.json @@ -1347,12 +1347,12 @@ { "parentPluginId": "home", "id": "def-server.TutorialContext.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: unknown", "description": [], "signature": [ - "any" + "[key: string]: unknown" ], "path": "src/plugins/home/server/services/tutorials/lib/tutorials_registry_types.ts", "deprecated": false @@ -1408,7 +1408,7 @@ "label": "InstructionSetSchema", "description": [], "signature": [ - "{ readonly title?: string | undefined; readonly callOut?: Readonly<{ iconType?: string | undefined; message?: string | undefined; } & { title: string; }> | undefined; readonly statusCheck?: Readonly<{ title?: string | undefined; text?: string | undefined; error?: string | undefined; success?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; readonly instructionVariants: Readonly<{} & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }" + "{ readonly title?: string | undefined; readonly callOut?: Readonly<{ iconType?: string | undefined; message?: string | undefined; } & { title: string; }> | undefined; readonly statusCheck?: Readonly<{ title?: string | undefined; text?: string | undefined; error?: string | undefined; success?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; readonly instructionVariants: Readonly<{ initialSelected?: boolean | undefined; } & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }" ], "path": "src/plugins/home/server/services/tutorials/lib/tutorial_schema.ts", "deprecated": false, @@ -1422,7 +1422,7 @@ "label": "InstructionsSchema", "description": [], "signature": [ - "{ readonly params?: Readonly<{ defaultValue?: any; } & { type: \"string\" | \"number\"; id: string; label: string; }>[] | undefined; readonly instructionSets: Readonly<{ title?: string | undefined; callOut?: Readonly<{ iconType?: string | undefined; message?: string | undefined; } & { title: string; }> | undefined; statusCheck?: Readonly<{ title?: string | undefined; text?: string | undefined; error?: string | undefined; success?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; } & { instructionVariants: Readonly<{} & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }>[]; }" + "{ readonly params?: Readonly<{ defaultValue?: any; } & { type: \"string\" | \"number\"; id: string; label: string; }>[] | undefined; readonly instructionSets: Readonly<{ title?: string | undefined; callOut?: Readonly<{ iconType?: string | undefined; message?: string | undefined; } & { title: string; }> | undefined; statusCheck?: Readonly<{ title?: string | undefined; text?: string | undefined; error?: string | undefined; success?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; } & { instructionVariants: Readonly<{ initialSelected?: boolean | undefined; } & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }>[]; }" ], "path": "src/plugins/home/server/services/tutorials/lib/tutorial_schema.ts", "deprecated": false, @@ -1538,7 +1538,7 @@ "section": "def-server.TutorialContext", "text": "TutorialContext" }, - ") => Readonly<{ savedObjects?: any[] | undefined; isBeta?: boolean | undefined; euiIconType?: string | undefined; previewImagePath?: string | undefined; moduleName?: string | undefined; completionTimeMinutes?: number | undefined; elasticCloud?: Readonly<{ params?: Readonly<{ defaultValue?: any; } & { type: \"string\" | \"number\"; id: string; label: string; }>[] | undefined; } & { instructionSets: Readonly<{ title?: string | undefined; callOut?: Readonly<{ iconType?: string | undefined; message?: string | undefined; } & { title: string; }> | undefined; statusCheck?: Readonly<{ title?: string | undefined; text?: string | undefined; error?: string | undefined; success?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; } & { instructionVariants: Readonly<{} & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }>[]; }> | undefined; onPremElasticCloud?: Readonly<{ params?: Readonly<{ defaultValue?: any; } & { type: \"string\" | \"number\"; id: string; label: string; }>[] | undefined; } & { instructionSets: Readonly<{ title?: string | undefined; callOut?: Readonly<{ iconType?: string | undefined; message?: string | undefined; } & { title: string; }> | undefined; statusCheck?: Readonly<{ title?: string | undefined; text?: string | undefined; error?: string | undefined; success?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; } & { instructionVariants: Readonly<{} & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }>[]; }> | undefined; artifacts?: Readonly<{ application?: Readonly<{} & { path: string; label: string; }> | undefined; exportedFields?: Readonly<{} & { documentationUrl: string; }> | undefined; } & { dashboards: Readonly<{ linkLabel?: string | undefined; } & { id: string; isOverview: boolean; }>[]; }> | undefined; savedObjectsInstallMsg?: string | undefined; customStatusCheckName?: string | undefined; integrationBrowserCategories?: string[] | undefined; eprPackageOverlap?: string | undefined; } & { name: string; id: string; category: \"metrics\" | \"security\" | \"other\" | \"logging\"; shortDescription: string; longDescription: string; onPrem: Readonly<{ params?: Readonly<{ defaultValue?: any; } & { type: \"string\" | \"number\"; id: string; label: string; }>[] | undefined; } & { instructionSets: Readonly<{ title?: string | undefined; callOut?: Readonly<{ iconType?: string | undefined; message?: string | undefined; } & { title: string; }> | undefined; statusCheck?: Readonly<{ title?: string | undefined; text?: string | undefined; error?: string | undefined; success?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; } & { instructionVariants: Readonly<{} & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }>[]; }>; }>" + ") => Readonly<{ savedObjects?: any[] | undefined; isBeta?: boolean | undefined; euiIconType?: string | undefined; previewImagePath?: string | undefined; moduleName?: string | undefined; completionTimeMinutes?: number | undefined; elasticCloud?: Readonly<{ params?: Readonly<{ defaultValue?: any; } & { type: \"string\" | \"number\"; id: string; label: string; }>[] | undefined; } & { instructionSets: Readonly<{ title?: string | undefined; callOut?: Readonly<{ iconType?: string | undefined; message?: string | undefined; } & { title: string; }> | undefined; statusCheck?: Readonly<{ title?: string | undefined; text?: string | undefined; error?: string | undefined; success?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; } & { instructionVariants: Readonly<{ initialSelected?: boolean | undefined; } & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }>[]; }> | undefined; onPremElasticCloud?: Readonly<{ params?: Readonly<{ defaultValue?: any; } & { type: \"string\" | \"number\"; id: string; label: string; }>[] | undefined; } & { instructionSets: Readonly<{ title?: string | undefined; callOut?: Readonly<{ iconType?: string | undefined; message?: string | undefined; } & { title: string; }> | undefined; statusCheck?: Readonly<{ title?: string | undefined; text?: string | undefined; error?: string | undefined; success?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; } & { instructionVariants: Readonly<{ initialSelected?: boolean | undefined; } & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }>[]; }> | undefined; artifacts?: Readonly<{ application?: Readonly<{} & { path: string; label: string; }> | undefined; exportedFields?: Readonly<{} & { documentationUrl: string; }> | undefined; } & { dashboards: Readonly<{ linkLabel?: string | undefined; } & { id: string; isOverview: boolean; }>[]; }> | undefined; savedObjectsInstallMsg?: string | undefined; customStatusCheckName?: string | undefined; integrationBrowserCategories?: string[] | undefined; eprPackageOverlap?: string | undefined; } & { name: string; id: string; category: \"metrics\" | \"security\" | \"other\" | \"logging\"; shortDescription: string; longDescription: string; onPrem: Readonly<{ params?: Readonly<{ defaultValue?: any; } & { type: \"string\" | \"number\"; id: string; label: string; }>[] | undefined; } & { instructionSets: Readonly<{ title?: string | undefined; callOut?: Readonly<{ iconType?: string | undefined; message?: string | undefined; } & { title: string; }> | undefined; statusCheck?: Readonly<{ title?: string | undefined; text?: string | undefined; error?: string | undefined; success?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; } & { instructionVariants: Readonly<{ initialSelected?: boolean | undefined; } & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }>[]; }>; }>" ], "path": "src/plugins/home/server/services/tutorials/lib/tutorials_registry_types.ts", "deprecated": false, @@ -1574,7 +1574,7 @@ "label": "TutorialSchema", "description": [], "signature": [ - "{ readonly savedObjects?: any[] | undefined; readonly isBeta?: boolean | undefined; readonly euiIconType?: string | undefined; readonly previewImagePath?: string | undefined; readonly moduleName?: string | undefined; readonly completionTimeMinutes?: number | undefined; readonly elasticCloud?: Readonly<{ params?: Readonly<{ defaultValue?: any; } & { type: \"string\" | \"number\"; id: string; label: string; }>[] | undefined; } & { instructionSets: Readonly<{ title?: string | undefined; callOut?: Readonly<{ iconType?: string | undefined; message?: string | undefined; } & { title: string; }> | undefined; statusCheck?: Readonly<{ title?: string | undefined; text?: string | undefined; error?: string | undefined; success?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; } & { instructionVariants: Readonly<{} & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }>[]; }> | undefined; readonly onPremElasticCloud?: Readonly<{ params?: Readonly<{ defaultValue?: any; } & { type: \"string\" | \"number\"; id: string; label: string; }>[] | undefined; } & { instructionSets: Readonly<{ title?: string | undefined; callOut?: Readonly<{ iconType?: string | undefined; message?: string | undefined; } & { title: string; }> | undefined; statusCheck?: Readonly<{ title?: string | undefined; text?: string | undefined; error?: string | undefined; success?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; } & { instructionVariants: Readonly<{} & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }>[]; }> | undefined; readonly artifacts?: Readonly<{ application?: Readonly<{} & { path: string; label: string; }> | undefined; exportedFields?: Readonly<{} & { documentationUrl: string; }> | undefined; } & { dashboards: Readonly<{ linkLabel?: string | undefined; } & { id: string; isOverview: boolean; }>[]; }> | undefined; readonly savedObjectsInstallMsg?: string | undefined; readonly customStatusCheckName?: string | undefined; readonly integrationBrowserCategories?: string[] | undefined; readonly eprPackageOverlap?: string | undefined; readonly name: string; readonly id: string; readonly category: \"metrics\" | \"security\" | \"other\" | \"logging\"; readonly shortDescription: string; readonly longDescription: string; readonly onPrem: Readonly<{ params?: Readonly<{ defaultValue?: any; } & { type: \"string\" | \"number\"; id: string; label: string; }>[] | undefined; } & { instructionSets: Readonly<{ title?: string | undefined; callOut?: Readonly<{ iconType?: string | undefined; message?: string | undefined; } & { title: string; }> | undefined; statusCheck?: Readonly<{ title?: string | undefined; text?: string | undefined; error?: string | undefined; success?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; } & { instructionVariants: Readonly<{} & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }>[]; }>; }" + "{ readonly savedObjects?: any[] | undefined; readonly isBeta?: boolean | undefined; readonly euiIconType?: string | undefined; readonly previewImagePath?: string | undefined; readonly moduleName?: string | undefined; readonly completionTimeMinutes?: number | undefined; readonly elasticCloud?: Readonly<{ params?: Readonly<{ defaultValue?: any; } & { type: \"string\" | \"number\"; id: string; label: string; }>[] | undefined; } & { instructionSets: Readonly<{ title?: string | undefined; callOut?: Readonly<{ iconType?: string | undefined; message?: string | undefined; } & { title: string; }> | undefined; statusCheck?: Readonly<{ title?: string | undefined; text?: string | undefined; error?: string | undefined; success?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; } & { instructionVariants: Readonly<{ initialSelected?: boolean | undefined; } & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }>[]; }> | undefined; readonly onPremElasticCloud?: Readonly<{ params?: Readonly<{ defaultValue?: any; } & { type: \"string\" | \"number\"; id: string; label: string; }>[] | undefined; } & { instructionSets: Readonly<{ title?: string | undefined; callOut?: Readonly<{ iconType?: string | undefined; message?: string | undefined; } & { title: string; }> | undefined; statusCheck?: Readonly<{ title?: string | undefined; text?: string | undefined; error?: string | undefined; success?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; } & { instructionVariants: Readonly<{ initialSelected?: boolean | undefined; } & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }>[]; }> | undefined; readonly artifacts?: Readonly<{ application?: Readonly<{} & { path: string; label: string; }> | undefined; exportedFields?: Readonly<{} & { documentationUrl: string; }> | undefined; } & { dashboards: Readonly<{ linkLabel?: string | undefined; } & { id: string; isOverview: boolean; }>[]; }> | undefined; readonly savedObjectsInstallMsg?: string | undefined; readonly customStatusCheckName?: string | undefined; readonly integrationBrowserCategories?: string[] | undefined; readonly eprPackageOverlap?: string | undefined; readonly name: string; readonly id: string; readonly category: \"metrics\" | \"security\" | \"other\" | \"logging\"; readonly shortDescription: string; readonly longDescription: string; readonly onPrem: Readonly<{ params?: Readonly<{ defaultValue?: any; } & { type: \"string\" | \"number\"; id: string; label: string; }>[] | undefined; } & { instructionSets: Readonly<{ title?: string | undefined; callOut?: Readonly<{ iconType?: string | undefined; message?: string | undefined; } & { title: string; }> | undefined; statusCheck?: Readonly<{ title?: string | undefined; text?: string | undefined; error?: string | undefined; success?: string | undefined; btnLabel?: string | undefined; } & { esHitsCheck: Readonly<{} & { query: Record; index: string | string[]; }>; }> | undefined; } & { instructionVariants: Readonly<{ initialSelected?: boolean | undefined; } & { id: string; instructions: Readonly<{ title?: string | undefined; commands?: string[] | undefined; textPre?: string | undefined; textPost?: string | undefined; customComponentName?: string | undefined; } & {}>[]; }>[]; }>[]; }>; }" ], "path": "src/plugins/home/server/services/tutorials/lib/tutorial_schema.ts", "deprecated": false, diff --git a/api_docs/home.mdx b/api_docs/home.mdx index e4ce618a1d0c3..8513408e9c37e 100644 --- a/api_docs/home.mdx +++ b/api_docs/home.mdx @@ -18,7 +18,7 @@ Contact [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) for que | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 132 | 4 | 102 | 0 | +| 132 | 0 | 102 | 0 | ## Client diff --git a/api_docs/index_management.json b/api_docs/index_management.json index 522cc732fa34b..81f748459e33d 100644 --- a/api_docs/index_management.json +++ b/api_docs/index_management.json @@ -240,12 +240,12 @@ { "parentPluginId": "indexManagement", "id": "def-public.Index.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: any", "description": [], "signature": [ - "any" + "[key: string]: any" ], "path": "x-pack/plugins/index_management/common/types/indices.ts", "deprecated": false @@ -503,12 +503,12 @@ { "parentPluginId": "indexManagement", "id": "def-server.Index.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: any", "description": [], "signature": [ - "any" + "[key: string]: any" ], "path": "x-pack/plugins/index_management/common/types/indices.ts", "deprecated": false @@ -780,12 +780,12 @@ { "parentPluginId": "indexManagement", "id": "def-common.Aliases.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: any", "description": [], "signature": [ - "any" + "[key: string]: any" ], "path": "x-pack/plugins/index_management/common/types/aliases.ts", "deprecated": false @@ -1566,12 +1566,12 @@ { "parentPluginId": "indexManagement", "id": "def-common.Index.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: any", "description": [], "signature": [ - "any" + "[key: string]: any" ], "path": "x-pack/plugins/index_management/common/types/indices.ts", "deprecated": false @@ -1618,12 +1618,12 @@ { "parentPluginId": "indexManagement", "id": "def-common.IndexSettings.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: any", "description": [], "signature": [ - "any" + "[key: string]: any" ], "path": "x-pack/plugins/index_management/common/types/indices.ts", "deprecated": false @@ -1758,12 +1758,12 @@ { "parentPluginId": "indexManagement", "id": "def-common.Mappings.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: any", "description": [], "signature": [ - "any" + "[key: string]: any" ], "path": "x-pack/plugins/index_management/common/types/mappings.ts", "deprecated": false diff --git a/api_docs/index_management.mdx b/api_docs/index_management.mdx index cd543449aa7cb..ebfd2b60c98b2 100644 --- a/api_docs/index_management.mdx +++ b/api_docs/index_management.mdx @@ -18,7 +18,7 @@ Contact [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-ma | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 169 | 9 | 164 | 3 | +| 169 | 3 | 164 | 3 | ## Client diff --git a/api_docs/index_pattern_field_editor.mdx b/api_docs/index_pattern_field_editor.mdx deleted file mode 100644 index fa38c1fe47d03..0000000000000 --- a/api_docs/index_pattern_field_editor.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -id: kibIndexPatternFieldEditorPluginApi -slug: /kibana-dev-docs/api/indexPatternFieldEditor -title: "indexPatternFieldEditor" -image: https://source.unsplash.com/400x175/?github -summary: API docs for the indexPatternFieldEditor plugin -date: 2020-11-16 -tags: ['contributor', 'dev', 'apidocs', 'kibana', 'indexPatternFieldEditor'] -warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info. ---- -import indexPatternFieldEditorObj from './index_pattern_field_editor.json'; - -Reusable index pattern field editor across Kibana - -Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) for questions regarding this plugin. - -**Code health stats** - -| Public API count | Any count | Items lacking comments | Missing exports | -|-------------------|-----------|------------------------|-----------------| -| 42 | 2 | 39 | 3 | - -## Client - -### Setup - - -### Start - - -### Classes - - -### Interfaces - - -### Consts, variables and types - - diff --git a/api_docs/inspector.json b/api_docs/inspector.json index 964b5b25814a4..c4825cd8c8903 100644 --- a/api_docs/inspector.json +++ b/api_docs/inspector.json @@ -766,12 +766,12 @@ { "parentPluginId": "inspector", "id": "def-public.Adapters.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: any", "description": [], "signature": [ - "any" + "[key: string]: any" ], "path": "src/plugins/inspector/common/adapters/types.ts", "deprecated": false @@ -1227,12 +1227,19 @@ { "parentPluginId": "inspector", "id": "def-public.RequestStatistics.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: RequestStatistic", "description": [], "signature": [ - "any" + "[key: string]: ", + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.RequestStatistic", + "text": "RequestStatistic" + } ], "path": "src/plugins/inspector/common/adapters/request/types.ts", "deprecated": false @@ -2022,12 +2029,12 @@ { "parentPluginId": "inspector", "id": "def-common.Adapters.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: any", "description": [], "signature": [ - "any" + "[key: string]: any" ], "path": "src/plugins/inspector/common/adapters/types.ts", "deprecated": false @@ -2230,12 +2237,19 @@ { "parentPluginId": "inspector", "id": "def-common.RequestStatistics.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: RequestStatistic", "description": [], "signature": [ - "any" + "[key: string]: ", + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.RequestStatistic", + "text": "RequestStatistic" + } ], "path": "src/plugins/inspector/common/adapters/request/types.ts", "deprecated": false diff --git a/api_docs/inspector.mdx b/api_docs/inspector.mdx index 24931ecbaa639..4fa66efbef0b2 100644 --- a/api_docs/inspector.mdx +++ b/api_docs/inspector.mdx @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 123 | 6 | 96 | 4 | +| 123 | 2 | 96 | 4 | ## Client diff --git a/api_docs/interactive_setup.json b/api_docs/interactive_setup.json index 98469965ad838..c5f798c05b83c 100644 --- a/api_docs/interactive_setup.json +++ b/api_docs/interactive_setup.json @@ -275,6 +275,20 @@ } ], "misc": [ + { + "parentPluginId": "interactiveSetup", + "id": "def-common.ERROR_COMPATIBILITY_FAILURE", + "type": "string", + "tags": [], + "label": "ERROR_COMPATIBILITY_FAILURE", + "description": [], + "signature": [ + "\"compatibility_failure\"" + ], + "path": "src/plugins/interactive_setup/common/constants.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "interactiveSetup", "id": "def-common.ERROR_CONFIGURE_FAILURE", diff --git a/api_docs/interactive_setup.mdx b/api_docs/interactive_setup.mdx index 0a31dfef397e9..6cf89908707ee 100644 --- a/api_docs/interactive_setup.mdx +++ b/api_docs/interactive_setup.mdx @@ -18,7 +18,7 @@ Contact [Platform Security](https://github.com/orgs/elastic/teams/kibana-securit | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 27 | 0 | 17 | 0 | +| 28 | 0 | 18 | 0 | ## Common diff --git a/api_docs/kbn_dev_utils.json b/api_docs/kbn_dev_utils.json index 53225a845e3bc..843ad434b1d92 100644 --- a/api_docs/kbn_dev_utils.json +++ b/api_docs/kbn_dev_utils.json @@ -3198,14 +3198,14 @@ { "parentPluginId": "@kbn/dev-utils", "id": "def-server.CiStatsMetadata.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: string | number | boolean | string[] | undefined", "description": [ "\nArbitrary key-value pairs which can be attached to CiStatsTiming and CiStatsMetric\nobjects stored in the ci-stats service" ], "signature": [ - "any" + "[key: string]: string | number | boolean | string[] | undefined" ], "path": "packages/kbn-dev-utils/src/ci_stats_reporter/ci_stats_reporter.ts", "deprecated": false @@ -3740,12 +3740,12 @@ { "parentPluginId": "@kbn/dev-utils", "id": "def-server.Flags.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: string | boolean | string[] | undefined", "description": [], "signature": [ - "any" + "[key: string]: string | boolean | string[] | undefined" ], "path": "packages/kbn-dev-utils/src/run/flags.ts", "deprecated": false diff --git a/api_docs/kbn_dev_utils.mdx b/api_docs/kbn_dev_utils.mdx index 775e0c03fa49c..ce584b7e24f1b 100644 --- a/api_docs/kbn_dev_utils.mdx +++ b/api_docs/kbn_dev_utils.mdx @@ -18,7 +18,7 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 280 | 6 | 214 | 0 | +| 280 | 3 | 214 | 0 | ## Server diff --git a/api_docs/kbn_es_query.json b/api_docs/kbn_es_query.json index 1095f32d95c0d..eb6bab043487a 100644 --- a/api_docs/kbn_es_query.json +++ b/api_docs/kbn_es_query.json @@ -3498,12 +3498,12 @@ { "parentPluginId": "@kbn/es-query", "id": "def-common.KueryNode.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: any", "description": [], "signature": [ - "any" + "[key: string]: any" ], "path": "packages/kbn-es-query/src/kuery/types.ts", "deprecated": false diff --git a/api_docs/kbn_es_query.mdx b/api_docs/kbn_es_query.mdx index be44bd1e5a9a4..424ccdd9d49d3 100644 --- a/api_docs/kbn_es_query.mdx +++ b/api_docs/kbn_es_query.mdx @@ -18,7 +18,7 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 205 | 2 | 153 | 14 | +| 205 | 1 | 153 | 14 | ## Common diff --git a/api_docs/kbn_mapbox_gl.json b/api_docs/kbn_mapbox_gl.json index 76fd490447c1d..89817e66690bf 100644 --- a/api_docs/kbn_mapbox_gl.json +++ b/api_docs/kbn_mapbox_gl.json @@ -2473,12 +2473,12 @@ { "parentPluginId": "@kbn/mapbox-gl", "id": "def-server.Map.setFeatureState.$2.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: any", "description": [], "signature": [ - "any" + "[key: string]: any" ], "path": "node_modules/maplibre-gl/src/index.d.ts", "deprecated": false diff --git a/api_docs/kbn_mapbox_gl.mdx b/api_docs/kbn_mapbox_gl.mdx index 1ab394db8905b..aebd25ed46253 100644 --- a/api_docs/kbn_mapbox_gl.mdx +++ b/api_docs/kbn_mapbox_gl.mdx @@ -18,7 +18,7 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 467 | 9 | 378 | 0 | +| 467 | 1 | 378 | 0 | ## Server diff --git a/api_docs/kbn_monaco.json b/api_docs/kbn_monaco.json index 03527a796a800..68eec7f21c542 100644 --- a/api_docs/kbn_monaco.json +++ b/api_docs/kbn_monaco.json @@ -512,12 +512,20 @@ { "parentPluginId": "@kbn/monaco", "id": "def-common.SyntaxErrors.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[modelId: string]: EditorError[]", "description": [], "signature": [ - "any" + "[modelId: string]: ", + { + "pluginId": "@kbn/monaco", + "scope": "common", + "docId": "kibKbnMonacoPluginApi", + "section": "def-common.EditorError", + "text": "EditorError" + }, + "[]" ], "path": "packages/kbn-monaco/src/types.ts", "deprecated": false @@ -558,6 +566,43 @@ } ], "objects": [ + { + "parentPluginId": "@kbn/monaco", + "id": "def-common.EsqlLang", + "type": "Object", + "tags": [], + "label": "EsqlLang", + "description": [], + "path": "packages/kbn-monaco/src/esql/index.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/monaco", + "id": "def-common.EsqlLang.ID", + "type": "string", + "tags": [], + "label": "ID", + "description": [], + "path": "packages/kbn-monaco/src/esql/index.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/monaco", + "id": "def-common.EsqlLang.lexerRules", + "type": "Object", + "tags": [], + "label": "lexerRules", + "description": [], + "signature": [ + "languages", + ".IMonarchLanguage" + ], + "path": "packages/kbn-monaco/src/esql/index.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/monaco", "id": "def-common.PainlessLang", diff --git a/api_docs/kbn_monaco.mdx b/api_docs/kbn_monaco.mdx index adb95090405cc..05885275a11fb 100644 --- a/api_docs/kbn_monaco.mdx +++ b/api_docs/kbn_monaco.mdx @@ -18,7 +18,7 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 52 | 1 | 52 | 2 | +| 55 | 0 | 55 | 2 | ## Common diff --git a/api_docs/kbn_securitysolution_io_ts_alerting_types.json b/api_docs/kbn_securitysolution_io_ts_alerting_types.json index c18188bce8f36..d3017bfeff837 100644 --- a/api_docs/kbn_securitysolution_io_ts_alerting_types.json +++ b/api_docs/kbn_securitysolution_io_ts_alerting_types.json @@ -35,12 +35,19 @@ { "parentPluginId": "@kbn/securitysolution-io-ts-alerting-types", "id": "def-common.SavedObjectAttributes.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: SavedObjectAttribute", "description": [], "signature": [ - "any" + "[key: string]: ", + { + "pluginId": "@kbn/securitysolution-io-ts-alerting-types", + "scope": "common", + "docId": "kibKbnSecuritysolutionIoTsAlertingTypesPluginApi", + "section": "def-common.SavedObjectAttribute", + "text": "SavedObjectAttribute" + } ], "path": "packages/kbn-securitysolution-io-ts-alerting-types/src/saved_object_attributes/index.ts", "deprecated": false diff --git a/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx b/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx index 39c7549b8812e..53e73d41b9b2d 100644 --- a/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx @@ -18,7 +18,7 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 147 | 1 | 128 | 0 | +| 147 | 0 | 128 | 0 | ## Common diff --git a/api_docs/kbn_test.json b/api_docs/kbn_test.json index 1fb7fd398fb11..7cb60c5d33c89 100644 --- a/api_docs/kbn_test.json +++ b/api_docs/kbn_test.json @@ -178,12 +178,19 @@ { "parentPluginId": "@kbn/test", "id": "def-server.DockerServersService.Unnamed.$1.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[name: string]: DockerServerSpec", "description": [], "signature": [ - "any" + "[name: string]: ", + { + "pluginId": "@kbn/test", + "scope": "server", + "docId": "kibKbnTestPluginApi", + "section": "def-server.DockerServerSpec", + "text": "DockerServerSpec" + } ], "path": "packages/kbn-test/src/functional_test_runner/lib/docker_servers/docker_servers_service.ts", "deprecated": false diff --git a/api_docs/kbn_test.mdx b/api_docs/kbn_test.mdx index f8698fd82e597..db0a53433c68c 100644 --- a/api_docs/kbn_test.mdx +++ b/api_docs/kbn_test.mdx @@ -18,7 +18,7 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 203 | 5 | 180 | 9 | +| 203 | 4 | 180 | 9 | ## Server diff --git a/api_docs/kbn_utility_types.json b/api_docs/kbn_utility_types.json index 49e2155b92da4..f7df1f11ffbc7 100644 --- a/api_docs/kbn_utility_types.json +++ b/api_docs/kbn_utility_types.json @@ -55,12 +55,19 @@ { "parentPluginId": "@kbn/utility-types", "id": "def-server.JsonObject.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: JsonValue", "description": [], "signature": [ - "any" + "[key: string]: ", + { + "pluginId": "@kbn/utility-types", + "scope": "server", + "docId": "kibKbnUtilityTypesPluginApi", + "section": "def-server.JsonValue", + "text": "JsonValue" + } ], "path": "packages/kbn-utility-types/src/serializable/index.ts", "deprecated": false diff --git a/api_docs/kbn_utility_types.mdx b/api_docs/kbn_utility_types.mdx index c2533460c3531..e9dd693a311bb 100644 --- a/api_docs/kbn_utility_types.mdx +++ b/api_docs/kbn_utility_types.mdx @@ -18,7 +18,7 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 29 | 1 | 10 | 1 | +| 29 | 0 | 10 | 1 | ## Server diff --git a/api_docs/kibana_react.json b/api_docs/kibana_react.json index cc0373028a354..134a7ae3bbcc4 100644 --- a/api_docs/kibana_react.json +++ b/api_docs/kibana_react.json @@ -2050,6 +2050,24 @@ ], "path": "src/plugins/kibana_react/public/exit_full_screen_button/exit_full_screen_button.tsx", "deprecated": false + }, + { + "parentPluginId": "kibanaReact", + "id": "def-public.ExitFullScreenButtonProps.toggleChrome", + "type": "CompoundType", + "tags": [ + "note", + "default" + ], + "label": "toggleChrome", + "description": [ + "\nOptional argument that determines whether we toggle the chrome bar\nthe button unmounts.\n" + ], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/kibana_react/public/exit_full_screen_button/exit_full_screen_button.tsx", + "deprecated": false } ], "initialIsOpen": false diff --git a/api_docs/kibana_react.mdx b/api_docs/kibana_react.mdx index 93a0f372ec10a..6df52cdffa835 100644 --- a/api_docs/kibana_react.mdx +++ b/api_docs/kibana_react.mdx @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 237 | 2 | 213 | 5 | +| 238 | 0 | 213 | 5 | ## Client diff --git a/api_docs/lens.json b/api_docs/lens.json index bef5961ae9276..15d40d11e1136 100644 --- a/api_docs/lens.json +++ b/api_docs/lens.json @@ -165,6 +165,20 @@ ], "path": "x-pack/plugins/lens/public/datatable_visualization/visualization.tsx", "deprecated": false + }, + { + "parentPluginId": "lens", + "id": "def-public.DatatableVisualizationState.paging", + "type": "Object", + "tags": [], + "label": "paging", + "description": [], + "signature": [ + "PagingState", + " | undefined" + ], + "path": "x-pack/plugins/lens/public/datatable_visualization/visualization.tsx", + "deprecated": false } ], "initialIsOpen": false @@ -1095,7 +1109,7 @@ "label": "shape", "description": [], "signature": [ - "\"pie\" | \"donut\" | \"treemap\"" + "\"pie\" | \"donut\" | \"treemap\" | \"mosaic\"" ], "path": "x-pack/plugins/lens/common/expressions/pie_chart/types.ts", "deprecated": false diff --git a/api_docs/lens.mdx b/api_docs/lens.mdx index a75f1f08d41f4..7b33259a53773 100644 --- a/api_docs/lens.mdx +++ b/api_docs/lens.mdx @@ -18,7 +18,7 @@ Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 259 | 0 | 242 | 23 | +| 260 | 0 | 243 | 24 | ## Client diff --git a/api_docs/maps_ems.json b/api_docs/maps_ems.json index a14b7836341eb..bb0459e3b82cb 100644 --- a/api_docs/maps_ems.json +++ b/api_docs/maps_ems.json @@ -358,12 +358,12 @@ { "parentPluginId": "mapsEms", "id": "def-public.IServiceSettings.setQueryParams.$1.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[p: string]: string", "description": [], "signature": [ - "any" + "[p: string]: string" ], "path": "src/plugins/maps_ems/public/service_settings/service_settings_types.ts", "deprecated": false diff --git a/api_docs/maps_ems.mdx b/api_docs/maps_ems.mdx index 6f22ae26afb7d..7227d9a31f160 100644 --- a/api_docs/maps_ems.mdx +++ b/api_docs/maps_ems.mdx @@ -18,7 +18,7 @@ Contact [GIS](https://github.com/orgs/elastic/teams/kibana-gis) for questions re | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 64 | 1 | 64 | 0 | +| 64 | 0 | 64 | 0 | ## Client diff --git a/api_docs/ml.json b/api_docs/ml.json index 15eb6b1a186ca..c495ae37f4dae 100644 --- a/api_docs/ml.json +++ b/api_docs/ml.json @@ -723,7 +723,7 @@ "label": "capabilities", "description": [], "signature": [ - "{ canAccessML: boolean; canGetJobs: boolean; canGetDatafeeds: boolean; canGetCalendars: boolean; canFindFileStructure: boolean; canGetDataFrameAnalytics: boolean; canGetAnnotations: boolean; canCreateAnnotation: boolean; canDeleteAnnotation: boolean; canUseMlAlerts: boolean; } & { canCreateJob: boolean; canDeleteJob: boolean; canOpenJob: boolean; canCloseJob: boolean; canResetJob: boolean; canUpdateJob: boolean; canForecastJob: boolean; canCreateDatafeed: boolean; canDeleteDatafeed: boolean; canStartStopDatafeed: boolean; canUpdateDatafeed: boolean; canPreviewDatafeed: boolean; canGetFilters: boolean; canCreateCalendar: boolean; canDeleteCalendar: boolean; canCreateFilter: boolean; canDeleteFilter: boolean; canCreateDataFrameAnalytics: boolean; canDeleteDataFrameAnalytics: boolean; canStartStopDataFrameAnalytics: boolean; canCreateMlAlerts: boolean; canUseMlAlerts: boolean; }" + "{ canAccessML: boolean; canGetJobs: boolean; canGetDatafeeds: boolean; canGetCalendars: boolean; canFindFileStructure: boolean; canGetDataFrameAnalytics: boolean; canGetAnnotations: boolean; canCreateAnnotation: boolean; canDeleteAnnotation: boolean; canUseMlAlerts: boolean; } & { canCreateJob: boolean; canDeleteJob: boolean; canOpenJob: boolean; canCloseJob: boolean; canResetJob: boolean; canUpdateJob: boolean; canForecastJob: boolean; canCreateDatafeed: boolean; canDeleteDatafeed: boolean; canStartStopDatafeed: boolean; canUpdateDatafeed: boolean; canPreviewDatafeed: boolean; canGetFilters: boolean; canCreateCalendar: boolean; canDeleteCalendar: boolean; canCreateFilter: boolean; canDeleteFilter: boolean; canCreateDataFrameAnalytics: boolean; canDeleteDataFrameAnalytics: boolean; canStartStopDataFrameAnalytics: boolean; canCreateMlAlerts: boolean; canUseMlAlerts: boolean; canViewMlNodes: boolean; }" ], "path": "x-pack/plugins/ml/common/types/capabilities.ts", "deprecated": false @@ -1863,12 +1863,12 @@ { "parentPluginId": "ml", "id": "def-server.AnomalyCategorizerStatsDoc.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: any", "description": [], "signature": [ - "any" + "[key: string]: any" ], "path": "x-pack/plugins/ml/common/types/anomalies.ts", "deprecated": false @@ -2031,12 +2031,12 @@ { "parentPluginId": "ml", "id": "def-server.AnomalyRecordDoc.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: any", "description": [], "signature": [ - "any" + "[key: string]: any" ], "path": "x-pack/plugins/ml/common/types/anomalies.ts", "deprecated": false @@ -3290,9 +3290,6 @@ "tags": [], "label": "MlJobBlocked", "description": [], - "signature": [ - "MlJobBlocked" - ], "path": "x-pack/plugins/ml/common/types/anomaly_detection_jobs/job.ts", "deprecated": false, "initialIsOpen": false @@ -3539,6 +3536,23 @@ "returnComment": [], "initialIsOpen": false }, + { + "parentPluginId": "ml", + "id": "def-common.getDefaultCapabilities", + "type": "Function", + "tags": [], + "label": "getDefaultCapabilities", + "description": [], + "signature": [ + "() => ", + "MlCapabilities" + ], + "path": "x-pack/plugins/ml/common/types/capabilities.ts", + "deprecated": false, + "children": [], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "ml", "id": "def-common.getSeverityColor", diff --git a/api_docs/ml.mdx b/api_docs/ml.mdx index 52618ec948857..0de51079f13f7 100644 --- a/api_docs/ml.mdx +++ b/api_docs/ml.mdx @@ -18,7 +18,7 @@ Contact [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) for q | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 282 | 10 | 278 | 33 | +| 283 | 8 | 279 | 34 | ## Client diff --git a/api_docs/observability.json b/api_docs/observability.json index f237dcdcb4e1c..de38eb48d98d1 100644 --- a/api_docs/observability.json +++ b/api_docs/observability.json @@ -3243,9 +3243,6 @@ "tags": [], "label": "DropResult", "description": [], - "signature": [ - "DropResult" - ], "path": "x-pack/plugins/observability/public/typings/eui_draggable/index.ts", "deprecated": false, "initialIsOpen": false @@ -4792,6 +4789,20 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "observability", + "id": "def-common.casesPath", + "type": "string", + "tags": [], + "label": "casesPath", + "description": [], + "signature": [ + "\"/cases\"" + ], + "path": "x-pack/plugins/observability/common/index.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "observability", "id": "def-common.enableComparisonByDefault", diff --git a/api_docs/observability.mdx b/api_docs/observability.mdx index 47c49717b249d..d06d2d64735d9 100644 --- a/api_docs/observability.mdx +++ b/api_docs/observability.mdx @@ -18,7 +18,7 @@ Contact [Observability UI](https://github.com/orgs/elastic/teams/observability-u | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 274 | 1 | 273 | 17 | +| 275 | 1 | 274 | 17 | ## Client diff --git a/api_docs/plugin_directory.mdx b/api_docs/plugin_directory.mdx index 72eca2b2933fa..1e79db71d5d31 100644 --- a/api_docs/plugin_directory.mdx +++ b/api_docs/plugin_directory.mdx @@ -18,40 +18,43 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | API Count | Any Count | Missing comments | Missing exports | |--------------|----------|-----------------|--------| -| 24821 | 269 | 20163 | 760 | +| 24885 | 173 | 20207 | 1658 | ## Plugin Directory | Plugin name           | Maintaining team | Description | API Cnt | Any Cnt | Missing
comments | Missing
exports | |--------------|----------------|-----------|--------------|----------|---------------|--------| | | [Kibana Alerting](https://github.com/orgs/elastic/teams/kibana-alerting-services) | - | 125 | 0 | 125 | 8 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | - | 23 | 0 | 22 | 1 | -| | [Kibana Alerting](https://github.com/orgs/elastic/teams/kibana-alerting-services) | - | 260 | 0 | 252 | 18 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | - | 23 | 0 | 20 | 1 | +| | [Kibana Alerting](https://github.com/orgs/elastic/teams/kibana-alerting-services) | - | 263 | 0 | 255 | 18 | | | [APM UI](https://github.com/orgs/elastic/teams/apm-ui) | The user interface for Elastic APM | 39 | 0 | 39 | 42 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 9 | 0 | 9 | 0 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Considering using bfetch capabilities when fetching large amounts of data. This services supports batching HTTP requests and streaming responses back. | 76 | 1 | 67 | 2 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds Canvas application to Kibana | 9 | 0 | 8 | 3 | -| | [Security Solution Threat Hunting](https://github.com/orgs/elastic/teams/security-threat-hunting) | The Case management system in Kibana | 478 | 0 | 434 | 15 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | - | 310 | 4 | 278 | 3 | +| | [Security Solution Threat Hunting](https://github.com/orgs/elastic/teams/security-threat-hunting) | The Case management system in Kibana | 451 | 0 | 411 | 15 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | - | 310 | 2 | 278 | 3 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 22 | 0 | 22 | 0 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 13 | 0 | 13 | 1 | -| | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 2318 | 26 | 1031 | 29 | +| | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 2326 | 15 | 1039 | 30 | | crossClusterReplication | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | -| | [Fleet](https://github.com/orgs/elastic/teams/fleet) | Add custom data integrations so they can be displayed in the Fleet integrations app | 96 | 1 | 80 | 1 | -| | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds the Dashboard app to Kibana | 153 | 1 | 140 | 12 | +| | [Fleet](https://github.com/orgs/elastic/teams/fleet) | Add custom data integrations so they can be displayed in the Fleet integrations app | 96 | 0 | 80 | 1 | +| | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds the Dashboard app to Kibana | 153 | 0 | 140 | 12 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 51 | 0 | 50 | 0 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. | 3245 | 40 | 2853 | 48 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. | 3245 | 39 | 2853 | 48 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Enhanced data plugin. (See src/plugins/data.) Enhances the main data plugin with a search session management UI. Includes a reusable search session indicator component to use in other applications. Exposes routes for managing search sessions. Includes a service that monitors, updates, and cleans up search session saved objects. | 16 | 0 | 16 | 2 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. | 668 | 5 | 526 | 5 | -| | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | The Data Visualizer tools help you understand your data, by analyzing the metrics and fields in a log file or an existing Elasticsearch index. | 84 | 5 | 84 | 0 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | This plugin provides the ability to create data views via a modal flyout from any kibana app | 13 | 0 | 9 | 0 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Reusable data view field editor across Kibana | 42 | 0 | 39 | 3 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data view management app | 2 | 0 | 2 | 0 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. | 709 | 3 | 561 | 5 | +| | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | The Data Visualizer tools help you understand your data, by analyzing the metrics and fields in a log file or an existing Elasticsearch index. | 84 | 2 | 84 | 0 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 10 | 0 | 8 | 2 | | | [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | This plugin contains the Discover application and the saved search embeddable. | 89 | 0 | 61 | 7 | | | [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 37 | 0 | 35 | 2 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds embeddables service to Kibana | 469 | 5 | 393 | 3 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds embeddables service to Kibana | 469 | 0 | 393 | 3 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Extends embeddable plugin with more functionality | 14 | 0 | 14 | 0 | | | [Platform Security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides encryption and decryption utilities for saved objects containing sensitive information. | 29 | 0 | 27 | 4 | | | [Enterprise Search](https://github.com/orgs/elastic/teams/enterprise-search-frontend) | Adds dashboards for discovering and managing Enterprise Search products. | 2 | 0 | 2 | 0 | -| | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 110 | 5 | 106 | 3 | +| | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 110 | 3 | 106 | 3 | | | [Kibana Alerting](https://github.com/orgs/elastic/teams/kibana-alerting-services) | - | 81 | 0 | 81 | 4 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'error' renderer to expressions | 12 | 0 | 12 | 2 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'image' function and renderer to expressions | 24 | 0 | 24 | 0 | @@ -61,33 +64,30 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'revealImage' function and renderer to expressions | 12 | 0 | 12 | 3 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds 'shape' function and renderer to expressions | 143 | 0 | 143 | 0 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Expression Tagcloud plugin adds a `tagcloud` renderer and function to the expression plugin. The renderer will display the `Wordcloud` chart. | 5 | 0 | 5 | 0 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds expression runtime to Kibana | 2102 | 27 | 1656 | 3 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds expression runtime to Kibana | 2102 | 26 | 1656 | 3 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 216 | 0 | 98 | 2 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Index pattern fields and ambiguous values formatters | 278 | 7 | 240 | 3 | -| | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | The file upload plugin contains components and services for uploading a file, analyzing its data, and then importing the data into an Elasticsearch index. Supported file types include CSV, TSV, newline-delimited JSON and GeoJSON. | 129 | 4 | 129 | 1 | -| | [Fleet](https://github.com/orgs/elastic/teams/fleet) | - | 1229 | 15 | 1127 | 10 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Index pattern fields and ambiguous values formatters | 278 | 6 | 240 | 3 | +| | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | The file upload plugin contains components and services for uploading a file, analyzing its data, and then importing the data into an Elasticsearch index. Supported file types include CSV, TSV, newline-delimited JSON and GeoJSON. | 129 | 2 | 129 | 1 | +| | [Fleet](https://github.com/orgs/elastic/teams/fleet) | - | 1232 | 8 | 1130 | 10 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 68 | 0 | 14 | 5 | | globalSearchBar | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 0 | 0 | 0 | 0 | | globalSearchProviders | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 0 | 0 | 0 | 0 | | graph | [Data Discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 0 | 0 | 0 | 0 | | grokdebugger | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | -| | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 132 | 4 | 102 | 0 | +| | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 132 | 0 | 102 | 0 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 4 | 0 | 4 | 0 | -| | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 169 | 9 | 164 | 3 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | This plugin provides the ability to create index patterns via a modal flyout from any kibana app | 13 | 1 | 8 | 0 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Reusable index pattern field editor across Kibana | 42 | 2 | 39 | 3 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Index pattern management app | 2 | 0 | 2 | 0 | +| | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 169 | 3 | 164 | 3 | | | [Logs and Metrics UI](https://github.com/orgs/elastic/teams/logs-metrics-ui) | This plugin visualizes data from Filebeat and Metricbeat, and integrates with other Observability solutions | 25 | 0 | 22 | 3 | | ingestPipelines | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | | inputControlVis | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds Input Control visualization to Kibana | 0 | 0 | 0 | 0 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 123 | 6 | 96 | 4 | -| | [Platform Security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides UI and APIs for the interactive setup mode. | 27 | 0 | 17 | 0 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 123 | 2 | 96 | 4 | +| | [Platform Security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides UI and APIs for the interactive setup mode. | 28 | 0 | 18 | 0 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | - | 11 | 0 | 8 | 0 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 6 | 0 | 6 | 0 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 237 | 2 | 213 | 5 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 238 | 0 | 213 | 5 | | kibanaUsageCollection | [Kibana Telemetry](https://github.com/orgs/elastic/teams/kibana-telemetry) | - | 0 | 0 | 0 | 0 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 615 | 3 | 420 | 8 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Visualization editor allowing to quickly and easily configure compelling visualizations to use on dashboards and canvas workpads. Exposes components to embed visualizations and link into the Lens editor from within other apps in Kibana. | 259 | 0 | 242 | 23 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Visualization editor allowing to quickly and easily configure compelling visualizations to use on dashboards and canvas workpads. Exposes components to embed visualizations and link into the Lens editor from within other apps in Kibana. | 260 | 0 | 243 | 24 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 8 | 0 | 8 | 0 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 3 | 0 | 3 | 0 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 117 | 0 | 42 | 8 | @@ -95,16 +95,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | logstash | [Logstash](https://github.com/orgs/elastic/teams/logstash) | - | 0 | 0 | 0 | 0 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | - | 41 | 0 | 41 | 5 | | | [GIS](https://github.com/orgs/elastic/teams/kibana-gis) | - | 205 | 0 | 204 | 29 | -| | [GIS](https://github.com/orgs/elastic/teams/kibana-gis) | - | 64 | 1 | 64 | 0 | +| | [GIS](https://github.com/orgs/elastic/teams/kibana-gis) | - | 64 | 0 | 64 | 0 | | | [Security solution](https://github.com/orgs/elastic/teams/security-solution) | - | 9 | 0 | 6 | 1 | -| | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | This plugin provides access to the machine learning features provided by Elastic. | 282 | 10 | 278 | 33 | +| | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | This plugin provides access to the machine learning features provided by Elastic. | 283 | 8 | 279 | 34 | | | [Stack Monitoring](https://github.com/orgs/elastic/teams/stack-monitoring-ui) | - | 10 | 0 | 10 | 2 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 31 | 0 | 31 | 2 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 17 | 0 | 17 | 0 | -| | [Observability UI](https://github.com/orgs/elastic/teams/observability-ui) | - | 274 | 1 | 273 | 17 | +| | [Observability UI](https://github.com/orgs/elastic/teams/observability-ui) | - | 275 | 1 | 274 | 17 | | | [Security asset management](https://github.com/orgs/elastic/teams/security-asset-management) | - | 10 | 0 | 10 | 0 | | painlessLab | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | -| | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | The Presentation Utility Plugin is a set of common, shared components and toolkits for solutions within the Presentation space, (e.g. Dashboards, Canvas). | 271 | 4 | 243 | 12 | +| | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | The Presentation Utility Plugin is a set of common, shared components and toolkits for solutions within the Presentation space, (e.g. Dashboards, Canvas). | 271 | 2 | 243 | 12 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 4 | 0 | 4 | 0 | | | [Kibana Reporting Services](https://github.com/orgs/elastic/teams/kibana-reporting-services) | Reporting Services enables applications to feature reports that the user can automate with Watcher and download later. | 165 | 0 | 162 | 15 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 21 | 0 | 21 | 0 | @@ -113,12 +113,12 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 221 | 3 | 207 | 4 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 103 | 0 | 90 | 0 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 54 | 0 | 50 | 0 | -| | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 90 | 3 | 51 | 0 | +| | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 90 | 0 | 51 | 0 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 22 | 0 | 17 | 1 | | searchprofiler | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | | | [Platform Security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides authentication and authorization features, and exposes functionality to understand the capabilities of the currently authenticated user. | 108 | 0 | 47 | 8 | -| | [Security solution](https://github.com/orgs/elastic/teams/security-solution) | - | 1378 | 8 | 1329 | 33 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds URL Service and sharing capabilities to Kibana | 132 | 1 | 79 | 10 | +| | [Security solution](https://github.com/orgs/elastic/teams/security-solution) | - | 1378 | 4 | 1329 | 33 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds URL Service and sharing capabilities to Kibana | 132 | 0 | 79 | 10 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 23 | 1 | 23 | 1 | | | [Platform Security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides the Spaces feature, which allows saved objects to be organized into meaningful categories. | 208 | 0 | 21 | 1 | | | [Kibana Alerting](https://github.com/orgs/elastic/teams/kibana-alerting-services) | - | 4 | 0 | 4 | 0 | @@ -127,12 +127,12 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Kibana Telemetry](https://github.com/orgs/elastic/teams/kibana-telemetry) | - | 32 | 0 | 32 | 5 | | | [Kibana Telemetry](https://github.com/orgs/elastic/teams/kibana-telemetry) | - | 1 | 0 | 1 | 0 | | | [Kibana Telemetry](https://github.com/orgs/elastic/teams/kibana-telemetry) | - | 11 | 0 | 10 | 0 | -| | [Security solution](https://github.com/orgs/elastic/teams/security-solution) | - | 987 | 8 | 869 | 25 | +| | [Security solution](https://github.com/orgs/elastic/teams/security-solution) | - | 1013 | 4 | 879 | 25 | | | [Machine Learning UI](https://github.com/orgs/elastic/teams/ml-ui) | This plugin provides access to the transforms features provided by Elastic. Transforms enable you to convert existing Elasticsearch indices into summarized indices, which provide opportunities for new insights and analytics. | 4 | 0 | 4 | 1 | | translations | [Kibana Localization](https://github.com/orgs/elastic/teams/kibana-localization) | - | 0 | 0 | 0 | 0 | -| | [Kibana Alerting](https://github.com/orgs/elastic/teams/kibana-alerting-services) | - | 238 | 1 | 229 | 18 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds UI Actions service to Kibana | 127 | 0 | 88 | 11 | -| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Extends UI Actions plugin with more functionality | 203 | 2 | 145 | 9 | +| | [Kibana Alerting](https://github.com/orgs/elastic/teams/kibana-alerting-services) | - | 238 | 0 | 229 | 18 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds UI Actions service to Kibana | 129 | 0 | 90 | 11 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Extends UI Actions plugin with more functionality | 203 | 0 | 145 | 9 | | upgradeAssistant | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | | uptime | [Uptime](https://github.com/orgs/elastic/teams/uptime) | This plugin visualizes data from Synthetics and Heartbeat, and integrates with other Observability solutions. | 0 | 0 | 0 | 0 | | urlDrilldown | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds drilldown implementations to Kibana | 0 | 0 | 0 | 0 | @@ -149,7 +149,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Registers the vega visualization. Is the elastic version of vega and vega-lite libraries. | 2 | 0 | 2 | 0 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Contains the vislib visualizations. These are the classical area/line/bar, pie, gauge/goal and heatmap charts. We want to replace them with elastic-charts. | 26 | 0 | 25 | 1 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Contains the new xy-axis chart using the elastic-charts library, which will eventually replace the vislib xy-axis charts including bar, area, and line. | 57 | 0 | 51 | 5 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Contains the shared architecture among all the legacy visualizations, e.g. the visualization type registry or the visualization embeddable. | 303 | 13 | 285 | 15 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Contains the shared architecture among all the legacy visualizations, e.g. the visualization type registry or the visualization embeddable. | 303 | 11 | 285 | 15 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Contains the visualize application which includes the listing page and the app frame, which will load the visualization's editor. | 24 | 0 | 23 | 1 | | watcher | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | @@ -168,16 +168,16 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Owner missing] | - | 66 | 0 | 46 | 1 | | | [Owner missing] | - | 109 | 3 | 107 | 18 | | | [Owner missing] | - | 13 | 0 | 7 | 0 | -| | [Owner missing] | - | 280 | 6 | 214 | 0 | +| | [Owner missing] | - | 280 | 3 | 214 | 0 | | | [Owner missing] | - | 1 | 0 | 1 | 0 | | | [Owner missing] | - | 27 | 0 | 14 | 1 | -| | [Owner missing] | - | 205 | 2 | 153 | 14 | +| | [Owner missing] | - | 205 | 1 | 153 | 14 | | | [Owner missing] | - | 20 | 0 | 16 | 0 | | | [Owner missing] | - | 2 | 0 | 2 | 2 | | | [Owner missing] | - | 18 | 0 | 18 | 2 | | | [Owner missing] | - | 30 | 0 | 5 | 37 | -| | [Owner missing] | - | 467 | 9 | 378 | 0 | -| | [Owner missing] | - | 52 | 1 | 52 | 2 | +| | [Owner missing] | - | 467 | 1 | 378 | 0 | +| | [Owner missing] | - | 55 | 0 | 55 | 2 | | | [Owner missing] | - | 45 | 0 | 45 | 9 | | | [Owner missing] | - | 1 | 0 | 1 | 0 | | | [Owner missing] | Just some helpers for kibana plugin devs. | 1 | 0 | 1 | 0 | @@ -187,7 +187,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Owner missing] | Security Solution auto complete | 47 | 1 | 34 | 0 | | | [Owner missing] | security solution elastic search utilities to use across plugins such lists, security_solution, cases, etc... | 57 | 0 | 51 | 0 | | | [Owner missing] | Security Solution utilities for React hooks | 8 | 0 | 1 | 1 | -| | [Owner missing] | io ts utilities and types to be shared with plugins from the security solution project | 147 | 1 | 128 | 0 | +| | [Owner missing] | io ts utilities and types to be shared with plugins from the security solution project | 147 | 0 | 128 | 0 | | | [Owner missing] | io ts utilities and types to be shared with plugins from the security solution project | 428 | 1 | 419 | 0 | | | [Owner missing] | io ts utilities and types to be shared with plugins from the security solution project | 45 | 0 | 23 | 0 | | | [Owner missing] | io ts utilities and types to be shared with plugins from the security solution project | 28 | 0 | 22 | 0 | @@ -203,8 +203,8 @@ warning: This document is auto-generated and is meant to be viewed inside our ex | | [Owner missing] | - | 96 | 1 | 63 | 2 | | | [Owner missing] | - | 18 | 1 | 18 | 0 | | | [Owner missing] | - | 2 | 0 | 2 | 0 | -| | [Owner missing] | - | 203 | 5 | 180 | 9 | +| | [Owner missing] | - | 203 | 4 | 180 | 9 | | | [Owner missing] | - | 78 | 0 | 78 | 1 | -| | [Owner missing] | - | 29 | 1 | 10 | 1 | +| | [Owner missing] | - | 29 | 0 | 10 | 1 | | | [Owner missing] | - | 31 | 1 | 21 | 0 | diff --git a/api_docs/presentation_util.json b/api_docs/presentation_util.json index 5fd6f4106e4e6..a436c40064eb2 100644 --- a/api_docs/presentation_util.json +++ b/api_docs/presentation_util.json @@ -437,6 +437,113 @@ "path": "src/plugins/presentation_util/public/components/controls/control_group/embeddable/control_group_container_factory.ts", "deprecated": false }, + { + "parentPluginId": "presentationUtil", + "id": "def-public.ControlGroupContainerFactory.inject", + "type": "Function", + "tags": [], + "label": "inject", + "description": [], + "signature": [ + "(state: ", + { + "pluginId": "embeddable", + "scope": "common", + "docId": "kibEmbeddablePluginApi", + "section": "def-common.EmbeddableStateWithType", + "text": "EmbeddableStateWithType" + }, + ", references: ", + "SavedObjectReference", + "[]) => ", + { + "pluginId": "embeddable", + "scope": "common", + "docId": "kibEmbeddablePluginApi", + "section": "def-common.EmbeddableStateWithType", + "text": "EmbeddableStateWithType" + } + ], + "path": "src/plugins/presentation_util/public/components/controls/control_group/embeddable/control_group_container_factory.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "presentationUtil", + "id": "def-public.ControlGroupContainerFactory.inject.$1", + "type": "Uncategorized", + "tags": [], + "label": "state", + "description": [], + "signature": [ + "P" + ], + "path": "src/plugins/kibana_utils/common/persistable_state/types.ts", + "deprecated": false + }, + { + "parentPluginId": "presentationUtil", + "id": "def-public.ControlGroupContainerFactory.inject.$2", + "type": "Array", + "tags": [], + "label": "references", + "description": [], + "signature": [ + "SavedObjectReference", + "[]" + ], + "path": "src/plugins/kibana_utils/common/persistable_state/types.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "presentationUtil", + "id": "def-public.ControlGroupContainerFactory.extract", + "type": "Function", + "tags": [], + "label": "extract", + "description": [], + "signature": [ + "(state: ", + { + "pluginId": "embeddable", + "scope": "common", + "docId": "kibEmbeddablePluginApi", + "section": "def-common.EmbeddableStateWithType", + "text": "EmbeddableStateWithType" + }, + ") => { state: ", + { + "pluginId": "embeddable", + "scope": "common", + "docId": "kibEmbeddablePluginApi", + "section": "def-common.EmbeddableStateWithType", + "text": "EmbeddableStateWithType" + }, + "; references: ", + "SavedObjectReference", + "[]; }" + ], + "path": "src/plugins/presentation_util/public/components/controls/control_group/embeddable/control_group_container_factory.ts", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "presentationUtil", + "id": "def-public.ControlGroupContainerFactory.extract.$1", + "type": "Uncategorized", + "tags": [], + "label": "state", + "description": [], + "signature": [ + "P" + ], + "path": "src/plugins/kibana_utils/common/persistable_state/types.ts", + "deprecated": false + } + ] + }, { "parentPluginId": "presentationUtil", "id": "def-public.ControlGroupContainerFactory.Unnamed", @@ -620,113 +727,6 @@ } ], "returnComment": [] - }, - { - "parentPluginId": "presentationUtil", - "id": "def-public.ControlGroupContainerFactory.inject", - "type": "Function", - "tags": [], - "label": "inject", - "description": [], - "signature": [ - "(state: ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableStateWithType", - "text": "EmbeddableStateWithType" - }, - ", references: ", - "SavedObjectReference", - "[]) => ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableStateWithType", - "text": "EmbeddableStateWithType" - } - ], - "path": "src/plugins/presentation_util/public/components/controls/control_group/embeddable/control_group_container_factory.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "presentationUtil", - "id": "def-public.ControlGroupContainerFactory.inject.$1", - "type": "Uncategorized", - "tags": [], - "label": "state", - "description": [], - "signature": [ - "P" - ], - "path": "src/plugins/kibana_utils/common/persistable_state/types.ts", - "deprecated": false - }, - { - "parentPluginId": "presentationUtil", - "id": "def-public.ControlGroupContainerFactory.inject.$2", - "type": "Array", - "tags": [], - "label": "references", - "description": [], - "signature": [ - "SavedObjectReference", - "[]" - ], - "path": "src/plugins/kibana_utils/common/persistable_state/types.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "presentationUtil", - "id": "def-public.ControlGroupContainerFactory.extract", - "type": "Function", - "tags": [], - "label": "extract", - "description": [], - "signature": [ - "(state: ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableStateWithType", - "text": "EmbeddableStateWithType" - }, - ") => { state: ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableStateWithType", - "text": "EmbeddableStateWithType" - }, - "; references: ", - "SavedObjectReference", - "[]; }" - ], - "path": "src/plugins/presentation_util/public/components/controls/control_group/embeddable/control_group_container_factory.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "presentationUtil", - "id": "def-public.ControlGroupContainerFactory.extract.$1", - "type": "Uncategorized", - "tags": [], - "label": "state", - "description": [], - "signature": [ - "P" - ], - "path": "src/plugins/kibana_utils/common/persistable_state/types.ts", - "deprecated": false - } - ] } ], "initialIsOpen": false @@ -2373,12 +2373,16 @@ { "parentPluginId": "presentationUtil", "id": "def-public.ControlsPanels.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[panelId: string]: ControlPanelState", "description": [], "signature": [ - "any" + "[panelId: string]: ", + "ControlPanelState", + "<", + "ControlInput", + ">" ], "path": "src/plugins/presentation_util/common/controls/control_group/types.ts", "deprecated": false diff --git a/api_docs/presentation_util.mdx b/api_docs/presentation_util.mdx index 65d3713c55b82..b930d26c11ef8 100644 --- a/api_docs/presentation_util.mdx +++ b/api_docs/presentation_util.mdx @@ -18,7 +18,7 @@ Contact [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-prese | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 271 | 4 | 243 | 12 | +| 271 | 2 | 243 | 12 | ## Client diff --git a/api_docs/saved_objects_tagging_oss.mdx b/api_docs/saved_objects_tagging_oss.mdx index 206d6ad01a49e..5df9d6d1eb33a 100644 --- a/api_docs/saved_objects_tagging_oss.mdx +++ b/api_docs/saved_objects_tagging_oss.mdx @@ -18,7 +18,7 @@ Contact [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) for que | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 90 | 3 | 51 | 0 | +| 90 | 0 | 51 | 0 | ## Client diff --git a/api_docs/security_solution.json b/api_docs/security_solution.json index 73ea87032d624..d3670c4bc810e 100644 --- a/api_docs/security_solution.json +++ b/api_docs/security_solution.json @@ -272,7 +272,13 @@ "description": [], "signature": [ "Pick<", - "TGridModel", + { + "pluginId": "timelines", + "scope": "public", + "docId": "kibTimelinesPluginApi", + "section": "def-public.TGridModel", + "text": "TGridModel" + }, ", \"columns\" | \"sort\" | \"title\" | \"version\" | \"filters\" | \"id\" | \"isLoading\" | \"filterManager\" | \"dateRange\" | \"defaultColumns\" | \"savedObjectId\" | \"unit\" | \"dataProviders\" | \"dataViewId\" | \"deletedEventIds\" | \"documentType\" | \"excludedRowRendererIds\" | \"expandedDetail\" | \"footerText\" | \"graphEventId\" | \"kqlQuery\" | \"queryFields\" | \"indexNames\" | \"isSelectAllChecked\" | \"itemsPerPage\" | \"itemsPerPageOptions\" | \"loadingEventIds\" | \"loadingText\" | \"selectAll\" | \"showCheckboxes\" | \"selectedEventIds\"> & { activeTab: ", { "pluginId": "securitySolution", @@ -1601,12 +1607,13 @@ { "parentPluginId": "securitySolution", "id": "def-common.AggregationRequest.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[aggField: string]: AggregationsAggregationContainer", "description": [], "signature": [ - "any" + "[aggField: string]: ", + "AggregationsAggregationContainer" ], "path": "x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/details/index.ts", "deprecated": false @@ -1797,12 +1804,12 @@ { "parentPluginId": "securitySolution", "id": "def-common.AnomalySource.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[field: string]: any", "description": [], "signature": [ - "any" + "[field: string]: any" ], "path": "x-pack/plugins/security_solution/common/search_strategy/security_solution/matrix_histogram/anomalies/index.ts", "deprecated": false @@ -4401,12 +4408,12 @@ { "parentPluginId": "securitySolution", "id": "def-common.EventSource.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[field: string]: any", "description": [], "signature": [ - "any" + "[field: string]: any" ], "path": "x-pack/plugins/security_solution/common/search_strategy/security_solution/matrix_histogram/events/index.ts", "deprecated": false @@ -4649,12 +4656,20 @@ { "parentPluginId": "securitySolution", "id": "def-common.Fields.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[x: string]: T | Fields[]", "description": [], "signature": [ - "any" + "[x: string]: T | ", + { + "pluginId": "securitySolution", + "scope": "common", + "docId": "kibSecuritySolutionPluginApi", + "section": "def-common.Fields", + "text": "Fields" + }, + "[]" ], "path": "x-pack/plugins/security_solution/common/search_strategy/security_solution/matrix_histogram/events/index.ts", "deprecated": false diff --git a/api_docs/security_solution.mdx b/api_docs/security_solution.mdx index 36e7c614ca380..ba21bd9aa5fcd 100644 --- a/api_docs/security_solution.mdx +++ b/api_docs/security_solution.mdx @@ -18,7 +18,7 @@ Contact [Security solution](https://github.com/orgs/elastic/teams/security-solut | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 1378 | 8 | 1329 | 33 | +| 1378 | 4 | 1329 | 33 | ## Client diff --git a/api_docs/share.json b/api_docs/share.json index 595ba479186e2..0b0fdca026c37 100644 --- a/api_docs/share.json +++ b/api_docs/share.json @@ -691,10 +691,6 @@ "plugin": "ml", "path": "x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseriesexplorer_no_jobs_found/timeseriesexplorer_no_jobs_found.tsx" }, - { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/trained_models/models_management/expanded_row.tsx" - }, { "plugin": "ml", "path": "x-pack/plugins/ml/public/application/trained_models/models_management/models_list.tsx" @@ -729,7 +725,7 @@ }, { "plugin": "upgradeAssistant", - "path": "x-pack/plugins/upgrade_assistant/public/application/components/overview/fix_logs_step/external_links.tsx" + "path": "x-pack/plugins/upgrade_assistant/public/application/components/es_deprecation_logs/fix_deprecation_logs/external_links.tsx" }, { "plugin": "upgradeAssistant", @@ -1686,12 +1682,20 @@ { "parentPluginId": "share", "id": "def-public.UrlGeneratorStateMapping.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: UrlGeneratorState", "description": [], "signature": [ - "any" + "[key: string]: ", + { + "pluginId": "share", + "scope": "public", + "docId": "kibSharePluginApi", + "section": "def-public.UrlGeneratorState", + "text": "UrlGeneratorState" + }, + "" ], "path": "src/plugins/share/public/url_generators/url_generator_definition.ts", "deprecated": false @@ -2397,10 +2401,6 @@ "plugin": "ml", "path": "x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseriesexplorer_no_jobs_found/timeseriesexplorer_no_jobs_found.tsx" }, - { - "plugin": "ml", - "path": "x-pack/plugins/ml/public/application/trained_models/models_management/expanded_row.tsx" - }, { "plugin": "ml", "path": "x-pack/plugins/ml/public/application/trained_models/models_management/models_list.tsx" @@ -2435,7 +2435,7 @@ }, { "plugin": "upgradeAssistant", - "path": "x-pack/plugins/upgrade_assistant/public/application/components/overview/fix_logs_step/external_links.tsx" + "path": "x-pack/plugins/upgrade_assistant/public/application/components/es_deprecation_logs/fix_deprecation_logs/external_links.tsx" }, { "plugin": "upgradeAssistant", diff --git a/api_docs/share.mdx b/api_docs/share.mdx index 29309f413390f..a10e552c6af57 100644 --- a/api_docs/share.mdx +++ b/api_docs/share.mdx @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 132 | 1 | 79 | 10 | +| 132 | 0 | 79 | 10 | ## Client diff --git a/api_docs/spaces.json b/api_docs/spaces.json index 8bee2084c46cc..2b7a53d6daf59 100644 --- a/api_docs/spaces.json +++ b/api_docs/spaces.json @@ -2582,9 +2582,7 @@ "parentPluginId": "spaces", "id": "def-server.SpacesServiceSetup.getSpaceId", "type": "Function", - "tags": [ - "deprecated" - ], + "tags": [], "label": "getSpaceId", "description": [ "\nRetrieves the space id associated with the provided request." @@ -2601,46 +2599,7 @@ ") => string" ], "path": "x-pack/plugins/spaces/server/spaces_service/spaces_service.ts", - "deprecated": true, - "removeBy": "7.16", - "references": [ - { - "plugin": "security", - "path": "x-pack/plugins/security/server/audit/audit_service.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/check_privileges_dynamically.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/server/plugin.ts" - }, - { - "plugin": "reporting", - "path": "x-pack/plugins/reporting/server/core.ts" - }, - { - "plugin": "apm", - "path": "x-pack/plugins/apm/server/routes/data_view/route.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/infra/server/plugin.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/check_privileges_dynamically.test.ts" - } - ], + "deprecated": false, "children": [ { "parentPluginId": "spaces", @@ -2672,9 +2631,7 @@ "parentPluginId": "spaces", "id": "def-server.SpacesServiceSetup.spaceIdToNamespace", "type": "Function", - "tags": [ - "deprecated" - ], + "tags": [], "label": "spaceIdToNamespace", "description": [ "\nConverts the provided space id into the corresponding Saved Objects `namespace` id." @@ -2683,9 +2640,7 @@ "(spaceId: string) => string | undefined" ], "path": "x-pack/plugins/spaces/server/spaces_service/spaces_service.ts", - "deprecated": true, - "removeBy": "7.16", - "references": [], + "deprecated": false, "children": [ { "parentPluginId": "spaces", @@ -2710,9 +2665,7 @@ "parentPluginId": "spaces", "id": "def-server.SpacesServiceSetup.namespaceToSpaceId", "type": "Function", - "tags": [ - "deprecated" - ], + "tags": [], "label": "namespaceToSpaceId", "description": [ "\nConverts the provided namespace into the corresponding space id." @@ -2721,90 +2674,7 @@ "(namespace: string | undefined) => string" ], "path": "x-pack/plugins/spaces/server/spaces_service/spaces_service.ts", - "deprecated": true, - "removeBy": "7.16", - "references": [ - { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/check_saved_objects_privileges.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/check_saved_objects_privileges.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/server/saved_objects/secure_saved_objects_client_wrapper.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/server/saved_objects/secure_saved_objects_client_wrapper.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/server/saved_objects/secure_saved_objects_client_wrapper.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/check_privileges_dynamically.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/check_saved_objects_privileges.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/check_saved_objects_privileges.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/check_saved_objects_privileges.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/check_saved_objects_privileges.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/check_saved_objects_privileges.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/check_saved_objects_privileges.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/check_saved_objects_privileges.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/check_saved_objects_privileges.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/check_saved_objects_privileges.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/check_saved_objects_privileges.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/check_saved_objects_privileges.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/check_saved_objects_privileges.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/check_saved_objects_privileges.test.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/server/authorization/check_saved_objects_privileges.test.ts" - } - ], + "deprecated": false, "children": [ { "parentPluginId": "spaces", @@ -3326,12 +3196,10 @@ "parentPluginId": "spaces", "id": "def-server.SpacesPluginSetup.spacesService", "type": "Object", - "tags": [ - "deprecated" - ], + "tags": [], "label": "spacesService", "description": [ - "\nService for interacting with spaces.\n" + "\nService for interacting with spaces." ], "signature": [ { @@ -3343,58 +3211,7 @@ } ], "path": "x-pack/plugins/spaces/server/plugin.ts", - "deprecated": true, - "removeBy": "7.16", - "references": [ - { - "plugin": "security", - "path": "x-pack/plugins/security/server/plugin.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/server/plugin.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/server/plugin.ts" - }, - { - "plugin": "security", - "path": "x-pack/plugins/security/server/plugin.ts" - }, - { - "plugin": "reporting", - "path": "x-pack/plugins/reporting/server/core.ts" - }, - { - "plugin": "reporting", - "path": "x-pack/plugins/reporting/server/core.ts" - }, - { - "plugin": "reporting", - "path": "x-pack/plugins/reporting/server/core.ts" - }, - { - "plugin": "apm", - "path": "x-pack/plugins/apm/server/routes/data_view/route.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/infra/server/plugin.ts" - } - ] + "deprecated": false }, { "parentPluginId": "spaces", diff --git a/api_docs/timelines.json b/api_docs/timelines.json index ba8081fbefa3e..a11b68874a5d5 100644 --- a/api_docs/timelines.json +++ b/api_docs/timelines.json @@ -1391,6 +1391,413 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "timelines", + "id": "def-public.TGridModel", + "type": "Interface", + "tags": [], + "label": "TGridModel", + "description": [], + "signature": [ + { + "pluginId": "timelines", + "scope": "public", + "docId": "kibTimelinesPluginApi", + "section": "def-public.TGridModel", + "text": "TGridModel" + }, + " extends ", + "TGridModelSettings" + ], + "path": "x-pack/plugins/timelines/public/store/t_grid/model.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "timelines", + "id": "def-public.TGridModel.columns", + "type": "Array", + "tags": [], + "label": "columns", + "description": [ + "The columns displayed in the timeline" + ], + "signature": [ + "(Pick<", + "EuiDataGridColumn", + ", \"id\" | \"display\" | \"displayAsText\" | \"initialWidth\"> & Pick<", + "EuiDataGridColumn", + ", \"id\" | \"schema\" | \"display\" | \"actions\" | \"defaultSortDirection\" | \"displayAsText\" | \"initialWidth\" | \"isSortable\"> & { aggregatable?: boolean | undefined; tGridCellActions?: ", + { + "pluginId": "timelines", + "scope": "common", + "docId": "kibTimelinesPluginApi", + "section": "def-common.TGridCellAction", + "text": "TGridCellAction" + }, + "[] | undefined; category?: string | undefined; columnHeaderType: ", + { + "pluginId": "timelines", + "scope": "common", + "docId": "kibTimelinesPluginApi", + "section": "def-common.ColumnHeaderType", + "text": "ColumnHeaderType" + }, + "; description?: string | undefined; example?: string | undefined; format?: string | undefined; linkField?: string | undefined; placeholder?: string | undefined; subType?: ", + "IFieldSubTypeMultiOptional", + " | ", + "IFieldSubTypeNestedOptional", + " | undefined; type?: string | undefined; })[]" + ], + "path": "x-pack/plugins/timelines/public/store/t_grid/model.ts", + "deprecated": false + }, + { + "parentPluginId": "timelines", + "id": "def-public.TGridModel.dataProviders", + "type": "Array", + "tags": [], + "label": "dataProviders", + "description": [ + "The sources of the event data shown in the timeline" + ], + "signature": [ + { + "pluginId": "timelines", + "scope": "common", + "docId": "kibTimelinesPluginApi", + "section": "def-common.DataProvider", + "text": "DataProvider" + }, + "[]" + ], + "path": "x-pack/plugins/timelines/public/store/t_grid/model.ts", + "deprecated": false + }, + { + "parentPluginId": "timelines", + "id": "def-public.TGridModel.dateRange", + "type": "Object", + "tags": [], + "label": "dateRange", + "description": [ + "Specifies the granularity of the date range (e.g. 1 Day / Week / Month) applicable to the mini-map" + ], + "signature": [ + "{ start: string; end: string; }" + ], + "path": "x-pack/plugins/timelines/public/store/t_grid/model.ts", + "deprecated": false + }, + { + "parentPluginId": "timelines", + "id": "def-public.TGridModel.dataViewId", + "type": "string", + "tags": [], + "label": "dataViewId", + "description": [ + "Kibana data view id" + ], + "path": "x-pack/plugins/timelines/public/store/t_grid/model.ts", + "deprecated": false + }, + { + "parentPluginId": "timelines", + "id": "def-public.TGridModel.deletedEventIds", + "type": "Array", + "tags": [], + "label": "deletedEventIds", + "description": [ + "Events to not be rendered" + ], + "signature": [ + "string[]" + ], + "path": "x-pack/plugins/timelines/public/store/t_grid/model.ts", + "deprecated": false + }, + { + "parentPluginId": "timelines", + "id": "def-public.TGridModel.expandedDetail", + "type": "Object", + "tags": [], + "label": "expandedDetail", + "description": [ + "This holds the view information for the flyout when viewing timeline in a consuming view (i.e. hosts page) or the side panel in the primary timeline view" + ], + "signature": [ + "{ [x: string]: { panelView?: \"eventDetail\" | undefined; params?: { eventId: string; indexName: string; ecsData?: ", + "Ecs", + " | undefined; } | undefined; } | Partial> | { panelView?: \"hostDetail\" | undefined; params?: { hostName: string; } | undefined; } | { panelView?: \"networkDetail\" | undefined; params?: { ip: string; flowTarget: FlowTarget; } | undefined; } | undefined; }" + ], + "path": "x-pack/plugins/timelines/public/store/t_grid/model.ts", + "deprecated": false + }, + { + "parentPluginId": "timelines", + "id": "def-public.TGridModel.filters", + "type": "Array", + "tags": [], + "label": "filters", + "description": [], + "signature": [ + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, + "[] | undefined" + ], + "path": "x-pack/plugins/timelines/public/store/t_grid/model.ts", + "deprecated": false + }, + { + "parentPluginId": "timelines", + "id": "def-public.TGridModel.graphEventId", + "type": "string", + "tags": [], + "label": "graphEventId", + "description": [ + "When non-empty, display a graph view for this event" + ], + "signature": [ + "string | undefined" + ], + "path": "x-pack/plugins/timelines/public/store/t_grid/model.ts", + "deprecated": false + }, + { + "parentPluginId": "timelines", + "id": "def-public.TGridModel.kqlQuery", + "type": "Object", + "tags": [], + "label": "kqlQuery", + "description": [ + "the KQL query in the KQL bar" + ], + "signature": [ + "{ filterQuery: ", + { + "pluginId": "timelines", + "scope": "common", + "docId": "kibTimelinesPluginApi", + "section": "def-common.SerializedFilterQuery", + "text": "SerializedFilterQuery" + }, + " | null; }" + ], + "path": "x-pack/plugins/timelines/public/store/t_grid/model.ts", + "deprecated": false + }, + { + "parentPluginId": "timelines", + "id": "def-public.TGridModel.id", + "type": "string", + "tags": [], + "label": "id", + "description": [ + "Uniquely identifies the timeline" + ], + "path": "x-pack/plugins/timelines/public/store/t_grid/model.ts", + "deprecated": false + }, + { + "parentPluginId": "timelines", + "id": "def-public.TGridModel.indexNames", + "type": "Array", + "tags": [], + "label": "indexNames", + "description": [], + "signature": [ + "string[]" + ], + "path": "x-pack/plugins/timelines/public/store/t_grid/model.ts", + "deprecated": false + }, + { + "parentPluginId": "timelines", + "id": "def-public.TGridModel.isAddToExistingCaseOpen", + "type": "boolean", + "tags": [], + "label": "isAddToExistingCaseOpen", + "description": [], + "path": "x-pack/plugins/timelines/public/store/t_grid/model.ts", + "deprecated": false + }, + { + "parentPluginId": "timelines", + "id": "def-public.TGridModel.isCreateNewCaseOpen", + "type": "boolean", + "tags": [], + "label": "isCreateNewCaseOpen", + "description": [], + "path": "x-pack/plugins/timelines/public/store/t_grid/model.ts", + "deprecated": false + }, + { + "parentPluginId": "timelines", + "id": "def-public.TGridModel.isLoading", + "type": "boolean", + "tags": [], + "label": "isLoading", + "description": [], + "path": "x-pack/plugins/timelines/public/store/t_grid/model.ts", + "deprecated": false + }, + { + "parentPluginId": "timelines", + "id": "def-public.TGridModel.isSelectAllChecked", + "type": "boolean", + "tags": [], + "label": "isSelectAllChecked", + "description": [ + "If selectAll checkbox in header is checked" + ], + "path": "x-pack/plugins/timelines/public/store/t_grid/model.ts", + "deprecated": false + }, + { + "parentPluginId": "timelines", + "id": "def-public.TGridModel.itemsPerPage", + "type": "number", + "tags": [], + "label": "itemsPerPage", + "description": [ + "The number of items to show in a single page of results" + ], + "path": "x-pack/plugins/timelines/public/store/t_grid/model.ts", + "deprecated": false + }, + { + "parentPluginId": "timelines", + "id": "def-public.TGridModel.itemsPerPageOptions", + "type": "Array", + "tags": [], + "label": "itemsPerPageOptions", + "description": [ + "Displays a series of choices that when selected, become the value of `itemsPerPage`" + ], + "signature": [ + "number[]" + ], + "path": "x-pack/plugins/timelines/public/store/t_grid/model.ts", + "deprecated": false + }, + { + "parentPluginId": "timelines", + "id": "def-public.TGridModel.loadingEventIds", + "type": "Array", + "tags": [], + "label": "loadingEventIds", + "description": [ + "Events to be rendered as loading" + ], + "signature": [ + "string[]" + ], + "path": "x-pack/plugins/timelines/public/store/t_grid/model.ts", + "deprecated": false + }, + { + "parentPluginId": "timelines", + "id": "def-public.TGridModel.showCheckboxes", + "type": "boolean", + "tags": [], + "label": "showCheckboxes", + "description": [ + "When true, shows checkboxes enabling selection. Selected events store in selectedEventIds" + ], + "path": "x-pack/plugins/timelines/public/store/t_grid/model.ts", + "deprecated": false + }, + { + "parentPluginId": "timelines", + "id": "def-public.TGridModel.sort", + "type": "Array", + "tags": [], + "label": "sort", + "description": [ + " Specifies which column the timeline is sorted on, and the direction (ascending / descending)" + ], + "signature": [ + { + "pluginId": "timelines", + "scope": "common", + "docId": "kibTimelinesPluginApi", + "section": "def-common.SortColumnTimeline", + "text": "SortColumnTimeline" + }, + "[]" + ], + "path": "x-pack/plugins/timelines/public/store/t_grid/model.ts", + "deprecated": false + }, + { + "parentPluginId": "timelines", + "id": "def-public.TGridModel.selectedEventIds", + "type": "Object", + "tags": [], + "label": "selectedEventIds", + "description": [ + "Events selected on this timeline -- eventId to TimelineNonEcsData[] mapping of data required for bulk actions" + ], + "signature": [ + "{ [x: string]: ", + { + "pluginId": "timelines", + "scope": "common", + "docId": "kibTimelinesPluginApi", + "section": "def-common.TimelineNonEcsData", + "text": "TimelineNonEcsData" + }, + "[]; }" + ], + "path": "x-pack/plugins/timelines/public/store/t_grid/model.ts", + "deprecated": false + }, + { + "parentPluginId": "timelines", + "id": "def-public.TGridModel.savedObjectId", + "type": "CompoundType", + "tags": [], + "label": "savedObjectId", + "description": [], + "signature": [ + "string | null" + ], + "path": "x-pack/plugins/timelines/public/store/t_grid/model.ts", + "deprecated": false + }, + { + "parentPluginId": "timelines", + "id": "def-public.TGridModel.version", + "type": "CompoundType", + "tags": [], + "label": "version", + "description": [], + "signature": [ + "string | null" + ], + "path": "x-pack/plugins/timelines/public/store/t_grid/model.ts", + "deprecated": false + }, + { + "parentPluginId": "timelines", + "id": "def-public.TGridModel.initialized", + "type": "CompoundType", + "tags": [], + "label": "initialized", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "x-pack/plugins/timelines/public/store/t_grid/model.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "timelines", "id": "def-public.TimelineState", @@ -1717,6 +2124,28 @@ "deprecated": false, "initialIsOpen": false }, + { + "parentPluginId": "timelines", + "id": "def-public.State", + "type": "Type", + "tags": [], + "label": "State", + "description": [], + "signature": [ + "EmptyObject", + " & ", + { + "pluginId": "timelines", + "scope": "public", + "docId": "kibTimelinesPluginApi", + "section": "def-public.TimelineState", + "text": "TimelineState" + } + ], + "path": "x-pack/plugins/timelines/public/store/t_grid/index.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "timelines", "id": "def-public.TGridModelForTimeline", @@ -7393,12 +7822,12 @@ { "parentPluginId": "timelines", "id": "def-common.EventSource.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[field: string]: any", "description": [], "signature": [ - "any" + "[field: string]: any" ], "path": "x-pack/plugins/timelines/common/search_strategy/common/index.ts", "deprecated": false @@ -7588,12 +8017,20 @@ { "parentPluginId": "timelines", "id": "def-common.Fields.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[x: string]: T | Fields[]", "description": [], "signature": [ - "any" + "[x: string]: T | ", + { + "pluginId": "timelines", + "scope": "common", + "docId": "kibTimelinesPluginApi", + "section": "def-common.Fields", + "text": "Fields" + }, + "[]" ], "path": "x-pack/plugins/timelines/common/search_strategy/common/index.ts", "deprecated": false diff --git a/api_docs/timelines.mdx b/api_docs/timelines.mdx index 30e120efa4cb3..959c9551b6ffd 100644 --- a/api_docs/timelines.mdx +++ b/api_docs/timelines.mdx @@ -18,7 +18,7 @@ Contact [Security solution](https://github.com/orgs/elastic/teams/security-solut | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 987 | 8 | 869 | 25 | +| 1013 | 4 | 879 | 25 | ## Client diff --git a/api_docs/triggers_actions_ui.json b/api_docs/triggers_actions_ui.json index fde87285ae60d..6ee42e2a8444c 100644 --- a/api_docs/triggers_actions_ui.json +++ b/api_docs/triggers_actions_ui.json @@ -1620,12 +1620,19 @@ { "parentPluginId": "triggersActionsUi", "id": "def-public.IErrorObject.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: string | string[] | IErrorObject", "description": [], "signature": [ - "any" + "[key: string]: string | string[] | ", + { + "pluginId": "triggersActionsUi", + "scope": "public", + "docId": "kibTriggersActionsUiPluginApi", + "section": "def-public.IErrorObject", + "text": "IErrorObject" + } ], "path": "x-pack/plugins/triggers_actions_ui/public/types.ts", "deprecated": false diff --git a/api_docs/triggers_actions_ui.mdx b/api_docs/triggers_actions_ui.mdx index e626b24432246..2b3b921730f33 100644 --- a/api_docs/triggers_actions_ui.mdx +++ b/api_docs/triggers_actions_ui.mdx @@ -18,7 +18,7 @@ Contact [Kibana Alerting](https://github.com/orgs/elastic/teams/kibana-alerting- | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 238 | 1 | 229 | 18 | +| 238 | 0 | 229 | 18 | ## Client diff --git a/api_docs/ui_actions.json b/api_docs/ui_actions.json index ccdeb633338a5..5eb77b541a142 100644 --- a/api_docs/ui_actions.json +++ b/api_docs/ui_actions.json @@ -1048,15 +1048,15 @@ "section": "def-common.UiComponent", "text": "UiComponent" }, - "<{ context: ", + "<", { "pluginId": "uiActions", "scope": "public", "docId": "kibUiActionsPluginApi", - "section": "def-public.ActionExecutionContext", - "text": "ActionExecutionContext" + "section": "def-public.ActionMenuItemProps", + "text": "ActionMenuItemProps" }, - "; }> | undefined" + "> | undefined" ], "path": "src/plugins/ui_actions/public/actions/action.ts", "deprecated": false @@ -1490,6 +1490,49 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "uiActions", + "id": "def-public.ActionMenuItemProps", + "type": "Interface", + "tags": [], + "label": "ActionMenuItemProps", + "description": [], + "signature": [ + { + "pluginId": "uiActions", + "scope": "public", + "docId": "kibUiActionsPluginApi", + "section": "def-public.ActionMenuItemProps", + "text": "ActionMenuItemProps" + }, + "" + ], + "path": "src/plugins/ui_actions/public/actions/action.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "uiActions", + "id": "def-public.ActionMenuItemProps.context", + "type": "CompoundType", + "tags": [], + "label": "context", + "description": [], + "signature": [ + "Context & ", + { + "pluginId": "uiActions", + "scope": "public", + "docId": "kibUiActionsPluginApi", + "section": "def-public.ActionExecutionMeta", + "text": "ActionExecutionMeta" + } + ], + "path": "src/plugins/ui_actions/public/actions/action.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "uiActions", "id": "def-public.Presentable", diff --git a/api_docs/ui_actions.mdx b/api_docs/ui_actions.mdx index b5e8c1f69d8a7..27523595c8c5c 100644 --- a/api_docs/ui_actions.mdx +++ b/api_docs/ui_actions.mdx @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 127 | 0 | 88 | 11 | +| 129 | 0 | 90 | 11 | ## Client diff --git a/api_docs/ui_actions_enhanced.json b/api_docs/ui_actions_enhanced.json index 033c3b2ffd6aa..54c9c3f11f7d7 100644 --- a/api_docs/ui_actions_enhanced.json +++ b/api_docs/ui_actions_enhanced.json @@ -288,57 +288,6 @@ "path": "x-pack/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory.ts", "deprecated": false, "children": [ - { - "parentPluginId": "uiActionsEnhanced", - "id": "def-public.ActionFactory.Unnamed", - "type": "Function", - "tags": [], - "label": "Constructor", - "description": [], - "signature": [ - "any" - ], - "path": "x-pack/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "uiActionsEnhanced", - "id": "def-public.ActionFactory.Unnamed.$1", - "type": "Object", - "tags": [], - "label": "def", - "description": [], - "signature": [ - { - "pluginId": "uiActionsEnhanced", - "scope": "public", - "docId": "kibUiActionsEnhancedPluginApi", - "section": "def-public.ActionFactoryDefinition", - "text": "ActionFactoryDefinition" - }, - "" - ], - "path": "x-pack/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "uiActionsEnhanced", - "id": "def-public.ActionFactory.Unnamed.$2", - "type": "Object", - "tags": [], - "label": "deps", - "description": [], - "signature": [ - "ActionFactoryDeps" - ], - "path": "x-pack/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, { "parentPluginId": "uiActionsEnhanced", "id": "def-public.ActionFactory.id", @@ -410,7 +359,15 @@ "section": "def-common.UiComponent", "text": "UiComponent" }, - "<{ context: FactoryContext; }> | undefined" + "<", + { + "pluginId": "uiActions", + "scope": "public", + "docId": "kibUiActionsPluginApi", + "section": "def-public.ActionMenuItemProps", + "text": "ActionMenuItemProps" + }, + "> | undefined" ], "path": "x-pack/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory.ts", "deprecated": false @@ -423,7 +380,15 @@ "label": "ReactMenuItem", "description": [], "signature": [ - "React.FC<{ context: FactoryContext; }> | undefined" + "React.FC<", + { + "pluginId": "uiActions", + "scope": "public", + "docId": "kibUiActionsPluginApi", + "section": "def-public.ActionMenuItemProps", + "text": "ActionMenuItemProps" + }, + "> | undefined" ], "path": "x-pack/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory.ts", "deprecated": false @@ -531,9 +496,9 @@ "label": "context", "description": [], "signature": [ - "Context" + "FactoryContext" ], - "path": "src/plugins/kibana_utils/public/ui/configurable.ts", + "path": "x-pack/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory.ts", "deprecated": false } ] @@ -562,7 +527,7 @@ "signature": [ "Config" ], - "path": "src/plugins/kibana_utils/public/ui/configurable.ts", + "path": "x-pack/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory.ts", "deprecated": false }, { @@ -573,9 +538,9 @@ "label": "context", "description": [], "signature": [ - "Context" + "FactoryContext" ], - "path": "src/plugins/kibana_utils/public/ui/configurable.ts", + "path": "x-pack/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory.ts", "deprecated": false } ] @@ -601,6 +566,57 @@ "path": "x-pack/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory.ts", "deprecated": false }, + { + "parentPluginId": "uiActionsEnhanced", + "id": "def-public.ActionFactory.Unnamed", + "type": "Function", + "tags": [], + "label": "Constructor", + "description": [], + "signature": [ + "any" + ], + "path": "x-pack/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "uiActionsEnhanced", + "id": "def-public.ActionFactory.Unnamed.$1", + "type": "Object", + "tags": [], + "label": "def", + "description": [], + "signature": [ + { + "pluginId": "uiActionsEnhanced", + "scope": "public", + "docId": "kibUiActionsEnhancedPluginApi", + "section": "def-public.ActionFactoryDefinition", + "text": "ActionFactoryDefinition" + }, + "" + ], + "path": "x-pack/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "uiActionsEnhanced", + "id": "def-public.ActionFactory.Unnamed.$2", + "type": "Object", + "tags": [], + "label": "deps", + "description": [], + "signature": [ + "ActionFactoryDeps" + ], + "path": "x-pack/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, { "parentPluginId": "uiActionsEnhanced", "id": "def-public.ActionFactory.getIconType", diff --git a/api_docs/ui_actions_enhanced.mdx b/api_docs/ui_actions_enhanced.mdx index 12f3cdddd8f49..681fccca7bdcc 100644 --- a/api_docs/ui_actions_enhanced.mdx +++ b/api_docs/ui_actions_enhanced.mdx @@ -18,7 +18,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 203 | 2 | 145 | 9 | +| 203 | 0 | 145 | 9 | ## Client diff --git a/api_docs/visualizations.json b/api_docs/visualizations.json index 83297552e90e7..ac6e46b24e03c 100644 --- a/api_docs/visualizations.json +++ b/api_docs/visualizations.json @@ -2685,12 +2685,12 @@ { "parentPluginId": "visualizations", "id": "def-public.VisParams.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: any", "description": [], "signature": [ - "any" + "[key: string]: any" ], "path": "src/plugins/visualizations/common/types.ts", "deprecated": false @@ -5861,12 +5861,12 @@ { "parentPluginId": "visualizations", "id": "def-common.VisParams.Unnamed", - "type": "Any", + "type": "IndexSignature", "tags": [], - "label": "Unnamed", + "label": "[key: string]: any", "description": [], "signature": [ - "any" + "[key: string]: any" ], "path": "src/plugins/visualizations/common/types.ts", "deprecated": false diff --git a/api_docs/visualizations.mdx b/api_docs/visualizations.mdx index 197cc2bb4a1ee..80604a7d837ad 100644 --- a/api_docs/visualizations.mdx +++ b/api_docs/visualizations.mdx @@ -18,7 +18,7 @@ Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 303 | 13 | 285 | 15 | +| 303 | 11 | 285 | 15 | ## Client diff --git a/docs/CHANGELOG.asciidoc b/docs/CHANGELOG.asciidoc index 31cdcbca9d1f9..b63e6fbc94117 100644 --- a/docs/CHANGELOG.asciidoc +++ b/docs/CHANGELOG.asciidoc @@ -404,7 +404,7 @@ Use spaces, cross-cluster replication, or cross-cluster search. To migrate to << The logging configuration and log output format has changed. For more information, refer to {kibana-pull}112305[#112305]. *Impact* + -Use the new <>. +Use the new <>. ==== [float] diff --git a/docs/developer/architecture/core/logging-configuration-migration.asciidoc b/docs/developer/architecture/core/logging-configuration-migration.asciidoc deleted file mode 100644 index db02b4d4e507f..0000000000000 --- a/docs/developer/architecture/core/logging-configuration-migration.asciidoc +++ /dev/null @@ -1,80 +0,0 @@ -[[logging-configuration-migration]] -== Logging configuration migration - -Compatibility with the legacy logging system is assured until the end of the `v7` version. -All log messages handled by `root` context are forwarded to the legacy logging service. If you re-write -root appenders, make sure that it contains `default` appender to provide backward compatibility. - -NOTE: When you switch to the new logging configuration, you will start seeing duplicate log entries in both formats. -These will be removed when the `default` appender is no longer required. If you define an appender for a logger, -the log messages aren't handled by the `root` logger anymore and are not forwarded to the legacy logging service. - -[[logging-pattern-format-old-and-new-example]] -[options="header"] -|=== - -| Parameter | Platform log record in **pattern** format | Legacy Platform log record **text** format - -| @timestamp | ISO8601_TZ `2012-01-31T23:33:22.011-05:00` | Absolute `23:33:22.011` - -| logger | `parent.child` | `['parent', 'child']` - -| level | `DEBUG` | `['debug']` - -| meta | stringified JSON object `{"to": "v8"}`| N/A - -| pid | can be configured as `%pid` | N/A - -|=== - -[[logging-json-format-old-and-new-example]] -[options="header"] -|=== - -| Parameter | Platform log record in **json** format | Legacy Platform log record **json** format - -| @timestamp | ISO8601_TZ `2012-01-31T23:33:22.011-05:00` | ISO8601 `2012-01-31T23:33:22.011Z` - -| logger | `log.logger: parent.child` | `tags: ['parent', 'child']` - -| level | `log.level: DEBUG` | `tags: ['debug']` - -| meta | merged in log record `{... "to": "v8"}` | merged in log record `{... "to": "v8"}` - -| pid | `process.pid: 12345` | `pid: 12345` - -| type | N/A | `type: log` - -| error | `{ message, name, stack }` | `{ message, name, stack, code, signal }` - -|=== - -[[logging-cli-migration]] -=== Logging configuration via CLI - -As is the case for any of Kibana's config settings, you can specify your logging configuration via the CLI. For convenience, the `--verbose` and `--silent` flags exist as shortcuts and will continue to be supported beyond v7. - -If you wish to override these flags, you can always do so by passing your preferred logging configuration directly to the CLI. For example, with the following configuration: - -[source,yaml] ----- -logging: - appenders: - custom: - type: console - layout: - type: pattern - pattern: "[%date][%level] %message" ----- - -you can override the flags with: - -[options="header"] -|=== - -| legacy logging | {kib} Platform logging | cli shortcuts - -|--verbose| --logging.root.level=debug --logging.root.appenders[0]=default --logging.root.appenders[1]=custom | --verbose - -|--silent| --logging.root.level=off | --silent -|=== diff --git a/docs/developer/architecture/core/logging-service.asciidoc b/docs/developer/architecture/core/logging-service.asciidoc index 7dc2a4ca1f4ce..79d8c6d197e10 100644 --- a/docs/developer/architecture/core/logging-service.asciidoc +++ b/docs/developer/architecture/core/logging-service.asciidoc @@ -25,482 +25,6 @@ export class MyPlugin implements Plugin { } } ---- - -The way logging works in {kib} is inspired by the `log4j 2` logging framework used by {ref-bare}/current/logging.html[Elasticsearch]. -The main idea is to have consistent logging behavior (configuration, log format etc.) across the entire Elastic Stack where possible. - -=== Loggers, Appenders and Layouts - -The {kib} logging system has three main components: _loggers_, _appenders_ and _layouts_. These components allow us to log -messages according to message type and level, to control how these messages are formatted and where the final logs -will be displayed or stored. - -__Loggers__ define what logging settings should be applied to a particular logger. - -__<>__ define where log messages are displayed (eg. stdout or console) and stored (eg. file on the disk). - -__<>__ define how log messages are formatted and what type of information they include. - -[[log-level]] -=== Log level - -Currently we support the following log levels: _all_, _fatal_, _error_, _warn_, _info_, _debug_, _trace_, _off_. - -Levels are ordered, so _all_ > _fatal_ > _error_ > _warn_ > _info_ > _debug_ > _trace_ > _off_. - -A log record is being logged by the logger if its level is higher than or equal to the level of its logger. Otherwise, -the log record is ignored. - -The _all_ and _off_ levels can be used only in configuration and are just handy shortcuts that allow you to log every -log record or disable logging entirely or for a specific logger. These levels are also configurable as <>. - -[[logging-layouts]] -=== Layouts - -Every appender should know exactly how to format log messages before they are written to the console or file on the disk. -This behavior is controlled by the layouts and configured through `appender.layout` configuration property for every -custom appender. Currently we don't define any default layout for the -custom appenders, so one should always make the choice explicitly. - -There are two types of layout supported at the moment: <> and <>. - -[[pattern-layout]] -==== Pattern layout - -With `pattern` layout it's possible to define a string pattern with special placeholders `%conversion_pattern` that will be replaced with data from the actual log message. By default the following pattern is used: `[%date][%level][%logger] %message`. - -NOTE: The `pattern` layout uses a sub-set of https://logging.apache.org/log4j/2.x/manual/layouts.html#PatternLayout[log4j 2 pattern syntax] and **doesn't implement** all `log4j 2` capabilities. - -The conversions that are provided out of the box are: - -**level** -Outputs the <> of the logging event. -Example of `%level` output: `TRACE`, `DEBUG`, `INFO`. - -**logger** -Outputs the name of the logger that published the logging event. -Example of `%logger` output: `server`, `server.http`, `server.http.kibana`. - -**message** -Outputs the application supplied message associated with the logging event. - -**meta** -Outputs the entries of `meta` object data in **json** format, if one is present in the event. -Example of `%meta` output: -[source,bash] ----- -// Meta{from: 'v7', to: 'v8'} -'{"from":"v7","to":"v8"}' -// Meta empty object -'{}' -// no Meta provided -'' ----- - -[[date-format]] -**date** -Outputs the date of the logging event. The date conversion specifier may be followed by a set of braces containing a name of predefined date format and canonical timezone name. -Timezone name is expected to be one from https://en.wikipedia.org/wiki/List_of_tz_database_time_zones[TZ database name]. -Timezone defaults to the host timezone when not explicitly specified. -Example of `%date` output: - -[[date-conversion-pattern-examples]] -[options="header"] -|=== - -| Conversion pattern | Example - -| `%date` -| `2012-02-01T14:30:22.011Z` uses `ISO8601` format by default - -| `%date{ISO8601}` -| `2012-02-01T14:30:22.011Z` - -| `%date{ISO8601_TZ}` -| `2012-02-01T09:30:22.011-05:00` `ISO8601` with timezone - -| `%date{ISO8601_TZ}{America/Los_Angeles}` -| `2012-02-01T06:30:22.011-08:00` - -| `%date{ABSOLUTE}` -| `09:30:22.011` - -| `%date{ABSOLUTE}{America/Los_Angeles}` -| `06:30:22.011` - -| `%date{UNIX}` -| `1328106622` - -| `%date{UNIX_MILLIS}` -| `1328106622011` - -|=== - -**pid** -Outputs the process ID. - -The pattern layout also offers a `highlight` option that allows you to highlight -some parts of the log message with different colors. Highlighting is quite handy if log messages are forwarded -to a terminal with color support. - -[[json-layout]] -==== JSON layout -With `json` layout log messages will be formatted as JSON strings in https://www.elastic.co/guide/en/ecs/current/ecs-reference.html[ECS format] that includes a timestamp, log level, logger, message text and any other metadata that may be associated with the log message itself. - -[[logging-appenders]] -=== Appenders - -[[rolling-file-appender]] -==== Rolling File Appender - -Similar to Log4j's `RollingFileAppender`, this appender will log into a file, and rotate it following a rolling -strategy when the configured policy triggers. - -===== Triggering Policies - -The triggering policy determines when a rollover should occur. - -There are currently two policies supported: `size-limit` and `time-interval`. - -[[size-limit-triggering-policy]] -**SizeLimitTriggeringPolicy** - -This policy will rotate the file when it reaches a predetermined size. - -[source,yaml] ----- -logging: - appenders: - rolling-file: - type: rolling-file - fileName: /var/logs/kibana.log - policy: - type: size-limit - size: 50mb - strategy: - //... - layout: - type: pattern ----- - -The options are: - -- `size` - -The maximum size the log file should reach before a rollover should be performed. The default value is `100mb` - -[[time-interval-triggering-policy]] -**TimeIntervalTriggeringPolicy** - -This policy will rotate the file every given interval of time. - -[source,yaml] ----- -logging: - appenders: - rolling-file: - type: rolling-file - fileName: /var/logs/kibana.log - policy: - type: time-interval - interval: 10s - modulate: true - strategy: - //... - layout: - type: pattern ----- - -The options are: - -- `interval` - -How often a rollover should occur. The default value is `24h` - -- `modulate` - -Whether the interval should be adjusted to cause the next rollover to occur on the interval boundary. - -For example, if modulate is true and the interval is `4h`, if the current hour is 3 am then the first rollover will occur at 4 am -and then next ones will occur at 8 am, noon, 4pm, etc. The default value is `true`. - -===== Rolling strategies - -The rolling strategy determines how the rollover should occur: both the naming of the rolled files, -and their retention policy. - -There is currently one strategy supported: `numeric`. - -**NumericRollingStrategy** - -This strategy will suffix the file with a given pattern when rolling, -and will retains a fixed amount of rolled files. - -[source,yaml] ----- -logging: - appenders: - rolling-file: - type: rolling-file - fileName: /var/logs/kibana.log - policy: - // ... - strategy: - type: numeric - pattern: '-%i' - max: 2 - layout: - type: pattern ----- - -For example, with this configuration: - -- During the first rollover kibana.log is renamed to kibana-1.log. A new kibana.log file is created and starts - being written to. -- During the second rollover kibana-1.log is renamed to kibana-2.log and kibana.log is renamed to kibana-1.log. - A new kibana.log file is created and starts being written to. -- During the third and subsequent rollovers, kibana-2.log is deleted, kibana-1.log is renamed to kibana-2.log and - kibana.log is renamed to kibana-1.log. A new kibana.log file is created and starts being written to. - -The options are: - -- `pattern` - -The suffix to append to the file path when rolling. Must include `%i`, as this is the value -that will be converted to the file index. - -For example, with `fileName: /var/logs/kibana.log` and `pattern: '-%i'`, the rolling files created -will be `/var/logs/kibana-1.log`, `/var/logs/kibana-2.log`, and so on. The default value is `-%i` - -- `max` - -The maximum number of files to keep. Once this number is reached, oldest files will be deleted. The default value is `7` - -==== Rewrite Appender - -WARNING: This appender is currently considered experimental and is not intended -for public consumption. The API is subject to change at any time. - -Similar to log4j's `RewriteAppender`, this appender serves as a sort of middleware, -modifying the provided log events before passing them along to another -appender. - -[source,yaml] ----- -logging: - appenders: - my-rewrite-appender: - type: rewrite - appenders: [console, file] # name of "destination" appender(s) - policy: - # ... ----- - -The most common use case for the `RewriteAppender` is when you want to -filter or censor sensitive data that may be contained in a log entry. -In fact, with a default configuration, {kib} will automatically redact -any `authorization`, `cookie`, or `set-cookie` headers when logging http -requests & responses. - -To configure additional rewrite rules, you'll need to specify a <>. - -[[rewrite-policies]] -===== Rewrite Policies - -Rewrite policies exist to indicate which parts of a log record can be -modified within the rewrite appender. - -**Meta** - -The `meta` rewrite policy can read and modify any data contained in the -`LogMeta` before passing it along to a destination appender. - -Meta policies must specify one of three modes, which indicate which action -to perform on the configured properties: -- `update` updates an existing property at the provided `path`. -- `remove` removes an existing property at the provided `path`. - -The `properties` are listed as a `path` and `value` pair, where `path` is -the dot-delimited path to the target property in the `LogMeta` object, and -`value` is the value to add or update in that target property. When using -the `remove` mode, a `value` is not necessary. - -Here's an example of how you would replace any `cookie` header values with `[REDACTED]`: - -[source,yaml] ----- -logging: - appenders: - my-rewrite-appender: - type: rewrite - appenders: [console] - policy: - type: meta # indicates that we want to rewrite the LogMeta - mode: update # will update an existing property only - properties: - - path: "http.request.headers.cookie" # path to property - value: "[REDACTED]" # value to replace at path ----- - -Rewrite appenders can even be passed to other rewrite appenders to apply -multiple filter policies/modes, as long as it doesn't create a circular -reference. Each rewrite appender is applied sequentially (one after the other). - -[source,yaml] ----- -logging: - appenders: - remove-request-headers: - type: rewrite - appenders: [censor-response-headers] # redirect to the next rewrite appender - policy: - type: meta - mode: remove - properties: - - path: "http.request.headers" # remove all request headers - censor-response-headers: - type: rewrite - appenders: [console] # output to console - policy: - type: meta - mode: update - properties: - - path: "http.response.headers.set-cookie" - value: "[REDACTED]" ----- - -===== Complete Example For Rewrite Appender - -[source,yaml] ----- -logging: - appenders: - custom_console: - type: console - layout: - type: pattern - highlight: true - pattern: "[%date][%level][%logger] %message %meta" - file: - type: file - fileName: ./kibana.log - layout: - type: json - censor: - type: rewrite - appenders: [custom_console, file] - policy: - type: meta - mode: update - properties: - - path: "http.request.headers.cookie" - value: "[REDACTED]" - loggers: - - name: http.server.response - appenders: [censor] # pass these logs to our rewrite appender - level: debug ----- - -[[logger-hierarchy]] -=== Logger hierarchy - -Every logger has a unique name that follows a hierarchical naming rule. The logger is considered to be an -ancestor of another logger if its name followed by a `.` is a prefix of the descendant logger. For example, a logger -named `a.b` is an ancestor of logger `a.b.c`. All top-level loggers are descendants of a special `root` logger at the top of the logger hierarchy. The `root` logger always exists and -fully configured. - -You can configure _<>_ and _appenders_ for a specific logger. If a logger only has a _log level_ configured, then the _appenders_ configuration applied to the logger is inherited from the ancestor logger. - -NOTE: In the current implementation we __don't support__ so called _appender additivity_ when log messages are forwarded to _every_ distinct appender within the -ancestor chain including `root`. That means that log messages are only forwarded to appenders that are configured for a particular logger. If a logger doesn't have any appenders configured, the configuration of that particular logger will be inherited from its closest ancestor. - -[[dedicated-loggers]] -==== Dedicated loggers - -**Root** - -The `root` logger has a dedicated configuration node since this logger is special and should always exist. By default `root` is configured with `info` level and `default` appender that is also always available. This is the configuration that all custom loggers will use unless they're re-configured explicitly. - -For example to see _all_ log messages that fall back on the `root` logger configuration, just add one line to the configuration: - -[source,yaml] ----- -logging.root.level: all ----- - -Or disable logging entirely with `off`: - -[source,yaml] ----- -logging.root.level: off ----- - -**Metrics Logs** - -The `metrics.ops` logger is configured with `debug` level and will automatically output sample system and process information at a regular interval. -The metrics that are logged are a subset of the data collected and are formatted in the log message as follows: - -[options="header"] -|=== - -| Ops formatted log property | Location in metrics service | Log units - -| memory | process.memory.heap.used_in_bytes | http://numeraljs.com/#format[depends on the value], typically MB or GB - -| uptime | process.uptime_in_millis | HH:mm:ss - -| load | os.load | [ "load for the last 1 min" "load for the last 5 min" "load for the last 15 min"] - -| delay | process.event_loop_delay | ms -|=== - -The log interval is the same as the interval at which system and process information is refreshed and is configurable under `ops.interval`: - -[source,yaml] ----- -ops.interval: 5000 ----- - -The minimum interval is 100ms and defaults to 5000ms. - -[[request-response-logger]] -**Request and Response Logs** - -The `http.server.response` logger is configured with `debug` level and will automatically output -data about http requests and responses occurring on the {kib} server. -The message contains some high-level information, and the corresponding log meta contains the following: - -[options="header"] -|=== - -| Meta property | Description | Format - -| client.ip | IP address of the requesting client | ip - -| http.request.method | http verb for the request (uppercase) | string - -| http.request.mime_type | (optional) mime as specified in the headers | string - -| http.request.referrer | (optional) referrer | string - -| http.request.headers | request headers | object - -| http.response.body.bytes | (optional) Calculated response payload size in bytes | number - -| http.response.status_code | status code returned | number - -| http.response.headers | response headers | object - -| http.response.responseTime | (optional) Calculated response time in ms | number - -| url.path | request path | string - -| url.query | (optional) request query string | string - -| user_agent.original | raw user-agent string provided in request headers | string - -|=== - === Usage Usage is very straightforward, one should just get a logger for a specific context and use it to log messages with diff --git a/docs/developer/architecture/index.asciidoc b/docs/developer/architecture/index.asciidoc index 90a0972d65f2f..774292f513f03 100644 --- a/docs/developer/architecture/index.asciidoc +++ b/docs/developer/architecture/index.asciidoc @@ -40,8 +40,6 @@ include::core/http-service.asciidoc[leveloffset=+1] include::core/logging-service.asciidoc[leveloffset=+1] -include::core/logging-configuration-migration.asciidoc[leveloffset=+1] - include::core/saved-objects-service.asciidoc[leveloffset=+1] include::core/uisettings-service.asciidoc[leveloffset=+1] diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index bd516454fa420..2f0be0c39a3b8 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -53,6 +53,18 @@ as uiSettings within the code. |The data plugin provides common data access services, such as search and query, for solutions and application developers. +|{kib-repo}blob/{branch}/src/plugins/data_view_editor/README.md[dataViewEditor] +|Create data views from within Kibana apps. + + +|{kib-repo}blob/{branch}/src/plugins/data_view_field_editor/README.md[dataViewFieldEditor] +|The reusable field editor across Kibana! + + +|{kib-repo}blob/{branch}/src/plugins/data_view_management[dataViewManagement] +|WARNING: Missing README. + + |{kib-repo}blob/{branch}/src/plugins/data_views/README.mdx[dataViews] |The data views API provides a consistent method of structuring and formatting documents and field lists across the various Kibana apps. Its typically used in conjunction with @@ -137,18 +149,6 @@ for use in their own application. |Moves the legacy ui/registry/feature_catalogue module for registering "features" that should be shown in the home page's feature catalogue to a service within a "home" plugin. The feature catalogue refered to here should not be confused with the "feature" plugin for registering features used to derive UI capabilities for feature controls. -|{kib-repo}blob/{branch}/src/plugins/index_pattern_editor/README.md[indexPatternEditor] -|Create index patterns from within Kibana apps. - - -|{kib-repo}blob/{branch}/src/plugins/index_pattern_field_editor/README.md[indexPatternFieldEditor] -|The reusable field editor across Kibana! - - -|{kib-repo}blob/{branch}/src/plugins/index_pattern_management[indexPatternManagement] -|WARNING: Missing README. - - |{kib-repo}blob/{branch}/src/plugins/input_control_vis/README.md[inputControlVis] |Contains the input control visualization allowing to place custom filter controls on a dashboard. @@ -162,10 +162,6 @@ in Kibana, e.g. visualizations. It has the form of a flyout panel. |The plugin provides UI and APIs for the interactive setup mode. -|{kib-repo}blob/{branch}/src/plugins/kibana_legacy/README.md[kibanaLegacy] -|This plugin contains several helpers and services to integrate pieces of the legacy Kibana app with the new Kibana platform. - - |{kib-repo}blob/{branch}/src/plugins/kibana_overview/README.md[kibanaOverview] |An overview page highlighting Kibana apps diff --git a/docs/developer/plugin/external-plugin-localization.asciidoc b/docs/developer/plugin/external-plugin-localization.asciidoc index 656dff90fe0de..36cb91a42203a 100644 --- a/docs/developer/plugin/external-plugin-localization.asciidoc +++ b/docs/developer/plugin/external-plugin-localization.asciidoc @@ -120,7 +120,7 @@ To localize strings in React, use either `FormattedMessage` or `i18n.translate`. ["source","js"] ----------- import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const Component = () => { return ( diff --git a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md index 6e50afedbe0b2..33f5775a429be 100644 --- a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md +++ b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.links.md @@ -240,7 +240,6 @@ readonly links: { readonly snapshotRestore: Record; readonly ingest: Record; readonly fleet: Readonly<{ - datastreamsILM: string; beatsAgentComparison: string; guide: string; fleetServer: string; diff --git a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md index 1b2774fdd223f..5a6c7131768bf 100644 --- a/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md +++ b/docs/development/core/public/kibana-plugin-core-public.doclinksstart.md @@ -15,7 +15,7 @@ export interface DocLinksStart | Property | Type | Description | | --- | --- | --- | -| [DOC\_LINK\_VERSION](./kibana-plugin-core-public.doclinksstart.doc_link_version.md) | string | | -| [ELASTIC\_WEBSITE\_URL](./kibana-plugin-core-public.doclinksstart.elastic_website_url.md) | string | | -| [links](./kibana-plugin-core-public.doclinksstart.links.md) | {
readonly settings: string;
readonly elasticStackGetStarted: string;
readonly upgrade: {
readonly upgradingElasticStack: string;
};
readonly apm: {
readonly kibanaSettings: string;
readonly supportedServiceMaps: string;
readonly customLinks: string;
readonly droppedTransactionSpans: string;
readonly upgrading: string;
readonly metaData: string;
};
readonly canvas: {
readonly guide: string;
};
readonly dashboard: {
readonly guide: string;
readonly drilldowns: string;
readonly drilldownsTriggerPicker: string;
readonly urlDrilldownTemplateSyntax: string;
readonly urlDrilldownVariables: string;
};
readonly discover: Record<string, string>;
readonly filebeat: {
readonly base: string;
readonly installation: string;
readonly configuration: string;
readonly elasticsearchOutput: string;
readonly elasticsearchModule: string;
readonly startup: string;
readonly exportedFields: string;
readonly suricataModule: string;
readonly zeekModule: string;
};
readonly auditbeat: {
readonly base: string;
readonly auditdModule: string;
readonly systemModule: string;
};
readonly metricbeat: {
readonly base: string;
readonly configure: string;
readonly httpEndpoint: string;
readonly install: string;
readonly start: string;
};
readonly enterpriseSearch: {
readonly base: string;
readonly appSearchBase: string;
readonly workplaceSearchBase: string;
};
readonly heartbeat: {
readonly base: string;
};
readonly libbeat: {
readonly getStarted: string;
};
readonly logstash: {
readonly base: string;
};
readonly functionbeat: {
readonly base: string;
};
readonly winlogbeat: {
readonly base: string;
};
readonly aggs: {
readonly composite: string;
readonly composite_missing_bucket: string;
readonly date_histogram: string;
readonly date_range: string;
readonly date_format_pattern: string;
readonly filter: string;
readonly filters: string;
readonly geohash_grid: string;
readonly histogram: string;
readonly ip_range: string;
readonly range: string;
readonly significant_terms: string;
readonly terms: string;
readonly terms_doc_count_error: string;
readonly avg: string;
readonly avg_bucket: string;
readonly max_bucket: string;
readonly min_bucket: string;
readonly sum_bucket: string;
readonly cardinality: string;
readonly count: string;
readonly cumulative_sum: string;
readonly derivative: string;
readonly geo_bounds: string;
readonly geo_centroid: string;
readonly max: string;
readonly median: string;
readonly min: string;
readonly moving_avg: string;
readonly percentile_ranks: string;
readonly serial_diff: string;
readonly std_dev: string;
readonly sum: string;
readonly top_hits: string;
};
readonly runtimeFields: {
readonly overview: string;
readonly mapping: string;
};
readonly scriptedFields: {
readonly scriptFields: string;
readonly scriptAggs: string;
readonly painless: string;
readonly painlessApi: string;
readonly painlessLangSpec: string;
readonly painlessSyntax: string;
readonly painlessWalkthrough: string;
readonly luceneExpressions: string;
};
readonly search: {
readonly sessions: string;
readonly sessionLimits: string;
};
readonly indexPatterns: {
readonly introduction: string;
readonly fieldFormattersNumber: string;
readonly fieldFormattersString: string;
readonly runtimeFields: string;
};
readonly addData: string;
readonly kibana: string;
readonly upgradeAssistant: {
readonly overview: string;
readonly batchReindex: string;
readonly remoteReindex: string;
};
readonly rollupJobs: string;
readonly elasticsearch: Record<string, string>;
readonly siem: {
readonly privileges: string;
readonly guide: string;
readonly gettingStarted: string;
readonly ml: string;
readonly ruleChangeLog: string;
readonly detectionsReq: string;
readonly networkMap: string;
readonly troubleshootGaps: string;
};
readonly securitySolution: {
readonly trustedApps: string;
};
readonly query: {
readonly eql: string;
readonly kueryQuerySyntax: string;
readonly luceneQuerySyntax: string;
readonly percolate: string;
readonly queryDsl: string;
};
readonly date: {
readonly dateMath: string;
readonly dateMathIndexNames: string;
};
readonly management: Record<string, string>;
readonly ml: Record<string, string>;
readonly transforms: Record<string, string>;
readonly visualize: Record<string, string>;
readonly apis: Readonly<{
bulkIndexAlias: string;
byteSizeUnits: string;
createAutoFollowPattern: string;
createFollower: string;
createIndex: string;
createSnapshotLifecyclePolicy: string;
createRoleMapping: string;
createRoleMappingTemplates: string;
createRollupJobsRequest: string;
createApiKey: string;
createPipeline: string;
createTransformRequest: string;
cronExpressions: string;
executeWatchActionModes: string;
indexExists: string;
openIndex: string;
putComponentTemplate: string;
painlessExecute: string;
painlessExecuteAPIContexts: string;
putComponentTemplateMetadata: string;
putSnapshotLifecyclePolicy: string;
putIndexTemplateV1: string;
putWatch: string;
simulatePipeline: string;
timeUnits: string;
updateTransform: string;
}>;
readonly observability: Readonly<{
guide: string;
infrastructureThreshold: string;
logsThreshold: string;
metricsThreshold: string;
monitorStatus: string;
monitorUptime: string;
tlsCertificate: string;
uptimeDurationAnomaly: string;
}>;
readonly alerting: Record<string, string>;
readonly maps: Record<string, string>;
readonly monitoring: Record<string, string>;
readonly security: Readonly<{
apiKeyServiceSettings: string;
clusterPrivileges: string;
elasticsearchSettings: string;
elasticsearchEnableSecurity: string;
elasticsearchEnableApiKeys: string;
indicesPrivileges: string;
kibanaTLS: string;
kibanaPrivileges: string;
mappingRoles: string;
mappingRolesFieldRules: string;
runAsPrivilege: string;
}>;
readonly spaces: Readonly<{
kibanaLegacyUrlAliases: string;
kibanaDisableLegacyUrlAliasesApi: string;
}>;
readonly watcher: Record<string, string>;
readonly ccs: Record<string, string>;
readonly plugins: Record<string, string>;
readonly snapshotRestore: Record<string, string>;
readonly ingest: Record<string, string>;
readonly fleet: Readonly<{
datastreamsILM: string;
beatsAgentComparison: string;
guide: string;
fleetServer: string;
fleetServerAddFleetServer: string;
settings: string;
settingsFleetServerHostSettings: string;
settingsFleetServerProxySettings: string;
troubleshooting: string;
elasticAgent: string;
datastreams: string;
datastreamsNamingScheme: string;
installElasticAgent: string;
upgradeElasticAgent: string;
upgradeElasticAgent712lower: string;
learnMoreBlog: string;
apiKeysLearnMore: string;
onPremRegistry: string;
}>;
readonly ecs: {
readonly guide: string;
};
readonly clients: {
readonly guide: string;
readonly goOverview: string;
readonly javaIndex: string;
readonly jsIntro: string;
readonly netGuide: string;
readonly perlGuide: string;
readonly phpGuide: string;
readonly pythonGuide: string;
readonly rubyOverview: string;
readonly rustGuide: string;
};
readonly endpoints: {
readonly troubleshooting: string;
};
} | | +| [DOC\_LINK\_VERSION](./kibana-plugin-core-public.doclinksstart.doc_link_version.md) | string | | +| [ELASTIC\_WEBSITE\_URL](./kibana-plugin-core-public.doclinksstart.elastic_website_url.md) | string | | +| [links](./kibana-plugin-core-public.doclinksstart.links.md) | { readonly settings: string; readonly elasticStackGetStarted: string; readonly upgrade: { readonly upgradingElasticStack: string; }; readonly apm: { readonly kibanaSettings: string; readonly supportedServiceMaps: string; readonly customLinks: string; readonly droppedTransactionSpans: string; readonly upgrading: string; readonly metaData: string; }; readonly canvas: { readonly guide: string; }; readonly dashboard: { readonly guide: string; readonly drilldowns: string; readonly drilldownsTriggerPicker: string; readonly urlDrilldownTemplateSyntax: string; readonly urlDrilldownVariables: string; }; readonly discover: Record<string, string>; readonly filebeat: { readonly base: string; readonly installation: string; readonly configuration: string; readonly elasticsearchOutput: string; readonly elasticsearchModule: string; readonly startup: string; readonly exportedFields: string; readonly suricataModule: string; readonly zeekModule: string; }; readonly auditbeat: { readonly base: string; readonly auditdModule: string; readonly systemModule: string; }; readonly metricbeat: { readonly base: string; readonly configure: string; readonly httpEndpoint: string; readonly install: string; readonly start: string; }; readonly enterpriseSearch: { readonly base: string; readonly appSearchBase: string; readonly workplaceSearchBase: string; }; readonly heartbeat: { readonly base: string; }; readonly libbeat: { readonly getStarted: string; }; readonly logstash: { readonly base: string; }; readonly functionbeat: { readonly base: string; }; readonly winlogbeat: { readonly base: string; }; readonly aggs: { readonly composite: string; readonly composite\_missing\_bucket: string; readonly date\_histogram: string; readonly date\_range: string; readonly date\_format\_pattern: string; readonly filter: string; readonly filters: string; readonly geohash\_grid: string; readonly histogram: string; readonly ip\_range: string; readonly range: string; readonly significant\_terms: string; readonly terms: string; readonly terms\_doc\_count\_error: string; readonly avg: string; readonly avg\_bucket: string; readonly max\_bucket: string; readonly min\_bucket: string; readonly sum\_bucket: string; readonly cardinality: string; readonly count: string; readonly cumulative\_sum: string; readonly derivative: string; readonly geo\_bounds: string; readonly geo\_centroid: string; readonly max: string; readonly median: string; readonly min: string; readonly moving\_avg: string; readonly percentile\_ranks: string; readonly serial\_diff: string; readonly std\_dev: string; readonly sum: string; readonly top\_hits: string; }; readonly runtimeFields: { readonly overview: string; readonly mapping: string; }; readonly scriptedFields: { readonly scriptFields: string; readonly scriptAggs: string; readonly painless: string; readonly painlessApi: string; readonly painlessLangSpec: string; readonly painlessSyntax: string; readonly painlessWalkthrough: string; readonly luceneExpressions: string; }; readonly search: { readonly sessions: string; readonly sessionLimits: string; }; readonly indexPatterns: { readonly introduction: string; readonly fieldFormattersNumber: string; readonly fieldFormattersString: string; readonly runtimeFields: string; }; readonly addData: string; readonly kibana: string; readonly upgradeAssistant: { readonly overview: string; readonly batchReindex: string; readonly remoteReindex: string; }; readonly rollupJobs: string; readonly elasticsearch: Record<string, string>; readonly siem: { readonly privileges: string; readonly guide: string; readonly gettingStarted: string; readonly ml: string; readonly ruleChangeLog: string; readonly detectionsReq: string; readonly networkMap: string; readonly troubleshootGaps: string; }; readonly securitySolution: { readonly trustedApps: string; }; readonly query: { readonly eql: string; readonly kueryQuerySyntax: string; readonly luceneQuerySyntax: string; readonly percolate: string; readonly queryDsl: string; }; readonly date: { readonly dateMath: string; readonly dateMathIndexNames: string; }; readonly management: Record<string, string>; readonly ml: Record<string, string>; readonly transforms: Record<string, string>; readonly visualize: Record<string, string>; readonly apis: Readonly<{ bulkIndexAlias: string; byteSizeUnits: string; createAutoFollowPattern: string; createFollower: string; createIndex: string; createSnapshotLifecyclePolicy: string; createRoleMapping: string; createRoleMappingTemplates: string; createRollupJobsRequest: string; createApiKey: string; createPipeline: string; createTransformRequest: string; cronExpressions: string; executeWatchActionModes: string; indexExists: string; openIndex: string; putComponentTemplate: string; painlessExecute: string; painlessExecuteAPIContexts: string; putComponentTemplateMetadata: string; putSnapshotLifecyclePolicy: string; putIndexTemplateV1: string; putWatch: string; simulatePipeline: string; timeUnits: string; updateTransform: string; }>; readonly observability: Readonly<{ guide: string; infrastructureThreshold: string; logsThreshold: string; metricsThreshold: string; monitorStatus: string; monitorUptime: string; tlsCertificate: string; uptimeDurationAnomaly: string; }>; readonly alerting: Record<string, string>; readonly maps: Readonly<{ guide: string; importGeospatialPrivileges: string; gdalTutorial: string; }>; readonly monitoring: Record<string, string>; readonly security: Readonly<{ apiKeyServiceSettings: string; clusterPrivileges: string; elasticsearchSettings: string; elasticsearchEnableSecurity: string; elasticsearchEnableApiKeys: string; indicesPrivileges: string; kibanaTLS: string; kibanaPrivileges: string; mappingRoles: string; mappingRolesFieldRules: string; runAsPrivilege: string; }>; readonly spaces: Readonly<{ kibanaLegacyUrlAliases: string; kibanaDisableLegacyUrlAliasesApi: string; }>; readonly watcher: Record<string, string>; readonly ccs: Record<string, string>; readonly plugins: Record<string, string>; readonly snapshotRestore: Record<string, string>; readonly ingest: Record<string, string>; readonly fleet: Readonly<{ beatsAgentComparison: string; guide: string; fleetServer: string; fleetServerAddFleetServer: string; settings: string; settingsFleetServerHostSettings: string; settingsFleetServerProxySettings: string; troubleshooting: string; elasticAgent: string; datastreams: string; datastreamsNamingScheme: string; installElasticAgent: string; upgradeElasticAgent: string; upgradeElasticAgent712lower: string; learnMoreBlog: string; apiKeysLearnMore: string; onPremRegistry: string; }>; readonly ecs: { readonly guide: string; }; readonly clients: { readonly guide: string; readonly goOverview: string; readonly javaIndex: string; readonly jsIntro: string; readonly netGuide: string; readonly perlGuide: string; readonly phpGuide: string; readonly pythonGuide: string; readonly rubyOverview: string; readonly rustGuide: string; }; readonly endpoints: { readonly troubleshooting: string; }; } | | diff --git a/docs/migration/migrate_8_0.asciidoc b/docs/migration/migrate_8_0.asciidoc index f5f8a95ad24de..59dd36a4fa5ef 100644 --- a/docs/migration/migrate_8_0.asciidoc +++ b/docs/migration/migrate_8_0.asciidoc @@ -65,7 +65,7 @@ If you are currently using one of these settings in your Kibana config, please r ==== Default logging timezone is now the system's timezone *Details:* In prior releases the timezone used in logs defaulted to UTC. We now use the host machine's timezone by default. -*Impact:* To restore the previous behavior, in kibana.yml use the pattern layout, with a {kibana-ref}/logging-service.html#date-format[date modifier]: +*Impact:* To restore the previous behavior, in kibana.yml use the pattern layout, with a date modifier: [source,yaml] ------------------- logging: @@ -100,7 +100,7 @@ See https://github.com/elastic/kibana/pull/87939 for more details. [float] ==== Logging destination is specified by the appender -*Details:* Previously log destination would be `stdout` and could be changed to `file` using `logging.dest`. With the new logging configuration, you can specify the destination using {kibana-ref}/logging-service.html#logging-appenders[appenders]. +*Details:* Previously log destination would be `stdout` and could be changed to `file` using `logging.dest`. With the new logging configuration, you can specify the destination using appenders. *Impact:* To restore the previous behavior and log records to *stdout*, in `kibana.yml` use an appender with `type: console`. [source,yaml] @@ -131,7 +131,7 @@ logging: [float] ==== Set log verbosity with root -*Details:* Previously logging output would be specified by `logging.silent` (none), `logging.quiet` (error messages only) and `logging.verbose` (all). With the new logging configuration, set the minimum required {kibana-ref}/logging-service.html#log-level[log level]. +*Details:* Previously logging output would be specified by `logging.silent` (none), `logging.quiet` (error messages only) and `logging.verbose` (all). With the new logging configuration, set the minimum required log level. *Impact:* To restore the previous behavior, in `kibana.yml` specify `logging.root.level`: [source,yaml] @@ -188,7 +188,7 @@ logging: ==== Configure log rotation with the rolling-file appender *Details:* Previously log rotation would be enabled when `logging.rotate.enabled` was true. -*Impact:* To restore the previous behavior, in `kibana.yml` use the {kibana-ref}/logging-service.html#rolling-file-appender[`rolling-file`] appender. +*Impact:* To restore the previous behavior, in `kibana.yml` use the `rolling-file` appender. [source,yaml] ------------------- diff --git a/docs/osquery/images/mapped-icon.png b/docs/osquery/images/mapped-icon.png new file mode 100644 index 0000000000000..66f2361c15944 Binary files /dev/null and b/docs/osquery/images/mapped-icon.png differ diff --git a/docs/osquery/images/scheduled-pack.png b/docs/osquery/images/scheduled-pack.png new file mode 100644 index 0000000000000..608730e371ade Binary files /dev/null and b/docs/osquery/images/scheduled-pack.png differ diff --git a/docs/osquery/images/scheduled-query-groupds.png b/docs/osquery/images/scheduled-query-groupds.png deleted file mode 100644 index bb7fd8ae87563..0000000000000 Binary files a/docs/osquery/images/scheduled-query-groupds.png and /dev/null differ diff --git a/docs/osquery/osquery.asciidoc b/docs/osquery/osquery.asciidoc index a4f3c80463143..396135d8d1751 100644 --- a/docs/osquery/osquery.asciidoc +++ b/docs/osquery/osquery.asciidoc @@ -3,22 +3,19 @@ [[osquery]] = Osquery -https://osquery.io[Osquery] is an open source tool that lets you query operating systems, like a database, providing you with visibility into your infrastructure and operating systems. +https://osquery.io[Osquery] is an open source tool that lets you query operating systems like a database, providing you with visibility into your infrastructure and operating systems. Using basic SQL commands, you can ask questions about devices, such as servers, Docker containers, and computers running Linux, macOS, or Windows. The https://osquery.io/schema[extensive schema] helps with a variety of use cases, including vulnerability detection, compliance monitoring, incident investigations, and more. -With Osquery, you can: +With Osquery in {kib}, you can: * Run live queries for one or more agents - * Schedule queries to capture changes to OS state over time + * Schedule query packs to capture changes to OS state over time * View a history of past queries and their results * Save queries and build a library of queries for specific use cases -Osquery results are stored in {es}, so that you can -search, analyze, and visualize Osquery data in {kib}. - Osquery is powered by the *Osquery Manager* integration. For information on how to set up *Osquery Manager*, refer to <>. @@ -36,8 +33,8 @@ view live and scheduled query results, but you cannot run live queries or edit. [[osquery-run-query]] == Run live queries -To inspect a host or test queries you want to schedule, run a query against one or more agents or policies, -and view the results. +To inspect hosts, run a query against one or more agents or policies, +then view the results. . Open the main menu, and then click *Osquery*. @@ -51,21 +48,25 @@ and you'll get suggestions for agents by name, ID, platform, and policy. [role="screenshot"] image::images/enter-query.png[Select saved query dropdown name showing query name and description] +. (Optional) Expand the **Advanced** section to view or set <> included in the results from the live query. + . Click **Submit**. . Review the results in a table, or navigate to *Discover* to dive deeper into the response, or to the drag-and-drop *Lens* editor to create visualizations. . To view more information about the request, such as failures, open the *Status* tab. -. To optionally save the query for future use, click *Save for later* and define the ID, -description, and other -<>. +. To save the query for future use, click *Save for later* and define the ID, +description, and other <>. -To view a history of the past queries you have run, open the *Live queries history*. +[float] +[[osquery-view-history]] +=== View or rerun previous live queries -* To replay a query, click image:images/play-icon.png[Right-pointing triangle]. +From the *Live queries history* section on the *Live queries* tab: -* To view the query <> and <>, -click image:images/table-icon.png[Table icon]. +* Click image:images/play-icon.png[Right-pointing triangle] to replay a query. + +* Click image:images/table-icon.png[Table icon] to view the query <> and <>. + [role="screenshot"] image::images/live-query-check-results.png[Results of OSquery] @@ -73,89 +74,141 @@ image::images/live-query-check-results.png[Results of OSquery] [float] [[osquery-schedule-query]] -== Schedule queries +== Schedule queries with packs + +Create packs to organize sets of queries. For example, you might create one pack that checks +for IT compliance-type issues, and another pack that monitors for evidence of malware. +You can schedule packs to run for one or more agent policies. When scheduled, queries in the pack are run at the set intervals for all agents in those policies. Scheduling packs is optional. + +. Open the **Packs** tab. + +. Click **Add pack** to create a new pack, or click the name of an existing pack, then **Edit** to add queries to an existing pack. + +. Provide the following fields: + +* The name of the pack. -Group and schedule queries to run on a specified interval, in seconds. -For example, you might create a group that checks -for IT compliance-type issues, and -another group that monitors for evidence of malware. +* A short description of the pack. -. Open the **Scheduled query groups** tab. +* The agent policies where this pack should run. If no agent policies are set, then the pack is not scheduled. -. Click a group name to view the details. +. Add queries to schedule: + +* To add a query to the pack, click *Add query*, and then either add a saved query or enter a new query. +Each query must include a unique query ID and the interval at which it should run. +Optionally, set the minimum Osquery version and platform, +or <>. When you add a saved query to a pack, this adds a copy of the query. A connection is not maintained between saved queries and packs. + +* To upload queries from a `.conf` query pack, drag the pack to the drop zone under the query table. To explore the community packs that Osquery publishes, click *Example packs*. + +. Click *Save pack*. The queries run when the policy receives the update. + +[float] +[[osquery-schedule-status]] +=== View status of scheduled packs + +. Open the **Packs** tab. + +. Click a pack name to view the status. + Details include the last time each query ran, how many results were returned, and the number of agents the query ran against. If there are errors, expand the row to view the details. + [role="screenshot"] -image::images/scheduled-query-groupds.png[Shows last results last time it ran, how many results returned, number of agents it ran against, if it is actually running and if there are errors] +image::images/scheduled-pack.png[Shows queries in the pack and details about each query, including the last time it ran, how many results were returned, the number of agents it ran against, and if there are errors] -. To make changes, click *Edit*. +. View scheduled query results in <> or the drag-and-drop <> editor. -.. To add a query to the group, click *Add query*, and then enter the query ID and interval. -Optionally, set the minimum Osquery version and platform, -or <>. +[float] +[[osquery-manage-query]] +== Edit saved queries + +Add or edit saved queries from the *Saved queries* tab. + +. Go to the saved queries, then click **Add saved query** or the edit icon. +. Provide the following fields: -.. To upload queries from a .conf query pack, drag the pack to the drop zone under the query table. To explore the community packs that Osquery publishes, click *Example packs*. +* The unique identifier. -. Click *Save query*. The queries run when the policy receives the update. +* A brief description. -. View scheduled history results in < or the drag-and-drop <> editor. +* The SQL query. +* The <> to populate when the query is run. These fields are also copied in when you add this query to a pack. + +* The defaults to set when you add the query to a pack. + +** The frequency to run the query. + +** The minimum https://github.com/osquery/osquery/releases)[version of Osquery] required to run the query. + +** The operating system required to run the query. For information about supported platforms per table, refer to the https://osquery.io/schema[Osquery schema]. + +. Click *Test configuration* to test the query and any mapped fields: + +* From the *Test query* panel, select agents or groups to test the query, then click *Submit* to run a live query. Result columns with the image:images/mapped-icon.png[mapping] icon are mapped. Hover over the icon to see the mapped ECS field. + +. Click **Save query**. [float] [[osquery-map-fields]] -== Map Osquery fields to ECS fields +== Map result fields to ECS -When you schedule queries, you can optionally map query results to fields in -the {ecs-ref}/ecs-reference.html[Elastic Common Schema] (ECS), -which standardizes your Osquery data for use across detections, machine learning, +When you save queries or add queries to a pack, you can optionally map Osquery results or static values to fields in +the {ecs-ref}/ecs-reference.html[Elastic Common Schema] (ECS). +This standardizes your Osquery data for use across detections, machine learning, and any other areas that rely on ECS-compliant data. -The query results include the original `osquery.` -and the mapped ECS field. For example, if you update a query to map `osquery.name` to `user.name`, the query results include both fields. +When the query is run, the results include the original `osquery.` +and the mapped ECS fields. For example, if you update a query to map `osquery.name` to `user.name`, the query results include both fields. -. Edit a scheduled query group, and then click the edit icon for the query that you want to map. +. Edit saved queries or queries in a pack to map fields: -. In **ECS mapping**, select the Osquery result fields you want to map to ECS fields. -+ -The fields available in the **Osquery.results** column are based on the SQL query entered, -and only include fields that the query returns. +* For *Saved queries*: Open the *Saved queries* tab, and then click the edit icon for the query that you want to map. -When mapping fields: +* For *packs*: Open the *Packs* tab, edit a pack, and then click the edit icon for the query that you want to map. -. To add a new row for additional fields to map, click the plus icon. +. In the **ECS mapping** section, select an **ECS field** to map. -. To remove any mapped rows, click the trash icon. +. In the **Value** column, use the dropdown on the left to choose what type of value to map to the ECS field: -. To save changes to the query, click *Save*. +** **Osquery value**: Select an Osquery field. The fields available are based on the SQL query entered, and only include fields that the query returns. When the query runs, the ECS field is set dynamically to the value of the Osquery field selected. -. To save changes to the group, click *Save query*. +** **Static value**: Enter a static value. When the query runs, the ECS field is set to the value entered. For example, static fields can be used to apply `tags` or your preferred `event.category` to the query results. +. Map more fields, as needed. -[float] -[[osquery-manage-query]] -== Edit saved queries +** To add a new row for additional fields to map, click the plus icon. -Add or edit saved queries to the *Saved queries* tab. +** To remove any mapped rows, click the trash icon. -. Go to the saved queries, then click **Add saved query** or the edit icon. -. Provide the following fields: +. Save your changes. -* The unique identifier. +[NOTE] +========================= -* A brief description. +* Some ECS fields are restricted and cannot be mapped. These are not available in the ECS dropdown. -* The SQL query. +* Some ECS fields are restricted to a set of allowed values, like {ecs-ref}/ecs-event.html#field-event-category[event.category]. Use the {ecs-ref}/ecs-field-reference.html[ECS Field Reference] for help when mapping fields. -* The defaults for the scheduled query group, which is included when you add the query to a scheduled query group. +* Osquery date fields have a variety of data types (including integer, text, or bigint). When mapping an Osquery date field to an ECS date field, you might need to use SQL operators in the query to get an {es}-compatible +{ref}/date.html[date] type. +========================= -** The frequency to run the query. -** The minimum https://github.com/osquery/osquery/releases)[version of Osquery] required to run the query. +[float] +[[osquery-extended-tables]] +== Extended tables for Kubernetes queries +In addition to the Osquery schema, the Elastic-provided version of Osquery also includes the following tables to support Kubernetes containers. These can be queried with live or scheduled queries. -** The operating system required to run the query. For information about supported platforms per table, click *OSquery schema* in the *Edit query* flyout. +* `host_users` -. Click **Save query**. +* `host_groups` + +* `host_processes` + +When querying these tables, the expectation is that the `/etc/passwd`, `/etc/group`, and `/proc` are available in the container under `/hostfs` as: +`/hostfs/etc/passwd`, `/hostfs/etc/group`, and `/hostfs/proc`. For information about the fields available in these tables, see the +https://docs.elastic.co/en/integrations/osquery_manager#exported-fields[exported fields] reference. [float] [[osquery-status]] @@ -180,189 +233,34 @@ the results are still returned. [float] [[osquery-results]] == Osquery results - -For the fields that can be returned in Osquery results, +When you run live or scheduled queries, the results are automatically +stored in an {es} index, so that you can search, analyze, and visualize this data in {kib}. +For a list of the Osquery fields that can be returned in query results, refer to https://docs.elastic.co/en/integrations/osquery_manager#exported-fields[exported fields]. -Scheduled Osquery -results can also include ECS fields, if the query has a defined ECS mapping. +Query results can also include ECS fields, if the query has a defined ECS mapping. Osquery responses include the following information: -* Everything prefaced with `osquery.` is part of the query response. These fields are not mapped to ECS. +* Everything prefaced with `osquery.` is part of the query response. These fields are not mapped to ECS by default. -* By default, the `host.*` and `agent.*` fields are mapped to ECS. +* Results include some ECS fields by default, such as `host.*` and `agent.*`, which provide information about the host that was queried. -* The `action_data.query` has the query that was sent. +* For live queries, the `action_data.query` is the query that was sent. -* All query results are https://osquery.readthedocs.io/en/stable/deployment/logging/#snapshot-logs[snapshot logs] -that represent a point in time with a set of results, with no differentials. -https://osquery.readthedocs.io/en/stable/deployment/logging/#differential-logs[Differential logs] are unsupported. +* For scheduled queries in a pack, the `action_id` has the format `pack__`. You can use this information to look up the query that was run. -* Osquery data is stored in the `logs-osquery_manager.result-default` datastream, and the result row data is under the `osquery` property in the document. +* By default, all query results are https://osquery.readthedocs.io/en/stable/deployment/logging/#snapshot-logs[snapshot logs] +that represent a point in time with a set of results, with no +https://osquery.readthedocs.io/en/stable/deployment/logging/#differential-logs[differentials]. -The following example shows a successful Osquery result: +* Osquery data is stored in the `logs-osquery_manager.result-` datastream, and the result row data is under the `osquery` property in the document. - -```ts -{ - "_index": ".ds-logs-osquery_manager.result-default-2021.04.12-2021.04.12-000001", - "_id": "R3ZwxngBKwN-X8eyQbxy", - "_version": 1, - "_score": null, - "fields": { - "osquery.seconds": [ - "7" - ], - "action_data.id": [ - "72d3ec71-7635-461e-a15d-f728819ae27f" - ], - "osquery.seconds.number": [ - 7 - ], - "osquery.hours.number": [ - 6 - ], - "host.hostname": [ - "MacBook-Pro.local" - ], - "type": [ - "MacBook-Pro.local" - ], - "host.mac": [ - "ad:de:48:00:12:22", - "a6:83:e7:cb:91:ee" - ], - "osquery.total_seconds.number": [ - 1060627 - ], - "host.os.build": [ - "20D91" - ], - "host.ip": [ - "192.168.31.171", - "fe80::b5b1:39ff:faa1:3b39" - ], - "agent.type": [ - "osquerybeat" - ], - "action_data.query": [ - "select * from uptime;" - ], - "osquery.minutes": [ - "37" - ], - "action_id": [ - "5099c02d-bd6d-4b88-af90-d80dcdc945df" - ], - "host.os.version": [ - "10.16" - ], - "host.os.kernel": [ - "20.3.0" - ], - "host.os.name": [ - "Mac OS X" - ], - "agent.name": [ - "MacBook-Pro.local" - ], - "host.name": [ - "MacBook-Pro.local" - ], - "osquery.total_seconds": [ - "1060627" - ], - "host.id": [ - "155D977D-8EA8-5BDE-94A2-D78A7B545198" - ], - "osquery.hours": [ - "6" - ], - "osquery.days": [ - "12" - ], - "host.os.type": [ - "macos" - ], - "osquery.days.number": [ - 12 - ], - "host.architecture": [ - "x86_64" - ], - "@timestamp": [ - "2021-04-12T14:15:45.060Z" - ], - "agent.id": [ - "196a0086-a612-48b1-930a-300565b3efaf" - ], - "host.os.platform": [ - "darwin" - ], - "ecs.version": [ - "1.8.0" - ], - "agent.ephemeral_id": [ - "5cb88e34-50fe-4c13-b81c-d2b7187505ea" - ], - "agent.version": [ - "7.13.0" - ], - "host.os.family": [ - "darwin" - ], - "osquery.minutes.number": [ - 37 - ] - } -} -``` - -The following is an example of an **error response** for an undefined action query: - -```ts -{ - "_index": ".ds-.fleet-actions-results-2021.04.10-000001", - "_id": "qm7mvHgBKwN-X8eyYB1x", - "_version": 1, - "_score": null, - "fields": { - "completed_at": [ - "2021-04-10T17:48:32.268Z" - ], - "error.keyword": [ - "action undefined" - ], - "@timestamp": [ - "2021-04-10T17:48:32.000Z" - ], - "action_data.query": [ - "select * from uptime;" - ], - "action_data.id": [ - "2c95bb2c-8ab6-4e8c-ac01-a1abb693ea00" - ], - "agent_id": [ - "c21b4c9c-6f36-49f0-8b60-08490fc619ce" - ], - "action_id": [ - "53454d3b-c8cd-4a50-b5b4-f85da17b4be2" - ], - "started_at": [ - "2021-04-10T17:48:32.267Z" - ], - "error": [ - "action undefined" - ] - } -} -``` [float] [[manage-osquery-integration]] == Manage the integration [float] -== System requirements +=== System requirements * {fleet-guide}/fleet-overview.html[Fleet] is enabled on your cluster, and one or more {fleet-guide}/elastic-agent-installation.html[Elastic Agents] is enrolled. @@ -373,23 +271,53 @@ This integration supports x64 architecture on Windows, MacOS, and Linux platform and ARM64 architecture on Linux. NOTE: The original {filebeat-ref}/filebeat-module-osquery.html[Filebeat Osquery module] -and the https://docs.elastic.co/en/integrations/osquery[Osquery Log Collection] +and the https://docs.elastic.co/en/integrations/osquery[Osquery] integration collect logs from self-managed Osquery deployments. The *Osquery Manager* integration manages Osquery deployments and supports running and scheduling queries from {kib}. [float] -== Customize Osquery sub-feature privileges +=== Customize Osquery sub-feature privileges Depending on your https://www.elastic.co/subscriptions[subscription level], you can further customize the sub-feature privileges for *Osquery Manager*. These include options to grant specific access for running live queries, -running saved queries, saving queries, and scheduling queries. For example, +running saved queries, saving queries, and scheduling packs. For example, you can create roles for users who can only run live or saved queries, but who cannot save or schedule queries. This is useful for teams who need in-depth and detailed control. [float] -== Upgrade Osquery versions +=== Customize Osquery configuration +By default, all Osquery Manager integrations share the same osquery configuration. However, you can customize how Osquery is configured by editing the Osquery Manager integration for each agent policy +you want to adjust. The custom configuration is then applied to all agents in the policy. +This powerful feature allows you to configure +https://osquery.readthedocs.io/en/stable/deployment/file-integrity-monitoring[File Integrity Monitoring], https://osquery.readthedocs.io/en/stable/deployment/process-auditing[Process auditing], +and https://osquery.readthedocs.io/en/stable/deployment/configuration/#configuration-specification[others]. + +IMPORTANT: Take caution when editing this configuration. The changes you make are distributed to all agents in the policy. + +. From the {kib} main menu, click *Fleet*, then the *Agent policies* tab. + +. Click the name of the agent policy where you want to adjust the Osquery configuration. The configuration changes you make only apply to the policy you select. + +. Click the name of the *Osquery Manager* integration, or add the integration first if the agent policy does not yet have it. + +. From the *Edit Osquery Manager integration* page, expand the *Advanced* section. + +. Edit the *Osquery config* JSON field to apply your preferred Osquery configuration. Note the following: + +* The field may already have content if you have scheduled packs for this agent policy. To keep these packs scheduled, do not edit the `packs` section. + +* Refer to the https://osquery.readthedocs.io/en/stable/[Osquery documentation] for configuration options. + +* Some fields are protected and cannot be set. A warning is displayed with details about which fields should be removed. + +* (Optional) To load a full configuration file, drag and drop an Osquery `.conf` file into the area at the bottom of the page. + +. Click *Save integration* to apply the custom configuration to all agents in the policy. + +[float] +=== Upgrade Osquery versions The https://github.com/osquery/osquery/releases[Osquery version] available on an Elastic Agent is associated to the version of Osquery Beat on the Agent. @@ -397,7 +325,7 @@ To get the latest version of Osquery Beat, https://www.elastic.co/guide/en/fleet/master/upgrade-elastic-agent.html[upgrade your Elastic Agent]. [float] -== Debug issues +=== Debug issues If you encounter issues with *Osquery Manager*, find the relevant logs for the {elastic-agent} and Osquerybeat in the installed agent directory, then adjust the agent path for your setup. diff --git a/docs/settings/logging-settings.asciidoc b/docs/settings/logging-settings.asciidoc index f88ea665c0213..cb8237c5aa384 100644 --- a/docs/settings/logging-settings.asciidoc +++ b/docs/settings/logging-settings.asciidoc @@ -4,172 +4,86 @@ Logging settings ++++ -{kib} relies on three high-level entities to set the logging service: appenders, loggers, and root. +You do not need to configure any additional settings to use the logging features in {kib}. Logging is enabled by default and will log at `info` level using the `pattern` layout, which outputs logs to `stdout`. + +However, if you are planning to ingest your logs using Elasticsearch or another tool, we recommend using the `json` layout, which produces logs in ECS format. In general, `pattern` layout is recommended when raw logs will be read by a human, and `json` layout when logs will be read by a machine. + +NOTE: The logging configuration is validated against the predefined schema and if there are any issues with it, {kib} will fail to start with the detailed error message. + +{kib} relies on three high-level entities to set the logging service: appenders, loggers, and root. These can be configured in the `logging` namespace in `kibana.yml`. - Appenders define where log messages are displayed (stdout or console) and their layout (`pattern` or `json`). They also allow you to specify if you want the logs stored and, if so, where (file on the disk). - Loggers define what logging settings, such as the level of verbosity and the appenders, to apply to a particular context. Each log entry context provides information about the service or plugin that emits it and any of its sub-parts, for example, `metrics.ops` or `elasticsearch.query`. - Root is a logger that applies to all the log entries in {kib}. -Refer to the <> for common configuration use cases. To learn more about possible configuration values, go to {kibana-ref}/logging-service.html[{kib}'s Logging service]. - -[[log-settings-examples]] -==== Examples -Here are some configuration examples for the most common logging use cases: - -[[log-to-file-example]] -===== Log to a file - -Log the default log format to a file instead of to stdout (the default). - -[source,yaml] ----- -logging: - appenders: - file: - type: file - fileName: /var/log/kibana.log - layout: - type: pattern - root: - appenders: [file] ----- - -[[log-in-json-ECS-example]] -===== Log in JSON format - -Log the default log format to JSON layout instead of pattern (the default). -With `json` layout, log messages will be formatted as JSON strings in https://www.elastic.co/guide/en/ecs/current/ecs-reference.html[ECS format] that includes a timestamp, log level, logger, message text and any other metadata that may be associated with the log message itself. - -[source,yaml] ----- -logging: - appenders: - json-layout: - type: console - layout: - type: json - root: - appenders: [json-layout] ----- - -[[log-with-meta-to-stdout]] -===== Log with meta to stdout - -Include `%meta` in your pattern layout: - -[source,yaml] ----- -logging: - appenders: - console-meta: - type: console - layout: - type: pattern - pattern: "[%date] [%level] [%logger] [%meta] %message" - root: - appenders: [console-meta] ----- - -[[log-elasticsearch-queries]] -===== Log {es} queries - -[source,yaml] --- -logging: - appenders: - console_appender: - type: console - layout: - type: pattern - highlight: true - root: - appenders: [console_appender] - level: warn - loggers: - - name: elasticsearch.query - level: debug --- - -[[change-overall-log-level]] -===== Change overall log level - -[source,yaml] ----- -logging: - root: - level: debug ----- - -[[customize-specific-log-records]] -===== Customize specific log records -Here is a detailed configuration example that can be used to configure _loggers_, _appenders_ and _layouts_: - -[source,yaml] ----- -logging: - appenders: - console: - type: console - layout: - type: pattern - highlight: true - file: - type: file - fileName: /var/log/kibana.log - custom: - type: console - layout: - type: pattern - pattern: "[%date][%level] %message" - json-file-appender: - type: file - fileName: /var/log/kibana-json.log - layout: - type: json - - root: - appenders: [console, file] - level: error - - loggers: - - name: plugins - appenders: [custom] - level: warn - - name: plugins.myPlugin - level: info - - name: server - level: fatal - - name: optimize - appenders: [console] - - name: telemetry - appenders: [json-file-appender] - level: all - - name: metrics.ops - appenders: [console] - level: debug ----- - -Here is what we get with the config above: -[options="header"] +The following table serves as a quick reference for different logging configuration keys. Note that these are not stand-alone settings and may require additional logging configuration. See the <> guide and complete <> for common configuration use cases. + +[cols="2*<"] |=== +| `logging.appenders[].` +| Unique appender identifier. -| Context name | Appenders | Level +| `logging.appenders[].console:` +| Appender to use for logging records to *stdout*. By default, uses the `[%date][%level][%logger] %message` **pattern** layout. To use a **json**, set the <>. -| root | console, file | error +| `logging.appenders[].file:` +| Allows you to specify a fileName to write log records to disk. To write <>, add the file appender to `root.appenders`. If configured, you also need to specify <>. -| plugins | custom | warn +| `logging.appenders[].rolling-file:` +| Similar to Log4j's `RollingFileAppender`, this appender will log to a file and rotate if following a rolling strategy when the configured policy triggers. There are currently two policies supported: `size-limit` and `time-interval`. -| plugins.myPlugin | custom | info +| `logging.appenders[]..type` +| The appender type determines where the log messages are sent. Options are `console`, `file`, `rewrite`, `rolling-file`. Required. -| server | console, file | fatal +| `logging.appenders[]..fileName` +| Determines the filepath where the log messages are written to for file and rolling-file appender types. Required for appenders that write to file. -| optimize | console | error +| `logging.appenders[]..policy.type` +| Specify the triggering policy for when a rollover should occur for the `rolling-file` type appender. -| telemetry | json-file-appender | all +| `logging.appenders[]..policy.interval` +| Specify the time interval for rotating a log file for a `time-interval` type `rolling-file` appender. *Default 24h* -| metrics.ops | console | debug -|=== +| `logging.appenders[]..policy.size` +| Specify the size limit at which the policy should trigger a rollover for a `size-limit` type `rolling-file` appender. *Default 100mb*. + +| `logging.appenders[]..policy.interval` +| Specify the time interval at which the policy should trigger a rollover for a time-interval type `rolling-file` appender. + +| `logging.appenders[]..policy.modulate` +| Whether the interval should be adjusted to cause the next rollover to occur on the interval boundary. Boolean. Default `true`. + +| `logging.appenders[]..strategy.type` +| Rolling file strategy type. Only `numeric` is currently supported. + +| `logging.appenders[]..strategy.pattern` +| The suffix to append to the file path when rolling. Must include `%i`. -NOTE: If you modify `root.appenders`, make sure to include `default`. +| `logging.appenders[]..strategy.max` +| The maximum number of files to keep. Optional. Default is `7`. -// For more details about logging configuration, refer to the logging system documentation (update to include a link). +| `logging.appenders[]..layout.type` +| Determines how the log messages are displayed. Options are `pattern`, which provides human-readable output, or `json`, which provides ECS-compliant output. Required. + +| `logging.appenders[]..layout.highlight` +| Optional boolean to highlight log messages in color. Applies to `pattern` layout only. Default is `false`. + +| `logging.appenders[]..layout.pattern` +| Optional <> for placeholders that will be replaced with data from the actual log message. Applicable to pattern type layout only. + +| `logging.root.appenders[]` +| List of specific appenders to apply to `root`. Defaults to `console` with `pattern` layout. + +| `logging.root.level` +| Specify default verbosity for all log messages to fall back to if not specifically configured at the individual logger level. Options are `all`, `fatal`, `error`, `warn`, `info`, `debug`, `trace`, `off`. The `all` and `off` levels can be used only in configuration and are just handy shortcuts that allow you to log every log record or disable logging entirely or for a specific logger. Default is `info`. + +| `logging.loggers[]..name:` +| Specific logger instance. + +| `logging.loggers[]..level` +| Specify verbosity of log messages for context. Optional and inherits the verbosity of any ancestor logger, up to the `root` logger `level`. + +| `logging.loggers[]..appenders` +| Determines the appender to apply to a specific logger context as an array. Optional and falls back to the appender(s) of the `root` logger if not specified. + +|=== diff --git a/docs/setup/configuring-logging.asciidoc b/docs/setup/configuring-logging.asciidoc new file mode 100644 index 0000000000000..38c5594a8e78f --- /dev/null +++ b/docs/setup/configuring-logging.asciidoc @@ -0,0 +1,697 @@ +[[logging-configuration]] +== Configure logging + +The {kib} logging system has three main components: _loggers_, _appenders_ and _layouts_. These components allow us to log messages according to message type and level, to control how these messages are formatted and where the final logs will be displayed or stored. + +- <> +- <> +- <> +- <> + +[float] +[[loggers-appenders-layout]] +=== Loggers, Appenders and Layouts +__Loggers__ define what logging settings should be applied to a particular logger. + +__<>__ define where log messages are displayed (eg. stdout or console) and stored (eg. file on the disk). + +__<>__ define how log messages are formatted and what type of information they include. + +[float] +[[log-level]] +=== Log level + +Currently we support the following log levels: _all_, _fatal_, _error_, _warn_, _info_, _debug_, _trace_, _off_. + +Levels are ordered, so _all_ > _fatal_ > _error_ > _warn_ > _info_ > _debug_ > _trace_ > _off_. + +A log record will be logged by the logger if its level is higher than or equal to the level of its logger. Otherwise, the log record is ignored. + +The _all_ and _off_ levels can only be used in configuration and are handy shortcuts that allow you to log every log record or disable logging entirely for a specific logger. These levels can also be specified using <>. + +[float] +[[logging-layouts]] +=== Layouts + +Every appender should know exactly how to format log messages before they are written to the console or file on the disk. +This behavior is controlled by the layouts and configured through `appender.layout` configuration property for every +custom appender. Currently we don't define any default layout for the +custom appenders, so one should always make the choice explicitly. + +There are two types of layout supported at the moment: <> and <>. + +[float] +[[pattern-layout]] +==== Pattern layout + +With `pattern` layout it's possible to define a string pattern with special placeholders `%conversion_pattern` that will be replaced with data from the actual log message. By default the following pattern is used: `[%date][%level][%logger] %message`. + +NOTE: The `pattern` layout uses a sub-set of https://logging.apache.org/log4j/2.x/manual/layouts.html#PatternLayout[log4j 2 pattern syntax] and **doesn't implement** all `log4j 2` capabilities. + +The conversions that are provided out of the box are: + +**level** +Outputs the <> of the logging event. +Example of `%level` output: `TRACE`, `DEBUG`, `INFO`. + +**logger** +Outputs the name of the logger that published the logging event. +Example of `%logger` output: `server`, `server.http`, `server.http.kibana`. + +**message** +Outputs the application supplied message associated with the logging event. + +**meta** +Outputs the entries of `meta` object data in **json** format, if one is present in the event. +Example of `%meta` output: +[source,bash] +---- +// Meta{from: 'v7', to: 'v8'} +'{"from":"v7","to":"v8"}' +// Meta empty object +'{}' +// no Meta provided +'' +---- + +[float] +[[date-format]] +**date** +Outputs the date of the logging event. The date conversion specifier may be followed by a set of braces containing a name of predefined date format and canonical timezone name. +Timezone name is expected to be one from https://en.wikipedia.org/wiki/List_of_tz_database_time_zones[TZ database name]. +Timezone defaults to the host timezone when not explicitly specified. +Example of `%date` output: + +[float] +[[date-conversion-pattern-examples]] +[options="header"] +|=== + +| Conversion pattern | Example + +| `%date` +| `2012-02-01T14:30:22.011Z` uses `ISO8601` format by default + +| `%date{ISO8601}` +| `2012-02-01T14:30:22.011Z` + +| `%date{ISO8601_TZ}` +| `2012-02-01T09:30:22.011-05:00` `ISO8601` with timezone + +| `%date{ISO8601_TZ}{America/Los_Angeles}` +| `2012-02-01T06:30:22.011-08:00` + +| `%date{ABSOLUTE}` +| `09:30:22.011` + +| `%date{ABSOLUTE}{America/Los_Angeles}` +| `06:30:22.011` + +| `%date{UNIX}` +| `1328106622` + +| `%date{UNIX_MILLIS}` +| `1328106622011` + +|=== + +**pid** +Outputs the process ID. + +The pattern layout also offers a `highlight` option that allows you to highlight +some parts of the log message with different colors. Highlighting is quite handy if log messages are forwarded +to a terminal with color support. + +[float] +[[json-layout]] +==== JSON layout +With `json` layout log messages will be formatted as JSON strings in https://www.elastic.co/guide/en/ecs/current/ecs-reference.html[ECS format] that includes a timestamp, log level, logger, message text and any other metadata that may be associated with the log message itself. + +[float] +[[logger-hierarchy]] +=== Logger hierarchy + +Every logger has a unique name that follows a hierarchical naming rule. The logger is considered to be an +ancestor of another logger if its name followed by a `.` is a prefix of the descendant logger. For example, a logger +named `a.b` is an ancestor of logger `a.b.c`. All top-level loggers are descendants of a special `root` logger at the top of the logger hierarchy. The `root` logger always exists, is fully configured and logs to `info` level by default. The `root` logger must also be configured if any other logging configuration is specified in your `kibana.yml`. + +You can configure _<>_ and _appenders_ for a specific logger. If a logger only has a _log level_ configured, then the _appenders_ configuration applied to the logger is inherited from the ancestor logger, up to the `root` logger. + +NOTE: In the current implementation we __don't support__ so called _appender additivity_ when log messages are forwarded to _every_ distinct appender within the +ancestor chain including `root`. That means that log messages are only forwarded to appenders that are configured for a particular logger. If a logger doesn't have any appenders configured, the configuration of that particular logger will be inherited from its closest ancestor. + +[float] +[[dedicated-loggers]] +===== Dedicated loggers + +**Root** + +The `root` logger has a dedicated configuration node since this logger is special and should always exist. By default `root` is configured with `info` level and `default` appender that is also always available. This is the configuration that all custom loggers will use unless they're re-configured explicitly. + +For example to see _all_ log messages that fall back on the `root` logger configuration, just add one line to the configuration: + +[source,yaml] +---- +logging.root.level: all +---- + +Or disable logging entirely with `off`: + +[source,yaml] +---- +logging.root.level: off +---- + +**Metrics Logs** + +The `metrics.ops` logger is configured with `debug` level and will automatically output sample system and process information at a regular interval. +The metrics that are logged are a subset of the data collected and are formatted in the log message as follows: + +[options="header"] +|=== + +| Ops formatted log property | Location in metrics service | Log units + +| memory | process.memory.heap.used_in_bytes | http://numeraljs.com/#format[depends on the value], typically MB or GB + +| uptime | process.uptime_in_millis | HH:mm:ss + +| load | os.load | [ "load for the last 1 min" "load for the last 5 min" "load for the last 15 min"] + +| delay | process.event_loop_delay | ms +|=== + +The log interval is the same as the interval at which system and process information is refreshed and is configurable under `ops.interval`: + +[source,yaml] +---- +ops.interval: 5000 +---- + +The minimum interval is 100ms and defaults to 5000ms. + +[[request-response-logger]] +**Request and Response Logs** + +The `http.server.response` logger is configured with `debug` level and will automatically output +data about http requests and responses occurring on the {kib} server. +The message contains some high-level information, and the corresponding log meta contains the following: + +[options="header"] +|=== + +| Meta property | Description | Format + +| client.ip | IP address of the requesting client | ip + +| http.request.method | http verb for the request (uppercase) | string + +| http.request.mime_type | (optional) mime as specified in the headers | string + +| http.request.referrer | (optional) referrer | string + +| http.request.headers | request headers | object + +| http.response.body.bytes | (optional) Calculated response payload size in bytes | number + +| http.response.status_code | status code returned | number + +| http.response.headers | response headers | object + +| http.response.responseTime | (optional) Calculated response time in ms | number + +| url.path | request path | string + +| url.query | (optional) request query string | string + +| user_agent.original | raw user-agent string provided in request headers | string + +|=== + +[float] +[[logging-appenders]] +=== Appenders + +[float] +[[rolling-file-appender]] +==== Rolling File Appender + +Similar to Log4j's `RollingFileAppender`, this appender will log into a file, and rotate it following a rolling +strategy when the configured policy triggers. + +[float] +====== Triggering Policies + +The triggering policy determines when a rollover should occur. + +There are currently two policies supported: `size-limit` and `time-interval`. + +[float] +[[size-limit-triggering-policy]] +**Size-limit triggering policy** + +This policy will rotate the file when it reaches a predetermined size. + +[source,yaml] +---- +logging: + appenders: + rolling-file: + type: rolling-file + fileName: /var/logs/kibana.log + policy: + type: size-limit + size: 50mb + strategy: + //... + layout: + type: pattern +---- + +The options are: + +- `size` + +The maximum size the log file should reach before a rollover should be performed. The default value is `100mb` + +[[time-interval-triggering-policy]] +**Time-interval triggering policy** + +This policy will rotate the file every given interval of time. + +[source,yaml] +---- +logging: + appenders: + rolling-file: + type: rolling-file + fileName: /var/logs/kibana.log + policy: + type: time-interval + interval: 10s + modulate: true + strategy: + //... + layout: + type: pattern +---- + +The options are: + +- `interval` + +How often a rollover should occur. The default value is `24h` + +- `modulate` + +Whether the interval should be adjusted to cause the next rollover to occur on the interval boundary. + +For example, if modulate is true and the interval is `4h`, if the current hour is 3 am then the first rollover will occur at 4 am +and then next ones will occur at 8 am, noon, 4pm, etc. The default value is `true`. + +[float] +===== Rolling strategies + +The rolling strategy determines how the rollover should occur: both the naming of the rolled files, +and their retention policy. + +There is currently one strategy supported: `numeric`. + +**Numeric rolling strategy** + +This strategy will suffix the file with a given pattern when rolling, +and will retains a fixed amount of rolled files. + +[source,yaml] +---- +logging: + appenders: + rolling-file: + type: rolling-file + fileName: /var/logs/kibana.log + policy: + // ... + strategy: + type: numeric + pattern: '-%i' + max: 2 + layout: + type: pattern +---- + +For example, with this configuration: + +- During the first rollover kibana.log is renamed to kibana-1.log. A new kibana.log file is created and starts + being written to. +- During the second rollover kibana-1.log is renamed to kibana-2.log and kibana.log is renamed to kibana-1.log. + A new kibana.log file is created and starts being written to. +- During the third and subsequent rollovers, kibana-2.log is deleted, kibana-1.log is renamed to kibana-2.log and + kibana.log is renamed to kibana-1.log. A new kibana.log file is created and starts being written to. + +The options are: + +- `pattern` + +The suffix to append to the file path when rolling. Must include `%i`, as this is the value +that will be converted to the file index. + +For example, with `fileName: /var/logs/kibana.log` and `pattern: '-%i'`, the rolling files created +will be `/var/logs/kibana-1.log`, `/var/logs/kibana-2.log`, and so on. The default value is `-%i` + +- `max` + +The maximum number of files to keep. Once this number is reached, oldest files will be deleted. The default value is `7` + +[float] +[[rewrite-appender]] +==== Rewrite appender + +WARNING: This appender is currently considered experimental and is not intended +for public consumption. The API is subject to change at any time. + +Similar to log4j's `RewriteAppender`, this appender serves as a sort of middleware, +modifying the provided log events before passing them along to another +appender. + +[source,yaml] +---- +logging: + appenders: + my-rewrite-appender: + type: rewrite + appenders: [console, file] # name of "destination" appender(s) + policy: + # ... +---- + +The most common use case for the `RewriteAppender` is when you want to +filter or censor sensitive data that may be contained in a log entry. +In fact, with a default configuration, {kib} will automatically redact +any `authorization`, `cookie`, or `set-cookie` headers when logging http +requests & responses. + +To configure additional rewrite rules, you'll need to specify a <>. + +[float] +[[rewrite-policies]] +====== Rewrite policies + +Rewrite policies exist to indicate which parts of a log record can be +modified within the rewrite appender. + +**Meta** + +The `meta` rewrite policy can read and modify any data contained in the +`LogMeta` before passing it along to a destination appender. + +Meta policies must specify one of three modes, which indicate which action +to perform on the configured properties: +- `update` updates an existing property at the provided `path`. +- `remove` removes an existing property at the provided `path`. + +The `properties` are listed as a `path` and `value` pair, where `path` is +the dot-delimited path to the target property in the `LogMeta` object, and +`value` is the value to add or update in that target property. When using +the `remove` mode, a `value` is not necessary. + +Here's an example of how you would replace any `cookie` header values with `[REDACTED]`: + +[source,yaml] +---- +logging: + appenders: + my-rewrite-appender: + type: rewrite + appenders: [console] + policy: + type: meta # indicates that we want to rewrite the LogMeta + mode: update # will update an existing property only + properties: + - path: "http.request.headers.cookie" # path to property + value: "[REDACTED]" # value to replace at path +---- + +Rewrite appenders can even be passed to other rewrite appenders to apply +multiple filter policies/modes, as long as it doesn't create a circular +reference. Each rewrite appender is applied sequentially (one after the other). + +[source,yaml] +---- +logging: + appenders: + remove-request-headers: + type: rewrite + appenders: [censor-response-headers] # redirect to the next rewrite appender + policy: + type: meta + mode: remove + properties: + - path: "http.request.headers" # remove all request headers + censor-response-headers: + type: rewrite + appenders: [console] # output to console + policy: + type: meta + mode: update + properties: + - path: "http.response.headers.set-cookie" + value: "[REDACTED]" +---- + +[float] +====== Complete Example For Rewrite Appender + +[source,yaml] +---- +logging: + appenders: + custom_console: + type: console + layout: + type: pattern + highlight: true + pattern: "[%date][%level][%logger] %message %meta" + file: + type: file + fileName: ./kibana.log + layout: + type: json + censor: + type: rewrite + appenders: [custom_console, file] + policy: + type: meta + mode: update + properties: + - path: "http.request.headers.cookie" + value: "[REDACTED]" + loggers: + - name: http.server.response + appenders: [censor] # pass these logs to our rewrite appender + level: debug +---- + +[[log-settings-examples]] +=== Examples +Here are some configuration examples for the most common logging use cases: + +[float] +[[log-to-file-example]] +==== Log to a file + +Log the default log format to a file instead of to stdout (the default). + +[source,yaml] +---- +logging: + appenders: + file: + type: file + fileName: /var/log/kibana.log + layout: + type: pattern + root: + appenders: [file] +---- + +[float] +[[log-in-json-ECS-example]] +==== Log in JSON format + +Log the default log format to JSON layout instead of pattern (the default). +With `json` layout, log messages will be formatted as JSON strings in https://www.elastic.co/guide/en/ecs/current/ecs-reference.html[ECS format] that includes a timestamp, log level, logger, message text and any other metadata that may be associated with the log message itself. + +[source,yaml] +---- +logging: + appenders: + json-layout: + type: console + layout: + type: json + root: + appenders: [json-layout] +---- + +[float] +[[log-with-meta-to-stdout]] +==== Log with meta to stdout + +Include `%meta` in your pattern layout: + +[source,yaml] +---- +logging: + appenders: + console-meta: + type: console + layout: + type: pattern + pattern: "[%date] [%level] [%logger] [%meta] %message" + root: + appenders: [console-meta] +---- + +[float] +[[log-elasticsearch-queries]] +==== Log {es} queries + +[source,yaml] +-- +logging: + appenders: + console_appender: + type: console + layout: + type: pattern + highlight: true + root: + appenders: [console_appender] + level: warn + loggers: + - name: elasticsearch.query + level: debug +-- + +[float] +[[change-overall-log-level]] +==== Change overall log level + +[source,yaml] +---- +logging: + root: + level: debug +---- + +[float] +[[customize-specific-log-records]] +==== Customize specific log records +Here is a detailed configuration example that can be used to configure _loggers_, _appenders_ and _layouts_: + +[source,yaml] +---- +logging: + appenders: + console: + type: console + layout: + type: pattern + highlight: true + file: + type: file + fileName: /var/log/kibana.log + custom: + type: console + layout: + type: pattern + pattern: "[%date][%level] %message" + json-file-appender: + type: file + fileName: /var/log/kibana-json.log + layout: + type: json + + root: + appenders: [console, file] + level: error + + loggers: + - name: plugins + appenders: [custom] + level: warn + - name: plugins.myPlugin + level: info + - name: server + level: fatal + - name: optimize + appenders: [console] + - name: telemetry + appenders: [json-file-appender] + level: all + - name: metrics.ops + appenders: [console] + level: debug +---- + +Here is what we get with the config above: +[options="header"] +|=== + +| Context name | Appenders | Level + +| root | console, file | error + +| plugins | custom | warn + +| plugins.myPlugin | custom | info + +| server | console, file | fatal + +| optimize | console | error + +| telemetry | json-file-appender | all + +| metrics.ops | console | debug +|=== + +=== Cli configuration +[float] +[[logging-cli-migration]] +=== Logging configuration via CLI + +As is the case for any of Kibana's config settings, you can specify your logging configuration via the CLI. For convenience, the `--verbose` and `--silent` flags exist as shortcuts and will continue to be supported beyond v7. + +If you wish to override these flags, you can always do so by passing your preferred logging configuration directly to the CLI. For example, with the following configuration: + +[source,yaml] +---- +logging: + appenders: + custom: + type: console + layout: + type: pattern + pattern: "[%date][%level] %message" + root: + level: warn + appenders: [custom] +---- + +you can override the root logging level with: + +[options="header"] +[cols="1, 4, 1"] +|=== + +|legacy logging|{kib} Platform logging|cli shortcuts + +|--verbose +|--logging.root.level=debug +|--verbose + +|--silent +|--logging.root.level=off +|--silent + +|=== diff --git a/docs/setup/docker.asciidoc b/docs/setup/docker.asciidoc index 19b22cc086479..3acaf2ddd2c12 100644 --- a/docs/setup/docker.asciidoc +++ b/docs/setup/docker.asciidoc @@ -64,7 +64,7 @@ For example: [source,sh] ---- -docker exec -it es-node01 /usr/share/elasticsearch/bin/reset-elastic-password +docker exec -it es-node01 /usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic ---- ==== diff --git a/docs/setup/settings.asciidoc b/docs/setup/settings.asciidoc index c9a8210f82198..9e2f981e92f92 100644 --- a/docs/setup/settings.asciidoc +++ b/docs/setup/settings.asciidoc @@ -110,7 +110,7 @@ in this setting. currently do not have an inspector, for example Timelion and Monitoring. *Default: `false`* -The following example shows a valid `elasticsearch.query` logger configuration: +The following example shows a valid verbose `elasticsearch.query` logger configuration: |=== [source,text] @@ -123,7 +123,7 @@ logging: type: pattern highlight: true root: - appenders: [default, console_appender] + appenders: [console_appender] level: warn loggers: - name: elasticsearch.query @@ -298,50 +298,54 @@ suggestions. This value must be a whole number greater than zero. [NOTE] ============ -To reload the logging settings, send a SIGHUP signal to {kib}. +To reload the <>, send a SIGHUP signal to {kib}. +For more logging configuration options, see the <> guide. ============ [cols="2*<"] |=== |[[logging-root]] `logging.root:` -| The {kibana-ref}/logging-service.html#logging-service[`root` logger] has a dedicated configuration node since this context name is special and is pre-configured for logging by default. -// TODO: add link to the advanced logging documentation. +| The `root` logger has is a <> and is pre-configured. The `root` logger logs at `info` level by default. If any other logging configuration is specified, `root` _must_ also be explicitly configured. |[[logging-root-appenders]] `logging.root.appenders:` -| A list of logging appenders to forward the root level logger instance to. By default `root` is configured with the `default` appender that must be included in the list. This is the configuration that all custom loggers will use unless they're re-configured explicitly. Additional appenders, if configured, can be included in the list. +| A list of logging appenders to forward the root level logger instance to. By default `root` is configured with the `default` appender that logs to stdout with a `pattern` layout. This is the configuration that all custom loggers will use unless they're re-configured explicitly. You can override the default behavior by configuring a different <> to apply to `root`. |[[logging-root-level]] `logging.root.level:` {ess-icon} -| Level at which a log record should be logged. Supported levels are: _all_, _fatal_, _error_, _warn_, _info_, _debug_, _trace_, _off_. Levels are ordered from _all_ (highest) to _off_ and a log record will be logged it its level is higher than or equal to the level of its logger, otherwise the log record is ignored. Use this value to <>. Set to `all` to log all events, including system usage information and all requests. Set to `off` to silence all logs. *Default: `info`*. +| Level at which a log record should be logged. Supported levels are: _all_, _fatal_, _error_, _warn_, _info_, _debug_, _trace_, _off_. Levels are ordered from _all_ (highest) to _off_ and a log record will be logged it its level is higher than or equal to the level of its logger, otherwise the log record is ignored. Use this value to <>. *Default: `info`*. -|[[logging-loggers]] `logging.loggers:` - | Allows you to <>. - -| `logging.loggers.name:` -| Specific logger instance. - -| `logging.loggers.level:` -| Level at which a log record should be shown. Supported levels are: _all_, _fatal_, _error_, _warn_, _info_, _debug_, _trace_, _off_. - -| `logging.loggers.appenders:` -| Specific appender format to apply for a particular logger context. +2+a| +[TIP] +============ +Set to `all` to log all events, including system usage information and all requests. Set to `off` to silence all logs. You can also use the logging <> to set log level to `verbose` or silence all logs. +============ -| `logging.appenders:` -| {kibana-ref}/logging-service.html#logging-appenders[Appenders] define how and where log messages are displayed (eg. *stdout* or console) and stored (eg. file on the disk). -// TODO: add link to the advanced logging documentation. +The following example shows a valid verbose `logging.root` configuration: +|=== -| `logging.appenders.console:` -| Appender to use for logging records to *stdout*. By default, uses the `[%date][%level][%logger] %message` **pattern** layout. To use a **json**, set the <>. +[source,text] +-- +logging: + appenders: + console_appender: + type: console + layout: + type: pattern + highlight: true + root: + appenders: [console_appender] + level: all +-- -| `logging.appenders.file:` -| Allows you to specify a fileName to send log records to on disk. To send <>, add the file appender to `root.appenders`. +[cols="2*<"] +|=== -| `logging.appenders.rolling-file:` -| Similar to Log4j's `RollingFileAppender`, this appender will log into a file and rotate if following a rolling strategy when the configured policy triggers. There are currently two policies supported: `size-limit` and `time-interval`. +|[[logging-loggers]] `logging.loggers[]:` + | Allows you to <>. -The size limit policy will perform a rollover when the log file reaches a maximum `size`. *Default 100mb* +| `logging.appenders[]:` +| <> define how and where log messages are displayed (eg. *stdout* or console) and stored (eg. file on the disk). -The time interval policy will rotate the log file every given interval of time. *Default 24h* | `map.includeElasticMapsService:` {ess-icon} | Set to `false` to disable connections to Elastic Maps Service. diff --git a/docs/setup/upgrade.asciidoc b/docs/setup/upgrade.asciidoc index 9a949ffa01b65..a139b8a50ca4d 100644 --- a/docs/setup/upgrade.asciidoc +++ b/docs/setup/upgrade.asciidoc @@ -58,6 +58,8 @@ Before you upgrade {kib}: * Shut down all {kib} instances. Running more than one {kib} version against the same Elasticseach index is unsupported. Upgrading while older {kib} instances are running can cause data loss or upgrade failures. + +NOTE: {kib} logging system may have changed, depending on your target version. For details, see <>. To identify the changes you need to make to upgrade, and to enable you to perform an Elasticsearch rolling upgrade with no downtime, you must upgrade to @@ -101,3 +103,5 @@ Assistant, <>. include::upgrade/upgrade-standard.asciidoc[] include::upgrade/upgrade-migrations.asciidoc[] + +include::upgrade/logging-configuration-changes.asciidoc[] diff --git a/docs/setup/upgrade/logging-configuration-changes.asciidoc b/docs/setup/upgrade/logging-configuration-changes.asciidoc new file mode 100644 index 0000000000000..a7a86fcb45b14 --- /dev/null +++ b/docs/setup/upgrade/logging-configuration-changes.asciidoc @@ -0,0 +1,45 @@ +[[logging-configuration-changes]] +=== Logging configuration changes + +WARNING: {kib} 8.0 and later uses a new logging system. Be sure to read the documentation for your version of {kib} before proceeding. + +[[logging-pattern-format-old-and-new-example]] +[options="header"] +|=== + +| Parameter | Log record in **pattern** format | Legacy log record in **text** format + +| @timestamp | ISO8601_TZ `2012-01-31T23:33:22.011-05:00` | Absolute `23:33:22.011` + +| logger | `parent.child` | `['parent', 'child']` + +| level | `DEBUG` | `['debug']` + +| meta | stringified JSON object `{"to": "v8"}`| N/A + +| pid | can be configured as `%pid` | N/A + +|=== + +[[logging-json-format-old-and-new-example]] +[options="header"] +|=== + +| Parameter | Log record in **json** format | Legacy log record **json** format + +| @timestamp | ISO8601_TZ `2012-01-31T23:33:22.011-05:00` | ISO8601 `2012-01-31T23:33:22.011Z` + +| logger | `log.logger: parent.child` | `tags: ['parent', 'child']` + +| level | `log.level: DEBUG` | `tags: ['debug']` + +| meta | merged in log record `{... "to": "v8"}` | merged in log record `{... "to": "v8"}` + +| pid | `process.pid: 12345` | `pid: 12345` + +| type | N/A | `type: log` + +| error | `{ message, name, stack }` | `{ message, name, stack, code, signal }` + +|=== + diff --git a/docs/user/dashboard/tsvb.asciidoc b/docs/user/dashboard/tsvb.asciidoc index 7efd8425e5611..1c90c28826f6e 100644 --- a/docs/user/dashboard/tsvb.asciidoc +++ b/docs/user/dashboard/tsvb.asciidoc @@ -31,7 +31,7 @@ When you use only {data-sources}, you are able to: * Improve performance -IMPORTANT: Creating *TSVB* visualizations with an {es} index string is deprecated and will be removed in a fytyre release. By default, you create *TSVB* visualizations with only {data-sources}. To use an {es} index string, contact your administrator, or go to <> and set `metrics:allowStringIndices` to `true`. +IMPORTANT: Creating *TSVB* visualizations with an {es} index string is deprecated and will be removed in a future release. By default, you create *TSVB* visualizations with only {data-sources}. To use an {es} index string, contact your administrator, or go to <> and set `metrics:allowStringIndices` to `true`. . On the dashboard, click *All types*, then select *TSVB*. diff --git a/docs/user/setup.asciidoc b/docs/user/setup.asciidoc index 7da0a969b53e8..546cc8f974865 100644 --- a/docs/user/setup.asciidoc +++ b/docs/user/setup.asciidoc @@ -64,6 +64,8 @@ include::security/securing-kibana.asciidoc[] include::{kib-repo-dir}/setup/configuring-reporting.asciidoc[] +include::{kib-repo-dir}/setup/configuring-logging.asciidoc[] + include::monitoring/configuring-monitoring.asciidoc[leveloffset=+1] include::monitoring/monitoring-metricbeat.asciidoc[leveloffset=+2] include::monitoring/viewing-metrics.asciidoc[leveloffset=+2] diff --git a/examples/data_view_field_editor_example/README.md b/examples/data_view_field_editor_example/README.md new file mode 100644 index 0000000000000..a82d7cc54e5a7 --- /dev/null +++ b/examples/data_view_field_editor_example/README.md @@ -0,0 +1,7 @@ +## Data view field editor example + +This example data view field editor app shows how to: + - Edit data view fields via flyout + - Delete data view runtime fields with modal confirm prompt + +To run this example, use the command `yarn start --run-examples`. diff --git a/examples/index_pattern_field_editor_example/kibana.json b/examples/data_view_field_editor_example/kibana.json similarity index 55% rename from examples/index_pattern_field_editor_example/kibana.json rename to examples/data_view_field_editor_example/kibana.json index 680f75e8ee4fa..8d079d10fbc72 100644 --- a/examples/index_pattern_field_editor_example/kibana.json +++ b/examples/data_view_field_editor_example/kibana.json @@ -1,15 +1,15 @@ { - "id": "indexPatternFieldEditorExample", + "id": "dataViewFieldEditorExample", "kibanaVersion": "kibana", "version": "0.0.1", "server": false, "ui": true, - "requiredPlugins": ["data", "indexPatternFieldEditor", "developerExamples"], + "requiredPlugins": ["data", "dataViewFieldEditor", "developerExamples"], "optionalPlugins": [], "requiredBundles": [], "owner": { "name": "App Services", "githubTeam": "kibana-app-services" }, - "description": "Index pattern field editor example app" + "description": "Data view field editor example app" } diff --git a/examples/index_pattern_field_editor_example/public/app.tsx b/examples/data_view_field_editor_example/public/app.tsx similarity index 83% rename from examples/index_pattern_field_editor_example/public/app.tsx rename to examples/data_view_field_editor_example/public/app.tsx index bd725759380aa..ac7e3b60482e0 100644 --- a/examples/index_pattern_field_editor_example/public/app.tsx +++ b/examples/data_view_field_editor_example/public/app.tsx @@ -25,14 +25,14 @@ import { IndexPattern, IndexPatternField, } from '../../../src/plugins/data/public'; -import { IndexPatternFieldEditorStart } from '../../../src/plugins/index_pattern_field_editor/public'; +import { IndexPatternFieldEditorStart } from '../../../src/plugins/data_view_field_editor/public'; interface Props { indexPattern?: IndexPattern; - indexPatternFieldEditor: IndexPatternFieldEditorStart; + dataViewFieldEditor: IndexPatternFieldEditorStart; } -const IndexPatternFieldEditorExample = ({ indexPattern, indexPatternFieldEditor }: Props) => { +const IndexPatternFieldEditorExample = ({ indexPattern, dataViewFieldEditor }: Props) => { const [fields, setFields] = useState( indexPattern?.getNonScriptedFields() || [] ); @@ -52,8 +52,8 @@ const IndexPatternFieldEditorExample = ({ indexPattern, indexPatternFieldEditor type: 'icon', 'data-test-subj': 'editField', onClick: (fld: IndexPatternField) => - indexPatternFieldEditor.openEditor({ - ctx: { indexPattern: indexPattern! }, + dataViewFieldEditor.openEditor({ + ctx: { dataView: indexPattern! }, fieldName: fld.name, onSave: refreshFields, }), @@ -66,10 +66,10 @@ const IndexPatternFieldEditorExample = ({ indexPattern, indexPatternFieldEditor 'data-test-subj': 'deleteField', available: (fld) => !!fld.runtimeField, onClick: (fld: IndexPatternField) => - indexPatternFieldEditor.openDeleteModal({ + dataViewFieldEditor.openDeleteModal({ fieldName: fld.name, ctx: { - indexPattern: indexPattern!, + dataView: indexPattern!, }, onDelete: refreshFields, }), @@ -84,8 +84,8 @@ const IndexPatternFieldEditorExample = ({ indexPattern, indexPatternFieldEditor

- indexPatternFieldEditor.openEditor({ - ctx: { indexPattern: indexPattern! }, + dataViewFieldEditor.openEditor({ + ctx: { dataView: indexPattern! }, onSave: refreshFields, }) } @@ -125,18 +125,18 @@ const IndexPatternFieldEditorExample = ({ indexPattern, indexPatternFieldEditor interface RenderAppDependencies { data: DataPublicPluginStart; - indexPatternFieldEditor: IndexPatternFieldEditorStart; + dataViewFieldEditor: IndexPatternFieldEditorStart; } export const renderApp = async ( - { data, indexPatternFieldEditor }: RenderAppDependencies, + { data, dataViewFieldEditor }: RenderAppDependencies, { element }: AppMountParameters ) => { const indexPattern = (await data.indexPatterns.getDefault()) || undefined; ReactDOM.render( , element ); diff --git a/examples/index_pattern_field_editor_example/public/index.ts b/examples/data_view_field_editor_example/public/index.ts similarity index 100% rename from examples/index_pattern_field_editor_example/public/index.ts rename to examples/data_view_field_editor_example/public/index.ts diff --git a/examples/index_pattern_field_editor_example/public/plugin.tsx b/examples/data_view_field_editor_example/public/plugin.tsx similarity index 95% rename from examples/index_pattern_field_editor_example/public/plugin.tsx rename to examples/data_view_field_editor_example/public/plugin.tsx index ffd93c8a0735f..92d18030e19b8 100644 --- a/examples/index_pattern_field_editor_example/public/plugin.tsx +++ b/examples/data_view_field_editor_example/public/plugin.tsx @@ -9,11 +9,11 @@ import { Plugin, CoreSetup, AppMountParameters, AppNavLinkStatus } from '../../../src/core/public'; import { DeveloperExamplesSetup } from '../../developer_examples/public'; import { DataPublicPluginStart } from '../../../src/plugins/data/public'; -import { IndexPatternFieldEditorStart } from '../../../src/plugins/index_pattern_field_editor/public'; +import { IndexPatternFieldEditorStart } from '../../../src/plugins/data_view_field_editor/public'; interface StartDeps { data: DataPublicPluginStart; - indexPatternFieldEditor: IndexPatternFieldEditorStart; + dataViewFieldEditor: IndexPatternFieldEditorStart; } interface SetupDeps { diff --git a/examples/index_pattern_field_editor_example/tsconfig.json b/examples/data_view_field_editor_example/tsconfig.json similarity index 85% rename from examples/index_pattern_field_editor_example/tsconfig.json rename to examples/data_view_field_editor_example/tsconfig.json index f11ca18fc1a82..62172718cc842 100644 --- a/examples/index_pattern_field_editor_example/tsconfig.json +++ b/examples/data_view_field_editor_example/tsconfig.json @@ -14,7 +14,7 @@ { "path": "../../src/core/tsconfig.json" }, { "path": "../../src/plugins/kibana_react/tsconfig.json" }, { "path": "../../src/plugins/data/tsconfig.json" }, - { "path": "../../src/plugins/index_pattern_field_editor/tsconfig.json" }, + { "path": "../../src/plugins/data_view_field_editor/tsconfig.json" }, { "path": "../developer_examples/tsconfig.json" }, ] } diff --git a/examples/expressions_explorer/public/inspector/expressions_inspector_view.tsx b/examples/expressions_explorer/public/inspector/expressions_inspector_view.tsx index 1b86017a92005..d05ab5d279d0d 100644 --- a/examples/expressions_explorer/public/inspector/expressions_inspector_view.tsx +++ b/examples/expressions_explorer/public/inspector/expressions_inspector_view.tsx @@ -8,7 +8,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiEmptyPrompt } from '@elastic/eui'; import { InspectorViewProps, Adapters } from '../../../../src/plugins/inspector/public'; import { AstDebugView } from './ast_debug_view'; diff --git a/examples/field_formats_example/common/example_currency_format.ts b/examples/field_formats_example/common/example_currency_format.ts new file mode 100644 index 0000000000000..18ff46892a02c --- /dev/null +++ b/examples/field_formats_example/common/example_currency_format.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 { KBN_FIELD_TYPES } from '@kbn/field-types'; +import { FieldFormat } from '../../../src/plugins/field_formats/common'; + +// 1. Create a custom formatter by extending {@link FieldFormat} +export class ExampleCurrencyFormat extends FieldFormat { + static id = 'example-currency'; + static title = 'Currency (example)'; + + // 2. Specify field types that this formatter supports + static fieldType = KBN_FIELD_TYPES.NUMBER; + + // Or pass an array in case supports multiple types + // static fieldType = [KBN_FIELD_TYPES.NUMBER, KBN_FIELD_TYPES.DATE]; + + // 3. This formats support a `currency` param. Use `EUR` as a default. + getParamDefaults() { + return { + currency: 'EUR', + }; + } + + // 4. Implement a conversion function + textConvert = (val: unknown) => { + if (typeof val !== 'number') return `${val}`; + + return new Intl.NumberFormat(undefined, { + style: 'currency', + currency: this.param('currency'), + }).format(val); + }; +} diff --git a/src/plugins/kibana_legacy/public/notify/index.ts b/examples/field_formats_example/common/index.ts similarity index 84% rename from src/plugins/kibana_legacy/public/notify/index.ts rename to examples/field_formats_example/common/index.ts index d4dcaa77cc47a..f2d04e195d2d8 100644 --- a/src/plugins/kibana_legacy/public/notify/index.ts +++ b/examples/field_formats_example/common/index.ts @@ -6,4 +6,4 @@ * Side Public License, v 1. */ -export * from './lib'; +export { ExampleCurrencyFormat } from './example_currency_format'; diff --git a/examples/field_formats_example/kibana.json b/examples/field_formats_example/kibana.json index a33375e661197..e3bca1b2fcb9e 100644 --- a/examples/field_formats_example/kibana.json +++ b/examples/field_formats_example/kibana.json @@ -3,10 +3,11 @@ "version": "1.0.0", "kibanaVersion": "kibana", "ui": true, + "server": true, "owner": { "name": "App Services", "githubTeam": "kibana-app-services" }, "description": "A plugin that demonstrates field formats usage", - "requiredPlugins": ["developerExamples", "fieldFormats", "indexPatternFieldEditor", "data"] + "requiredPlugins": ["developerExamples", "fieldFormats", "dataViewFieldEditor", "data"] } diff --git a/examples/field_formats_example/public/app.tsx b/examples/field_formats_example/public/app.tsx index ce4995672d227..f3ec0b15d2ab4 100644 --- a/examples/field_formats_example/public/app.tsx +++ b/examples/field_formats_example/public/app.tsx @@ -29,7 +29,11 @@ import * as example2 from './examples/2_creating_custom_formatter'; // @ts-ignore import example1SampleCode from '!!raw-loader!./examples/1_using_existing_format'; // @ts-ignore -import example2SampleCode from '!!raw-loader!./examples/2_creating_custom_formatter'; +import example2SampleCodePart1 from '!!raw-loader!../common/example_currency_format'; +// @ts-ignore +import example2SampleCodePart2 from '!!raw-loader!./examples/2_creating_custom_formatter'; +// @ts-ignore +import example2SampleCodePart3 from '!!raw-loader!../server/examples/2_creating_custom_formatter'; // @ts-ignore import example3SampleCode from '!!raw-loader!./examples/3_creating_custom_format_editor'; @@ -88,11 +92,16 @@ const CreatingCustomFieldFormat: React.FC<{ deps: Deps }> = (props) => {

This example shows how to create a custom field formatter. As an example, we create a - currency formatter and then display some values as USD. + currency formatter and then display some values as USD. Custom field + formatter has to be registered both client and server side.

- {example2SampleCode} + {example2SampleCodePart1} + + {example2SampleCodePart2} + + {example2SampleCodePart3} { - if (typeof val !== 'number') return `${val}`; - - return new Intl.NumberFormat(undefined, { - style: 'currency', - currency: this.param('currency'), - }).format(val); - }; -} +import { ExampleCurrencyFormat } from '../../common'; export function registerExampleFormat(fieldFormats: FieldFormatsSetup) { - // 5. Register a field format. This should happen in setup plugin lifecycle phase. + // 5.1 Register a field format. This should happen in setup plugin lifecycle phase. fieldFormats.register([ExampleCurrencyFormat]); } +// 5.2 also register a field formatter with the same `formatId` server-side. +// This is required for some server-side features like CSV export, +// see: examples/field_formats_example/public/examples/2_creating_custom_formatter.ts + // 6. Now let's apply the formatter to some sample values export function getSample(fieldFormats: FieldFormatsStart) { const exampleSerializedFieldFormat: SerializedFieldFormat<{ currency: string }> = { diff --git a/examples/field_formats_example/public/examples/3_creating_custom_format_editor.tsx b/examples/field_formats_example/public/examples/3_creating_custom_format_editor.tsx index dc2135c94985c..e0863a952f8b3 100644 --- a/examples/field_formats_example/public/examples/3_creating_custom_format_editor.tsx +++ b/examples/field_formats_example/public/examples/3_creating_custom_format_editor.tsx @@ -12,8 +12,8 @@ import { FieldFormatEditor, FieldFormatEditorFactory, IndexPatternFieldEditorSetup, -} from '../../../../src/plugins/index_pattern_field_editor/public'; -import { ExampleCurrencyFormat } from './2_creating_custom_formatter'; +} from '../../../../src/plugins/data_view_field_editor/public'; +import { ExampleCurrencyFormat } from '../../common'; // 1. Create an editor component // NOTE: the `params` field is not type checked and a consumer has to know the `param` format that a particular `formatId` expects, diff --git a/examples/field_formats_example/public/plugin.tsx b/examples/field_formats_example/public/plugin.tsx index 5019fc6da1be2..b12304c4ce080 100755 --- a/examples/field_formats_example/public/plugin.tsx +++ b/examples/field_formats_example/public/plugin.tsx @@ -22,7 +22,7 @@ import { registerExampleFormat } from './examples/2_creating_custom_formatter'; import { IndexPatternFieldEditorStart, IndexPatternFieldEditorSetup, -} from '../../../src/plugins/index_pattern_field_editor/public'; +} from '../../../src/plugins/data_view_field_editor/public'; import { DataPublicPluginStart } from '../../../src/plugins/data/public'; import { registerExampleFormatEditor } from './examples/3_creating_custom_format_editor'; import img from './formats.png'; @@ -30,19 +30,19 @@ import img from './formats.png'; interface SetupDeps { developerExamples: DeveloperExamplesSetup; fieldFormats: FieldFormatsSetup; - indexPatternFieldEditor: IndexPatternFieldEditorSetup; + dataViewFieldEditor: IndexPatternFieldEditorSetup; } interface StartDeps { fieldFormats: FieldFormatsStart; - indexPatternFieldEditor: IndexPatternFieldEditorStart; + dataViewFieldEditor: IndexPatternFieldEditorStart; data: DataPublicPluginStart; } export class FieldFormatsExamplePlugin implements Plugin { public setup(core: CoreSetup, deps: SetupDeps) { registerExampleFormat(deps.fieldFormats); - registerExampleFormatEditor(deps.indexPatternFieldEditor); + registerExampleFormatEditor(deps.dataViewFieldEditor); // just for demonstration purposes: // opens a field editor using default index pattern and first number field @@ -65,9 +65,9 @@ export class FieldFormatsExamplePlugin implements Plugin new KibanaLegacyPlugin(); - -export * from './plugin'; -export * from './notify'; +export function plugin() { + return new FieldFormatsExamplePlugin(); +} diff --git a/examples/field_formats_example/server/plugin.ts b/examples/field_formats_example/server/plugin.ts new file mode 100644 index 0000000000000..2163e0fc6e9fe --- /dev/null +++ b/examples/field_formats_example/server/plugin.ts @@ -0,0 +1,29 @@ +/* + * 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, CoreStart, Plugin } from '../../../src/core/server'; +import { FieldFormatsSetup, FieldFormatsStart } from '../../../src/plugins/field_formats/server'; +import { registerExampleFormat } from './examples/2_creating_custom_formatter'; + +interface SetupDeps { + fieldFormats: FieldFormatsSetup; +} + +interface StartDeps { + fieldFormats: FieldFormatsStart; +} + +export class FieldFormatsExamplePlugin implements Plugin { + public setup(core: CoreSetup, deps: SetupDeps) { + registerExampleFormat(deps.fieldFormats); + } + public start(core: CoreStart) { + return {}; + } + public stop() {} +} diff --git a/examples/field_formats_example/tsconfig.json b/examples/field_formats_example/tsconfig.json index a0b609c95bae1..66b059df68943 100644 --- a/examples/field_formats_example/tsconfig.json +++ b/examples/field_formats_example/tsconfig.json @@ -18,6 +18,6 @@ { "path": "../developer_examples/tsconfig.json" }, { "path": "../../src/plugins/field_formats/tsconfig.json" }, { "path": "../../src/plugins/data/tsconfig.json" }, - { "path": "../../src/plugins/index_pattern_field_editor/tsconfig.json" } + { "path": "../../src/plugins/data_view_field_editor/tsconfig.json" } ] } diff --git a/examples/index_pattern_field_editor_example/README.md b/examples/index_pattern_field_editor_example/README.md deleted file mode 100644 index 35ae814fc10e2..0000000000000 --- a/examples/index_pattern_field_editor_example/README.md +++ /dev/null @@ -1,7 +0,0 @@ -## index pattern field editor example - -This example index pattern field editor app shows how to: - - Edit index pattern fields via flyout - - Delete index pattern runtime fields with modal confirm prompt - -To run this example, use the command `yarn start --run-examples`. \ No newline at end of file diff --git a/examples/screenshot_mode_example/public/components/app.tsx b/examples/screenshot_mode_example/public/components/app.tsx index c50eaf5b52568..10dcf05870415 100644 --- a/examples/screenshot_mode_example/public/components/app.tsx +++ b/examples/screenshot_mode_example/public/components/app.tsx @@ -8,7 +8,7 @@ import React, { useEffect } from 'react'; import { BrowserRouter as Router } from 'react-router-dom'; -import { FormattedMessage, I18nProvider } from '@kbn/i18n/react'; +import { FormattedMessage, I18nProvider } from '@kbn/i18n-react'; import { EuiPage, diff --git a/examples/search_examples/public/application.tsx b/examples/search_examples/public/application.tsx index 4e5212b6f76a2..c77c3c24be147 100644 --- a/examples/search_examples/public/application.tsx +++ b/examples/search_examples/public/application.tsx @@ -9,7 +9,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { Router, Route, Redirect } from 'react-router-dom'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { AppMountParameters, CoreStart } from '../../../src/core/public'; import { AppPluginStartDependencies } from './types'; import { SearchExamplePage, ExampleLink } from './common/example_page'; diff --git a/examples/search_examples/public/search/app.tsx b/examples/search_examples/public/search/app.tsx index bfb41160ae963..1f8cda9443fa7 100644 --- a/examples/search_examples/public/search/app.tsx +++ b/examples/search_examples/public/search/app.tsx @@ -8,7 +8,7 @@ import React, { useState, useEffect } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, diff --git a/examples/search_examples/public/search_sessions/app.tsx b/examples/search_examples/public/search_sessions/app.tsx index c953da0895ccd..b5b38df7a548e 100644 --- a/examples/search_examples/public/search_sessions/app.tsx +++ b/examples/search_examples/public/search_sessions/app.tsx @@ -299,6 +299,7 @@ export const SearchSessionsExampleApp = ({ setIndexPattern(id); }} isClearable={false} + data-test-subj="indexPatternSelector" /> @@ -313,6 +314,7 @@ export const SearchSessionsExampleApp = ({ setNumericFieldName(fld?.name); }} sortMatchesBy="startsWith" + data-test-subj="searchMetricField" /> diff --git a/package.json b/package.json index d56fe68b2e074..df39dd8c65d7e 100644 --- a/package.json +++ b/package.json @@ -74,6 +74,7 @@ "yarn": "^1.21.1" }, "resolutions": { + "**/@babel/runtime": "^7.16.3", "**/@types/node": "16.10.2", "**/chokidar": "^3.4.3", "**/deepmerge": "^4.2.2", @@ -99,7 +100,7 @@ "@elastic/apm-rum": "^5.9.1", "@elastic/apm-rum-react": "^1.3.1", "@elastic/apm-synthtrace": "link:bazel-bin/packages/elastic-apm-synthtrace", - "@elastic/charts": "39.0.2", + "@elastic/charts": "40.0.0", "@elastic/datemath": "link:bazel-bin/packages/elastic-datemath", "@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.35", "@elastic/ems-client": "8.0.0", @@ -135,6 +136,7 @@ "@kbn/es-query": "link:bazel-bin/packages/kbn-es-query", "@kbn/field-types": "link:bazel-bin/packages/kbn-field-types", "@kbn/i18n": "link:bazel-bin/packages/kbn-i18n", + "@kbn/i18n-react": "link:bazel-bin/packages/kbn-i18n-react", "@kbn/interpreter": "link:bazel-bin/packages/kbn-interpreter", "@kbn/io-ts-utils": "link:bazel-bin/packages/kbn-io-ts-utils", "@kbn/logging": "link:bazel-bin/packages/kbn-logging", @@ -184,9 +186,9 @@ "@turf/distance": "6.0.1", "@turf/helpers": "6.0.1", "@turf/length": "^6.0.2", + "@types/jsonwebtoken": "^8.5.6", "JSONStream": "1.3.5", "abort-controller": "^3.0.0", - "abortcontroller-polyfill": "^1.7.3", "antlr4ts": "^0.5.0-alpha.3", "archiver": "^5.2.0", "axios": "^0.21.1", @@ -467,21 +469,22 @@ "@microsoft/api-extractor": "7.18.19", "@octokit/rest": "^16.35.0", "@percy/agent": "^0.28.6", - "@storybook/addon-a11y": "^6.1.20", - "@storybook/addon-actions": "^6.1.20", - "@storybook/addon-docs": "^6.1.20", - "@storybook/addon-essentials": "^6.1.20", - "@storybook/addon-knobs": "^6.1.20", - "@storybook/addon-storyshots": "^6.1.20", - "@storybook/addons": "^6.1.20", - "@storybook/api": "^6.1.20", - "@storybook/components": "^6.1.20", - "@storybook/core": "^6.1.20", - "@storybook/core-events": "^6.1.20", - "@storybook/node-logger": "^6.1.20", - "@storybook/react": "^6.1.20", - "@storybook/testing-react": "^0.0.17", - "@storybook/theming": "^6.1.20", + "@storybook/addon-a11y": "^6.3.12", + "@storybook/addon-actions": "^6.3.12", + "@storybook/addon-docs": "^6.3.12", + "@storybook/addon-essentials": "^6.3.12", + "@storybook/addon-knobs": "^6.3.1", + "@storybook/addon-storyshots": "^6.3.12", + "@storybook/addons": "^6.3.12", + "@storybook/api": "^6.3.12", + "@storybook/components": "^6.3.12", + "@storybook/core": "^6.3.12", + "@storybook/core-common": "^6.3.12", + "@storybook/core-events": "^6.3.12", + "@storybook/node-logger": "^6.3.12", + "@storybook/react": "^6.3.12", + "@storybook/testing-react": "^0.0.22", + "@storybook/theming": "^6.3.12", "@testing-library/dom": "^7.30.3", "@testing-library/jest-dom": "^5.11.10", "@testing-library/react": "^11.2.6", @@ -516,6 +519,7 @@ "@types/elasticsearch": "^5.0.33", "@types/enzyme": "^3.10.8", "@types/eslint": "^7.28.0", + "@types/express": "^4.17.13", "@types/extract-zip": "^1.6.2", "@types/faker": "^5.1.5", "@types/fancy-log": "^1.3.1", @@ -552,6 +556,8 @@ "@types/json-stable-stringify": "^1.0.32", "@types/json5": "^0.0.30", "@types/kbn__ace": "link:bazel-bin/packages/kbn-ace/npm_module_types", + "@types/kbn__i18n": "link:bazel-bin/packages/kbn-i18n/npm_module_types", + "@types/kbn__i18n-react": "link:bazel-bin/packages/kbn-i18n-react/npm_module_types", "@types/license-checker": "15.0.0", "@types/listr": "^0.14.0", "@types/loader-utils": "^1.1.3", @@ -639,6 +645,7 @@ "@types/write-pkg": "^3.1.0", "@types/xml-crypto": "^1.4.2", "@types/xml2js": "^0.4.5", + "@types/yargs": "^15.0.0", "@types/yauzl": "^2.9.1", "@types/zen-observable": "^0.8.0", "@typescript-eslint/eslint-plugin": "^5.2.0", @@ -664,7 +671,7 @@ "callsites": "^3.1.0", "chai": "3.5.0", "chance": "1.0.18", - "chromedriver": "^95.0.0", + "chromedriver": "^96.0.0", "clean-webpack-plugin": "^3.0.0", "cmd-shim": "^2.1.0", "compression-webpack-plugin": "^4.0.0", diff --git a/packages/BUILD.bazel b/packages/BUILD.bazel index 893216f060b9c..07513ac94c85d 100644 --- a/packages/BUILD.bazel +++ b/packages/BUILD.bazel @@ -27,6 +27,7 @@ filegroup( "//packages/kbn-expect:build", "//packages/kbn-field-types:build", "//packages/kbn-i18n:build", + "//packages/kbn-i18n-react:build", "//packages/kbn-interpreter:build", "//packages/kbn-io-ts-utils:build", "//packages/kbn-logging:build", @@ -77,6 +78,8 @@ filegroup( "//packages/elastic-apm-synthtrace:build_types", "//packages/elastic-datemath:build_types", "//packages/kbn-ace:build_types", + "//packages/kbn-i18n:build_types", + "//packages/kbn-i18n-react:build_types", ], ) diff --git a/packages/elastic-eslint-config-kibana/.eslintrc.js b/packages/elastic-eslint-config-kibana/.eslintrc.js index bc7b7aeed0499..dc95601fadd1a 100644 --- a/packages/elastic-eslint-config-kibana/.eslintrc.js +++ b/packages/elastic-eslint-config-kibana/.eslintrc.js @@ -79,8 +79,8 @@ module.exports = { }, { from: 'react-intl', - to: '@kbn/i18n/react', - disallowedMessage: `import from @kbn/i18n/react instead` + to: '@kbn/i18n-react', + disallowedMessage: `import from @kbn/i18n-react instead` }, { from: 'styled-components', @@ -105,5 +105,6 @@ module.exports = { '@kbn/eslint/no_async_foreach': 'error', '@kbn/eslint/no_trailing_import_slash': 'error', '@kbn/eslint/no_constructor_args_in_property_initializers': 'error', + '@kbn/eslint/no_this_in_property_initializers': 'error', }, }; diff --git a/packages/kbn-alerts/BUILD.bazel b/packages/kbn-alerts/BUILD.bazel index 91c575346fff7..e567c18807dfc 100644 --- a/packages/kbn-alerts/BUILD.bazel +++ b/packages/kbn-alerts/BUILD.bazel @@ -38,9 +38,10 @@ RUNTIME_DEPS = [ ] TYPES_DEPS = [ - "//packages/kbn-i18n", + "//packages/kbn-i18n:npm_module_types", "@npm//@elastic/eui", "@npm//resize-observer-polyfill", + "@npm//tslib", "@npm//@types/enzyme", "@npm//@types/jest", "@npm//@types/node", diff --git a/packages/kbn-apm-config-loader/BUILD.bazel b/packages/kbn-apm-config-loader/BUILD.bazel index 8fb513a746ec3..731876d5b550c 100644 --- a/packages/kbn-apm-config-loader/BUILD.bazel +++ b/packages/kbn-apm-config-loader/BUILD.bazel @@ -36,11 +36,12 @@ RUNTIME_DEPS = [ TYPES_DEPS = [ "//packages/elastic-safer-lodash-set", "//packages/kbn-utils", - "@npm//elastic-apm-node", + "@npm//@elastic/apm-rum", "@npm//@types/jest", "@npm//@types/js-yaml", "@npm//@types/lodash", "@npm//@types/node", + "@npm//elastic-apm-node", ] jsts_transpiler( diff --git a/packages/kbn-apm-config-loader/src/config.test.ts b/packages/kbn-apm-config-loader/src/config.test.ts index b0beebfefd6bd..265362fa8f166 100644 --- a/packages/kbn-apm-config-loader/src/config.test.ts +++ b/packages/kbn-apm-config-loader/src/config.test.ts @@ -95,8 +95,9 @@ describe('ApmConfiguration', () => { "globalLabels": Object {}, "logUncaughtExceptions": true, "metricsInterval": "30s", - "secretToken": "7YKhoXsO4MzjhXjx2c", - "serverUrl": "https://kibana-ci-apm.apm.us-central1.gcp.cloud.es.io", + "propagateTracestate": true, + "secretToken": "JpBCcOQxN81D5yucs2", + "serverUrl": "https://kibana-cloud-apm.apm.us-east-1.aws.found.io", "serviceName": "serviceName", "serviceVersion": "8.0.0", "transactionSampleRate": 1, @@ -119,11 +120,12 @@ describe('ApmConfiguration', () => { }, "logUncaughtExceptions": true, "metricsInterval": "120s", - "secretToken": "7YKhoXsO4MzjhXjx2c", - "serverUrl": "https://kibana-ci-apm.apm.us-central1.gcp.cloud.es.io", + "propagateTracestate": true, + "secretToken": "JpBCcOQxN81D5yucs2", + "serverUrl": "https://kibana-cloud-apm.apm.us-east-1.aws.found.io", "serviceName": "serviceName", "serviceVersion": "8.0.0", - "transactionSampleRate": 1, + "transactionSampleRate": 0.1, } `); }); diff --git a/packages/kbn-apm-config-loader/src/config.ts b/packages/kbn-apm-config-loader/src/config.ts index ecafcbd7e3261..6cc0bcdb3f84a 100644 --- a/packages/kbn-apm-config-loader/src/config.ts +++ b/packages/kbn-apm-config-loader/src/config.ts @@ -13,6 +13,7 @@ import { execSync } from 'child_process'; import { getDataPath } from '@kbn/utils'; import { readFileSync } from 'fs'; import type { AgentConfigOptions } from 'elastic-apm-node'; +import type { AgentConfigOptions as RUMAgentConfigOptions } from '@elastic/apm-rum'; // https://www.elastic.co/guide/en/apm/agent/nodejs/current/configuration.html const DEFAULT_CONFIG: AgentConfigOptions = { @@ -23,28 +24,30 @@ const DEFAULT_CONFIG: AgentConfigOptions = { globalLabels: {}, }; -const CENTRALIZED_SERVICE_BASE_CONFIG: AgentConfigOptions = { - serverUrl: 'https://kibana-ci-apm.apm.us-central1.gcp.cloud.es.io', +const CENTRALIZED_SERVICE_BASE_CONFIG: AgentConfigOptions | RUMAgentConfigOptions = { + serverUrl: 'https://kibana-cloud-apm.apm.us-east-1.aws.found.io', // The secretToken below is intended to be hardcoded in this file even though // it makes it public. This is not a security/privacy issue. Normally we'd // instead disable the need for a secretToken in the APM Server config where // the data is transmitted to, but due to how it's being hosted, it's easier, // for now, to simply leave it in. - secretToken: '7YKhoXsO4MzjhXjx2c', + secretToken: 'JpBCcOQxN81D5yucs2', + breakdownMetrics: true, + captureSpanStackTraces: false, centralConfig: false, metricsInterval: '30s', - captureSpanStackTraces: false, + propagateTracestate: true, transactionSampleRate: 1.0, - breakdownMetrics: true, }; const CENTRALIZED_SERVICE_DIST_CONFIG: AgentConfigOptions = { - metricsInterval: '120s', + breakdownMetrics: false, captureBody: 'off', captureHeaders: false, - breakdownMetrics: false, + metricsInterval: '120s', + transactionSampleRate: 0.1, }; export class ApmConfiguration { @@ -222,10 +225,11 @@ export class ApmConfiguration { return { globalLabels: { branch: process.env.GIT_BRANCH || '', - targetBranch: process.env.PR_TARGET_BRANCH || '', - ciBuildNumber: process.env.BUILD_NUMBER || '', - isPr: process.env.GITHUB_PR_NUMBER ? true : false, - prId: process.env.GITHUB_PR_NUMBER || '', + targetBranch: process.env.GITHUB_PR_TARGET_BRANCH || '', + ciBuildNumber: process.env.BUILDKITE_BUILD_NUMBER || '', + ciBuildId: process.env.BUILDKITE_BUILD_ID || '', + isPr: process.env.BUILDKITE_PULL_REQUEST ? true : false, + prId: process.env.BUILDKITE_PULL_REQUEST || '', }, }; } diff --git a/packages/kbn-config/BUILD.bazel b/packages/kbn-config/BUILD.bazel index e0cf4d2205d65..061b8306bcc6f 100644 --- a/packages/kbn-config/BUILD.bazel +++ b/packages/kbn-config/BUILD.bazel @@ -49,7 +49,7 @@ TYPES_DEPS = [ "//packages/kbn-logging", "//packages/kbn-std", "//packages/kbn-utility-types", - "//packages/kbn-i18n", + "//packages/kbn-i18n:npm_module_types", "@npm//load-json-file", "@npm//rxjs", "@npm//@types/jest", diff --git a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_basic_api_declaration.ts b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_basic_api_declaration.ts index 0066e0df96f6a..d9538467a0984 100644 --- a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_basic_api_declaration.ts +++ b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/build_basic_api_declaration.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { JSDocTag, Node } from 'ts-morph'; +import { JSDocTag, Node, TypeFormatFlags } from 'ts-morph'; import { ApiDeclaration } from '../types'; import { maybeCollectReferences } from './get_references'; import { getSignature } from './get_signature'; @@ -24,12 +24,26 @@ export function buildBasicApiDeclaration(node: Node, opts: BuildApiDecOpts): Api const deprecated = tags.find((t) => t.getTagName() === 'deprecated') !== undefined; const removeByTag = tags.find((t) => t.getTagName() === 'removeBy'); + let label = opts.name; + + if (Node.isIndexSignatureDeclaration(node)) { + // These nodes never have a name, so the label will just equal "Unnamed". + if (label !== 'Unnamed') { + throw new Error(`Assumption is incorrect! Index signature with name: ${label}.`); + } + + // If we could include links in label names, we could just use `getSignature`. + label = `[${node.getKeyName()}: ${node.getKeyType().getText()}]: ${node + .getReturnType() + .getText(undefined, TypeFormatFlags.OmitParameterModifiers)}`; + } + const apiDec = { parentPluginId: opts.currentPluginId, id: opts.id, type: getTypeKind(node), tags: getTagNames(tags), - label: opts.name, + label, description: getCommentsFromNode(node), signature: getSignature(node, opts.plugins, opts.log), path: getSourceForNode(node), diff --git a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/get_signature.ts b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/get_signature.ts index 46fe93e49e448..81daa3bb5df6d 100644 --- a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/get_signature.ts +++ b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/get_signature.ts @@ -33,7 +33,11 @@ export function getSignature( log: ToolingLog ): Array | undefined { let signature = ''; - if (Node.isFunctionDeclaration(node)) { + if (Node.isIndexSignatureDeclaration(node)) { + signature = `[${node.getKeyName()}: ${node.getKeyType().getText()}]: ${node + .getReturnType() + .getText()}`; + } else if (Node.isFunctionDeclaration(node)) { // See https://github.com/dsherret/ts-morph/issues/907#issue-770284331. // Unfortunately this has to be manually pieced together, or it comes up as "typeof TheFunction" const params = node diff --git a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/get_type_kind.ts b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/get_type_kind.ts index 592833f40cebf..11110fbe4c6e1 100644 --- a/packages/kbn-docs-utils/src/api_docs/build_api_declarations/get_type_kind.ts +++ b/packages/kbn-docs-utils/src/api_docs/build_api_declarations/get_type_kind.ts @@ -10,7 +10,12 @@ import { Type, Node } from 'ts-morph'; import { TypeKind } from '../types'; export function getTypeKind(node: Node): TypeKind { - if (Node.isTypeAliasDeclaration(node)) { + if (Node.isIndexSignatureDeclaration(node)) { + return TypeKind.IndexSignature; + } else if (Node.isConstructorDeclaration(node)) { + // For some reason constructors come back as Any type. + return TypeKind.FunctionKind; + } else if (Node.isTypeAliasDeclaration(node)) { return TypeKind.TypeKind; } else { return getTypeKindForType(node.getType()); diff --git a/packages/kbn-docs-utils/src/api_docs/build_api_docs_cli.ts b/packages/kbn-docs-utils/src/api_docs/build_api_docs_cli.ts index 4ef3039253e90..2e4ce08540714 100644 --- a/packages/kbn-docs-utils/src/api_docs/build_api_docs_cli.ts +++ b/packages/kbn-docs-utils/src/api_docs/build_api_docs_cli.ts @@ -13,21 +13,14 @@ import { REPO_ROOT, run, CiStatsReporter, createFlagError } from '@kbn/dev-utils import { Project } from 'ts-morph'; import { writePluginDocs } from './mdx/write_plugin_mdx_docs'; -import { - ApiDeclaration, - ApiStats, - MissingApiItemMap, - PluginApi, - PluginMetaInfo, - ReferencedDeprecationsByPlugin, - TypeKind, -} from './types'; +import { ApiDeclaration, PluginMetaInfo } from './types'; import { findPlugins } from './find_plugins'; import { pathsOutsideScopes } from './build_api_declarations/utils'; import { getPluginApiMap } from './get_plugin_api_map'; import { writeDeprecationDocByApi } from './mdx/write_deprecations_doc_by_api'; import { writeDeprecationDocByPlugin } from './mdx/write_deprecations_doc_by_plugin'; import { writePluginDirectoryDoc } from './mdx/write_plugin_directory_doc'; +import { collectApiStatsForPlugin } from './stats'; function isStringArray(arr: unknown | string[]): arr is string[] { return Array.isArray(arr) && arr.every((p) => typeof p === 'string'); @@ -267,72 +260,3 @@ function getTsProject(repoPath: string) { project.resolveSourceFileDependencies(); return project; } - -function collectApiStatsForPlugin( - doc: PluginApi, - missingApiItems: MissingApiItemMap, - deprecations: ReferencedDeprecationsByPlugin -): ApiStats { - const stats: ApiStats = { - missingComments: [], - isAnyType: [], - noReferences: [], - deprecatedAPIsReferencedCount: 0, - apiCount: countApiForPlugin(doc), - missingExports: Object.values(missingApiItems[doc.id] ?? {}).length, - }; - Object.values(doc.client).forEach((def) => { - collectStatsForApi(def, stats, doc); - }); - Object.values(doc.server).forEach((def) => { - collectStatsForApi(def, stats, doc); - }); - Object.values(doc.common).forEach((def) => { - collectStatsForApi(def, stats, doc); - }); - stats.deprecatedAPIsReferencedCount = deprecations[doc.id] ? deprecations[doc.id].length : 0; - return stats; -} - -function collectStatsForApi(doc: ApiDeclaration, stats: ApiStats, pluginApi: PluginApi): void { - const missingComment = doc.description === undefined || doc.description.length === 0; - if (missingComment) { - stats.missingComments.push(doc); - } - if (doc.type === TypeKind.AnyKind) { - stats.isAnyType.push(doc); - } - if (doc.children) { - doc.children.forEach((child) => { - collectStatsForApi(child, stats, pluginApi); - }); - } - if (!doc.references || doc.references.length === 0) { - stats.noReferences.push(doc); - } -} - -function countApiForPlugin(doc: PluginApi) { - return ( - doc.client.reduce((sum, def) => { - return sum + countApi(def); - }, 0) + - doc.server.reduce((sum, def) => { - return sum + countApi(def); - }, 0) + - doc.common.reduce((sum, def) => { - return sum + countApi(def); - }, 0) - ); -} - -function countApi(doc: ApiDeclaration): number { - if (!doc.children) return 1; - else - return ( - 1 + - doc.children.reduce((sum, child) => { - return sum + countApi(child); - }, 0) - ); -} diff --git a/packages/kbn-docs-utils/src/api_docs/mdx/split_apis_by_folder.test.ts b/packages/kbn-docs-utils/src/api_docs/mdx/split_apis_by_folder.test.ts index 993e28aab50a0..022cce8cbfe2d 100644 --- a/packages/kbn-docs-utils/src/api_docs/mdx/split_apis_by_folder.test.ts +++ b/packages/kbn-docs-utils/src/api_docs/mdx/split_apis_by_folder.test.ts @@ -38,7 +38,7 @@ beforeAll(() => { }); test('foo service has all exports', () => { - expect(doc?.client.length).toBe(36); + expect(doc?.client.length).toBe(37); const split = splitApisByFolder(doc); expect(split.length).toBe(2); @@ -47,5 +47,5 @@ test('foo service has all exports', () => { expect(fooDoc?.common.length).toBe(1); expect(fooDoc?.client.length).toBe(2); - expect(mainDoc?.client.length).toBe(34); + expect(mainDoc?.client.length).toBe(35); }); diff --git a/packages/kbn-docs-utils/src/api_docs/stats.ts b/packages/kbn-docs-utils/src/api_docs/stats.ts new file mode 100644 index 0000000000000..8019f186f1426 --- /dev/null +++ b/packages/kbn-docs-utils/src/api_docs/stats.ts @@ -0,0 +1,88 @@ +/* + * 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 { + ApiDeclaration, + ApiStats, + MissingApiItemMap, + PluginApi, + ReferencedDeprecationsByPlugin, + TypeKind, +} from './types'; + +export function collectApiStatsForPlugin( + doc: PluginApi, + missingApiItems: MissingApiItemMap, + deprecations: ReferencedDeprecationsByPlugin +): ApiStats { + const stats: ApiStats = { + missingComments: [], + isAnyType: [], + noReferences: [], + deprecatedAPIsReferencedCount: 0, + apiCount: countApiForPlugin(doc), + missingExports: Object.values(missingApiItems[doc.id] ?? {}).length, + }; + Object.values(doc.client).forEach((def) => { + collectStatsForApi(def, stats, doc); + }); + Object.values(doc.server).forEach((def) => { + collectStatsForApi(def, stats, doc); + }); + Object.values(doc.common).forEach((def) => { + collectStatsForApi(def, stats, doc); + }); + stats.deprecatedAPIsReferencedCount = deprecations[doc.id] ? deprecations[doc.id].length : 0; + return stats; +} + +function collectStatsForApi(doc: ApiDeclaration, stats: ApiStats, pluginApi: PluginApi): void { + const missingComment = doc.description === undefined || doc.description.length === 0; + if (missingComment) { + stats.missingComments.push(doc); + } + + // Any types can be inherited, for example, from an inherited react type. If the any type is coming from + // a package in node_modules, it's beyond our control, so we don't care about it in the stats. + if (doc.type === TypeKind.AnyKind && !doc.path.includes('node_modules')) { + stats.isAnyType.push(doc); + } + if (doc.children) { + doc.children.forEach((child) => { + collectStatsForApi(child, stats, pluginApi); + }); + } + if (!doc.references || doc.references.length === 0) { + stats.noReferences.push(doc); + } +} + +function countApiForPlugin(doc: PluginApi) { + return ( + doc.client.reduce((sum, def) => { + return sum + countApi(def); + }, 0) + + doc.server.reduce((sum, def) => { + return sum + countApi(def); + }, 0) + + doc.common.reduce((sum, def) => { + return sum + countApi(def); + }, 0) + ); +} + +function countApi(doc: ApiDeclaration): number { + if (!doc.children) return 1; + else + return ( + 1 + + doc.children.reduce((sum, child) => { + return sum + countApi(child); + }, 0) + ); +} diff --git a/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/index.ts b/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/index.ts index 89bfb07e515ff..345e85bc044b7 100644 --- a/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/index.ts +++ b/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/index.ts @@ -19,6 +19,11 @@ export * from './types'; export const imAnAny: any = 'hi'; export const imAnUnknown: unknown = 'hi'; +// This kind of type was triggering an `any` type even though it has no anys! +export interface InterfaceWithIndexSignature { + [key: string]: { foo: string }; +} + export function plugin() { return new PluginA(); } diff --git a/packages/kbn-docs-utils/src/api_docs/tests/api_doc_suite.test.ts b/packages/kbn-docs-utils/src/api_docs/tests/api_doc_suite.test.ts index b5e2deb62817a..7708eca0ec67a 100644 --- a/packages/kbn-docs-utils/src/api_docs/tests/api_doc_suite.test.ts +++ b/packages/kbn-docs-utils/src/api_docs/tests/api_doc_suite.test.ts @@ -25,6 +25,7 @@ import { import { getKibanaPlatformPlugin } from './kibana_platform_plugin_mock'; import { groupPluginApi } from '../utils'; import { getPluginApiMap } from '../get_plugin_api_map'; +import { collectApiStatsForPlugin } from '../stats'; const log = new ToolingLog({ level: 'debug', @@ -33,6 +34,8 @@ const log = new ToolingLog({ let doc: PluginApi; let mdxOutputFolder: string; +let pluginAStats: ApiStats; +let pluginBStats: ApiStats; function linkCount(signature: TextWithLinks): number { return signature.reduce((cnt, next) => (typeof next === 'string' ? cnt : cnt + 1), 0); @@ -106,27 +109,38 @@ beforeAll(() => { pluginA.manifest.serviceFolders = ['foo']; const plugins: PluginOrPackage[] = [pluginA, pluginB]; - const { pluginApiMap } = getPluginApiMap(project, plugins, log, { collectReferences: false }); - const pluginStats: ApiStats = { - deprecatedAPIsReferencedCount: 0, - missingComments: [], - isAnyType: [], - noReferences: [], - apiCount: 3, - missingExports: 0, - }; + const { pluginApiMap, missingApiItems, referencedDeprecations } = getPluginApiMap( + project, + plugins, + log, + { collectReferences: false } + ); doc = pluginApiMap.pluginA; + + pluginAStats = collectApiStatsForPlugin(doc, missingApiItems, referencedDeprecations); + pluginBStats = collectApiStatsForPlugin( + pluginApiMap.pluginB, + missingApiItems, + referencedDeprecations + ); + mdxOutputFolder = Path.resolve(__dirname, 'snapshots'); - writePluginDocs(mdxOutputFolder, { doc, plugin: pluginA, pluginStats, log }); + writePluginDocs(mdxOutputFolder, { doc, plugin: pluginA, pluginStats: pluginAStats, log }); writePluginDocs(mdxOutputFolder, { doc: pluginApiMap.pluginB, plugin: pluginB, - pluginStats, + pluginStats: pluginBStats, log, }); }); +it('Stats', () => { + // Type "imAnAny" + expect(pluginAStats.isAnyType.length).toBe(1); + expect(pluginBStats.isAnyType.length).toBe(0); +}); + it('Setup type is extracted', () => { const grouped = groupPluginApi(doc.client); expect(grouped.setup).toBeDefined(); @@ -434,6 +448,14 @@ describe('Types', () => { }); describe('interfaces and classes', () => { + it('Interface with index signature exported correctly', () => { + const anInterface = doc.client.find((c) => c.label === 'InterfaceWithIndexSignature'); + expect(anInterface?.children).toBeDefined(); + expect(anInterface?.children?.length).toBe(1); + expect(anInterface?.children![0].signature).toBeDefined(); + expect(anInterface?.children![0].signature?.length).toBeGreaterThanOrEqual(1); + }); + it('Basic interface exported correctly', () => { const anInterface = doc.client.find((c) => c.label === 'IReturnAReactComponent'); expect(anInterface).toBeDefined(); diff --git a/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.json b/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.json index 37366d84fef21..0eb9438ce594f 100644 --- a/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.json +++ b/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.json @@ -985,6 +985,32 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "pluginA", + "id": "def-public.InterfaceWithIndexSignature", + "type": "Interface", + "tags": [], + "label": "InterfaceWithIndexSignature", + "description": [], + "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/index.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "pluginA", + "id": "def-public.InterfaceWithIndexSignature.Unnamed", + "type": "IndexSignature", + "tags": [], + "label": "[key: string}]: { foo: string; }", + "description": [], + "signature": [ + "[key: string]: { foo: string; }" + ], + "path": "packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/plugin_a/public/index.ts", + "deprecated": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "pluginA", "id": "def-public.IReturnAReactComponent", diff --git a/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.mdx b/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.mdx index 2b2094d3e82e1..44223783ada57 100644 --- a/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.mdx +++ b/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a.mdx @@ -18,7 +18,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3 | 0 | 0 | 0 | +| 131 | 1 | 71 | 2 | ## Client diff --git a/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a_foo.mdx b/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a_foo.mdx index a89e036b64e77..b27d6d2de2f8f 100644 --- a/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a_foo.mdx +++ b/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_a_foo.mdx @@ -18,7 +18,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3 | 0 | 0 | 0 | +| 131 | 1 | 71 | 2 | ## Client diff --git a/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_b.mdx b/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_b.mdx index e78752ef49524..df0dec0054497 100644 --- a/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_b.mdx +++ b/packages/kbn-docs-utils/src/api_docs/tests/snapshots/plugin_b.mdx @@ -18,7 +18,7 @@ Contact Kibana Core for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 3 | 0 | 0 | 0 | +| 2 | 0 | 2 | 0 | ## Client diff --git a/packages/kbn-docs-utils/src/api_docs/types.ts b/packages/kbn-docs-utils/src/api_docs/types.ts index a87613075d651..f494c3b433d18 100644 --- a/packages/kbn-docs-utils/src/api_docs/types.ts +++ b/packages/kbn-docs-utils/src/api_docs/types.ts @@ -33,6 +33,10 @@ export enum TypeKind { ObjectKind = 'Object', EnumKind = 'Enum', InterfaceKind = 'Interface', + /** + * Interface children defined like [key: string]: Foo will be tagged as "any" type by typescript. Let's use a specialized type. + */ + IndexSignature = 'IndexSignature', /** * Maps to the typescript syntax kind `TypeReferences`. For example, * export type FooFn = () => string will be a TypeKind, not a FunctionKind. diff --git a/packages/kbn-es-query/BUILD.bazel b/packages/kbn-es-query/BUILD.bazel index b3d861d937c8b..26d2030d1b0ba 100644 --- a/packages/kbn-es-query/BUILD.bazel +++ b/packages/kbn-es-query/BUILD.bazel @@ -38,13 +38,13 @@ RUNTIME_DEPS = [ "@npm//load-json-file", "@npm//lodash", "@npm//moment-timezone", - "@npm//tslib", ] TYPES_DEPS = [ "//packages/kbn-utility-types", - "//packages/kbn-i18n", + "//packages/kbn-i18n:npm_module_types", "@npm//@elastic/elasticsearch", + "@npm//tslib", "@npm//@types/jest", "@npm//@types/lodash", "@npm//@types/moment-timezone", diff --git a/packages/kbn-eslint-plugin-eslint/index.js b/packages/kbn-eslint-plugin-eslint/index.js index 68ffe96792821..44244f265cd23 100644 --- a/packages/kbn-eslint-plugin-eslint/index.js +++ b/packages/kbn-eslint-plugin-eslint/index.js @@ -17,5 +17,6 @@ module.exports = { no_async_foreach: require('./rules/no_async_foreach'), no_trailing_import_slash: require('./rules/no_trailing_import_slash'), no_constructor_args_in_property_initializers: require('./rules/no_constructor_args_in_property_initializers'), + no_this_in_property_initializers: require('./rules/no_this_in_property_initializers'), }, }; diff --git a/packages/kbn-eslint-plugin-eslint/rules/no_constructor_args_in_property_initializers.js b/packages/kbn-eslint-plugin-eslint/rules/no_constructor_args_in_property_initializers.js index e3666d1cd5fa8..672892730feb1 100644 --- a/packages/kbn-eslint-plugin-eslint/rules/no_constructor_args_in_property_initializers.js +++ b/packages/kbn-eslint-plugin-eslint/rules/no_constructor_args_in_property_initializers.js @@ -79,7 +79,7 @@ module.exports = { node.type === esTypes.FunctionExpression || node.type === esTypes.ArrowFunctionExpression ) { - return traverse.STOP; + return traverse.SKIP; } if ( diff --git a/packages/kbn-eslint-plugin-eslint/rules/no_constructor_args_in_property_initializers.test.js b/packages/kbn-eslint-plugin-eslint/rules/no_constructor_args_in_property_initializers.test.js index af1d15982007d..ca73b8947265e 100644 --- a/packages/kbn-eslint-plugin-eslint/rules/no_constructor_args_in_property_initializers.test.js +++ b/packages/kbn-eslint-plugin-eslint/rules/no_constructor_args_in_property_initializers.test.js @@ -53,7 +53,6 @@ ruleTester.run('@kbn/eslint/no_constructor_args_in_property_initializers', rule, ], invalid: [ - // no catch { code: dedent` class Foo { @@ -96,5 +95,25 @@ ruleTester.run('@kbn/eslint/no_constructor_args_in_property_initializers', rule, }, ], }, + { + code: dedent` + class Foo { + readonly bar = y(this.deps.history).x( + () => { + this.deps.usage() + } + ); + + + constructor(private readonly deps: unknown) {} + } + `, + errors: [ + { + line: 2, + message: `The constructor argument "deps" can't be used in a class property intializer, define the property in the constructor instead`, + }, + ], + }, ], }); diff --git a/packages/kbn-eslint-plugin-eslint/rules/no_this_in_property_initializers.js b/packages/kbn-eslint-plugin-eslint/rules/no_this_in_property_initializers.js new file mode 100644 index 0000000000000..4754dc144bd9b --- /dev/null +++ b/packages/kbn-eslint-plugin-eslint/rules/no_this_in_property_initializers.js @@ -0,0 +1,62 @@ +/* + * 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. + */ + +const tsEstree = require('@typescript-eslint/typescript-estree'); +const traverse = require('eslint-traverse'); +const esTypes = tsEstree.AST_NODE_TYPES; + +/** @typedef {import("eslint").Rule.RuleModule} Rule */ +/** @typedef {import("@typescript-eslint/typescript-estree").TSESTree.Node} Node */ +/** @typedef {import("@typescript-eslint/typescript-estree").TSESTree.ClassBody} ClassBody */ + +/** + * @param {string} arg + */ +const ERROR_MSG = `"this" is not fully initialized in class property intializers, define the value for this property in the constructor instead`; + +/** @type {Rule} */ +module.exports = { + meta: { + schema: [], + }, + create: (context) => ({ + ClassBody(_) { + const node = /** @type {ClassBody} */ (_); + + for (const prop of node.body) { + if (prop.type !== esTypes.PropertyDefinition) { + continue; + } + + const visitor = (path) => { + /** @type {Node} node */ + const node = path.node; + + if ( + node.type === esTypes.FunctionExpression || + node.type === esTypes.ArrowFunctionExpression + ) { + return traverse.STOP; + } + + if ( + node.type === esTypes.ThisExpression && + node.parent?.type !== esTypes.MemberExpression + ) { + context.report({ + message: ERROR_MSG, + loc: node.loc, + }); + } + }; + + traverse(context, prop, visitor); + } + }, + }), +}; diff --git a/packages/kbn-eslint-plugin-eslint/rules/no_this_in_property_initializers.test.js b/packages/kbn-eslint-plugin-eslint/rules/no_this_in_property_initializers.test.js new file mode 100644 index 0000000000000..05a41d09d9ff8 --- /dev/null +++ b/packages/kbn-eslint-plugin-eslint/rules/no_this_in_property_initializers.test.js @@ -0,0 +1,79 @@ +/* + * 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. + */ + +const { RuleTester } = require('eslint'); +const rule = require('./no_this_in_property_initializers'); +const dedent = require('dedent'); + +const ruleTester = new RuleTester({ + parser: require.resolve('@typescript-eslint/parser'), + parserOptions: { + sourceType: 'module', + ecmaVersion: 2018, + ecmaFeatures: { + jsx: true, + }, + }, +}); + +ruleTester.run('@kbn/eslint/no_this_in_property_initializers', rule, { + valid: [ + { + code: dedent` + class Foo { + bar = 'baz' + } + `, + }, + { + code: dedent` + class Foo { + bar = 'baz' + constructor(private readonly foo: Box) {} + } + `, + }, + { + code: dedent` + class Foo { + bar = 'baz' + constructor(private readonly foo: () => void) {} + + get = () => { + return this.foo() + } + } + `, + }, + { + code: dedent` + class Foo { + bar = this.foo.split().reverse() + constructor(private readonly foo: string) {} + } + `, + }, + ], + + invalid: [ + { + code: dedent` + class Foo { + bar = new Bar(this) + constructor(private readonly foo: (() => void) = defaultValue) {} + } + `, + errors: [ + { + line: 2, + message: `"this" is not fully initialized in class property intializers, define the value for this property in the constructor instead`, + }, + ], + }, + ], +}); diff --git a/packages/kbn-i18n-react/BUILD.bazel b/packages/kbn-i18n-react/BUILD.bazel new file mode 100644 index 0000000000000..505afabfa860d --- /dev/null +++ b/packages/kbn-i18n-react/BUILD.bazel @@ -0,0 +1,123 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_BASE_NAME = "kbn-i18n-react" +PKG_REQUIRE_NAME = "@kbn/i18n-react" +TYPES_PKG_REQUIRE_NAME = "@types/kbn__i18n-react" + +SOURCE_FILES = glob( + [ + "src/**/*.ts", + "src/**/*.tsx", + ], + exclude = [ + "**/*.test.*", + "**/__snapshots__/**", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", + "README.md" +] + +RUNTIME_DEPS = [ + "//packages/kbn-i18n", + "@npm//prop-types", + "@npm//react", + "@npm//react-intl" +] + +TYPES_DEPS = [ + "//packages/kbn-i18n:npm_module_types", + "@npm//tslib", + "@npm//@types/jest", + "@npm//@types/node", + "@npm//@types/prop-types", + "@npm//@types/react", + "@npm//@types/react-intl", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), +) + +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + web = True, +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + declaration_map = True, + emit_declaration_only = True, + out_dir = "target_types", + source_map = True, + root_dir = "src", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_BASE_NAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web"], + 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"], +) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = TYPES_PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [ + ":npm_module_types", + ], + visibility = ["//visibility:public"], +) diff --git a/packages/kbn-i18n-react/README.md b/packages/kbn-i18n-react/README.md new file mode 100644 index 0000000000000..63e733d51be38 --- /dev/null +++ b/packages/kbn-i18n-react/README.md @@ -0,0 +1,3 @@ +# I18n-React + +Please check the [@kbn/I18n README](../kbn-i18n/README.md) for all the information diff --git a/packages/kbn-i18n-react/jest.config.js b/packages/kbn-i18n-react/jest.config.js new file mode 100644 index 0000000000000..6fa8016cd8d52 --- /dev/null +++ b/packages/kbn-i18n-react/jest.config.js @@ -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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../..', + roots: ['/packages/kbn-i18n-react'], + testRunner: 'jasmine2', +}; diff --git a/packages/kbn-i18n-react/package.json b/packages/kbn-i18n-react/package.json new file mode 100644 index 0000000000000..3fdadf10a0f03 --- /dev/null +++ b/packages/kbn-i18n-react/package.json @@ -0,0 +1,8 @@ +{ + "name": "@kbn/i18n-react", + "browser": "./target_web/browser.js", + "main": "./target_node/index.js", + "version": "1.0.0", + "license": "SSPL-1.0 OR Elastic License 2.0", + "private": true +} \ No newline at end of file diff --git a/packages/kbn-i18n/src/react/__snapshots__/provider.test.tsx.snap b/packages/kbn-i18n-react/src/__snapshots__/provider.test.tsx.snap similarity index 100% rename from packages/kbn-i18n/src/react/__snapshots__/provider.test.tsx.snap rename to packages/kbn-i18n-react/src/__snapshots__/provider.test.tsx.snap diff --git a/packages/kbn-i18n/src/react/index.tsx b/packages/kbn-i18n-react/src/index.tsx similarity index 100% rename from packages/kbn-i18n/src/react/index.tsx rename to packages/kbn-i18n-react/src/index.tsx diff --git a/packages/kbn-i18n/src/react/inject.tsx b/packages/kbn-i18n-react/src/inject.tsx similarity index 100% rename from packages/kbn-i18n/src/react/inject.tsx rename to packages/kbn-i18n-react/src/inject.tsx diff --git a/packages/kbn-i18n/src/react/provider.test.tsx b/packages/kbn-i18n-react/src/provider.test.tsx similarity index 100% rename from packages/kbn-i18n/src/react/provider.test.tsx rename to packages/kbn-i18n-react/src/provider.test.tsx diff --git a/packages/kbn-i18n/src/react/provider.tsx b/packages/kbn-i18n-react/src/provider.tsx similarity index 97% rename from packages/kbn-i18n/src/react/provider.tsx rename to packages/kbn-i18n-react/src/provider.tsx index fc0f6769c7160..2b4d8339a948d 100644 --- a/packages/kbn-i18n/src/react/provider.tsx +++ b/packages/kbn-i18n-react/src/provider.tsx @@ -12,7 +12,7 @@ import * as React from 'react'; // eslint-disable-next-line @kbn/eslint/module_migration import { IntlProvider } from 'react-intl'; -import * as i18n from '../core'; +import { i18n } from '@kbn/i18n'; import { PseudoLocaleWrapper } from './pseudo_locale_wrapper'; /** diff --git a/packages/kbn-i18n/src/react/pseudo_locale_wrapper.tsx b/packages/kbn-i18n-react/src/pseudo_locale_wrapper.tsx similarity index 88% rename from packages/kbn-i18n/src/react/pseudo_locale_wrapper.tsx rename to packages/kbn-i18n-react/src/pseudo_locale_wrapper.tsx index 705850193f428..645e746d7bf5f 100644 --- a/packages/kbn-i18n/src/react/pseudo_locale_wrapper.tsx +++ b/packages/kbn-i18n-react/src/pseudo_locale_wrapper.tsx @@ -8,8 +8,7 @@ import * as PropTypes from 'prop-types'; import * as React from 'react'; -import * as i18n from '../core'; -import { isPseudoLocale, translateUsingPseudoLocale } from '../core/pseudo_locale'; +import { i18n } from '@kbn/i18n'; /** * To translate label that includes nested `FormattedMessage` instances React Intl @@ -26,11 +25,11 @@ function translateFormattedMessageUsingPseudoLocale(message: string) { if (formattedMessageDelimiter !== null) { return message .split(formattedMessageDelimiter[0]) - .map((part) => (part.startsWith('ELEMENT-') ? part : translateUsingPseudoLocale(part))) + .map((part) => (part.startsWith('ELEMENT-') ? part : i18n.translateUsingPseudoLocale(part))) .join(formattedMessageDelimiter[0]); } - return translateUsingPseudoLocale(message); + return i18n.translateUsingPseudoLocale(message); } /** @@ -51,7 +50,7 @@ export class PseudoLocaleWrapper extends React.PureComponent { constructor(props: { children: React.ReactNode }, context: any) { super(props, context); - if (isPseudoLocale(i18n.getLocale())) { + if (i18n.isPseudoLocale(i18n.getLocale())) { const formatMessage = context.intl.formatMessage; context.intl.formatMessage = (...args: any[]) => translateFormattedMessageUsingPseudoLocale(formatMessage(...args)); diff --git a/packages/kbn-i18n-react/tsconfig.json b/packages/kbn-i18n-react/tsconfig.json new file mode 100644 index 0000000000000..d2707938041d2 --- /dev/null +++ b/packages/kbn-i18n-react/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "./target_types", + "sourceMap": true, + "sourceRoot": "../../../../../packages/kbn-i18n-react/src", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "src/**/*.ts", + "src/**/*.tsx", + ], +} diff --git a/packages/kbn-i18n/BUILD.bazel b/packages/kbn-i18n/BUILD.bazel index 8ea6c3dd192f4..385bdafb7c8ee 100644 --- a/packages/kbn-i18n/BUILD.bazel +++ b/packages/kbn-i18n/BUILD.bazel @@ -1,9 +1,10 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project") -load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm") -load("//src/dev/bazel:index.bzl", "jsts_transpiler") +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") PKG_BASE_NAME = "kbn-i18n" PKG_REQUIRE_NAME = "@kbn/i18n" +TYPES_PKG_REQUIRE_NAME = "@types/kbn__i18n" SOURCE_FILES = glob( [ @@ -27,7 +28,6 @@ filegroup( ) NPM_MODULE_EXTRA_FILES = [ - "react/package.json", "package.json", "GUIDELINE.md", "README.md" @@ -37,21 +37,14 @@ RUNTIME_DEPS = [ "@npm//intl-format-cache", "@npm//intl-messageformat", "@npm//intl-relativeformat", - "@npm//prop-types", - "@npm//react", - "@npm//react-intl" ] TYPES_DEPS = [ - "//packages/kbn-babel-preset", "@npm//intl-messageformat", "@npm//tslib", "@npm//@types/intl-relativeformat", "@npm//@types/jest", "@npm//@types/node", - "@npm//@types/prop-types", - "@npm//@types/react", - "@npm//@types/react-intl", ] jsts_transpiler( @@ -93,7 +86,7 @@ ts_project( js_library( name = PKG_BASE_NAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node", ":target_web", ":tsc_types"], + deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) @@ -112,3 +105,20 @@ filegroup( ], visibility = ["//visibility:public"], ) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = TYPES_PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [ + ":npm_module_types", + ], + visibility = ["//visibility:public"], +) diff --git a/packages/kbn-i18n/README.md b/packages/kbn-i18n/README.md index 0eaf232998a39..0121524b57e84 100644 --- a/packages/kbn-i18n/README.md +++ b/packages/kbn-i18n/README.md @@ -201,7 +201,7 @@ uses I18n engine under the hood: ```js import React from 'react'; import ReactDOM from 'react-dom'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; ReactDOM.render( @@ -216,7 +216,7 @@ ReactDOM.render( After that we can use `FormattedMessage` components inside `RootComponent`: ```jsx import React, { Component } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; class RootComponent extends Component { constructor(props) { @@ -292,7 +292,7 @@ React component as a pure function: ```js import React from 'react'; -import { injectI18n, intlShape } from '@kbn/i18n/react'; +import { injectI18n, intlShape } from '@kbn/i18n-react'; export const MyComponent = injectI18n({ intl }) => ( ; defaultMessage: string; description?: string; diff --git a/packages/kbn-i18n/src/core/index.ts b/packages/kbn-i18n/src/core/index.ts index 63ac1a98f218c..67b4a87bb2d1a 100644 --- a/packages/kbn-i18n/src/core/index.ts +++ b/packages/kbn-i18n/src/core/index.ts @@ -6,5 +6,7 @@ * Side Public License, v 1. */ +export type { Formats } from './formats'; export { formats } from './formats'; export * from './i18n'; +export * from './pseudo_locale'; diff --git a/packages/kbn-i18n/src/index.ts b/packages/kbn-i18n/src/index.ts index 19f4927ead09e..ca75591ca9227 100644 --- a/packages/kbn-i18n/src/index.ts +++ b/packages/kbn-i18n/src/index.ts @@ -6,8 +6,60 @@ * Side Public License, v 1. */ -import * as i18nCore from './core'; -import * as loader from './loader'; +import { + formats, + addTranslation, + getTranslation, + setLocale, + getLocale, + setDefaultLocale, + getDefaultLocale, + setFormats, + getFormats, + getRegisteredLocales, + translate, + init, + load, + isPseudoLocale, + translateUsingPseudoLocale, +} from './core'; -export const i18n = i18nCore; -export const i18nLoader = loader; +import { + registerTranslationFile, + registerTranslationFiles, + getTranslationsByLocale, + getAllTranslations, + getAllTranslationsFromPaths, + getRegisteredLocales as getRegisteredLocalesForLoader, +} from './loader'; + +const i18n = { + formats, + addTranslation, + getTranslation, + setLocale, + getLocale, + setDefaultLocale, + getDefaultLocale, + setFormats, + getFormats, + getRegisteredLocales, + translate, + init, + load, + isPseudoLocale, + translateUsingPseudoLocale, +}; + +const i18nLoader = { + registerTranslationFile, + registerTranslationFiles, + getTranslationsByLocale, + getAllTranslations, + getAllTranslationsFromPaths, + getRegisteredLocales: getRegisteredLocalesForLoader, +}; + +export type { Translation } from './translation'; +export type { Formats, TranslateArguments } from './core'; +export { i18n, i18nLoader }; diff --git a/packages/kbn-monaco/BUILD.bazel b/packages/kbn-monaco/BUILD.bazel index b2efa79f7fb34..4813f9dd2dc88 100644 --- a/packages/kbn-monaco/BUILD.bazel +++ b/packages/kbn-monaco/BUILD.bazel @@ -41,10 +41,11 @@ RUNTIME_DEPS = [ ] TYPES_DEPS = [ - "//packages/kbn-i18n", + "//packages/kbn-i18n:npm_module_types", "@npm//antlr4ts", "@npm//monaco-editor", "@npm//rxjs", + "@npm//tslib", "@npm//@types/jest", "@npm//@types/node", ] diff --git a/packages/kbn-monaco/src/index.ts b/packages/kbn-monaco/src/index.ts index 5394a46b142db..2f78038849e6b 100644 --- a/packages/kbn-monaco/src/index.ts +++ b/packages/kbn-monaco/src/index.ts @@ -11,6 +11,7 @@ import './register_globals'; export { monaco } from './monaco_imports'; export { XJsonLang } from './xjson'; +export { EsqlLang } from './esql'; export * from './painless'; /* eslint-disable-next-line @kbn/eslint/module_migration */ import * as BarePluginApi from 'monaco-editor/esm/vs/editor/editor.api'; diff --git a/packages/kbn-optimizer/limits.yml b/packages/kbn-optimizer/limits.yml index b39968f4889f5..e08b34f70b2a1 100644 --- a/packages/kbn-optimizer/limits.yml +++ b/packages/kbn-optimizer/limits.yml @@ -29,7 +29,6 @@ pageLoadAssetSize: ingestPipelines: 58003 inputControlVis: 172675 inspector: 148711 - kibanaLegacy: 107711 kibanaOverview: 56279 lens: 96624 licenseManagement: 41817 @@ -112,7 +111,7 @@ pageLoadAssetSize: embeddableEnhanced: 22107 uiActionsEnhanced: 38494 urlDrilldown: 30063 - indexPatternEditor: 19123 - indexPatternFieldEditor: 34448 - indexPatternManagement: 19165 + dataViewEditor: 12000 + dataViewFieldEditor: 20000 + dataViewManagement: 5000 reporting: 57003 diff --git a/packages/kbn-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap b/packages/kbn-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap index 3ca65769a18e1..ddcdd980153fb 100644 --- a/packages/kbn-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap +++ b/packages/kbn-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap @@ -156,16 +156,627 @@ OptimizerConfig { } `; -exports[`prepares assets for distribution: bar bundle 1`] = `"!function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){\\"undefined\\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\\"Module\\"}),Object.defineProperty(e,\\"__esModule\\",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&\\"object\\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,\\"default\\",{enumerable:!0,value:e}),2&n&&\\"string\\"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,\\"a\\",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p=\\"\\",t(t.s=3)}([function(e,n,t){\\"use strict\\";var r,o=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},i=function(){var e={};return function(n){if(void 0===e[n]){var t=document.querySelector(n);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}e[n]=t}return e[n]}}(),a=[];function c(e){for(var n=-1,t=0;t { * Verifies that the file matches the expected output and has matching compressed variants. */ const expectFileMatchesSnapshotWithCompression = (filePath: string, snapshotLabel: string) => { - const raw = Fs.readFileSync(Path.resolve(MOCK_REPO_DIR, filePath), 'utf8'); + const path = Path.resolve(MOCK_REPO_DIR, filePath); + const raw = Fs.readFileSync(path, 'utf8'); + const pretty = prettier.format(raw, { + filepath: path, + }); - expect(raw).toMatchSnapshot(snapshotLabel); + expect(pretty).toMatchSnapshot(snapshotLabel); // Verify the brotli variant matches expect( diff --git a/packages/kbn-plugin-generator/template/public/components/app.tsx.ejs b/packages/kbn-plugin-generator/template/public/components/app.tsx.ejs index c3e33788464fb..8da267c864fda 100644 --- a/packages/kbn-plugin-generator/template/public/components/app.tsx.ejs +++ b/packages/kbn-plugin-generator/template/public/components/app.tsx.ejs @@ -1,6 +1,6 @@ import React, { useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage, I18nProvider } from '@kbn/i18n/react'; +import { FormattedMessage, I18nProvider } from '@kbn/i18n-react'; import { BrowserRouter as Router } from 'react-router-dom'; import { diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_list/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_list/index.ts index 7d1aa44e7d907..54c9ecfe40b92 100644 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_list/index.ts +++ b/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_list/index.ts @@ -11,6 +11,7 @@ import * as t from 'io-ts'; export const exceptionListType = t.keyof({ detection: null, endpoint: null, + endpoint_trusted_apps: null, endpoint_events: null, endpoint_host_isolation_exceptions: null, }); @@ -20,6 +21,7 @@ export type ExceptionListTypeOrUndefined = t.TypeOf { const message = pipe(decoded, foldLeftRight); expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "1" supplied to "Array<{| id: NonEmptyString, list_id: NonEmptyString, type: "detection" | "endpoint" | "endpoint_events" | "endpoint_host_isolation_exceptions", namespace_type: "agnostic" | "single" |}>"', + 'Invalid value "1" supplied to "Array<{| id: NonEmptyString, list_id: NonEmptyString, type: "detection" | "endpoint" | "endpoint_trusted_apps" | "endpoint_events" | "endpoint_host_isolation_exceptions", namespace_type: "agnostic" | "single" |}>"', ]); expect(message.schema).toEqual({}); }); @@ -117,8 +117,8 @@ describe('Lists', () => { const message = pipe(decoded, foldLeftRight); expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "1" supplied to "(Array<{| id: NonEmptyString, list_id: NonEmptyString, type: "detection" | "endpoint" | "endpoint_events" | "endpoint_host_isolation_exceptions", namespace_type: "agnostic" | "single" |}> | undefined)"', - 'Invalid value "[1]" supplied to "(Array<{| id: NonEmptyString, list_id: NonEmptyString, type: "detection" | "endpoint" | "endpoint_events" | "endpoint_host_isolation_exceptions", namespace_type: "agnostic" | "single" |}> | undefined)"', + 'Invalid value "1" supplied to "(Array<{| id: NonEmptyString, list_id: NonEmptyString, type: "detection" | "endpoint" | "endpoint_trusted_apps" | "endpoint_events" | "endpoint_host_isolation_exceptions", namespace_type: "agnostic" | "single" |}> | undefined)"', + 'Invalid value "[1]" supplied to "(Array<{| id: NonEmptyString, list_id: NonEmptyString, type: "detection" | "endpoint" | "endpoint_trusted_apps" | "endpoint_events" | "endpoint_host_isolation_exceptions", namespace_type: "agnostic" | "single" |}> | undefined)"', ]); expect(message.schema).toEqual({}); }); diff --git a/packages/kbn-storybook/BUILD.bazel b/packages/kbn-storybook/BUILD.bazel index b98f2d055a91a..f2a7bf25fb407 100644 --- a/packages/kbn-storybook/BUILD.bazel +++ b/packages/kbn-storybook/BUILD.bazel @@ -36,6 +36,7 @@ RUNTIME_DEPS = [ "@npm//@storybook/api", "@npm//@storybook/components", "@npm//@storybook/core", + "@npm//@storybook/core-common", "@npm//@storybook/node-logger", "@npm//@storybook/react", "@npm//@storybook/theming", @@ -53,9 +54,11 @@ TYPES_DEPS = [ "@npm//@storybook/api", "@npm//@storybook/components", "@npm//@storybook/core", + "@npm//@storybook/core-common", "@npm//@storybook/node-logger", "@npm//@storybook/react", "@npm//@storybook/theming", + "@npm//@types/express", # necessary for storybook which is missing the types "@npm//@types/loader-utils", "@npm//@types/node", "@npm//@types/react", diff --git a/packages/kbn-storybook/src/lib/default_config.ts b/packages/kbn-storybook/src/lib/default_config.ts index 5326be5912ca5..85e206ce01141 100644 --- a/packages/kbn-storybook/src/lib/default_config.ts +++ b/packages/kbn-storybook/src/lib/default_config.ts @@ -7,7 +7,7 @@ */ import * as path from 'path'; -import { StorybookConfig } from '@storybook/core/types'; +import { StorybookConfig } from '@storybook/core-common'; import { Configuration } from 'webpack'; import webpackMerge from 'webpack-merge'; import { REPO_ROOT } from './constants'; @@ -20,6 +20,9 @@ export const defaultConfig: StorybookConfig = { typescript: { reactDocgen: false, }, + features: { + postcss: false, + }, webpackFinal: (config, options) => { if (process.env.CI) { config.parallelism = 4; diff --git a/packages/kbn-storybook/src/lib/theme_switcher.tsx b/packages/kbn-storybook/src/lib/theme_switcher.tsx index fd3e36b4cc306..c06e57035819f 100644 --- a/packages/kbn-storybook/src/lib/theme_switcher.tsx +++ b/packages/kbn-storybook/src/lib/theme_switcher.tsx @@ -9,7 +9,10 @@ import React from 'react'; import { Icons, IconButton, TooltipLinkList, WithTooltip } from '@storybook/components'; import { useGlobals } from '@storybook/api'; -import { Link } from '@storybook/components/dist/tooltip/TooltipLinkList'; + +type PropsOf> = T extends React.FC ? P : never; +type ArrayItem = T extends Array ? I : never; +type Link = ArrayItem['links']>; const defaultTheme = 'v8.light'; @@ -22,7 +25,7 @@ export function ThemeSwitcher() { } function Menu({ onHide }: { onHide: () => void }) { - const links: Link[] = [ + const links = [ { id: 'v8.light', title: 'Light', @@ -31,16 +34,18 @@ export function ThemeSwitcher() { id: 'v8.dark', title: 'Dark', }, - ].map((link) => ({ - ...link, - onClick: (_event, item) => { - if (item.id !== selectedTheme) { - updateGlobals({ euiTheme: item.id }); - } - onHide(); - }, - active: selectedTheme === link.id, - })); + ].map( + (link): Link => ({ + ...link, + onClick: (_event, item) => { + if (item.id !== selectedTheme) { + updateGlobals({ euiTheme: item.id }); + } + onHide(); + }, + active: selectedTheme === link.id, + }) + ); return ; } diff --git a/packages/kbn-storybook/src/typings.ts b/packages/kbn-storybook/src/typings.ts index 6c5d8f4da5709..a4a091a46d190 100644 --- a/packages/kbn-storybook/src/typings.ts +++ b/packages/kbn-storybook/src/typings.ts @@ -16,3 +16,27 @@ declare module '@storybook/react/standalone'; // See https://github.com/storybookjs/storybook/issues/11684 declare module 'react-syntax-highlighter/dist/cjs/create-element'; declare module 'react-syntax-highlighter/dist/cjs/prism-light'; + +// Storybook uses this module and its types are defined in the source but not in the type output +declare module 'file-system-cache' { + interface Options { + basePath?: string; + ns?: string | string[]; + extension?: string; + } + + class FileSystemCache { + constructor(options: Options); + path(key: string): string; + fileExists(key: string): Promise; + ensureBasePath(): Promise; + get(key: string, defaultValue?: any): Promise; + getSync(key: string, defaultValue?: any): any | typeof defaultValue; + set(key: string, value: any): Promise<{ path: string }>; + setSync(key: string, value: any): this; + remove(key: string): Promise; + clear(): Promise; + save(): Promise<{ paths: string[] }>; + load(): Promise<{ files: Array<{ path: string; value: any }> }>; + } +} diff --git a/packages/kbn-storybook/templates/index.ejs b/packages/kbn-storybook/templates/index.ejs index 3473f73ca131f..13fb54c8442c1 100644 --- a/packages/kbn-storybook/templates/index.ejs +++ b/packages/kbn-storybook/templates/index.ejs @@ -1,6 +1,6 @@ @@ -37,23 +37,25 @@ - <% if (typeof bodyHtmlSnippet !== 'undefined') { %> <%= bodyHtmlSnippet %> <% } %> + <% if (typeof bodyHtmlSnippet !== 'undefined') { %> + <%= bodyHtmlSnippet %> + <% } %>
<% if (typeof globals !== 'undefined' && Object.keys(globals).length) { %> - - <% } %> <% dlls.forEach(file => { %> - - <% }); %> <% files.js.forEach(file => { %> - + + <% } %> + + <% files.js.forEach(file => { %> + <% }); %> diff --git a/packages/kbn-test/BUILD.bazel b/packages/kbn-test/BUILD.bazel index efaf01f7137d9..c42c33483703e 100644 --- a/packages/kbn-test/BUILD.bazel +++ b/packages/kbn-test/BUILD.bazel @@ -37,7 +37,7 @@ NPM_MODULE_EXTRA_FILES = [ RUNTIME_DEPS = [ "//packages/kbn-dev-utils", - "//packages/kbn-i18n", + "//packages/kbn-i18n-react", "//packages/kbn-std", "//packages/kbn-utils", "@npm//@elastic/elasticsearch", @@ -73,7 +73,7 @@ RUNTIME_DEPS = [ TYPES_DEPS = [ "//packages/kbn-dev-utils", - "//packages/kbn-i18n", + "//packages/kbn-i18n-react:npm_module_types", "//packages/kbn-utils", "@npm//@elastic/elasticsearch", "@npm//del", diff --git a/packages/kbn-test/src/functional_tests/lib/babel_register_for_test_plugins.js b/packages/kbn-test/src/functional_tests/lib/babel_register_for_test_plugins.js index 09ed81b62a09d..03947f7e267ba 100644 --- a/packages/kbn-test/src/functional_tests/lib/babel_register_for_test_plugins.js +++ b/packages/kbn-test/src/functional_tests/lib/babel_register_for_test_plugins.js @@ -23,6 +23,7 @@ const transpileKbnPaths = [ // TODO: should should probably remove this link back to the source 'x-pack/plugins/task_manager/server/config.ts', 'src/core/utils/default_app_categories.ts', + 'src/plugins/field_formats/common', ].map((path) => Path.resolve(BASE_REPO_ROOT, path)); // modifies all future calls to require() to automatically diff --git a/packages/kbn-test/src/jest/utils/enzyme_helpers.tsx b/packages/kbn-test/src/jest/utils/enzyme_helpers.tsx index 0aa93dc51446c..ee5e06ebf6947 100644 --- a/packages/kbn-test/src/jest/utils/enzyme_helpers.tsx +++ b/packages/kbn-test/src/jest/utils/enzyme_helpers.tsx @@ -13,7 +13,7 @@ * intl context around them. */ -import { I18nProvider, InjectedIntl, intlShape, __IntlProvider } from '@kbn/i18n/react'; +import { I18nProvider, InjectedIntl, intlShape, __IntlProvider } from '@kbn/i18n-react'; import { mount, ReactWrapper, render, shallow } from 'enzyme'; import React, { ReactElement, ValidationMap } from 'react'; import { act as reactAct } from 'react-dom/test-utils'; diff --git a/packages/kbn-ui-shared-deps-npm/BUILD.bazel b/packages/kbn-ui-shared-deps-npm/BUILD.bazel index 490aa91f30680..b75315120e90d 100644 --- a/packages/kbn-ui-shared-deps-npm/BUILD.bazel +++ b/packages/kbn-ui-shared-deps-npm/BUILD.bazel @@ -34,7 +34,6 @@ RUNTIME_DEPS = [ "@npm//@elastic/eui", "@npm//@elastic/numeral", "@npm//@emotion/react", - "@npm//abortcontroller-polyfill", "@npm//babel-loader", "@npm//babel-plugin-transform-react-remove-prop-types", "@npm//core-js", @@ -74,7 +73,6 @@ TYPES_DEPS = [ "@npm//@elastic/eui", "@npm//@elastic/numeral", "@npm//@emotion/react", - "@npm//abortcontroller-polyfill", "@npm//babel-loader", "@npm//core-js", "@npm//css-loader", diff --git a/packages/kbn-ui-shared-deps-npm/webpack.config.js b/packages/kbn-ui-shared-deps-npm/webpack.config.js index a6e7180e88123..197ec5e63ad7c 100644 --- a/packages/kbn-ui-shared-deps-npm/webpack.config.js +++ b/packages/kbn-ui-shared-deps-npm/webpack.config.js @@ -56,6 +56,7 @@ module.exports = (_, argv) => { '@babel/runtime/helpers/interopRequireDefault', '@babel/runtime/helpers/interopRequireWildcard', '@babel/runtime/helpers/objectSpread2', + '@babel/runtime/helpers/objectWithoutProperties', '@babel/runtime/helpers/objectWithoutPropertiesLoose', '@babel/runtime/helpers/slicedToArray', '@babel/runtime/helpers/toArray', diff --git a/packages/kbn-ui-shared-deps-src/BUILD.bazel b/packages/kbn-ui-shared-deps-src/BUILD.bazel index f4597c1ee66b1..b135ae4021400 100644 --- a/packages/kbn-ui-shared-deps-src/BUILD.bazel +++ b/packages/kbn-ui-shared-deps-src/BUILD.bazel @@ -35,6 +35,7 @@ RUNTIME_DEPS = [ "//packages/kbn-analytics", "//packages/kbn-babel-preset", "//packages/kbn-i18n", + "//packages/kbn-i18n-react", "//packages/kbn-monaco", "//packages/kbn-std", "//packages/kbn-ui-shared-deps-npm", @@ -45,7 +46,8 @@ TYPES_DEPS = [ "//packages/elastic-safer-lodash-set", "//packages/kbn-analytics", "//packages/kbn-babel-preset", - "//packages/kbn-i18n", + "//packages/kbn-i18n:npm_module_types", + "//packages/kbn-i18n-react:npm_module_types", "//packages/kbn-monaco", "//packages/kbn-std", "//packages/kbn-ui-shared-deps-npm", diff --git a/packages/kbn-ui-shared-deps-src/src/entry.js b/packages/kbn-ui-shared-deps-src/src/entry.js index c111cbbe60b97..424eb4b55cc64 100644 --- a/packages/kbn-ui-shared-deps-src/src/entry.js +++ b/packages/kbn-ui-shared-deps-src/src/entry.js @@ -15,7 +15,7 @@ require('./flot_charts'); // stateful deps export const KbnI18n = require('@kbn/i18n'); -export const KbnI18nReact = require('@kbn/i18n/react'); +export const KbnI18nReact = require('@kbn/i18n-react'); export const EmotionReact = require('@emotion/react'); export const Moment = require('moment'); export const MomentTimezone = require('moment-timezone/moment-timezone'); diff --git a/packages/kbn-ui-shared-deps-src/src/index.js b/packages/kbn-ui-shared-deps-src/src/index.js index 630cf75c447fd..41ea7b03c9eb3 100644 --- a/packages/kbn-ui-shared-deps-src/src/index.js +++ b/packages/kbn-ui-shared-deps-src/src/index.js @@ -31,7 +31,7 @@ exports.externals = { * stateful deps */ '@kbn/i18n': '__kbnSharedDeps__.KbnI18n', - '@kbn/i18n/react': '__kbnSharedDeps__.KbnI18nReact', + '@kbn/i18n-react': '__kbnSharedDeps__.KbnI18nReact', '@emotion/react': '__kbnSharedDeps__.EmotionReact', jquery: '__kbnSharedDeps__.Jquery', moment: '__kbnSharedDeps__.Moment', diff --git a/src/core/public/application/integration_tests/utils.tsx b/src/core/public/application/integration_tests/utils.tsx index 455d19956f7e8..7ebc12deccd02 100644 --- a/src/core/public/application/integration_tests/utils.tsx +++ b/src/core/public/application/integration_tests/utils.tsx @@ -9,7 +9,7 @@ import React, { ReactElement } from 'react'; import { act } from 'react-dom/test-utils'; import { mount } from 'enzyme'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { AppMountParameters } from '../types'; import { MockedMounterTuple, Mountable } from '../test_types'; diff --git a/src/core/public/application/ui/app_not_found_screen.tsx b/src/core/public/application/ui/app_not_found_screen.tsx index 47cc158463f4e..b0f71d69e31e2 100644 --- a/src/core/public/application/ui/app_not_found_screen.tsx +++ b/src/core/public/application/ui/app_not_found_screen.tsx @@ -8,7 +8,7 @@ import { EuiEmptyPrompt, EuiPage, EuiPageBody, EuiPageContent } from '@elastic/eui'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const AppNotFound = () => ( diff --git a/src/core/public/chrome/chrome_service.tsx b/src/core/public/chrome/chrome_service.tsx index 8c8b264b094cc..ceb65827cd9a4 100644 --- a/src/core/public/chrome/chrome_service.tsx +++ b/src/core/public/chrome/chrome_service.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { BehaviorSubject, combineLatest, merge, Observable, of, ReplaySubject } from 'rxjs'; import { flatMap, map, takeUntil } from 'rxjs/operators'; import { parse } from 'url'; diff --git a/src/core/public/chrome/ui/header/header_help_menu.tsx b/src/core/public/chrome/ui/header/header_help_menu.tsx index cbf89bba2ca44..b2adf0494d090 100644 --- a/src/core/public/chrome/ui/header/header_help_menu.tsx +++ b/src/core/public/chrome/ui/header/header_help_menu.tsx @@ -9,7 +9,7 @@ import React, { Component, Fragment } from 'react'; import { combineLatest, Observable, Subscription } from 'rxjs'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, EuiButtonEmptyProps, diff --git a/src/core/public/core_app/errors/error_application.tsx b/src/core/public/core_app/errors/error_application.tsx index c04f6fd5b5408..64069f81b83b6 100644 --- a/src/core/public/core_app/errors/error_application.tsx +++ b/src/core/public/core_app/errors/error_application.tsx @@ -10,7 +10,7 @@ import React, { ReactChild, useState, useLayoutEffect } from 'react'; import ReactDOM from 'react-dom'; import { History } from 'history'; import { i18n } from '@kbn/i18n'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { EuiEmptyPrompt, EuiPage, EuiPageBody, EuiPageContent } from '@elastic/eui'; import { UrlOverflowUi } from './url_overflow_ui'; diff --git a/src/core/public/core_app/errors/public_base_url.tsx b/src/core/public/core_app/errors/public_base_url.tsx index 263367a4cb09a..3a4cce58bb1c4 100644 --- a/src/core/public/core_app/errors/public_base_url.tsx +++ b/src/core/public/core_app/errors/public_base_url.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { EuiButton, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { HttpStart, NotificationsStart } from '../..'; import type { DocLinksStart } from '../../doc_links'; diff --git a/src/core/public/core_app/errors/url_overflow.tsx b/src/core/public/core_app/errors/url_overflow.tsx index 481f73c367138..b908c9f7dcdff 100644 --- a/src/core/public/core_app/errors/url_overflow.tsx +++ b/src/core/public/core_app/errors/url_overflow.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { History, Location } from 'history'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { mountReactNode } from '../../utils'; import { IToasts } from '../../notifications'; diff --git a/src/core/public/core_app/errors/url_overflow_ui.tsx b/src/core/public/core_app/errors/url_overflow_ui.tsx index 3ed4011f25bf6..9937c7c508656 100644 --- a/src/core/public/core_app/errors/url_overflow_ui.tsx +++ b/src/core/public/core_app/errors/url_overflow_ui.tsx @@ -8,7 +8,7 @@ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiText } from '@elastic/eui'; import { IBasePath } from '../../http'; diff --git a/src/core/public/core_app/status/components/server_status.tsx b/src/core/public/core_app/status/components/server_status.tsx index 1147e21d17737..992e33a829044 100644 --- a/src/core/public/core_app/status/components/server_status.tsx +++ b/src/core/public/core_app/status/components/server_status.tsx @@ -8,7 +8,7 @@ import React, { FunctionComponent } from 'react'; import { EuiText, EuiFlexGroup, EuiFlexItem, EuiTitle } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { StatusState } from '../lib'; import { StatusBadge } from './status_badge'; diff --git a/src/core/public/core_app/status/components/status_table.tsx b/src/core/public/core_app/status/components/status_table.tsx index 755469145e01b..37833ebfde923 100644 --- a/src/core/public/core_app/status/components/status_table.tsx +++ b/src/core/public/core_app/status/components/status_table.tsx @@ -15,7 +15,7 @@ import { EuiScreenReaderOnly, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { FormattedStatus, getLevelSortValue } from '../lib'; import { StatusExpandedRow } from './status_expanded_row'; diff --git a/src/core/public/core_app/status/components/version_header.tsx b/src/core/public/core_app/status/components/version_header.tsx index cd19dbc205615..b07dc26c9dd02 100644 --- a/src/core/public/core_app/status/components/version_header.tsx +++ b/src/core/public/core_app/status/components/version_header.tsx @@ -8,7 +8,7 @@ import React, { FC } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiPageContent, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { ServerVersion } from '../../../../types/status'; interface VersionHeaderProps { diff --git a/src/core/public/core_app/status/render_app.tsx b/src/core/public/core_app/status/render_app.tsx index 97398af6c9cf3..836c1017a91f5 100644 --- a/src/core/public/core_app/status/render_app.tsx +++ b/src/core/public/core_app/status/render_app.tsx @@ -8,7 +8,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import type { AppMountParameters } from '../../application'; import type { HttpSetup } from '../../http'; import type { NotificationsSetup } from '../../notifications'; diff --git a/src/core/public/core_app/status/status_app.tsx b/src/core/public/core_app/status/status_app.tsx index 7ec1518719874..2cb2b861bcacf 100644 --- a/src/core/public/core_app/status/status_app.tsx +++ b/src/core/public/core_app/status/status_app.tsx @@ -8,7 +8,7 @@ import React, { Component } from 'react'; import { EuiLoadingSpinner, EuiText, EuiPage, EuiPageBody, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { HttpSetup } from '../../http'; import { NotificationsSetup } from '../../notifications'; diff --git a/src/core/public/doc_links/doc_links_service.ts b/src/core/public/doc_links/doc_links_service.ts index f97ec152aa5d7..ec7802b68e7c5 100644 --- a/src/core/public/doc_links/doc_links_service.ts +++ b/src/core/public/doc_links/doc_links_service.ts @@ -488,7 +488,7 @@ export class DocLinksService { fleet: { guide: `${FLEET_DOCS}index.html`, fleetServer: `${FLEET_DOCS}fleet-server.html`, - fleetServerAddFleetServer: `${FLEET_DOCS}fleet-server.html#add-fleet-server`, + fleetServerAddFleetServer: `${FLEET_DOCS}add-a-fleet-server.html`, settings: `${FLEET_DOCS}fleet-settings.html#fleet-server-hosts-setting`, settingsFleetServerHostSettings: `${FLEET_DOCS}fleet-settings.html#fleet-server-hosts-setting`, settingsFleetServerProxySettings: `${KIBANA_DOCS}fleet-settings-kb.html#fleet-data-visualizer-settings`, @@ -496,7 +496,6 @@ export class DocLinksService { elasticAgent: `${FLEET_DOCS}elastic-agent-installation.html`, beatsAgentComparison: `${FLEET_DOCS}beats-agent-comparison.html`, datastreams: `${FLEET_DOCS}data-streams.html`, - datastreamsILM: `${FLEET_DOCS}data-streams.html#data-streams-ilm`, datastreamsNamingScheme: `${FLEET_DOCS}data-streams.html#data-streams-naming-scheme`, installElasticAgent: `${FLEET_DOCS}install-fleet-managed-elastic-agent.html`, upgradeElasticAgent: `${FLEET_DOCS}upgrade-elastic-agent.html`, @@ -766,7 +765,6 @@ export interface DocLinksStart { readonly snapshotRestore: Record; readonly ingest: Record; readonly fleet: Readonly<{ - datastreamsILM: string; beatsAgentComparison: string; guide: string; fleetServer: string; diff --git a/src/core/public/fatal_errors/fatal_errors_screen.tsx b/src/core/public/fatal_errors/fatal_errors_screen.tsx index 5ddaa022ea946..b46fdf134d0bd 100644 --- a/src/core/public/fatal_errors/fatal_errors_screen.tsx +++ b/src/core/public/fatal_errors/fatal_errors_screen.tsx @@ -20,7 +20,7 @@ import React from 'react'; import * as Rx from 'rxjs'; import { tap } from 'rxjs/operators'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { FatalErrorInfo } from './get_error_info'; diff --git a/src/core/public/i18n/i18n_eui_mapping.tsx b/src/core/public/i18n/i18n_eui_mapping.tsx index 79180575129ea..7c4d39fa2b11a 100644 --- a/src/core/public/i18n/i18n_eui_mapping.tsx +++ b/src/core/public/i18n/i18n_eui_mapping.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiTokensObject } from '@elastic/eui'; interface EuiValues { diff --git a/src/core/public/i18n/i18n_service.test.tsx b/src/core/public/i18n/i18n_service.test.tsx index 0bf89f5c2ed68..4a010ad19661c 100644 --- a/src/core/public/i18n/i18n_service.test.tsx +++ b/src/core/public/i18n/i18n_service.test.tsx @@ -16,7 +16,7 @@ jest.mock('@elastic/eui', () => { }; }); -jest.mock('@kbn/i18n/react', () => { +jest.mock('@kbn/i18n-react', () => { return { I18nProvider: function MockI18nProvider() { // no-op diff --git a/src/core/public/i18n/i18n_service.tsx b/src/core/public/i18n/i18n_service.tsx index ad1a32333d021..640dec6321184 100644 --- a/src/core/public/i18n/i18n_service.tsx +++ b/src/core/public/i18n/i18n_service.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiContext } from '@elastic/eui'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { getEuiContextMapping } from './i18n_eui_mapping'; diff --git a/src/core/public/notifications/toasts/error_toast.tsx b/src/core/public/notifications/toasts/error_toast.tsx index 47a84f2d85364..f75bdda716131 100644 --- a/src/core/public/notifications/toasts/error_toast.tsx +++ b/src/core/public/notifications/toasts/error_toast.tsx @@ -19,7 +19,7 @@ import { EuiModalHeaderTitle, } from '@elastic/eui'; import { EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { OverlayStart } from 'kibana/public'; import { I18nStart } from '../../i18n'; diff --git a/src/core/public/overlays/banners/user_banner_service.tsx b/src/core/public/overlays/banners/user_banner_service.tsx index d65378b91ffe1..cb6dd81d85a7b 100644 --- a/src/core/public/overlays/banners/user_banner_service.tsx +++ b/src/core/public/overlays/banners/user_banner_service.tsx @@ -11,7 +11,7 @@ import ReactDOM from 'react-dom'; import { filter } from 'rxjs/operators'; import { Subscription } from 'rxjs'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCallOut, EuiButton, EuiLoadingSpinner } from '@elastic/eui'; import { I18nStart } from '../../i18n'; diff --git a/src/core/public/public.api.md b/src/core/public/public.api.md index d1a164a2ab13d..5dcd3422d5d86 100644 --- a/src/core/public/public.api.md +++ b/src/core/public/public.api.md @@ -722,7 +722,6 @@ export interface DocLinksStart { readonly snapshotRestore: Record; readonly ingest: Record; readonly fleet: Readonly<{ - datastreamsILM: string; beatsAgentComparison: string; guide: string; fleetServer: string; diff --git a/src/core/public/utils/mount.tsx b/src/core/public/utils/mount.tsx index fc23202e2c71d..468fde3c04385 100644 --- a/src/core/public/utils/mount.tsx +++ b/src/core/public/utils/mount.tsx @@ -8,7 +8,7 @@ import React, { useEffect, useRef } from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { MountPoint } from '../types'; const defaultWrapperClass = 'kbnMountWrapper'; diff --git a/src/core/server/http/http_server.ts b/src/core/server/http/http_server.ts index 26725aff71b6c..348b5c4af3e58 100644 --- a/src/core/server/http/http_server.ts +++ b/src/core/server/http/http_server.ts @@ -16,6 +16,7 @@ import { getServerOptions, getRequestId, } from '@kbn/server-http-tools'; +import agent from 'elastic-apm-node'; import type { Duration } from 'moment'; import { Observable } from 'rxjs'; @@ -345,6 +346,9 @@ export class HttpServer { ...(request.app ?? {}), requestId, requestUuid: uuid.v4(), + // Kibana stores trace.id until https://github.com/elastic/apm-agent-nodejs/issues/2353 is resolved + // The current implementation of the APM agent ends a request transaction before "response" log is emitted. + traceId: agent.currentTraceIds['trace.id'], } as KibanaRequestState; return responseToolkit.continue; }); diff --git a/src/core/server/http/integration_tests/lifecycle.test.ts b/src/core/server/http/integration_tests/lifecycle.test.ts index 1db0b3c131522..ba4d8724599ed 100644 --- a/src/core/server/http/integration_tests/lifecycle.test.ts +++ b/src/core/server/http/integration_tests/lifecycle.test.ts @@ -259,7 +259,9 @@ describe('OnPreRouting', () => { const result = await supertest(innerServer.listener).get('/').expect(500); - expect(result.body.message).toBe('An internal server error occurred.'); + expect(result.body.message).toBe( + 'An internal server error occurred. Check Kibana server logs for details.' + ); expect(loggingSystemMock.collect(logger).error).toMatchInlineSnapshot(` Array [ Array [ @@ -284,7 +286,9 @@ describe('OnPreRouting', () => { const result = await supertest(innerServer.listener).get('/').expect(500); - expect(result.body.message).toBe('An internal server error occurred.'); + expect(result.body.message).toBe( + 'An internal server error occurred. Check Kibana server logs for details.' + ); expect(loggingSystemMock.collect(logger).error).toMatchInlineSnapshot(` Array [ Array [ @@ -403,7 +407,9 @@ describe('OnPreAuth', () => { const result = await supertest(innerServer.listener).get('/').expect(500); - expect(result.body.message).toBe('An internal server error occurred.'); + expect(result.body.message).toBe( + 'An internal server error occurred. Check Kibana server logs for details.' + ); expect(loggingSystemMock.collect(logger).error).toMatchInlineSnapshot(` Array [ Array [ @@ -424,7 +430,9 @@ describe('OnPreAuth', () => { const result = await supertest(innerServer.listener).get('/').expect(500); - expect(result.body.message).toBe('An internal server error occurred.'); + expect(result.body.message).toBe( + 'An internal server error occurred. Check Kibana server logs for details.' + ); expect(loggingSystemMock.collect(logger).error).toMatchInlineSnapshot(` Array [ Array [ @@ -570,7 +578,9 @@ describe('OnPostAuth', () => { const result = await supertest(innerServer.listener).get('/').expect(500); - expect(result.body.message).toBe('An internal server error occurred.'); + expect(result.body.message).toBe( + 'An internal server error occurred. Check Kibana server logs for details.' + ); expect(loggingSystemMock.collect(logger).error).toMatchInlineSnapshot(` Array [ Array [ @@ -590,7 +600,9 @@ describe('OnPostAuth', () => { const result = await supertest(innerServer.listener).get('/').expect(500); - expect(result.body.message).toBe('An internal server error occurred.'); + expect(result.body.message).toBe( + 'An internal server error occurred. Check Kibana server logs for details.' + ); expect(loggingSystemMock.collect(logger).error).toMatchInlineSnapshot(` Array [ Array [ @@ -808,7 +820,9 @@ describe('Auth', () => { const result = await supertest(innerServer.listener).get('/').expect(500); - expect(result.body.message).toBe('An internal server error occurred.'); + expect(result.body.message).toBe( + 'An internal server error occurred. Check Kibana server logs for details.' + ); expect(loggingSystemMock.collect(logger).error).toMatchInlineSnapshot(` Array [ Array [ @@ -1100,7 +1114,9 @@ describe('Auth', () => { const result = await supertest(innerServer.listener).get('/').expect(500); - expect(result.body.message).toBe('An internal server error occurred.'); + expect(result.body.message).toBe( + 'An internal server error occurred. Check Kibana server logs for details.' + ); expect(loggingSystemMock.collect(logger).error).toMatchInlineSnapshot(` Array [ Array [ @@ -1120,7 +1136,9 @@ describe('Auth', () => { const result = await supertest(innerServer.listener).get('/').expect(500); - expect(result.body.message).toBe('An internal server error occurred.'); + expect(result.body.message).toBe( + 'An internal server error occurred. Check Kibana server logs for details.' + ); expect(loggingSystemMock.collect(logger).error).toMatchInlineSnapshot(` Array [ Array [ @@ -1296,7 +1314,9 @@ describe('OnPreResponse', () => { const result = await supertest(innerServer.listener).get('/').expect(500); - expect(result.body.message).toBe('An internal server error occurred.'); + expect(result.body.message).toBe( + 'An internal server error occurred. Check Kibana server logs for details.' + ); expect(loggingSystemMock.collect(logger).error).toMatchInlineSnapshot(` Array [ Array [ @@ -1320,7 +1340,9 @@ describe('OnPreResponse', () => { const result = await supertest(innerServer.listener).get('/').expect(500); - expect(result.body.message).toBe('An internal server error occurred.'); + expect(result.body.message).toBe( + 'An internal server error occurred. Check Kibana server logs for details.' + ); expect(loggingSystemMock.collect(logger).error).toMatchInlineSnapshot(` Array [ Array [ diff --git a/src/core/server/http/integration_tests/router.test.ts b/src/core/server/http/integration_tests/router.test.ts index 80676b6be6c63..1bc42a556dbc4 100644 --- a/src/core/server/http/integration_tests/router.test.ts +++ b/src/core/server/http/integration_tests/router.test.ts @@ -569,7 +569,9 @@ describe('Handler', () => { const result = await supertest(innerServer.listener).get('/').expect(500); - expect(result.body.message).toBe('An internal server error occurred.'); + expect(result.body.message).toBe( + 'An internal server error occurred. Check Kibana server logs for details.' + ); expect(loggingSystemMock.collect(logger).error).toMatchInlineSnapshot(` Array [ Array [ @@ -590,7 +592,9 @@ describe('Handler', () => { const result = await supertest(innerServer.listener).get('/').expect(500); - expect(result.body.message).toBe('An internal server error occurred.'); + expect(result.body.message).toBe( + 'An internal server error occurred. Check Kibana server logs for details.' + ); expect(loggingSystemMock.collect(logger).error).toMatchInlineSnapshot(` Array [ Array [ @@ -609,7 +613,9 @@ describe('Handler', () => { const result = await supertest(innerServer.listener).get('/').expect(500); - expect(result.body.message).toBe('An internal server error occurred.'); + expect(result.body.message).toBe( + 'An internal server error occurred. Check Kibana server logs for details.' + ); expect(loggingSystemMock.collect(logger).error).toMatchInlineSnapshot(` Array [ Array [ @@ -737,7 +743,7 @@ describe('handleLegacyErrors', () => { expect(result.body).toEqual({ error: 'Internal Server Error', - message: 'An internal server error occurred.', + message: 'An internal server error occurred. Check Kibana server logs for details.', statusCode: 500, }); }); @@ -1113,7 +1119,9 @@ describe('Response factory', () => { const result = await supertest(innerServer.listener).get('/').expect(500); - expect(result.body.message).toBe('An internal server error occurred.'); + expect(result.body.message).toBe( + 'An internal server error occurred. Check Kibana server logs for details.' + ); expect(loggingSystemMock.collect(logger).error).toMatchInlineSnapshot(` Array [ Array [ @@ -1517,7 +1525,7 @@ describe('Response factory', () => { expect(result.body).toEqual({ error: 'Internal Server Error', - message: 'An internal server error occurred.', + message: 'An internal server error occurred. Check Kibana server logs for details.', statusCode: 500, }); expect(loggingSystemMock.collect(logger).error).toMatchInlineSnapshot(` @@ -1726,7 +1734,9 @@ describe('Response factory', () => { const result = await supertest(innerServer.listener).get('/').expect(500); - expect(result.body.message).toBe('An internal server error occurred.'); + expect(result.body.message).toBe( + 'An internal server error occurred. Check Kibana server logs for details.' + ); expect(loggingSystemMock.collect(logger).error).toMatchInlineSnapshot(` Array [ Array [ @@ -1750,7 +1760,9 @@ describe('Response factory', () => { const result = await supertest(innerServer.listener).get('/').expect(500); - expect(result.body.message).toBe('An internal server error occurred.'); + expect(result.body.message).toBe( + 'An internal server error occurred. Check Kibana server logs for details.' + ); expect(loggingSystemMock.collect(logger).error).toMatchInlineSnapshot(` Array [ Array [ @@ -1773,7 +1785,9 @@ describe('Response factory', () => { const result = await supertest(innerServer.listener).get('/').expect(500); - expect(result.body.message).toBe('An internal server error occurred.'); + expect(result.body.message).toBe( + 'An internal server error occurred. Check Kibana server logs for details.' + ); expect(loggingSystemMock.collect(logger).error).toMatchInlineSnapshot(` Array [ Array [ @@ -1796,7 +1810,9 @@ describe('Response factory', () => { const result = await supertest(innerServer.listener).get('/').expect(500); - expect(result.body.message).toBe('An internal server error occurred.'); + expect(result.body.message).toBe( + 'An internal server error occurred. Check Kibana server logs for details.' + ); expect(loggingSystemMock.collect(logger).error).toMatchInlineSnapshot(` Array [ Array [ diff --git a/src/core/server/http/logging/get_response_log.test.ts b/src/core/server/http/logging/get_response_log.test.ts index df91ae9c1a98b..4e749e9b6c8e0 100644 --- a/src/core/server/http/logging/get_response_log.test.ts +++ b/src/core/server/http/logging/get_response_log.test.ts @@ -27,6 +27,7 @@ interface RequestFixtureOptions { path?: string; query?: Record; response?: Record | Boom.Boom; + app?: Record; } function createMockHapiRequest({ @@ -39,6 +40,7 @@ function createMockHapiRequest({ path = '/path', query = {}, response = { headers: {}, statusCode: 200 }, + app = {}, }: RequestFixtureOptions = {}): Request { return { auth, @@ -50,6 +52,7 @@ function createMockHapiRequest({ path, query, response, + app, } as unknown as Request; } @@ -143,6 +146,17 @@ describe('getEcsResponseLog', () => { expect(result.message).toMatchInlineSnapshot(`"GET /path 200"`); }); + test('set traceId stored in the request app storage', () => { + const req = createMockHapiRequest({ + app: { + foo: 'bar', + traceId: 'trace_id', + }, + }); + const result = getEcsResponseLog(req, logger); + expect(result.meta?.trace?.id).toBe('trace_id'); + }); + test('handles Boom errors in the response', () => { const req = createMockHapiRequest({ response: Boom.badRequest(), @@ -280,6 +294,7 @@ describe('getEcsResponseLog', () => { "status_code": 200, }, }, + "trace": undefined, "url": Object { "path": "/path", "query": "", diff --git a/src/core/server/http/logging/get_response_log.ts b/src/core/server/http/logging/get_response_log.ts index 37ee618e43395..e65871c1b1f11 100644 --- a/src/core/server/http/logging/get_response_log.ts +++ b/src/core/server/http/logging/get_response_log.ts @@ -13,6 +13,7 @@ import numeral from '@elastic/numeral'; import { LogMeta } from '@kbn/logging'; import { Logger } from '../../logging'; import { getResponsePayloadBytes } from './get_payload_size'; +import type { KibanaRequestState } from '../router'; const FORBIDDEN_HEADERS = ['authorization', 'cookie', 'set-cookie']; const REDACTED_HEADER_TEXT = '[REDACTED]'; @@ -65,6 +66,8 @@ export function getEcsResponseLog(request: Request, log: Logger) { const bytes = getResponsePayloadBytes(response, log); const bytesMsg = bytes ? ` - ${numeral(bytes).format('0.0b')}` : ''; + const traceId = (request.app as KibanaRequestState).traceId; + const meta: LogMeta = { client: { ip: request.info.remoteAddress, @@ -95,6 +98,7 @@ export function getEcsResponseLog(request: Request, log: Logger) { user_agent: { original: request.headers['user-agent'], }, + trace: traceId ? { id: traceId } : undefined, }; return { diff --git a/src/core/server/http/router/request.ts b/src/core/server/http/router/request.ts index 89511c00a8f32..94d353e1335b3 100644 --- a/src/core/server/http/router/request.ts +++ b/src/core/server/http/router/request.ts @@ -35,6 +35,7 @@ export interface KibanaRequestState extends RequestApplicationState { requestId: string; requestUuid: string; rewrittenUrl?: URL; + traceId?: string; } /** diff --git a/src/core/server/http/router/response_adapter.ts b/src/core/server/http/router/response_adapter.ts index 753c11d5f45ae..ad884a06768da 100644 --- a/src/core/server/http/router/response_adapter.ts +++ b/src/core/server/http/router/response_adapter.ts @@ -55,7 +55,8 @@ export class HapiResponseAdapter { statusCode: 500, }); - error.output.payload.message = 'An internal server error occurred.'; + error.output.payload.message = + 'An internal server error occurred. Check Kibana server logs for details.'; return error; } diff --git a/src/core/server/logging/layouts/json_layout.test.ts b/src/core/server/logging/layouts/json_layout.test.ts index d3bf2eab473a4..259900fd5d3fb 100644 --- a/src/core/server/logging/layouts/json_layout.test.ts +++ b/src/core/server/logging/layouts/json_layout.test.ts @@ -343,9 +343,9 @@ test('format() meta can not override tracing properties', () => { trace: { id: 'trace_override' }, transaction: { id: 'transaction_override' }, }, - spanId: 'spanId-1', - traceId: 'traceId-1', - transactionId: 'transactionId-1', + spanId: 'spanId', + traceId: 'traceId', + transactionId: 'transactionId', }) ) ).toStrictEqual({ @@ -359,8 +359,8 @@ test('format() meta can not override tracing properties', () => { process: { pid: 3, }, - span: { id: 'spanId-1' }, - trace: { id: 'traceId-1' }, - transaction: { id: 'transactionId-1' }, + span: { id: 'span_override' }, + trace: { id: 'trace_override' }, + transaction: { id: 'transaction_override' }, }); }); diff --git a/src/core/server/logging/layouts/json_layout.ts b/src/core/server/logging/layouts/json_layout.ts index 5c23e7ac1a911..84ceb0a30e9bb 100644 --- a/src/core/server/logging/layouts/json_layout.ts +++ b/src/core/server/logging/layouts/json_layout.ts @@ -42,6 +42,10 @@ export class JsonLayout implements Layout { } public format(record: LogRecord): string { + const spanId = record.meta?.span?.id ?? record.spanId; + const traceId = record.meta?.trace?.id ?? record.traceId; + const transactionId = record.meta?.transaction?.id ?? record.transactionId; + const log: Ecs = { ecs: { version: '8.0.0' }, '@timestamp': moment(record.timestamp).format('YYYY-MM-DDTHH:mm:ss.SSSZ'), @@ -54,9 +58,9 @@ export class JsonLayout implements Layout { process: { pid: record.pid, }, - span: record.spanId ? { id: record.spanId } : undefined, - trace: record.traceId ? { id: record.traceId } : undefined, - transaction: record.transactionId ? { id: record.transactionId } : undefined, + span: spanId ? { id: spanId } : undefined, + trace: traceId ? { id: traceId } : undefined, + transaction: transactionId ? { id: transactionId } : undefined, }; const output = record.meta ? merge({ ...record.meta }, log) : log; diff --git a/src/dev/build/args.test.ts b/src/dev/build/args.test.ts index 9ac4c5ec3b236..354de9fee60d7 100644 --- a/src/dev/build/args.test.ts +++ b/src/dev/build/args.test.ts @@ -36,6 +36,8 @@ it('build default and oss dist for current platform, without packages, by defaul "createGenericFolders": true, "createPlatformFolders": true, "createRpmPackage": false, + "dockerPush": false, + "dockerTagQualifier": null, "downloadCloudDependencies": true, "downloadFreshNode": true, "initialize": true, @@ -64,6 +66,8 @@ it('builds packages if --all-platforms is passed', () => { "createGenericFolders": true, "createPlatformFolders": true, "createRpmPackage": true, + "dockerPush": false, + "dockerTagQualifier": null, "downloadCloudDependencies": true, "downloadFreshNode": true, "initialize": true, @@ -92,6 +96,8 @@ it('limits packages if --rpm passed with --all-platforms', () => { "createGenericFolders": true, "createPlatformFolders": true, "createRpmPackage": true, + "dockerPush": false, + "dockerTagQualifier": null, "downloadCloudDependencies": true, "downloadFreshNode": true, "initialize": true, @@ -120,6 +126,8 @@ it('limits packages if --deb passed with --all-platforms', () => { "createGenericFolders": true, "createPlatformFolders": true, "createRpmPackage": false, + "dockerPush": false, + "dockerTagQualifier": null, "downloadCloudDependencies": true, "downloadFreshNode": true, "initialize": true, @@ -149,6 +157,8 @@ it('limits packages if --docker passed with --all-platforms', () => { "createGenericFolders": true, "createPlatformFolders": true, "createRpmPackage": false, + "dockerPush": false, + "dockerTagQualifier": null, "downloadCloudDependencies": true, "downloadFreshNode": true, "initialize": true, @@ -185,6 +195,8 @@ it('limits packages if --docker passed with --skip-docker-ubi and --all-platform "createGenericFolders": true, "createPlatformFolders": true, "createRpmPackage": false, + "dockerPush": false, + "dockerTagQualifier": null, "downloadCloudDependencies": true, "downloadFreshNode": true, "initialize": true, @@ -214,6 +226,8 @@ it('limits packages if --all-platforms passed with --skip-docker-centos', () => "createGenericFolders": true, "createPlatformFolders": true, "createRpmPackage": true, + "dockerPush": false, + "dockerTagQualifier": null, "downloadCloudDependencies": true, "downloadFreshNode": true, "initialize": true, diff --git a/src/dev/build/args.ts b/src/dev/build/args.ts index e7fca2a2a3d7b..78f097b595c40 100644 --- a/src/dev/build/args.ts +++ b/src/dev/build/args.ts @@ -23,6 +23,7 @@ export function readCliArgs(argv: string[]) { 'rpm', 'deb', 'docker-images', + 'docker-push', 'skip-docker-contexts', 'skip-docker-ubi', 'skip-docker-centos', @@ -50,6 +51,8 @@ export function readCliArgs(argv: string[]) { rpm: null, deb: null, 'docker-images': null, + 'docker-push': false, + 'docker-tag-qualifier': null, 'version-qualifier': '', }, unknown: (flag) => { @@ -95,6 +98,8 @@ export function readCliArgs(argv: string[]) { const buildOptions: BuildOptions = { isRelease: Boolean(flags.release), versionQualifier: flags['version-qualifier'], + dockerPush: Boolean(flags['docker-push']), + dockerTagQualifier: flags['docker-tag-qualifier'], initialize: !Boolean(flags['skip-initialize']), downloadFreshNode: !Boolean(flags['skip-node-download']), downloadCloudDependencies: !Boolean(flags['skip-cloud-dependencies-download']), diff --git a/src/dev/build/build_distributables.ts b/src/dev/build/build_distributables.ts index 8912b05a16943..a5ed81c15c9b1 100644 --- a/src/dev/build/build_distributables.ts +++ b/src/dev/build/build_distributables.ts @@ -13,6 +13,8 @@ import * as Tasks from './tasks'; export interface BuildOptions { isRelease: boolean; + dockerPush: boolean; + dockerTagQualifier: string | null; downloadFreshNode: boolean; downloadCloudDependencies: boolean; initialize: boolean; diff --git a/src/dev/build/lib/build.test.ts b/src/dev/build/lib/build.test.ts index f92a91e2b7221..8ea2a20d83960 100644 --- a/src/dev/build/lib/build.test.ts +++ b/src/dev/build/lib/build.test.ts @@ -32,6 +32,8 @@ const config = new Config( buildSha: 'abcd1234', buildVersion: '8.0.0', }, + '', + false, true ); diff --git a/src/dev/build/lib/config.test.ts b/src/dev/build/lib/config.test.ts index b2afe3337230d..3f90c8738d8e2 100644 --- a/src/dev/build/lib/config.test.ts +++ b/src/dev/build/lib/config.test.ts @@ -29,6 +29,8 @@ const setup = async ({ targetAllPlatforms = true }: { targetAllPlatforms?: boole return await Config.create({ isRelease: true, targetAllPlatforms, + dockerPush: false, + dockerTagQualifier: '', }); }; diff --git a/src/dev/build/lib/config.ts b/src/dev/build/lib/config.ts index 33b98e1b94a04..650af04dfd54b 100644 --- a/src/dev/build/lib/config.ts +++ b/src/dev/build/lib/config.ts @@ -17,6 +17,8 @@ interface Options { isRelease: boolean; targetAllPlatforms: boolean; versionQualifier?: string; + dockerTagQualifier: string | null; + dockerPush: boolean; } interface Package { @@ -29,7 +31,13 @@ interface Package { } export class Config { - static async create({ isRelease, targetAllPlatforms, versionQualifier }: Options) { + static async create({ + isRelease, + targetAllPlatforms, + versionQualifier, + dockerTagQualifier, + dockerPush, + }: Options) { const pkgPath = resolve(__dirname, '../../../../package.json'); const pkg: Package = loadJsonFile.sync(pkgPath); @@ -43,6 +51,8 @@ export class Config { versionQualifier, pkg, }), + dockerTagQualifier, + dockerPush, isRelease ); } @@ -53,6 +63,8 @@ export class Config { private readonly nodeVersion: string, private readonly repoRoot: string, private readonly versionInfo: VersionInfo, + private readonly dockerTagQualifier: string | null, + private readonly dockerPush: boolean, public readonly isRelease: boolean ) {} @@ -70,6 +82,20 @@ export class Config { return this.nodeVersion; } + /** + * Get the docker tag qualifier + */ + getDockerTagQualfiier() { + return this.dockerTagQualifier; + } + + /** + * Get docker push + */ + getDockerPush() { + return this.dockerPush; + } + /** * Convert an absolute path to a relative path, based from the repo */ diff --git a/src/dev/build/lib/download.ts b/src/dev/build/lib/download.ts index 9293854bfb2bd..c67407095b37e 100644 --- a/src/dev/build/lib/download.ts +++ b/src/dev/build/lib/download.ts @@ -8,11 +8,12 @@ import { openSync, writeSync, unlinkSync, closeSync } from 'fs'; import { dirname } from 'path'; +import { setTimeout } from 'timers/promises'; import chalk from 'chalk'; import { createHash } from 'crypto'; import Axios from 'axios'; -import { ToolingLog } from '@kbn/dev-utils'; +import { ToolingLog, isAxiosResponseError } from '@kbn/dev-utils'; // https://github.com/axios/axios/tree/ffea03453f77a8176c51554d5f6c3c6829294649/lib/adapters // @ts-expect-error untyped internal module used to prevent axios from using xhr adapter in tests @@ -30,81 +31,151 @@ function tryUnlink(path: string) { } } -interface DownloadOptions { +interface DownloadToDiskOptions { log: ToolingLog; url: string; destination: string; shaChecksum: string; shaAlgorithm: string; - retries?: number; + maxAttempts?: number; + retryDelaySecMultiplier?: number; } -export async function download(options: DownloadOptions): Promise { - const { log, url, destination, shaChecksum, shaAlgorithm, retries = 0 } = options; - +export async function downloadToDisk({ + log, + url, + destination, + shaChecksum, + shaAlgorithm, + maxAttempts = 1, + retryDelaySecMultiplier = 5, +}: DownloadToDiskOptions) { if (!shaChecksum) { throw new Error(`${shaAlgorithm} checksum of ${url} not provided, refusing to download.`); } - // mkdirp and open file outside of try/catch, we don't retry for those errors - await mkdirp(dirname(destination)); - const fileHandle = openSync(destination, 'w'); + if (maxAttempts < 1) { + throw new Error(`[maxAttempts=${maxAttempts}] must be >= 1`); + } - let error; - try { - log.debug(`Attempting download of ${url}`, chalk.dim(shaAlgorithm)); + let attempt = 0; + while (true) { + attempt += 1; - const response = await Axios.request({ - url, - responseType: 'stream', - adapter: AxiosHttpAdapter, - }); + // mkdirp and open file outside of try/catch, we don't retry for those errors + await mkdirp(dirname(destination)); + const fileHandle = openSync(destination, 'w'); - if (response.status !== 200) { - throw new Error(`Unexpected status code ${response.status} when downloading ${url}`); - } + let error; + try { + log.debug( + `[${attempt}/${maxAttempts}] Attempting download of ${url}`, + chalk.dim(shaAlgorithm) + ); - const hash = createHash(shaAlgorithm); - await new Promise((resolve, reject) => { - response.data.on('data', (chunk: Buffer) => { - hash.update(chunk); - writeSync(fileHandle, chunk); + const response = await Axios.request({ + url, + responseType: 'stream', + adapter: AxiosHttpAdapter, }); - response.data.on('error', reject); - response.data.on('end', resolve); - }); + if (response.status !== 200) { + throw new Error(`Unexpected status code ${response.status} when downloading ${url}`); + } - const downloadedSha = hash.digest('hex'); - if (downloadedSha !== shaChecksum) { - throw new Error( - `Downloaded checksum ${downloadedSha} does not match the expected ${shaAlgorithm} checksum.` - ); + const hash = createHash(shaAlgorithm); + await new Promise((resolve, reject) => { + response.data.on('data', (chunk: Buffer) => { + hash.update(chunk); + writeSync(fileHandle, chunk); + }); + + response.data.on('error', reject); + response.data.on('end', resolve); + }); + + const downloadedSha = hash.digest('hex'); + if (downloadedSha !== shaChecksum) { + throw new Error( + `Downloaded checksum ${downloadedSha} does not match the expected ${shaAlgorithm} checksum.` + ); + } + } catch (_error) { + error = _error; + } finally { + closeSync(fileHandle); } - } catch (_error) { - error = _error; - } finally { - closeSync(fileHandle); - } - if (!error) { - log.debug(`Downloaded ${url} and verified checksum`); - return; - } + if (!error) { + log.debug(`Downloaded ${url} and verified checksum`); + return; + } - log.debug(`Download failed: ${error.message}`); + log.debug(`Download failed: ${error.message}`); - // cleanup downloaded data and log error - log.debug(`Deleting downloaded data at ${destination}`); - tryUnlink(destination); + // cleanup downloaded data and log error + log.debug(`Deleting downloaded data at ${destination}`); + tryUnlink(destination); - // retry if we have retries left - if (retries > 0) { - log.debug(`Retrying - ${retries} attempt remaining`); - return await download({ - ...options, - retries: retries - 1, - }); + // retry if we have retries left + if (attempt < maxAttempts) { + const sec = attempt * retryDelaySecMultiplier; + log.info(`Retrying in ${sec} seconds`); + await setTimeout(sec * 1000); + continue; + } + + throw error; } +} + +interface DownloadToStringOptions { + log: ToolingLog; + url: string; + expectStatus?: number; + maxAttempts?: number; + retryDelaySecMultiplier?: number; +} +export async function downloadToString({ + log, + url, + expectStatus, + maxAttempts = 3, + retryDelaySecMultiplier = 5, +}: DownloadToStringOptions) { + let attempt = 0; + while (true) { + try { + attempt += 1; + log.debug(`[${attempt}/${maxAttempts}] Attempting download to string of [${url}]`); + + const resp = await Axios.request({ + url, + method: 'GET', + adapter: AxiosHttpAdapter, + responseType: 'text', + validateStatus: !expectStatus ? undefined : (status) => status === expectStatus, + }); + + log.success(`Downloaded [${url}]`); + return resp.data; + } catch (error) { + log.warning(`Download failed: ${error.message}`); + if (isAxiosResponseError(error)) { + log.debug( + `[${error.response.status}/${error.response.statusText}] response: ${error.response.data}` + ); + } else { + log.debug('received no response'); + } + + if ((maxAttempts ?? 3) > attempt) { + const sec = (retryDelaySecMultiplier ?? 5) * attempt; + log.info(`Retrying in ${sec} seconds`); + await setTimeout(sec * 1000); + continue; + } - throw error; + throw error; + } + } } diff --git a/src/dev/build/lib/integration_tests/download.test.ts b/src/dev/build/lib/integration_tests/download.test.ts index 173682ef05d71..7f885fdc02d28 100644 --- a/src/dev/build/lib/integration_tests/download.test.ts +++ b/src/dev/build/lib/integration_tests/download.test.ts @@ -13,14 +13,25 @@ import { readFileSync } from 'fs'; import del from 'del'; import { CI_PARALLEL_PROCESS_PREFIX } from '@kbn/test'; -import { ToolingLog } from '@kbn/dev-utils'; +import { + ToolingLog, + ToolingLogCollectingWriter, + createStripAnsiSerializer, + createReplaceSerializer, +} from '@kbn/dev-utils'; import { mkdirp } from '../fs'; -import { download } from '../download'; +import { downloadToDisk, downloadToString } from '../download'; const TMP_DIR = join(tmpdir(), CI_PARALLEL_PROCESS_PREFIX, 'download-js-test-tmp-dir'); const TMP_DESTINATION = join(TMP_DIR, '__tmp_download_js_test_file__'); +expect.addSnapshotSerializer(createStripAnsiSerializer()); +expect.addSnapshotSerializer(createReplaceSerializer(TMP_DIR, 'TMP_DIR')); +expect.addSnapshotSerializer( + createReplaceSerializer(/http:\/\/localhost:\d+\//g, 'TEST_SERVER_URL') +); + beforeEach(async () => { await del(TMP_DIR, { force: true }); await mkdirp(TMP_DIR); @@ -31,12 +42,11 @@ afterEach(async () => { await del(TMP_DIR, { force: true }); }); -const onLogLine = jest.fn(); -const log = new ToolingLog({ - level: 'verbose', - writeTo: { - write: onLogLine, - }, +const logWritter = new ToolingLogCollectingWriter('verbose'); +const log = new ToolingLog(); +log.setWriters([logWritter]); +afterEach(() => { + logWritter.messages.length = 0; }); type Handler = (req: IncomingMessage, res: ServerResponse) => void; @@ -54,18 +64,14 @@ const sendErrorHandler: Handler = (req, res) => { }; let serverUrl: string; -let nextHandler: Handler | null = null; +const handlers: Handler[] = []; const server = createServer((req, res) => { - if (!nextHandler) { - nextHandler = sendErrorHandler; - } - - const handler = nextHandler; - nextHandler = null; - handler(req, res); + (handlers.shift() ?? sendErrorHandler)(req, res); }); -afterEach(() => (nextHandler = null)); +afterEach(() => { + handlers.length = 0; +}); beforeAll(async () => { await Promise.race([ @@ -87,136 +93,224 @@ afterAll(async () => { server.close(); }); -it('downloads from URL and checks that content matches sha256', async () => { - nextHandler = createSendHandler('foo'); - await download({ - log, - url: serverUrl, - destination: TMP_DESTINATION, - shaChecksum: FOO_SHA256, - shaAlgorithm: 'sha256', - }); - expect(readFileSync(TMP_DESTINATION, 'utf8')).toBe('foo'); -}); - -it('rejects and deletes destination if sha256 does not match', async () => { - nextHandler = createSendHandler('foo'); - - try { - await download({ +describe('downloadToDisk', () => { + it('downloads from URL and checks that content matches sha256', async () => { + handlers.push(createSendHandler('foo')); + await downloadToDisk({ log, url: serverUrl, destination: TMP_DESTINATION, - shaChecksum: 'bar', + shaChecksum: FOO_SHA256, shaAlgorithm: 'sha256', }); - throw new Error('Expected download() to reject'); - } catch (error) { - expect(error).toHaveProperty( - 'message', - expect.stringContaining('does not match the expected sha256 checksum') - ); - } - - try { - readFileSync(TMP_DESTINATION); - throw new Error('Expected download to be deleted'); - } catch (error) { - expect(error).toHaveProperty('code', 'ENOENT'); - } -}); + expect(readFileSync(TMP_DESTINATION, 'utf8')).toBe('foo'); + }); -describe('reties download retries: number of times', () => { - it('resolves if retries = 1 and first attempt fails', async () => { - let reqCount = 0; - nextHandler = function sequenceHandler(req, res) { - switch (++reqCount) { - case 1: - nextHandler = sequenceHandler; - return sendErrorHandler(req, res); - default: - return createSendHandler('foo')(req, res); - } - }; + it('rejects and deletes destination if sha256 does not match', async () => { + handlers.push(createSendHandler('foo')); - await download({ + const promise = downloadToDisk({ log, url: serverUrl, destination: TMP_DESTINATION, - shaChecksum: FOO_SHA256, + shaChecksum: 'bar', shaAlgorithm: 'sha256', - retries: 2, }); + await expect(promise).rejects.toMatchInlineSnapshot( + `[Error: Downloaded checksum 2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae does not match the expected sha256 checksum.]` + ); - expect(readFileSync(TMP_DESTINATION, 'utf8')).toBe('foo'); + try { + readFileSync(TMP_DESTINATION); + throw new Error('Expected download to be deleted'); + } catch (error) { + expect(error).toHaveProperty('code', 'ENOENT'); + } }); - it('resolves if first fails, second is bad shasum, but third succeeds', async () => { - let reqCount = 0; - nextHandler = function sequenceHandler(req, res) { - switch (++reqCount) { - case 1: - nextHandler = sequenceHandler; - return sendErrorHandler(req, res); - case 2: - nextHandler = sequenceHandler; - return createSendHandler('bar')(req, res); - default: - return createSendHandler('foo')(req, res); - } - }; + describe('reties download retries: number of times', () => { + it('resolves if retries = 1 and first attempt fails', async () => { + handlers.push(sendErrorHandler, createSendHandler('foo')); - await download({ - log, - url: serverUrl, - destination: TMP_DESTINATION, - shaChecksum: FOO_SHA256, - shaAlgorithm: 'sha256', - retries: 2, + await downloadToDisk({ + log, + url: serverUrl, + destination: TMP_DESTINATION, + shaChecksum: FOO_SHA256, + shaAlgorithm: 'sha256', + maxAttempts: 2, + retryDelaySecMultiplier: 0.1, + }); + + expect(readFileSync(TMP_DESTINATION, 'utf8')).toBe('foo'); + expect(logWritter.messages).toMatchInlineSnapshot(` + Array [ + " debg [1/2] Attempting download of TEST_SERVER_URL sha256", + " debg Download failed: Request failed with status code 500", + " debg Deleting downloaded data at TMP_DIR/__tmp_download_js_test_file__", + " info Retrying in 0.1 seconds", + " debg [2/2] Attempting download of TEST_SERVER_URL sha256", + " debg Downloaded TEST_SERVER_URL and verified checksum", + ] + `); }); - }); - it('makes 6 requests if `retries: 5` and all failed', async () => { - let reqCount = 0; - nextHandler = function sequenceHandler(req, res) { - reqCount += 1; - nextHandler = sequenceHandler; - sendErrorHandler(req, res); - }; + it('resolves if first fails, second is bad shasum, but third succeeds', async () => { + handlers.push(sendErrorHandler, createSendHandler('bar'), createSendHandler('foo')); - try { - await download({ + await downloadToDisk({ log, url: serverUrl, destination: TMP_DESTINATION, shaChecksum: FOO_SHA256, shaAlgorithm: 'sha256', - retries: 5, + maxAttempts: 3, + retryDelaySecMultiplier: 0.1, }); - throw new Error('Expected download() to reject'); - } catch (error) { - expect(error).toHaveProperty( - 'message', - expect.stringContaining('Request failed with status code 500') + + expect(logWritter.messages).toMatchInlineSnapshot(` + Array [ + " debg [1/3] Attempting download of TEST_SERVER_URL sha256", + " debg Download failed: Request failed with status code 500", + " debg Deleting downloaded data at TMP_DIR/__tmp_download_js_test_file__", + " info Retrying in 0.1 seconds", + " debg [2/3] Attempting download of TEST_SERVER_URL sha256", + " debg Download failed: Downloaded checksum fcde2b2edba56bf408601fb721fe9b5c338d10ee429ea04fae5511b68fbf8fb9 does not match the expected sha256 checksum.", + " debg Deleting downloaded data at TMP_DIR/__tmp_download_js_test_file__", + " info Retrying in 0.2 seconds", + " debg [3/3] Attempting download of TEST_SERVER_URL sha256", + " debg Downloaded TEST_SERVER_URL and verified checksum", + ] + `); + }); + + it('makes 5 requests if `maxAttempts: 5` and all failed', async () => { + const promise = downloadToDisk({ + log, + url: serverUrl, + destination: TMP_DESTINATION, + shaChecksum: FOO_SHA256, + shaAlgorithm: 'sha256', + maxAttempts: 5, + retryDelaySecMultiplier: 0.1, + }); + await expect(promise).rejects.toMatchInlineSnapshot( + `[Error: Request failed with status code 500]` ); - expect(reqCount).toBe(6); - } + expect(logWritter.messages).toMatchInlineSnapshot(` + Array [ + " debg [1/5] Attempting download of TEST_SERVER_URL sha256", + " debg Download failed: Request failed with status code 500", + " debg Deleting downloaded data at TMP_DIR/__tmp_download_js_test_file__", + " info Retrying in 0.1 seconds", + " debg [2/5] Attempting download of TEST_SERVER_URL sha256", + " debg Download failed: Request failed with status code 500", + " debg Deleting downloaded data at TMP_DIR/__tmp_download_js_test_file__", + " info Retrying in 0.2 seconds", + " debg [3/5] Attempting download of TEST_SERVER_URL sha256", + " debg Download failed: Request failed with status code 500", + " debg Deleting downloaded data at TMP_DIR/__tmp_download_js_test_file__", + " info Retrying in 0.30000000000000004 seconds", + " debg [4/5] Attempting download of TEST_SERVER_URL sha256", + " debg Download failed: Request failed with status code 500", + " debg Deleting downloaded data at TMP_DIR/__tmp_download_js_test_file__", + " info Retrying in 0.4 seconds", + " debg [5/5] Attempting download of TEST_SERVER_URL sha256", + " debg Download failed: Request failed with status code 500", + " debg Deleting downloaded data at TMP_DIR/__tmp_download_js_test_file__", + ] + `); + }); }); -}); -describe('sha256 option not supplied', () => { - it('refuses to download', async () => { - try { + describe('sha256 option not supplied', () => { + it('refuses to download', async () => { // @ts-expect-error missing sha256 param is intentional - await download({ + const promise = downloadToDisk({ log, url: 'http://google.com', destination: TMP_DESTINATION, }); - throw new Error('expected download() to reject'); - } catch (error) { - expect(error).toHaveProperty('message', expect.stringContaining('refusing to download')); - } + await expect(promise).rejects.toMatchInlineSnapshot( + `[Error: undefined checksum of http://google.com not provided, refusing to download.]` + ); + }); + }); +}); + +describe('downloadToString', () => { + it('returns a string from the server', async () => { + handlers.push(createSendHandler('foo bar')); + + const result = await downloadToString({ log, url: serverUrl }); + expect(result).toBe('foo bar'); + expect(logWritter.messages).toMatchInlineSnapshot(` + Array [ + " debg [1/3] Attempting download to string of [TEST_SERVER_URL]", + " succ Downloaded [TEST_SERVER_URL]", + ] + `); + }); + + it(`throws when expectStatus doesn't match`, async () => { + handlers.push(createSendHandler('foo')); + + const promise = downloadToString({ + log, + url: serverUrl, + expectStatus: 201, + maxAttempts: 1, + }); + await expect(promise).rejects.toMatchInlineSnapshot( + `[Error: Request failed with status code 200]` + ); + expect(logWritter.messages).toMatchInlineSnapshot(` + Array [ + " debg [1/1] Attempting download to string of [TEST_SERVER_URL]", + " warn Download failed: Request failed with status code 200", + " debg [200/OK] response: foo", + ] + `); + }); + + it(`retries when expectStatus doesn't match`, async () => { + handlers.push( + (_, res) => { + res.statusCode = 500; + res.end('something went wrong'); + }, + (_, res) => { + res.statusCode = 404; + res.end('not found'); + }, + (_, res) => { + res.statusCode = 201; + res.end('bar'); + } + ); + + const result = await downloadToString({ + log, + url: serverUrl, + expectStatus: 201, + retryDelaySecMultiplier: 0.1, + }); + + expect(result).toBe('bar'); + expect(logWritter.messages).toMatchInlineSnapshot(` + Array [ + " debg [1/3] Attempting download to string of [TEST_SERVER_URL]", + " warn Download failed: Request failed with status code 500", + " debg [500/Internal Server Error] response: something went wrong", + " info Retrying in 0.1 seconds", + " debg [2/3] Attempting download to string of [TEST_SERVER_URL]", + " warn Download failed: Request failed with status code 404", + " debg [404/Not Found] response: not found", + " info Retrying in 0.2 seconds", + " debg [3/3] Attempting download to string of [TEST_SERVER_URL]", + " succ Downloaded [TEST_SERVER_URL]", + ] + `); }); }); diff --git a/src/dev/build/lib/runner.test.ts b/src/dev/build/lib/runner.test.ts index 2a08da2797a9d..7c49c35446833 100644 --- a/src/dev/build/lib/runner.test.ts +++ b/src/dev/build/lib/runner.test.ts @@ -50,6 +50,8 @@ const setup = async () => { isRelease: true, targetAllPlatforms: true, versionQualifier: '-SNAPSHOT', + dockerPush: false, + dockerTagQualifier: '', }); const run = createRunner({ diff --git a/src/dev/build/tasks/download_cloud_dependencies.ts b/src/dev/build/tasks/download_cloud_dependencies.ts index 5b5ba2a9ff625..be1767769cff0 100644 --- a/src/dev/build/tasks/download_cloud_dependencies.ts +++ b/src/dev/build/tasks/download_cloud_dependencies.ts @@ -6,10 +6,9 @@ * Side Public License, v 1. */ -import axios from 'axios'; import Path from 'path'; import del from 'del'; -import { Task, download } from '../lib'; +import { Task, downloadToDisk, downloadToString } from '../lib'; export const DownloadCloudDependencies: Task = { description: 'Downloading cloud dependencies', @@ -20,18 +19,15 @@ export const DownloadCloudDependencies: Task = { const version = config.getBuildVersion(); const architecture = process.arch === 'arm64' ? 'arm64' : 'x86_64'; const url = `https://${subdomain}-no-kpi.elastic.co/downloads/beats/${beat}/${beat}-${version}-linux-${architecture}.tar.gz`; - const checksumRes = await axios.get(url + '.sha512'); - if (checksumRes.status !== 200) { - throw new Error(`Unexpected status code ${checksumRes.status} when downloading ${url}`); - } + const checksum = await downloadToString({ log, url: url + '.sha512', expectStatus: 200 }); const destination = config.resolveFromRepo('.beats', Path.basename(url)); - return download({ + return downloadToDisk({ log, url, destination, - shaChecksum: checksumRes.data.split(' ')[0], + shaChecksum: checksum.split(' ')[0], shaAlgorithm: 'sha512', - retries: 3, + maxAttempts: 3, }); }; diff --git a/src/dev/build/tasks/nodejs/download_node_builds_task.test.ts b/src/dev/build/tasks/nodejs/download_node_builds_task.test.ts index ec82caac273cf..b1309bd05c603 100644 --- a/src/dev/build/tasks/nodejs/download_node_builds_task.test.ts +++ b/src/dev/build/tasks/nodejs/download_node_builds_task.test.ts @@ -24,7 +24,7 @@ expect.addSnapshotSerializer(createAnyInstanceSerializer(ToolingLog)); const { getNodeDownloadInfo } = jest.requireMock('./node_download_info'); const { getNodeShasums } = jest.requireMock('./node_shasums'); -const { download } = jest.requireMock('../../lib/download'); +const { downloadToDisk } = jest.requireMock('../../lib/download'); const log = new ToolingLog(); const testWriter = new ToolingLogCollectingWriter(); @@ -39,6 +39,8 @@ async function setup({ failOnUrl }: { failOnUrl?: string } = {}) { const config = await Config.create({ isRelease: true, targetAllPlatforms: true, + dockerPush: false, + dockerTagQualifier: '', }); getNodeDownloadInfo.mockImplementation((_: Config, platform: Platform) => { @@ -55,7 +57,7 @@ async function setup({ failOnUrl }: { failOnUrl?: string } = {}) { 'win32:downloadName': 'win32:sha256', }); - download.mockImplementation(({ url }: any) => { + downloadToDisk.mockImplementation(({ url }: any) => { if (url === failOnUrl) { throw new Error('Download failed for reasons'); } @@ -69,13 +71,13 @@ it('downloads node builds for each platform', async () => { await DownloadNodeBuilds.run(config, log, []); - expect(download.mock.calls).toMatchInlineSnapshot(` + expect(downloadToDisk.mock.calls).toMatchInlineSnapshot(` Array [ Array [ Object { "destination": "linux:downloadPath", "log": , - "retries": 3, + "maxAttempts": 3, "shaAlgorithm": "sha256", "shaChecksum": "linux:sha256", "url": "linux:url", @@ -85,7 +87,7 @@ it('downloads node builds for each platform', async () => { Object { "destination": "linux:downloadPath", "log": , - "retries": 3, + "maxAttempts": 3, "shaAlgorithm": "sha256", "shaChecksum": "linux:sha256", "url": "linux:url", @@ -95,7 +97,7 @@ it('downloads node builds for each platform', async () => { Object { "destination": "darwin:downloadPath", "log": , - "retries": 3, + "maxAttempts": 3, "shaAlgorithm": "sha256", "shaChecksum": "darwin:sha256", "url": "darwin:url", @@ -105,7 +107,7 @@ it('downloads node builds for each platform', async () => { Object { "destination": "darwin:downloadPath", "log": , - "retries": 3, + "maxAttempts": 3, "shaAlgorithm": "sha256", "shaChecksum": "darwin:sha256", "url": "darwin:url", @@ -115,7 +117,7 @@ it('downloads node builds for each platform', async () => { Object { "destination": "win32:downloadPath", "log": , - "retries": 3, + "maxAttempts": 3, "shaAlgorithm": "sha256", "shaChecksum": "win32:sha256", "url": "win32:url", diff --git a/src/dev/build/tasks/nodejs/download_node_builds_task.ts b/src/dev/build/tasks/nodejs/download_node_builds_task.ts index f19195092d964..9bc46def46964 100644 --- a/src/dev/build/tasks/nodejs/download_node_builds_task.ts +++ b/src/dev/build/tasks/nodejs/download_node_builds_task.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { download, GlobalTask } from '../../lib'; +import { downloadToDisk, GlobalTask } from '../../lib'; import { getNodeShasums } from './node_shasums'; import { getNodeDownloadInfo } from './node_download_info'; @@ -18,13 +18,13 @@ export const DownloadNodeBuilds: GlobalTask = { await Promise.all( config.getNodePlatforms().map(async (platform) => { const { url, downloadPath, downloadName } = getNodeDownloadInfo(config, platform); - await download({ + await downloadToDisk({ log, url, shaChecksum: shasums[downloadName], shaAlgorithm: 'sha256', destination: downloadPath, - retries: 3, + maxAttempts: 3, }); }) ); diff --git a/src/dev/build/tasks/nodejs/extract_node_builds_task.test.ts b/src/dev/build/tasks/nodejs/extract_node_builds_task.test.ts index 9f869b99c18ae..fb0891c24f3b0 100644 --- a/src/dev/build/tasks/nodejs/extract_node_builds_task.test.ts +++ b/src/dev/build/tasks/nodejs/extract_node_builds_task.test.ts @@ -43,6 +43,8 @@ async function setup() { const config = await Config.create({ isRelease: true, targetAllPlatforms: true, + dockerPush: false, + dockerTagQualifier: '', }); return { config }; diff --git a/src/dev/build/tasks/nodejs/node_shasums.test.ts b/src/dev/build/tasks/nodejs/node_shasums.test.ts index 4b1482f9c0820..20d1f297b9ae0 100644 --- a/src/dev/build/tasks/nodejs/node_shasums.test.ts +++ b/src/dev/build/tasks/nodejs/node_shasums.test.ts @@ -47,15 +47,12 @@ c4edece2c0aa68e816c4e067f397eb12e9d0c81bb37b3d349dbaf47cf246b0b7 win-x86/node.l 6a2ee7a0b0074ece27d171418d82ce25a60b87750ec30c5c9fbeaaca8c206fa5 win-x86/node_pdb.7z 1b44176d888c1bc6a6b05fcc6234031b3b8a58da9de8b99661088f998ac5e269 win-x86/node_pdb.zip`; -jest.mock('axios', () => ({ - async get(url: string) { +jest.mock('../../lib/download', () => ({ + async downloadToString({ url }: { url: string }) { expect(url).toBe( 'https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/dist/v8.9.4/SHASUMS256.txt' ); - return { - status: 200, - data: mockResponse, - }; + return mockResponse; }, })); diff --git a/src/dev/build/tasks/nodejs/node_shasums.ts b/src/dev/build/tasks/nodejs/node_shasums.ts index 973dc86977a8e..ca588352ce7bb 100644 --- a/src/dev/build/tasks/nodejs/node_shasums.ts +++ b/src/dev/build/tasks/nodejs/node_shasums.ts @@ -6,29 +6,22 @@ * Side Public License, v 1. */ -import axios from 'axios'; import { ToolingLog } from '@kbn/dev-utils'; +import { downloadToString } from '../../lib/download'; export async function getNodeShasums(log: ToolingLog, nodeVersion: string) { const url = `https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/dist/v${nodeVersion}/SHASUMS256.txt`; log.debug('Downloading shasum values for node version', nodeVersion, 'from', url); - const { status, data } = await axios.get(url); + const checksum = await downloadToString({ log, url, expectStatus: 200 }); - if (status !== 200) { - throw new Error(`${url} failed with a ${status} response`); - } + return checksum.split('\n').reduce((acc: Record, line: string) => { + const [sha, platform] = line.split(' '); - return data - .toString('utf8') - .split('\n') - .reduce((acc: Record, line: string) => { - const [sha, platform] = line.split(' '); - - return { - ...acc, - [platform]: sha, - }; - }, {}); + return { + ...acc, + [platform]: sha, + }; + }, {}); } diff --git a/src/dev/build/tasks/nodejs/verify_existing_node_builds_task.test.ts b/src/dev/build/tasks/nodejs/verify_existing_node_builds_task.test.ts index c636db145694c..3a71a2b06fe91 100644 --- a/src/dev/build/tasks/nodejs/verify_existing_node_builds_task.test.ts +++ b/src/dev/build/tasks/nodejs/verify_existing_node_builds_task.test.ts @@ -48,6 +48,8 @@ async function setup(actualShaSums?: Record) { const config = await Config.create({ isRelease: true, targetAllPlatforms: true, + dockerPush: false, + dockerTagQualifier: '', }); getNodeShasums.mockReturnValue( diff --git a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker index 8ce8e2cb40700..895c42ad5f47d 100755 --- a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker +++ b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker @@ -354,8 +354,6 @@ kibana_vars=( xpack.security.showInsecureClusterWarning xpack.securitySolution.alertMergeStrategy xpack.securitySolution.alertIgnoreFields - xpack.securitySolution.endpointResultListDefaultFirstPageIndex - xpack.securitySolution.endpointResultListDefaultPageSize xpack.securitySolution.maxRuleImportExportSize xpack.securitySolution.maxRuleImportPayloadBytes xpack.securitySolution.maxTimelineImportExportSize diff --git a/src/dev/build/tasks/os_packages/docker_generator/run.ts b/src/dev/build/tasks/os_packages/docker_generator/run.ts index 715516c3807ec..6a192baed3fa3 100644 --- a/src/dev/build/tasks/os_packages/docker_generator/run.ts +++ b/src/dev/build/tasks/os_packages/docker_generator/run.ts @@ -71,6 +71,9 @@ export async function runDockerGenerator( : []), ]; + const dockerPush = config.getDockerPush(); + const dockerTagQualifier = config.getDockerTagQualfiier(); + const scope: TemplateContext = { artifactPrefix, artifactTarball, @@ -82,6 +85,8 @@ export async function runDockerGenerator( imageTag, dockerBuildDir, dockerTargetFilename, + dockerPush, + dockerTagQualifier, baseOSImage, dockerBuildDate, ubi: flags.ubi, diff --git a/src/dev/build/tasks/os_packages/docker_generator/template_context.ts b/src/dev/build/tasks/os_packages/docker_generator/template_context.ts index 075a3a8808e73..143fcf16ace56 100644 --- a/src/dev/build/tasks/os_packages/docker_generator/template_context.ts +++ b/src/dev/build/tasks/os_packages/docker_generator/template_context.ts @@ -14,6 +14,8 @@ export interface TemplateContext { version: string; license: string; artifactsDir: string; + dockerPush: boolean; + dockerTagQualifier: string | null; imageTag: string; dockerBuildDir: string; dockerTargetFilename: string; diff --git a/src/dev/build/tasks/os_packages/docker_generator/templates/build_docker_sh.template.ts b/src/dev/build/tasks/os_packages/docker_generator/templates/build_docker_sh.template.ts index 05b9b4d100c53..de26705566585 100644 --- a/src/dev/build/tasks/os_packages/docker_generator/templates/build_docker_sh.template.ts +++ b/src/dev/build/tasks/os_packages/docker_generator/templates/build_docker_sh.template.ts @@ -13,11 +13,16 @@ import { TemplateContext } from '../template_context'; function generator({ imageTag, imageFlavor, + dockerPush, + dockerTagQualifier, version, dockerTargetFilename, baseOSImage, architecture, }: TemplateContext) { + const dockerTargetName = `${imageTag}${imageFlavor}:${version}${ + dockerTagQualifier ? '-' + dockerTagQualifier : '' + }`; return dedent(` #!/usr/bin/env bash # @@ -54,10 +59,11 @@ function generator({ retry_docker_pull ${baseOSImage} echo "Building: kibana${imageFlavor}-docker"; \\ - docker build -t ${imageTag}${imageFlavor}:${version} -f Dockerfile . || exit 1; + docker build -t ${dockerTargetName} -f Dockerfile . || exit 1; - docker save ${imageTag}${imageFlavor}:${version} | gzip -c > ${dockerTargetFilename} + docker save ${dockerTargetName} | gzip -c > ${dockerTargetFilename} + ${dockerPush} && docker image push ${dockerTargetName} exit 0 `); } diff --git a/src/dev/build/tasks/os_packages/docker_generator/templates/ironbank/Dockerfile b/src/dev/build/tasks/os_packages/docker_generator/templates/ironbank/Dockerfile index 79b089c097344..dbdace85eda01 100644 --- a/src/dev/build/tasks/os_packages/docker_generator/templates/ironbank/Dockerfile +++ b/src/dev/build/tasks/os_packages/docker_generator/templates/ironbank/Dockerfile @@ -60,7 +60,7 @@ COPY --chown=1000:0 config/kibana.yml /usr/share/kibana/config/kibana.yml # Add the launcher/wrapper script. It knows how to interpret environment # variables and translate them to Kibana CLI options. -COPY --chown=1000:0 bin/kibana-docker /usr/local/bin/ +COPY bin/kibana-docker /usr/local/bin/ # Remove the suid bit everywhere to mitigate "Stack Clash" RUN find / -xdev -perm -4000 -exec chmod u-s {} + diff --git a/src/dev/build/tasks/patch_native_modules_task.ts b/src/dev/build/tasks/patch_native_modules_task.ts index fe9743533b901..be7fa5b50a074 100644 --- a/src/dev/build/tasks/patch_native_modules_task.ts +++ b/src/dev/build/tasks/patch_native_modules_task.ts @@ -10,7 +10,17 @@ import path from 'path'; import { ToolingLog } from '@kbn/dev-utils'; -import { deleteAll, download, gunzip, untar, Task, Config, Build, Platform, read } from '../lib'; +import { + deleteAll, + downloadToDisk, + gunzip, + untar, + Task, + Config, + Build, + Platform, + read, +} from '../lib'; const DOWNLOAD_DIRECTORY = '.native_modules'; @@ -100,13 +110,13 @@ async function patchModule( log.debug(`Patching ${pkg.name} binaries from ${archive.url} to ${extractPath}`); await deleteAll([extractPath], log); - await download({ + await downloadToDisk({ log, url: archive.url, destination: downloadPath, shaChecksum: archive.sha256, shaAlgorithm: 'sha256', - retries: 3, + maxAttempts: 3, }); switch (pkg.extractMethod) { case 'gunzip': diff --git a/src/dev/i18n/tasks/extract_untracked_translations.ts b/src/dev/i18n/tasks/extract_untracked_translations.ts index 64ac773db27a7..7afaa1ef71a06 100644 --- a/src/dev/i18n/tasks/extract_untracked_translations.ts +++ b/src/dev/i18n/tasks/extract_untracked_translations.ts @@ -36,6 +36,7 @@ export async function extractUntrackedMessagesTask({ '**/build/**', '**/__fixtures__/**', '**/packages/kbn-i18n/**', + '**/packages/kbn-i18n-react/**', '**/packages/kbn-plugin-generator/template/**', '**/target/**', '**/test/**', diff --git a/src/plugins/advanced_settings/public/component_registry/component_registry.ts b/src/plugins/advanced_settings/public/component_registry/component_registry.ts index adac6e83d46a3..93b0ab67b50cf 100644 --- a/src/plugins/advanced_settings/public/component_registry/component_registry.ts +++ b/src/plugins/advanced_settings/public/component_registry/component_registry.ts @@ -34,47 +34,43 @@ export class ComponentRegistry { registry: { [key in Id]?: RegistryComponent } = {}; - /** - * Attempts to register the provided component, with the ability to optionally allow - * the component to override an existing one. - * - * If the intent is to override, then `allowOverride` must be set to true, otherwise an exception is thrown. - * - * @param {*} id the id of the component to register - * @param {*} component the component - * @param {*} allowOverride (default: false) - optional flag to allow this component to override a previously registered component - */ - private register(id: Id, component: RegistryComponent, allowOverride = false) { - if (!allowOverride && id in this.registry) { - throw new Error(`Component with id ${id} is already registered.`); - } - - // Setting a display name if one does not already exist. - // This enhances the snapshots, as well as the debugging experience. - if (!component.displayName) { - component.displayName = id; - } - - this.registry[id] = component; - } - - /** - * Retrieve a registered component by its ID. - * If the component does not exist, then an exception is thrown. - * - * @param {*} id the ID of the component to retrieve - */ - private get(id: Id): RegistryComponent { - return this.registry[id] || ComponentRegistry.defaultRegistry[id]; - } - setup = { componentType: ComponentRegistry.componentType, - register: this.register.bind(this), + /** + * Attempts to register the provided component, with the ability to optionally allow + * the component to override an existing one. + * + * If the intent is to override, then `allowOverride` must be set to true, otherwise an exception is thrown. + * + * @param id the id of the component to register + * @param component the component + * @param allowOverride (default: false) - optional flag to allow this component to override a previously registered component + */ + register: (id: Id, component: RegistryComponent, allowOverride = false) => { + if (!allowOverride && id in this.registry) { + throw new Error(`Component with id ${id} is already registered.`); + } + + // Setting a display name if one does not already exist. + // This enhances the snapshots, as well as the debugging experience. + if (!component.displayName) { + component.displayName = id; + } + + this.registry[id] = component; + }, }; start = { componentType: ComponentRegistry.componentType, - get: this.get.bind(this), + /** + * Retrieve a registered component by its ID. + * If the component does not exist, then an exception is thrown. + * + * @param id the ID of the component to retrieve + */ + get: (id: Id): RegistryComponent => { + return this.registry[id] || ComponentRegistry.defaultRegistry[id]; + }, }; } diff --git a/src/plugins/advanced_settings/public/component_registry/page_title/page_title.tsx b/src/plugins/advanced_settings/public/component_registry/page_title/page_title.tsx index 53b12dcdd5f52..018644b3a9f9a 100644 --- a/src/plugins/advanced_settings/public/component_registry/page_title/page_title.tsx +++ b/src/plugins/advanced_settings/public/component_registry/page_title/page_title.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const PageTitle = () => { return ( diff --git a/src/plugins/advanced_settings/public/management_app/advanced_settings.test.tsx b/src/plugins/advanced_settings/public/management_app/advanced_settings.test.tsx index b897c1c73b89b..91f4a5e6be471 100644 --- a/src/plugins/advanced_settings/public/management_app/advanced_settings.test.tsx +++ b/src/plugins/advanced_settings/public/management_app/advanced_settings.test.tsx @@ -18,7 +18,11 @@ import { } from '../../../../core/public'; import { FieldSetting } from './types'; import { AdvancedSettings } from './advanced_settings'; -import { notificationServiceMock, docLinksServiceMock } from '../../../../core/public/mocks'; +import { + notificationServiceMock, + docLinksServiceMock, + themeServiceMock, +} from '../../../../core/public/mocks'; import { ComponentRegistry } from '../component_registry'; import { Search } from './components/search'; @@ -251,6 +255,7 @@ describe('AdvancedSettings', () => { dockLinks={docLinksServiceMock.createStartContract().links} uiSettings={mockConfig().core.uiSettings} componentRegistry={new ComponentRegistry().start} + theme={themeServiceMock.createStartContract().theme$} /> ); @@ -273,6 +278,7 @@ describe('AdvancedSettings', () => { dockLinks={docLinksServiceMock.createStartContract().links} uiSettings={mockConfig().core.uiSettings} componentRegistry={new ComponentRegistry().start} + theme={themeServiceMock.createStartContract().theme$} /> ); @@ -299,6 +305,7 @@ describe('AdvancedSettings', () => { dockLinks={docLinksServiceMock.createStartContract().links} uiSettings={mockConfig().core.uiSettings} componentRegistry={new ComponentRegistry().start} + theme={themeServiceMock.createStartContract().theme$} /> ); diff --git a/src/plugins/advanced_settings/public/management_app/advanced_settings.tsx b/src/plugins/advanced_settings/public/management_app/advanced_settings.tsx index 1391312df5231..c0decf516fbad 100644 --- a/src/plugins/advanced_settings/public/management_app/advanced_settings.tsx +++ b/src/plugins/advanced_settings/public/management_app/advanced_settings.tsx @@ -19,6 +19,7 @@ import { DocLinksStart, ToastsStart, ScopedHistory, + ThemeServiceStart, } from '../../../../core/public'; import { url } from '../../../kibana_utils/public'; @@ -41,6 +42,7 @@ interface AdvancedSettingsProps { uiSettings: IUiSettingsClient; dockLinks: DocLinksStart['links']; toasts: ToastsStart; + theme: ThemeServiceStart['theme$']; componentRegistry: ComponentRegistry['start']; trackUiMetric?: (metricType: UiCounterMetricType, eventName: string | string[]) => void; } @@ -270,6 +272,7 @@ export class AdvancedSettings extends Component { return ( diff --git a/src/plugins/advanced_settings/public/management_app/components/field/field.test.tsx b/src/plugins/advanced_settings/public/management_app/components/field/field.test.tsx index b90efe9033da0..7047959522427 100644 --- a/src/plugins/advanced_settings/public/management_app/components/field/field.test.tsx +++ b/src/plugins/advanced_settings/public/management_app/components/field/field.test.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { shallowWithI18nProvider, mountWithI18nProvider } from '@kbn/test/jest'; import { mount, ReactWrapper } from 'enzyme'; import { FieldSetting } from '../../types'; diff --git a/src/plugins/advanced_settings/public/management_app/components/field/field.tsx b/src/plugins/advanced_settings/public/management_app/components/field/field.tsx index 5e4d047b2c701..586609fa1bf64 100644 --- a/src/plugins/advanced_settings/public/management_app/components/field/field.tsx +++ b/src/plugins/advanced_settings/public/management_app/components/field/field.tsx @@ -35,7 +35,7 @@ import { EuiToolTip, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { FieldSetting, FieldState } from '../../types'; import { isDefaultValue } from '../../lib'; import { UiSettingsType, DocLinksStart, ToastsStart } from '../../../../../../core/public'; diff --git a/src/plugins/advanced_settings/public/management_app/components/form/form.test.tsx b/src/plugins/advanced_settings/public/management_app/components/form/form.test.tsx index 2fbee2d57ebe6..a371831dcb007 100644 --- a/src/plugins/advanced_settings/public/management_app/components/form/form.test.tsx +++ b/src/plugins/advanced_settings/public/management_app/components/form/form.test.tsx @@ -9,6 +9,7 @@ import React from 'react'; import { shallowWithI18nProvider, mountWithI18nProvider } from '@kbn/test/jest'; import { UiSettingsType } from '../../../../../../core/public'; +import { themeServiceMock } from '../../../../../../core/public/mocks'; import { findTestSubject } from '@elastic/eui/lib/test'; @@ -127,6 +128,7 @@ describe('Form', () => { enableSaving={true} toasts={{} as any} dockLinks={{} as any} + theme={themeServiceMock.createStartContract().theme$} /> ); @@ -146,6 +148,7 @@ describe('Form', () => { enableSaving={false} toasts={{} as any} dockLinks={{} as any} + theme={themeServiceMock.createStartContract().theme$} /> ); @@ -165,6 +168,7 @@ describe('Form', () => { enableSaving={true} toasts={{} as any} dockLinks={{} as any} + theme={themeServiceMock.createStartContract().theme$} /> ); @@ -184,6 +188,7 @@ describe('Form', () => { enableSaving={true} toasts={{} as any} dockLinks={{} as any} + theme={themeServiceMock.createStartContract().theme$} /> ); @@ -203,6 +208,7 @@ describe('Form', () => { enableSaving={false} toasts={{} as any} dockLinks={{} as any} + theme={themeServiceMock.createStartContract().theme$} /> ); (wrapper.instance() as Form).setState({ @@ -233,6 +239,7 @@ describe('Form', () => { enableSaving={false} toasts={toasts} dockLinks={{} as any} + theme={themeServiceMock.createStartContract().theme$} /> ); (wrapper.instance() as Form).setState({ @@ -269,6 +276,7 @@ describe('Form', () => { enableSaving={false} toasts={{} as any} dockLinks={{} as any} + theme={themeServiceMock.createStartContract().theme$} /> ); @@ -297,6 +305,7 @@ describe('Form', () => { enableSaving={false} toasts={{} as any} dockLinks={{} as any} + theme={themeServiceMock.createStartContract().theme$} /> ); diff --git a/src/plugins/advanced_settings/public/management_app/components/form/form.tsx b/src/plugins/advanced_settings/public/management_app/components/form/form.tsx index 2356cc7690c7c..a398155131bd4 100644 --- a/src/plugins/advanced_settings/public/management_app/components/form/form.tsx +++ b/src/plugins/advanced_settings/public/management_app/components/form/form.tsx @@ -22,12 +22,12 @@ import { EuiButtonEmpty, EuiTitle, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { isEmpty } from 'lodash'; import { i18n } from '@kbn/i18n'; import { UiCounterMetricType } from '@kbn/analytics'; -import { toMountPoint } from '../../../../../kibana_react/public'; -import { DocLinksStart, ToastsStart } from '../../../../../../core/public'; +import { KibanaThemeProvider, toMountPoint } from '../../../../../kibana_react/public'; +import { DocLinksStart, ThemeServiceStart, ToastsStart } from '../../../../../../core/public'; import { getCategoryName } from '../../lib'; import { Field, getEditableValue } from '../field'; @@ -46,6 +46,7 @@ interface FormProps { enableSaving: boolean; dockLinks: DocLinksStart['links']; toasts: ToastsStart; + theme: ThemeServiceStart['theme$']; trackUiMetric?: (metricType: UiCounterMetricType, eventName: string | string[]) => void; queryText?: string; } @@ -191,7 +192,7 @@ export class Form extends PureComponent { defaultMessage: 'One or more settings require you to reload the page to take effect.', }), text: toMountPoint( - <> + window.location.reload()}> @@ -201,7 +202,7 @@ export class Form extends PureComponent { - + ), color: 'success', }); diff --git a/src/plugins/advanced_settings/public/management_app/mount_management_section.tsx b/src/plugins/advanced_settings/public/management_app/mount_management_section.tsx index 3a4ec83e28963..baef0fe38e3fe 100644 --- a/src/plugins/advanced_settings/public/management_app/mount_management_section.tsx +++ b/src/plugins/advanced_settings/public/management_app/mount_management_section.tsx @@ -11,9 +11,10 @@ import ReactDOM from 'react-dom'; import { Router, Switch, Route, Redirect, RouteChildrenProps } from 'react-router-dom'; import { i18n } from '@kbn/i18n'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { LocationDescriptor } from 'history'; +import { KibanaThemeProvider } from '../../../kibana_react/public'; import { url } from '../../../kibana_utils/public'; import { ManagementAppMountParams } from '../../../management/public'; import { UsageCollectionSetup } from '../../../usage_collection/public'; @@ -70,25 +71,28 @@ export async function mountManagementSection( chrome.docTitle.change(title); ReactDOM.render( - - - - {/* TODO: remove route param (`query`) in 7.13 */} - {(props) => } - - - - - - , + + + + + {/* TODO: remove route param (`query`) in 7.13 */} + {(props) => } + + + + + + + , params.element ); return () => { diff --git a/src/plugins/chart_expressions/expression_metric/kibana.json b/src/plugins/chart_expressions/expression_metric/kibana.json index c662dc1310323..dec818b1f17df 100755 --- a/src/plugins/chart_expressions/expression_metric/kibana.json +++ b/src/plugins/chart_expressions/expression_metric/kibana.json @@ -10,6 +10,6 @@ "server": true, "ui": true, "requiredPlugins": ["expressions", "fieldFormats", "charts", "visualizations", "presentationUtil"], - "requiredBundles": ["kibanaUtils"], + "requiredBundles": ["kibanaUtils", "kibanaReact"], "optionalPlugins": [] } diff --git a/src/plugins/chart_expressions/expression_metric/public/__stories__/metric_renderer.stories.tsx b/src/plugins/chart_expressions/expression_metric/public/__stories__/metric_renderer.stories.tsx index 748ef15a6c9c9..18f97f23538c2 100644 --- a/src/plugins/chart_expressions/expression_metric/public/__stories__/metric_renderer.stories.tsx +++ b/src/plugins/chart_expressions/expression_metric/public/__stories__/metric_renderer.stories.tsx @@ -8,11 +8,12 @@ import React from 'react'; import { storiesOf } from '@storybook/react'; +import { from } from 'rxjs'; import { ExpressionValueVisDimension } from '../../../../visualizations/common'; import { Datatable, DatatableColumn } from '../../../../expressions'; import { Render } from '../../../../presentation_util/public/__stories__'; import { ColorMode, CustomPaletteState } from '../../../../charts/common'; -import { metricVisRenderer } from '../expression_renderers'; +import { getMetricVisRenderer } from '../expression_renderers'; import { MetricStyle, MetricVisRenderConfig, visType } from '../../common/types'; const palette: CustomPaletteState = { @@ -117,6 +118,8 @@ const containerSize = { height: '700px', }; +const metricVisRenderer = getMetricVisRenderer({ theme$: from([{ darkMode: false }]) }); + storiesOf('renderers/visMetric', module) .add('Default', () => { return ; diff --git a/src/plugins/chart_expressions/expression_metric/public/expression_renderers/index.ts b/src/plugins/chart_expressions/expression_metric/public/expression_renderers/index.ts index b4fb6cea84aa3..98a987db2fd43 100644 --- a/src/plugins/chart_expressions/expression_metric/public/expression_renderers/index.ts +++ b/src/plugins/chart_expressions/expression_metric/public/expression_renderers/index.ts @@ -6,4 +6,4 @@ * Side Public License, v 1. */ -export { metricVisRenderer } from './metric_vis_renderer'; +export { getMetricVisRenderer } from './metric_vis_renderer'; diff --git a/src/plugins/chart_expressions/expression_metric/public/expression_renderers/metric_vis_renderer.tsx b/src/plugins/chart_expressions/expression_metric/public/expression_renderers/metric_vis_renderer.tsx index 6c3c7696fca40..f6cc73c366e4e 100644 --- a/src/plugins/chart_expressions/expression_metric/public/expression_renderers/metric_vis_renderer.tsx +++ b/src/plugins/chart_expressions/expression_metric/public/expression_renderers/metric_vis_renderer.tsx @@ -9,6 +9,8 @@ import React, { lazy } from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; +import { ThemeServiceStart } from 'kibana/public'; +import { KibanaThemeProvider } from '../../../../kibana_react/public'; import { VisualizationContainer } from '../../../../visualizations/public'; import { ExpressionRenderDefinition } from '../../../../expressions/common/expression_renderers'; import { EXPRESSION_METRIC_NAME, MetricVisRenderConfig } from '../../common'; @@ -16,29 +18,35 @@ import { EXPRESSION_METRIC_NAME, MetricVisRenderConfig } from '../../common'; // @ts-ignore const MetricVisComponent = lazy(() => import('../components/metric_component')); -export const metricVisRenderer: () => ExpressionRenderDefinition = () => ({ - name: EXPRESSION_METRIC_NAME, - displayName: 'metric visualization', - reuseDomNode: true, - render: async (domNode, { visData, visConfig }, handlers) => { - handlers.onDestroy(() => { - unmountComponentAtNode(domNode); - }); +export const getMetricVisRenderer = ( + theme: ThemeServiceStart +): (() => ExpressionRenderDefinition) => { + return () => ({ + name: EXPRESSION_METRIC_NAME, + displayName: 'metric visualization', + reuseDomNode: true, + render: async (domNode, { visData, visConfig }, handlers) => { + handlers.onDestroy(() => { + unmountComponentAtNode(domNode); + }); - render( - - - , - domNode - ); - }, -}); + render( + + + + + , + domNode + ); + }, + }); +}; diff --git a/src/plugins/chart_expressions/expression_metric/public/plugin.ts b/src/plugins/chart_expressions/expression_metric/public/plugin.ts index 6053cba597b4b..f941b4a9e2f22 100644 --- a/src/plugins/chart_expressions/expression_metric/public/plugin.ts +++ b/src/plugins/chart_expressions/expression_metric/public/plugin.ts @@ -11,7 +11,7 @@ import { CoreSetup, CoreStart, Plugin } from '../../../../core/public'; import { Plugin as ExpressionsPublicPlugin } from '../../../expressions/public'; import { metricVisFunction } from '../common'; import { setFormatService, setPaletteService } from './services'; -import { metricVisRenderer } from './expression_renderers'; +import { getMetricVisRenderer } from './expression_renderers'; import { FieldFormatsStart } from '../../../field_formats/public'; /** @internal */ @@ -29,7 +29,7 @@ export interface ExpressionMetricPluginStart { export class ExpressionMetricPlugin implements Plugin { public setup(core: CoreSetup, { expressions, charts }: ExpressionMetricPluginSetup) { expressions.registerFunction(metricVisFunction); - expressions.registerRenderer(metricVisRenderer); + expressions.registerRenderer(getMetricVisRenderer(core.theme)); charts.palettes.getPalettes().then((palettes) => { setPaletteService(palettes); }); diff --git a/src/plugins/chart_expressions/expression_tagcloud/kibana.json b/src/plugins/chart_expressions/expression_tagcloud/kibana.json index b1c3c1f020366..37a7e3be843b2 100755 --- a/src/plugins/chart_expressions/expression_tagcloud/kibana.json +++ b/src/plugins/chart_expressions/expression_tagcloud/kibana.json @@ -5,7 +5,7 @@ "server": true, "ui": true, "requiredPlugins": ["expressions", "visualizations", "charts", "presentationUtil", "fieldFormats"], - "requiredBundles": ["kibanaUtils"], + "requiredBundles": ["kibanaUtils", "kibanaReact"], "optionalPlugins": [], "owner": { "name": "Vis Editors", diff --git a/src/plugins/kibana_legacy/public/notify/lib/index.ts b/src/plugins/chart_expressions/expression_tagcloud/public/__mocks__/theme.ts similarity index 78% rename from src/plugins/kibana_legacy/public/notify/lib/index.ts rename to src/plugins/chart_expressions/expression_tagcloud/public/__mocks__/theme.ts index 7f1cfb0e5b1fe..d64fa429d5684 100644 --- a/src/plugins/kibana_legacy/public/notify/lib/index.ts +++ b/src/plugins/chart_expressions/expression_tagcloud/public/__mocks__/theme.ts @@ -6,5 +6,8 @@ * Side Public License, v 1. */ -export { formatESMsg } from './format_es_msg'; -export { formatMsg } from './format_msg'; +import { from } from 'rxjs'; + +export const theme = { + theme$: from([{ darkMode: false }]), +}; diff --git a/src/plugins/chart_expressions/expression_tagcloud/public/__stories__/tagcloud_renderer.stories.tsx b/src/plugins/chart_expressions/expression_tagcloud/public/__stories__/tagcloud_renderer.stories.tsx index 1e0dc2600d1a1..eca35918d7289 100644 --- a/src/plugins/chart_expressions/expression_tagcloud/public/__stories__/tagcloud_renderer.stories.tsx +++ b/src/plugins/chart_expressions/expression_tagcloud/public/__stories__/tagcloud_renderer.stories.tsx @@ -12,6 +12,7 @@ import { tagcloudRenderer } from '../expression_renderers'; import { Render } from '../../../../presentation_util/public/__stories__'; import { TagcloudRendererConfig } from '../../common/types'; import { palettes } from '../__mocks__/palettes'; +import { theme } from '../__mocks__/theme'; const config: TagcloudRendererConfig = { visType: 'tagcloud', @@ -66,13 +67,17 @@ const containerSize = { storiesOf('renderers/tag_cloud_vis', module) .add('Default', () => { return ( - tagcloudRenderer({ palettes })} config={config} {...containerSize} /> + tagcloudRenderer({ palettes, theme })} + config={config} + {...containerSize} + /> ); }) .add('With log scale', () => { return ( tagcloudRenderer({ palettes })} + renderer={() => tagcloudRenderer({ palettes, theme })} config={{ ...config, visParams: { ...config.visParams, scale: 'log' } }} {...containerSize} /> @@ -81,7 +86,7 @@ storiesOf('renderers/tag_cloud_vis', module) .add('With square root scale', () => { return ( tagcloudRenderer({ palettes })} + renderer={() => tagcloudRenderer({ palettes, theme })} config={{ ...config, visParams: { ...config.visParams, scale: 'square root' } }} {...containerSize} /> @@ -90,7 +95,7 @@ storiesOf('renderers/tag_cloud_vis', module) .add('With right angled orientation', () => { return ( tagcloudRenderer({ palettes })} + renderer={() => tagcloudRenderer({ palettes, theme })} config={{ ...config, visParams: { ...config.visParams, orientation: 'right angled' } }} {...containerSize} /> @@ -99,7 +104,7 @@ storiesOf('renderers/tag_cloud_vis', module) .add('With multiple orientations', () => { return ( tagcloudRenderer({ palettes })} + renderer={() => tagcloudRenderer({ palettes, theme })} config={{ ...config, visParams: { ...config.visParams, orientation: 'multiple' } }} {...containerSize} /> @@ -108,7 +113,7 @@ storiesOf('renderers/tag_cloud_vis', module) .add('With hidden label', () => { return ( tagcloudRenderer({ palettes })} + renderer={() => tagcloudRenderer({ palettes, theme })} config={{ ...config, visParams: { ...config.visParams, showLabel: false } }} {...containerSize} /> @@ -117,7 +122,7 @@ storiesOf('renderers/tag_cloud_vis', module) .add('With empty results', () => { return ( tagcloudRenderer({ palettes })} + renderer={() => tagcloudRenderer({ palettes, theme })} config={{ ...config, visData: { ...config.visData, rows: [] } }} {...containerSize} /> diff --git a/src/plugins/chart_expressions/expression_tagcloud/public/components/tagcloud_component.tsx b/src/plugins/chart_expressions/expression_tagcloud/public/components/tagcloud_component.tsx index b0f9f3197a44a..2bec25534f49b 100644 --- a/src/plugins/chart_expressions/expression_tagcloud/public/components/tagcloud_component.tsx +++ b/src/plugins/chart_expressions/expression_tagcloud/public/components/tagcloud_component.tsx @@ -7,7 +7,7 @@ */ import React, { useCallback, useState, useMemo } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { throttle } from 'lodash'; import { EuiIconTip, EuiResizeObserver } from '@elastic/eui'; import { Chart, Settings, Wordcloud, RenderChangeListener } from '@elastic/charts'; diff --git a/src/plugins/chart_expressions/expression_tagcloud/public/expression_renderers/tagcloud_renderer.tsx b/src/plugins/chart_expressions/expression_tagcloud/public/expression_renderers/tagcloud_renderer.tsx index 294371b3a5703..2cec5453b9b9e 100644 --- a/src/plugins/chart_expressions/expression_tagcloud/public/expression_renderers/tagcloud_renderer.tsx +++ b/src/plugins/chart_expressions/expression_tagcloud/public/expression_renderers/tagcloud_renderer.tsx @@ -8,9 +8,10 @@ import React, { lazy } from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { ClassNames } from '@emotion/react'; import { i18n } from '@kbn/i18n'; +import { KibanaThemeProvider } from '../../../../kibana_react/public'; import { VisualizationContainer } from '../../../../visualizations/public'; import { ExpressionRenderDefinition } from '../../../../expressions/common/expression_renderers'; import { ExpressioTagcloudRendererDependencies } from '../plugin'; @@ -36,7 +37,7 @@ const TagCloudChart = lazy(() => import('../components/tagcloud_component')); export const tagcloudRenderer: ( deps: ExpressioTagcloudRendererDependencies -) => ExpressionRenderDefinition = ({ palettes }) => ({ +) => ExpressionRenderDefinition = ({ palettes, theme }) => ({ name: EXPRESSION_NAME, displayName: strings.getDisplayName(), help: strings.getHelpDescription(), @@ -50,27 +51,29 @@ export const tagcloudRenderer: ( const showNoResult = config.visData.rows.length === 0; render( - - - {({ css, cx }) => ( - - - - )} - - , + + + + {({ css, cx }) => ( + + + + )} + + + , domNode ); }, diff --git a/src/plugins/chart_expressions/expression_tagcloud/public/plugin.ts b/src/plugins/chart_expressions/expression_tagcloud/public/plugin.ts index 5a8bcc8aa64bb..9385ab3b26772 100644 --- a/src/plugins/chart_expressions/expression_tagcloud/public/plugin.ts +++ b/src/plugins/chart_expressions/expression_tagcloud/public/plugin.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { CoreSetup, CoreStart, Plugin } from '../../../../core/public'; +import { CoreSetup, CoreStart, Plugin, ThemeServiceStart } from '../../../../core/public'; import { ExpressionsStart, ExpressionsSetup } from '../../../expressions/public'; import { ChartsPluginSetup } from '../../../charts/public'; import { tagcloudRenderer } from './expression_renderers'; @@ -22,6 +22,7 @@ interface SetupDeps { /** @internal */ export interface ExpressioTagcloudRendererDependencies { palettes: ChartsPluginSetup['palettes']; + theme: ThemeServiceStart; } interface StartDeps { @@ -39,6 +40,7 @@ export class ExpressionTagcloudPlugin public setup(core: CoreSetup, { expressions, charts }: SetupDeps): ExpressionTagcloudPluginSetup { const rendererDependencies: ExpressioTagcloudRendererDependencies = { palettes: charts.palettes, + theme: core.theme, }; expressions.registerFunction(tagcloudFunction); expressions.registerRenderer(tagcloudRenderer(rendererDependencies)); diff --git a/src/plugins/charts/public/static/components/color_picker.tsx b/src/plugins/charts/public/static/components/color_picker.tsx index 813748accd8fd..6fcf9d19638fc 100644 --- a/src/plugins/charts/public/static/components/color_picker.tsx +++ b/src/plugins/charts/public/static/components/color_picker.tsx @@ -17,7 +17,7 @@ import { EuiScreenReaderOnly, EuiFlexGroup, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { lightenColor } from '../../services/palettes/lighten_color'; import './color_picker.scss'; diff --git a/src/plugins/console/public/application/components/console_menu.tsx b/src/plugins/console/public/application/components/console_menu.tsx index 270fc2f0751c0..4769765715a65 100644 --- a/src/plugins/console/public/application/components/console_menu.tsx +++ b/src/plugins/console/public/application/components/console_menu.tsx @@ -18,7 +18,7 @@ import { EuiLink, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; interface Props { diff --git a/src/plugins/console/public/application/components/help_panel.tsx b/src/plugins/console/public/application/components/help_panel.tsx index 8bb617e7c99de..cdb45f929459d 100644 --- a/src/plugins/console/public/application/components/help_panel.tsx +++ b/src/plugins/console/public/application/components/help_panel.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiText, EuiFlyout, diff --git a/src/plugins/console/public/application/components/settings_modal.tsx b/src/plugins/console/public/application/components/settings_modal.tsx index 033bce42177be..3e76c18ac32ae 100644 --- a/src/plugins/console/public/application/components/settings_modal.tsx +++ b/src/plugins/console/public/application/components/settings_modal.tsx @@ -9,7 +9,7 @@ import _ from 'lodash'; import React, { Fragment, useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, @@ -44,6 +44,7 @@ export function DevToolsSettingsModal(props: Props) { const [templates, setTemplates] = useState(props.settings.autocomplete.templates); const [polling, setPolling] = useState(props.settings.polling); const [tripleQuotes, setTripleQuotes] = useState(props.settings.tripleQuotes); + const [historyDisabled, setHistoryDisabled] = useState(props.settings.historyDisabled); const autoCompleteCheckboxes = [ { @@ -93,6 +94,7 @@ export function DevToolsSettingsModal(props: Props) { }, polling, tripleQuotes, + historyDisabled, }); } @@ -218,6 +220,24 @@ export function DevToolsSettingsModal(props: Props) { /> + + } + > + + } + onChange={(e) => setHistoryDisabled(e.target.checked)} + /> + + void; + onDisableSavingToHistory: () => void; +} + +export const StorageQuotaError = ({ onClearHistory, onDisableSavingToHistory }: Props) => ( + + + + + + + + + + + + +); diff --git a/src/plugins/console/public/application/components/welcome_panel.tsx b/src/plugins/console/public/application/components/welcome_panel.tsx index 8514d41c04a51..3a7898df084a7 100644 --- a/src/plugins/console/public/application/components/welcome_panel.tsx +++ b/src/plugins/console/public/application/components/welcome_panel.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; // @ts-ignore import { diff --git a/src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.test.tsx b/src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.test.tsx index f8995479c1416..d39ffb9755445 100644 --- a/src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.test.tsx +++ b/src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.test.tsx @@ -10,7 +10,7 @@ import './editor.test.mock'; import React from 'react'; import { mount } from 'enzyme'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { act } from 'react-dom/test-utils'; import * as sinon from 'sinon'; diff --git a/src/plugins/console/public/application/hooks/use_send_current_request_to_es/use_send_current_request_to_es.ts b/src/plugins/console/public/application/hooks/use_send_current_request_to_es/use_send_current_request_to_es.ts index 71580b7764f31..d025760c19d0a 100644 --- a/src/plugins/console/public/application/hooks/use_send_current_request_to_es/use_send_current_request_to_es.ts +++ b/src/plugins/console/public/application/hooks/use_send_current_request_to_es/use_send_current_request_to_es.ts @@ -13,9 +13,11 @@ import { instance as registry } from '../../contexts/editor_context/editor_regis import { useRequestActionContext, useServicesContext } from '../../contexts'; import { sendRequestToES } from './send_request_to_es'; import { track } from './track'; +import { toMountPoint } from '../../../../../kibana_react/public'; // @ts-ignore import { retrieveAutoCompleteInfo } from '../../../lib/mappings/mappings'; +import { StorageQuotaError } from '../../components/storage_quota_error'; export const useSendCurrentRequestToES = () => { const { @@ -46,29 +48,43 @@ export const useSendCurrentRequestToES = () => { const results = await sendRequestToES({ requests }); let saveToHistoryError: undefined | Error; + const { historyDisabled } = settings.toJSON(); - results.forEach(({ request: { path, method, data } }) => { - try { - history.addToHistory(path, method, data); - } catch (e) { - // Grab only the first error - if (!saveToHistoryError) { - saveToHistoryError = e; + if (!historyDisabled) { + results.forEach(({ request: { path, method, data } }) => { + try { + history.addToHistory(path, method, data); + } catch (e) { + // Grab only the first error + if (!saveToHistoryError) { + saveToHistoryError = e; + } } - } - }); + }); + } if (saveToHistoryError) { const errorTitle = i18n.translate('console.notification.error.couldNotSaveRequestTitle', { defaultMessage: 'Could not save request to Console history.', }); if (isQuotaExceededError(saveToHistoryError)) { - notifications.toasts.addError(saveToHistoryError, { - title: errorTitle, - toastMessage: i18n.translate('console.notification.error.historyQuotaReachedMessage', { + const toast = notifications.toasts.addWarning({ + title: i18n.translate('console.notification.error.historyQuotaReachedMessage', { defaultMessage: - 'Request history is full. Clear the Console history to save new requests.', + 'Request history is full. Clear the console history or disable saving new requests.', }), + text: toMountPoint( + StorageQuotaError({ + onClearHistory: () => { + history.clearHistory(); + notifications.toasts.remove(toast); + }, + onDisableSavingToHistory: () => { + settings.setHistoryDisabled(true); + notifications.toasts.remove(toast); + }, + }) + ), }); } else { // Best effort, but still notify the user. diff --git a/src/plugins/console/public/services/settings.ts b/src/plugins/console/public/services/settings.ts index 647ac1e0ad09f..80ad29b3308a7 100644 --- a/src/plugins/console/public/services/settings.ts +++ b/src/plugins/console/public/services/settings.ts @@ -14,6 +14,7 @@ export const DEFAULT_SETTINGS = Object.freeze({ tripleQuotes: true, wrapMode: true, autocomplete: Object.freeze({ fields: true, indices: true, templates: true }), + historyDisabled: false, }); export interface DevToolsSettings { @@ -26,6 +27,7 @@ export interface DevToolsSettings { }; polling: boolean; tripleQuotes: boolean; + historyDisabled: boolean; } export class Settings { @@ -76,6 +78,15 @@ export class Settings { return true; } + setHistoryDisabled(disable: boolean) { + this.storage.set('disable_history', disable); + return true; + } + + getHistoryDisabled() { + return this.storage.get('disable_history', DEFAULT_SETTINGS.historyDisabled); + } + toJSON(): DevToolsSettings { return { autocomplete: this.getAutocomplete(), @@ -83,15 +94,24 @@ export class Settings { tripleQuotes: this.getTripleQuotes(), fontSize: parseFloat(this.getFontSize()), polling: Boolean(this.getPolling()), + historyDisabled: Boolean(this.getHistoryDisabled()), }; } - updateSettings({ fontSize, wrapMode, tripleQuotes, autocomplete, polling }: DevToolsSettings) { + updateSettings({ + fontSize, + wrapMode, + tripleQuotes, + autocomplete, + polling, + historyDisabled, + }: DevToolsSettings) { this.setFontSize(fontSize); this.setWrapMode(wrapMode); this.setTripleQuotes(tripleQuotes); this.setAutocomplete(autocomplete); this.setPolling(polling); + this.setHistoryDisabled(historyDisabled); } } diff --git a/src/plugins/custom_integrations/public/components/replacement_card/replacement_card.component.tsx b/src/plugins/custom_integrations/public/components/replacement_card/replacement_card.component.tsx index 0fa341cdf9435..9b5e1248d1938 100644 --- a/src/plugins/custom_integrations/public/components/replacement_card/replacement_card.component.tsx +++ b/src/plugins/custom_integrations/public/components/replacement_card/replacement_card.component.tsx @@ -21,7 +21,7 @@ import { useEuiTheme, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { CustomIntegration } from '../../../common'; import { usePlatformService } from '../../services'; diff --git a/src/plugins/custom_integrations/server/language_clients/index.ts b/src/plugins/custom_integrations/server/language_clients/index.ts index 0ce45dbcfcd87..d18eddaf08627 100644 --- a/src/plugins/custom_integrations/server/language_clients/index.ts +++ b/src/plugins/custom_integrations/server/language_clients/index.ts @@ -151,7 +151,11 @@ export function registerLanguageClients( description: integration.description, type: 'ui_link', shipper: 'language_clients', - uiInternalPath: integration.docUrlTemplate.replace('{branch}', branch), + // Documentation for `main` branches is still published at a `master` URL. + uiInternalPath: integration.docUrlTemplate.replace( + '{branch}', + branch === 'main' ? 'master' : branch + ), isBeta: false, icons, categories: ['elastic_stack', 'custom', 'language_client'], diff --git a/src/plugins/custom_integrations/storybook/decorator.tsx b/src/plugins/custom_integrations/storybook/decorator.tsx index c5fea9615ee47..eff12dde9b74a 100644 --- a/src/plugins/custom_integrations/storybook/decorator.tsx +++ b/src/plugins/custom_integrations/storybook/decorator.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { DecoratorFn } from '@storybook/react'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { PluginServiceRegistry } from '../../presentation_util/public'; diff --git a/src/plugins/dashboard/public/application/dashboard_router.tsx b/src/plugins/dashboard/public/application/dashboard_router.tsx index 97f7cbc769851..4a22899c12e8a 100644 --- a/src/plugins/dashboard/public/application/dashboard_router.tsx +++ b/src/plugins/dashboard/public/application/dashboard_router.tsx @@ -11,7 +11,7 @@ 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 { 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'; diff --git a/src/plugins/dashboard/public/application/embeddable/dashboard_container.test.tsx b/src/plugins/dashboard/public/application/embeddable/dashboard_container.test.tsx index 41054b377d22e..6cd102a4d4770 100644 --- a/src/plugins/dashboard/public/application/embeddable/dashboard_container.test.tsx +++ b/src/plugins/dashboard/public/application/embeddable/dashboard_container.test.tsx @@ -12,7 +12,7 @@ import { mount } from 'enzyme'; import { findTestSubject, nextTick } from '@kbn/test/jest'; import { DashboardContainer, DashboardContainerServices } from './dashboard_container'; import { getSampleDashboardInput, getSampleDashboardPanel } from '../test_helpers'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks'; import { KibanaContextProvider } from '../../services/kibana_react'; diff --git a/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx b/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx index f86307d71fb18..54fa1f05b9c0d 100644 --- a/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx +++ b/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx @@ -9,7 +9,7 @@ import _ from 'lodash'; import React from 'react'; import ReactDOM from 'react-dom'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import uuid from 'uuid'; import { CoreStart, IUiSettingsClient, KibanaExecutionContext } from 'src/core/public'; import { Start as InspectorStartContract } from 'src/plugins/inspector/public'; 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 b2f1302c65c9c..5ae2d41e69730 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 @@ -7,7 +7,7 @@ */ import React from 'react'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { EuiIcon, EuiSpacer, diff --git a/src/plugins/dashboard/public/application/embeddable/grid/dashboard_grid.tsx b/src/plugins/dashboard/public/application/embeddable/grid/dashboard_grid.tsx index 5d492c049fdad..9d2afdba36dbc 100644 --- a/src/plugins/dashboard/public/application/embeddable/grid/dashboard_grid.tsx +++ b/src/plugins/dashboard/public/application/embeddable/grid/dashboard_grid.tsx @@ -12,7 +12,7 @@ import 'react-resizable/css/styles.css'; // @ts-ignore import sizeMe from 'react-sizeme'; -import { injectI18n } from '@kbn/i18n/react'; +import { injectI18n } from '@kbn/i18n-react'; import classNames from 'classnames'; import _ from 'lodash'; import React from 'react'; diff --git a/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.test.tsx b/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.test.tsx index 7a920685bcaae..7c671ce7736d7 100644 --- a/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.test.tsx +++ b/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.test.tsx @@ -10,7 +10,7 @@ import { findTestSubject } from '@elastic/eui/lib/test'; import React from 'react'; import { skip } from 'rxjs/operators'; import { mount } from 'enzyme'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { nextTick } from '@kbn/test/jest'; import { DashboardViewport, DashboardViewportProps } from './dashboard_viewport'; import { DashboardContainer, DashboardContainerServices } from '../dashboard_container'; 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 ff34a63bdce19..065544409b8cf 100644 --- a/src/plugins/dashboard/public/application/listing/dashboard_listing.test.tsx +++ b/src/plugins/dashboard/public/application/listing/dashboard_listing.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { mount } from 'enzyme'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { DashboardAppServices } from '../../types'; import { SimpleSavedObject } from '../../../../../core/public'; diff --git a/src/plugins/dashboard/public/application/listing/dashboard_listing.tsx b/src/plugins/dashboard/public/application/listing/dashboard_listing.tsx index 8b99b5c51598a..605e5ec88565f 100644 --- a/src/plugins/dashboard/public/application/listing/dashboard_listing.tsx +++ b/src/plugins/dashboard/public/application/listing/dashboard_listing.tsx @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiLink, EuiButton, 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 91361836f59d4..228a6994dcbb7 100644 --- a/src/plugins/dashboard/public/application/listing/dashboard_no_match.tsx +++ b/src/plugins/dashboard/public/application/listing/dashboard_no_match.tsx @@ -9,7 +9,7 @@ import { i18n } from '@kbn/i18n'; import React, { useEffect } from 'react'; import { EuiCallOut } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { RouteComponentProps } from 'react-router-dom'; import { useKibana, toMountPoint } from '../../services/kibana_react'; 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 8f53c16749fe6..685d090c20459 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 @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { findTestSubject } from '@elastic/eui/lib/test'; import { waitFor } from '@testing-library/react'; import { mount } from 'enzyme'; diff --git a/src/plugins/dashboard/public/application/top_nav/clone_modal.tsx b/src/plugins/dashboard/public/application/top_nav/clone_modal.tsx index 3af186f841a5d..0408b85d27fef 100644 --- a/src/plugins/dashboard/public/application/top_nav/clone_modal.tsx +++ b/src/plugins/dashboard/public/application/top_nav/clone_modal.tsx @@ -8,7 +8,7 @@ import React, { Fragment } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, 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 b0ed1ad0de9b6..575d57914e23f 100644 --- a/src/plugins/dashboard/public/application/top_nav/save_modal.tsx +++ b/src/plugins/dashboard/public/application/top_nav/save_modal.tsx @@ -7,7 +7,7 @@ */ import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiFormRow, EuiTextArea, EuiSwitch } from '@elastic/eui'; diff --git a/src/plugins/dashboard/public/application/top_nav/show_clone_modal.tsx b/src/plugins/dashboard/public/application/top_nav/show_clone_modal.tsx index e5645a2f41e3f..66803d0d7741e 100644 --- a/src/plugins/dashboard/public/application/top_nav/show_clone_modal.tsx +++ b/src/plugins/dashboard/public/application/top_nav/show_clone_modal.tsx @@ -9,7 +9,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { i18n } from '@kbn/i18n'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { DashboardCloneModal } from './clone_modal'; export function showCloneModal( diff --git a/src/plugins/dashboard/public/application/top_nav/show_options_popover.tsx b/src/plugins/dashboard/public/application/top_nav/show_options_popover.tsx index ac7e2932b63c8..c9e10f83ff7ef 100644 --- a/src/plugins/dashboard/public/application/top_nav/show_options_popover.tsx +++ b/src/plugins/dashboard/public/application/top_nav/show_options_popover.tsx @@ -8,7 +8,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { EuiWrappingPopover } from '@elastic/eui'; import { OptionsMenu } from './options'; diff --git a/src/plugins/data/common/search/aggs/agg_types.ts b/src/plugins/data/common/search/aggs/agg_types.ts index 375de79f7f081..dd930887f9d19 100644 --- a/src/plugins/data/common/search/aggs/agg_types.ts +++ b/src/plugins/data/common/search/aggs/agg_types.ts @@ -56,6 +56,7 @@ export const getAggTypes = () => ({ { name: BUCKET_TYPES.DATE_RANGE, fn: buckets.getDateRangeBucketAgg }, { name: BUCKET_TYPES.IP_RANGE, fn: buckets.getIpRangeBucketAgg }, { name: BUCKET_TYPES.TERMS, fn: buckets.getTermsBucketAgg }, + { name: BUCKET_TYPES.MULTI_TERMS, fn: buckets.getMultiTermsBucketAgg }, { name: BUCKET_TYPES.FILTER, fn: buckets.getFilterBucketAgg }, { name: BUCKET_TYPES.FILTERS, fn: buckets.getFiltersBucketAgg }, { name: BUCKET_TYPES.SIGNIFICANT_TERMS, fn: buckets.getSignificantTermsBucketAgg }, @@ -77,6 +78,7 @@ export const getAggTypesFunctions = () => [ buckets.aggHistogram, buckets.aggDateHistogram, buckets.aggTerms, + buckets.aggMultiTerms, metrics.aggAvg, metrics.aggBucketAvg, metrics.aggBucketMax, diff --git a/src/plugins/data/common/search/aggs/aggs_service.test.ts b/src/plugins/data/common/search/aggs/aggs_service.test.ts index 3f434b0cc1c15..be3fbae26174a 100644 --- a/src/plugins/data/common/search/aggs/aggs_service.test.ts +++ b/src/plugins/data/common/search/aggs/aggs_service.test.ts @@ -67,6 +67,7 @@ describe('Aggs service', () => { "date_range", "ip_range", "terms", + "multi_terms", "filter", "filters", "significant_terms", @@ -115,6 +116,7 @@ describe('Aggs service', () => { "date_range", "ip_range", "terms", + "multi_terms", "filter", "filters", "significant_terms", diff --git a/src/plugins/data/common/search/aggs/buckets/_terms_order_helper.ts b/src/plugins/data/common/search/aggs/buckets/_terms_order_helper.ts new file mode 100644 index 0000000000000..bfe3c21653745 --- /dev/null +++ b/src/plugins/data/common/search/aggs/buckets/_terms_order_helper.ts @@ -0,0 +1,120 @@ +/* + * 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 moment from 'moment'; +import { IBucketAggConfig, BucketAggParam } from './bucket_agg_type'; + +export const termsAggFilter = [ + '!top_hits', + '!percentiles', + '!std_dev', + '!derivative', + '!moving_avg', + '!serial_diff', + '!cumulative_sum', + '!avg_bucket', + '!max_bucket', + '!min_bucket', + '!sum_bucket', +]; + +export const termsOrderAggParamDefinition: Partial> = { + name: 'orderAgg', + type: 'agg', + allowedAggs: termsAggFilter, + default: null, + makeAgg(termsAgg, state = { type: 'count' }) { + state.schema = 'orderAgg'; + const orderAgg = termsAgg.aggConfigs.createAggConfig(state, { + addToAggConfigs: false, + }); + orderAgg.id = termsAgg.id + '-orderAgg'; + + return orderAgg; + }, + write(agg, output, aggs) { + const dir = agg.params.order.value; + const order: Record = (output.params.order = {}); + + let orderAgg = agg.params.orderAgg || aggs!.getResponseAggById(agg.params.orderBy); + + // TODO: This works around an Elasticsearch bug the always casts terms agg scripts to strings + // thus causing issues with filtering. This probably causes other issues since float might not + // be able to contain the number on the elasticsearch side + if (output.params.script) { + output.params.value_type = agg.getField().type === 'number' ? 'float' : agg.getField().type; + } + + if (agg.params.missingBucket && agg.params.field.type === 'string') { + output.params.missing = '__missing__'; + } + + if (!orderAgg) { + order[agg.params.orderBy || '_count'] = dir; + return; + } + + if (aggs?.hasTimeShifts() && Object.keys(aggs?.getTimeShifts()).length > 1 && aggs.timeRange) { + const shift = orderAgg.getTimeShift(); + orderAgg = aggs.createAggConfig( + { + type: 'filtered_metric', + id: orderAgg.id, + params: { + customBucket: aggs + .createAggConfig( + { + type: 'filter', + id: 'shift', + params: { + filter: { + language: 'lucene', + query: { + range: { + [aggs.timeFields![0]]: { + gte: moment(aggs.timeRange.from) + .subtract(shift || 0) + .toISOString(), + lte: moment(aggs.timeRange.to) + .subtract(shift || 0) + .toISOString(), + }, + }, + }, + }, + }, + }, + { + addToAggConfigs: false, + } + ) + .serialize(), + customMetric: orderAgg.serialize(), + }, + enabled: false, + }, + { + addToAggConfigs: false, + } + ); + } + if (orderAgg.type.name === 'count') { + order._count = dir; + return; + } + + const orderAggPath = orderAgg.getValueBucketPath(); + + if (orderAgg.parentId && aggs) { + orderAgg = aggs.byId(orderAgg.parentId); + } + + output.subAggs = (output.subAggs || []).concat(orderAgg); + order[orderAggPath] = dir; + }, +}; diff --git a/src/plugins/data/common/search/aggs/buckets/_terms_other_bucket_helper.test.ts b/src/plugins/data/common/search/aggs/buckets/_terms_other_bucket_helper.test.ts index 7ec176d7ab11a..0ed504861c5ba 100644 --- a/src/plugins/data/common/search/aggs/buckets/_terms_other_bucket_helper.test.ts +++ b/src/plugins/data/common/search/aggs/buckets/_terms_other_bucket_helper.test.ts @@ -11,6 +11,7 @@ import { mergeOtherBucketAggResponse, updateMissingBucket, OTHER_BUCKET_SEPARATOR as SEP, + constructSingleTermOtherFilter, } from './_terms_other_bucket_helper'; import { AggConfigs, CreateAggConfigParams } from '../agg_configs'; import { BUCKET_TYPES } from './bucket_agg_types'; @@ -573,7 +574,8 @@ describe('Terms Agg Other bucket helper', () => { singleTermResponse, singleOtherResponse, aggConfigs.aggs[0] as IBucketAggConfig, - otherAggConfig() + otherAggConfig(), + constructSingleTermOtherFilter ); expect((mergedResponse!.aggregations!['1'] as any).buckets[3].key).toEqual('__other__'); } @@ -594,7 +596,8 @@ describe('Terms Agg Other bucket helper', () => { nestedTermResponse, nestedOtherResponse, aggConfigs.aggs[1] as IBucketAggConfig, - otherAggConfig() + otherAggConfig(), + constructSingleTermOtherFilter ); expect((mergedResponse!.aggregations!['1'] as any).buckets[1]['2'].buckets[3].key).toEqual( diff --git a/src/plugins/data/common/search/aggs/buckets/_terms_other_bucket_helper.ts b/src/plugins/data/common/search/aggs/buckets/_terms_other_bucket_helper.ts index ef5066e84f985..d781971f83aab 100644 --- a/src/plugins/data/common/search/aggs/buckets/_terms_other_bucket_helper.ts +++ b/src/plugins/data/common/search/aggs/buckets/_terms_other_bucket_helper.ts @@ -7,11 +7,18 @@ */ import { isNumber, keys, values, find, each, cloneDeep, flatten } from 'lodash'; +import { i18n } from '@kbn/i18n'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import { buildExistsFilter, buildPhrasesFilter, buildQueryFromFilters } from '@kbn/es-query'; +import { + buildExistsFilter, + buildPhrasesFilter, + buildQueryFromFilters, + Filter, +} from '@kbn/es-query'; import { AggGroupNames } from '../agg_groups'; import { IAggConfigs } from '../agg_configs'; -import { IBucketAggConfig } from './bucket_agg_type'; +import { IAggType } from '../agg_type'; +import { IAggConfig } from '../agg_config'; export const OTHER_BUCKET_SEPARATOR = '╰┄►'; @@ -44,7 +51,7 @@ const getNestedAggDSL = (aggNestedDsl: Record, startFromAggId: stri const getAggResultBuckets = ( aggConfigs: IAggConfigs, response: estypes.SearchResponse['aggregations'], - aggWithOtherBucket: IBucketAggConfig, + aggWithOtherBucket: IAggConfig, key: string ) => { const keyParts = key.split(OTHER_BUCKET_SEPARATOR); @@ -111,11 +118,7 @@ const getAggConfigResultMissingBuckets = (responseAggs: any, aggId: string) => { * @param key: the key for this specific other bucket * @param otherAgg: AggConfig of the aggregation with other bucket */ -const getOtherAggTerms = ( - requestAgg: Record, - key: string, - otherAgg: IBucketAggConfig -) => { +const getOtherAggTerms = (requestAgg: Record, key: string, otherAgg: IAggConfig) => { return requestAgg['other-filter'].filters.filters[key].bool.must_not .filter( (filter: Record) => @@ -126,7 +129,7 @@ const getOtherAggTerms = ( export const buildOtherBucketAgg = ( aggConfigs: IAggConfigs, - aggWithOtherBucket: IBucketAggConfig, + aggWithOtherBucket: IAggConfig, response: any ) => { const bucketAggs = aggConfigs.aggs.filter( @@ -200,12 +203,16 @@ export const buildOtherBucketAgg = ( return; } - const hasScriptedField = !!aggWithOtherBucket.params.field.scripted; + const hasScriptedField = !!aggWithOtherBucket.params.field?.scripted; const hasMissingBucket = !!aggWithOtherBucket.params.missingBucket; const hasMissingBucketKey = agg.buckets.some( (bucket: { key: string }) => bucket.key === '__missing__' ); - if (!hasScriptedField && (!hasMissingBucket || hasMissingBucketKey)) { + if ( + aggWithOtherBucket.params.field && + !hasScriptedField && + (!hasMissingBucket || hasMissingBucketKey) + ) { filters.push( buildExistsFilter( aggWithOtherBucket.params.field, @@ -217,7 +224,7 @@ export const buildOtherBucketAgg = ( // create not filters for all the buckets each(agg.buckets, (bucket) => { if (bucket.key === '__missing__') return; - const filter = currentAgg.createFilter(bucket.key); + const filter = currentAgg.createFilter(currentAgg.getKey(bucket, bucket.key)); filter.meta.negate = true; filters.push(filter); }); @@ -244,8 +251,9 @@ export const mergeOtherBucketAggResponse = ( aggsConfig: IAggConfigs, response: estypes.SearchResponse, otherResponse: any, - otherAgg: IBucketAggConfig, - requestAgg: Record + otherAgg: IAggConfig, + requestAgg: Record, + otherFilterBuilder: (requestAgg: Record, key: string, otherAgg: IAggConfig) => Filter ): estypes.SearchResponse => { const updatedResponse = cloneDeep(response); each(otherResponse.aggregations['other-filter'].buckets, (bucket, key) => { @@ -257,15 +265,8 @@ export const mergeOtherBucketAggResponse = ( otherAgg, bucketKey ); - const requestFilterTerms = getOtherAggTerms(requestAgg, key, otherAgg); - - const phraseFilter = buildPhrasesFilter( - otherAgg.params.field, - requestFilterTerms, - otherAgg.aggConfigs.indexPattern - ); - phraseFilter.meta.negate = true; - bucket.filters = [phraseFilter]; + const otherFilter = otherFilterBuilder(requestAgg, key, otherAgg); + bucket.filters = [otherFilter]; bucket.key = '__other__'; if ( @@ -285,7 +286,7 @@ export const mergeOtherBucketAggResponse = ( export const updateMissingBucket = ( response: estypes.SearchResponse, aggConfigs: IAggConfigs, - agg: IBucketAggConfig + agg: IAggConfig ) => { const updatedResponse = cloneDeep(response); const aggResultBuckets = getAggConfigResultMissingBuckets(updatedResponse.aggregations, agg.id); @@ -294,3 +295,84 @@ export const updateMissingBucket = ( }); return updatedResponse; }; + +export function constructSingleTermOtherFilter( + requestAgg: Record, + key: string, + otherAgg: IAggConfig +) { + const requestFilterTerms = getOtherAggTerms(requestAgg, key, otherAgg); + + const phraseFilter = buildPhrasesFilter( + otherAgg.params.field, + requestFilterTerms, + otherAgg.aggConfigs.indexPattern + ); + phraseFilter.meta.negate = true; + return phraseFilter; +} + +export function constructMultiTermOtherFilter( + requestAgg: Record, + key: string +): Filter { + return { + query: requestAgg['other-filter'].filters.filters[key], + meta: {}, + }; +} + +export const createOtherBucketPostFlightRequest = ( + otherFilterBuilder: (requestAgg: Record, key: string, otherAgg: IAggConfig) => Filter +) => { + const postFlightRequest: IAggType['postFlightRequest'] = async ( + resp, + aggConfigs, + aggConfig, + searchSource, + inspectorRequestAdapter, + abortSignal, + searchSessionId + ) => { + if (!resp.aggregations) return resp; + const nestedSearchSource = searchSource.createChild(); + if (aggConfig.params.otherBucket) { + const filterAgg = buildOtherBucketAgg(aggConfigs, aggConfig, resp); + if (!filterAgg) return resp; + + nestedSearchSource.setField('aggs', filterAgg); + + const { rawResponse: response } = await nestedSearchSource + .fetch$({ + abortSignal, + sessionId: searchSessionId, + inspector: { + adapter: inspectorRequestAdapter, + title: i18n.translate('data.search.aggs.buckets.terms.otherBucketTitle', { + defaultMessage: 'Other bucket', + }), + description: i18n.translate('data.search.aggs.buckets.terms.otherBucketDescription', { + defaultMessage: + 'This request counts the number of documents that fall ' + + 'outside the criterion of the data buckets.', + }), + }, + }) + .toPromise(); + + resp = mergeOtherBucketAggResponse( + aggConfigs, + resp, + response, + aggConfig, + filterAgg(), + otherFilterBuilder + ); + } + if (aggConfig.params.missingBucket) { + resp = updateMissingBucket(resp, aggConfigs, aggConfig); + } + return resp; + }; + return postFlightRequest; +}; diff --git a/src/plugins/data/common/search/aggs/buckets/bucket_agg_types.ts b/src/plugins/data/common/search/aggs/buckets/bucket_agg_types.ts index ada2368944039..0c01bff90bfee 100644 --- a/src/plugins/data/common/search/aggs/buckets/bucket_agg_types.ts +++ b/src/plugins/data/common/search/aggs/buckets/bucket_agg_types.ts @@ -14,6 +14,7 @@ export enum BUCKET_TYPES { DATE_RANGE = 'date_range', RANGE = 'range', TERMS = 'terms', + MULTI_TERMS = 'multi_terms', SIGNIFICANT_TERMS = 'significant_terms', GEOHASH_GRID = 'geohash_grid', GEOTILE_GRID = 'geotile_grid', diff --git a/src/plugins/data/common/search/aggs/buckets/create_filter/multi_terms.ts b/src/plugins/data/common/search/aggs/buckets/create_filter/multi_terms.ts new file mode 100644 index 0000000000000..68dd0f88dbd0b --- /dev/null +++ b/src/plugins/data/common/search/aggs/buckets/create_filter/multi_terms.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 { i18n } from '@kbn/i18n'; +import { buildPhraseFilter, Filter } from '@kbn/es-query'; +import { IBucketAggConfig } from '../bucket_agg_type'; +import { MultiFieldKey } from '../multi_field_key'; + +export const createFilterMultiTerms = ( + aggConfig: IBucketAggConfig, + key: MultiFieldKey, + params: { terms: MultiFieldKey[] } +): Filter => { + const fields = aggConfig.params.fields; + const indexPattern = aggConfig.aggConfigs.indexPattern; + + if (String(key) === '__other__') { + const multiTerms = params.terms; + + const perMultiTermQuery = multiTerms.map((multiTerm) => + multiTerm.keys.map( + (partialKey, i) => + buildPhraseFilter(indexPattern.getFieldByName(fields[i])!, partialKey, indexPattern).query + ) + ); + + return { + meta: { + negate: true, + alias: multiTerms + .map((multiTerm) => multiTerm.keys.join(', ')) + .join( + ` ${i18n.translate('data.search.aggs.buckets.multiTerms.otherFilterJoinName', { + defaultMessage: 'or', + })} ` + ), + index: indexPattern.id, + }, + query: { + bool: { + should: perMultiTermQuery.map((multiTermQuery) => ({ + bool: { + must: multiTermQuery, + }, + })), + minimum_should_match: 1, + }, + }, + }; + } + const partials = key.keys.map((partialKey, i) => + buildPhraseFilter(indexPattern.getFieldByName(fields[i])!, partialKey, indexPattern) + ); + return { + meta: { + alias: key.keys.join(', '), + index: indexPattern.id, + }, + query: { + bool: { + must: partials.map((partialFilter) => partialFilter.query), + }, + }, + }; +}; diff --git a/src/plugins/data/common/search/aggs/buckets/index.ts b/src/plugins/data/common/search/aggs/buckets/index.ts index df02f1d7aa6c0..421fa0fcfdaf4 100644 --- a/src/plugins/data/common/search/aggs/buckets/index.ts +++ b/src/plugins/data/common/search/aggs/buckets/index.ts @@ -36,3 +36,5 @@ export * from './significant_terms_fn'; export * from './significant_terms'; export * from './terms_fn'; export * from './terms'; +export * from './multi_terms_fn'; +export * from './multi_terms'; diff --git a/src/plugins/data/common/search/aggs/buckets/multi_field_key.ts b/src/plugins/data/common/search/aggs/buckets/multi_field_key.ts new file mode 100644 index 0000000000000..89ac1f4c00a54 --- /dev/null +++ b/src/plugins/data/common/search/aggs/buckets/multi_field_key.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. + */ + +const id = Symbol('id'); + +const isBucketLike = (bucket: unknown): bucket is { key: unknown } => { + return Boolean(bucket && typeof bucket === 'object' && 'key' in bucket); +}; + +function getKeysFromBucket(bucket: unknown) { + if (!isBucketLike(bucket)) { + throw new Error('bucket malformed - no key found'); + } + return Array.isArray(bucket.key) + ? bucket.key.map((keyPart) => String(keyPart)) + : [String(bucket.key)]; +} + +export class MultiFieldKey { + [id]: string; + keys: string[]; + + constructor(bucket: unknown) { + this.keys = getKeysFromBucket(bucket); + + this[id] = MultiFieldKey.idBucket(bucket); + } + static idBucket(bucket: unknown) { + return getKeysFromBucket(bucket).join(','); + } + + toString() { + return this[id]; + } +} diff --git a/src/plugins/data/common/search/aggs/buckets/multi_terms.test.ts b/src/plugins/data/common/search/aggs/buckets/multi_terms.test.ts new file mode 100644 index 0000000000000..8788f55440772 --- /dev/null +++ b/src/plugins/data/common/search/aggs/buckets/multi_terms.test.ts @@ -0,0 +1,191 @@ +/* + * 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 { AggConfigs } from '../agg_configs'; +import { METRIC_TYPES } from '../metrics'; +import { mockAggTypesRegistry } from '../test_helpers'; +import { BUCKET_TYPES } from './bucket_agg_types'; +import type { IndexPatternField } from '../../..'; +import { IndexPattern } from '../../..'; + +describe('Multi Terms Agg', () => { + const getAggConfigs = (params: Record = {}) => { + const indexPattern = { + id: '1234', + title: 'logstash-*', + fields: [ + { + name: 'field', + type: 'string', + esTypes: ['string'], + aggregatable: true, + filterable: true, + searchable: true, + }, + { + name: 'string_field', + type: 'string', + esTypes: ['string'], + aggregatable: true, + filterable: true, + searchable: true, + }, + { + name: 'empty_number_field', + type: 'number', + esTypes: ['number'], + aggregatable: true, + filterable: true, + searchable: true, + }, + { + name: 'number_field', + type: 'number', + esTypes: ['number'], + aggregatable: true, + filterable: true, + searchable: true, + }, + ], + } as IndexPattern; + + indexPattern.fields.getByName = (name) => ({ name } as unknown as IndexPatternField); + indexPattern.fields.filter = () => indexPattern.fields; + + return new AggConfigs( + indexPattern, + [ + { + id: 'test', + params, + type: BUCKET_TYPES.MULTI_TERMS, + }, + ], + { typesRegistry: mockAggTypesRegistry() } + ); + }; + + test('produces the expected expression ast', () => { + const aggConfigs = getAggConfigs({ + fields: ['field', 'string_field'], + orderAgg: { + type: 'count', + }, + }); + expect(aggConfigs.aggs[0].toExpressionAst()).toMatchInlineSnapshot(` + Object { + "chain": Array [ + Object { + "arguments": Object { + "enabled": Array [ + true, + ], + "fields": Array [ + "field", + "string_field", + ], + "id": Array [ + "test", + ], + "order": Array [ + "desc", + ], + "orderAgg": Array [ + Object { + "chain": Array [ + Object { + "arguments": Object { + "enabled": Array [ + true, + ], + "id": Array [ + "test-orderAgg", + ], + "schema": Array [ + "orderAgg", + ], + }, + "function": "aggCount", + "type": "function", + }, + ], + "type": "expression", + }, + ], + "otherBucket": Array [ + false, + ], + "otherBucketLabel": Array [ + "Other", + ], + "size": Array [ + 5, + ], + }, + "function": "aggTerms", + "type": "function", + }, + ], + "type": "expression", + } + `); + }); + + test('uses correct bucket path for sorting by median', () => { + const indexPattern = { + id: '1234', + title: 'logstash-*', + fields: [ + { + name: 'string_field', + type: 'string', + esTypes: ['string'], + aggregatable: true, + filterable: true, + searchable: true, + }, + { + name: 'number_field', + type: 'number', + esTypes: ['number'], + aggregatable: true, + filterable: true, + searchable: true, + }, + ], + } as IndexPattern; + + indexPattern.fields.getByName = (name) => ({ name } as unknown as IndexPatternField); + indexPattern.fields.filter = () => indexPattern.fields; + + const aggConfigs = new AggConfigs( + indexPattern, + [ + { + id: 'test', + params: { + fields: ['string_field'], + orderAgg: { + type: METRIC_TYPES.MEDIAN, + params: { + field: { + name: 'number_field', + type: 'number', + }, + }, + }, + }, + type: BUCKET_TYPES.MULTI_TERMS, + }, + ], + { typesRegistry: mockAggTypesRegistry() } + ); + const { [BUCKET_TYPES.MULTI_TERMS]: params } = aggConfigs.aggs[0].toDsl(); + expect(params.order).toEqual({ 'test-orderAgg.50': 'desc' }); + }); +}); diff --git a/src/plugins/data/common/search/aggs/buckets/multi_terms.ts b/src/plugins/data/common/search/aggs/buckets/multi_terms.ts new file mode 100644 index 0000000000000..c320c7e242798 --- /dev/null +++ b/src/plugins/data/common/search/aggs/buckets/multi_terms.ts @@ -0,0 +1,147 @@ +/* + * 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 { noop } from 'lodash'; +import { i18n } from '@kbn/i18n'; + +import { BucketAggType } from './bucket_agg_type'; +import { BUCKET_TYPES } from './bucket_agg_types'; +import { createFilterMultiTerms } from './create_filter/multi_terms'; +import { aggTermsFnName } from './terms_fn'; +import { AggConfigSerialized, BaseAggParams } from '../types'; + +import { MultiFieldKey } from './multi_field_key'; +import { + createOtherBucketPostFlightRequest, + constructMultiTermOtherFilter, +} from './_terms_other_bucket_helper'; +import { termsOrderAggParamDefinition } from './_terms_order_helper'; + +const termsTitle = i18n.translate('data.search.aggs.buckets.multiTermsTitle', { + defaultMessage: 'Multi-Terms', +}); + +export interface AggParamsMultiTerms extends BaseAggParams { + fields: string[]; + orderBy: string; + orderAgg?: AggConfigSerialized; + order?: 'asc' | 'desc'; + size?: number; + otherBucket?: boolean; + otherBucketLabel?: string; +} + +export const getMultiTermsBucketAgg = () => { + const keyCaches = new WeakMap(); + return new BucketAggType({ + name: BUCKET_TYPES.MULTI_TERMS, + expressionName: aggTermsFnName, + title: termsTitle, + makeLabel(agg) { + const params = agg.params; + return agg.getFieldDisplayName() + ': ' + params.order.text; + }, + getKey(bucket, key, agg) { + let keys = keyCaches.get(agg); + + if (!keys) { + keys = new Map(); + keyCaches.set(agg, keys); + } + + const id = MultiFieldKey.idBucket(bucket); + + key = keys.get(id); + if (!key) { + key = new MultiFieldKey(bucket); + keys.set(id, key); + } + + return key; + }, + getSerializedFormat(agg) { + const params = agg.params as AggParamsMultiTerms; + const formats = params.fields + ? params.fields.map((field) => { + const fieldSpec = agg.aggConfigs.indexPattern.getFieldByName(field); + if (!fieldSpec) { + return { + id: undefined, + params: undefined, + }; + } + return agg.aggConfigs.indexPattern.getFormatterForField(fieldSpec).toJSON(); + }) + : [{ id: undefined, params: undefined }]; + return { + id: 'multi_terms', + params: { + otherBucketLabel: params.otherBucketLabel, + paramsPerField: formats, + }, + }; + }, + createFilter: createFilterMultiTerms, + postFlightRequest: createOtherBucketPostFlightRequest(constructMultiTermOtherFilter), + params: [ + { + name: 'fields', + write(agg, output, aggs) { + const params = agg.params as AggParamsMultiTerms; + output.params.terms = params.fields.map((field) => ({ field })); + }, + }, + { + name: 'orderBy', + write: noop, // prevent default write, it's handled by orderAgg + }, + termsOrderAggParamDefinition, + { + name: 'order', + type: 'optioned', + default: 'desc', + options: [ + { + text: i18n.translate('data.search.aggs.buckets.terms.orderDescendingTitle', { + defaultMessage: 'Descending', + }), + value: 'desc', + }, + { + text: i18n.translate('data.search.aggs.buckets.terms.orderAscendingTitle', { + defaultMessage: 'Ascending', + }), + value: 'asc', + }, + ], + write: noop, // prevent default write, it's handled by orderAgg + }, + { + name: 'size', + default: 5, + }, + { + name: 'otherBucket', + default: false, + write: noop, + }, + { + name: 'otherBucketLabel', + type: 'string', + default: i18n.translate('data.search.aggs.buckets.terms.otherBucketLabel', { + defaultMessage: 'Other', + }), + displayName: i18n.translate('data.search.aggs.otherBucket.labelForOtherBucketLabel', { + defaultMessage: 'Label for other bucket', + }), + shouldShow: (agg) => agg.getParam('otherBucket'), + write: noop, + }, + ], + }); +}; diff --git a/src/plugins/data/common/search/aggs/buckets/multi_terms_fn.ts b/src/plugins/data/common/search/aggs/buckets/multi_terms_fn.ts new file mode 100644 index 0000000000000..58e49479cd2c1 --- /dev/null +++ b/src/plugins/data/common/search/aggs/buckets/multi_terms_fn.ts @@ -0,0 +1,132 @@ +/* + * 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 { Assign } from '@kbn/utility-types'; +import { ExpressionFunctionDefinition } from 'src/plugins/expressions/common'; +import { AggExpressionType, AggExpressionFunctionArgs, BUCKET_TYPES } from '../'; + +export const aggMultiTermsFnName = 'aggMultiTerms'; + +type Input = any; +type AggArgs = AggExpressionFunctionArgs; + +// Since the orderAgg param is an agg nested in a subexpression, we need to +// overwrite the param type to expect a value of type AggExpressionType. +type Arguments = Assign; + +type Output = AggExpressionType; +type FunctionDefinition = ExpressionFunctionDefinition< + typeof aggMultiTermsFnName, + Input, + Arguments, + Output +>; + +export const aggMultiTerms = (): FunctionDefinition => ({ + name: aggMultiTermsFnName, + help: i18n.translate('data.search.aggs.function.buckets.multiTerms.help', { + defaultMessage: 'Generates a serialized agg config for a Multi-Terms agg', + }), + type: 'agg_type', + args: { + id: { + types: ['string'], + help: i18n.translate('data.search.aggs.buckets.multiTerms.id.help', { + defaultMessage: 'ID for this aggregation', + }), + }, + enabled: { + types: ['boolean'], + default: true, + help: i18n.translate('data.search.aggs.buckets.multiTerms.enabled.help', { + defaultMessage: 'Specifies whether this aggregation should be enabled', + }), + }, + schema: { + types: ['string'], + help: i18n.translate('data.search.aggs.buckets.multiTerms.schema.help', { + defaultMessage: 'Schema to use for this aggregation', + }), + }, + fields: { + types: ['string'], + multi: true, + required: true, + help: i18n.translate('data.search.aggs.buckets.multiTerms.fields.help', { + defaultMessage: 'Fields to use for this aggregation', + }), + }, + order: { + types: ['string'], + options: ['asc', 'desc'], + help: i18n.translate('data.search.aggs.buckets.multiTerms.order.help', { + defaultMessage: 'Order in which to return the results: asc or desc', + }), + }, + orderBy: { + types: ['string'], + help: i18n.translate('data.search.aggs.buckets.multiTerms.orderBy.help', { + defaultMessage: 'Field to order results by', + }), + }, + orderAgg: { + types: ['agg_type'], + help: i18n.translate('data.search.aggs.buckets.multiTerms.orderAgg.help', { + defaultMessage: 'Agg config to use for ordering results', + }), + }, + size: { + types: ['number'], + help: i18n.translate('data.search.aggs.buckets.multiTerms.size.help', { + defaultMessage: 'Max number of buckets to retrieve', + }), + }, + otherBucket: { + types: ['boolean'], + help: i18n.translate('data.search.aggs.buckets.multiTerms.otherBucket.help', { + defaultMessage: 'When set to true, groups together any buckets beyond the allowed size', + }), + }, + otherBucketLabel: { + types: ['string'], + help: i18n.translate('data.search.aggs.buckets.multiTerms.otherBucketLabel.help', { + defaultMessage: 'Default label used in charts for documents in the Other bucket', + }), + }, + json: { + types: ['string'], + help: i18n.translate('data.search.aggs.buckets.multiTerms.json.help', { + defaultMessage: 'Advanced json to include when the agg is sent to Elasticsearch', + }), + }, + customLabel: { + types: ['string'], + help: i18n.translate('data.search.aggs.buckets.multiTerms.customLabel.help', { + defaultMessage: 'Represents a custom label for this aggregation', + }), + }, + }, + fn: (input, args) => { + const { id, enabled, schema, ...rest } = args; + + return { + type: 'agg_type', + value: { + id, + enabled, + schema, + type: BUCKET_TYPES.MULTI_TERMS, + params: { + ...rest, + orderAgg: args.orderAgg?.value, + }, + }, + }; + }, +}); diff --git a/src/plugins/data/common/search/aggs/buckets/terms.ts b/src/plugins/data/common/search/aggs/buckets/terms.ts index b3872d29beaac..bfc5809d5e439 100644 --- a/src/plugins/data/common/search/aggs/buckets/terms.ts +++ b/src/plugins/data/common/search/aggs/buckets/terms.ts @@ -9,8 +9,7 @@ import { noop } from 'lodash'; import { i18n } from '@kbn/i18n'; -import moment from 'moment'; -import { BucketAggType, IBucketAggConfig } from './bucket_agg_type'; +import { BucketAggType } from './bucket_agg_type'; import { BUCKET_TYPES } from './bucket_agg_types'; import { createFilterTerms } from './create_filter/terms'; import { @@ -23,24 +22,12 @@ import { AggConfigSerialized, BaseAggParams } from '../types'; import { KBN_FIELD_TYPES } from '../../../../common'; import { - buildOtherBucketAgg, - mergeOtherBucketAggResponse, - updateMissingBucket, + createOtherBucketPostFlightRequest, + constructSingleTermOtherFilter, } from './_terms_other_bucket_helper'; +import { termsOrderAggParamDefinition } from './_terms_order_helper'; -export const termsAggFilter = [ - '!top_hits', - '!percentiles', - '!std_dev', - '!derivative', - '!moving_avg', - '!serial_diff', - '!cumulative_sum', - '!avg_bucket', - '!max_bucket', - '!min_bucket', - '!sum_bucket', -]; +export { termsAggFilter } from './_terms_order_helper'; const termsTitle = i18n.translate('data.search.aggs.buckets.termsTitle', { defaultMessage: 'Terms', @@ -85,49 +72,8 @@ export const getTermsBucketAgg = () => }; }, createFilter: createFilterTerms, + postFlightRequest: createOtherBucketPostFlightRequest(constructSingleTermOtherFilter), hasPrecisionError: (aggBucket) => Boolean(aggBucket?.doc_count_error_upper_bound), - postFlightRequest: async ( - resp, - aggConfigs, - aggConfig, - searchSource, - inspectorRequestAdapter, - abortSignal, - searchSessionId - ) => { - if (!resp.aggregations) return resp; - const nestedSearchSource = searchSource.createChild(); - if (aggConfig.params.otherBucket) { - const filterAgg = buildOtherBucketAgg(aggConfigs, aggConfig, resp); - if (!filterAgg) return resp; - - nestedSearchSource.setField('aggs', filterAgg); - - const { rawResponse: response } = await nestedSearchSource - .fetch$({ - abortSignal, - sessionId: searchSessionId, - inspector: { - adapter: inspectorRequestAdapter, - title: i18n.translate('data.search.aggs.buckets.terms.otherBucketTitle', { - defaultMessage: 'Other bucket', - }), - description: i18n.translate('data.search.aggs.buckets.terms.otherBucketDescription', { - defaultMessage: - 'This request counts the number of documents that fall ' + - 'outside the criterion of the data buckets.', - }), - }, - }) - .toPromise(); - - resp = mergeOtherBucketAggResponse(aggConfigs, resp, response, aggConfig, filterAgg()); - } - if (aggConfig.params.missingBucket) { - resp = updateMissingBucket(resp, aggConfigs, aggConfig); - } - return resp; - }, params: [ { name: 'field', @@ -144,106 +90,7 @@ export const getTermsBucketAgg = () => name: 'orderBy', write: noop, // prevent default write, it's handled by orderAgg }, - { - name: 'orderAgg', - type: 'agg', - allowedAggs: termsAggFilter, - default: null, - makeAgg(termsAgg, state = { type: 'count' }) { - state.schema = 'orderAgg'; - const orderAgg = termsAgg.aggConfigs.createAggConfig(state, { - addToAggConfigs: false, - }); - orderAgg.id = termsAgg.id + '-orderAgg'; - - return orderAgg; - }, - write(agg, output, aggs) { - const dir = agg.params.order.value; - const order: Record = (output.params.order = {}); - - let orderAgg = agg.params.orderAgg || aggs!.getResponseAggById(agg.params.orderBy); - - // TODO: This works around an Elasticsearch bug the always casts terms agg scripts to strings - // thus causing issues with filtering. This probably causes other issues since float might not - // be able to contain the number on the elasticsearch side - if (output.params.script) { - output.params.value_type = - agg.getField().type === 'number' ? 'float' : agg.getField().type; - } - - if (agg.params.missingBucket && agg.params.field.type === 'string') { - output.params.missing = '__missing__'; - } - - if (!orderAgg) { - order[agg.params.orderBy || '_count'] = dir; - return; - } - - if ( - aggs?.hasTimeShifts() && - Object.keys(aggs?.getTimeShifts()).length > 1 && - aggs.timeRange - ) { - const shift = orderAgg.getTimeShift(); - orderAgg = aggs.createAggConfig( - { - type: 'filtered_metric', - id: orderAgg.id, - params: { - customBucket: aggs - .createAggConfig( - { - type: 'filter', - id: 'shift', - params: { - filter: { - language: 'lucene', - query: { - range: { - [aggs.timeFields![0]]: { - gte: moment(aggs.timeRange.from) - .subtract(shift || 0) - .toISOString(), - lte: moment(aggs.timeRange.to) - .subtract(shift || 0) - .toISOString(), - }, - }, - }, - }, - }, - }, - { - addToAggConfigs: false, - } - ) - .serialize(), - customMetric: orderAgg.serialize(), - }, - enabled: false, - }, - { - addToAggConfigs: false, - } - ); - } - if (orderAgg.type.name === 'count') { - order._count = dir; - return; - } - - const orderAggPath = orderAgg.getValueBucketPath(); - - if (orderAgg.parentId && aggs) { - orderAgg = aggs.byId(orderAgg.parentId); - } - - output.subAggs = (output.subAggs || []).concat(orderAgg); - order[orderAggPath] = dir; - }, - }, + termsOrderAggParamDefinition, { name: 'order', type: 'optioned', diff --git a/src/plugins/data/common/search/aggs/types.ts b/src/plugins/data/common/search/aggs/types.ts index 34c4f0fbf98c5..b9a977e0a8a09 100644 --- a/src/plugins/data/common/search/aggs/types.ts +++ b/src/plugins/data/common/search/aggs/types.ts @@ -67,6 +67,7 @@ import { AggParamsStdDeviation, AggParamsSum, AggParamsTerms, + AggParamsMultiTerms, AggParamsTopHit, aggPercentileRanks, aggPercentiles, @@ -76,6 +77,7 @@ import { aggStdDeviation, aggSum, aggTerms, + aggMultiTerms, aggTopHit, AggTypesRegistry, AggTypesRegistrySetup, @@ -163,6 +165,7 @@ export interface AggParamsMapping { [BUCKET_TYPES.HISTOGRAM]: AggParamsHistogram; [BUCKET_TYPES.DATE_HISTOGRAM]: AggParamsDateHistogram; [BUCKET_TYPES.TERMS]: AggParamsTerms; + [BUCKET_TYPES.MULTI_TERMS]: AggParamsMultiTerms; [METRIC_TYPES.AVG]: AggParamsAvg; [METRIC_TYPES.CARDINALITY]: AggParamsCardinality; [METRIC_TYPES.COUNT]: BaseAggParams; @@ -203,6 +206,7 @@ export interface AggFunctionsMapping { aggHistogram: ReturnType; aggDateHistogram: ReturnType; aggTerms: ReturnType; + aggMultiTerms: ReturnType; aggAvg: ReturnType; aggBucketAvg: ReturnType; aggBucketMax: ReturnType; diff --git a/src/plugins/data/common/search/aggs/utils/get_aggs_formats.ts b/src/plugins/data/common/search/aggs/utils/get_aggs_formats.ts index 1652f51477e64..aade8bc70e4ee 100644 --- a/src/plugins/data/common/search/aggs/utils/get_aggs_formats.ts +++ b/src/plugins/data/common/search/aggs/utils/get_aggs_formats.ts @@ -19,6 +19,7 @@ import { import { DateRange } from '../../expressions'; import { convertDateRangeToString } from '../buckets/lib/date_range'; import { convertIPRangeToString, IpRangeKey } from '../buckets/lib/ip_range'; +import { MultiFieldKey } from '../buckets/multi_field_key'; type GetFieldFormat = (mapping: SerializedFieldFormat) => IFieldFormat; @@ -128,5 +129,25 @@ export function getAggsFormats(getFieldFormat: GetFieldFormat): FieldFormatInsta }; getConverterFor = (type: FieldFormatsContentType) => (val: string) => this.convert(val, type); }, + class AggsMultiTermsFieldFormat extends FieldFormat { + static id = 'multi_terms'; + static hidden = true; + + convert = (val: unknown, type: FieldFormatsContentType) => { + const params = this._params; + const formats = (params.paramsPerField as SerializedFieldFormat[]).map((fieldParams) => + getFieldFormat({ id: fieldParams.id, params: fieldParams }) + ); + + if (String(val) === '__other__') { + return params.otherBucketLabel; + } + + return (val as MultiFieldKey).keys + .map((valPart, i) => formats[i].convert(valPart, type)) + .join(' › '); + }; + getConverterFor = (type: FieldFormatsContentType) => (val: string) => this.convert(val, type); + }, ]; } diff --git a/src/plugins/data/public/actions/filters/create_filters_from_value_click.ts b/src/plugins/data/public/actions/filters/create_filters_from_value_click.ts index 13cb9ba419bf9..e1088b42e37b6 100644 --- a/src/plugins/data/public/actions/filters/create_filters_from_value_click.ts +++ b/src/plugins/data/public/actions/filters/create_filters_from_value_click.ts @@ -53,8 +53,8 @@ const getOtherBucketFilterTerms = ( return [ ...new Set( terms.filter((term) => { - const notOther = term !== '__other__'; - const notMissing = term !== '__missing__'; + const notOther = String(term) !== '__other__'; + const notMissing = String(term) !== '__missing__'; return notOther && notMissing; }) ), @@ -99,7 +99,10 @@ const createFilter = async ( if (value === null || value === undefined || !aggConfig.isFilterable()) { return; } - if (aggConfig.type.name === 'terms' && aggConfig.params.otherBucket) { + if ( + (aggConfig.type.name === 'terms' || aggConfig.type.name === 'multi_terms') && + aggConfig.params.otherBucket + ) { const terms = getOtherBucketFilterTerms(table, columnIndex, rowIndex); filter = aggConfig.createFilter(value, { terms }); } else { diff --git a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/conjunction.tsx b/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/conjunction.tsx index 345f9f8051e5d..4cad30943f4cf 100644 --- a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/conjunction.tsx +++ b/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/conjunction.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { $Keys } from 'utility-types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { KqlQuerySuggestionProvider } from './types'; import { QuerySuggestion, diff --git a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/field.tsx b/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/field.tsx index 44e2f17e083ea..dc34cd8dee247 100644 --- a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/field.tsx +++ b/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/field.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { flatten } from 'lodash'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { escapeKuery } from './lib/escape_kuery'; import { sortPrefixFirst } from './sort_prefix_first'; import { diff --git a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/operator.tsx b/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/operator.tsx index 618e33ddf345a..4e1efef73a42b 100644 --- a/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/operator.tsx +++ b/src/plugins/data/public/autocomplete/providers/kql_query_suggestion/operator.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { $Keys } from 'utility-types'; import { flatten } from 'lodash'; diff --git a/src/plugins/data/public/search/aggs/aggs_service.test.ts b/src/plugins/data/public/search/aggs/aggs_service.test.ts index 563fd5d044073..20e07360a68e5 100644 --- a/src/plugins/data/public/search/aggs/aggs_service.test.ts +++ b/src/plugins/data/public/search/aggs/aggs_service.test.ts @@ -53,7 +53,7 @@ describe('AggsService - public', () => { test('registers default agg types', () => { service.setup(setupDeps); const start = service.start(startDeps); - expect(start.types.getAll().buckets.length).toBe(11); + expect(start.types.getAll().buckets.length).toBe(12); expect(start.types.getAll().metrics.length).toBe(23); }); @@ -69,7 +69,7 @@ describe('AggsService - public', () => { ); const start = service.start(startDeps); - expect(start.types.getAll().buckets.length).toBe(12); + expect(start.types.getAll().buckets.length).toBe(13); expect(start.types.getAll().buckets.some(({ name }) => name === 'foo')).toBe(true); expect(start.types.getAll().metrics.length).toBe(24); expect(start.types.getAll().metrics.some(({ name }) => name === 'bar')).toBe(true); diff --git a/src/plugins/data/public/search/errors/painless_error.tsx b/src/plugins/data/public/search/errors/painless_error.tsx index bad4567024d00..674197d74d6be 100644 --- a/src/plugins/data/public/search/errors/painless_error.tsx +++ b/src/plugins/data/public/search/errors/painless_error.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { EuiButton, EuiSpacer, EuiText, EuiCodeBlock } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ApplicationStart } from 'kibana/public'; import { IEsError, isEsError } from './types'; import { EsError } from './es_error'; diff --git a/src/plugins/data/public/search/errors/search_session_incomplete_warning.tsx b/src/plugins/data/public/search/errors/search_session_incomplete_warning.tsx index c5c5c37f31cf8..20d89dd5dc842 100644 --- a/src/plugins/data/public/search/errors/search_session_incomplete_warning.tsx +++ b/src/plugins/data/public/search/errors/search_session_incomplete_warning.tsx @@ -9,7 +9,7 @@ import { EuiLink, EuiSpacer, EuiText } from '@elastic/eui'; import { CoreStart } from 'kibana/public'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const SearchSessionIncompleteWarning = (docLinks: CoreStart['docLinks']) => ( <> diff --git a/src/plugins/data/public/ui/apply_filters/apply_filter_popover_content.tsx b/src/plugins/data/public/ui/apply_filters/apply_filter_popover_content.tsx index 9cc9af04409f1..64bf7975e3935 100644 --- a/src/plugins/data/public/ui/apply_filters/apply_filter_popover_content.tsx +++ b/src/plugins/data/public/ui/apply_filters/apply_filter_popover_content.tsx @@ -17,7 +17,7 @@ import { EuiModalHeaderTitle, EuiCheckbox, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { Component } from 'react'; import { IIndexPattern } from '../..'; import { Filter } from '../../../common'; diff --git a/src/plugins/data/public/ui/filter_bar/filter_bar.tsx b/src/plugins/data/public/ui/filter_bar/filter_bar.tsx index 8abf6a41d8762..acfafa6dd6bd8 100644 --- a/src/plugins/data/public/ui/filter_bar/filter_bar.tsx +++ b/src/plugins/data/public/ui/filter_bar/filter_bar.tsx @@ -7,7 +7,7 @@ */ import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiPopover } from '@elastic/eui'; -import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n/react'; +import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n-react'; import { buildEmptyFilter, Filter, diff --git a/src/plugins/data/public/ui/filter_bar/filter_editor/index.tsx b/src/plugins/data/public/ui/filter_bar/filter_editor/index.tsx index aeff61739be4d..726a4bf29a43c 100644 --- a/src/plugins/data/public/ui/filter_bar/filter_editor/index.tsx +++ b/src/plugins/data/public/ui/filter_bar/filter_editor/index.tsx @@ -20,7 +20,7 @@ import { EuiSwitchEvent, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n/react'; +import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n-react'; import { Filter, FieldFilter, diff --git a/src/plugins/data/public/ui/filter_bar/filter_editor/phrase_value_input.tsx b/src/plugins/data/public/ui/filter_bar/filter_editor/phrase_value_input.tsx index c71605b8b7244..8690387fe61ed 100644 --- a/src/plugins/data/public/ui/filter_bar/filter_editor/phrase_value_input.tsx +++ b/src/plugins/data/public/ui/filter_bar/filter_editor/phrase_value_input.tsx @@ -7,7 +7,7 @@ */ import { EuiFormRow } from '@elastic/eui'; -import { InjectedIntl, injectI18n } from '@kbn/i18n/react'; +import { InjectedIntl, injectI18n } from '@kbn/i18n-react'; import { uniq } from 'lodash'; import React from 'react'; import { GenericComboBox, GenericComboBoxProps } from './generic_combo_box'; diff --git a/src/plugins/data/public/ui/filter_bar/filter_editor/phrases_values_input.tsx b/src/plugins/data/public/ui/filter_bar/filter_editor/phrases_values_input.tsx index d1eac2b281a92..5bf8a655dc360 100644 --- a/src/plugins/data/public/ui/filter_bar/filter_editor/phrases_values_input.tsx +++ b/src/plugins/data/public/ui/filter_bar/filter_editor/phrases_values_input.tsx @@ -7,7 +7,7 @@ */ import { EuiFormRow } from '@elastic/eui'; -import { InjectedIntl, injectI18n } from '@kbn/i18n/react'; +import { InjectedIntl, injectI18n } from '@kbn/i18n-react'; import { uniq } from 'lodash'; import React from 'react'; import { GenericComboBox, GenericComboBoxProps } from './generic_combo_box'; diff --git a/src/plugins/data/public/ui/filter_bar/filter_editor/range_value_input.tsx b/src/plugins/data/public/ui/filter_bar/filter_editor/range_value_input.tsx index 50bbdf3b5b5f8..27642e62a9618 100644 --- a/src/plugins/data/public/ui/filter_bar/filter_editor/range_value_input.tsx +++ b/src/plugins/data/public/ui/filter_bar/filter_editor/range_value_input.tsx @@ -8,7 +8,7 @@ import moment from 'moment'; import { EuiFormControlLayoutDelimited } from '@elastic/eui'; -import { InjectedIntl, injectI18n } from '@kbn/i18n/react'; +import { InjectedIntl, injectI18n } from '@kbn/i18n-react'; import { get } from 'lodash'; import React from 'react'; import { useKibana } from '../../../../../kibana_react/public'; diff --git a/src/plugins/data/public/ui/filter_bar/filter_editor/value_input_type.tsx b/src/plugins/data/public/ui/filter_bar/filter_editor/value_input_type.tsx index 84d53f8cba106..b72743ae9d2d9 100644 --- a/src/plugins/data/public/ui/filter_bar/filter_editor/value_input_type.tsx +++ b/src/plugins/data/public/ui/filter_bar/filter_editor/value_input_type.tsx @@ -7,7 +7,7 @@ */ import { EuiFieldNumber, EuiFieldText, EuiSelect } from '@elastic/eui'; -import { InjectedIntl, injectI18n } from '@kbn/i18n/react'; +import { InjectedIntl, injectI18n } from '@kbn/i18n-react'; import { isEmpty } from 'lodash'; import React, { Component } from 'react'; import { validateParams } from './lib/filter_editor_utils'; diff --git a/src/plugins/data/public/ui/filter_bar/filter_item.tsx b/src/plugins/data/public/ui/filter_bar/filter_item.tsx index dd186a7e9b668..9e535513aa014 100644 --- a/src/plugins/data/public/ui/filter_bar/filter_item.tsx +++ b/src/plugins/data/public/ui/filter_bar/filter_item.tsx @@ -7,7 +7,7 @@ */ import { EuiContextMenu, EuiPopover } from '@elastic/eui'; -import { InjectedIntl } from '@kbn/i18n/react'; +import { InjectedIntl } from '@kbn/i18n-react'; import { Filter, isFilterPinned, diff --git a/src/plugins/data/public/ui/filter_bar/filter_options.tsx b/src/plugins/data/public/ui/filter_bar/filter_options.tsx index 4d80e505a55be..c3a217c8479db 100644 --- a/src/plugins/data/public/ui/filter_bar/filter_options.tsx +++ b/src/plugins/data/public/ui/filter_bar/filter_options.tsx @@ -7,7 +7,7 @@ */ import { EuiButtonIcon, EuiContextMenu, EuiPopover, EuiPopoverTitle } from '@elastic/eui'; -import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n/react'; +import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n-react'; import { Component } from 'react'; import React from 'react'; diff --git a/src/plugins/data/public/ui/query_string_input/language_switcher.tsx b/src/plugins/data/public/ui/query_string_input/language_switcher.tsx index 9eed22477ae4e..6a52220086194 100644 --- a/src/plugins/data/public/ui/query_string_input/language_switcher.tsx +++ b/src/plugins/data/public/ui/query_string_input/language_switcher.tsx @@ -19,7 +19,7 @@ import { EuiText, PopoverAnchorPosition, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import React, { useState } from 'react'; import { useKibana } from '../../../../kibana_react/public'; diff --git a/src/plugins/data/public/ui/query_string_input/query_bar_top_row.test.tsx b/src/plugins/data/public/ui/query_string_input/query_bar_top_row.test.tsx index 453e74c9fad5b..0fce65f2a47b1 100644 --- a/src/plugins/data/public/ui/query_string_input/query_bar_top_row.test.tsx +++ b/src/plugins/data/public/ui/query_string_input/query_bar_top_row.test.tsx @@ -17,7 +17,7 @@ import QueryBarTopRow from './query_bar_top_row'; import { coreMock } from '../../../../../core/public/mocks'; import { dataPluginMock } from '../../mocks'; import { KibanaContextProvider } from 'src/plugins/kibana_react/public'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { stubIndexPattern } from '../../stubs'; import { UI_SETTINGS } from '../../../common'; const startMock = coreMock.createStart(); diff --git a/src/plugins/data/public/ui/query_string_input/query_string_input.test.tsx b/src/plugins/data/public/ui/query_string_input/query_string_input.test.tsx index 70f24dfe72cd3..764ad45c78d3d 100644 --- a/src/plugins/data/public/ui/query_string_input/query_string_input.test.tsx +++ b/src/plugins/data/public/ui/query_string_input/query_string_input.test.tsx @@ -13,7 +13,7 @@ import { } from './query_string_input.test.mocks'; import React from 'react'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { mount } from 'enzyme'; import { waitFor } from '@testing-library/dom'; import { render } from '@testing-library/react'; diff --git a/src/plugins/data/public/ui/query_string_input/query_string_input.tsx b/src/plugins/data/public/ui/query_string_input/query_string_input.tsx index f29409dc16362..5d3e359ca5fc5 100644 --- a/src/plugins/data/public/ui/query_string_input/query_string_input.tsx +++ b/src/plugins/data/public/ui/query_string_input/query_string_input.tsx @@ -24,7 +24,7 @@ import { EuiIconProps, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { debounce, compact, isEqual, isFunction } from 'lodash'; import { Toast } from 'src/core/public'; import { METRIC_TYPE } from '@kbn/analytics'; diff --git a/src/plugins/data/public/ui/search_bar/index.tsx b/src/plugins/data/public/ui/search_bar/index.tsx index fac421dd743d7..b31b53fd399f2 100644 --- a/src/plugins/data/public/ui/search_bar/index.tsx +++ b/src/plugins/data/public/ui/search_bar/index.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { injectI18n } from '@kbn/i18n/react'; +import { injectI18n } from '@kbn/i18n-react'; import { withKibana } from '../../../../kibana_react/public'; import type { SearchBarProps } from './search_bar'; diff --git a/src/plugins/data/public/ui/search_bar/search_bar.test.tsx b/src/plugins/data/public/ui/search_bar/search_bar.test.tsx index 0de1af3f27f7c..8d57f8a2bd16c 100644 --- a/src/plugins/data/public/ui/search_bar/search_bar.test.tsx +++ b/src/plugins/data/public/ui/search_bar/search_bar.test.tsx @@ -10,7 +10,7 @@ import React from 'react'; import SearchBar from './search_bar'; import { KibanaContextProvider } from 'src/plugins/kibana_react/public'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { coreMock } from '../../../../../core/public/mocks'; const startMock = coreMock.createStart(); diff --git a/src/plugins/data/public/ui/search_bar/search_bar.tsx b/src/plugins/data/public/ui/search_bar/search_bar.tsx index bd48dcd6cd34c..9478d84741b7e 100644 --- a/src/plugins/data/public/ui/search_bar/search_bar.tsx +++ b/src/plugins/data/public/ui/search_bar/search_bar.tsx @@ -7,7 +7,7 @@ */ import { compact } from 'lodash'; -import { InjectedIntl, injectI18n } from '@kbn/i18n/react'; +import { InjectedIntl, injectI18n } from '@kbn/i18n-react'; import classNames from 'classnames'; import React, { Component } from 'react'; import { get, isEqual } from 'lodash'; diff --git a/src/plugins/data/public/ui/shard_failure_modal/shard_failure_modal.tsx b/src/plugins/data/public/ui/shard_failure_modal/shard_failure_modal.tsx index e009af4250e6c..babbabba5ad58 100644 --- a/src/plugins/data/public/ui/shard_failure_modal/shard_failure_modal.tsx +++ b/src/plugins/data/public/ui/shard_failure_modal/shard_failure_modal.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiCodeBlock, diff --git a/src/plugins/data/public/ui/shard_failure_modal/shard_failure_open_modal_button.tsx b/src/plugins/data/public/ui/shard_failure_modal/shard_failure_open_modal_button.tsx index 4ebdd64fede13..32ebd83aa47f0 100644 --- a/src/plugins/data/public/ui/shard_failure_modal/shard_failure_open_modal_button.tsx +++ b/src/plugins/data/public/ui/shard_failure_modal/shard_failure_open_modal_button.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiTextAlign } from '@elastic/eui'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; diff --git a/src/plugins/data/public/utils/table_inspector_view/components/data_table.tsx b/src/plugins/data/public/utils/table_inspector_view/components/data_table.tsx index de72f16358098..4621937664479 100644 --- a/src/plugins/data/public/utils/table_inspector_view/components/data_table.tsx +++ b/src/plugins/data/public/utils/table_inspector_view/components/data_table.tsx @@ -17,7 +17,7 @@ import { EuiToolTip, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { DataViewRow, DataViewColumn } from '../types'; diff --git a/src/plugins/data/public/utils/table_inspector_view/components/data_table_selector.tsx b/src/plugins/data/public/utils/table_inspector_view/components/data_table_selector.tsx index f7dec575680e3..0a55582ebff05 100644 --- a/src/plugins/data/public/utils/table_inspector_view/components/data_table_selector.tsx +++ b/src/plugins/data/public/utils/table_inspector_view/components/data_table_selector.tsx @@ -7,7 +7,7 @@ */ import React, { Component } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import PropTypes from 'prop-types'; import { EuiButtonEmpty, diff --git a/src/plugins/data/public/utils/table_inspector_view/components/data_view.tsx b/src/plugins/data/public/utils/table_inspector_view/components/data_view.tsx index bfdd2d602de19..f310952a5608d 100644 --- a/src/plugins/data/public/utils/table_inspector_view/components/data_view.tsx +++ b/src/plugins/data/public/utils/table_inspector_view/components/data_view.tsx @@ -8,7 +8,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiEmptyPrompt, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiText } from '@elastic/eui'; import { DataTableFormat } from './data_table'; diff --git a/src/plugins/data/public/utils/table_inspector_view/components/download_options.tsx b/src/plugins/data/public/utils/table_inspector_view/components/download_options.tsx index 03d9a8d2b35bc..cd20f7d598ce3 100644 --- a/src/plugins/data/public/utils/table_inspector_view/components/download_options.tsx +++ b/src/plugins/data/public/utils/table_inspector_view/components/download_options.tsx @@ -9,7 +9,7 @@ import React, { Component } from 'react'; import { memoize } from 'lodash'; import PropTypes from 'prop-types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { diff --git a/src/plugins/data/server/lib/get_request_aborted_signal.ts b/src/plugins/data/server/lib/get_request_aborted_signal.ts index 7d1ed1fd89024..1d2849745da26 100644 --- a/src/plugins/data/server/lib/get_request_aborted_signal.ts +++ b/src/plugins/data/server/lib/get_request_aborted_signal.ts @@ -7,8 +7,6 @@ */ import { Observable } from 'rxjs'; -// @ts-ignore not typed -import { AbortController } from 'abortcontroller-polyfill/dist/cjs-ponyfill'; /** * A simple utility function that returns an `AbortSignal` corresponding to an `AbortController` diff --git a/src/plugins/index_pattern_editor/README.md b/src/plugins/data_view_editor/README.md similarity index 50% rename from src/plugins/index_pattern_editor/README.md rename to src/plugins/data_view_editor/README.md index 3ffb589230732..c40fe16b15d72 100644 --- a/src/plugins/index_pattern_editor/README.md +++ b/src/plugins/data_view_editor/README.md @@ -1,26 +1,26 @@ -# Index pattern editor +# Data view editor -Create index patterns from within Kibana apps. +Create data views from within Kibana apps. ## How to use -You first need to add in your kibana.json the "`indexPatternEditor`" plugin as a required dependency of your plugin. +You first need to add in your kibana.json the "`dataViewEditor`" plugin as a required dependency of your plugin. -You will then receive in the start contract of the indexPatternEditor plugin the following API: +You will then receive in the start contract of the dataViewEditor plugin the following API: -### `userPermissions.editIndexPattern(): boolean` +### `userPermissions.editDataView(): boolean` -Convenience method that uses the `core.application.capabilities` api to determine whether the user can create or edit the index pattern. +Convenience method that uses the `core.application.capabilities` api to determine whether the user can create or edit the data view. -### `openEditor(options: IndexPatternEditorProps): CloseEditor` +### `openEditor(options: DataViewEditorProps): CloseEditor` -Use this method to display the index pattern editor to create an index pattern. +Use this method to display the data view editor to create an index pattern. #### `options` -`onSave: (indexPattern: IndexPattern) => void` (**required**) +`onSave: (dataView: DataView) => void` (**required**) -You must provide an `onSave` handler to be notified when an index pattern has been created/updated. This handler is called after the index pattern has been persisted as a saved object. +You must provide an `onSave` handler to be notified when a data vuew has been created/updated. This handler is called after the dataview has been persisted as a saved object. `onCancel: () => void;` (optional) diff --git a/src/plugins/kibana_legacy/jest.config.js b/src/plugins/data_view_editor/jest.config.js similarity index 75% rename from src/plugins/kibana_legacy/jest.config.js rename to src/plugins/data_view_editor/jest.config.js index a2bdf5649f900..5452a757baa45 100644 --- a/src/plugins/kibana_legacy/jest.config.js +++ b/src/plugins/data_view_editor/jest.config.js @@ -9,8 +9,8 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', - roots: ['/src/plugins/kibana_legacy'], - coverageDirectory: '/target/kibana-coverage/jest/src/plugins/kibana_legacy', + roots: ['/src/plugins/data_view_editor'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/data_view_editor', coverageReporters: ['text', 'html'], - collectCoverageFrom: ['/src/plugins/kibana_legacy/public/**/*.{js,ts,tsx}'], + collectCoverageFrom: ['/src/plugins/data_view_editor/public/**/*.{ts,tsx}'], }; diff --git a/src/plugins/index_pattern_editor/kibana.json b/src/plugins/data_view_editor/kibana.json similarity index 52% rename from src/plugins/index_pattern_editor/kibana.json rename to src/plugins/data_view_editor/kibana.json index b4a1bea555616..8e83cb1be046b 100644 --- a/src/plugins/index_pattern_editor/kibana.json +++ b/src/plugins/data_view_editor/kibana.json @@ -1,13 +1,13 @@ { - "id": "indexPatternEditor", + "id": "dataViewEditor", "version": "kibana", "server": false, "ui": true, - "requiredPlugins": ["data"], + "requiredPlugins": ["data", "dataViews"], "requiredBundles": ["kibanaReact", "esUiShared"], "owner": { "name": "App Services", "githubTeam": "kibana-app-services" }, - "description": "This plugin provides the ability to create index patterns via a modal flyout from any kibana app" + "description": "This plugin provides the ability to create data views via a modal flyout from any kibana app" } diff --git a/src/plugins/index_pattern_editor/public/components/_templates.scss b/src/plugins/data_view_editor/public/components/_templates.scss similarity index 100% rename from src/plugins/index_pattern_editor/public/components/_templates.scss rename to src/plugins/data_view_editor/public/components/_templates.scss diff --git a/src/plugins/index_pattern_editor/public/components/_variables.scss b/src/plugins/data_view_editor/public/components/_variables.scss similarity index 100% rename from src/plugins/index_pattern_editor/public/components/_variables.scss rename to src/plugins/data_view_editor/public/components/_variables.scss diff --git a/src/plugins/index_pattern_editor/public/components/advanced_params_content/advanced_params_content.tsx b/src/plugins/data_view_editor/public/components/advanced_params_content/advanced_params_content.tsx similarity index 100% rename from src/plugins/index_pattern_editor/public/components/advanced_params_content/advanced_params_content.tsx rename to src/plugins/data_view_editor/public/components/advanced_params_content/advanced_params_content.tsx diff --git a/src/plugins/index_pattern_editor/public/components/advanced_params_content/advanced_params_section.tsx b/src/plugins/data_view_editor/public/components/advanced_params_content/advanced_params_section.tsx similarity index 100% rename from src/plugins/index_pattern_editor/public/components/advanced_params_content/advanced_params_section.tsx rename to src/plugins/data_view_editor/public/components/advanced_params_content/advanced_params_section.tsx diff --git a/src/plugins/index_pattern_editor/public/components/advanced_params_content/index.ts b/src/plugins/data_view_editor/public/components/advanced_params_content/index.ts similarity index 100% rename from src/plugins/index_pattern_editor/public/components/advanced_params_content/index.ts rename to src/plugins/data_view_editor/public/components/advanced_params_content/index.ts diff --git a/src/plugins/index_pattern_editor/public/components/index_pattern_editor.scss b/src/plugins/data_view_editor/public/components/data_view_editor.scss similarity index 100% rename from src/plugins/index_pattern_editor/public/components/index_pattern_editor.scss rename to src/plugins/data_view_editor/public/components/data_view_editor.scss diff --git a/src/plugins/index_pattern_editor/public/components/index_pattern_editor.tsx b/src/plugins/data_view_editor/public/components/data_view_editor.tsx similarity index 66% rename from src/plugins/index_pattern_editor/public/components/index_pattern_editor.tsx rename to src/plugins/data_view_editor/public/components/data_view_editor.tsx index cbf6e4bdf7305..18af3c4ebd6d5 100644 --- a/src/plugins/index_pattern_editor/public/components/index_pattern_editor.tsx +++ b/src/plugins/data_view_editor/public/components/data_view_editor.tsx @@ -8,29 +8,29 @@ import React from 'react'; import { EuiFlyout } from '@elastic/eui'; -import { IndexPatternEditorLazy } from './index_pattern_editor_lazy'; -import { IndexPatternEditorContext, IndexPatternEditorProps } from '../types'; +import { DataViewEditorLazy } from './data_view_editor_lazy'; +import { DataViewEditorContext, DataViewEditorProps } from '../types'; import { createKibanaReactContext } from '../shared_imports'; -import './index_pattern_editor.scss'; +import './data_view_editor.scss'; -export interface IndexPatternEditorPropsWithServices extends IndexPatternEditorProps { - services: IndexPatternEditorContext; +export interface DataViewEditorPropsWithServices extends DataViewEditorProps { + services: DataViewEditorContext; } -export const IndexPatternEditor = ({ +export const DataViewEditor = ({ onSave, onCancel = () => {}, services, defaultTypeIsRollup = false, requireTimestampField = false, -}: IndexPatternEditorPropsWithServices) => { +}: DataViewEditorPropsWithServices) => { const { Provider: KibanaReactContextProvider } = - createKibanaReactContext(services); + createKibanaReactContext(services); return ( {}} hideCloseButton={true} size="l"> - { const { - services: { http, indexPatternService, uiSettings, searchClient }, - } = useKibana(); + services: { http, dataViews, uiSettings, searchClient }, + } = useKibana(); const { form } = useForm({ defaultValue: { @@ -155,13 +155,13 @@ const IndexPatternEditorFlyoutContentComponent = ({ useEffect(() => { loadSources(); const getTitles = async () => { - const indexPatternTitles = await indexPatternService.getTitles(); + const indexPatternTitles = await dataViews.getTitles(); setExistingIndexPatterns(indexPatternTitles); setIsLoadingIndexPatterns(false); }; getTitles(); - }, [http, indexPatternService, loadSources]); + }, [http, dataViews, loadSources]); // loading rollup info useEffect(() => { @@ -199,9 +199,7 @@ const IndexPatternEditorFlyoutContentComponent = ({ getFieldsOptions.rollupIndex = rollupIndex; } - const fields = await ensureMinimumTime( - indexPatternService.getFieldsForWildcard(getFieldsOptions) - ); + const fields = await ensureMinimumTime(dataViews.getFieldsForWildcard(getFieldsOptions)); timestampOptions = extractTimeFields(fields, requireTimestampField); } if (currentLoadingTimestampFieldsIdx === currentLoadingTimestampFieldsRef.current) { @@ -212,7 +210,7 @@ const IndexPatternEditorFlyoutContentComponent = ({ }, [ existingIndexPatterns, - indexPatternService, + dataViews, requireTimestampField, rollupIndex, type, @@ -392,8 +390,8 @@ const loadMatchedIndices = memoizeOne( searchClient, }: { isRollupIndex: (index: string) => boolean; - http: IndexPatternEditorContext['http']; - searchClient: IndexPatternEditorContext['searchClient']; + http: DataViewEditorContext['http']; + searchClient: DataViewEditorContext['searchClient']; } ): Promise<{ matchedIndicesResult: MatchedIndicesSet; diff --git a/src/plugins/index_pattern_editor/public/components/index_pattern_editor_lazy.tsx b/src/plugins/data_view_editor/public/components/data_view_editor_lazy.tsx similarity index 77% rename from src/plugins/index_pattern_editor/public/components/index_pattern_editor_lazy.tsx rename to src/plugins/data_view_editor/public/components/data_view_editor_lazy.tsx index 4241f042af0d5..0abf5e3821f8e 100644 --- a/src/plugins/index_pattern_editor/public/components/index_pattern_editor_lazy.tsx +++ b/src/plugins/data_view_editor/public/components/data_view_editor_lazy.tsx @@ -9,13 +9,13 @@ import React, { lazy, Suspense } from 'react'; import { EuiLoadingSpinner } from '@elastic/eui'; -import { IndexPatternEditorProps } from '../types'; +import { DataViewEditorProps } from '../types'; const IndexPatternFlyoutContentContainer = lazy( - () => import('./index_pattern_flyout_content_container') + () => import('./data_view_flyout_content_container') ); -export const IndexPatternEditorLazy = (props: IndexPatternEditorProps) => ( +export const DataViewEditorLazy = (props: DataViewEditorProps) => ( }> diff --git a/src/plugins/index_pattern_editor/public/components/index_pattern_flyout_content_container.tsx b/src/plugins/data_view_editor/public/components/data_view_flyout_content_container.tsx similarity index 79% rename from src/plugins/index_pattern_editor/public/components/index_pattern_flyout_content_container.tsx rename to src/plugins/data_view_editor/public/components/data_view_flyout_content_container.tsx index 39adf0a398a37..bf42582db8e3f 100644 --- a/src/plugins/index_pattern_editor/public/components/index_pattern_flyout_content_container.tsx +++ b/src/plugins/data_view_editor/public/components/data_view_flyout_content_container.tsx @@ -10,22 +10,22 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { IndexPatternSpec, useKibana } from '../shared_imports'; -import { IndexPatternEditorFlyoutContent } from './index_pattern_editor_flyout_content'; -import { IndexPatternEditorContext, IndexPatternEditorProps } from '../types'; +import { IndexPatternEditorFlyoutContent } from './data_view_editor_flyout_content'; +import { DataViewEditorContext, DataViewEditorProps } from '../types'; const IndexPatternFlyoutContentContainer = ({ onSave, onCancel = () => {}, defaultTypeIsRollup, requireTimestampField = false, -}: IndexPatternEditorProps) => { +}: DataViewEditorProps) => { const { - services: { indexPatternService, notifications }, - } = useKibana(); + services: { dataViews, notifications }, + } = useKibana(); const onSaveClick = async (indexPatternSpec: IndexPatternSpec) => { try { - const indexPattern = await indexPatternService.createAndSave(indexPatternSpec); + const indexPattern = await dataViews.createAndSave(indexPatternSpec); const message = i18n.translate('indexPatternEditor.saved', { defaultMessage: "Saved '{indexPatternTitle}'", diff --git a/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_list_prompt/__snapshots__/empty_index_list_prompt.test.tsx.snap b/src/plugins/data_view_editor/public/components/empty_prompts/empty_index_list_prompt/__snapshots__/empty_index_list_prompt.test.tsx.snap similarity index 100% rename from src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_list_prompt/__snapshots__/empty_index_list_prompt.test.tsx.snap rename to src/plugins/data_view_editor/public/components/empty_prompts/empty_index_list_prompt/__snapshots__/empty_index_list_prompt.test.tsx.snap diff --git a/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_list_prompt/empty_index_list_prompt.scss b/src/plugins/data_view_editor/public/components/empty_prompts/empty_index_list_prompt/empty_index_list_prompt.scss similarity index 100% rename from src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_list_prompt/empty_index_list_prompt.scss rename to src/plugins/data_view_editor/public/components/empty_prompts/empty_index_list_prompt/empty_index_list_prompt.scss diff --git a/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_list_prompt/empty_index_list_prompt.test.tsx b/src/plugins/data_view_editor/public/components/empty_prompts/empty_index_list_prompt/empty_index_list_prompt.test.tsx similarity index 100% rename from src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_list_prompt/empty_index_list_prompt.test.tsx rename to src/plugins/data_view_editor/public/components/empty_prompts/empty_index_list_prompt/empty_index_list_prompt.test.tsx diff --git a/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_list_prompt/empty_index_list_prompt.tsx b/src/plugins/data_view_editor/public/components/empty_prompts/empty_index_list_prompt/empty_index_list_prompt.tsx similarity index 99% rename from src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_list_prompt/empty_index_list_prompt.tsx rename to src/plugins/data_view_editor/public/components/empty_prompts/empty_index_list_prompt/empty_index_list_prompt.tsx index 70493f33df33e..34cfb2802ac89 100644 --- a/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_list_prompt/empty_index_list_prompt.tsx +++ b/src/plugins/data_view_editor/public/components/empty_prompts/empty_index_list_prompt/empty_index_list_prompt.tsx @@ -8,7 +8,7 @@ import './empty_index_list_prompt.scss'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiPageContentHeader, EuiPageContentHeaderSection, diff --git a/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_list_prompt/index.ts b/src/plugins/data_view_editor/public/components/empty_prompts/empty_index_list_prompt/index.ts similarity index 100% rename from src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_list_prompt/index.ts rename to src/plugins/data_view_editor/public/components/empty_prompts/empty_index_list_prompt/index.ts diff --git a/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_pattern_prompt/__snapshots__/empty_index_pattern_prompt.test.tsx.snap b/src/plugins/data_view_editor/public/components/empty_prompts/empty_index_pattern_prompt/__snapshots__/empty_index_pattern_prompt.test.tsx.snap similarity index 100% rename from src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_pattern_prompt/__snapshots__/empty_index_pattern_prompt.test.tsx.snap rename to src/plugins/data_view_editor/public/components/empty_prompts/empty_index_pattern_prompt/__snapshots__/empty_index_pattern_prompt.test.tsx.snap diff --git a/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_pattern_prompt/assets/index_pattern_illustration.scss b/src/plugins/data_view_editor/public/components/empty_prompts/empty_index_pattern_prompt/assets/index_pattern_illustration.scss similarity index 100% rename from src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_pattern_prompt/assets/index_pattern_illustration.scss rename to src/plugins/data_view_editor/public/components/empty_prompts/empty_index_pattern_prompt/assets/index_pattern_illustration.scss diff --git a/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_pattern_prompt/assets/index_pattern_illustration.tsx b/src/plugins/data_view_editor/public/components/empty_prompts/empty_index_pattern_prompt/assets/index_pattern_illustration.tsx similarity index 100% rename from src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_pattern_prompt/assets/index_pattern_illustration.tsx rename to src/plugins/data_view_editor/public/components/empty_prompts/empty_index_pattern_prompt/assets/index_pattern_illustration.tsx diff --git a/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_pattern_prompt/empty_index_pattern_prompt.scss b/src/plugins/data_view_editor/public/components/empty_prompts/empty_index_pattern_prompt/empty_index_pattern_prompt.scss similarity index 100% rename from src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_pattern_prompt/empty_index_pattern_prompt.scss rename to src/plugins/data_view_editor/public/components/empty_prompts/empty_index_pattern_prompt/empty_index_pattern_prompt.scss diff --git a/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_pattern_prompt/empty_index_pattern_prompt.test.tsx b/src/plugins/data_view_editor/public/components/empty_prompts/empty_index_pattern_prompt/empty_index_pattern_prompt.test.tsx similarity index 100% rename from src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_pattern_prompt/empty_index_pattern_prompt.test.tsx rename to src/plugins/data_view_editor/public/components/empty_prompts/empty_index_pattern_prompt/empty_index_pattern_prompt.test.tsx diff --git a/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_pattern_prompt/empty_index_pattern_prompt.tsx b/src/plugins/data_view_editor/public/components/empty_prompts/empty_index_pattern_prompt/empty_index_pattern_prompt.tsx similarity index 98% rename from src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_pattern_prompt/empty_index_pattern_prompt.tsx rename to src/plugins/data_view_editor/public/components/empty_prompts/empty_index_pattern_prompt/empty_index_pattern_prompt.tsx index b6859c7fa7ac0..e99ef24858ca7 100644 --- a/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_pattern_prompt/empty_index_pattern_prompt.tsx +++ b/src/plugins/data_view_editor/public/components/empty_prompts/empty_index_pattern_prompt/empty_index_pattern_prompt.tsx @@ -9,7 +9,7 @@ import './empty_index_pattern_prompt.scss'; import React, { lazy, Suspense } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiPageContent, EuiSpacer, EuiText, EuiFlexItem, EuiFlexGroup } from '@elastic/eui'; import { EuiDescriptionListTitle } from '@elastic/eui'; diff --git a/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_pattern_prompt/index.tsx b/src/plugins/data_view_editor/public/components/empty_prompts/empty_index_pattern_prompt/index.tsx similarity index 100% rename from src/plugins/index_pattern_editor/public/components/empty_prompts/empty_index_pattern_prompt/index.tsx rename to src/plugins/data_view_editor/public/components/empty_prompts/empty_index_pattern_prompt/index.tsx diff --git a/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_prompts.test.tsx b/src/plugins/data_view_editor/public/components/empty_prompts/empty_prompts.test.tsx similarity index 100% rename from src/plugins/index_pattern_editor/public/components/empty_prompts/empty_prompts.test.tsx rename to src/plugins/data_view_editor/public/components/empty_prompts/empty_prompts.test.tsx diff --git a/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_prompts.tsx b/src/plugins/data_view_editor/public/components/empty_prompts/empty_prompts.tsx similarity index 91% rename from src/plugins/index_pattern_editor/public/components/empty_prompts/empty_prompts.tsx rename to src/plugins/data_view_editor/public/components/empty_prompts/empty_prompts.tsx index 51c64f4c13404..d44e793d4ef49 100644 --- a/src/plugins/index_pattern_editor/public/components/empty_prompts/empty_prompts.tsx +++ b/src/plugins/data_view_editor/public/components/empty_prompts/empty_prompts.tsx @@ -11,7 +11,7 @@ import useAsync from 'react-use/lib/useAsync'; import { useKibana } from '../../shared_imports'; -import { MatchedItem, ResolveIndexResponseItemAlias, IndexPatternEditorContext } from '../../types'; +import { MatchedItem, ResolveIndexResponseItemAlias, DataViewEditorContext } from '../../types'; import { getIndices } from '../../lib'; @@ -46,8 +46,8 @@ export function isUserDataIndex(source: MatchedItem) { export const EmptyPrompts: FC = ({ allSources, onCancel, children, loadSources }) => { const { - services: { docLinks, application, http, searchClient, indexPatternService }, - } = useKibana(); + services: { docLinks, application, http, searchClient, dataViews }, + } = useKibana(); const [remoteClustersExist, setRemoteClustersExist] = useState(false); const [hasCheckedRemoteClusters, setHasCheckedRemoteClusters] = useState(false); @@ -55,9 +55,7 @@ export const EmptyPrompts: FC = ({ allSources, onCancel, children, loadSo const [goToForm, setGoToForm] = useState(false); const hasDataIndices = allSources.some(isUserDataIndex); - const hasUserIndexPattern = useAsync(() => - indexPatternService.hasUserDataView().catch(() => true) - ); + const hasUserIndexPattern = useAsync(() => dataViews.hasUserDataView().catch(() => true)); useEffect(() => { if (!hasDataIndices && !hasCheckedRemoteClusters) { diff --git a/src/plugins/index_pattern_editor/public/components/empty_prompts/index.tsx b/src/plugins/data_view_editor/public/components/empty_prompts/index.tsx similarity index 100% rename from src/plugins/index_pattern_editor/public/components/empty_prompts/index.tsx rename to src/plugins/data_view_editor/public/components/empty_prompts/index.tsx diff --git a/src/plugins/index_pattern_editor/public/components/empty_prompts/prompt_footer/index.ts b/src/plugins/data_view_editor/public/components/empty_prompts/prompt_footer/index.ts similarity index 100% rename from src/plugins/index_pattern_editor/public/components/empty_prompts/prompt_footer/index.ts rename to src/plugins/data_view_editor/public/components/empty_prompts/prompt_footer/index.ts diff --git a/src/plugins/index_pattern_editor/public/components/empty_prompts/prompt_footer/prompt_footer.tsx b/src/plugins/data_view_editor/public/components/empty_prompts/prompt_footer/prompt_footer.tsx similarity index 100% rename from src/plugins/index_pattern_editor/public/components/empty_prompts/prompt_footer/prompt_footer.tsx rename to src/plugins/data_view_editor/public/components/empty_prompts/prompt_footer/prompt_footer.tsx diff --git a/src/plugins/index_pattern_editor/public/components/flyout_panels/flyout_panel.tsx b/src/plugins/data_view_editor/public/components/flyout_panels/flyout_panel.tsx similarity index 100% rename from src/plugins/index_pattern_editor/public/components/flyout_panels/flyout_panel.tsx rename to src/plugins/data_view_editor/public/components/flyout_panels/flyout_panel.tsx diff --git a/src/plugins/index_pattern_editor/public/components/flyout_panels/flyout_panels.scss b/src/plugins/data_view_editor/public/components/flyout_panels/flyout_panels.scss similarity index 100% rename from src/plugins/index_pattern_editor/public/components/flyout_panels/flyout_panels.scss rename to src/plugins/data_view_editor/public/components/flyout_panels/flyout_panels.scss diff --git a/src/plugins/index_pattern_editor/public/components/flyout_panels/flyout_panels.tsx b/src/plugins/data_view_editor/public/components/flyout_panels/flyout_panels.tsx similarity index 100% rename from src/plugins/index_pattern_editor/public/components/flyout_panels/flyout_panels.tsx rename to src/plugins/data_view_editor/public/components/flyout_panels/flyout_panels.tsx diff --git a/src/plugins/index_pattern_editor/public/components/flyout_panels/flyout_panels_content.tsx b/src/plugins/data_view_editor/public/components/flyout_panels/flyout_panels_content.tsx similarity index 100% rename from src/plugins/index_pattern_editor/public/components/flyout_panels/flyout_panels_content.tsx rename to src/plugins/data_view_editor/public/components/flyout_panels/flyout_panels_content.tsx diff --git a/src/plugins/index_pattern_editor/public/components/flyout_panels/flyout_panels_footer.tsx b/src/plugins/data_view_editor/public/components/flyout_panels/flyout_panels_footer.tsx similarity index 100% rename from src/plugins/index_pattern_editor/public/components/flyout_panels/flyout_panels_footer.tsx rename to src/plugins/data_view_editor/public/components/flyout_panels/flyout_panels_footer.tsx diff --git a/src/plugins/index_pattern_editor/public/components/flyout_panels/flyout_panels_header.tsx b/src/plugins/data_view_editor/public/components/flyout_panels/flyout_panels_header.tsx similarity index 100% rename from src/plugins/index_pattern_editor/public/components/flyout_panels/flyout_panels_header.tsx rename to src/plugins/data_view_editor/public/components/flyout_panels/flyout_panels_header.tsx diff --git a/src/plugins/index_pattern_editor/public/components/flyout_panels/index.ts b/src/plugins/data_view_editor/public/components/flyout_panels/index.ts similarity index 100% rename from src/plugins/index_pattern_editor/public/components/flyout_panels/index.ts rename to src/plugins/data_view_editor/public/components/flyout_panels/index.ts diff --git a/src/plugins/index_pattern_editor/public/components/footer/footer.tsx b/src/plugins/data_view_editor/public/components/footer/footer.tsx similarity index 100% rename from src/plugins/index_pattern_editor/public/components/footer/footer.tsx rename to src/plugins/data_view_editor/public/components/footer/footer.tsx diff --git a/src/plugins/index_pattern_editor/public/components/footer/index.ts b/src/plugins/data_view_editor/public/components/footer/index.ts similarity index 100% rename from src/plugins/index_pattern_editor/public/components/footer/index.ts rename to src/plugins/data_view_editor/public/components/footer/index.ts diff --git a/src/plugins/index_pattern_editor/public/components/form_fields/index.ts b/src/plugins/data_view_editor/public/components/form_fields/index.ts similarity index 100% rename from src/plugins/index_pattern_editor/public/components/form_fields/index.ts rename to src/plugins/data_view_editor/public/components/form_fields/index.ts diff --git a/src/plugins/index_pattern_editor/public/components/form_fields/timestamp_field.tsx b/src/plugins/data_view_editor/public/components/form_fields/timestamp_field.tsx similarity index 100% rename from src/plugins/index_pattern_editor/public/components/form_fields/timestamp_field.tsx rename to src/plugins/data_view_editor/public/components/form_fields/timestamp_field.tsx diff --git a/src/plugins/index_pattern_editor/public/components/form_fields/title_field.tsx b/src/plugins/data_view_editor/public/components/form_fields/title_field.tsx similarity index 100% rename from src/plugins/index_pattern_editor/public/components/form_fields/title_field.tsx rename to src/plugins/data_view_editor/public/components/form_fields/title_field.tsx diff --git a/src/plugins/index_pattern_editor/public/components/form_fields/type_field.tsx b/src/plugins/data_view_editor/public/components/form_fields/type_field.tsx similarity index 98% rename from src/plugins/index_pattern_editor/public/components/form_fields/type_field.tsx rename to src/plugins/data_view_editor/public/components/form_fields/type_field.tsx index 0f4a040d1317b..f6545d5fcb08e 100644 --- a/src/plugins/index_pattern_editor/public/components/form_fields/type_field.tsx +++ b/src/plugins/data_view_editor/public/components/form_fields/type_field.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { euiLightVars } from '@kbn/ui-shared-deps-src/theme'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFormRow, diff --git a/src/plugins/index_pattern_editor/public/components/form_schema.ts b/src/plugins/data_view_editor/public/components/form_schema.ts similarity index 100% rename from src/plugins/index_pattern_editor/public/components/form_schema.ts rename to src/plugins/data_view_editor/public/components/form_schema.ts diff --git a/src/plugins/index_pattern_editor/public/components/index.ts b/src/plugins/data_view_editor/public/components/index.ts similarity index 81% rename from src/plugins/index_pattern_editor/public/components/index.ts rename to src/plugins/data_view_editor/public/components/index.ts index b78ac6946ad94..0486b6d72215c 100644 --- a/src/plugins/index_pattern_editor/public/components/index.ts +++ b/src/plugins/data_view_editor/public/components/index.ts @@ -6,10 +6,10 @@ * Side Public License, v 1. */ -export type { Props as IndexPatternEditorFlyoutContentProps } from './index_pattern_editor_flyout_content'; -export { IndexPatternEditorFlyoutContent } from './index_pattern_editor_flyout_content'; +export type { Props as IndexPatternEditorFlyoutContentProps } from './data_view_editor_flyout_content'; +export { IndexPatternEditorFlyoutContent } from './data_view_editor_flyout_content'; -export { IndexPatternEditor } from './index_pattern_editor'; +export { DataViewEditor } from './data_view_editor'; export { schema } from './form_schema'; export { TimestampField, TypeField, TitleField } from './form_fields'; diff --git a/src/plugins/index_pattern_editor/public/components/loading_indices/__snapshots__/loading_indices.test.tsx.snap b/src/plugins/data_view_editor/public/components/loading_indices/__snapshots__/loading_indices.test.tsx.snap similarity index 100% rename from src/plugins/index_pattern_editor/public/components/loading_indices/__snapshots__/loading_indices.test.tsx.snap rename to src/plugins/data_view_editor/public/components/loading_indices/__snapshots__/loading_indices.test.tsx.snap diff --git a/src/plugins/index_pattern_editor/public/components/loading_indices/index.ts b/src/plugins/data_view_editor/public/components/loading_indices/index.ts similarity index 100% rename from src/plugins/index_pattern_editor/public/components/loading_indices/index.ts rename to src/plugins/data_view_editor/public/components/loading_indices/index.ts diff --git a/src/plugins/index_pattern_editor/public/components/loading_indices/loading_indices.test.tsx b/src/plugins/data_view_editor/public/components/loading_indices/loading_indices.test.tsx similarity index 100% rename from src/plugins/index_pattern_editor/public/components/loading_indices/loading_indices.test.tsx rename to src/plugins/data_view_editor/public/components/loading_indices/loading_indices.test.tsx diff --git a/src/plugins/index_pattern_editor/public/components/loading_indices/loading_indices.tsx b/src/plugins/data_view_editor/public/components/loading_indices/loading_indices.tsx similarity index 95% rename from src/plugins/index_pattern_editor/public/components/loading_indices/loading_indices.tsx rename to src/plugins/data_view_editor/public/components/loading_indices/loading_indices.tsx index 14ae51567938d..b67252edc145c 100644 --- a/src/plugins/index_pattern_editor/public/components/loading_indices/loading_indices.tsx +++ b/src/plugins/data_view_editor/public/components/loading_indices/loading_indices.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiTitle, EuiLoadingSpinner } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const LoadingIndices = ({ ...rest }) => ( >; +export type Start = jest.Mocked>; -export type Setup = jest.Mocked>; +export type Setup = jest.Mocked>; const createSetupContract = (): Setup => { return {}; @@ -21,7 +21,7 @@ const createStartContract = (): Start => { openEditor: jest.fn(), IndexPatternEditorComponent: jest.fn(), userPermissions: { - editIndexPattern: jest.fn(), + editDataView: jest.fn(), }, }; }; diff --git a/src/plugins/index_pattern_editor/public/open_editor.tsx b/src/plugins/data_view_editor/public/open_editor.tsx similarity index 78% rename from src/plugins/index_pattern_editor/public/open_editor.tsx rename to src/plugins/data_view_editor/public/open_editor.tsx index 290af83c94fea..98843d6d1698a 100644 --- a/src/plugins/index_pattern_editor/public/open_editor.tsx +++ b/src/plugins/data_view_editor/public/open_editor.tsx @@ -8,7 +8,8 @@ import React from 'react'; import { CoreStart, OverlayRef } from 'src/core/public'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; +import type { DataViewsPublicPluginStart } from 'src/plugins/data_views/public'; import { createKibanaReactContext, @@ -17,27 +18,27 @@ import { DataPublicPluginStart, } from './shared_imports'; -import { CloseEditor, IndexPatternEditorContext, IndexPatternEditorProps } from './types'; -import { IndexPatternEditorLazy } from './components/index_pattern_editor_lazy'; +import { CloseEditor, DataViewEditorContext, DataViewEditorProps } from './types'; +import { DataViewEditorLazy } from './components/data_view_editor_lazy'; interface Dependencies { core: CoreStart; - indexPatternService: DataPublicPluginStart['indexPatterns']; searchClient: DataPublicPluginStart['search']['search']; + dataViews: DataViewsPublicPluginStart; } export const getEditorOpener = - ({ core, indexPatternService, searchClient }: Dependencies) => - (options: IndexPatternEditorProps): CloseEditor => { + ({ core, searchClient, dataViews }: Dependencies) => + (options: DataViewEditorProps): CloseEditor => { const { uiSettings, overlays, docLinks, notifications, http, application } = core; const { Provider: KibanaReactContextProvider } = - createKibanaReactContext({ + createKibanaReactContext({ uiSettings, docLinks, http, notifications, application, - indexPatternService, + dataViews, searchClient, }); @@ -48,7 +49,7 @@ export const getEditorOpener = onCancel = () => {}, defaultTypeIsRollup = false, requireTimestampField = false, - }: IndexPatternEditorProps): CloseEditor => { + }: DataViewEditorProps): CloseEditor => { const closeEditor = () => { if (overlayRef) { overlayRef.close(); @@ -68,7 +69,7 @@ export const getEditorOpener = toMountPoint( - { closeEditor(); diff --git a/src/plugins/index_pattern_editor/public/plugin.test.tsx b/src/plugins/data_view_editor/public/plugin.test.tsx similarity index 84% rename from src/plugins/index_pattern_editor/public/plugin.test.tsx rename to src/plugins/data_view_editor/public/plugin.test.tsx index b11d6b0c176b6..f8735462fcff5 100644 --- a/src/plugins/index_pattern_editor/public/plugin.test.tsx +++ b/src/plugins/data_view_editor/public/plugin.test.tsx @@ -21,25 +21,26 @@ import { coreMock } from 'src/core/public/mocks'; import { dataPluginMock } from '../../data/public/mocks'; import { usageCollectionPluginMock } from '../../usage_collection/public/mocks'; -import { IndexPatternEditorLazy } from './components/index_pattern_editor_lazy'; -import { IndexPatternEditorPlugin } from './plugin'; +import { DataViewEditorLazy } from './components/data_view_editor_lazy'; +import { DataViewEditorPlugin } from './plugin'; const noop = () => {}; -describe('IndexPatternEditorPlugin', () => { +describe('DataViewEditorPlugin', () => { const coreStart: CoreStart = coreMock.createStart(); const pluginStart = { data: dataPluginMock.createStartContract(), usageCollection: usageCollectionPluginMock.createSetupContract(), + dataViews: dataPluginMock.createStartContract().dataViews, }; - let plugin: IndexPatternEditorPlugin; + let plugin: DataViewEditorPlugin; beforeEach(() => { - plugin = new IndexPatternEditorPlugin(); + plugin = new DataViewEditorPlugin(); }); - test('should expose a handler to open the indexpattern field editor', async () => { + test('should expose a handler to open the data view field editor', async () => { const startApi = await plugin.start(coreStart, pluginStart); expect(startApi.openEditor).toBeDefined(); }); @@ -63,7 +64,7 @@ describe('IndexPatternEditorPlugin', () => { const [[arg]] = openFlyout.mock.calls; const i18nProvider = arg.props.children; - expect(i18nProvider.props.children.type).toBe(IndexPatternEditorLazy); + expect(i18nProvider.props.children.type).toBe(DataViewEditorLazy); // We force call the "onSave" prop from the component // and make sure that the the spy is being called. diff --git a/src/plugins/index_pattern_editor/public/plugin.tsx b/src/plugins/data_view_editor/public/plugin.tsx similarity index 66% rename from src/plugins/index_pattern_editor/public/plugin.tsx rename to src/plugins/data_view_editor/public/plugin.tsx index f31abd76d7f5e..68a0191836291 100644 --- a/src/plugins/index_pattern_editor/public/plugin.tsx +++ b/src/plugins/data_view_editor/public/plugin.tsx @@ -9,17 +9,11 @@ import React from 'react'; import { Plugin, CoreSetup, CoreStart } from 'src/core/public'; -import { - PluginSetup, - PluginStart, - SetupPlugins, - StartPlugins, - IndexPatternEditorProps, -} from './types'; +import { PluginSetup, PluginStart, SetupPlugins, StartPlugins, DataViewEditorProps } from './types'; import { getEditorOpener } from './open_editor'; -import { IndexPatternEditor } from './components/index_pattern_editor'; +import { DataViewEditor } from './components/data_view_editor'; -export class IndexPatternEditorPlugin +export class DataViewEditorPlugin implements Plugin { public setup(core: CoreSetup, plugins: SetupPlugins): PluginSetup { @@ -28,45 +22,45 @@ export class IndexPatternEditorPlugin public start(core: CoreStart, plugins: StartPlugins) { const { application, uiSettings, docLinks, http, notifications } = core; - const { data } = plugins; + const { data, dataViews } = plugins; return { /** - * Index pattern editor flyout via function interface - * @param IndexPatternEditorProps - index pattern editor config + * Data view editor flyout via function interface + * @param DataViewEditorProps - data view editor config * @returns method to close editor */ openEditor: getEditorOpener({ core, - indexPatternService: data.indexPatterns, + dataViews, searchClient: data.search.search, }), /** - * Index pattern editor flyout via react component - * @param IndexPatternEditorProps - index pattern editor config + * Data view editor flyout via react component + * @param DataViewEditorProps - data view editor config * @returns JSX.Element */ - IndexPatternEditorComponent: (props: IndexPatternEditorProps) => ( - ( + ), /** - * Convenience method to determine whether the user can create or edit edit the index patterns. + * Convenience method to determine whether the user can create or edit edit data views. * * @returns boolean */ userPermissions: { - editIndexPattern: () => { + editDataView: () => { return application.capabilities.management.kibana.indexPatterns; }, }, diff --git a/src/plugins/index_pattern_editor/public/shared_imports.ts b/src/plugins/data_view_editor/public/shared_imports.ts similarity index 96% rename from src/plugins/index_pattern_editor/public/shared_imports.ts rename to src/plugins/data_view_editor/public/shared_imports.ts index 7edb7dfd0f599..02204bb1c176f 100644 --- a/src/plugins/index_pattern_editor/public/shared_imports.ts +++ b/src/plugins/data_view_editor/public/shared_imports.ts @@ -13,6 +13,7 @@ export type { IndexPatternAggRestrictions, } from '../../data/public'; export { IndexPattern, IndexPatternField } from '../../data/public'; +export { DataView } from '../../data_views/public'; export { createKibanaReactContext, diff --git a/src/plugins/index_pattern_editor/public/test_utils/helpers.ts b/src/plugins/data_view_editor/public/test_utils/helpers.ts similarity index 100% rename from src/plugins/index_pattern_editor/public/test_utils/helpers.ts rename to src/plugins/data_view_editor/public/test_utils/helpers.ts diff --git a/src/plugins/index_pattern_editor/public/test_utils/index.ts b/src/plugins/data_view_editor/public/test_utils/index.ts similarity index 100% rename from src/plugins/index_pattern_editor/public/test_utils/index.ts rename to src/plugins/data_view_editor/public/test_utils/index.ts diff --git a/src/plugins/index_pattern_editor/public/test_utils/mocks.ts b/src/plugins/data_view_editor/public/test_utils/mocks.ts similarity index 100% rename from src/plugins/index_pattern_editor/public/test_utils/mocks.ts rename to src/plugins/data_view_editor/public/test_utils/mocks.ts diff --git a/src/plugins/index_pattern_editor/public/test_utils/test_utils.ts b/src/plugins/data_view_editor/public/test_utils/test_utils.ts similarity index 100% rename from src/plugins/index_pattern_editor/public/test_utils/test_utils.ts rename to src/plugins/data_view_editor/public/test_utils/test_utils.ts diff --git a/src/plugins/index_pattern_editor/public/types.ts b/src/plugins/data_view_editor/public/types.ts similarity index 90% rename from src/plugins/index_pattern_editor/public/types.ts rename to src/plugins/data_view_editor/public/types.ts index 8cc1779a804ba..cfeee1df979d8 100644 --- a/src/plugins/index_pattern_editor/public/types.ts +++ b/src/plugins/data_view_editor/public/types.ts @@ -17,26 +17,26 @@ import { import { EuiComboBoxOptionOption } from '@elastic/eui'; -import type { IndexPattern } from 'src/plugins/data/public'; +import type { DataView, DataViewsPublicPluginStart } from 'src/plugins/data_views/public'; import { DataPublicPluginStart, IndexPatternAggRestrictions } from './shared_imports'; -export interface IndexPatternEditorContext { +export interface DataViewEditorContext { uiSettings: IUiSettingsClient; docLinks: DocLinksStart; http: HttpSetup; notifications: NotificationsStart; application: ApplicationStart; - indexPatternService: DataPublicPluginStart['indexPatterns']; + dataViews: DataViewsPublicPluginStart; searchClient: DataPublicPluginStart['search']['search']; } /** @public */ -export interface IndexPatternEditorProps { +export interface DataViewEditorProps { /** * Handler for the "save" footer button * @param indexPattern - newly created index pattern */ - onSave: (indexPattern: IndexPattern) => void; + onSave: (dataView: DataView) => void; /** * Handler for the "cancel" footer button */ @@ -55,10 +55,10 @@ export interface IndexPatternEditorProps { export interface PluginSetup {} export interface PluginStart { - openEditor(options: IndexPatternEditorProps): () => void; - IndexPatternEditorComponent: FC; + openEditor(options: DataViewEditorProps): () => void; + IndexPatternEditorComponent: FC; userPermissions: { - editIndexPattern: () => boolean; + editDataView: () => boolean; }; } @@ -67,6 +67,7 @@ export interface SetupPlugins {} export interface StartPlugins { data: DataPublicPluginStart; + dataViews: DataViewsPublicPluginStart; } export type CloseEditor = () => void; diff --git a/src/plugins/index_pattern_editor/tsconfig.json b/src/plugins/data_view_editor/tsconfig.json similarity index 91% rename from src/plugins/index_pattern_editor/tsconfig.json rename to src/plugins/data_view_editor/tsconfig.json index 559b1aaf0fc26..2b7cdc53a6a3a 100644 --- a/src/plugins/index_pattern_editor/tsconfig.json +++ b/src/plugins/data_view_editor/tsconfig.json @@ -13,6 +13,7 @@ "references": [ { "path": "../../core/tsconfig.json" }, { "path": "../data/tsconfig.json" }, + { "path": "../data_views/tsconfig.json" }, { "path": "../kibana_react/tsconfig.json" }, { "path": "../kibana_utils/tsconfig.json" }, { "path": "../es_ui_shared/tsconfig.json" }, diff --git a/src/plugins/index_pattern_field_editor/README.md b/src/plugins/data_view_field_editor/README.md similarity index 67% rename from src/plugins/index_pattern_field_editor/README.md rename to src/plugins/data_view_field_editor/README.md index f6ef06cd77b36..3e4c6fb8b77ab 100644 --- a/src/plugins/index_pattern_field_editor/README.md +++ b/src/plugins/data_view_field_editor/README.md @@ -1,25 +1,25 @@ -# Index pattern field editor +# Data view field editor The reusable field editor across Kibana! This editor can be used to -* create or edit a runtime field inside an index pattern. +* create or edit a runtime field inside a data view. * edit concrete (mapped) fields. In this case certain functionalities will be disabled like the possibility to change the field _type_ or to set the field _value_. ## How to use -You first need to add in your kibana.json the "`indexPatternFieldEditor`" plugin as a required dependency of your plugin. +You first need to add in your kibana.json the "`dataViewFieldEditor`" plugin as a required dependency of your plugin. -You will then receive in the start contract of the indexPatternFieldEditor plugin the following API: +You will then receive in the start contract of the dataViewFieldEditor plugin the following API: -### `userPermissions.editIndexPattern(): boolean` +### `userPermissions.editDataView(): boolean` -Convenience method that uses the `core.application.capabilities` api to determine whether the user can edit the index pattern. +Convenience method that uses the `core.application.capabilities` api to determine whether the user can edit the data view. ### `openEditor(options: OpenFieldEditorOptions): CloseEditor` -Use this method to open the index pattern field editor to either create (runtime) or edit (concrete | runtime) a field. +Use this method to open the data view field editor to either create (runtime) or edit (concrete | runtime) a field. #### `options` @@ -27,9 +27,9 @@ Use this method to open the index pattern field editor to either create (runtime This is the only required option. You need to provide the context in which the editor is being consumed. This object has the following properties: -- `indexPattern: IndexPattern`: the index pattern you want to create/edit the field into. +- `dataView: DataView`: the data view you want to create/edit the field into. -`onSave(field: IndexPatternField): void` (optional) +`onSave(field: DataViewField): void` (optional) You can provide an optional `onSave` handler to be notified when the field has being created/updated. This handler is called after the field has been persisted to the saved object. @@ -39,7 +39,7 @@ You can optionally pass the name of a field to edit. Leave empty to create a new ### `openDeleteModal(options: OpenFieldDeleteModalOptions): CloseEditor` -Use this method to open a confirmation modal to delete runtime fields from an index pattern. +Use this method to open a confirmation modal to delete runtime fields from a data view. #### `options` @@ -47,7 +47,7 @@ Use this method to open a confirmation modal to delete runtime fields from an in You need to provide the context in which the deletion modal is being consumed. This object has the following properties: -- `indexPattern: IndexPattern`: the index pattern you want to delete fields from. +- `dataView: DataView`: the index pattern you want to delete fields from. `onDelete(fieldNames: string[]): void` (optional) @@ -63,14 +63,14 @@ This children func React component provides a handler to delete one or multiple #### Props -* `indexPattern: IndexPattern`: the current index pattern. (**required**) +* `dataView: DataView`: the current dataView. (**required**) ```js -const { DeleteRuntimeFieldProvider } = indexPatternFieldEditor; +const { DeleteRuntimeFieldProvider } = dataViewFieldEditor; // Single field - + {(deleteField) => ( deleteField('myField')}> Delete @@ -79,7 +79,7 @@ const { DeleteRuntimeFieldProvider } = indexPatternFieldEditor; // Multiple fields - + {(deleteFields) => ( deleteFields(['field1', 'field2', 'field3'])}> Delete diff --git a/src/plugins/index_pattern_field_editor/__jest__/client_integration/field_editor.helpers.ts b/src/plugins/data_view_field_editor/__jest__/client_integration/field_editor.helpers.ts similarity index 100% rename from src/plugins/index_pattern_field_editor/__jest__/client_integration/field_editor.helpers.ts rename to src/plugins/data_view_field_editor/__jest__/client_integration/field_editor.helpers.ts diff --git a/src/plugins/index_pattern_field_editor/__jest__/client_integration/field_editor.test.tsx b/src/plugins/data_view_field_editor/__jest__/client_integration/field_editor.test.tsx similarity index 100% rename from src/plugins/index_pattern_field_editor/__jest__/client_integration/field_editor.test.tsx rename to src/plugins/data_view_field_editor/__jest__/client_integration/field_editor.test.tsx diff --git a/src/plugins/index_pattern_field_editor/__jest__/client_integration/field_editor_flyout_content.helpers.ts b/src/plugins/data_view_field_editor/__jest__/client_integration/field_editor_flyout_content.helpers.ts similarity index 100% rename from src/plugins/index_pattern_field_editor/__jest__/client_integration/field_editor_flyout_content.helpers.ts rename to src/plugins/data_view_field_editor/__jest__/client_integration/field_editor_flyout_content.helpers.ts diff --git a/src/plugins/index_pattern_field_editor/__jest__/client_integration/field_editor_flyout_content.test.ts b/src/plugins/data_view_field_editor/__jest__/client_integration/field_editor_flyout_content.test.ts similarity index 100% rename from src/plugins/index_pattern_field_editor/__jest__/client_integration/field_editor_flyout_content.test.ts rename to src/plugins/data_view_field_editor/__jest__/client_integration/field_editor_flyout_content.test.ts diff --git a/src/plugins/index_pattern_field_editor/__jest__/client_integration/field_editor_flyout_preview.helpers.ts b/src/plugins/data_view_field_editor/__jest__/client_integration/field_editor_flyout_preview.helpers.ts similarity index 100% rename from src/plugins/index_pattern_field_editor/__jest__/client_integration/field_editor_flyout_preview.helpers.ts rename to src/plugins/data_view_field_editor/__jest__/client_integration/field_editor_flyout_preview.helpers.ts diff --git a/src/plugins/index_pattern_field_editor/__jest__/client_integration/field_editor_flyout_preview.test.ts b/src/plugins/data_view_field_editor/__jest__/client_integration/field_editor_flyout_preview.test.ts similarity index 100% rename from src/plugins/index_pattern_field_editor/__jest__/client_integration/field_editor_flyout_preview.test.ts rename to src/plugins/data_view_field_editor/__jest__/client_integration/field_editor_flyout_preview.test.ts diff --git a/src/plugins/index_pattern_field_editor/__jest__/client_integration/helpers/common_actions.ts b/src/plugins/data_view_field_editor/__jest__/client_integration/helpers/common_actions.ts similarity index 100% rename from src/plugins/index_pattern_field_editor/__jest__/client_integration/helpers/common_actions.ts rename to src/plugins/data_view_field_editor/__jest__/client_integration/helpers/common_actions.ts diff --git a/src/plugins/index_pattern_field_editor/__jest__/client_integration/helpers/http_requests.ts b/src/plugins/data_view_field_editor/__jest__/client_integration/helpers/http_requests.ts similarity index 100% rename from src/plugins/index_pattern_field_editor/__jest__/client_integration/helpers/http_requests.ts rename to src/plugins/data_view_field_editor/__jest__/client_integration/helpers/http_requests.ts diff --git a/src/plugins/index_pattern_field_editor/__jest__/client_integration/helpers/index.ts b/src/plugins/data_view_field_editor/__jest__/client_integration/helpers/index.ts similarity index 100% rename from src/plugins/index_pattern_field_editor/__jest__/client_integration/helpers/index.ts rename to src/plugins/data_view_field_editor/__jest__/client_integration/helpers/index.ts diff --git a/src/plugins/index_pattern_field_editor/__jest__/client_integration/helpers/jest.mocks.tsx b/src/plugins/data_view_field_editor/__jest__/client_integration/helpers/jest.mocks.tsx similarity index 100% rename from src/plugins/index_pattern_field_editor/__jest__/client_integration/helpers/jest.mocks.tsx rename to src/plugins/data_view_field_editor/__jest__/client_integration/helpers/jest.mocks.tsx diff --git a/src/plugins/index_pattern_field_editor/__jest__/client_integration/helpers/mocks.ts b/src/plugins/data_view_field_editor/__jest__/client_integration/helpers/mocks.ts similarity index 100% rename from src/plugins/index_pattern_field_editor/__jest__/client_integration/helpers/mocks.ts rename to src/plugins/data_view_field_editor/__jest__/client_integration/helpers/mocks.ts diff --git a/src/plugins/index_pattern_field_editor/__jest__/client_integration/helpers/setup_environment.tsx b/src/plugins/data_view_field_editor/__jest__/client_integration/helpers/setup_environment.tsx similarity index 99% rename from src/plugins/index_pattern_field_editor/__jest__/client_integration/helpers/setup_environment.tsx rename to src/plugins/data_view_field_editor/__jest__/client_integration/helpers/setup_environment.tsx index b11915855aa23..577aac09a744e 100644 --- a/src/plugins/index_pattern_field_editor/__jest__/client_integration/helpers/setup_environment.tsx +++ b/src/plugins/data_view_field_editor/__jest__/client_integration/helpers/setup_environment.tsx @@ -103,7 +103,7 @@ export const WithFieldEditorDependencies = }); const dependencies: Context = { - indexPattern: { + dataView: { title: indexPatternNameForTest, fields: { getAll: spyIndexPatternGetAllFields }, } as any, diff --git a/src/plugins/index_pattern_field_editor/common/constants.ts b/src/plugins/data_view_field_editor/common/constants.ts similarity index 100% rename from src/plugins/index_pattern_field_editor/common/constants.ts rename to src/plugins/data_view_field_editor/common/constants.ts diff --git a/src/plugins/index_pattern_field_editor/jest.config.js b/src/plugins/data_view_field_editor/jest.config.js similarity index 74% rename from src/plugins/index_pattern_field_editor/jest.config.js rename to src/plugins/data_view_field_editor/jest.config.js index e1f8f57038e26..7a9329f655276 100644 --- a/src/plugins/index_pattern_field_editor/jest.config.js +++ b/src/plugins/data_view_field_editor/jest.config.js @@ -9,10 +9,10 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', - roots: ['/src/plugins/index_pattern_field_editor'], - coverageDirectory: '/target/kibana-coverage/jest/src/plugins/index_pattern_field_editor', + roots: ['/src/plugins/data_view_field_editor'], + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/data_view_field_editor', coverageReporters: ['text', 'html'], collectCoverageFrom: [ - '/src/plugins/index_pattern_field_editor/{common,public,server}/**/*.{ts,tsx}', + '/src/plugins/data_view_field_editor/{common,public,server}/**/*.{ts,tsx}', ], }; diff --git a/src/plugins/data_view_field_editor/kibana.json b/src/plugins/data_view_field_editor/kibana.json new file mode 100644 index 0000000000000..813dbc8ad5fd3 --- /dev/null +++ b/src/plugins/data_view_field_editor/kibana.json @@ -0,0 +1,14 @@ +{ + "id": "dataViewFieldEditor", + "version": "kibana", + "server": true, + "ui": true, + "requiredPlugins": ["data", "fieldFormats", "dataViews"], + "optionalPlugins": ["usageCollection"], + "requiredBundles": ["kibanaReact", "esUiShared"], + "owner": { + "name": "App Services", + "githubTeam": "kibana-app-services" + }, + "description": "Reusable data view field editor across Kibana" +} diff --git a/src/plugins/index_pattern_field_editor/public/assets/icons/LICENSE.txt b/src/plugins/data_view_field_editor/public/assets/icons/LICENSE.txt similarity index 100% rename from src/plugins/index_pattern_field_editor/public/assets/icons/LICENSE.txt rename to src/plugins/data_view_field_editor/public/assets/icons/LICENSE.txt diff --git a/src/plugins/index_pattern_field_editor/public/assets/icons/cv.png b/src/plugins/data_view_field_editor/public/assets/icons/cv.png similarity index 100% rename from src/plugins/index_pattern_field_editor/public/assets/icons/cv.png rename to src/plugins/data_view_field_editor/public/assets/icons/cv.png diff --git a/src/plugins/index_pattern_field_editor/public/assets/icons/de.png b/src/plugins/data_view_field_editor/public/assets/icons/de.png similarity index 100% rename from src/plugins/index_pattern_field_editor/public/assets/icons/de.png rename to src/plugins/data_view_field_editor/public/assets/icons/de.png diff --git a/src/plugins/index_pattern_field_editor/public/assets/icons/go.png b/src/plugins/data_view_field_editor/public/assets/icons/go.png similarity index 100% rename from src/plugins/index_pattern_field_editor/public/assets/icons/go.png rename to src/plugins/data_view_field_editor/public/assets/icons/go.png diff --git a/src/plugins/index_pattern_field_editor/public/assets/icons/ne.png b/src/plugins/data_view_field_editor/public/assets/icons/ne.png similarity index 100% rename from src/plugins/index_pattern_field_editor/public/assets/icons/ne.png rename to src/plugins/data_view_field_editor/public/assets/icons/ne.png diff --git a/src/plugins/index_pattern_field_editor/public/assets/icons/ni.png b/src/plugins/data_view_field_editor/public/assets/icons/ni.png similarity index 100% rename from src/plugins/index_pattern_field_editor/public/assets/icons/ni.png rename to src/plugins/data_view_field_editor/public/assets/icons/ni.png diff --git a/src/plugins/index_pattern_field_editor/public/assets/icons/stop.png b/src/plugins/data_view_field_editor/public/assets/icons/stop.png similarity index 100% rename from src/plugins/index_pattern_field_editor/public/assets/icons/stop.png rename to src/plugins/data_view_field_editor/public/assets/icons/stop.png diff --git a/src/plugins/index_pattern_field_editor/public/assets/icons/us.png b/src/plugins/data_view_field_editor/public/assets/icons/us.png similarity index 100% rename from src/plugins/index_pattern_field_editor/public/assets/icons/us.png rename to src/plugins/data_view_field_editor/public/assets/icons/us.png diff --git a/src/plugins/index_pattern_field_editor/public/components/confirm_modals/delete_field_modal.tsx b/src/plugins/data_view_field_editor/public/components/confirm_modals/delete_field_modal.tsx similarity index 100% rename from src/plugins/index_pattern_field_editor/public/components/confirm_modals/delete_field_modal.tsx rename to src/plugins/data_view_field_editor/public/components/confirm_modals/delete_field_modal.tsx diff --git a/src/plugins/index_pattern_field_editor/public/components/confirm_modals/index.ts b/src/plugins/data_view_field_editor/public/components/confirm_modals/index.ts similarity index 100% rename from src/plugins/index_pattern_field_editor/public/components/confirm_modals/index.ts rename to src/plugins/data_view_field_editor/public/components/confirm_modals/index.ts diff --git a/src/plugins/index_pattern_field_editor/public/components/confirm_modals/modified_field_modal.tsx b/src/plugins/data_view_field_editor/public/components/confirm_modals/modified_field_modal.tsx similarity index 100% rename from src/plugins/index_pattern_field_editor/public/components/confirm_modals/modified_field_modal.tsx rename to src/plugins/data_view_field_editor/public/components/confirm_modals/modified_field_modal.tsx diff --git a/src/plugins/index_pattern_field_editor/public/components/confirm_modals/save_field_type_or_name_changed_modal.tsx b/src/plugins/data_view_field_editor/public/components/confirm_modals/save_field_type_or_name_changed_modal.tsx similarity index 100% rename from src/plugins/index_pattern_field_editor/public/components/confirm_modals/save_field_type_or_name_changed_modal.tsx rename to src/plugins/data_view_field_editor/public/components/confirm_modals/save_field_type_or_name_changed_modal.tsx diff --git a/src/plugins/index_pattern_field_editor/public/components/delete_field_provider.tsx b/src/plugins/data_view_field_editor/public/components/delete_field_provider.tsx similarity index 87% rename from src/plugins/index_pattern_field_editor/public/components/delete_field_provider.tsx rename to src/plugins/data_view_field_editor/public/components/delete_field_provider.tsx index 4ec766fe1c851..9a960674e061e 100644 --- a/src/plugins/index_pattern_field_editor/public/components/delete_field_provider.tsx +++ b/src/plugins/data_view_field_editor/public/components/delete_field_provider.tsx @@ -8,21 +8,21 @@ import React, { useCallback, useRef, useEffect } from 'react'; -import { IndexPattern } from '../shared_imports'; +import { DataView } from '../shared_imports'; import { OpenFieldDeleteModalOptions } from '../open_delete_modal'; import { CloseEditor } from '../types'; type DeleteFieldFunc = (fieldName: string | string[]) => void; export interface Props { children: (deleteFieldHandler: DeleteFieldFunc) => React.ReactNode; - indexPattern: IndexPattern; + dataView: DataView; onDelete?: (fieldNames: string[]) => void; } export const getDeleteFieldProvider = ( modalOpener: (options: OpenFieldDeleteModalOptions) => CloseEditor ): React.FunctionComponent => { - return React.memo(({ indexPattern, children, onDelete }: Props) => { + return React.memo(({ dataView, children, onDelete }: Props) => { const closeModal = useRef(null); const deleteFields = useCallback( async (fieldName: string | string[]) => { @@ -31,13 +31,13 @@ export const getDeleteFieldProvider = ( } closeModal.current = modalOpener({ ctx: { - indexPattern, + dataView, }, fieldName, onDelete, }); }, - [onDelete, indexPattern] + [onDelete, dataView] ); useEffect(() => { diff --git a/src/plugins/index_pattern_field_editor/public/components/field_editor/advanced_parameters_section.tsx b/src/plugins/data_view_field_editor/public/components/field_editor/advanced_parameters_section.tsx similarity index 100% rename from src/plugins/index_pattern_field_editor/public/components/field_editor/advanced_parameters_section.tsx rename to src/plugins/data_view_field_editor/public/components/field_editor/advanced_parameters_section.tsx diff --git a/src/plugins/index_pattern_field_editor/public/components/field_editor/constants.ts b/src/plugins/data_view_field_editor/public/components/field_editor/constants.ts similarity index 100% rename from src/plugins/index_pattern_field_editor/public/components/field_editor/constants.ts rename to src/plugins/data_view_field_editor/public/components/field_editor/constants.ts diff --git a/src/plugins/index_pattern_field_editor/public/components/field_editor/field_editor.tsx b/src/plugins/data_view_field_editor/public/components/field_editor/field_editor.tsx similarity index 99% rename from src/plugins/index_pattern_field_editor/public/components/field_editor/field_editor.tsx rename to src/plugins/data_view_field_editor/public/components/field_editor/field_editor.tsx index ddc3aa72c7610..0185e1ba1c3f9 100644 --- a/src/plugins/index_pattern_field_editor/public/components/field_editor/field_editor.tsx +++ b/src/plugins/data_view_field_editor/public/components/field_editor/field_editor.tsx @@ -8,7 +8,7 @@ import React, { useEffect } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { get } from 'lodash'; import { EuiFlexGroup, diff --git a/src/plugins/index_pattern_field_editor/public/components/field_editor/form_fields/custom_label_field.tsx b/src/plugins/data_view_field_editor/public/components/field_editor/form_fields/custom_label_field.tsx similarity index 100% rename from src/plugins/index_pattern_field_editor/public/components/field_editor/form_fields/custom_label_field.tsx rename to src/plugins/data_view_field_editor/public/components/field_editor/form_fields/custom_label_field.tsx diff --git a/src/plugins/index_pattern_field_editor/public/components/field_editor/form_fields/format_field.tsx b/src/plugins/data_view_field_editor/public/components/field_editor/form_fields/format_field.tsx similarity index 94% rename from src/plugins/index_pattern_field_editor/public/components/field_editor/form_fields/format_field.tsx rename to src/plugins/data_view_field_editor/public/components/field_editor/form_fields/format_field.tsx index 2ff4a48477def..c584a59eda8d1 100644 --- a/src/plugins/index_pattern_field_editor/public/components/field_editor/form_fields/format_field.tsx +++ b/src/plugins/data_view_field_editor/public/components/field_editor/form_fields/format_field.tsx @@ -15,7 +15,7 @@ import type { FieldFormInternal } from '../field_editor'; import type { FieldFormatConfig } from '../../../types'; export const FormatField = () => { - const { indexPattern, uiSettings, fieldFormats, fieldFormatEditors } = useFieldEditorContext(); + const { dataView, uiSettings, fieldFormats, fieldFormatEditors } = useFieldEditorContext(); const isMounted = useRef(false); const [{ type }] = useFormData({ watch: ['name', 'type'] }); const { getFields, isSubmitted } = useFormContext(); @@ -62,7 +62,7 @@ export const FormatField = () => { (undefined); export const FieldEditorProvider: FunctionComponent = ({ services, - indexPattern, + dataView, links, uiSettings, fieldTypeToProcess, @@ -57,7 +57,7 @@ export const FieldEditorProvider: FunctionComponent = ({ }) => { const ctx = useMemo( () => ({ - indexPattern, + dataView, fieldTypeToProcess, links, uiSettings, @@ -68,7 +68,7 @@ export const FieldEditorProvider: FunctionComponent = ({ existingConcreteFields, }), [ - indexPattern, + dataView, fieldTypeToProcess, services, links, diff --git a/src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content.tsx b/src/plugins/data_view_field_editor/public/components/field_editor_flyout_content.tsx similarity index 98% rename from src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content.tsx rename to src/plugins/data_view_field_editor/public/components/field_editor_flyout_content.tsx index d1dbb50ebf2e4..5d14f3a7be4cb 100644 --- a/src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content.tsx +++ b/src/plugins/data_view_field_editor/public/components/field_editor_flyout_content.tsx @@ -8,7 +8,7 @@ import React, { useState, useCallback, useEffect, useRef } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiTitle, EuiFlexGroup, @@ -67,7 +67,7 @@ const FieldEditorFlyoutContentComponent = ({ }: Props) => { const isMounted = useRef(false); const isEditingExistingField = !!field; - const { indexPattern } = useFieldEditorContext(); + const { dataView } = useFieldEditorContext(); const { panel: { isVisible: isPanelVisible }, } = useFieldPreviewContext(); @@ -218,7 +218,7 @@ const FieldEditorFlyoutContentComponent = ({ id="indexPatternFieldEditor.editor.flyoutEditFieldSubtitle" defaultMessage="Data view: {patternName}" values={{ - patternName: {indexPattern.title}, + patternName: {dataView.title}, }} />

diff --git a/src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx b/src/plugins/data_view_field_editor/public/components/field_editor_flyout_content_container.tsx similarity index 83% rename from src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx rename to src/plugins/data_view_field_editor/public/components/field_editor_flyout_content_container.tsx index 1738c55ba1f55..5b431424c1b44 100644 --- a/src/plugins/index_pattern_field_editor/public/components/field_editor_flyout_content_container.tsx +++ b/src/plugins/data_view_field_editor/public/components/field_editor_flyout_content_container.tsx @@ -12,11 +12,12 @@ import { i18n } from '@kbn/i18n'; import { METRIC_TYPE } from '@kbn/analytics'; import { - IndexPatternField, - IndexPattern, + DataViewField, + DataView, DataPublicPluginStart, RuntimeType, UsageCollectionStart, + DataViewsPublicPluginStart, } from '../shared_imports'; import type { Field, PluginStart, InternalFieldType } from '../types'; import { pluginName } from '../constants'; @@ -30,20 +31,20 @@ import { FieldPreviewProvider } from './preview'; export interface Props { /** Handler for the "save" footer button */ - onSave: (field: IndexPatternField) => void; + onSave: (field: DataViewField) => void; /** Handler for the "cancel" footer button */ onCancel: () => void; onMounted?: FieldEditorFlyoutContentProps['onMounted']; /** The docLinks start service from core */ docLinks: DocLinksStart; /** The index pattern where the field will be added */ - indexPattern: IndexPattern; + dataView: DataView; /** The Kibana field type of the field to create or edit (default: "runtime") */ fieldTypeToProcess: InternalFieldType; /** Optional field to edit */ - field?: IndexPatternField; + field?: DataViewField; /** Services */ - indexPatternService: DataPublicPluginStart['indexPatterns']; + dataViews: DataViewsPublicPluginStart; notifications: NotificationsStart; search: DataPublicPluginStart['search']; usageCollection: UsageCollectionStart; @@ -68,8 +69,8 @@ export const FieldEditorFlyoutContentContainer = ({ onMounted, docLinks, fieldTypeToProcess, - indexPattern, - indexPatternService, + dataView, + dataViews, search, notifications, usageCollection, @@ -78,10 +79,10 @@ export const FieldEditorFlyoutContentContainer = ({ fieldFormats, uiSettings, }: Props) => { - const fieldToEdit = deserializeField(indexPattern, field); + const fieldToEdit = deserializeField(dataView, field); const [isSaving, setIsSaving] = useState(false); - const { fields } = indexPattern; + const { fields } = dataView; const namesNotAllowed = useMemo(() => fields.map((fld) => fld.name), [fields]); @@ -125,10 +126,10 @@ export const FieldEditorFlyoutContentContainer = ({ } catch {} // rename an existing runtime field if (field?.name && field.name !== updatedField.name) { - indexPattern.removeRuntimeField(field.name); + dataView.removeRuntimeField(field.name); } - indexPattern.addRuntimeField(updatedField.name, { + dataView.addRuntimeField(updatedField.name, { type: updatedField.type as RuntimeType, script, }); @@ -139,24 +140,24 @@ export const FieldEditorFlyoutContentContainer = ({ } catch {} } - const editedField = indexPattern.getFieldByName(updatedField.name); + const editedField = dataView.getFieldByName(updatedField.name); try { if (!editedField) { throw new Error( - `Unable to find field named '${updatedField.name}' on index pattern '${indexPattern.title}'` + `Unable to find field named '${updatedField.name}' on index pattern '${dataView.title}'` ); } - indexPattern.setFieldCustomLabel(updatedField.name, updatedField.customLabel); + dataView.setFieldCustomLabel(updatedField.name, updatedField.customLabel); editedField.count = updatedField.popularity || 0; if (updatedField.format) { - indexPattern.setFieldFormat(updatedField.name, updatedField.format); + dataView.setFieldFormat(updatedField.name, updatedField.format); } else { - indexPattern.deleteFieldFormat(updatedField.name); + dataView.deleteFieldFormat(updatedField.name); } - await indexPatternService.updateSavedObject(indexPattern).then(() => { + await dataViews.updateSavedObject(dataView).then(() => { const message = i18n.translate('indexPatternFieldEditor.deleteField.savedHeader', { defaultMessage: "Saved '{fieldName}'", values: { fieldName: updatedField.name }, @@ -173,20 +174,12 @@ export const FieldEditorFlyoutContentContainer = ({ setIsSaving(false); } }, - [ - onSave, - indexPattern, - indexPatternService, - notifications, - fieldTypeToProcess, - field?.name, - usageCollection, - ] + [onSave, dataView, dataViews, notifications, fieldTypeToProcess, field?.name, usageCollection] ); return ( = ({ height, clearSearch, searchValue = '' }) => { - const { indexPattern } = useFieldEditorContext(); + const { dataView } = useFieldEditorContext(); const { currentDocument: { value: currentDocument }, pinnedFields: { value: pinnedFields, set: setPinnedFields }, @@ -57,7 +57,7 @@ export const PreviewFieldList: React.FC = ({ height, clearSearch, searchV const { fields: { getAll: getAllFields }, - } = indexPattern; + } = dataView; const indexPatternFields = useMemo(() => { return getAllFields(); diff --git a/src/plugins/index_pattern_field_editor/public/components/preview/field_list/field_list_item.tsx b/src/plugins/data_view_field_editor/public/components/preview/field_list/field_list_item.tsx similarity index 100% rename from src/plugins/index_pattern_field_editor/public/components/preview/field_list/field_list_item.tsx rename to src/plugins/data_view_field_editor/public/components/preview/field_list/field_list_item.tsx diff --git a/src/plugins/index_pattern_field_editor/public/components/preview/field_preview.scss b/src/plugins/data_view_field_editor/public/components/preview/field_preview.scss similarity index 100% rename from src/plugins/index_pattern_field_editor/public/components/preview/field_preview.scss rename to src/plugins/data_view_field_editor/public/components/preview/field_preview.scss diff --git a/src/plugins/index_pattern_field_editor/public/components/preview/field_preview.tsx b/src/plugins/data_view_field_editor/public/components/preview/field_preview.tsx similarity index 100% rename from src/plugins/index_pattern_field_editor/public/components/preview/field_preview.tsx rename to src/plugins/data_view_field_editor/public/components/preview/field_preview.tsx diff --git a/src/plugins/index_pattern_field_editor/public/components/preview/field_preview_context.tsx b/src/plugins/data_view_field_editor/public/components/preview/field_preview_context.tsx similarity index 99% rename from src/plugins/index_pattern_field_editor/public/components/preview/field_preview_context.tsx rename to src/plugins/data_view_field_editor/public/components/preview/field_preview_context.tsx index 74f77f91e2f13..f560cee59372f 100644 --- a/src/plugins/index_pattern_field_editor/public/components/preview/field_preview_context.tsx +++ b/src/plugins/data_view_field_editor/public/components/preview/field_preview_context.tsx @@ -63,7 +63,7 @@ export const FieldPreviewProvider: FunctionComponent = ({ children }) => { }); const { - indexPattern, + dataView, fieldTypeToProcess, services: { search, @@ -188,7 +188,7 @@ export const FieldPreviewProvider: FunctionComponent = ({ children }) => { const [response, searchError] = await search .search({ params: { - index: indexPattern.title, + index: dataView.title, body: { size: limit, }, @@ -225,7 +225,7 @@ export const FieldPreviewProvider: FunctionComponent = ({ children }) => { }); } }, - [indexPattern, search] + [dataView, search] ); const loadDocument = useCallback( @@ -240,7 +240,7 @@ export const FieldPreviewProvider: FunctionComponent = ({ children }) => { const [response, searchError] = await search .search({ params: { - index: indexPattern.title, + index: dataView.title, body: { size: 1, query: { @@ -299,7 +299,7 @@ export const FieldPreviewProvider: FunctionComponent = ({ children }) => { setIsLoadingPreview(false); } }, - [indexPattern, search] + [dataView, search] ); const updatePreview = useCallback(async () => { diff --git a/src/plugins/index_pattern_field_editor/public/components/preview/field_preview_empty_prompt.tsx b/src/plugins/data_view_field_editor/public/components/preview/field_preview_empty_prompt.tsx similarity index 100% rename from src/plugins/index_pattern_field_editor/public/components/preview/field_preview_empty_prompt.tsx rename to src/plugins/data_view_field_editor/public/components/preview/field_preview_empty_prompt.tsx diff --git a/src/plugins/index_pattern_field_editor/public/components/preview/field_preview_error.tsx b/src/plugins/data_view_field_editor/public/components/preview/field_preview_error.tsx similarity index 100% rename from src/plugins/index_pattern_field_editor/public/components/preview/field_preview_error.tsx rename to src/plugins/data_view_field_editor/public/components/preview/field_preview_error.tsx diff --git a/src/plugins/index_pattern_field_editor/public/components/preview/field_preview_header.tsx b/src/plugins/data_view_field_editor/public/components/preview/field_preview_header.tsx similarity index 92% rename from src/plugins/index_pattern_field_editor/public/components/preview/field_preview_header.tsx rename to src/plugins/data_view_field_editor/public/components/preview/field_preview_header.tsx index 28b75a43b7d11..6d327a7e0cdd8 100644 --- a/src/plugins/index_pattern_field_editor/public/components/preview/field_preview_header.tsx +++ b/src/plugins/data_view_field_editor/public/components/preview/field_preview_header.tsx @@ -24,7 +24,7 @@ const i18nTexts = { }; export const FieldPreviewHeader = () => { - const { indexPattern } = useFieldEditorContext(); + const { dataView } = useFieldEditorContext(); const { from, currentDocument: { isLoading: isFetchingDocument }, @@ -49,7 +49,7 @@ export const FieldPreviewHeader = () => { {i18n.translate('indexPatternFieldEditor.fieldPreview.subTitle', { defaultMessage: 'From: {from}', values: { - from: from.value === 'cluster' ? indexPattern.title : i18nTexts.customData, + from: from.value === 'cluster' ? dataView.title : i18nTexts.customData, }, })} diff --git a/src/plugins/index_pattern_field_editor/public/components/preview/image_preview_modal.tsx b/src/plugins/data_view_field_editor/public/components/preview/image_preview_modal.tsx similarity index 100% rename from src/plugins/index_pattern_field_editor/public/components/preview/image_preview_modal.tsx rename to src/plugins/data_view_field_editor/public/components/preview/image_preview_modal.tsx diff --git a/src/plugins/index_pattern_field_editor/public/components/preview/index.ts b/src/plugins/data_view_field_editor/public/components/preview/index.ts similarity index 100% rename from src/plugins/index_pattern_field_editor/public/components/preview/index.ts rename to src/plugins/data_view_field_editor/public/components/preview/index.ts diff --git a/src/plugins/index_pattern_field_editor/public/components/preview/is_updating_indicator.tsx b/src/plugins/data_view_field_editor/public/components/preview/is_updating_indicator.tsx similarity index 100% rename from src/plugins/index_pattern_field_editor/public/components/preview/is_updating_indicator.tsx rename to src/plugins/data_view_field_editor/public/components/preview/is_updating_indicator.tsx diff --git a/src/plugins/index_pattern_field_editor/public/components/preview/types.ts b/src/plugins/data_view_field_editor/public/components/preview/types.ts similarity index 100% rename from src/plugins/index_pattern_field_editor/public/components/preview/types.ts rename to src/plugins/data_view_field_editor/public/components/preview/types.ts diff --git a/src/plugins/index_pattern_field_editor/public/constants.ts b/src/plugins/data_view_field_editor/public/constants.ts similarity index 100% rename from src/plugins/index_pattern_field_editor/public/constants.ts rename to src/plugins/data_view_field_editor/public/constants.ts diff --git a/src/plugins/index_pattern_field_editor/public/index.ts b/src/plugins/data_view_field_editor/public/index.ts similarity index 100% rename from src/plugins/index_pattern_field_editor/public/index.ts rename to src/plugins/data_view_field_editor/public/index.ts diff --git a/src/plugins/index_pattern_field_editor/public/lib/api.ts b/src/plugins/data_view_field_editor/public/lib/api.ts similarity index 100% rename from src/plugins/index_pattern_field_editor/public/lib/api.ts rename to src/plugins/data_view_field_editor/public/lib/api.ts diff --git a/src/plugins/index_pattern_field_editor/public/lib/documentation.ts b/src/plugins/data_view_field_editor/public/lib/documentation.ts similarity index 100% rename from src/plugins/index_pattern_field_editor/public/lib/documentation.ts rename to src/plugins/data_view_field_editor/public/lib/documentation.ts diff --git a/src/plugins/index_pattern_field_editor/public/lib/index.ts b/src/plugins/data_view_field_editor/public/lib/index.ts similarity index 100% rename from src/plugins/index_pattern_field_editor/public/lib/index.ts rename to src/plugins/data_view_field_editor/public/lib/index.ts diff --git a/src/plugins/index_pattern_field_editor/public/lib/remove_fields.ts b/src/plugins/data_view_field_editor/public/lib/remove_fields.ts similarity index 76% rename from src/plugins/index_pattern_field_editor/public/lib/remove_fields.ts rename to src/plugins/data_view_field_editor/public/lib/remove_fields.ts index bc9457424099f..abae8de69dcb6 100644 --- a/src/plugins/index_pattern_field_editor/public/lib/remove_fields.ts +++ b/src/plugins/data_view_field_editor/public/lib/remove_fields.ts @@ -9,21 +9,21 @@ import { i18n } from '@kbn/i18n'; import { METRIC_TYPE } from '@kbn/analytics'; import { NotificationsStart } from 'src/core/public'; -import { IndexPattern, UsageCollectionStart } from '../shared_imports'; +import { DataView, UsageCollectionStart } from '../shared_imports'; import { pluginName } from '../constants'; -import { DataPublicPluginStart } from '../../../data/public'; +import { DataViewsPublicPluginStart } from '../../../data_views/public'; export async function removeFields( fieldNames: string[], - indexPattern: IndexPattern, + dataView: DataView, services: { - indexPatternService: DataPublicPluginStart['indexPatterns']; + dataViews: DataViewsPublicPluginStart; usageCollection: UsageCollectionStart; notifications: NotificationsStart; } ) { fieldNames.forEach((fieldName) => { - indexPattern.removeRuntimeField(fieldName); + dataView.removeRuntimeField(fieldName); }); try { @@ -32,7 +32,7 @@ export async function removeFields( } catch {} try { - await services.indexPatternService.updateSavedObject(indexPattern); + await services.dataViews.updateSavedObject(dataView); } catch (e) { const title = i18n.translate('indexPatternFieldEditor.save.deleteErrorTitle', { defaultMessage: 'Failed to save field removal', diff --git a/src/plugins/index_pattern_field_editor/public/lib/runtime_field_validation.ts b/src/plugins/data_view_field_editor/public/lib/runtime_field_validation.ts similarity index 100% rename from src/plugins/index_pattern_field_editor/public/lib/runtime_field_validation.ts rename to src/plugins/data_view_field_editor/public/lib/runtime_field_validation.ts diff --git a/src/plugins/index_pattern_field_editor/public/lib/serialization.ts b/src/plugins/data_view_field_editor/public/lib/serialization.ts similarity index 83% rename from src/plugins/index_pattern_field_editor/public/lib/serialization.ts rename to src/plugins/data_view_field_editor/public/lib/serialization.ts index 0f042cdac114f..833fe331203c2 100644 --- a/src/plugins/index_pattern_field_editor/public/lib/serialization.ts +++ b/src/plugins/data_view_field_editor/public/lib/serialization.ts @@ -6,13 +6,10 @@ * Side Public License, v 1. */ import { monaco } from '@kbn/monaco'; -import { IndexPatternField, IndexPattern } from '../shared_imports'; +import { DataViewField, DataView } from '../shared_imports'; import type { Field, RuntimeFieldPainlessError } from '../types'; -export const deserializeField = ( - indexPattern: IndexPattern, - field?: IndexPatternField -): Field | undefined => { +export const deserializeField = (dataView: DataView, field?: DataViewField): Field | undefined => { if (field === undefined) { return undefined; } @@ -23,7 +20,7 @@ export const deserializeField = ( script: field.runtimeField ? field.runtimeField.script : undefined, customLabel: field.customLabel, popularity: field.count, - format: indexPattern.getFormatterForFieldNoDefault(field.name)?.toJSON(), + format: dataView.getFormatterForFieldNoDefault(field.name)?.toJSON(), }; }; diff --git a/src/plugins/index_pattern_field_editor/public/mocks.ts b/src/plugins/data_view_field_editor/public/mocks.ts similarity index 100% rename from src/plugins/index_pattern_field_editor/public/mocks.ts rename to src/plugins/data_view_field_editor/public/mocks.ts diff --git a/src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx b/src/plugins/data_view_field_editor/public/open_delete_modal.tsx similarity index 86% rename from src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx rename to src/plugins/data_view_field_editor/public/open_delete_modal.tsx index 19ed7010ca3e7..84e3885ddb605 100644 --- a/src/plugins/index_pattern_field_editor/public/open_delete_modal.tsx +++ b/src/plugins/data_view_field_editor/public/open_delete_modal.tsx @@ -11,8 +11,8 @@ import { CoreStart, OverlayRef } from 'src/core/public'; import { toMountPoint, - DataPublicPluginStart, - IndexPattern, + DataViewsPublicPluginStart, + DataView, UsageCollectionStart, } from './shared_imports'; @@ -23,7 +23,7 @@ import { removeFields } from './lib/remove_fields'; export interface OpenFieldDeleteModalOptions { ctx: { - indexPattern: IndexPattern; + dataView: DataView; }; onDelete?: (fieldNames: string[]) => void; fieldName: string | string[]; @@ -31,12 +31,12 @@ export interface OpenFieldDeleteModalOptions { interface Dependencies { core: CoreStart; - indexPatternService: DataPublicPluginStart['indexPatterns']; + dataViews: DataViewsPublicPluginStart; usageCollection: UsageCollectionStart; } export const getFieldDeleteModalOpener = - ({ core, indexPatternService, usageCollection }: Dependencies) => + ({ core, dataViews, usageCollection }: Dependencies) => (options: OpenFieldDeleteModalOptions): CloseEditor => { const { overlays, notifications } = core; @@ -45,7 +45,7 @@ export const getFieldDeleteModalOpener = const openDeleteModal = ({ onDelete, fieldName, - ctx: { indexPattern }, + ctx: { dataView }, }: OpenFieldDeleteModalOptions): CloseEditor => { const fieldsToDelete = Array.isArray(fieldName) ? fieldName : [fieldName]; const closeModal = () => { @@ -58,8 +58,8 @@ export const getFieldDeleteModalOpener = const onConfirmDelete = async () => { closeModal(); - await removeFields(fieldsToDelete, indexPattern, { - indexPatternService, + await removeFields(fieldsToDelete, dataView, { + dataViews, usageCollection, notifications, }); diff --git a/src/plugins/index_pattern_field_editor/public/open_editor.tsx b/src/plugins/data_view_field_editor/public/open_editor.tsx similarity index 89% rename from src/plugins/index_pattern_field_editor/public/open_editor.tsx rename to src/plugins/data_view_field_editor/public/open_editor.tsx index 0109b8d95db52..277d7f5c549ae 100644 --- a/src/plugins/index_pattern_field_editor/public/open_editor.tsx +++ b/src/plugins/data_view_field_editor/public/open_editor.tsx @@ -13,10 +13,12 @@ import { i18n } from '@kbn/i18n'; import { createKibanaReactContext, toMountPoint, - IndexPatternField, + DataViewField, DataPublicPluginStart, - IndexPattern, + DataView, UsageCollectionStart, + DataViewsPublicPluginStart, + FieldFormatsStart, } from './shared_imports'; import type { PluginStart, InternalFieldType, CloseEditor } from './types'; @@ -26,9 +28,9 @@ import { FieldEditorLoader } from './components/field_editor_loader'; export interface OpenFieldEditorOptions { ctx: { - indexPattern: IndexPattern; + dataView: DataView; }; - onSave?: (field: IndexPatternField) => void; + onSave?: (field: DataViewField) => void; fieldName?: string; } @@ -36,9 +38,9 @@ interface Dependencies { core: CoreStart; /** The search service from the data plugin */ search: DataPublicPluginStart['search']; - indexPatternService: DataPublicPluginStart['indexPatterns']; + dataViews: DataViewsPublicPluginStart; apiService: ApiService; - fieldFormats: DataPublicPluginStart['fieldFormats']; + fieldFormats: FieldFormatsStart; fieldFormatEditors: PluginStart['fieldFormatEditors']; usageCollection: UsageCollectionStart; } @@ -46,7 +48,7 @@ interface Dependencies { export const getFieldEditorOpener = ({ core, - indexPatternService, + dataViews, fieldFormats, fieldFormatEditors, search, @@ -73,7 +75,7 @@ export const getFieldEditorOpener = const openEditor = ({ onSave, fieldName, - ctx: { indexPattern }, + ctx: { dataView }, }: OpenFieldEditorOptions): CloseEditor => { const closeEditor = () => { if (overlayRef) { @@ -82,7 +84,7 @@ export const getFieldEditorOpener = } }; - const onSaveField = (updatedField: IndexPatternField) => { + const onSaveField = (updatedField: DataViewField) => { closeEditor(); if (onSave) { @@ -90,7 +92,7 @@ export const getFieldEditorOpener = } }; - const field = fieldName ? indexPattern.getFieldByName(fieldName) : undefined; + const field = fieldName ? dataView.getFieldByName(fieldName) : undefined; if (fieldName && !field) { const err = i18n.translate('indexPatternFieldEditor.noSuchFieldName', { @@ -116,9 +118,9 @@ export const getFieldEditorOpener = docLinks={docLinks} field={field} fieldTypeToProcess={fieldTypeToProcess} - indexPattern={indexPattern} + dataView={dataView} search={search} - indexPatternService={indexPatternService} + dataViews={dataViews} notifications={notifications} usageCollection={usageCollection} apiService={apiService} diff --git a/src/plugins/index_pattern_field_editor/public/plugin.test.tsx b/src/plugins/data_view_field_editor/public/plugin.test.tsx similarity index 88% rename from src/plugins/index_pattern_field_editor/public/plugin.test.tsx rename to src/plugins/data_view_field_editor/public/plugin.test.tsx index de7a88b4c6d2a..4f609965171b5 100644 --- a/src/plugins/index_pattern_field_editor/public/plugin.test.tsx +++ b/src/plugins/data_view_field_editor/public/plugin.test.tsx @@ -25,15 +25,17 @@ import { usageCollectionPluginMock } from '../../usage_collection/public/mocks'; import { FieldEditorLoader } from './components/field_editor_loader'; import { IndexPatternFieldEditorPlugin } from './plugin'; import { DeleteFieldModal } from './components/confirm_modals/delete_field_modal'; -import { IndexPattern } from './shared_imports'; +import { DataView } from './shared_imports'; const noop = () => {}; -describe('IndexPatternFieldEditorPlugin', () => { +describe('DataViewFieldEditorPlugin', () => { const coreStart: CoreStart = coreMock.createStart(); const pluginStart = { data: dataPluginMock.createStartContract(), usageCollection: usageCollectionPluginMock.createSetupContract(), + dataViews: dataPluginMock.createStartContract().dataViews, + fieldFormats: dataPluginMock.createStartContract().fieldFormats, }; let plugin: IndexPatternFieldEditorPlugin; @@ -60,7 +62,7 @@ describe('IndexPatternFieldEditorPlugin', () => { }; const { openEditor } = await plugin.start(coreStartMocked, pluginStart); - openEditor({ onSave: onSaveSpy, ctx: { indexPattern: {} as any } }); + openEditor({ onSave: onSaveSpy, ctx: { dataView: {} as any } }); expect(openFlyout).toHaveBeenCalled(); @@ -79,7 +81,7 @@ describe('IndexPatternFieldEditorPlugin', () => { test('should return a handler to close the flyout', async () => { const { openEditor } = await plugin.start(coreStart, pluginStart); - const closeEditorHandler = openEditor({ onSave: noop, ctx: { indexPattern: {} as any } }); + const closeEditorHandler = openEditor({ onSave: noop, ctx: { dataView: {} as any } }); expect(typeof closeEditorHandler).toBe('function'); }); @@ -102,21 +104,19 @@ describe('IndexPatternFieldEditorPlugin', () => { }; const pluginStartMocked = { ...pluginStart, - data: { - ...pluginStart.data, - indexPatterns: { - ...pluginStart.data.indexPatterns, - updateSavedObject: jest.fn(), - }, + data: pluginStart.data, + dataViews: { + ...pluginStart.data.indexPatterns, + updateSavedObject: jest.fn(), }, }; const { openDeleteModal } = await plugin.start(coreStartMocked, pluginStartMocked); - const indexPatternMock = { removeRuntimeField: removeFieldSpy } as unknown as IndexPattern; + const indexPatternMock = { removeRuntimeField: removeFieldSpy } as unknown as DataView; openDeleteModal({ onDelete: onDeleteSpy, - ctx: { indexPattern: indexPatternMock }, + ctx: { dataView: indexPatternMock }, fieldName: ['a', 'b', 'c'], }); @@ -135,7 +135,7 @@ describe('IndexPatternFieldEditorPlugin', () => { expect(removeFieldSpy).toHaveBeenCalledWith('a'); expect(removeFieldSpy).toHaveBeenCalledWith('b'); expect(removeFieldSpy).toHaveBeenCalledWith('c'); - expect(pluginStartMocked.data.indexPatterns.updateSavedObject).toHaveBeenLastCalledWith( + expect(pluginStartMocked.dataViews.updateSavedObject).toHaveBeenLastCalledWith( indexPatternMock ); }); @@ -143,7 +143,7 @@ describe('IndexPatternFieldEditorPlugin', () => { test('should return a handler to close the modal', async () => { const { openDeleteModal } = await plugin.start(coreStart, pluginStart); - const closeModal = openDeleteModal({ fieldName: ['a'], ctx: { indexPattern: {} as any } }); + const closeModal = openDeleteModal({ fieldName: ['a'], ctx: { dataView: {} as any } }); expect(typeof closeModal).toBe('function'); }); @@ -152,7 +152,7 @@ describe('IndexPatternFieldEditorPlugin', () => { const TestComponent = ({ callback }: { callback: (...args: any[]) => void }) => { return ( - + {(...args) => { // Forward arguments passed down to children to our spy callback callback(args); diff --git a/src/plugins/index_pattern_field_editor/public/plugin.ts b/src/plugins/data_view_field_editor/public/plugin.ts similarity index 91% rename from src/plugins/index_pattern_field_editor/public/plugin.ts rename to src/plugins/data_view_field_editor/public/plugin.ts index c6d4aab1a95bf..c0f09cdace9ba 100644 --- a/src/plugins/index_pattern_field_editor/public/plugin.ts +++ b/src/plugins/data_view_field_editor/public/plugin.ts @@ -34,19 +34,19 @@ export class IndexPatternFieldEditorPlugin application: { capabilities }, http, } = core; - const { data, usageCollection } = plugins; + const { data, usageCollection, dataViews, fieldFormats } = plugins; const openDeleteModal = getFieldDeleteModalOpener({ core, - indexPatternService: data.indexPatterns, + dataViews, usageCollection, }); return { fieldFormatEditors, openEditor: getFieldEditorOpener({ core, - indexPatternService: data.indexPatterns, + dataViews, apiService: initApi(http), - fieldFormats: data.fieldFormats, + fieldFormats, fieldFormatEditors, search: data.search, usageCollection, diff --git a/src/plugins/index_pattern_field_editor/public/service/field_format_editors/field_format_editors.ts b/src/plugins/data_view_field_editor/public/service/field_format_editors/field_format_editors.ts similarity index 100% rename from src/plugins/index_pattern_field_editor/public/service/field_format_editors/field_format_editors.ts rename to src/plugins/data_view_field_editor/public/service/field_format_editors/field_format_editors.ts diff --git a/src/plugins/index_pattern_field_editor/public/service/field_format_editors/index.ts b/src/plugins/data_view_field_editor/public/service/field_format_editors/index.ts similarity index 100% rename from src/plugins/index_pattern_field_editor/public/service/field_format_editors/index.ts rename to src/plugins/data_view_field_editor/public/service/field_format_editors/index.ts diff --git a/src/plugins/index_pattern_field_editor/public/service/format_editor_service.ts b/src/plugins/data_view_field_editor/public/service/format_editor_service.ts similarity index 100% rename from src/plugins/index_pattern_field_editor/public/service/format_editor_service.ts rename to src/plugins/data_view_field_editor/public/service/format_editor_service.ts diff --git a/src/plugins/index_pattern_field_editor/public/service/index.ts b/src/plugins/data_view_field_editor/public/service/index.ts similarity index 100% rename from src/plugins/index_pattern_field_editor/public/service/index.ts rename to src/plugins/data_view_field_editor/public/service/index.ts diff --git a/src/plugins/index_pattern_field_editor/public/shared_imports.ts b/src/plugins/data_view_field_editor/public/shared_imports.ts similarity index 89% rename from src/plugins/index_pattern_field_editor/public/shared_imports.ts rename to src/plugins/data_view_field_editor/public/shared_imports.ts index 5b377bdd1d2b5..c8332a2afe76d 100644 --- a/src/plugins/index_pattern_field_editor/public/shared_imports.ts +++ b/src/plugins/data_view_field_editor/public/shared_imports.ts @@ -7,7 +7,9 @@ */ export type { DataPublicPluginStart } from '../../data/public'; -export { IndexPattern, IndexPatternField } from '../../data/public'; + +export type { DataViewsPublicPluginStart, DataView, DataViewField } from '../../data_views/public'; +export type { FieldFormatsStart } from '../../field_formats/public'; export type { UsageCollectionStart } from '../../usage_collection/public'; diff --git a/src/plugins/index_pattern_field_editor/public/types.ts b/src/plugins/data_view_field_editor/public/types.ts similarity index 94% rename from src/plugins/index_pattern_field_editor/public/types.ts rename to src/plugins/data_view_field_editor/public/types.ts index 9d62a5568584c..25f97e6737bf2 100644 --- a/src/plugins/index_pattern_field_editor/public/types.ts +++ b/src/plugins/data_view_field_editor/public/types.ts @@ -10,9 +10,11 @@ import { FunctionComponent } from 'react'; import { DataPublicPluginStart, + DataViewsPublicPluginStart, RuntimeField, RuntimeType, UsageCollectionStart, + FieldFormatsStart, } from './shared_imports'; import { OpenFieldEditorOptions } from './open_editor'; import { OpenFieldDeleteModalOptions } from './open_delete_modal'; @@ -39,6 +41,8 @@ export interface SetupPlugins {} export interface StartPlugins { data: DataPublicPluginStart; usageCollection: UsageCollectionStart; + dataViews: DataViewsPublicPluginStart; + fieldFormats: FieldFormatsStart; } export type InternalFieldType = 'concrete' | 'runtime'; diff --git a/src/plugins/index_pattern_field_editor/server/index.ts b/src/plugins/data_view_field_editor/server/index.ts similarity index 100% rename from src/plugins/index_pattern_field_editor/server/index.ts rename to src/plugins/data_view_field_editor/server/index.ts diff --git a/src/plugins/index_pattern_field_editor/server/plugin.ts b/src/plugins/data_view_field_editor/server/plugin.ts similarity index 100% rename from src/plugins/index_pattern_field_editor/server/plugin.ts rename to src/plugins/data_view_field_editor/server/plugin.ts diff --git a/src/plugins/index_pattern_field_editor/server/routes/field_preview.ts b/src/plugins/data_view_field_editor/server/routes/field_preview.ts similarity index 100% rename from src/plugins/index_pattern_field_editor/server/routes/field_preview.ts rename to src/plugins/data_view_field_editor/server/routes/field_preview.ts diff --git a/src/plugins/index_pattern_field_editor/server/routes/index.ts b/src/plugins/data_view_field_editor/server/routes/index.ts similarity index 100% rename from src/plugins/index_pattern_field_editor/server/routes/index.ts rename to src/plugins/data_view_field_editor/server/routes/index.ts diff --git a/src/plugins/index_pattern_field_editor/server/shared_imports.ts b/src/plugins/data_view_field_editor/server/shared_imports.ts similarity index 100% rename from src/plugins/index_pattern_field_editor/server/shared_imports.ts rename to src/plugins/data_view_field_editor/server/shared_imports.ts diff --git a/src/plugins/index_pattern_field_editor/server/types.ts b/src/plugins/data_view_field_editor/server/types.ts similarity index 100% rename from src/plugins/index_pattern_field_editor/server/types.ts rename to src/plugins/data_view_field_editor/server/types.ts diff --git a/src/plugins/index_pattern_field_editor/tsconfig.json b/src/plugins/data_view_field_editor/tsconfig.json similarity index 92% rename from src/plugins/index_pattern_field_editor/tsconfig.json rename to src/plugins/data_view_field_editor/tsconfig.json index 11a16ace1f2f5..2d1f603a1183d 100644 --- a/src/plugins/index_pattern_field_editor/tsconfig.json +++ b/src/plugins/data_view_field_editor/tsconfig.json @@ -16,6 +16,7 @@ "references": [ { "path": "../../core/tsconfig.json" }, { "path": "../data/tsconfig.json" }, + { "path": "../data_views/tsconfig.json" }, { "path": "../kibana_react/tsconfig.json" }, { "path": "../kibana_utils/tsconfig.json" }, { "path": "../es_ui_shared/tsconfig.json" }, diff --git a/src/plugins/index_pattern_management/jest.config.js b/src/plugins/data_view_management/jest.config.js similarity index 72% rename from src/plugins/index_pattern_management/jest.config.js rename to src/plugins/data_view_management/jest.config.js index 6249d44e6b31f..885706e862ceb 100644 --- a/src/plugins/index_pattern_management/jest.config.js +++ b/src/plugins/data_view_management/jest.config.js @@ -9,11 +9,9 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', - roots: ['/src/plugins/index_pattern_management'], + roots: ['/src/plugins/data_view_management'], testRunner: 'jasmine2', - coverageDirectory: '/target/kibana-coverage/jest/src/plugins/index_pattern_management', + coverageDirectory: '/target/kibana-coverage/jest/src/plugins/data_view_management', coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '/src/plugins/index_pattern_management/{public,server}/**/*.{ts,tsx}', - ], + collectCoverageFrom: ['/src/plugins/data_view_management/{public,server}/**/*.{ts,tsx}'], }; diff --git a/src/plugins/index_pattern_management/kibana.json b/src/plugins/data_view_management/kibana.json similarity index 50% rename from src/plugins/index_pattern_management/kibana.json rename to src/plugins/data_view_management/kibana.json index 3ba56eda3620e..707f68d0eb8da 100644 --- a/src/plugins/index_pattern_management/kibana.json +++ b/src/plugins/data_view_management/kibana.json @@ -1,13 +1,13 @@ { - "id": "indexPatternManagement", + "id": "dataViewManagement", "version": "kibana", "server": true, "ui": true, - "requiredPlugins": ["management", "data", "urlForwarding", "indexPatternFieldEditor", "indexPatternEditor"], + "requiredPlugins": ["management", "data", "urlForwarding", "dataViewFieldEditor", "dataViewEditor"], "requiredBundles": ["kibanaReact", "kibanaUtils"], "owner": { "name": "App Services", "githubTeam": "kibana-app-services" }, - "description": "Index pattern management app" + "description": "Data view management app" } diff --git a/src/plugins/index_pattern_management/public/_templates.scss b/src/plugins/data_view_management/public/_templates.scss similarity index 100% rename from src/plugins/index_pattern_management/public/_templates.scss rename to src/plugins/data_view_management/public/_templates.scss diff --git a/src/plugins/index_pattern_management/public/_variables.scss b/src/plugins/data_view_management/public/_variables.scss similarity index 100% rename from src/plugins/index_pattern_management/public/_variables.scss rename to src/plugins/data_view_management/public/_variables.scss diff --git a/src/plugins/index_pattern_management/public/assets/icons/LICENSE.txt b/src/plugins/data_view_management/public/assets/icons/LICENSE.txt similarity index 100% rename from src/plugins/index_pattern_management/public/assets/icons/LICENSE.txt rename to src/plugins/data_view_management/public/assets/icons/LICENSE.txt diff --git a/src/plugins/index_pattern_management/public/assets/icons/cv.png b/src/plugins/data_view_management/public/assets/icons/cv.png similarity index 100% rename from src/plugins/index_pattern_management/public/assets/icons/cv.png rename to src/plugins/data_view_management/public/assets/icons/cv.png diff --git a/src/plugins/index_pattern_management/public/assets/icons/de.png b/src/plugins/data_view_management/public/assets/icons/de.png similarity index 100% rename from src/plugins/index_pattern_management/public/assets/icons/de.png rename to src/plugins/data_view_management/public/assets/icons/de.png diff --git a/src/plugins/index_pattern_management/public/assets/icons/go.png b/src/plugins/data_view_management/public/assets/icons/go.png similarity index 100% rename from src/plugins/index_pattern_management/public/assets/icons/go.png rename to src/plugins/data_view_management/public/assets/icons/go.png diff --git a/src/plugins/index_pattern_management/public/assets/icons/ne.png b/src/plugins/data_view_management/public/assets/icons/ne.png similarity index 100% rename from src/plugins/index_pattern_management/public/assets/icons/ne.png rename to src/plugins/data_view_management/public/assets/icons/ne.png diff --git a/src/plugins/index_pattern_management/public/assets/icons/ni.png b/src/plugins/data_view_management/public/assets/icons/ni.png similarity index 100% rename from src/plugins/index_pattern_management/public/assets/icons/ni.png rename to src/plugins/data_view_management/public/assets/icons/ni.png diff --git a/src/plugins/index_pattern_management/public/assets/icons/stop.png b/src/plugins/data_view_management/public/assets/icons/stop.png similarity index 100% rename from src/plugins/index_pattern_management/public/assets/icons/stop.png rename to src/plugins/data_view_management/public/assets/icons/stop.png diff --git a/src/plugins/index_pattern_management/public/assets/icons/us.png b/src/plugins/data_view_management/public/assets/icons/us.png similarity index 100% rename from src/plugins/index_pattern_management/public/assets/icons/us.png rename to src/plugins/data_view_management/public/assets/icons/us.png diff --git a/src/plugins/index_pattern_management/public/components/__snapshots__/utils.test.ts.snap b/src/plugins/data_view_management/public/components/__snapshots__/utils.test.ts.snap similarity index 100% rename from src/plugins/index_pattern_management/public/components/__snapshots__/utils.test.ts.snap rename to src/plugins/data_view_management/public/components/__snapshots__/utils.test.ts.snap diff --git a/src/plugins/index_pattern_management/public/components/breadcrumbs.ts b/src/plugins/data_view_management/public/components/breadcrumbs.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/breadcrumbs.ts rename to src/plugins/data_view_management/public/components/breadcrumbs.ts diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/constants.ts b/src/plugins/data_view_management/public/components/edit_index_pattern/constants.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/constants.ts rename to src/plugins/data_view_management/public/components/edit_index_pattern/constants.ts diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx rename to src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field.tsx diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx rename to src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/create_edit_field_container.tsx diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/index.ts b/src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/index.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/create_edit_field/index.ts rename to src/plugins/data_view_management/public/components/edit_index_pattern/create_edit_field/index.ts diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx similarity index 99% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx rename to src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx index 75fb3a6114c6c..2255b4ff2eb47 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx +++ b/src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern.tsx @@ -19,7 +19,7 @@ import { EuiCallOut, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { IndexPattern, IndexPatternField } from '../../../../../plugins/data/public'; import { useKibana } from '../../../../../plugins/kibana_react/public'; import { IndexPatternManagmentContext } from '../../types'; diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx rename to src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern_container.tsx diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_state_container.ts b/src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern_state_container.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern_state_container.ts rename to src/plugins/data_view_management/public/components/edit_index_pattern/edit_index_pattern_state_container.ts diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/index.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/index.tsx similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/index.tsx rename to src/plugins/data_view_management/public/components/edit_index_pattern/index.tsx diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index.ts b/src/plugins/data_view_management/public/components/edit_index_pattern/index_header/index.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index.ts rename to src/plugins/data_view_management/public/components/edit_index_pattern/index_header/index.ts diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/index_header/index_header.tsx similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/index_header/index_header.tsx rename to src/plugins/data_view_management/public/components/edit_index_pattern/index_header/index_header.tsx diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/__snapshots__/indexed_fields_table.test.tsx.snap b/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/__snapshots__/indexed_fields_table.test.tsx.snap similarity index 99% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/__snapshots__/indexed_fields_table.test.tsx.snap rename to src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/__snapshots__/indexed_fields_table.test.tsx.snap index 8b6e0a1682750..fb463d0a5fb18 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/__snapshots__/indexed_fields_table.test.tsx.snap +++ b/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/__snapshots__/indexed_fields_table.test.tsx.snap @@ -116,7 +116,7 @@ exports[`IndexedFieldsTable IndexedFieldsTable with rollup index pattern should "isUserEditable": false, "kbnType": undefined, "name": "conflictingField", - "type": "keyword, long", + "type": "conflict", }, Object { "displayName": "amount", @@ -274,7 +274,7 @@ exports[`IndexedFieldsTable should render normally 1`] = ` "isUserEditable": false, "kbnType": undefined, "name": "conflictingField", - "type": "keyword, long", + "type": "conflict", }, Object { "displayName": "amount", diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/__snapshots__/table.test.tsx.snap b/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/components/table/__snapshots__/table.test.tsx.snap similarity index 67% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/__snapshots__/table.test.tsx.snap rename to src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/components/table/__snapshots__/table.test.tsx.snap index 5149ae1a61f60..100100106127b 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/__snapshots__/table.test.tsx.snap +++ b/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/components/table/__snapshots__/table.test.tsx.snap @@ -1,5 +1,86 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`Table render conflict summary modal 1`] = ` + + + +

+ +

+
+
+ + +

+ + message + , + } + } + /> +

+ + } + responsive={true} + rowHeader="firstName" + tableCaption="Demo of EuiBasicTable" + tableLayout="auto" + /> +
+
+ + + + + +
+`; + exports[`Table render name 1`] = ` customer @@ -26,15 +107,17 @@ exports[`Table render name 2`] = ` exports[`Table should render conflicting type 1`] = ` - conflict -   - + iconOnClick={[Function]} + iconOnClickAriaLabel="Conflict Detail" + iconType="alert" + onClick={[Function]} + onClickAriaLabel="Conflict Detail" + > + Conflict + `; @@ -160,6 +243,14 @@ exports[`Table should render normally 1`] = ` "type": "date", }, Object { + "conflictDescriptions": Object { + "keyword": Array [ + "index_a", + ], + "long": Array [ + "index_b", + ], + }, "displayName": "conflictingField", "excluded": false, "hasRuntime": false, diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/index.ts b/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/components/table/index.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/index.ts rename to src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/components/table/index.ts diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.test.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.test.tsx similarity index 82% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.test.tsx rename to src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.test.tsx index 71b2e59aefc81..ec18665ccbaf3 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.test.tsx +++ b/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.test.tsx @@ -10,7 +10,8 @@ import React from 'react'; import { shallow } from 'enzyme'; import { IndexPattern } from 'src/plugins/data/public'; import { IndexedFieldItem } from '../../types'; -import { Table, renderFieldName } from './table'; +import { Table, renderFieldName, getConflictModalContent } from './table'; +import { overlayServiceMock } from 'src/core/public/mocks'; const indexPattern = { timeFieldName: 'timestamp', @@ -43,6 +44,7 @@ const items: IndexedFieldItem[] = [ { name: 'conflictingField', displayName: 'conflictingField', + conflictDescriptions: { keyword: ['index_a'], long: ['index_b'] }, type: 'text, long', kbnType: 'conflict', info: [], @@ -81,7 +83,13 @@ const renderTable = ( } ) => shallow( - {}} /> +
{}} + openModal={overlayServiceMock.createStartContract().openModal} + /> ); describe('Table', () => { @@ -116,7 +124,12 @@ describe('Table', () => { test('should render conflicting type', () => { const tableCell = shallow( - renderTable().prop('columns')[1].render('conflict', { kbnType: 'conflict' }) + renderTable() + .prop('columns')[1] + .render('conflict', { + kbnType: 'conflict', + conflictDescriptions: { keyword: ['index_a'], long: ['index_b'] }, + }) ); expect(tableCell).toMatchSnapshot(); }); @@ -163,4 +176,14 @@ describe('Table', () => { expect(renderFieldName(runtimeField)).toMatchSnapshot(); }); + + test('render conflict summary modal ', () => { + expect( + getConflictModalContent({ + closeFn: () => {}, + fieldName: 'message', + conflictDescriptions: { keyword: ['index_a'], long: ['index_b'] }, + }) + ).toMatchSnapshot(); + }); }); diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx similarity index 68% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx rename to src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx index aed985f062cd9..e08b153f0b262 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx +++ b/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/components/table/table.tsx @@ -7,6 +7,7 @@ */ import React, { PureComponent } from 'react'; +import { OverlayModalStart } from 'src/core/public'; import { EuiIcon, @@ -15,9 +16,19 @@ import { EuiBasicTableColumn, EuiBadge, EuiToolTip, + EuiModalHeader, + EuiModalFooter, + EuiModalBody, + EuiButton, + EuiModalHeaderTitle, + EuiText, + EuiBasicTable, + EuiCode, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { toMountPoint } from '../../../../../../../kibana_react/public'; import { IIndexPattern } from '../../../../../../../data/public'; import { IndexedFieldItem } from '../../types'; @@ -28,6 +39,11 @@ const additionalInfoAriaLabel = i18n.translate( { defaultMessage: 'Additional field information' } ); +const conflictDetailIconAria = i18n.translate( + 'indexPatternManagement.editIndexPattern.fields.table.conflictDetailIconAria', + { defaultMessage: 'Conflict Detail' } +); + const primaryTimeAriaLabel = i18n.translate( 'indexPatternManagement.editIndexPattern.fields.table.primaryTimeAriaLabel', { defaultMessage: 'Primary time field' } @@ -38,21 +54,6 @@ const primaryTimeTooltip = i18n.translate( { defaultMessage: 'This field represents the time that events occurred.' } ); -const multiTypeAriaLabel = i18n.translate( - 'indexPatternManagement.editIndexPattern.fields.table.multiTypeAria', - { - defaultMessage: 'Multiple type field', - } -); - -const multiTypeTooltip = i18n.translate( - 'indexPatternManagement.editIndexPattern.fields.table.multiTypeTooltip', - { - defaultMessage: - 'The type of this field changes across indices. It is unavailable for many analysis functions.', - } -); - const nameHeader = i18n.translate( 'indexPatternManagement.editIndexPattern.fields.table.nameHeader', { @@ -167,13 +168,31 @@ const runtimeIconTipText = i18n.translate( { defaultMessage: 'This field exists on the data view only.' } ); +const conflictType = i18n.translate( + 'indexPatternManagement.editDataView.fields.table.conflictType', + { defaultMessage: 'Conflict' } +); + interface IndexedFieldProps { indexPattern: IIndexPattern; items: IndexedFieldItem[]; editField: (field: IndexedFieldItem) => void; deleteField: (fieldName: string) => void; + openModal: OverlayModalStart['open']; } +const getItems = (conflictDescriptions: IndexedFieldItem['conflictDescriptions']) => { + const typesAndIndices: Array<{ type: string; indices: string }> = []; + Object.keys(conflictDescriptions!).forEach((type) => { + // only show first 100 indices just incase the list is CRAZY long + typesAndIndices.push({ + type, + indices: conflictDescriptions![type].slice(0, 99).join(', '), + }); + }); + return typesAndIndices; +}; + export const renderFieldName = (field: IndexedFieldItem, timeFieldName?: string) => ( {field.name} @@ -223,28 +242,119 @@ export const renderFieldName = (field: IndexedFieldItem, timeFieldName?: string) ); +const conflictColumns = [ + { + field: 'type', + name: i18n.translate( + 'indexPatternManagement.editIndexPattern.fields.table.conflictModalTypeColumn', + { defaultMessage: 'Type' } + ), + }, + { + field: 'indices', + name: i18n.translate( + 'indexPatternManagement.editIndexPattern.fields.table.conflictModalIndicesColumn', + { defaultMessage: 'Indices' } + ), + }, +]; + +export const getConflictModalContent = ({ + closeFn, + fieldName, + conflictDescriptions, +}: { + closeFn: () => void; + fieldName: string; + conflictDescriptions: IndexedFieldItem['conflictDescriptions']; +}) => ( + <> + + +

+ +

+
+
+ + +

+ {fieldName} }} + /> +

+ +
+
+ + + + + + +); + +const getConflictBtn = ( + fieldName: string, + conflictDescriptions: IndexedFieldItem['conflictDescriptions'], + openModal: IndexedFieldProps['openModal'] +) => { + const onClick = () => { + const overlayRef = openModal( + toMountPoint( + getConflictModalContent({ + closeFn: () => { + overlayRef.close(); + }, + fieldName, + conflictDescriptions, + }) + ) + ); + }; + + return ( + + + {conflictType} + + + ); +}; + export class Table extends PureComponent { renderBooleanTemplate(value: string, arialLabel: string) { return value ? : ; } - renderFieldType(type: string, isConflict: boolean) { + renderFieldType(type: string, field: IndexedFieldItem) { return ( - {type} - {isConflict ? ( - -   - - - ) : ( - '' - )} + {type !== 'conflict' ? type : ''} + {field.conflictDescriptions + ? getConflictBtn(field.name, field.conflictDescriptions, this.props.openModal) + : ''} ); } @@ -275,7 +385,7 @@ export class Table extends PureComponent { dataType: 'string', sortable: true, render: (value: string, field: IndexedFieldItem) => { - return this.renderFieldType(value, field.kbnType === 'conflict'); + return this.renderFieldType(value, field); }, 'data-test-subj': 'indexedFieldType', }, diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/index.ts b/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/index.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/index.ts rename to src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/index.ts diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.test.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.test.tsx similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.test.tsx rename to src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.test.tsx diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx similarity index 88% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx rename to src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx index b058ad4a7672c..1e0d36f465be5 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx +++ b/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/indexed_fields_table.tsx @@ -7,7 +7,9 @@ */ import React, { Component } from 'react'; +import { i18n } from '@kbn/i18n'; import { createSelector } from 'reselect'; +import { OverlayStart } from 'src/core/public'; import { IndexPatternField, IndexPattern } from '../../../../../../plugins/data/public'; import { useKibana } from '../../../../../../plugins/kibana_react/public'; import { Table } from './components/table'; @@ -26,6 +28,7 @@ interface IndexedFieldsTableProps { }; fieldWildcardMatcher: (filters: any[]) => (val: any) => boolean; userEditPermission: boolean; + openModal: OverlayStart['openModal']; } interface IndexedFieldsTableState { @@ -65,12 +68,25 @@ class IndexedFields extends Component) => f.value); const fieldWildcardMatch = fieldWildcardMatcher(sourceFilters || []); + const getDisplayEsType = (arr: string[]): string => { + const length = arr.length; + if (length < 1) { + return ''; + } + if (length > 1) { + return i18n.translate('indexPatternManagement.editIndexPattern.fields.conflictType', { + defaultMessage: 'conflict', + }); + } + return arr[0]; + }; + return ( (fields && fields.map((field) => { return { ...field.spec, - type: field.esTypes?.join(', ') || '', + type: getDisplayEsType(field.esTypes || []), kbnType: field.type, displayName: field.displayName, format: indexPattern.getFormatterForFieldNoDefault(field.name)?.type?.title || '', @@ -119,6 +135,7 @@ class IndexedFields extends Component this.props.helpers.editField(field.name)} deleteField={(fieldName) => this.props.helpers.deleteField(fieldName)} + openModal={this.props.openModal} /> ); diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts b/src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/types.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/indexed_fields_table/types.ts rename to src/plugins/data_view_management/public/components/edit_index_pattern/indexed_fields_table/types.ts diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/__snapshots__/scripted_field_table.test.tsx.snap b/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/__snapshots__/scripted_field_table.test.tsx.snap similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/__snapshots__/scripted_field_table.test.tsx.snap rename to src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/__snapshots__/scripted_field_table.test.tsx.snap diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/call_outs/__snapshots__/call_outs.test.tsx.snap b/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/call_outs/__snapshots__/call_outs.test.tsx.snap similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/call_outs/__snapshots__/call_outs.test.tsx.snap rename to src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/call_outs/__snapshots__/call_outs.test.tsx.snap diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/call_outs/call_outs.test.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/call_outs/call_outs.test.tsx similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/call_outs/call_outs.test.tsx rename to src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/call_outs/call_outs.test.tsx diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/call_outs/call_outs.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/call_outs/call_outs.tsx similarity index 97% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/call_outs/call_outs.tsx rename to src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/call_outs/call_outs.tsx index 05705142dda36..465c7aa5e4ae0 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/call_outs/call_outs.tsx +++ b/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/call_outs/call_outs.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { EuiCallOut, EuiLink, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; interface CallOutsProps { deprecatedLangsInUse: string[]; diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/call_outs/index.ts b/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/call_outs/index.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/call_outs/index.ts rename to src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/call_outs/index.ts diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/confirmation_modal/__snapshots__/confirmation_modal.test.tsx.snap b/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/confirmation_modal/__snapshots__/confirmation_modal.test.tsx.snap similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/confirmation_modal/__snapshots__/confirmation_modal.test.tsx.snap rename to src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/confirmation_modal/__snapshots__/confirmation_modal.test.tsx.snap 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/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/confirmation_modal/confirmation_modal.test.tsx similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/confirmation_modal/confirmation_modal.test.tsx rename to src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/confirmation_modal/confirmation_modal.test.tsx diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/confirmation_modal/confirmation_modal.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/confirmation_modal/confirmation_modal.tsx similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/confirmation_modal/confirmation_modal.tsx rename to src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/confirmation_modal/confirmation_modal.tsx diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/confirmation_modal/index.ts b/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/confirmation_modal/index.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/confirmation_modal/index.ts rename to src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/confirmation_modal/index.ts diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/header/__snapshots__/header.test.tsx.snap b/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/header/__snapshots__/header.test.tsx.snap similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/header/__snapshots__/header.test.tsx.snap rename to src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/header/__snapshots__/header.test.tsx.snap diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/header/header.test.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/header/header.test.tsx similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/header/header.test.tsx rename to src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/header/header.test.tsx diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/header/header.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/header/header.tsx similarity index 98% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/header/header.tsx rename to src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/header/header.tsx index a5930e14f0a0d..c3fd03617be6b 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/header/header.tsx +++ b/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/header/header.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { withRouter, RouteComponentProps } from 'react-router-dom'; import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiText, EuiLink, EuiIcon } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ScopedHistory } from 'kibana/public'; import { reactRouterNavigate, useKibana } from '../../../../../../../kibana_react/public'; diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/header/index.ts b/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/header/index.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/header/index.ts rename to src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/header/index.ts diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/index.ts b/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/index.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/index.ts rename to src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/index.ts diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/__snapshots__/table.test.tsx.snap b/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/table/__snapshots__/table.test.tsx.snap similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/__snapshots__/table.test.tsx.snap rename to src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/table/__snapshots__/table.test.tsx.snap diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/index.ts b/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/table/index.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/index.ts rename to src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/table/index.ts diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.test.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.test.tsx similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.test.tsx rename to src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.test.tsx diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx rename to src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/components/table/table.tsx diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/index.ts b/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/index.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/index.ts rename to src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/index.ts diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_field_table.test.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_field_table.test.tsx similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_field_table.test.tsx rename to src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_field_table.test.tsx diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx rename to src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/scripted_fields_table.tsx diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/types.ts b/src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/types.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/types.ts rename to src/plugins/data_view_management/public/components/edit_index_pattern/scripted_fields_table/types.ts diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/__snapshots__/source_filters_table.test.tsx.snap b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/__snapshots__/source_filters_table.test.tsx.snap similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/__snapshots__/source_filters_table.test.tsx.snap rename to src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/__snapshots__/source_filters_table.test.tsx.snap diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/add_filter/__snapshots__/add_filter.test.tsx.snap b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/add_filter/__snapshots__/add_filter.test.tsx.snap similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/add_filter/__snapshots__/add_filter.test.tsx.snap rename to src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/add_filter/__snapshots__/add_filter.test.tsx.snap diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/add_filter/add_filter.test.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/add_filter/add_filter.test.tsx similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/add_filter/add_filter.test.tsx rename to src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/add_filter/add_filter.test.tsx diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/add_filter/add_filter.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/add_filter/add_filter.tsx similarity index 96% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/add_filter/add_filter.tsx rename to src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/add_filter/add_filter.tsx index 003e83ccebf0b..af77fe6195654 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/add_filter/add_filter.tsx +++ b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/add_filter/add_filter.tsx @@ -9,7 +9,7 @@ import React, { useState, useCallback } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, EuiFieldText, EuiButton } from '@elastic/eui'; interface AddFilterProps { diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/add_filter/index.ts b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/add_filter/index.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/add_filter/index.ts rename to src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/add_filter/index.ts diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/confirmation_modal/__snapshots__/confirmation_modal.test.tsx.snap b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/confirmation_modal/__snapshots__/confirmation_modal.test.tsx.snap similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/confirmation_modal/__snapshots__/confirmation_modal.test.tsx.snap rename to src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/confirmation_modal/__snapshots__/confirmation_modal.test.tsx.snap diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/confirmation_modal/confirmation_modal.test.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/confirmation_modal/confirmation_modal.test.tsx similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/confirmation_modal/confirmation_modal.test.tsx rename to src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/confirmation_modal/confirmation_modal.test.tsx diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/confirmation_modal/confirmation_modal.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/confirmation_modal/confirmation_modal.tsx similarity index 97% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/confirmation_modal/confirmation_modal.tsx rename to src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/confirmation_modal/confirmation_modal.tsx index fb8d4a38bfe63..aba81da45a2b0 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/confirmation_modal/confirmation_modal.tsx +++ b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/confirmation_modal/confirmation_modal.tsx @@ -9,7 +9,7 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiConfirmModal, EUI_MODAL_CONFIRM_BUTTON } from '@elastic/eui'; interface DeleteFilterConfirmationModalProps { diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/confirmation_modal/index.ts b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/confirmation_modal/index.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/confirmation_modal/index.ts rename to src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/confirmation_modal/index.ts diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/header/__snapshots__/header.test.tsx.snap b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/header/__snapshots__/header.test.tsx.snap similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/header/__snapshots__/header.test.tsx.snap rename to src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/header/__snapshots__/header.test.tsx.snap diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/header/header.test.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/header/header.test.tsx similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/header/header.test.tsx rename to src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/header/header.test.tsx diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/header/header.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/header/header.tsx similarity index 96% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/header/header.tsx rename to src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/header/header.tsx index 626be02bfb7ba..82c40fd9681ae 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/header/header.tsx +++ b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/header/header.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { EuiText, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const Header = () => ( <> diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/header/index.ts b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/header/index.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/header/index.ts rename to src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/header/index.ts diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/index.ts b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/index.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/index.ts rename to src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/index.ts diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/__snapshots__/table.test.tsx.snap b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/__snapshots__/table.test.tsx.snap similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/__snapshots__/table.test.tsx.snap rename to src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/__snapshots__/table.test.tsx.snap diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/index.ts b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/index.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/index.ts rename to src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/index.ts diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.test.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/table.test.tsx similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.test.tsx rename to src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/table.test.tsx diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx similarity index 99% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx rename to src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx index c95fd95554f2e..237a876688c5d 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx +++ b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/table/table.tsx @@ -18,7 +18,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { IndexPattern } from 'src/plugins/data/public'; import { SourceFiltersTableFilter } from '../../types'; diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/index.ts b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/index.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/index.ts rename to src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/index.ts diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.test.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.test.tsx similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.test.tsx rename to src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.test.tsx diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx rename to src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/source_filters_table.tsx diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/types.ts b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/types.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/types.ts rename to src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/types.ts diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/index.ts b/src/plugins/data_view_management/public/components/edit_index_pattern/tabs/index.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/index.ts rename to src/plugins/data_view_management/public/components/edit_index_pattern/tabs/index.ts diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/tabs/tabs.tsx similarity index 93% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx rename to src/plugins/data_view_management/public/components/edit_index_pattern/tabs/tabs.tsx index 821f1d533e201..c79871dbc8d71 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx +++ b/src/plugins/data_view_management/public/components/edit_index_pattern/tabs/tabs.tsx @@ -80,7 +80,7 @@ export function Tabs({ location, refreshFields, }: TabsProps) { - const { application, uiSettings, docLinks, indexPatternFieldEditor } = + const { application, uiSettings, docLinks, dataViewFieldEditor, overlays } = useKibana().services; const [fieldFilter, setFieldFilter] = useState(''); const [indexedFieldTypeFilter, setIndexedFieldTypeFilter] = useState(''); @@ -91,7 +91,14 @@ export function Tabs({ getCurrentTab: () => TAB_INDEXED_FIELDS, }); const closeEditorHandler = useRef<() => void | undefined>(); - const { DeleteRuntimeFieldProvider } = indexPatternFieldEditor; + const { DeleteRuntimeFieldProvider } = dataViewFieldEditor; + + const conflict = i18n.translate( + 'indexPatternManagement.editIndexPattern.fieldTypes.conflictType', + { + defaultMessage: 'conflict', + } + ); const refreshFilters = useCallback(() => { const tempIndexedFieldTypes: string[] = []; @@ -103,7 +110,7 @@ export function Tabs({ } } else { if (field.esTypes) { - tempIndexedFieldTypes.push(field.esTypes?.join(', ')); + tempIndexedFieldTypes.push(field.esTypes.length === 1 ? field.esTypes[0] : conflict); } } }); @@ -112,7 +119,7 @@ export function Tabs({ setScriptedFieldLanguages( convertToEuiSelectOption(tempScriptedFieldLanguages, 'scriptedFieldLanguages') ); - }, [indexPattern]); + }, [indexPattern, conflict]); const closeFieldEditor = useCallback(() => { if (closeEditorHandler.current) { @@ -122,15 +129,15 @@ export function Tabs({ const openFieldEditor = useCallback( (fieldName?: string) => { - closeEditorHandler.current = indexPatternFieldEditor.openEditor({ + closeEditorHandler.current = dataViewFieldEditor.openEditor({ ctx: { - indexPattern, + dataView: indexPattern, }, onSave: refreshFields, fieldName, }); }, - [indexPatternFieldEditor, indexPattern, refreshFields] + [dataViewFieldEditor, indexPattern, refreshFields] ); useEffect(() => { @@ -217,7 +224,7 @@ export function Tabs({ {getFilterSection(type)} - + {(deleteField) => ( )} @@ -288,6 +296,7 @@ export function Tabs({ openFieldEditor, DeleteRuntimeFieldProvider, refreshFields, + overlays, ] ); diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts b/src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.test.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.test.ts rename to src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.test.ts diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts b/src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/utils.ts rename to src/plugins/data_view_management/public/components/edit_index_pattern/tabs/utils.ts diff --git a/src/plugins/index_pattern_management/public/components/field_editor/__snapshots__/field_editor.test.tsx.snap b/src/plugins/data_view_management/public/components/field_editor/__snapshots__/field_editor.test.tsx.snap similarity index 100% rename from src/plugins/index_pattern_management/public/components/field_editor/__snapshots__/field_editor.test.tsx.snap rename to src/plugins/data_view_management/public/components/field_editor/__snapshots__/field_editor.test.tsx.snap diff --git a/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/__snapshots__/field_format_editor.test.tsx.snap b/src/plugins/data_view_management/public/components/field_editor/components/field_format_editor/__snapshots__/field_format_editor.test.tsx.snap similarity index 100% rename from src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/__snapshots__/field_format_editor.test.tsx.snap rename to src/plugins/data_view_management/public/components/field_editor/components/field_format_editor/__snapshots__/field_format_editor.test.tsx.snap diff --git a/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/field_format_editor.test.tsx b/src/plugins/data_view_management/public/components/field_editor/components/field_format_editor/field_format_editor.test.tsx similarity index 100% rename from src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/field_format_editor.test.tsx rename to src/plugins/data_view_management/public/components/field_editor/components/field_format_editor/field_format_editor.test.tsx diff --git a/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/field_format_editor.tsx b/src/plugins/data_view_management/public/components/field_editor/components/field_format_editor/field_format_editor.tsx similarity index 98% rename from src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/field_format_editor.tsx rename to src/plugins/data_view_management/public/components/field_editor/components/field_format_editor/field_format_editor.tsx index 3689ae70639c8..3cddad8dc3e76 100644 --- a/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/field_format_editor.tsx +++ b/src/plugins/data_view_management/public/components/field_editor/components/field_format_editor/field_format_editor.tsx @@ -12,7 +12,7 @@ import { EuiDelayRender, EuiLoadingContent } from '@elastic/eui'; import type { FieldFormatEditorFactory, FieldFormatEditor as InnerFieldFormatEditor, -} from 'src/plugins/index_pattern_field_editor/public'; +} from 'src/plugins/data_view_field_editor/public'; import type { FieldFormat } from 'src/plugins/field_formats/common'; export interface FieldFormatEditorProps { diff --git a/src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/index.ts b/src/plugins/data_view_management/public/components/field_editor/components/field_format_editor/index.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/field_editor/components/field_format_editor/index.ts rename to src/plugins/data_view_management/public/components/field_editor/components/field_format_editor/index.ts diff --git a/src/plugins/index_pattern_management/public/components/field_editor/components/scripting_call_outs/__snapshots__/disabled_call_out.test.tsx.snap b/src/plugins/data_view_management/public/components/field_editor/components/scripting_call_outs/__snapshots__/disabled_call_out.test.tsx.snap similarity index 100% rename from src/plugins/index_pattern_management/public/components/field_editor/components/scripting_call_outs/__snapshots__/disabled_call_out.test.tsx.snap rename to src/plugins/data_view_management/public/components/field_editor/components/scripting_call_outs/__snapshots__/disabled_call_out.test.tsx.snap diff --git a/src/plugins/index_pattern_management/public/components/field_editor/components/scripting_call_outs/__snapshots__/warning_call_out.test.tsx.snap b/src/plugins/data_view_management/public/components/field_editor/components/scripting_call_outs/__snapshots__/warning_call_out.test.tsx.snap similarity index 100% rename from src/plugins/index_pattern_management/public/components/field_editor/components/scripting_call_outs/__snapshots__/warning_call_out.test.tsx.snap rename to src/plugins/data_view_management/public/components/field_editor/components/scripting_call_outs/__snapshots__/warning_call_out.test.tsx.snap diff --git a/src/plugins/index_pattern_management/public/components/field_editor/components/scripting_call_outs/disabled_call_out.test.tsx b/src/plugins/data_view_management/public/components/field_editor/components/scripting_call_outs/disabled_call_out.test.tsx similarity index 100% rename from src/plugins/index_pattern_management/public/components/field_editor/components/scripting_call_outs/disabled_call_out.test.tsx rename to src/plugins/data_view_management/public/components/field_editor/components/scripting_call_outs/disabled_call_out.test.tsx diff --git a/src/plugins/index_pattern_management/public/components/field_editor/components/scripting_call_outs/disabled_call_out.tsx b/src/plugins/data_view_management/public/components/field_editor/components/scripting_call_outs/disabled_call_out.tsx similarity index 96% rename from src/plugins/index_pattern_management/public/components/field_editor/components/scripting_call_outs/disabled_call_out.tsx rename to src/plugins/data_view_management/public/components/field_editor/components/scripting_call_outs/disabled_call_out.tsx index 6527217ad8cf4..f546633f0a51d 100644 --- a/src/plugins/index_pattern_management/public/components/field_editor/components/scripting_call_outs/disabled_call_out.tsx +++ b/src/plugins/data_view_management/public/components/field_editor/components/scripting_call_outs/disabled_call_out.tsx @@ -10,7 +10,7 @@ import React, { Fragment } from 'react'; import { EuiCallOut, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const ScriptingDisabledCallOut = ({ isVisible = false }) => { return isVisible ? ( diff --git a/src/plugins/index_pattern_management/public/components/field_editor/components/scripting_call_outs/index.ts b/src/plugins/data_view_management/public/components/field_editor/components/scripting_call_outs/index.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/field_editor/components/scripting_call_outs/index.ts rename to src/plugins/data_view_management/public/components/field_editor/components/scripting_call_outs/index.ts diff --git a/src/plugins/index_pattern_management/public/components/field_editor/components/scripting_call_outs/warning_call_out.test.tsx b/src/plugins/data_view_management/public/components/field_editor/components/scripting_call_outs/warning_call_out.test.tsx similarity index 100% rename from src/plugins/index_pattern_management/public/components/field_editor/components/scripting_call_outs/warning_call_out.test.tsx rename to src/plugins/data_view_management/public/components/field_editor/components/scripting_call_outs/warning_call_out.test.tsx diff --git a/src/plugins/index_pattern_management/public/components/field_editor/components/scripting_call_outs/warning_call_out.tsx b/src/plugins/data_view_management/public/components/field_editor/components/scripting_call_outs/warning_call_out.tsx similarity index 98% rename from src/plugins/index_pattern_management/public/components/field_editor/components/scripting_call_outs/warning_call_out.tsx rename to src/plugins/data_view_management/public/components/field_editor/components/scripting_call_outs/warning_call_out.tsx index d992a3fc5c192..875354de10e0f 100644 --- a/src/plugins/index_pattern_management/public/components/field_editor/components/scripting_call_outs/warning_call_out.tsx +++ b/src/plugins/data_view_management/public/components/field_editor/components/scripting_call_outs/warning_call_out.tsx @@ -10,7 +10,7 @@ import React, { Fragment } from 'react'; import { EuiCallOut, EuiLink, EuiSpacer, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useKibana } from '../../../../../../../plugins/kibana_react/public'; import { IndexPatternManagmentContext } from '../../../../types'; diff --git a/src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/__snapshots__/help_flyout.test.tsx.snap b/src/plugins/data_view_management/public/components/field_editor/components/scripting_help/__snapshots__/help_flyout.test.tsx.snap similarity index 100% rename from src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/__snapshots__/help_flyout.test.tsx.snap rename to src/plugins/data_view_management/public/components/field_editor/components/scripting_help/__snapshots__/help_flyout.test.tsx.snap diff --git a/src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/help_flyout.test.tsx b/src/plugins/data_view_management/public/components/field_editor/components/scripting_help/help_flyout.test.tsx similarity index 100% rename from src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/help_flyout.test.tsx rename to src/plugins/data_view_management/public/components/field_editor/components/scripting_help/help_flyout.test.tsx diff --git a/src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/help_flyout.tsx b/src/plugins/data_view_management/public/components/field_editor/components/scripting_help/help_flyout.tsx similarity index 100% rename from src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/help_flyout.tsx rename to src/plugins/data_view_management/public/components/field_editor/components/scripting_help/help_flyout.tsx diff --git a/src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/index.ts b/src/plugins/data_view_management/public/components/field_editor/components/scripting_help/index.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/index.ts rename to src/plugins/data_view_management/public/components/field_editor/components/scripting_help/index.ts diff --git a/src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/scripting_syntax.tsx b/src/plugins/data_view_management/public/components/field_editor/components/scripting_help/scripting_syntax.tsx similarity index 99% rename from src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/scripting_syntax.tsx rename to src/plugins/data_view_management/public/components/field_editor/components/scripting_help/scripting_syntax.tsx index 779dc7822379f..fe327bc0e0003 100644 --- a/src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/scripting_syntax.tsx +++ b/src/plugins/data_view_management/public/components/field_editor/components/scripting_help/scripting_syntax.tsx @@ -9,7 +9,7 @@ import React, { Fragment } from 'react'; import { EuiCode, EuiIcon, EuiLink, EuiText, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useKibana } from '../../../../../../../plugins/kibana_react/public'; import { IndexPatternManagmentContext } from '../../../../types'; diff --git a/src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.scss b/src/plugins/data_view_management/public/components/field_editor/components/scripting_help/test_script.scss similarity index 100% rename from src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.scss rename to src/plugins/data_view_management/public/components/field_editor/components/scripting_help/test_script.scss diff --git a/src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx b/src/plugins/data_view_management/public/components/field_editor/components/scripting_help/test_script.tsx similarity index 99% rename from src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx rename to src/plugins/data_view_management/public/components/field_editor/components/scripting_help/test_script.tsx index ffd469000940c..76c460de4ed42 100644 --- a/src/plugins/index_pattern_management/public/components/field_editor/components/scripting_help/test_script.tsx +++ b/src/plugins/data_view_management/public/components/field_editor/components/scripting_help/test_script.tsx @@ -21,7 +21,7 @@ import { EuiCallOut, EuiComboBoxOptionOption, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { esQuery, IndexPattern, Query } from '../../../../../../../plugins/data/public'; diff --git a/src/plugins/index_pattern_management/public/components/field_editor/constants/index.ts b/src/plugins/data_view_management/public/components/field_editor/constants/index.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/field_editor/constants/index.ts rename to src/plugins/data_view_management/public/components/field_editor/constants/index.ts diff --git a/src/plugins/index_pattern_management/public/components/field_editor/field_editor.test.tsx b/src/plugins/data_view_management/public/components/field_editor/field_editor.test.tsx similarity index 100% rename from src/plugins/index_pattern_management/public/components/field_editor/field_editor.test.tsx rename to src/plugins/data_view_management/public/components/field_editor/field_editor.test.tsx diff --git a/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx b/src/plugins/data_view_management/public/components/field_editor/field_editor.tsx similarity index 99% rename from src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx rename to src/plugins/data_view_management/public/components/field_editor/field_editor.tsx index 1c66f37dad141..ceaad76d6d124 100644 --- a/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx +++ b/src/plugins/data_view_management/public/components/field_editor/field_editor.tsx @@ -31,7 +31,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { PainlessLang } from '@kbn/monaco'; import type { FieldFormatInstanceType } from 'src/plugins/field_formats/common'; import { diff --git a/src/plugins/index_pattern_management/public/components/field_editor/index.ts b/src/plugins/data_view_management/public/components/field_editor/index.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/field_editor/index.ts rename to src/plugins/data_view_management/public/components/field_editor/index.ts diff --git a/src/plugins/index_pattern_management/public/components/field_editor/lib/index.ts b/src/plugins/data_view_management/public/components/field_editor/lib/index.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/field_editor/lib/index.ts rename to src/plugins/data_view_management/public/components/field_editor/lib/index.ts diff --git a/src/plugins/index_pattern_management/public/components/field_editor/lib/validate_script.ts b/src/plugins/data_view_management/public/components/field_editor/lib/validate_script.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/field_editor/lib/validate_script.ts rename to src/plugins/data_view_management/public/components/field_editor/lib/validate_script.ts diff --git a/src/plugins/index_pattern_management/public/components/field_editor/types.ts b/src/plugins/data_view_management/public/components/field_editor/types.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/field_editor/types.ts rename to src/plugins/data_view_management/public/components/field_editor/types.ts diff --git a/src/plugins/index_pattern_management/public/components/index.ts b/src/plugins/data_view_management/public/components/index.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/index.ts rename to src/plugins/data_view_management/public/components/index.ts diff --git a/src/plugins/index_pattern_management/public/components/index_pattern_table/index.ts b/src/plugins/data_view_management/public/components/index_pattern_table/index.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/index_pattern_table/index.ts rename to src/plugins/data_view_management/public/components/index_pattern_table/index.ts diff --git a/src/plugins/index_pattern_management/public/components/index_pattern_table/index_pattern_table.tsx b/src/plugins/data_view_management/public/components/index_pattern_table/index_pattern_table.tsx similarity index 99% rename from src/plugins/index_pattern_management/public/components/index_pattern_table/index_pattern_table.tsx rename to src/plugins/data_view_management/public/components/index_pattern_table/index_pattern_table.tsx index 7c3a2c6eb0e34..eeed4b9054d7b 100644 --- a/src/plugins/index_pattern_management/public/components/index_pattern_table/index_pattern_table.tsx +++ b/src/plugins/data_view_management/public/components/index_pattern_table/index_pattern_table.tsx @@ -15,7 +15,7 @@ import { EuiPageHeader, EuiSpacer, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { RouteComponentProps, withRouter, useLocation } from 'react-router-dom'; import React, { useEffect, useState } from 'react'; import { i18n } from '@kbn/i18n'; diff --git a/src/plugins/index_pattern_management/public/components/test_utils.tsx b/src/plugins/data_view_management/public/components/test_utils.tsx similarity index 100% rename from src/plugins/index_pattern_management/public/components/test_utils.tsx rename to src/plugins/data_view_management/public/components/test_utils.tsx diff --git a/src/plugins/index_pattern_management/public/components/types.ts b/src/plugins/data_view_management/public/components/types.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/types.ts rename to src/plugins/data_view_management/public/components/types.ts diff --git a/src/plugins/index_pattern_management/public/components/utils.test.ts b/src/plugins/data_view_management/public/components/utils.test.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/utils.test.ts rename to src/plugins/data_view_management/public/components/utils.test.ts diff --git a/src/plugins/index_pattern_management/public/components/utils.ts b/src/plugins/data_view_management/public/components/utils.ts similarity index 100% rename from src/plugins/index_pattern_management/public/components/utils.ts rename to src/plugins/data_view_management/public/components/utils.ts diff --git a/src/plugins/index_pattern_management/public/constants.ts b/src/plugins/data_view_management/public/constants.ts similarity index 100% rename from src/plugins/index_pattern_management/public/constants.ts rename to src/plugins/data_view_management/public/constants.ts diff --git a/src/plugins/index_pattern_management/public/index.ts b/src/plugins/data_view_management/public/index.ts similarity index 100% rename from src/plugins/index_pattern_management/public/index.ts rename to src/plugins/data_view_management/public/index.ts diff --git a/src/plugins/index_pattern_management/public/management_app/index.tsx b/src/plugins/data_view_management/public/management_app/index.tsx similarity index 100% rename from src/plugins/index_pattern_management/public/management_app/index.tsx rename to src/plugins/data_view_management/public/management_app/index.tsx diff --git a/src/plugins/index_pattern_management/public/management_app/mount_management_section.tsx b/src/plugins/data_view_management/public/management_app/mount_management_section.tsx similarity index 91% rename from src/plugins/index_pattern_management/public/management_app/mount_management_section.tsx rename to src/plugins/data_view_management/public/management_app/mount_management_section.tsx index 12080fed933f3..6e0e7ffc9091d 100644 --- a/src/plugins/index_pattern_management/public/management_app/mount_management_section.tsx +++ b/src/plugins/data_view_management/public/management_app/mount_management_section.tsx @@ -11,7 +11,7 @@ import ReactDOM from 'react-dom'; import { Router, Switch, Route, Redirect } from 'react-router-dom'; import { i18n } from '@kbn/i18n'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { StartServicesAccessor } from 'src/core/public'; import { KibanaContextProvider } from '../../../kibana_react/public'; @@ -40,7 +40,7 @@ export async function mountManagementSection( ) { const [ { chrome, application, uiSettings, notifications, overlays, http, docLinks }, - { data, indexPatternFieldEditor, indexPatternEditor }, + { data, dataViewFieldEditor, dataViewEditor }, indexPatternManagementStart, ] = await getStartServices(); const canSave = Boolean(application.capabilities.indexPatterns.save); @@ -58,11 +58,11 @@ export async function mountManagementSection( http, docLinks, data, - indexPatternFieldEditor, + dataViewFieldEditor, indexPatternManagementStart: indexPatternManagementStart as IndexPatternManagementStart, setBreadcrumbs: params.setBreadcrumbs, - fieldFormatEditors: indexPatternFieldEditor.fieldFormatEditors, - IndexPatternEditor: indexPatternEditor.IndexPatternEditorComponent, + fieldFormatEditors: dataViewFieldEditor.fieldFormatEditors, + IndexPatternEditor: dataViewEditor.IndexPatternEditorComponent, }; ReactDOM.render( diff --git a/src/plugins/index_pattern_management/public/mocks.ts b/src/plugins/data_view_management/public/mocks.ts similarity index 86% rename from src/plugins/index_pattern_management/public/mocks.ts rename to src/plugins/data_view_management/public/mocks.ts index ec71c5fa3264e..513de8d7f4404 100644 --- a/src/plugins/index_pattern_management/public/mocks.ts +++ b/src/plugins/data_view_management/public/mocks.ts @@ -11,8 +11,8 @@ import { coreMock } from '../../../core/public/mocks'; import { managementPluginMock } from '../../management/public/mocks'; import { urlForwardingPluginMock } from '../../url_forwarding/public/mocks'; import { dataPluginMock } from '../../data/public/mocks'; -import { indexPatternFieldEditorPluginMock } from '../../index_pattern_field_editor/public/mocks'; -import { indexPatternEditorPluginMock } from '../../index_pattern_editor/public/mocks'; +import { indexPatternFieldEditorPluginMock } from '../../data_view_field_editor/public/mocks'; +import { indexPatternEditorPluginMock } from '../../data_view_editor/public/mocks'; import { IndexPatternManagementSetup, IndexPatternManagementStart, @@ -56,7 +56,7 @@ const createIndexPatternManagmentContext = (): { const { chrome, application, uiSettings, notifications, overlays } = coreMock.createStart(); const { http } = coreMock.createSetup(); const data = dataPluginMock.createStartContract(); - const indexPatternFieldEditor = indexPatternFieldEditorPluginMock.createStartContract(); + const dataViewFieldEditor = indexPatternFieldEditorPluginMock.createStartContract(); return { chrome, @@ -67,10 +67,10 @@ const createIndexPatternManagmentContext = (): { http, docLinks, data, - indexPatternFieldEditor, + dataViewFieldEditor, indexPatternManagementStart: createStartContract(), setBreadcrumbs: () => {}, - fieldFormatEditors: indexPatternFieldEditor.fieldFormatEditors, + fieldFormatEditors: dataViewFieldEditor.fieldFormatEditors, IndexPatternEditor: indexPatternEditorPluginMock.createStartContract().IndexPatternEditorComponent, }; diff --git a/src/plugins/index_pattern_management/public/plugin.ts b/src/plugins/data_view_management/public/plugin.ts similarity index 91% rename from src/plugins/index_pattern_management/public/plugin.ts rename to src/plugins/data_view_management/public/plugin.ts index 47290bfdedb8d..742a623dcb084 100644 --- a/src/plugins/index_pattern_management/public/plugin.ts +++ b/src/plugins/data_view_management/public/plugin.ts @@ -12,8 +12,8 @@ import { DataPublicPluginStart } from 'src/plugins/data/public'; import { UrlForwardingSetup } from '../../url_forwarding/public'; import { ManagementSetup } from '../../management/public'; -import { IndexPatternFieldEditorStart } from '../../index_pattern_field_editor/public'; -import { IndexPatternEditorStart } from '../../index_pattern_editor/public'; +import { IndexPatternFieldEditorStart } from '../../data_view_field_editor/public'; +import { DataViewEditorStart } from '../../data_view_editor/public'; export interface IndexPatternManagementSetupDependencies { management: ManagementSetup; @@ -22,8 +22,8 @@ export interface IndexPatternManagementSetupDependencies { export interface IndexPatternManagementStartDependencies { data: DataPublicPluginStart; - indexPatternFieldEditor: IndexPatternFieldEditorStart; - indexPatternEditor: IndexPatternEditorStart; + dataViewFieldEditor: IndexPatternFieldEditorStart; + dataViewEditor: DataViewEditorStart; } // eslint-disable-next-line @typescript-eslint/no-empty-interface diff --git a/src/plugins/index_pattern_management/public/scripting_languages/index.ts b/src/plugins/data_view_management/public/scripting_languages/index.ts similarity index 100% rename from src/plugins/index_pattern_management/public/scripting_languages/index.ts rename to src/plugins/data_view_management/public/scripting_languages/index.ts diff --git a/src/plugins/index_pattern_management/public/types.ts b/src/plugins/data_view_management/public/types.ts similarity index 81% rename from src/plugins/index_pattern_management/public/types.ts rename to src/plugins/data_view_management/public/types.ts index 7f21f1b82a059..9cf1976937ac3 100644 --- a/src/plugins/index_pattern_management/public/types.ts +++ b/src/plugins/data_view_management/public/types.ts @@ -19,8 +19,8 @@ import { DataPublicPluginStart } from 'src/plugins/data/public'; import { ManagementAppMountParams } from '../../management/public'; import { IndexPatternManagementStart } from './index'; import { KibanaReactContextValue } from '../../kibana_react/public'; -import { IndexPatternFieldEditorStart } from '../../index_pattern_field_editor/public'; -import { IndexPatternEditorStart } from '../../index_pattern_editor/public'; +import { IndexPatternFieldEditorStart } from '../../data_view_field_editor/public'; +import { DataViewEditorStart } from '../../data_view_editor/public'; export interface IndexPatternManagmentContext { chrome: ChromeStart; @@ -31,11 +31,11 @@ export interface IndexPatternManagmentContext { http: HttpSetup; docLinks: DocLinksStart; data: DataPublicPluginStart; - indexPatternFieldEditor: IndexPatternFieldEditorStart; + dataViewFieldEditor: IndexPatternFieldEditorStart; indexPatternManagementStart: IndexPatternManagementStart; setBreadcrumbs: ManagementAppMountParams['setBreadcrumbs']; fieldFormatEditors: IndexPatternFieldEditorStart['fieldFormatEditors']; - IndexPatternEditor: IndexPatternEditorStart['IndexPatternEditorComponent']; + IndexPatternEditor: DataViewEditorStart['IndexPatternEditorComponent']; } export type IndexPatternManagmentContextValue = diff --git a/src/plugins/index_pattern_management/server/index.ts b/src/plugins/data_view_management/server/index.ts similarity index 100% rename from src/plugins/index_pattern_management/server/index.ts rename to src/plugins/data_view_management/server/index.ts diff --git a/src/plugins/index_pattern_management/server/plugin.ts b/src/plugins/data_view_management/server/plugin.ts similarity index 100% rename from src/plugins/index_pattern_management/server/plugin.ts rename to src/plugins/data_view_management/server/plugin.ts diff --git a/src/plugins/index_pattern_management/server/routes/index.ts b/src/plugins/data_view_management/server/routes/index.ts similarity index 100% rename from src/plugins/index_pattern_management/server/routes/index.ts rename to src/plugins/data_view_management/server/routes/index.ts diff --git a/src/plugins/index_pattern_management/server/routes/preview_scripted_field.test.ts b/src/plugins/data_view_management/server/routes/preview_scripted_field.test.ts similarity index 100% rename from src/plugins/index_pattern_management/server/routes/preview_scripted_field.test.ts rename to src/plugins/data_view_management/server/routes/preview_scripted_field.test.ts diff --git a/src/plugins/index_pattern_management/server/routes/preview_scripted_field.ts b/src/plugins/data_view_management/server/routes/preview_scripted_field.ts similarity index 100% rename from src/plugins/index_pattern_management/server/routes/preview_scripted_field.ts rename to src/plugins/data_view_management/server/routes/preview_scripted_field.ts diff --git a/src/plugins/index_pattern_management/server/routes/resolve_index.ts b/src/plugins/data_view_management/server/routes/resolve_index.ts similarity index 100% rename from src/plugins/index_pattern_management/server/routes/resolve_index.ts rename to src/plugins/data_view_management/server/routes/resolve_index.ts diff --git a/src/plugins/index_pattern_management/tsconfig.json b/src/plugins/data_view_management/tsconfig.json similarity index 83% rename from src/plugins/index_pattern_management/tsconfig.json rename to src/plugins/data_view_management/tsconfig.json index 2a719e98bea31..bde927aaf732b 100644 --- a/src/plugins/index_pattern_management/tsconfig.json +++ b/src/plugins/data_view_management/tsconfig.json @@ -18,7 +18,7 @@ { "path": "../kibana_react/tsconfig.json" }, { "path": "../kibana_utils/tsconfig.json" }, { "path": "../es_ui_shared/tsconfig.json" }, - { "path": "../index_pattern_field_editor/tsconfig.json" }, - { "path": "../index_pattern_editor/tsconfig.json" }, + { "path": "../data_view_field_editor/tsconfig.json" }, + { "path": "../data_view_editor/tsconfig.json" }, ] } diff --git a/src/plugins/data_views/common/data_views/data_view.ts b/src/plugins/data_views/common/data_views/data_view.ts index 8d3fcbf7d0ced..921a5897dd232 100644 --- a/src/plugins/data_views/common/data_views/data_view.ts +++ b/src/plugins/data_views/common/data_views/data_view.ts @@ -44,6 +44,14 @@ interface SavedObjectBody { type?: string; } +/** + * An interface representing a data view that is time based. + */ +export interface TimeBasedDataView extends DataView { + timeFieldName: NonNullable; + getTimeField: () => DataViewField; +} + export class DataView implements IIndexPattern { public id?: string; public title: string = ''; @@ -231,7 +239,6 @@ export class DataView implements IIndexPattern { * @param fieldType * @param lang * @deprecated use runtime field instead - * @removeBy 8.1 */ async addScriptedField(name: string, script: string, fieldType: string = 'string') { const scriptedFields = this.getScriptedFields(); @@ -262,7 +269,6 @@ export class DataView implements IIndexPattern { * Remove scripted field from field list * @param fieldName * @deprecated use runtime field instead - * @removeBy 8.1 */ removeScriptedField(fieldName: string) { @@ -274,8 +280,7 @@ export class DataView implements IIndexPattern { /** * - * @deprecated use runtime field instead - * @removeBy 8.1 + * @deprecated Will be removed when scripted fields are removed */ getNonScriptedFields() { return [...this.fields.getAll().filter((field) => !field.scripted)]; @@ -284,17 +289,16 @@ export class DataView implements IIndexPattern { /** * * @deprecated use runtime field instead - * @removeBy 8.1 */ getScriptedFields() { return [...this.fields.getAll().filter((field) => field.scripted)]; } - isTimeBased(): boolean { + isTimeBased(): this is TimeBasedDataView { return !!this.timeFieldName && (!this.fields || !!this.getTimeField()); } - isTimeNanosBased(): boolean { + isTimeNanosBased(): this is TimeBasedDataView { const timeField = this.getTimeField(); return !!(timeField && timeField.esTypes && timeField.esTypes.indexOf('date_nanos') !== -1); } diff --git a/src/plugins/data_views/common/index.ts b/src/plugins/data_views/common/index.ts index b3123df2597cc..25d2ddd874256 100644 --- a/src/plugins/data_views/common/index.ts +++ b/src/plugins/data_views/common/index.ts @@ -57,7 +57,7 @@ export type { export { DataViewType, IndexPatternType } from './types'; export type { IndexPatternsContract, DataViewsContract } from './data_views'; export { IndexPatternsService, DataViewsService } from './data_views'; -export type { IndexPatternListItem, DataViewListItem } from './data_views'; +export type { IndexPatternListItem, DataViewListItem, TimeBasedDataView } from './data_views'; export { IndexPattern, DataView } from './data_views'; export { DuplicateDataViewError, DataViewSavedObjectConflictError } from './errors'; export type { diff --git a/src/plugins/data_views/public/index.ts b/src/plugins/data_views/public/index.ts index 650d2132212f8..8e42e4c8b6b0f 100644 --- a/src/plugins/data_views/public/index.ts +++ b/src/plugins/data_views/public/index.ts @@ -16,7 +16,7 @@ export { export { onRedirectNoIndexPattern } from './data_views'; export type { IIndexPatternFieldList, TypeMeta } from '../common'; -export { IndexPatternField } from '../common'; +export { IndexPatternField, DataViewField } from '../common'; export type { IndexPatternsContract, DataViewsContract } from './data_views'; export { diff --git a/src/plugins/dev_tools/public/application.tsx b/src/plugins/dev_tools/public/application.tsx index 9351cdcdf54bf..a4fdaf28e0eb4 100644 --- a/src/plugins/dev_tools/public/application.tsx +++ b/src/plugins/dev_tools/public/application.tsx @@ -11,7 +11,7 @@ import { Observable } from 'rxjs'; import ReactDOM from 'react-dom'; import { HashRouter as Router, Switch, Route, Redirect } from 'react-router-dom'; import { EuiTab, EuiTabs, EuiToolTip, EuiBetaBadge } from '@elastic/eui'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { euiThemeVars } from '@kbn/ui-shared-deps-src/theme'; diff --git a/src/plugins/discover/kibana.json b/src/plugins/discover/kibana.json index 92871ca6d5e17..d0ff54290256e 100644 --- a/src/plugins/discover/kibana.json +++ b/src/plugins/discover/kibana.json @@ -13,7 +13,7 @@ "navigation", "uiActions", "savedObjects", - "indexPatternFieldEditor" + "dataViewFieldEditor" ], "optionalPlugins": ["home", "share", "usageCollection", "spaces"], "requiredBundles": ["kibanaUtils", "home", "kibanaReact", "dataViews"], diff --git a/src/plugins/discover/public/application/context/components/action_bar/action_bar.tsx b/src/plugins/discover/public/application/context/components/action_bar/action_bar.tsx index 4c1f7857e2b42..9b7ba6345111f 100644 --- a/src/plugins/discover/public/application/context/components/action_bar/action_bar.tsx +++ b/src/plugins/discover/public/application/context/components/action_bar/action_bar.tsx @@ -9,7 +9,7 @@ import './_action_bar.scss'; import React, { useState, useEffect } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, EuiFieldNumber, diff --git a/src/plugins/discover/public/application/context/components/action_bar/action_bar_warning.tsx b/src/plugins/discover/public/application/context/components/action_bar/action_bar_warning.tsx index 342485fe1f8c0..65ad945429ced 100644 --- a/src/plugins/discover/public/application/context/components/action_bar/action_bar_warning.tsx +++ b/src/plugins/discover/public/application/context/components/action_bar/action_bar_warning.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCallOut } from '@elastic/eui'; import { SurrDocType } from '../../services/context'; diff --git a/src/plugins/discover/public/application/context/components/context_error_message/context_error_message.tsx b/src/plugins/discover/public/application/context/components/context_error_message/context_error_message.tsx index fc05deeae7e51..e2f583dcf13a4 100644 --- a/src/plugins/discover/public/application/context/components/context_error_message/context_error_message.tsx +++ b/src/plugins/discover/public/application/context/components/context_error_message/context_error_message.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiCallOut, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { FailureReason, LoadingStatus, diff --git a/src/plugins/discover/public/application/context/context_app.tsx b/src/plugins/discover/public/application/context/context_app.tsx index 1bda31bd7bd27..96d4d3518c5b5 100644 --- a/src/plugins/discover/public/application/context/context_app.tsx +++ b/src/plugins/discover/public/application/context/context_app.tsx @@ -9,7 +9,7 @@ import React, { Fragment, memo, useEffect, useRef, useMemo, useCallback } from 'react'; import './context_app.scss'; import classNames from 'classnames'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiText, EuiPageContent, EuiPage, EuiSpacer } from '@elastic/eui'; import { cloneDeep } from 'lodash'; import { esFilters } from '../../../../data/public'; diff --git a/src/plugins/discover/public/application/context/context_app_content.tsx b/src/plugins/discover/public/application/context/context_app_content.tsx index 0d24e8129a8dd..f498c6f0a244d 100644 --- a/src/plugins/discover/public/application/context/context_app_content.tsx +++ b/src/plugins/discover/public/application/context/context_app_content.tsx @@ -7,7 +7,7 @@ */ import React, { useState, Fragment, useMemo, useCallback } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiHorizontalRule, EuiText } from '@elastic/eui'; import { CONTEXT_STEP_SETTING, DOC_HIDE_TIME_COLUMN_SETTING } from '../../../common'; import { IndexPattern } from '../../../../data/common'; diff --git a/src/plugins/discover/public/application/context/context_app_route.tsx b/src/plugins/discover/public/application/context/context_app_route.tsx index 9d47d211489b0..dfc318021b93e 100644 --- a/src/plugins/discover/public/application/context/context_app_route.tsx +++ b/src/plugins/discover/public/application/context/context_app_route.tsx @@ -9,7 +9,7 @@ import React, { useEffect } from 'react'; import { useParams } from 'react-router-dom'; import { i18n } from '@kbn/i18n'; import { EuiEmptyPrompt } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { DiscoverServices } from '../../build_services'; import { ContextApp } from './context_app'; import { getRootBreadcrumbs } from '../../utils/breadcrumbs'; diff --git a/src/plugins/discover/public/application/doc/components/doc.tsx b/src/plugins/discover/public/application/doc/components/doc.tsx index 3cb416ae8ef46..8742457ad7b82 100644 --- a/src/plugins/discover/public/application/doc/components/doc.tsx +++ b/src/plugins/discover/public/application/doc/components/doc.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCallOut, EuiLink, EuiLoadingSpinner, EuiPageContent, EuiPage } from '@elastic/eui'; import { IndexPattern } from 'src/plugins/data/public'; import { getServices } from '../../../kibana_services'; diff --git a/src/plugins/discover/public/application/doc/single_doc_route.tsx b/src/plugins/discover/public/application/doc/single_doc_route.tsx index b9887a6f16cdf..e5ddb784b9080 100644 --- a/src/plugins/discover/public/application/doc/single_doc_route.tsx +++ b/src/plugins/discover/public/application/doc/single_doc_route.tsx @@ -8,7 +8,7 @@ import React, { useEffect } from 'react'; import { useLocation, useParams } from 'react-router-dom'; import { EuiEmptyPrompt } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { DiscoverServices } from '../../build_services'; import { getRootBreadcrumbs } from '../../utils/breadcrumbs'; import { Doc } from './components/doc'; diff --git a/src/plugins/discover/public/application/main/components/chart/histogram.tsx b/src/plugins/discover/public/application/main/components/chart/histogram.tsx index 9bdf9dd61e703..5f488c5d658d4 100644 --- a/src/plugins/discover/public/application/main/components/chart/histogram.tsx +++ b/src/plugins/discover/public/application/main/components/chart/histogram.tsx @@ -16,7 +16,7 @@ import { EuiSpacer, EuiText, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import dateMath from '@elastic/datemath'; import { Axis, diff --git a/src/plugins/discover/public/application/components/field_stats_table/constants.ts b/src/plugins/discover/public/application/main/components/field_stats_table/constants.ts similarity index 100% rename from src/plugins/discover/public/application/components/field_stats_table/constants.ts rename to src/plugins/discover/public/application/main/components/field_stats_table/constants.ts diff --git a/src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx b/src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx similarity index 94% rename from src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx rename to src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx index 5061ab0ba3746..1ccb3fd9fa3f6 100644 --- a/src/plugins/discover/public/application/components/field_stats_table/field_stats_table.tsx +++ b/src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx @@ -9,19 +9,19 @@ import React, { useEffect, useMemo, useRef, useState } from 'react'; import type { Filter } from '@kbn/es-query'; import { METRIC_TYPE, UiCounterMetricType } from '@kbn/analytics'; -import { IndexPatternField, IndexPattern, DataView, Query } from '../../../../../data/common'; -import type { DiscoverServices } from '../../../build_services'; +import { IndexPatternField, IndexPattern, DataView, Query } from '../../../../../../data/common'; +import type { DiscoverServices } from '../../../../build_services'; import { EmbeddableInput, EmbeddableOutput, ErrorEmbeddable, IEmbeddable, isErrorEmbeddable, -} from '../../../../../embeddable/public'; +} from '../../../../../../embeddable/public'; import { FIELD_STATISTICS_LOADED } from './constants'; -import type { SavedSearch } from '../../../services/saved_searches'; -import type { GetStateReturn } from '../../main/services/discover_state'; -import { DataRefetch$ } from '../../main/utils/use_saved_search'; +import type { SavedSearch } from '../../../../services/saved_searches'; +import type { GetStateReturn } from '../../services/discover_state'; +import { DataRefetch$ } from '../../utils/use_saved_search'; export interface DataVisualizerGridEmbeddableInput extends EmbeddableInput { indexPattern: IndexPattern; diff --git a/src/plugins/discover/public/application/components/field_stats_table/field_stats_table_saved_search_embeddable.tsx b/src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table_saved_search_embeddable.tsx similarity index 95% rename from src/plugins/discover/public/application/components/field_stats_table/field_stats_table_saved_search_embeddable.tsx rename to src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table_saved_search_embeddable.tsx index 9c0c6f4e11609..7ffff24c143d0 100644 --- a/src/plugins/discover/public/application/components/field_stats_table/field_stats_table_saved_search_embeddable.tsx +++ b/src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table_saved_search_embeddable.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { FieldStatisticsTable, FieldStatisticsTableProps } from './field_stats_table'; export function FieldStatsTableSavedSearchEmbeddable(renderProps: FieldStatisticsTableProps) { diff --git a/src/plugins/discover/public/application/components/field_stats_table/index.ts b/src/plugins/discover/public/application/main/components/field_stats_table/index.ts similarity index 100% rename from src/plugins/discover/public/application/components/field_stats_table/index.ts rename to src/plugins/discover/public/application/main/components/field_stats_table/index.ts diff --git a/src/plugins/discover/public/application/main/components/hits_counter/hits_counter.tsx b/src/plugins/discover/public/application/main/components/hits_counter/hits_counter.tsx index 47c50f7bd47f5..1ae2b0942e248 100644 --- a/src/plugins/discover/public/application/main/components/hits_counter/hits_counter.tsx +++ b/src/plugins/discover/public/application/main/components/hits_counter/hits_counter.tsx @@ -15,7 +15,7 @@ import { EuiText, EuiLoadingSpinner, } from '@elastic/eui'; -import { FormattedMessage, FormattedNumber } from '@kbn/i18n/react'; +import { FormattedMessage, FormattedNumber } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { DataTotalHits$, DataTotalHitsMsg } from '../../utils/use_saved_search'; import { FetchStatus } from '../../../types'; diff --git a/src/plugins/discover/public/application/main/components/layout/discover_documents.tsx b/src/plugins/discover/public/application/main/components/layout/discover_documents.tsx index 08582b21a90ac..154f83796490b 100644 --- a/src/plugins/discover/public/application/main/components/layout/discover_documents.tsx +++ b/src/plugins/discover/public/application/main/components/layout/discover_documents.tsx @@ -13,7 +13,7 @@ import { EuiLoadingSpinner, EuiScreenReaderOnly, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { DocViewFilterFn, ElasticSearchHit } from '../../../../services/doc_views/doc_views_types'; import { DiscoverGrid } from '../../../../components/discover_grid/discover_grid'; import { FetchStatus } from '../../../types'; diff --git a/src/plugins/discover/public/application/main/components/layout/discover_layout.tsx b/src/plugins/discover/public/application/main/components/layout/discover_layout.tsx index d71e99fd2b9a8..39d8268de2d0b 100644 --- a/src/plugins/discover/public/application/main/components/layout/discover_layout.tsx +++ b/src/plugins/discover/public/application/main/components/layout/discover_layout.tsx @@ -43,12 +43,9 @@ import { SavedSearchURLConflictCallout, useSavedSearchAliasMatchRedirect, } from '../../../../services/saved_searches'; -import { FieldStatisticsTable } from '../../../components/field_stats_table'; +import { FieldStatisticsTable } from '../field_stats_table'; import { VIEW_MODE } from '../../../../components/view_mode_toggle'; -import { - DOCUMENTS_VIEW_CLICK, - FIELD_STATISTICS_VIEW_CLICK, -} from '../../../components/field_stats_table/constants'; +import { DOCUMENTS_VIEW_CLICK, FIELD_STATISTICS_VIEW_CLICK } from '../field_stats_table/constants'; import { DataViewType } from '../../../../../../data_views/common'; /** diff --git a/src/plugins/discover/public/application/main/components/loading_spinner/loading_spinner.tsx b/src/plugins/discover/public/application/main/components/loading_spinner/loading_spinner.tsx index 0d656ae30cb5a..949880d6c27d0 100644 --- a/src/plugins/discover/public/application/main/components/loading_spinner/loading_spinner.tsx +++ b/src/plugins/discover/public/application/main/components/loading_spinner/loading_spinner.tsx @@ -10,7 +10,7 @@ import './loading_spinner.scss'; import React from 'react'; import { EuiLoadingSpinner, EuiTitle, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function LoadingSpinner() { return ( diff --git a/src/plugins/discover/public/application/main/components/no_results/no_results.tsx b/src/plugins/discover/public/application/main/components/no_results/no_results.tsx index 558760f9c0035..aaaad49b1f611 100644 --- a/src/plugins/discover/public/application/main/components/no_results/no_results.tsx +++ b/src/plugins/discover/public/application/main/components/no_results/no_results.tsx @@ -7,7 +7,7 @@ */ import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiCallOut, diff --git a/src/plugins/discover/public/application/main/components/no_results/no_results_helper.tsx b/src/plugins/discover/public/application/main/components/no_results/no_results_helper.tsx index 25fff5f079619..dccb27d4becfd 100644 --- a/src/plugins/discover/public/application/main/components/no_results/no_results_helper.tsx +++ b/src/plugins/discover/public/application/main/components/no_results/no_results_helper.tsx @@ -7,7 +7,7 @@ */ import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescriptionList, EuiDescriptionListTitle, diff --git a/src/plugins/discover/public/application/main/components/sidebar/discover_field_details.tsx b/src/plugins/discover/public/application/main/components/sidebar/discover_field_details.tsx index af2a322d97806..c5a3e68e7bd79 100644 --- a/src/plugins/discover/public/application/main/components/sidebar/discover_field_details.tsx +++ b/src/plugins/discover/public/application/main/components/sidebar/discover_field_details.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiText, EuiSpacer, EuiLink } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { DiscoverFieldBucket } from './discover_field_bucket'; import { Bucket, FieldDetails } from './types'; import { IndexPatternField, IndexPattern } from '../../../../../../data/public'; diff --git a/src/plugins/discover/public/application/main/components/sidebar/discover_field_search.tsx b/src/plugins/discover/public/application/main/components/sidebar/discover_field_search.tsx index 4ab19a6ab05ef..67282ea2667ed 100644 --- a/src/plugins/discover/public/application/main/components/sidebar/discover_field_search.tsx +++ b/src/plugins/discover/public/application/main/components/sidebar/discover_field_search.tsx @@ -28,7 +28,7 @@ import { EuiFilterButton, EuiSpacer, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export interface State { searchable: string; diff --git a/src/plugins/discover/public/application/main/components/sidebar/discover_field_visualize.tsx b/src/plugins/discover/public/application/main/components/sidebar/discover_field_visualize.tsx index e974a67aef60d..381edefb503c7 100644 --- a/src/plugins/discover/public/application/main/components/sidebar/discover_field_visualize.tsx +++ b/src/plugins/discover/public/application/main/components/sidebar/discover_field_visualize.tsx @@ -8,7 +8,7 @@ import React, { useEffect, useState } from 'react'; import { EuiButton } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { METRIC_TYPE, UiCounterMetricType } from '@kbn/analytics'; import type { IndexPattern, IndexPatternField } from 'src/plugins/data/common'; diff --git a/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar.tsx b/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar.tsx index fcc4d32151018..3b4ff997f324e 100644 --- a/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar.tsx +++ b/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar.tsx @@ -24,7 +24,7 @@ import { import useShallowCompareEffect from 'react-use/lib/useShallowCompareEffect'; import { isEqual, sortBy } from 'lodash'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { DiscoverField } from './discover_field'; import { DiscoverIndexPattern } from './discover_index_pattern'; import { DiscoverFieldSearch } from './discover_field_search'; @@ -247,7 +247,7 @@ export function DiscoverSidebarComponent({ ? async (fieldName: string) => { const ref = indexPatternFieldEditor.openDeleteModal({ ctx: { - indexPattern: selectedIndexPattern, + dataView: selectedIndexPattern, }, fieldName, onDelete: async () => { diff --git a/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.tsx b/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.tsx index 1df3044b81bf8..a4e84bd831619 100644 --- a/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.tsx +++ b/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.tsx @@ -9,7 +9,7 @@ import React, { useEffect, useRef, useState, useCallback } from 'react'; import { sortBy } from 'lodash'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { UiCounterMetricType } from '@kbn/analytics'; import { EuiTitle, @@ -192,7 +192,7 @@ export function DiscoverSidebarResponsive(props: DiscoverSidebarResponsiveProps) } const ref = indexPatternFieldEditor.openEditor({ ctx: { - indexPattern: selectedIndexPattern, + dataView: selectedIndexPattern, }, fieldName, onSave: async () => { diff --git a/src/plugins/discover/public/application/main/components/skip_bottom_button/skip_bottom_button.tsx b/src/plugins/discover/public/application/main/components/skip_bottom_button/skip_bottom_button.tsx index 398fcfbc41140..1f1d63ae7647d 100644 --- a/src/plugins/discover/public/application/main/components/skip_bottom_button/skip_bottom_button.tsx +++ b/src/plugins/discover/public/application/main/components/skip_bottom_button/skip_bottom_button.tsx @@ -9,7 +9,7 @@ import React from 'react'; import './skip_bottom_button.scss'; import { EuiSkipLink } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export interface SkipBottomButtonProps { /** diff --git a/src/plugins/discover/public/application/main/components/top_nav/open_options_popover.tsx b/src/plugins/discover/public/application/main/components/top_nav/open_options_popover.tsx index a68888acb1f48..0d359c865220f 100644 --- a/src/plugins/discover/public/application/main/components/top_nav/open_options_popover.tsx +++ b/src/plugins/discover/public/application/main/components/top_nav/open_options_popover.tsx @@ -10,7 +10,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { I18nStart } from 'kibana/public'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiSpacer, EuiButton, diff --git a/src/plugins/discover/public/application/main/components/top_nav/open_search_panel.tsx b/src/plugins/discover/public/application/main/components/top_nav/open_search_panel.tsx index e5a175f0511da..ce6d151261243 100644 --- a/src/plugins/discover/public/application/main/components/top_nav/open_search_panel.tsx +++ b/src/plugins/discover/public/application/main/components/top_nav/open_search_panel.tsx @@ -9,7 +9,7 @@ import React from 'react'; import rison from 'rison-node'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiFlexGroup, diff --git a/src/plugins/discover/public/application/main/components/total_documents/total_documents.tsx b/src/plugins/discover/public/application/main/components/total_documents/total_documents.tsx index 13365b28b7ac1..f30d294bd40eb 100644 --- a/src/plugins/discover/public/application/main/components/total_documents/total_documents.tsx +++ b/src/plugins/discover/public/application/main/components/total_documents/total_documents.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiText } from '@elastic/eui'; export const TotalDocuments = ({ totalHitCount }: { totalHitCount: number }) => { diff --git a/src/plugins/discover/public/application/main/components/uninitialized/uninitialized.tsx b/src/plugins/discover/public/application/main/components/uninitialized/uninitialized.tsx index 6c1b1bfc87d20..df94010154a75 100644 --- a/src/plugins/discover/public/application/main/components/uninitialized/uninitialized.tsx +++ b/src/plugins/discover/public/application/main/components/uninitialized/uninitialized.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiEmptyPrompt } from '@elastic/eui'; interface Props { diff --git a/src/plugins/discover/public/application/main/services/discover_search_session.ts b/src/plugins/discover/public/application/main/services/discover_search_session.ts index 41e1ad37a353c..cace655a82a0f 100644 --- a/src/plugins/discover/public/application/main/services/discover_search_session.ts +++ b/src/plugins/discover/public/application/main/services/discover_search_session.ts @@ -7,6 +7,7 @@ */ import { History } from 'history'; +import * as Rx from 'rxjs'; import { filter } from 'rxjs/operators'; import { DataPublicPluginStart } from '../../../../../data/public'; import { @@ -29,17 +30,19 @@ export class DiscoverSearchSessionManager { * Notifies about `searchSessionId` changes in the URL, * skips if `searchSessionId` matches current search session id */ - readonly newSearchSessionIdFromURL$ = createQueryParamObservable( - this.deps.history, - SEARCH_SESSION_ID_QUERY_PARAM - ).pipe( - filter((searchSessionId) => { - if (!searchSessionId) return true; - return !this.deps.session.isCurrentSession(searchSessionId); - }) - ); + readonly newSearchSessionIdFromURL$: Rx.Observable; - constructor(private readonly deps: DiscoverSearchSessionManagerDeps) {} + constructor(private readonly deps: DiscoverSearchSessionManagerDeps) { + this.newSearchSessionIdFromURL$ = createQueryParamObservable( + this.deps.history, + SEARCH_SESSION_ID_QUERY_PARAM + ).pipe( + filter((searchSessionId) => { + if (!searchSessionId) return true; + return !this.deps.session.isCurrentSession(searchSessionId); + }) + ); + } /** * Get next session id by either starting or restoring a session. diff --git a/src/plugins/discover/public/application/main/utils/get_switch_index_pattern_app_state.test.ts b/src/plugins/discover/public/application/main/utils/get_switch_index_pattern_app_state.test.ts index 412ad060b5565..d37ccb808c966 100644 --- a/src/plugins/discover/public/application/main/utils/get_switch_index_pattern_app_state.test.ts +++ b/src/plugins/discover/public/application/main/utils/get_switch_index_pattern_app_state.test.ts @@ -16,6 +16,9 @@ const getIndexPattern = (id: string, timeFieldName: string, fields: string[]) => return { id, timeFieldName, + isTimeBased() { + return !!timeFieldName; + }, getFieldByName(name) { return this.fields.getByName(name); }, @@ -98,4 +101,12 @@ describe('Discover getSwitchIndexPatternAppState', () => { expect(result.columns).toEqual([]); expect(result.sort).toEqual([['timeFieldA', 'desc']]); }); + test('should change sorting for similar index patterns', async () => { + const current = getIndexPattern('timebased', 'timefield', ['timefield']); + const next = getIndexPattern('timebased2', 'timefield2', ['timefield', 'timefield2']); + + const result = getSwitchIndexPatternAppState(current, next, [], [['timefield', 'desc']]); + expect(result.columns).toEqual([]); + expect(result.sort).toEqual([['timefield2', 'desc']]); + }); }); diff --git a/src/plugins/discover/public/application/main/utils/get_switch_index_pattern_app_state.ts b/src/plugins/discover/public/application/main/utils/get_switch_index_pattern_app_state.ts index b6dfe7a63f3a8..6da410908c650 100644 --- a/src/plugins/discover/public/application/main/utils/get_switch_index_pattern_app_state.ts +++ b/src/plugins/discover/public/application/main/utils/get_switch_index_pattern_app_state.ts @@ -28,19 +28,32 @@ export function getSwitchIndexPatternAppState( ) : currentColumns; const columns = nextColumns.length ? nextColumns : []; + // when switching from an index pattern with timeField to an index pattern without timeField // filter out sorting by timeField in case it is set. index patterns without timeField don't // prepend this field in the table, so in legacy grid you would need to add this column to // remove sorting - const nextSort = getSortArray(currentSort, nextIndexPattern).filter((value) => { + let nextSort = getSortArray(currentSort, nextIndexPattern).filter((value) => { return nextIndexPattern.timeFieldName || value[0] !== currentIndexPattern.timeFieldName; }); + + if (nextIndexPattern.isTimeBased() && !nextSort.length) { + // set default sorting if it was not set + nextSort = [[nextIndexPattern.timeFieldName, sortDirection]]; + } else if ( + nextIndexPattern.isTimeBased() && + currentIndexPattern.isTimeBased() && + nextIndexPattern.timeFieldName !== currentIndexPattern.timeFieldName + ) { + // switch time fields + nextSort = nextSort.map((cur) => + cur[0] === currentIndexPattern.timeFieldName ? [nextIndexPattern.timeFieldName, cur[1]] : cur + ); + } + return { index: nextIndexPattern.id, columns, - sort: - nextIndexPattern.timeFieldName && !nextSort.length - ? [[nextIndexPattern.timeFieldName, sortDirection]] - : nextSort, + sort: nextSort, }; } diff --git a/src/plugins/discover/public/application/not_found/not_found_route.tsx b/src/plugins/discover/public/application/not_found/not_found_route.tsx index 4848248a7509d..80e4e5c8057f6 100644 --- a/src/plugins/discover/public/application/not_found/not_found_route.tsx +++ b/src/plugins/discover/public/application/not_found/not_found_route.tsx @@ -8,7 +8,7 @@ import React, { useEffect } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiCallOut } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Redirect } from 'react-router-dom'; import { toMountPoint } from '../../../../kibana_react/public'; import { DiscoverServices } from '../../build_services'; diff --git a/src/plugins/discover/public/build_services.ts b/src/plugins/discover/public/build_services.ts index 6003411e647c5..b86212251cb74 100644 --- a/src/plugins/discover/public/build_services.ts +++ b/src/plugins/discover/public/build_services.ts @@ -34,7 +34,7 @@ import { DiscoverStartPlugins } from './plugin'; import { getHistory } from './kibana_services'; import { UrlForwardingStart } from '../../url_forwarding/public'; import { NavigationPublicPluginStart } from '../../navigation/public'; -import { IndexPatternFieldEditorStart } from '../../index_pattern_field_editor/public'; +import { IndexPatternFieldEditorStart } from '../../data_view_field_editor/public'; import { FieldFormatsStart } from '../../field_formats/public'; import { EmbeddableStart } from '../../embeddable/public'; @@ -101,7 +101,7 @@ export function buildServices( uiSettings: core.uiSettings, storage, trackUiMetric: usageCollection?.reportUiCounter.bind(usageCollection, 'discover'), - indexPatternFieldEditor: plugins.indexPatternFieldEditor, + indexPatternFieldEditor: plugins.dataViewFieldEditor, http: core.http, spaces: plugins.spaces, }; diff --git a/src/plugins/discover/public/components/discover_grid/discover_grid.tsx b/src/plugins/discover/public/components/discover_grid/discover_grid.tsx index 9bcc0f90f9259..f0e0513c7748c 100644 --- a/src/plugins/discover/public/components/discover_grid/discover_grid.tsx +++ b/src/plugins/discover/public/components/discover_grid/discover_grid.tsx @@ -7,7 +7,7 @@ */ import React, { useCallback, useMemo, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import './discover_grid.scss'; import { EuiDataGridSorting, diff --git a/src/plugins/discover/public/components/discover_grid/discover_grid_document_selection.tsx b/src/plugins/discover/public/components/discover_grid/discover_grid_document_selection.tsx index b1fc8993375da..c517d3a65b6b9 100644 --- a/src/plugins/discover/public/components/discover_grid/discover_grid_document_selection.tsx +++ b/src/plugins/discover/public/components/discover_grid/discover_grid_document_selection.tsx @@ -16,7 +16,7 @@ import { EuiCheckbox, EuiDataGridCellValueElementProps, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { euiLightVars as themeLight, euiDarkVars as themeDark, diff --git a/src/plugins/discover/public/components/doc_table/components/pager/tool_bar_pagination.tsx b/src/plugins/discover/public/components/doc_table/components/pager/tool_bar_pagination.tsx index ae5d2fa32ea65..1b07eb89b3e23 100644 --- a/src/plugins/discover/public/components/doc_table/components/pager/tool_bar_pagination.tsx +++ b/src/plugins/discover/public/components/doc_table/components/pager/tool_bar_pagination.tsx @@ -16,7 +16,7 @@ import { EuiPagination, EuiPopover, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { euiLightVars } from '@kbn/ui-shared-deps-src/theme'; diff --git a/src/plugins/discover/public/components/doc_table/components/table_row_details.tsx b/src/plugins/discover/public/components/doc_table/components/table_row_details.tsx index 02d0ee4f2272a..87cb32f593f9e 100644 --- a/src/plugins/discover/public/components/doc_table/components/table_row_details.tsx +++ b/src/plugins/discover/public/components/doc_table/components/table_row_details.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiLink, EuiTitle } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; interface TableRowDetailsProps { open: boolean; colLength: number; diff --git a/src/plugins/discover/public/components/doc_table/create_doc_table_embeddable.tsx b/src/plugins/discover/public/components/doc_table/create_doc_table_embeddable.tsx index c745fbf64d294..f44d652595ac9 100644 --- a/src/plugins/discover/public/components/doc_table/create_doc_table_embeddable.tsx +++ b/src/plugins/discover/public/components/doc_table/create_doc_table_embeddable.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { DocTableEmbeddable, DocTableEmbeddableProps } from './doc_table_embeddable'; export function DiscoverDocTableEmbeddable(renderProps: DocTableEmbeddableProps) { diff --git a/src/plugins/discover/public/components/doc_table/doc_table_embeddable.tsx b/src/plugins/discover/public/components/doc_table/doc_table_embeddable.tsx index 0743c5ef813e8..6da42bc53442d 100644 --- a/src/plugins/discover/public/components/doc_table/doc_table_embeddable.tsx +++ b/src/plugins/discover/public/components/doc_table/doc_table_embeddable.tsx @@ -8,7 +8,7 @@ import React, { memo, useCallback, useEffect, useMemo, useRef } from 'react'; import './index.scss'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; import { SAMPLE_SIZE_SETTING } from '../../../common'; import { usePager } from './lib/use_pager'; diff --git a/src/plugins/discover/public/components/doc_table/doc_table_infinite.tsx b/src/plugins/discover/public/components/doc_table/doc_table_infinite.tsx index d2e93cdae452e..c43e65f405339 100644 --- a/src/plugins/discover/public/components/doc_table/doc_table_infinite.tsx +++ b/src/plugins/discover/public/components/doc_table/doc_table_infinite.tsx @@ -8,7 +8,7 @@ import React, { Fragment, memo, useCallback, useEffect, useRef, useState } from 'react'; import './index.scss'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { debounce } from 'lodash'; import { EuiButtonEmpty } from '@elastic/eui'; import { DocTableProps, DocTableRenderProps, DocTableWrapper } from './doc_table_wrapper'; diff --git a/src/plugins/discover/public/components/doc_table/doc_table_wrapper.tsx b/src/plugins/discover/public/components/doc_table/doc_table_wrapper.tsx index 139b835e2e5c4..64e5b29ac21aa 100644 --- a/src/plugins/discover/public/components/doc_table/doc_table_wrapper.tsx +++ b/src/plugins/discover/public/components/doc_table/doc_table_wrapper.tsx @@ -9,7 +9,7 @@ import React, { forwardRef, useCallback, useMemo } from 'react'; import { EuiIcon, EuiSpacer, EuiText } from '@elastic/eui'; import type { IndexPattern, IndexPatternField } from 'src/plugins/data/common'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { TableHeader } from './components/table_header/table_header'; import { FORMATS_UI_SETTINGS } from '../../../../field_formats/common'; import { diff --git a/src/plugins/discover/public/components/field_name/field_name.tsx b/src/plugins/discover/public/components/field_name/field_name.tsx index 918cf7166dce4..02d7c6f082db3 100644 --- a/src/plugins/discover/public/components/field_name/field_name.tsx +++ b/src/plugins/discover/public/components/field_name/field_name.tsx @@ -9,7 +9,7 @@ import React, { Fragment } from 'react'; import './field_name.scss'; import { EuiBadge, EuiFlexGroup, EuiFlexItem, EuiToolTip } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { FieldIcon, FieldIconProps } from '@kbn/react-field/field_icon'; import { getFieldTypeName } from './field_type_name'; diff --git a/src/plugins/discover/public/components/view_mode_toggle/view_mode_toggle.tsx b/src/plugins/discover/public/components/view_mode_toggle/view_mode_toggle.tsx index 3aa24c05e98d4..7c3610b45dc13 100644 --- a/src/plugins/discover/public/components/view_mode_toggle/view_mode_toggle.tsx +++ b/src/plugins/discover/public/components/view_mode_toggle/view_mode_toggle.tsx @@ -9,7 +9,7 @@ import { EuiButtonGroup, EuiBetaBadge } from '@elastic/eui'; import React, { useMemo } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { VIEW_MODE } from './constants'; import './_index.scss'; diff --git a/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx b/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx index c04e6515cfbe1..7146f84e194e2 100644 --- a/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx +++ b/src/plugins/discover/public/embeddable/saved_search_embeddable.tsx @@ -47,7 +47,7 @@ import { getDefaultSort } from '../components/doc_table'; import { SortOrder } from '../components/doc_table/components/table_header/helpers'; import { VIEW_MODE } from '../components/view_mode_toggle'; import { updateSearchSource } from './utils/update_search_source'; -import { FieldStatsTableSavedSearchEmbeddable } from '../application/components/field_stats_table'; +import { FieldStatsTableSavedSearchEmbeddable } from '../application/main/components/field_stats_table'; export type SearchProps = Partial & Partial & { diff --git a/src/plugins/discover/public/embeddable/saved_search_grid.tsx b/src/plugins/discover/public/embeddable/saved_search_grid.tsx index e4d4bf64a74f1..a28e509d3ba72 100644 --- a/src/plugins/discover/public/embeddable/saved_search_grid.tsx +++ b/src/plugins/discover/public/embeddable/saved_search_grid.tsx @@ -6,7 +6,7 @@ * Side Public License, v 1. */ import React, { useState } from 'react'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { DiscoverGrid, DiscoverGridProps } from '../components/discover_grid/discover_grid'; import { getServices } from '../kibana_services'; diff --git a/src/plugins/discover/public/plugin.tsx b/src/plugins/discover/public/plugin.tsx index ec95a82a5088e..cb1ac2fad4f61 100644 --- a/src/plugins/discover/public/plugin.tsx +++ b/src/plugins/discover/public/plugin.tsx @@ -56,7 +56,7 @@ import { DiscoverAppLocatorDefinition, DiscoverAppLocator } from './locator'; import { SearchEmbeddableFactory } from './embeddable'; import { UsageCollectionSetup } from '../../usage_collection/public'; import { replaceUrlHashQuery } from '../../kibana_utils/public/'; -import { IndexPatternFieldEditorStart } from '../../../plugins/index_pattern_field_editor/public'; +import { IndexPatternFieldEditorStart } from '../../../plugins/data_view_field_editor/public'; import { DeferredSpinner } from './components'; import { ViewSavedSearchAction } from './embeddable/view_saved_search_action'; import type { SpacesPluginStart } from '../../../../x-pack/plugins/spaces/public'; @@ -184,7 +184,7 @@ export interface DiscoverStartPlugins { inspector: InspectorPublicPluginStart; savedObjects: SavedObjectsStart; usageCollection?: UsageCollectionSetup; - indexPatternFieldEditor: IndexPatternFieldEditorStart; + dataViewFieldEditor: IndexPatternFieldEditorStart; spaces?: SpacesPluginStart; } diff --git a/src/plugins/discover/public/services/doc_views/components/doc_viewer/doc_viewer.tsx b/src/plugins/discover/public/services/doc_views/components/doc_viewer/doc_viewer.tsx index 9b627b1569275..db96cf2f8950b 100644 --- a/src/plugins/discover/public/services/doc_views/components/doc_viewer/doc_viewer.tsx +++ b/src/plugins/discover/public/services/doc_views/components/doc_viewer/doc_viewer.tsx @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -import './doc_viewer.scss'; import React from 'react'; import { EuiTabbedContent } from '@elastic/eui'; import { getDocViewsRegistry } from '../../../../kibana_services'; diff --git a/src/plugins/discover/public/services/doc_views/components/doc_viewer_source/source.tsx b/src/plugins/discover/public/services/doc_views/components/doc_viewer_source/source.tsx index c0475a24489c7..1c71472375b18 100644 --- a/src/plugins/discover/public/services/doc_views/components/doc_viewer_source/source.tsx +++ b/src/plugins/discover/public/services/doc_views/components/doc_viewer_source/source.tsx @@ -8,7 +8,7 @@ import './source.scss'; import React, { useEffect, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { monaco } from '@kbn/monaco'; import { EuiButton, EuiEmptyPrompt, EuiLoadingSpinner, EuiSpacer, EuiText } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; diff --git a/src/plugins/discover/public/services/doc_views/components/doc_viewer/doc_viewer.scss b/src/plugins/discover/public/services/doc_views/components/doc_viewer_table/table.scss similarity index 95% rename from src/plugins/discover/public/services/doc_views/components/doc_viewer/doc_viewer.scss rename to src/plugins/discover/public/services/doc_views/components/doc_viewer_table/table.scss index 16712ae8dbb78..df8498449aa59 100644 --- a/src/plugins/discover/public/services/doc_views/components/doc_viewer/doc_viewer.scss +++ b/src/plugins/discover/public/services/doc_views/components/doc_viewer_table/table.scss @@ -62,7 +62,3 @@ color: $euiColorFullShade; vertical-align: top; } - -.kbnDocViewer__warning { - margin-right: $euiSizeS; -} diff --git a/src/plugins/discover/public/services/doc_views/components/doc_viewer_table/table.tsx b/src/plugins/discover/public/services/doc_views/components/doc_viewer_table/table.tsx index 08cd0306f8759..707a98d87c924 100644 --- a/src/plugins/discover/public/services/doc_views/components/doc_viewer_table/table.tsx +++ b/src/plugins/discover/public/services/doc_views/components/doc_viewer_table/table.tsx @@ -6,6 +6,7 @@ * Side Public License, v 1. */ +import './table.scss'; import React, { useCallback, useMemo } from 'react'; import { EuiInMemoryTable } from '@elastic/eui'; import { IndexPattern, IndexPatternField } from '../../../../../../data/public'; diff --git a/src/plugins/discover/public/services/doc_views/components/doc_viewer_table/table_columns.tsx b/src/plugins/discover/public/services/doc_views/components/doc_viewer_table/table_columns.tsx index 0cd6a861b715b..a95db63af00b1 100644 --- a/src/plugins/discover/public/services/doc_views/components/doc_viewer_table/table_columns.tsx +++ b/src/plugins/discover/public/services/doc_views/components/doc_viewer_table/table_columns.tsx @@ -8,7 +8,7 @@ import { EuiBasicTableColumn, EuiText } from '@elastic/eui'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { FieldName } from '../../../../components/field_name/field_name'; import { FieldRecord } from './table'; import { TableActions } from './table_cell_actions'; diff --git a/src/plugins/discover/public/services/doc_views/components/doc_viewer_table/table_row_btn_filter_add.tsx b/src/plugins/discover/public/services/doc_views/components/doc_viewer_table/table_row_btn_filter_add.tsx index de56d733442d6..ac3768cb96ecd 100644 --- a/src/plugins/discover/public/services/doc_views/components/doc_viewer_table/table_row_btn_filter_add.tsx +++ b/src/plugins/discover/public/services/doc_views/components/doc_viewer_table/table_row_btn_filter_add.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiToolTip, EuiButtonIcon } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; diff --git a/src/plugins/discover/public/services/doc_views/components/doc_viewer_table/table_row_btn_filter_exists.tsx b/src/plugins/discover/public/services/doc_views/components/doc_viewer_table/table_row_btn_filter_exists.tsx index 6eb37c2fb1855..c69ded85cce2c 100644 --- a/src/plugins/discover/public/services/doc_views/components/doc_viewer_table/table_row_btn_filter_exists.tsx +++ b/src/plugins/discover/public/services/doc_views/components/doc_viewer_table/table_row_btn_filter_exists.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiToolTip, EuiButtonIcon } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; diff --git a/src/plugins/discover/public/services/doc_views/components/doc_viewer_table/table_row_btn_filter_remove.tsx b/src/plugins/discover/public/services/doc_views/components/doc_viewer_table/table_row_btn_filter_remove.tsx index 9875eb411d0e4..bfde1318ce91c 100644 --- a/src/plugins/discover/public/services/doc_views/components/doc_viewer_table/table_row_btn_filter_remove.tsx +++ b/src/plugins/discover/public/services/doc_views/components/doc_viewer_table/table_row_btn_filter_remove.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiToolTip, EuiButtonIcon } from '@elastic/eui'; diff --git a/src/plugins/discover/public/services/doc_views/components/doc_viewer_table/table_row_btn_toggle_column.tsx b/src/plugins/discover/public/services/doc_views/components/doc_viewer_table/table_row_btn_toggle_column.tsx index dfaf6986022cc..2032554c6cc54 100644 --- a/src/plugins/discover/public/services/doc_views/components/doc_viewer_table/table_row_btn_toggle_column.tsx +++ b/src/plugins/discover/public/services/doc_views/components/doc_viewer_table/table_row_btn_toggle_column.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiToolTip, EuiButtonIcon } from '@elastic/eui'; diff --git a/src/plugins/discover/tsconfig.json b/src/plugins/discover/tsconfig.json index 86534268c578a..961d265ab7ff9 100644 --- a/src/plugins/discover/tsconfig.json +++ b/src/plugins/discover/tsconfig.json @@ -22,7 +22,7 @@ { "path": "../usage_collection/tsconfig.json" }, { "path": "../kibana_utils/tsconfig.json" }, { "path": "../kibana_react/tsconfig.json" }, - { "path": "../index_pattern_field_editor/tsconfig.json"}, + { "path": "../data_view_field_editor/tsconfig.json"}, { "path": "../field_formats/tsconfig.json" }, { "path": "../data_views/tsconfig.json" }, { "path": "../../../x-pack/plugins/spaces/tsconfig.json" } diff --git a/src/plugins/embeddable/public/index.ts b/src/plugins/embeddable/public/index.ts index 6a6b5b2df2ddd..c6beccd5e3365 100644 --- a/src/plugins/embeddable/public/index.ts +++ b/src/plugins/embeddable/public/index.ts @@ -35,6 +35,7 @@ export type { EmbeddableEditorState, EmbeddablePackageState, EmbeddableRendererProps, + EmbeddableContainerContext, } from './lib'; export { ACTION_ADD_PANEL, diff --git a/src/plugins/embeddable/public/lib/actions/edit_panel_action.test.tsx b/src/plugins/embeddable/public/lib/actions/edit_panel_action.test.tsx index 1731907288460..a8c54ca8cdc33 100644 --- a/src/plugins/embeddable/public/lib/actions/edit_panel_action.test.tsx +++ b/src/plugins/embeddable/public/lib/actions/edit_panel_action.test.tsx @@ -44,7 +44,13 @@ test('is compatible when edit url is available, in edit mode and editable', asyn test('redirects to app using state transfer with by value mode', async () => { applicationMock.currentAppId$ = of('superCoolCurrentApp'); - const action = new EditPanelAction(getFactory, applicationMock, stateTransferMock); + const testPath = '/test-path'; + const action = new EditPanelAction( + getFactory, + applicationMock, + stateTransferMock, + () => testPath + ); const embeddable = new EditableEmbeddable( { id: '123', @@ -67,13 +73,20 @@ test('redirects to app using state transfer with by value mode', async () => { coolInput1: 1, coolInput2: 2, }, + originatingPath: testPath, }, }); }); test('redirects to app using state transfer without by value mode', async () => { applicationMock.currentAppId$ = of('superCoolCurrentApp'); - const action = new EditPanelAction(getFactory, applicationMock, stateTransferMock); + const testPath = '/test-path'; + const action = new EditPanelAction( + getFactory, + applicationMock, + stateTransferMock, + () => testPath + ); const embeddable = new EditableEmbeddable( { id: '123', viewMode: ViewMode.EDIT, savedObjectId: '1234' } as SavedObjectEmbeddableInput, true @@ -86,6 +99,7 @@ test('redirects to app using state transfer without by value mode', async () => originatingApp: 'superCoolCurrentApp', embeddableId: '123', valueInput: undefined, + originatingPath: testPath, }, }); }); diff --git a/src/plugins/embeddable/public/lib/actions/edit_panel_action.ts b/src/plugins/embeddable/public/lib/actions/edit_panel_action.ts index ea90307ef57a1..fde5c2ae62bc0 100644 --- a/src/plugins/embeddable/public/lib/actions/edit_panel_action.ts +++ b/src/plugins/embeddable/public/lib/actions/edit_panel_action.ts @@ -43,7 +43,8 @@ export class EditPanelAction implements Action { constructor( private readonly getEmbeddableFactory: EmbeddableStart['getEmbeddableFactory'], private readonly application: ApplicationStart, - private readonly stateTransfer?: EmbeddableStateTransfer + private readonly stateTransfer?: EmbeddableStateTransfer, + private readonly getOriginatingPath?: () => string ) { if (this.application?.currentAppId$) { this.application.currentAppId$ @@ -104,15 +105,21 @@ export class EditPanelAction implements Action { public getAppTarget({ embeddable }: ActionContext): NavigationContext | undefined { const app = embeddable ? embeddable.getOutput().editApp : undefined; const path = embeddable ? embeddable.getOutput().editPath : undefined; + if (app && path) { if (this.currentAppId) { const byValueMode = !(embeddable.getInput() as SavedObjectEmbeddableInput).savedObjectId; + + const originatingPath = this.getOriginatingPath?.(); + const state: EmbeddableEditorState = { originatingApp: this.currentAppId, valueInput: byValueMode ? this.getExplicitInput({ embeddable }) : undefined, embeddableId: embeddable.id, searchSessionId: embeddable.getInput().searchSessionId, + originatingPath, }; + return { app, path, state }; } return { app, path }; diff --git a/src/plugins/embeddable/public/lib/panel/embeddable_panel.test.tsx b/src/plugins/embeddable/public/lib/panel/embeddable_panel.test.tsx index 1b3e0388e9bb0..78bd337b21e52 100644 --- a/src/plugins/embeddable/public/lib/panel/embeddable_panel.test.tsx +++ b/src/plugins/embeddable/public/lib/panel/embeddable_panel.test.tsx @@ -11,7 +11,7 @@ import { mount } from 'enzyme'; import { mountWithIntl, nextTick } from '@kbn/test/jest'; import { findTestSubject } from '@elastic/eui/lib/test'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { CONTEXT_MENU_TRIGGER } from '../triggers'; import { Action, UiActionsStart } from '../../../../ui_actions/public'; import { Trigger, ViewMode } from '../types'; diff --git a/src/plugins/embeddable/public/lib/panel/embeddable_panel.tsx b/src/plugins/embeddable/public/lib/panel/embeddable_panel.tsx index cce286bfe73b4..9807a47698a50 100644 --- a/src/plugins/embeddable/public/lib/panel/embeddable_panel.tsx +++ b/src/plugins/embeddable/public/lib/panel/embeddable_panel.tsx @@ -53,6 +53,18 @@ const removeById = ({ id }: { id: string }) => disabledActions.indexOf(id) === -1; +/** + * Embeddable container may provide information about its environment, + * Use it for drilling down data that is static or doesn't have to be reactive, + * otherwise prefer passing data with input$ + * */ +export interface EmbeddableContainerContext { + /** + * Current app's path including query and hash starting from {appId} + */ + getCurrentPath?: () => string; +} + interface Props { embeddable: IEmbeddable; getActions: UiActionsService['getTriggerCompatibleActions']; @@ -70,6 +82,7 @@ interface Props { showShadow?: boolean; showBadges?: boolean; showNotifications?: boolean; + containerContext?: EmbeddableContainerContext; } interface State { @@ -373,7 +386,8 @@ export class EmbeddablePanel extends React.Component { editPanel: new EditPanelAction( this.props.getEmbeddableFactory, this.props.application, - this.props.stateTransfer + this.props.stateTransfer, + this.props.containerContext?.getCurrentPath ), }; }; diff --git a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.tsx b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.tsx index 30c8eb58e4bb7..a392502251039 100644 --- a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.tsx +++ b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.tsx @@ -7,7 +7,7 @@ */ import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { ReactElement } from 'react'; import { METRIC_TYPE } from '@kbn/analytics'; import { CoreSetup, SavedObjectAttributes, SimpleSavedObject, Toast } from 'src/core/public'; diff --git a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/saved_object_finder_create_new.tsx b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/saved_object_finder_create_new.tsx index 27f8fc8c79dc6..26bca1c4f3df2 100644 --- a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/saved_object_finder_create_new.tsx +++ b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/saved_object_finder_create_new.tsx @@ -10,7 +10,7 @@ import React, { ReactElement, useState } from 'react'; import { EuiButton } from '@elastic/eui'; import { EuiContextMenuPanel } from '@elastic/eui'; import { EuiPopover } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; interface Props { menuItems: ReactElement[]; diff --git a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_panel_modal.tsx b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_panel_modal.tsx index feabc107dcf3d..34acdf6fd1cb1 100644 --- a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_panel_modal.tsx +++ b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_panel_modal.tsx @@ -21,7 +21,7 @@ import { EuiFocusTrap, EuiOutsideClickDetector, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { IEmbeddable } from '../../../../'; diff --git a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_title_form.tsx b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_title_form.tsx index 073753d10700e..f54eb4125326f 100644 --- a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_title_form.tsx +++ b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_title/customize_title_form.tsx @@ -9,7 +9,7 @@ import React, { ChangeEvent } from 'react'; import { EuiButtonEmpty, EuiFieldText, EuiFormRow } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; export interface PanelOptionsMenuFormProps { diff --git a/src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world_container.tsx b/src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world_container.tsx index 919058bcbbc32..136ee5f4996b4 100644 --- a/src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world_container.tsx +++ b/src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world_container.tsx @@ -8,7 +8,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { Container, ViewMode, ContainerInput } from '../..'; import { HelloWorldContainerComponent } from './hello_world_container_component'; import { EmbeddableStart } from '../../../plugin'; diff --git a/src/plugins/embeddable/public/plugin.tsx b/src/plugins/embeddable/public/plugin.tsx index 7e393c6fc14e1..9043514fad317 100644 --- a/src/plugins/embeddable/public/plugin.tsx +++ b/src/plugins/embeddable/public/plugin.tsx @@ -36,6 +36,7 @@ import { IEmbeddable, EmbeddablePanel, SavedObjectEmbeddableInput, + EmbeddableContainerContext, } from './lib'; import { EmbeddableFactoryDefinition } from './lib/embeddables/embeddable_factory_definition'; import { EmbeddableStateTransfer } from './lib/state_transfer'; @@ -97,7 +98,11 @@ export interface EmbeddableStart extends PersistableStateService AttributeService; } -export type EmbeddablePanelHOC = React.FC<{ embeddable: IEmbeddable; hideHeader?: boolean }>; +export type EmbeddablePanelHOC = React.FC<{ + embeddable: IEmbeddable; + hideHeader?: boolean; + containerContext?: EmbeddableContainerContext; +}>; export class EmbeddablePublicPlugin implements Plugin { private readonly embeddableFactoryDefinitions: Map = @@ -155,7 +160,15 @@ export class EmbeddablePublicPlugin implements Plugin - ({ embeddable, hideHeader }: { embeddable: IEmbeddable; hideHeader?: boolean }) => + ({ + embeddable, + hideHeader, + containerContext, + }: { + embeddable: IEmbeddable; + hideHeader?: boolean; + containerContext?: EmbeddableContainerContext; + }) => ( ); diff --git a/src/plugins/es_ui_shared/public/components/cron_editor/cron_daily.tsx b/src/plugins/es_ui_shared/public/components/cron_editor/cron_daily.tsx index bce62a94d7cf9..8a2aabbbbf62f 100644 --- a/src/plugins/es_ui_shared/public/components/cron_editor/cron_daily.tsx +++ b/src/plugins/es_ui_shared/public/components/cron_editor/cron_daily.tsx @@ -7,7 +7,7 @@ */ import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiFlexGroup, EuiFlexItem, EuiFormRow, EuiSelect, EuiSelectOption } from '@elastic/eui'; diff --git a/src/plugins/es_ui_shared/public/components/cron_editor/cron_editor.tsx b/src/plugins/es_ui_shared/public/components/cron_editor/cron_editor.tsx index 5b76dd9c1f6a8..405a51b537f5d 100644 --- a/src/plugins/es_ui_shared/public/components/cron_editor/cron_editor.tsx +++ b/src/plugins/es_ui_shared/public/components/cron_editor/cron_editor.tsx @@ -7,7 +7,7 @@ */ import React, { Component, Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiSelect, EuiFormRow, EuiSelectOption } from '@elastic/eui'; diff --git a/src/plugins/es_ui_shared/public/components/cron_editor/cron_hourly.tsx b/src/plugins/es_ui_shared/public/components/cron_editor/cron_hourly.tsx index 054d29831153b..ef65c7c0da803 100644 --- a/src/plugins/es_ui_shared/public/components/cron_editor/cron_hourly.tsx +++ b/src/plugins/es_ui_shared/public/components/cron_editor/cron_hourly.tsx @@ -7,7 +7,7 @@ */ import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiFormRow, EuiSelect, EuiSelectOption } from '@elastic/eui'; diff --git a/src/plugins/es_ui_shared/public/components/cron_editor/cron_monthly.tsx b/src/plugins/es_ui_shared/public/components/cron_editor/cron_monthly.tsx index 4c8d47a07bf70..fb1efa99603c6 100644 --- a/src/plugins/es_ui_shared/public/components/cron_editor/cron_monthly.tsx +++ b/src/plugins/es_ui_shared/public/components/cron_editor/cron_monthly.tsx @@ -7,7 +7,7 @@ */ import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiFlexGroup, EuiFlexItem, EuiFormRow, EuiSelect, EuiSelectOption } from '@elastic/eui'; diff --git a/src/plugins/es_ui_shared/public/components/cron_editor/cron_weekly.tsx b/src/plugins/es_ui_shared/public/components/cron_editor/cron_weekly.tsx index a7ceb164a2912..2d44fa498643b 100644 --- a/src/plugins/es_ui_shared/public/components/cron_editor/cron_weekly.tsx +++ b/src/plugins/es_ui_shared/public/components/cron_editor/cron_weekly.tsx @@ -7,7 +7,7 @@ */ import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiFlexGroup, EuiFlexItem, EuiFormRow, EuiSelect, EuiSelectOption } from '@elastic/eui'; diff --git a/src/plugins/es_ui_shared/public/components/cron_editor/cron_yearly.tsx b/src/plugins/es_ui_shared/public/components/cron_editor/cron_yearly.tsx index 0d130f3f7d66e..069122e031ba8 100644 --- a/src/plugins/es_ui_shared/public/components/cron_editor/cron_yearly.tsx +++ b/src/plugins/es_ui_shared/public/components/cron_editor/cron_yearly.tsx @@ -7,7 +7,7 @@ */ import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiFlexGroup, EuiFlexItem, EuiFormRow, EuiSelect, EuiSelectOption } from '@elastic/eui'; diff --git a/src/plugins/expression_error/public/expression_renderers/error_renderer.tsx b/src/plugins/expression_error/public/expression_renderers/error_renderer.tsx index 8ce4d5fdbbbca..f0fbed22f38a0 100644 --- a/src/plugins/expression_error/public/expression_renderers/error_renderer.tsx +++ b/src/plugins/expression_error/public/expression_renderers/error_renderer.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { ExpressionRenderDefinition, IInterpreterRenderHandlers } from 'src/plugins/expressions'; import { withSuspense } from '../../../presentation_util/public'; diff --git a/src/plugins/expression_repeat_image/public/expression_renderers/repeat_image_renderer.tsx b/src/plugins/expression_repeat_image/public/expression_renderers/repeat_image_renderer.tsx index bd35de79713cc..330bf16e038fa 100644 --- a/src/plugins/expression_repeat_image/public/expression_renderers/repeat_image_renderer.tsx +++ b/src/plugins/expression_repeat_image/public/expression_renderers/repeat_image_renderer.tsx @@ -7,7 +7,7 @@ */ import React, { lazy } from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { ExpressionRenderDefinition, IInterpreterRenderHandlers } from 'src/plugins/expressions'; import { i18n } from '@kbn/i18n'; import { getElasticOutline, isValidUrl, withSuspense } from '../../../presentation_util/public'; diff --git a/src/plugins/expression_reveal_image/public/expression_renderers/reveal_image_renderer.tsx b/src/plugins/expression_reveal_image/public/expression_renderers/reveal_image_renderer.tsx index c89272ba58add..d4dec3a8a5825 100644 --- a/src/plugins/expression_reveal_image/public/expression_renderers/reveal_image_renderer.tsx +++ b/src/plugins/expression_reveal_image/public/expression_renderers/reveal_image_renderer.tsx @@ -7,7 +7,7 @@ */ import React, { lazy } from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { ExpressionRenderDefinition, IInterpreterRenderHandlers } from 'src/plugins/expressions'; import { i18n } from '@kbn/i18n'; import { withSuspense } from '../../../presentation_util/public'; diff --git a/src/plugins/expression_shape/public/expression_renderers/shape_renderer.tsx b/src/plugins/expression_shape/public/expression_renderers/shape_renderer.tsx index 09a0fe53fbe74..d6fc7c4d27107 100644 --- a/src/plugins/expression_shape/public/expression_renderers/shape_renderer.tsx +++ b/src/plugins/expression_shape/public/expression_renderers/shape_renderer.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { ExpressionRenderDefinition, IInterpreterRenderHandlers } from 'src/plugins/expressions'; import { i18n } from '@kbn/i18n'; import { withSuspense } from '../../../presentation_util/public'; diff --git a/src/plugins/expressions/common/execution/execution.ts b/src/plugins/expressions/common/execution/execution.ts index 90e05083fd9f1..c81e398dbc9e8 100644 --- a/src/plugins/expressions/common/execution/execution.ts +++ b/src/plugins/expressions/common/execution/execution.ts @@ -64,23 +64,6 @@ export interface ExecutionResult { result: Output; } -/** - * AbortController is not available in Node until v15, so we - * need to temporarily mock it for plugins using expressions - * on the server. - * - * TODO: Remove this once Kibana is upgraded to Node 15. - */ -const getNewAbortController = (): AbortController => { - try { - return new AbortController(); - } catch (error) { - // eslint-disable-next-line @typescript-eslint/no-var-requires - const polyfill = require('abortcontroller-polyfill/dist/cjs-ponyfill'); - return new polyfill.AbortController(); - } -}; - const createAbortErrorValue = () => createError({ message: 'The expression was aborted.', @@ -173,7 +156,7 @@ export class Execution< /** * AbortController to cancel this Execution. */ - private readonly abortController = getNewAbortController(); + private readonly abortController = new AbortController(); /** * Whether .start() method has been called. @@ -196,8 +179,7 @@ export class Execution< * Contract is a public representation of `Execution` instances. Contract we * can return to other plugins for their consumption. */ - public readonly contract: ExecutionContract = - new ExecutionContract(this); + public readonly contract: ExecutionContract; public readonly expression: string; @@ -208,6 +190,8 @@ export class Execution< constructor(public readonly execution: ExecutionParams) { const { executor } = execution; + this.contract = new ExecutionContract(this); + if (!execution.ast && !execution.expression) { throw new TypeError('Execution params should contain at least .ast or .expression key.'); } else if (execution.ast && execution.expression) { diff --git a/src/plugins/expressions/common/executor/executor.ts b/src/plugins/expressions/common/executor/executor.ts index f4913c4953bac..3b727b5dd63a4 100644 --- a/src/plugins/expressions/common/executor/executor.ts +++ b/src/plugins/expressions/common/executor/executor.ts @@ -100,16 +100,18 @@ export class Executor = Record; constructor(state?: ExecutorState) { + this.functions = new FunctionsRegistry(this as Executor); + this.types = new TypesRegistry(this as Executor); this.container = createExecutorContainer(state); } diff --git a/src/plugins/home/public/application/application.tsx b/src/plugins/home/public/application/application.tsx index 18f3089c14d11..b5a340fafacc0 100644 --- a/src/plugins/home/public/application/application.tsx +++ b/src/plugins/home/public/application/application.tsx @@ -9,8 +9,13 @@ import React from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; import { i18n } from '@kbn/i18n'; -import { ScopedHistory, CoreStart } from 'kibana/public'; -import { KibanaContextProvider, RedirectAppLinks } from '../../../kibana_react/public'; +import { ScopedHistory, CoreStart, CoreTheme } from 'kibana/public'; +import { Observable } from 'rxjs'; +import { + KibanaContextProvider, + KibanaThemeProvider, + RedirectAppLinks, +} from '../../../kibana_react/public'; // @ts-ignore import { HomeApp } from './components/home_app'; import { getServices } from './kibana_services'; @@ -19,6 +24,7 @@ import './index.scss'; export const renderApp = async ( element: HTMLElement, + theme$: Observable, coreStart: CoreStart, history: ScopedHistory ) => { @@ -45,9 +51,11 @@ export const renderApp = async ( render( - - - + + + + + , element ); diff --git a/src/plugins/home/public/application/components/add_data/add_data.tsx b/src/plugins/home/public/application/components/add_data/add_data.tsx index ee38b2e6e5d20..090443c4a6f85 100644 --- a/src/plugins/home/public/application/components/add_data/add_data.tsx +++ b/src/plugins/home/public/application/components/add_data/add_data.tsx @@ -18,7 +18,7 @@ import { EuiText, EuiTitle, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { METRIC_TYPE } from '@kbn/analytics'; import { ApplicationStart } from 'kibana/public'; import { createAppNavigationHandler } from '../app_navigation_handler'; diff --git a/src/plugins/home/public/application/components/home.tsx b/src/plugins/home/public/application/components/home.tsx index 2a08754889c28..67d874267983e 100644 --- a/src/plugins/home/public/application/components/home.tsx +++ b/src/plugins/home/public/application/components/home.tsx @@ -7,7 +7,7 @@ */ import React, { Component } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { METRIC_TYPE } from '@kbn/analytics'; import { i18n } from '@kbn/i18n'; import type { TelemetryPluginStart } from 'src/plugins/telemetry/public'; diff --git a/src/plugins/home/public/application/components/home_app.js b/src/plugins/home/public/application/components/home_app.js index 1dbcaa6f50fa1..9de73d8551cab 100644 --- a/src/plugins/home/public/application/components/home_app.js +++ b/src/plugins/home/public/application/components/home_app.js @@ -7,7 +7,7 @@ */ import React from 'react'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import PropTypes from 'prop-types'; import { Home } from './home'; import { TutorialDirectory } from './tutorial_directory'; diff --git a/src/plugins/home/public/application/components/manage_data/manage_data.tsx b/src/plugins/home/public/application/components/manage_data/manage_data.tsx index 0f465dfcf965f..15f5dadb43493 100644 --- a/src/plugins/home/public/application/components/manage_data/manage_data.tsx +++ b/src/plugins/home/public/application/components/manage_data/manage_data.tsx @@ -15,7 +15,7 @@ import { EuiTitle, EuiFlexItem, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { METRIC_TYPE } from '@kbn/analytics'; import { ApplicationStart } from 'kibana/public'; import { FeatureCatalogueEntry } from '../../../services'; diff --git a/src/plugins/home/public/application/components/recently_accessed.js b/src/plugins/home/public/application/components/recently_accessed.js index b7f562c750a0b..5a47ac265a7b1 100644 --- a/src/plugins/home/public/application/components/recently_accessed.js +++ b/src/plugins/home/public/application/components/recently_accessed.js @@ -23,7 +23,7 @@ import { EuiTitle, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const NUM_LONG_LINKS = 5; diff --git a/src/plugins/home/public/application/components/sample_data/index.tsx b/src/plugins/home/public/application/components/sample_data/index.tsx index b65fbb5d002b0..8ce7a32b66e08 100644 --- a/src/plugins/home/public/application/components/sample_data/index.tsx +++ b/src/plugins/home/public/application/components/sample_data/index.tsx @@ -19,7 +19,7 @@ import { EuiButton, EuiButtonEmpty, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { getServices } from '../../kibana_services'; interface Props { diff --git a/src/plugins/home/public/application/components/sample_data_set_card.js b/src/plugins/home/public/application/components/sample_data_set_card.js index 2367d4bf2af32..10c05a27a9ce6 100644 --- a/src/plugins/home/public/application/components/sample_data_set_card.js +++ b/src/plugins/home/public/application/components/sample_data_set_card.js @@ -21,7 +21,7 @@ export const INSTALLED_STATUS = 'installed'; export const UNINSTALLED_STATUS = 'not_installed'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { SampleDataViewDataButton } from './sample_data_view_data_button'; diff --git a/src/plugins/home/public/application/components/solutions_section/solutions_section.tsx b/src/plugins/home/public/application/components/solutions_section/solutions_section.tsx index 475de6dba8151..11813bf86538f 100644 --- a/src/plugins/home/public/application/components/solutions_section/solutions_section.tsx +++ b/src/plugins/home/public/application/components/solutions_section/solutions_section.tsx @@ -8,7 +8,7 @@ import React, { FC } from 'react'; import { EuiFlexGroup, EuiHorizontalRule, EuiScreenReaderOnly } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { SolutionPanel } from './solution_panel'; import { FeatureCatalogueEntry, FeatureCatalogueSolution } from '../../../'; diff --git a/src/plugins/home/public/application/components/tutorial/footer.js b/src/plugins/home/public/application/components/tutorial/footer.js index 56985dab3f692..ecefa86a104d4 100644 --- a/src/plugins/home/public/application/components/tutorial/footer.js +++ b/src/plugins/home/public/application/components/tutorial/footer.js @@ -11,7 +11,7 @@ import PropTypes from 'prop-types'; import { EuiFlexGroup, EuiFlexItem, EuiText, EuiButton } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function Footer({ url, label }) { return ( diff --git a/src/plugins/home/public/application/components/tutorial/instruction_set.js b/src/plugins/home/public/application/components/tutorial/instruction_set.js index 822c60cdc31ba..b2cdbde83a2c3 100644 --- a/src/plugins/home/public/application/components/tutorial/instruction_set.js +++ b/src/plugins/home/public/application/components/tutorial/instruction_set.js @@ -26,7 +26,7 @@ import { } from '@elastic/eui'; import * as StatusCheckStates from './status_check_states'; -import { injectI18n, FormattedMessage } from '@kbn/i18n/react'; +import { injectI18n, FormattedMessage } from '@kbn/i18n-react'; import { euiThemeVars } from '@kbn/ui-shared-deps-src/theme'; class InstructionSetUi extends React.Component { @@ -37,6 +37,7 @@ class InstructionSetUi extends React.Component { return { id: variant.id, name: getDisplayText(variant.id), + initialSelected: variant.initialSelected, }; }); @@ -45,7 +46,8 @@ class InstructionSetUi extends React.Component { }; if (this.tabs.length > 0) { - this.state.selectedTabId = this.tabs[0].id; + this.state.selectedTabId = + this.tabs.find(({ initialSelected }) => initialSelected)?.id ?? this.tabs[0].id; } } @@ -298,6 +300,7 @@ const instructionShape = PropTypes.shape({ const instructionVariantShape = PropTypes.shape({ id: PropTypes.string.isRequired, instructions: PropTypes.arrayOf(instructionShape).isRequired, + initialSelected: PropTypes.bool, }); const statusCheckConfigShape = PropTypes.shape({ diff --git a/src/plugins/home/public/application/components/tutorial/introduction.js b/src/plugins/home/public/application/components/tutorial/introduction.js index eba4e96b72444..59c1454579e23 100644 --- a/src/plugins/home/public/application/components/tutorial/introduction.js +++ b/src/plugins/home/public/application/components/tutorial/introduction.js @@ -18,7 +18,7 @@ import { EuiSpacer, } from '@elastic/eui'; -import { FormattedMessage, injectI18n } from '@kbn/i18n/react'; +import { FormattedMessage, injectI18n } from '@kbn/i18n-react'; function IntroductionUI({ description, diff --git a/src/plugins/home/public/application/components/tutorial/saved_objects_installer.js b/src/plugins/home/public/application/components/tutorial/saved_objects_installer.js index 56cc5814df96e..d1e40deb44e13 100644 --- a/src/plugins/home/public/application/components/tutorial/saved_objects_installer.js +++ b/src/plugins/home/public/application/components/tutorial/saved_objects_installer.js @@ -8,7 +8,7 @@ /* eslint-disable no-multi-str*/ -import { injectI18n } from '@kbn/i18n/react'; +import { injectI18n } from '@kbn/i18n-react'; import React, { Fragment } from 'react'; import PropTypes from 'prop-types'; diff --git a/src/plugins/home/public/application/components/tutorial/tutorial.js b/src/plugins/home/public/application/components/tutorial/tutorial.js index fa77d46a5394f..14043338a9429 100644 --- a/src/plugins/home/public/application/components/tutorial/tutorial.js +++ b/src/plugins/home/public/application/components/tutorial/tutorial.js @@ -15,7 +15,7 @@ import { InstructionSet } from './instruction_set'; import { SavedObjectsInstaller } from './saved_objects_installer'; import { EuiSpacer, EuiPanel, EuiButton, EuiButtonGroup, EuiFormRow } from '@elastic/eui'; import * as StatusCheckStates from './status_check_states'; -import { injectI18n, FormattedMessage } from '@kbn/i18n/react'; +import { injectI18n, FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { getServices } from '../../kibana_services'; import { KibanaPageTemplate } from '../../../../../kibana_react/public'; diff --git a/src/plugins/home/public/application/components/tutorial_directory.js b/src/plugins/home/public/application/components/tutorial_directory.js index 36b301823f136..3ecbb73e849fc 100644 --- a/src/plugins/home/public/application/components/tutorial_directory.js +++ b/src/plugins/home/public/application/components/tutorial_directory.js @@ -10,7 +10,7 @@ import _ from 'lodash'; import React from 'react'; import PropTypes from 'prop-types'; import { EuiFlexItem, EuiFlexGrid, EuiFlexGroup, EuiLink } from '@elastic/eui'; -import { injectI18n, FormattedMessage } from '@kbn/i18n/react'; +import { injectI18n, FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { Synopsis } from './synopsis'; import { SampleDataSetCards } from './sample_data_set_cards'; diff --git a/src/plugins/home/public/application/components/welcome.tsx b/src/plugins/home/public/application/components/welcome.tsx index 21e0e03bb2bf7..1a6251ebdca11 100644 --- a/src/plugins/home/public/application/components/welcome.tsx +++ b/src/plugins/home/public/application/components/welcome.tsx @@ -24,7 +24,7 @@ import { EuiPortal, } from '@elastic/eui'; import { METRIC_TYPE } from '@kbn/analytics'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { getServices } from '../kibana_services'; import { TelemetryPluginStart } from '../../../../telemetry/public'; diff --git a/src/plugins/home/public/plugin.ts b/src/plugins/home/public/plugin.ts index 7d0af7415640e..ac680c78f31eb 100644 --- a/src/plugins/home/public/plugin.ts +++ b/src/plugins/home/public/plugin.ts @@ -105,7 +105,7 @@ export class HomePublicPlugin i18n.translate('home.pageTitle', { defaultMessage: 'Home' }) ); const { renderApp } = await import('./application'); - return await renderApp(params.element, coreStart, params.history); + return await renderApp(params.element, params.theme$, coreStart, params.history); }, }); urlForwarding.forwardApp('home', 'home'); diff --git a/src/plugins/home/server/services/tutorials/lib/tutorial_schema.ts b/src/plugins/home/server/services/tutorials/lib/tutorial_schema.ts index 114afa644c0c2..f05c0af01cb1e 100644 --- a/src/plugins/home/server/services/tutorials/lib/tutorial_schema.ts +++ b/src/plugins/home/server/services/tutorials/lib/tutorial_schema.ts @@ -63,6 +63,7 @@ export type Instruction = TypeOf; const instructionVariantSchema = schema.object({ id: schema.string(), instructions: schema.arrayOf(instructionSchema), + initialSelected: schema.maybe(schema.boolean()), }); export type InstructionVariant = TypeOf; diff --git a/src/plugins/index_pattern_editor/jest.config.js b/src/plugins/index_pattern_editor/jest.config.js deleted file mode 100644 index bdf5fd8a0e9e2..0000000000000 --- a/src/plugins/index_pattern_editor/jest.config.js +++ /dev/null @@ -1,16 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../..', - roots: ['/src/plugins/index_pattern_editor'], - coverageDirectory: '/target/kibana-coverage/jest/src/plugins/index_pattern_editor', - coverageReporters: ['text', 'html'], - collectCoverageFrom: ['/src/plugins/index_pattern_editor/public/**/*.{ts,tsx}'], -}; diff --git a/src/plugins/index_pattern_field_editor/kibana.json b/src/plugins/index_pattern_field_editor/kibana.json deleted file mode 100644 index df09fd56136c3..0000000000000 --- a/src/plugins/index_pattern_field_editor/kibana.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "id": "indexPatternFieldEditor", - "version": "kibana", - "server": true, - "ui": true, - "requiredPlugins": ["data"], - "optionalPlugins": ["usageCollection"], - "requiredBundles": ["kibanaReact", "esUiShared", "fieldFormats"], - "owner": { - "name": "App Services", - "githubTeam": "kibana-app-services" - }, - "description": "Reusable index pattern field editor across Kibana" -} diff --git a/src/plugins/input_control_vis/public/components/editor/control_editor.tsx b/src/plugins/input_control_vis/public/components/editor/control_editor.tsx index ec606b19c77d1..76727fcaa645f 100644 --- a/src/plugins/input_control_vis/public/components/editor/control_editor.tsx +++ b/src/plugins/input_control_vis/public/components/editor/control_editor.tsx @@ -7,7 +7,7 @@ */ import React, { PureComponent, ChangeEvent } from 'react'; -import { injectI18n, FormattedMessage, InjectedIntlProps } from '@kbn/i18n/react'; +import { injectI18n, FormattedMessage, InjectedIntlProps } from '@kbn/i18n-react'; import { EuiAccordion, diff --git a/src/plugins/input_control_vis/public/components/editor/controls_tab.tsx b/src/plugins/input_control_vis/public/components/editor/controls_tab.tsx index c6921b48e6020..41a6b34259a72 100644 --- a/src/plugins/input_control_vis/public/components/editor/controls_tab.tsx +++ b/src/plugins/input_control_vis/public/components/editor/controls_tab.tsx @@ -7,7 +7,7 @@ */ import React, { PureComponent } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { diff --git a/src/plugins/input_control_vis/public/components/editor/field_select.tsx b/src/plugins/input_control_vis/public/components/editor/field_select.tsx index d0925ee15d4b1..1ecbf2772ebfd 100644 --- a/src/plugins/input_control_vis/public/components/editor/field_select.tsx +++ b/src/plugins/input_control_vis/public/components/editor/field_select.tsx @@ -9,7 +9,7 @@ import _ from 'lodash'; import React, { Component } from 'react'; -import { injectI18n, FormattedMessage, InjectedIntlProps } from '@kbn/i18n/react'; +import { injectI18n, FormattedMessage, InjectedIntlProps } from '@kbn/i18n-react'; import { EuiFormRow, EuiComboBox, EuiComboBoxOptionOption } from '@elastic/eui'; import { IndexPattern, IndexPatternField } from '../../../../data/public'; diff --git a/src/plugins/input_control_vis/public/components/editor/index_pattern_select_form_row.tsx b/src/plugins/input_control_vis/public/components/editor/index_pattern_select_form_row.tsx index 1ab67dc0a86f1..5363a988226ec 100644 --- a/src/plugins/input_control_vis/public/components/editor/index_pattern_select_form_row.tsx +++ b/src/plugins/input_control_vis/public/components/editor/index_pattern_select_form_row.tsx @@ -7,7 +7,7 @@ */ import React, { ComponentType } from 'react'; -import { injectI18n, InjectedIntlProps } from '@kbn/i18n/react'; +import { injectI18n, InjectedIntlProps } from '@kbn/i18n-react'; import { EuiFormRow } from '@elastic/eui'; import { IndexPatternSelectProps } from 'src/plugins/data/public'; diff --git a/src/plugins/input_control_vis/public/components/editor/list_control_editor.tsx b/src/plugins/input_control_vis/public/components/editor/list_control_editor.tsx index 2501d1d14e14e..2bf1bacbbcd5b 100644 --- a/src/plugins/input_control_vis/public/components/editor/list_control_editor.tsx +++ b/src/plugins/input_control_vis/public/components/editor/list_control_editor.tsx @@ -8,7 +8,7 @@ import React, { PureComponent, ComponentType } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFormRow, EuiFieldNumber, EuiSwitch, EuiSelect } from '@elastic/eui'; import { IndexPatternSelectFormRow } from './index_pattern_select_form_row'; diff --git a/src/plugins/input_control_vis/public/components/editor/options_tab.tsx b/src/plugins/input_control_vis/public/components/editor/options_tab.tsx index d069b893d1cdd..17f07730bd1b7 100644 --- a/src/plugins/input_control_vis/public/components/editor/options_tab.tsx +++ b/src/plugins/input_control_vis/public/components/editor/options_tab.tsx @@ -9,7 +9,7 @@ import React, { PureComponent } from 'react'; import { EuiForm, EuiFormRow, EuiSwitch } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiSwitchEvent } from '@elastic/eui'; import { VisEditorOptionsProps } from 'src/plugins/visualizations/public'; diff --git a/src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx b/src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx index 38af22ab261d9..cdf8663caea56 100644 --- a/src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx +++ b/src/plugins/input_control_vis/public/components/editor/range_control_editor.tsx @@ -9,7 +9,7 @@ import React, { Component, Fragment, ComponentType } from 'react'; import { EuiFormRow, EuiFieldNumber } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { IndexPatternSelectFormRow } from './index_pattern_select_form_row'; import { FieldSelect } from './field_select'; diff --git a/src/plugins/input_control_vis/public/components/vis/input_control_vis.tsx b/src/plugins/input_control_vis/public/components/vis/input_control_vis.tsx index 9ece660928d41..956a6c55b61ba 100644 --- a/src/plugins/input_control_vis/public/components/vis/input_control_vis.tsx +++ b/src/plugins/input_control_vis/public/components/vis/input_control_vis.tsx @@ -8,7 +8,7 @@ import React, { Component } from 'react'; import { EuiButton, EuiButtonEmpty, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { CONTROL_TYPES } from '../../editor_utils'; import { ListControl } from '../../control/list_control_factory'; import { RangeControl } from '../../control/range_control_factory'; diff --git a/src/plugins/input_control_vis/public/components/vis/list_control.tsx b/src/plugins/input_control_vis/public/components/vis/list_control.tsx index 176802a520dbf..6ffc342bede2a 100644 --- a/src/plugins/input_control_vis/public/components/vis/list_control.tsx +++ b/src/plugins/input_control_vis/public/components/vis/list_control.tsx @@ -9,7 +9,7 @@ import React, { PureComponent } from 'react'; import _ from 'lodash'; -import { injectI18n, InjectedIntlProps } from '@kbn/i18n/react'; +import { injectI18n, InjectedIntlProps } from '@kbn/i18n-react'; import { EuiFieldText, EuiComboBox } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormRow } from './form_row'; diff --git a/src/plugins/inspector/public/ui/inspector_view_chooser.tsx b/src/plugins/inspector/public/ui/inspector_view_chooser.tsx index dc92550104d0a..454bd1917ffd1 100644 --- a/src/plugins/inspector/public/ui/inspector_view_chooser.tsx +++ b/src/plugins/inspector/public/ui/inspector_view_chooser.tsx @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { diff --git a/src/plugins/inspector/public/views/requests/components/request_selector.tsx b/src/plugins/inspector/public/views/requests/components/request_selector.tsx index 539abd3d14372..0a3a113f07664 100644 --- a/src/plugins/inspector/public/views/requests/components/request_selector.tsx +++ b/src/plugins/inspector/public/views/requests/components/request_selector.tsx @@ -7,7 +7,7 @@ */ import React, { Component } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import PropTypes from 'prop-types'; import { i18n } from '@kbn/i18n'; diff --git a/src/plugins/inspector/public/views/requests/components/requests_view.tsx b/src/plugins/inspector/public/views/requests/components/requests_view.tsx index dad0881e88ea3..822175cc65eea 100644 --- a/src/plugins/inspector/public/views/requests/components/requests_view.tsx +++ b/src/plugins/inspector/public/views/requests/components/requests_view.tsx @@ -8,7 +8,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiEmptyPrompt, EuiSpacer, EuiText, EuiTextColor } from '@elastic/eui'; import { RequestStatus } from '../../../../common/adapters'; diff --git a/src/plugins/interactive_setup/public/app.tsx b/src/plugins/interactive_setup/public/app.tsx index 89218df4208bc..f64e6628d1472 100644 --- a/src/plugins/interactive_setup/public/app.tsx +++ b/src/plugins/interactive_setup/public/app.tsx @@ -13,7 +13,7 @@ import type { FunctionComponent } from 'react'; import React, { useState } from 'react'; import useAsync from 'react-use/lib/useAsync'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { StatusResult } from '../common'; import { ClusterAddressForm } from './cluster_address_form'; diff --git a/src/plugins/interactive_setup/public/cluster_address_form.test.tsx b/src/plugins/interactive_setup/public/cluster_address_form.test.tsx index 5c770fbfbfefe..098012bd36310 100644 --- a/src/plugins/interactive_setup/public/cluster_address_form.test.tsx +++ b/src/plugins/interactive_setup/public/cluster_address_form.test.tsx @@ -9,7 +9,7 @@ import { fireEvent, render, waitFor } from '@testing-library/react'; import React from 'react'; -import { coreMock } from 'src/core/public/mocks'; +import { coreMock, themeServiceMock } from 'src/core/public/mocks'; import { ClusterAddressForm } from './cluster_address_form'; import { Providers } from './plugin'; @@ -21,6 +21,8 @@ jest.mock('@elastic/eui/lib/services/accessibility/html_id_generator', () => ({ describe('ClusterAddressForm', () => { jest.setTimeout(20_000); + const theme$ = themeServiceMock.createTheme$(); + it('calls enrollment API when submitting form', async () => { const coreStart = coreMock.createStart(); coreStart.http.post.mockResolvedValue({}); @@ -28,7 +30,7 @@ describe('ClusterAddressForm', () => { const onSuccess = jest.fn(); const { findByRole, findByLabelText } = render( - + ); @@ -52,7 +54,7 @@ describe('ClusterAddressForm', () => { const onSuccess = jest.fn(); const { findAllByText, findByRole, findByLabelText } = render( - + ); diff --git a/src/plugins/interactive_setup/public/cluster_address_form.tsx b/src/plugins/interactive_setup/public/cluster_address_form.tsx index 32f13a433a704..6c4654472e0aa 100644 --- a/src/plugins/interactive_setup/public/cluster_address_form.tsx +++ b/src/plugins/interactive_setup/public/cluster_address_form.tsx @@ -20,7 +20,7 @@ import type { FunctionComponent } from 'react'; import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { PingResult } from '../common'; import { SubmitErrorCallout } from './submit_error_callout'; diff --git a/src/plugins/interactive_setup/public/cluster_configuration_form.test.tsx b/src/plugins/interactive_setup/public/cluster_configuration_form.test.tsx index 7e20deb9251ec..21c8d193fbec1 100644 --- a/src/plugins/interactive_setup/public/cluster_configuration_form.test.tsx +++ b/src/plugins/interactive_setup/public/cluster_configuration_form.test.tsx @@ -9,7 +9,7 @@ import { fireEvent, render, waitFor } from '@testing-library/react'; import React from 'react'; -import { coreMock } from 'src/core/public/mocks'; +import { coreMock, themeServiceMock } from 'src/core/public/mocks'; import { ClusterConfigurationForm } from './cluster_configuration_form'; import { Providers } from './plugin'; @@ -21,6 +21,8 @@ jest.mock('@elastic/eui/lib/services/accessibility/html_id_generator', () => ({ describe('ClusterConfigurationForm', () => { jest.setTimeout(20_000); + const theme$ = themeServiceMock.createTheme$(); + it('calls enrollment API for https addresses when submitting form', async () => { const coreStart = coreMock.createStart(); coreStart.http.post.mockResolvedValue({}); @@ -28,7 +30,7 @@ describe('ClusterConfigurationForm', () => { const onSuccess = jest.fn(); const { findByRole, findByLabelText } = render( - + { const onSuccess = jest.fn(); const { findByRole } = render( - + { const onSuccess = jest.fn(); const { findAllByText, findByRole, findByLabelText } = render( - + + ) + } fullWidth > = ({ certificat ); }; + +export interface ForgotPasswordPopoverProps { + username: string; +} + +export const ForgotPasswordPopover: FunctionComponent = ({ + username, +}) => { + const [isPopoverOpen, setIsPopoverOpen] = useState(false); + + const button = ( + setIsPopoverOpen((isOpen) => !isOpen)}> + + + ); + + return ( + setIsPopoverOpen(false)} + > + +

+ {username}, + }} + /> +

+ + {getCommandLineSnippet('elasticsearch-reset-password', `--username ${username}`)} + +
+
+ ); +}; diff --git a/src/plugins/interactive_setup/public/enrollment_token_form.test.tsx b/src/plugins/interactive_setup/public/enrollment_token_form.test.tsx index 30983c68e1cf9..a344129aa8e5b 100644 --- a/src/plugins/interactive_setup/public/enrollment_token_form.test.tsx +++ b/src/plugins/interactive_setup/public/enrollment_token_form.test.tsx @@ -9,7 +9,7 @@ import { fireEvent, render, waitFor } from '@testing-library/react'; import React from 'react'; -import { coreMock } from 'src/core/public/mocks'; +import { coreMock, themeServiceMock } from 'src/core/public/mocks'; import type { EnrollmentToken } from '../common'; import { decodeEnrollmentToken, EnrollmentTokenForm } from './enrollment_token_form'; @@ -29,6 +29,8 @@ const token: EnrollmentToken = { describe('EnrollmentTokenForm', () => { jest.setTimeout(20_000); + const theme$ = themeServiceMock.createTheme$(); + it('calls enrollment API when submitting form', async () => { const coreStart = coreMock.createStart(); coreStart.http.post.mockResolvedValue({}); @@ -36,7 +38,7 @@ describe('EnrollmentTokenForm', () => { const onSuccess = jest.fn(); const { findByRole, findByLabelText } = render( - + ); @@ -62,7 +64,7 @@ describe('EnrollmentTokenForm', () => { const onSuccess = jest.fn(); const { findAllByText, findByRole, findByLabelText } = render( - + ); diff --git a/src/plugins/interactive_setup/public/enrollment_token_form.tsx b/src/plugins/interactive_setup/public/enrollment_token_form.tsx index e5a3aca8fd4e2..7944f33365213 100644 --- a/src/plugins/interactive_setup/public/enrollment_token_form.tsx +++ b/src/plugins/interactive_setup/public/enrollment_token_form.tsx @@ -9,23 +9,28 @@ import { EuiButton, EuiButtonEmpty, + EuiCodeBlock, EuiFlexGroup, EuiFlexItem, EuiForm, EuiFormRow, + EuiLink, + EuiPopover, + EuiPopoverFooter, EuiSpacer, EuiText, EuiTextArea, } from '@elastic/eui'; import type { FunctionComponent } from 'react'; -import React from 'react'; +import React, { useState } from 'react'; import useUpdateEffect from 'react-use/lib/useUpdateEffect'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { EnrollmentToken } from '../common'; import { DocLink } from './doc_link'; +import { getCommandLineSnippet } from './get_command_line_snippet'; import { SubmitErrorCallout } from './submit_error_callout'; import { TextTruncate } from './text_truncate'; import type { ValidationErrors } from './use_form'; @@ -109,7 +114,6 @@ export const EnrollmentTokenForm: FunctionComponent = )} - = enrollmentToken ? ( ) : ( - - - + ) } fullWidth @@ -226,3 +225,53 @@ export function compareAddresses(a: string, b: string) { } return 0; } + +export const EnrollmentTokenHelpPopover = () => { + const [isPopoverOpen, setIsPopoverOpen] = useState(false); + + const button = ( + setIsPopoverOpen((isOpen) => !isOpen)}> + + + ); + + return ( + setIsPopoverOpen(false)} + > + +

+ +

+

+ +

+ + {getCommandLineSnippet('elasticsearch-create-enrollment-token', '--scope kibana')} + +
+ + + + + +
+ ); +}; diff --git a/src/plugins/interactive_setup/public/get_command_line_snippet.test.ts b/src/plugins/interactive_setup/public/get_command_line_snippet.test.ts new file mode 100644 index 0000000000000..0d53a1826be19 --- /dev/null +++ b/src/plugins/interactive_setup/public/get_command_line_snippet.test.ts @@ -0,0 +1,38 @@ +/* + * 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 { getCommandLineSnippet } from './get_command_line_snippet'; + +describe('getCommandLineSnippet', () => { + const originalNavigator = window.navigator; + + it('should format windows correctly', () => { + Object.defineProperty(window, 'navigator', { + value: { userAgent: 'Windows' }, + writable: true, + }); + expect(getCommandLineSnippet('kibana')).toEqual('bin\\kibana.bat'); + expect(getCommandLineSnippet('kibana', '--silent')).toEqual('bin\\kibana.bat --silent'); + }); + + it('should format unix correctly', () => { + Object.defineProperty(window, 'navigator', { + value: { userAgent: 'Linux' }, + writable: true, + }); + expect(getCommandLineSnippet('kibana')).toEqual('bin/kibana'); + expect(getCommandLineSnippet('kibana', '--silent')).toEqual('bin/kibana --silent'); + }); + + afterAll(function () { + Object.defineProperty(window, 'navigator', { + value: originalNavigator, + writable: true, + }); + }); +}); diff --git a/src/plugins/interactive_setup/public/get_command_line_snippet.ts b/src/plugins/interactive_setup/public/get_command_line_snippet.ts new file mode 100644 index 0000000000000..51af5b4929140 --- /dev/null +++ b/src/plugins/interactive_setup/public/get_command_line_snippet.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 function getCommandLineSnippet(command: string, args?: string) { + const isWindows = window.navigator.userAgent.includes('Win'); + return `${isWindows ? `bin\\${command}.bat` : `bin/${command}`}${args ? ` ${args}` : ''}`; +} diff --git a/src/plugins/interactive_setup/public/plugin.tsx b/src/plugins/interactive_setup/public/plugin.tsx index dd2f4c14a5f77..2deba1ce5b1a2 100644 --- a/src/plugins/interactive_setup/public/plugin.tsx +++ b/src/plugins/interactive_setup/public/plugin.tsx @@ -9,11 +9,13 @@ import type { FunctionComponent } from 'react'; import React from 'react'; import ReactDOM from 'react-dom'; +import type { Observable } from 'rxjs'; -import { I18nProvider } from '@kbn/i18n/react'; -import type { CoreSetup, CoreStart, Plugin } from 'src/core/public'; +import { I18nProvider } from '@kbn/i18n-react'; +import type { CoreSetup, CoreStart, CoreTheme, Plugin } from 'src/core/public'; import { App } from './app'; +import { KibanaThemeProvider } from './theme'; // TODO: replace this with the one exported from `kibana_react` after https://github.com/elastic/kibana/issues/119204 is implemented. import { KibanaProvider } from './use_kibana'; import { VerificationProvider } from './use_verification'; @@ -24,7 +26,7 @@ export class InteractiveSetupPlugin implements Plugin { title: 'Configure Elastic to get started', appRoute: '/', chromeless: true, - mount: async (params) => { + mount: async ({ element, theme$ }) => { const url = new URL(window.location.href); const defaultCode = url.searchParams.get('code') || undefined; const onSuccess = () => { @@ -34,12 +36,12 @@ export class InteractiveSetupPlugin implements Plugin { const [services] = await core.getStartServices(); ReactDOM.render( - + , - params.element + element ); - return () => ReactDOM.unmountComponentAtNode(params.element); + return () => ReactDOM.unmountComponentAtNode(element); }, }); } @@ -49,17 +51,21 @@ export class InteractiveSetupPlugin implements Plugin { export interface ProvidersProps { services: CoreStart; + theme$: Observable; defaultCode?: string; } export const Providers: FunctionComponent = ({ defaultCode, services, + theme$, children, }) => ( - - {children} - + + + {children} + + ); diff --git a/src/plugins/interactive_setup/public/submit_error_callout.tsx b/src/plugins/interactive_setup/public/submit_error_callout.tsx index d3f4492394c81..7c4524dcfee96 100644 --- a/src/plugins/interactive_setup/public/submit_error_callout.tsx +++ b/src/plugins/interactive_setup/public/submit_error_callout.tsx @@ -10,7 +10,7 @@ import { EuiButton, EuiCallOut } from '@elastic/eui'; import type { FunctionComponent } from 'react'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { IHttpFetchError, ResponseErrorBody } from 'kibana/public'; import { diff --git a/src/plugins/kibana_legacy/public/font_awesome/index.ts b/src/plugins/interactive_setup/public/theme/index.ts similarity index 84% rename from src/plugins/kibana_legacy/public/font_awesome/index.ts rename to src/plugins/interactive_setup/public/theme/index.ts index 3a2a6fb94dd9b..165c5ef9195c2 100644 --- a/src/plugins/kibana_legacy/public/font_awesome/index.ts +++ b/src/plugins/interactive_setup/public/theme/index.ts @@ -6,4 +6,4 @@ * Side Public License, v 1. */ -import './font_awesome.scss'; +export { KibanaThemeProvider } from './kibana_theme_provider'; diff --git a/src/plugins/interactive_setup/public/theme/kibana_theme_provider.test.tsx b/src/plugins/interactive_setup/public/theme/kibana_theme_provider.test.tsx new file mode 100644 index 0000000000000..21059bd4a8236 --- /dev/null +++ b/src/plugins/interactive_setup/public/theme/kibana_theme_provider.test.tsx @@ -0,0 +1,88 @@ +/* + * 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 { useEuiTheme } from '@elastic/eui'; +import type { ReactWrapper } from 'enzyme'; +import type { FC } from 'react'; +import React, { useEffect } from 'react'; +import { act } from 'react-dom/test-utils'; +import { BehaviorSubject, of } from 'rxjs'; + +import { mountWithIntl } from '@kbn/test/jest'; +import type { CoreTheme } from 'src/core/public'; + +import { KibanaThemeProvider } from './kibana_theme_provider'; + +describe('KibanaThemeProvider', () => { + let euiTheme: ReturnType | undefined; + + beforeEach(() => { + euiTheme = undefined; + }); + + const flushPromises = async () => { + await new Promise(async (resolve, reject) => { + try { + setImmediate(() => resolve()); + } catch (error) { + reject(error); + } + }); + }; + + const InnerComponent: FC = () => { + const theme = useEuiTheme(); + useEffect(() => { + euiTheme = theme; + }, [theme]); + return
foo
; + }; + + const refresh = async (wrapper: ReactWrapper) => { + await act(async () => { + await flushPromises(); + wrapper.update(); + }); + }; + + it('exposes the EUI theme provider', async () => { + const coreTheme: CoreTheme = { darkMode: true }; + + const wrapper = mountWithIntl( + + + + ); + + await refresh(wrapper); + + expect(euiTheme!.colorMode).toEqual('DARK'); + }); + + it('propagates changes of the coreTheme observable', async () => { + const coreTheme$ = new BehaviorSubject({ darkMode: true }); + + const wrapper = mountWithIntl( + + + + ); + + await refresh(wrapper); + + expect(euiTheme!.colorMode).toEqual('DARK'); + + await act(async () => { + coreTheme$.next({ darkMode: false }); + }); + + await refresh(wrapper); + + expect(euiTheme!.colorMode).toEqual('LIGHT'); + }); +}); diff --git a/src/plugins/interactive_setup/public/theme/kibana_theme_provider.tsx b/src/plugins/interactive_setup/public/theme/kibana_theme_provider.tsx new file mode 100644 index 0000000000000..b1de6bd143049 --- /dev/null +++ b/src/plugins/interactive_setup/public/theme/kibana_theme_provider.tsx @@ -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 { EuiThemeProvider } from '@elastic/eui'; +import type { FC } from 'react'; +import React, { useMemo } from 'react'; +import useObservable from 'react-use/lib/useObservable'; +import type { Observable } from 'rxjs'; + +import type { CoreTheme } from '../../../../core/public'; +import { getColorMode } from './utils'; + +interface KibanaThemeProviderProps { + theme$: Observable; +} + +const defaultTheme: CoreTheme = { + darkMode: false, +}; + +/** + * Copied from the `kibana_react` plugin, remove once https://github.com/elastic/kibana/issues/119204 is implemented. + */ +export const KibanaThemeProvider: FC = ({ theme$, children }) => { + const theme = useObservable(theme$, defaultTheme); + const colorMode = useMemo(() => getColorMode(theme), [theme]); + return {children}; +}; diff --git a/src/plugins/interactive_setup/public/theme/utils.test.ts b/src/plugins/interactive_setup/public/theme/utils.test.ts new file mode 100644 index 0000000000000..57b37f4fb2f62 --- /dev/null +++ b/src/plugins/interactive_setup/public/theme/utils.test.ts @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { getColorMode } from './utils'; + +describe('getColorMode', () => { + it('returns the correct `colorMode` when `darkMode` is enabled', () => { + expect(getColorMode({ darkMode: true })).toEqual('DARK'); + }); + + it('returns the correct `colorMode` when `darkMode` is disabled', () => { + expect(getColorMode({ darkMode: false })).toEqual('LIGHT'); + }); +}); diff --git a/src/plugins/interactive_setup/public/theme/utils.ts b/src/plugins/interactive_setup/public/theme/utils.ts new file mode 100644 index 0000000000000..55730974afc16 --- /dev/null +++ b/src/plugins/interactive_setup/public/theme/utils.ts @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { EuiThemeColorMode } from '@elastic/eui/src/services/theme/types'; + +import type { CoreTheme } from '../../../../core/public'; + +/** + * Copied from the `kibana_react` plugin, remove once https://github.com/elastic/kibana/issues/119204 is implemented. + */ +export const getColorMode = (theme: CoreTheme): EuiThemeColorMode => { + // COLOR_MODES_STANDARD is not exported from eui + return theme.darkMode ? 'DARK' : 'LIGHT'; +}; diff --git a/src/plugins/interactive_setup/public/verification_code_form.test.tsx b/src/plugins/interactive_setup/public/verification_code_form.test.tsx index 9deb39e8e91a5..4848a2838f9d9 100644 --- a/src/plugins/interactive_setup/public/verification_code_form.test.tsx +++ b/src/plugins/interactive_setup/public/verification_code_form.test.tsx @@ -9,7 +9,7 @@ import { fireEvent, render, waitFor } from '@testing-library/react'; import React from 'react'; -import { coreMock } from 'src/core/public/mocks'; +import { coreMock, themeServiceMock } from 'src/core/public/mocks'; import { Providers } from './plugin'; import { VerificationCodeForm } from './verification_code_form'; @@ -21,6 +21,8 @@ jest.mock('@elastic/eui/lib/services/accessibility/html_id_generator', () => ({ describe('VerificationCodeForm', () => { jest.setTimeout(20_000); + const theme$ = themeServiceMock.createTheme$(); + it('calls enrollment API when submitting form', async () => { const coreStart = coreMock.createStart(); coreStart.http.post.mockResolvedValue({}); @@ -28,7 +30,7 @@ describe('VerificationCodeForm', () => { const onSuccess = jest.fn(); const { findByRole, findByLabelText } = render( - + ); @@ -65,7 +67,7 @@ describe('VerificationCodeForm', () => { const onSuccess = jest.fn(); const { findAllByText, findByRole, findByLabelText } = render( - + ); diff --git a/src/plugins/interactive_setup/public/verification_code_form.tsx b/src/plugins/interactive_setup/public/verification_code_form.tsx index 9ff86c63aca7f..fce48293b702b 100644 --- a/src/plugins/interactive_setup/public/verification_code_form.tsx +++ b/src/plugins/interactive_setup/public/verification_code_form.tsx @@ -19,10 +19,11 @@ import type { FunctionComponent } from 'react'; import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { IHttpFetchError, ResponseErrorBody } from 'kibana/public'; import { VERIFICATION_CODE_LENGTH } from '../common'; +import { getCommandLineSnippet } from './get_command_line_snippet'; import { SingleCharsField } from './single_chars_field'; import { SubmitErrorCallout } from './submit_error_callout'; import type { ValidationErrors } from './use_form'; @@ -118,9 +119,7 @@ export const VerificationCodeForm: FunctionComponent values={{ command: ( - {window.navigator.userAgent.includes('Win') - ? 'bin\\kibana-verification-code.bat' - : 'bin/kibana-verification-code'} + {getCommandLineSnippet('kibana-verification-code')} ), }} diff --git a/src/plugins/kibana_legacy/README.md b/src/plugins/kibana_legacy/README.md deleted file mode 100644 index d66938cca6d13..0000000000000 --- a/src/plugins/kibana_legacy/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# kibana-legacy - -This plugin contains several helpers and services to integrate pieces of the legacy Kibana app with the new Kibana platform. - -This plugin will be removed once all parts of legacy Kibana are removed from other plugins. - -All of this plugin should be considered deprecated. New code should never integrate with the services provided from this plugin. \ No newline at end of file diff --git a/src/plugins/kibana_legacy/kibana.json b/src/plugins/kibana_legacy/kibana.json deleted file mode 100644 index afca886ad9376..0000000000000 --- a/src/plugins/kibana_legacy/kibana.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "id": "kibanaLegacy", - "version": "kibana", - "server": false, - "ui": true, - "owner": { - "name": "Vis Editors", - "githubTeam": "kibana-vis-editors" - } -} diff --git a/src/plugins/kibana_legacy/public/mocks.ts b/src/plugins/kibana_legacy/public/mocks.ts deleted file mode 100644 index 3eac98a84d40a..0000000000000 --- a/src/plugins/kibana_legacy/public/mocks.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 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 { KibanaLegacyPlugin } from './plugin'; - -export type Setup = jest.Mocked>; -export type Start = jest.Mocked>; - -const createSetupContract = (): Setup => ({}); - -const createStartContract = (): Start => ({ - loadFontAwesome: jest.fn(), -}); - -export const kibanaLegacyPluginMock = { - createSetupContract, - createStartContract, -}; diff --git a/src/plugins/kibana_legacy/public/notify/lib/format_es_msg.test.js b/src/plugins/kibana_legacy/public/notify/lib/format_es_msg.test.js deleted file mode 100644 index d99db9f19f32e..0000000000000 --- a/src/plugins/kibana_legacy/public/notify/lib/format_es_msg.test.js +++ /dev/null @@ -1,65 +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 { formatESMsg } from './format_es_msg'; -import expect from '@kbn/expect'; - -describe('formatESMsg', () => { - test('should return undefined if passed a basic error', () => { - const err = new Error('This is a normal error'); - - const actual = formatESMsg(err); - - expect(actual).to.be(undefined); - }); - - test('should return undefined if passed a string', () => { - const err = 'This is a error string'; - - const actual = formatESMsg(err); - - expect(actual).to.be(undefined); - }); - - test('should return the root_cause if passed an extended elasticsearch', () => { - const err = new Error('This is an elasticsearch error'); - err.resp = { - error: { - root_cause: [ - { - reason: 'I am the detailed message', - }, - ], - }, - }; - - const actual = formatESMsg(err); - - expect(actual).to.equal('I am the detailed message'); - }); - - test('should combine the reason messages if more than one is returned.', () => { - const err = new Error('This is an elasticsearch error'); - err.resp = { - error: { - root_cause: [ - { - reason: 'I am the detailed message 1', - }, - { - reason: 'I am the detailed message 2', - }, - ], - }, - }; - - const actual = formatESMsg(err); - - expect(actual).to.equal('I am the detailed message 1\nI am the detailed message 2'); - }); -}); diff --git a/src/plugins/kibana_legacy/public/notify/lib/format_es_msg.ts b/src/plugins/kibana_legacy/public/notify/lib/format_es_msg.ts deleted file mode 100644 index 9c86899209a9c..0000000000000 --- a/src/plugins/kibana_legacy/public/notify/lib/format_es_msg.ts +++ /dev/null @@ -1,26 +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'; - -const getRootCause = (err: Record | string) => _.get(err, 'resp.error.root_cause'); - -/** - * Utilize the extended error information returned from elasticsearch - * @param {Error|String} err - * @returns {string} - */ -export const formatESMsg = (err: Record | string) => { - const rootCause = getRootCause(err); - - if (!Array.isArray(rootCause)) { - return; - } - - return rootCause.map((cause: Record) => cause.reason).join('\n'); -}; diff --git a/src/plugins/kibana_legacy/public/plugin.ts b/src/plugins/kibana_legacy/public/plugin.ts deleted file mode 100644 index a154770bbfffd..0000000000000 --- a/src/plugins/kibana_legacy/public/plugin.ts +++ /dev/null @@ -1,30 +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 { CoreSetup } from 'kibana/public'; - -export class KibanaLegacyPlugin { - public setup(core: CoreSetup<{}, KibanaLegacyStart>) { - return {}; - } - - public start() { - return { - /** - * Loads the font-awesome icon font. Should be removed once the last consumer has migrated to EUI - * @deprecated - */ - loadFontAwesome: async () => { - await import('./font_awesome'); - }, - }; - } -} - -export type KibanaLegacySetup = ReturnType; -export type KibanaLegacyStart = ReturnType; diff --git a/src/plugins/kibana_legacy/tsconfig.json b/src/plugins/kibana_legacy/tsconfig.json deleted file mode 100644 index 17f1a70838fd7..0000000000000 --- a/src/plugins/kibana_legacy/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, - "declarationMap": true - }, - "include": ["../../../typings/**/*", "public/**/*", "server/**/*", "config.ts"], - "references": [{ "path": "../../core/tsconfig.json" }] -} diff --git a/src/plugins/kibana_overview/public/application.tsx b/src/plugins/kibana_overview/public/application.tsx index 1611b9a8abf1f..4c0608d1b62ea 100644 --- a/src/plugins/kibana_overview/public/application.tsx +++ b/src/plugins/kibana_overview/public/application.tsx @@ -9,7 +9,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { i18n } from '@kbn/i18n'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { KibanaContextProvider, KibanaThemeProvider, diff --git a/src/plugins/kibana_overview/public/components/add_data/add_data.tsx b/src/plugins/kibana_overview/public/components/add_data/add_data.tsx index ecb38408e2c71..81121a17080c2 100644 --- a/src/plugins/kibana_overview/public/components/add_data/add_data.tsx +++ b/src/plugins/kibana_overview/public/components/add_data/add_data.tsx @@ -9,7 +9,7 @@ import React, { FC } from 'react'; import PropTypes from 'prop-types'; import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiTitle } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { CoreStart } from 'kibana/public'; import { RedirectAppLinks, useKibana } from '../../../../../../src/plugins/kibana_react/public'; import { FeatureCatalogueEntry } from '../../../../../../src/plugins/home/public'; diff --git a/src/plugins/kibana_overview/public/components/app.tsx b/src/plugins/kibana_overview/public/components/app.tsx index 4674f6e759022..ce1ebde281c8c 100644 --- a/src/plugins/kibana_overview/public/components/app.tsx +++ b/src/plugins/kibana_overview/public/components/app.tsx @@ -8,7 +8,7 @@ import React, { useEffect, useState } from 'react'; import { Observable } from 'rxjs'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { HashRouter as Router, Switch, Route } from 'react-router-dom'; import { CoreStart } from 'src/core/public'; import { NavigationPublicPluginStart } from 'src/plugins/navigation/public'; diff --git a/src/plugins/kibana_overview/public/components/manage_data/manage_data.tsx b/src/plugins/kibana_overview/public/components/manage_data/manage_data.tsx index 4d420fc00dfa9..fa9e33a2ba82c 100644 --- a/src/plugins/kibana_overview/public/components/manage_data/manage_data.tsx +++ b/src/plugins/kibana_overview/public/components/manage_data/manage_data.tsx @@ -9,7 +9,7 @@ import React, { FC } from 'react'; import PropTypes from 'prop-types'; import { EuiFlexGroup, EuiFlexItem, EuiHorizontalRule, EuiSpacer, EuiTitle } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { CoreStart } from 'kibana/public'; import { RedirectAppLinks, useKibana } from '../../../../../../src/plugins/kibana_react/public'; import { FeatureCatalogueEntry } from '../../../../../../src/plugins/home/public'; diff --git a/src/plugins/kibana_overview/public/components/news_feed/news_feed.tsx b/src/plugins/kibana_overview/public/components/news_feed/news_feed.tsx index 64948bcc93ac0..1960249086629 100644 --- a/src/plugins/kibana_overview/public/components/news_feed/news_feed.tsx +++ b/src/plugins/kibana_overview/public/components/news_feed/news_feed.tsx @@ -8,7 +8,7 @@ import React, { FC } from 'react'; import { EuiLink, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { FetchResult } from 'src/plugins/newsfeed/public'; interface Props { diff --git a/src/plugins/kibana_overview/public/components/overview/overview.tsx b/src/plugins/kibana_overview/public/components/overview/overview.tsx index 9bb685caecb7b..f27047a207af9 100644 --- a/src/plugins/kibana_overview/public/components/overview/overview.tsx +++ b/src/plugins/kibana_overview/public/components/overview/overview.tsx @@ -18,7 +18,7 @@ import { EuiTitle, EuiLoadingSpinner, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { CoreStart } from 'kibana/public'; import { i18n } from '@kbn/i18n'; import { diff --git a/src/plugins/kibana_react/public/code_editor/code_editor.tsx b/src/plugins/kibana_react/public/code_editor/code_editor.tsx index e0e2c4b3145c0..93cee7c0477e7 100644 --- a/src/plugins/kibana_react/public/code_editor/code_editor.tsx +++ b/src/plugins/kibana_react/public/code_editor/code_editor.tsx @@ -12,7 +12,7 @@ import ReactMonacoEditor from 'react-monaco-editor'; import { htmlIdGenerator, EuiToolTip, keys } from '@elastic/eui'; import { monaco } from '@kbn/monaco'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import classNames from 'classnames'; import './register_languages'; diff --git a/src/plugins/kibana_react/public/exit_full_screen_button/__snapshots__/exit_full_screen_button.test.tsx.snap b/src/plugins/kibana_react/public/exit_full_screen_button/__snapshots__/exit_full_screen_button.test.tsx.snap index 0ac76baa5c3e2..cc00a22c807ad 100644 --- a/src/plugins/kibana_react/public/exit_full_screen_button/__snapshots__/exit_full_screen_button.test.tsx.snap +++ b/src/plugins/kibana_react/public/exit_full_screen_button/__snapshots__/exit_full_screen_button.test.tsx.snap @@ -1,13 +1,26 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`is rendered 1`] = ` +exports[` is rendered 1`] = `
@@ -23,7 +36,7 @@ exports[`is rendered 1`] = ` aria-label="Exit full screen mode" className="dshExitFullScreenButton" data-test-subj="exitFullScreenModeLogo" - onClick={[Function]} + onClick={[MockFunction]} > {}, + setIsVisible: jest.fn(), } as unknown as ChromeStart; -test('is rendered', () => { - const component = mount( - {}} chrome={MockChrome} /> - ); +describe('', () => { + afterEach(() => { + jest.resetAllMocks(); + }); - expect(component).toMatchSnapshot(); -}); + test('is rendered', () => { + const component = mount( + + ); -describe('onExitFullScreenMode', () => { - test('is called when the button is pressed', () => { - const onExitHandler = sinon.stub(); + expect(component).toMatchSnapshot(); + }); + test('passing `false` to toggleChrome does not toggle chrome', () => { const component = mount( - + ); + expect(MockChrome.setIsVisible).toHaveBeenCalledTimes(0); + component.unmount(); + expect(MockChrome.setIsVisible).toHaveBeenCalledTimes(0); + }); - component.find('button').simulate('click'); + describe('onExitFullScreenMode', () => { + const onExitHandler = jest.fn(); + let component: ReactWrapper; - sinon.assert.calledOnce(onExitHandler); - }); + beforeEach(() => { + component = mount( + + ); + }); + + test('is called when the button is pressed', () => { + expect(MockChrome.setIsVisible).toHaveBeenLastCalledWith(false); + + component.find('button').simulate('click'); - test('is called when the ESC key is pressed', () => { - const onExitHandler = sinon.stub(); + expect(onExitHandler).toHaveBeenCalledTimes(1); + component.unmount(); + expect(MockChrome.setIsVisible).toHaveBeenLastCalledWith(true); + }); - mount(); + test('is called when the ESC key is pressed', () => { + expect(MockChrome.setIsVisible).toHaveBeenLastCalledWith(false); - const escapeKeyEvent = new KeyboardEvent('keydown', { key: keys.ESCAPE } as any); - document.dispatchEvent(escapeKeyEvent); + const escapeKeyEvent = new KeyboardEvent('keydown', { key: keys.ESCAPE } as any); + document.dispatchEvent(escapeKeyEvent); - sinon.assert.calledOnce(onExitHandler); + expect(onExitHandler).toHaveBeenCalledTimes(1); + component.unmount(); + expect(MockChrome.setIsVisible).toHaveBeenLastCalledWith(true); + }); }); }); diff --git a/src/plugins/kibana_react/public/exit_full_screen_button/exit_full_screen_button.tsx b/src/plugins/kibana_react/public/exit_full_screen_button/exit_full_screen_button.tsx index 9b82757523a83..593f45d87446b 100644 --- a/src/plugins/kibana_react/public/exit_full_screen_button/exit_full_screen_button.tsx +++ b/src/plugins/kibana_react/public/exit_full_screen_button/exit_full_screen_button.tsx @@ -15,11 +15,25 @@ import type { ChromeStart } from '../../../../core/public'; export interface ExitFullScreenButtonProps { onExitFullScreenMode: () => void; chrome: ChromeStart; + /** + * Optional argument that determines whether we toggle the chrome bar + * the button unmounts. + * + * @note The intended use for this prop is that it is either `true` or `false` + * for the lifetime of the button. + * + * @default true + */ + toggleChrome?: boolean; } import './index.scss'; class ExitFullScreenButtonUi extends PureComponent { + static defaultProps = { + toggleChrome: true, + }; + public onKeyDown = (e: KeyboardEvent) => { if (e.key === keys.ESCAPE) { this.props.onExitFullScreenMode(); @@ -27,12 +41,12 @@ class ExitFullScreenButtonUi extends PureComponent { }; public componentDidMount() { - this.props.chrome.setIsVisible(false); + if (this.props.toggleChrome) this.props.chrome.setIsVisible(false); document.addEventListener('keydown', this.onKeyDown, false); } public componentWillUnmount() { - this.props.chrome.setIsVisible(true); + if (this.props.toggleChrome) this.props.chrome.setIsVisible(true); document.removeEventListener('keydown', this.onKeyDown, false); } diff --git a/src/plugins/kibana_react/public/overview_page/overview_page_footer/overview_page_footer.tsx b/src/plugins/kibana_react/public/overview_page/overview_page_footer/overview_page_footer.tsx index 0b675aad62af8..cf2397b9693e9 100644 --- a/src/plugins/kibana_react/public/overview_page/overview_page_footer/overview_page_footer.tsx +++ b/src/plugins/kibana_react/public/overview_page/overview_page_footer/overview_page_footer.tsx @@ -8,7 +8,7 @@ import React, { FC, MouseEvent } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiButtonEmpty } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { CoreStart } from 'kibana/public'; import { RedirectAppLinks } from '../../app_links'; diff --git a/src/plugins/kibana_react/public/page_template/no_data_page/no_data_page.tsx b/src/plugins/kibana_react/public/page_template/no_data_page/no_data_page.tsx index b8df7b02c1526..0c8754f852b04 100644 --- a/src/plugins/kibana_react/public/page_template/no_data_page/no_data_page.tsx +++ b/src/plugins/kibana_react/public/page_template/no_data_page/no_data_page.tsx @@ -20,7 +20,7 @@ import { CommonProps, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import classNames from 'classnames'; import { KibanaPageTemplateProps } from '../page_template'; diff --git a/src/plugins/kibana_react/public/page_template/solution_nav/solution_nav.tsx b/src/plugins/kibana_react/public/page_template/solution_nav/solution_nav.tsx index 0f23e64a73a58..233872e203a52 100644 --- a/src/plugins/kibana_react/public/page_template/solution_nav/solution_nav.tsx +++ b/src/plugins/kibana_react/public/page_template/solution_nav/solution_nav.tsx @@ -8,7 +8,7 @@ import './solution_nav.scss'; import React, { FunctionComponent, useState, Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlyout, diff --git a/src/plugins/kibana_react/public/table_list_view/table_list_view.tsx b/src/plugins/kibana_react/public/table_list_view/table_list_view.tsx index 18a88790b425a..65c62543538d0 100644 --- a/src/plugins/kibana_react/public/table_list_view/table_list_view.tsx +++ b/src/plugins/kibana_react/public/table_list_view/table_list_view.tsx @@ -19,7 +19,7 @@ import { SearchFilterConfig, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { HttpFetchError, ToastsStart } from 'kibana/public'; import { debounce, keyBy, sortBy, uniq } from 'lodash'; import React from 'react'; diff --git a/src/plugins/kibana_react/public/theme/kibana_theme_provider.tsx b/src/plugins/kibana_react/public/theme/kibana_theme_provider.tsx index bd5d8c2ea8453..65d640f34a2ca 100644 --- a/src/plugins/kibana_react/public/theme/kibana_theme_provider.tsx +++ b/src/plugins/kibana_react/public/theme/kibana_theme_provider.tsx @@ -21,6 +21,9 @@ const defaultTheme: CoreTheme = { darkMode: false, }; +// IMPORTANT: This code has been copied to the `interactive_setup` plugin, any changes here should be applied there too. +// That copy and this comment can be removed once https://github.com/elastic/kibana/issues/119204 is implemented. + export const KibanaThemeProvider: FC = ({ theme$, children }) => { const theme = useObservable(theme$, defaultTheme); const colorMode = useMemo(() => getColorMode(theme), [theme]); diff --git a/src/plugins/kibana_react/public/theme/utils.ts b/src/plugins/kibana_react/public/theme/utils.ts index e85bc78333255..b3d2f8bc6bb30 100644 --- a/src/plugins/kibana_react/public/theme/utils.ts +++ b/src/plugins/kibana_react/public/theme/utils.ts @@ -9,6 +9,9 @@ import type { EuiThemeColorMode } from '@elastic/eui/src/services/theme/types'; import type { CoreTheme } from '../../../../core/public'; +// IMPORTANT: This code has been copied to the `interactive_setup` plugin, any changes here should be applied there too. +// That copy and this comment can be removed once https://github.com/elastic/kibana/issues/119204 is implemented. + export const getColorMode = (theme: CoreTheme): EuiThemeColorMode => { // COLOR_MODES_STANDARD is not exported from eui return theme.darkMode ? 'DARK' : 'LIGHT'; diff --git a/src/plugins/kibana_react/public/util/to_mount_point.tsx b/src/plugins/kibana_react/public/util/to_mount_point.tsx index b43894be31c8d..192f3a0ba2082 100644 --- a/src/plugins/kibana_react/public/util/to_mount_point.tsx +++ b/src/plugins/kibana_react/public/util/to_mount_point.tsx @@ -9,7 +9,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { Observable } from 'rxjs'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import type { MountPoint, CoreTheme } from 'kibana/public'; import { KibanaThemeProvider } from '../theme'; diff --git a/src/plugins/management/public/components/landing/landing.tsx b/src/plugins/management/public/components/landing/landing.tsx index 1cb2f04e7543c..6ebf980420918 100644 --- a/src/plugins/management/public/components/landing/landing.tsx +++ b/src/plugins/management/public/components/landing/landing.tsx @@ -7,7 +7,7 @@ */ import React, { useEffect } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiEmptyPrompt, EuiHorizontalRule, EuiPageContent } from '@elastic/eui'; interface ManagementLandingPageProps { diff --git a/src/plugins/management/public/components/management_app/management_app.tsx b/src/plugins/management/public/components/management_app/management_app.tsx index ac9739cc54578..8a520a2629c3b 100644 --- a/src/plugins/management/public/components/management_app/management_app.tsx +++ b/src/plugins/management/public/components/management_app/management_app.tsx @@ -9,7 +9,7 @@ import './management_app.scss'; import React, { useState, useEffect, useCallback } from 'react'; import { AppMountParameters, ChromeBreadcrumb, ScopedHistory } from 'kibana/public'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { ManagementSection, MANAGEMENT_BREADCRUMB } from '../../utils'; diff --git a/src/plugins/newsfeed/public/components/empty_news.tsx b/src/plugins/newsfeed/public/components/empty_news.tsx index 32fdf9d0c0c59..6942e00844946 100644 --- a/src/plugins/newsfeed/public/components/empty_news.tsx +++ b/src/plugins/newsfeed/public/components/empty_news.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiEmptyPrompt } from '@elastic/eui'; export const NewsEmptyPrompt = () => { diff --git a/src/plugins/newsfeed/public/components/flyout_list.tsx b/src/plugins/newsfeed/public/components/flyout_list.tsx index 63d2011ff7e08..622ae287bd0c1 100644 --- a/src/plugins/newsfeed/public/components/flyout_list.tsx +++ b/src/plugins/newsfeed/public/components/flyout_list.tsx @@ -22,7 +22,7 @@ import { EuiHeaderAlert, EuiPortal, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { NewsfeedContext } from './newsfeed_header_nav_button'; import { NewsfeedItem } from '../types'; import { NewsEmptyPrompt } from './empty_news'; diff --git a/src/plugins/newsfeed/public/components/loading_news.tsx b/src/plugins/newsfeed/public/components/loading_news.tsx index 5b47c98ccb442..d268f67758edb 100644 --- a/src/plugins/newsfeed/public/components/loading_news.tsx +++ b/src/plugins/newsfeed/public/components/loading_news.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiEmptyPrompt } from '@elastic/eui'; import { EuiLoadingElastic } from '@elastic/eui'; diff --git a/src/plugins/newsfeed/public/plugin.tsx b/src/plugins/newsfeed/public/plugin.tsx index babfb1dbeeb92..04d7c18d070af 100644 --- a/src/plugins/newsfeed/public/plugin.tsx +++ b/src/plugins/newsfeed/public/plugin.tsx @@ -11,7 +11,7 @@ import { catchError, takeUntil } from 'rxjs/operators'; import ReactDOM from 'react-dom'; import React from 'react'; import moment from 'moment'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from 'src/core/public'; import { NewsfeedPluginBrowserConfig, NewsfeedPluginStartDependencies } from './types'; import { NewsfeedNavButton } from './components/newsfeed_header_nav_button'; diff --git a/src/plugins/presentation_util/public/__stories__/wait_for.tsx b/src/plugins/presentation_util/public/__stories__/wait_for.tsx index 7dd8d8514b840..8799a0f566dca 100644 --- a/src/plugins/presentation_util/public/__stories__/wait_for.tsx +++ b/src/plugins/presentation_util/public/__stories__/wait_for.tsx @@ -9,13 +9,12 @@ import React, { useState, useEffect, useRef, ReactElement } from 'react'; import { act } from 'react-test-renderer'; import { Story } from '@storybook/react'; -import { StoryFnReactReturnType } from '@storybook/react/dist/client/preview/types'; import { EuiLoadingSpinner } from '@elastic/eui'; export const waitFor = (waitTarget: Promise, spinner: ReactElement | null = ) => (CurrentStory: Story) => { - const [storyComponent, setStory] = useState(); + const [storyComponent, setStory] = useState(); const componentIsMounted = useRef(false); useEffect(() => { diff --git a/src/plugins/presentation_util/public/components/field_picker/field_picker.tsx b/src/plugins/presentation_util/public/components/field_picker/field_picker.tsx index b0203e3df1d2b..fd83eeb0c8895 100644 --- a/src/plugins/presentation_util/public/components/field_picker/field_picker.tsx +++ b/src/plugins/presentation_util/public/components/field_picker/field_picker.tsx @@ -9,7 +9,7 @@ import classNames from 'classnames'; import { sortBy, uniq } from 'lodash'; import React, { useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, EuiPanel, EuiText } from '@elastic/eui'; import { FieldIcon } from '@kbn/react-field/field_icon'; import { FieldButton } from '@kbn/react-field/field_button'; diff --git a/src/plugins/presentation_util/public/components/field_picker/field_search.tsx b/src/plugins/presentation_util/public/components/field_picker/field_search.tsx index c0c73ebafa049..f8e36c6ee2106 100644 --- a/src/plugins/presentation_util/public/components/field_picker/field_search.tsx +++ b/src/plugins/presentation_util/public/components/field_picker/field_search.tsx @@ -22,7 +22,7 @@ import { EuiPopoverTitle, } from '@elastic/eui'; import { FieldIcon } from '@kbn/react-field/field_icon'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export interface Props { onSearchChange: (value: string) => void; diff --git a/src/plugins/presentation_util/public/components/saved_object_save_modal_dashboard_selector.tsx b/src/plugins/presentation_util/public/components/saved_object_save_modal_dashboard_selector.tsx index 53aaecb070c7a..33773dbc94faa 100644 --- a/src/plugins/presentation_util/public/components/saved_object_save_modal_dashboard_selector.tsx +++ b/src/plugins/presentation_util/public/components/saved_object_save_modal_dashboard_selector.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, diff --git a/src/plugins/presentation_util/public/i18n/labs.tsx b/src/plugins/presentation_util/public/i18n/labs.tsx index 487c6fa6641e4..ee8f15f421487 100644 --- a/src/plugins/presentation_util/public/i18n/labs.tsx +++ b/src/plugins/presentation_util/public/i18n/labs.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCode } from '@elastic/eui'; export const LabsStrings = { diff --git a/src/plugins/presentation_util/storybook/decorator.tsx b/src/plugins/presentation_util/storybook/decorator.tsx index 8da4f409e1eca..19e2864fa11ca 100644 --- a/src/plugins/presentation_util/storybook/decorator.tsx +++ b/src/plugins/presentation_util/storybook/decorator.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { DecoratorFn } from '@storybook/react'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { pluginServices } from '../public/services'; import { PresentationUtilServices } from '../public/services'; import { providers, StorybookParams } from '../public/services/storybook'; diff --git a/src/plugins/saved_objects/public/save_modal/saved_object_save_modal.tsx b/src/plugins/saved_objects/public/save_modal/saved_object_save_modal.tsx index c9e21d5204b01..c5ac2d07ede47 100644 --- a/src/plugins/saved_objects/public/save_modal/saved_object_save_modal.tsx +++ b/src/plugins/saved_objects/public/save_modal/saved_object_save_modal.tsx @@ -26,7 +26,7 @@ import { EuiSwitchEvent, EuiTextArea, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { EuiText } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; diff --git a/src/plugins/saved_objects/public/save_modal/saved_object_save_modal_origin.tsx b/src/plugins/saved_objects/public/save_modal/saved_object_save_modal_origin.tsx index a193fa881b019..7b340ba3eff89 100644 --- a/src/plugins/saved_objects/public/save_modal/saved_object_save_modal_origin.tsx +++ b/src/plugins/saved_objects/public/save_modal/saved_object_save_modal_origin.tsx @@ -7,7 +7,7 @@ */ import React, { Fragment, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFormRow, EuiSwitch } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; diff --git a/src/plugins/saved_objects_management/public/management_section/mount_section.tsx b/src/plugins/saved_objects_management/public/management_section/mount_section.tsx index 948c75cd1ef9b..778a42d408728 100644 --- a/src/plugins/saved_objects_management/public/management_section/mount_section.tsx +++ b/src/plugins/saved_objects_management/public/management_section/mount_section.tsx @@ -9,7 +9,7 @@ import React, { lazy, Suspense } from 'react'; import ReactDOM from 'react-dom'; import { Router, Switch, Route } from 'react-router-dom'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiLoadingSpinner } from '@elastic/eui'; import { CoreSetup } from 'src/core/public'; diff --git a/src/plugins/saved_objects_management/public/management_section/object_view/components/header.test.tsx b/src/plugins/saved_objects_management/public/management_section/object_view/components/header.test.tsx index 796632f9747a9..d3285511c5c27 100644 --- a/src/plugins/saved_objects_management/public/management_section/object_view/components/header.test.tsx +++ b/src/plugins/saved_objects_management/public/management_section/object_view/components/header.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { mount } from 'enzyme'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { Header } from './header'; describe('Intro component', () => { diff --git a/src/plugins/saved_objects_management/public/management_section/object_view/components/header.tsx b/src/plugins/saved_objects_management/public/management_section/object_view/components/header.tsx index 10374b839ca48..4b067daab0951 100644 --- a/src/plugins/saved_objects_management/public/management_section/object_view/components/header.tsx +++ b/src/plugins/saved_objects_management/public/management_section/object_view/components/header.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiButton, EuiPageHeader } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; interface HeaderProps { diff --git a/src/plugins/saved_objects_management/public/management_section/object_view/components/not_found_errors.test.tsx b/src/plugins/saved_objects_management/public/management_section/object_view/components/not_found_errors.test.tsx index 5eab44cb416e9..9ef69b5cef2d2 100644 --- a/src/plugins/saved_objects_management/public/management_section/object_view/components/not_found_errors.test.tsx +++ b/src/plugins/saved_objects_management/public/management_section/object_view/components/not_found_errors.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { mount } from 'enzyme'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { NotFoundErrors } from './not_found_errors'; import { docLinksServiceMock } from '../../../../../../core/public/mocks'; diff --git a/src/plugins/saved_objects_management/public/management_section/object_view/components/not_found_errors.tsx b/src/plugins/saved_objects_management/public/management_section/object_view/components/not_found_errors.tsx index e3a349b1f4aa5..ec2f345056d29 100644 --- a/src/plugins/saved_objects_management/public/management_section/object_view/components/not_found_errors.tsx +++ b/src/plugins/saved_objects_management/public/management_section/object_view/components/not_found_errors.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { EuiCallOut } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiLink } from '@elastic/eui'; import { DocLinksStart } from '../../../../../../core/public'; diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/delete_confirm_modal.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/delete_confirm_modal.tsx index 2ac3730da5142..784709451f835 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/delete_confirm_modal.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/delete_confirm_modal.tsx @@ -26,7 +26,7 @@ import { EuiCallOut, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { SavedObjectWithMetadata, SavedObjectManagementTypeInfo } from '../../../../common'; import { getSavedObjectLabel } from '../../../lib'; diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/export_modal.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/export_modal.tsx index 0699f77f57521..5172f0fcf5bc1 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/export_modal.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/export_modal.tsx @@ -22,7 +22,7 @@ import { EuiCheckboxGroup, EuiSwitch, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export interface ExportModalProps { onExport: () => void; diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx index 92dbba2d23023..04ad32c1df551 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/flyout.tsx @@ -30,7 +30,7 @@ import { EuiLink, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { HttpStart, IBasePath } from 'src/core/public'; import { IndexPatternsContract, diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/header.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/header.tsx index b24726f37815a..64cb284057674 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/header.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/header.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiButtonEmpty, EuiPageHeader } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const Header = ({ onExportAll, diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/import_summary.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/import_summary.tsx index 18f49407cdec1..016ba282c561f 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/import_summary.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/import_summary.tsx @@ -22,7 +22,7 @@ import { EuiSpacer, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { SavedObjectsImportSuccess, SavedObjectsImportWarning, diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/relationships.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/relationships.tsx index 3c518296e5ccd..9fef685250937 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/relationships.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/relationships.tsx @@ -23,7 +23,7 @@ import { } from '@elastic/eui'; import { SearchFilterConfig } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { IBasePath } from 'src/core/public'; import type { SavedObjectManagementTypeInfo } from '../../../../common/types'; import { getDefaultTitle, getSavedObjectLabel } from '../../../lib'; diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx index ed79135f1f09f..a7f43438e5525 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx @@ -26,7 +26,7 @@ import { QueryType, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { SavedObjectsTaggingApi } from '../../../../../saved_objects_tagging_oss/public'; import type { SavedObjectManagementTypeInfo } from '../../../../common/types'; import { getDefaultTitle, getSavedObjectLabel } from '../../../lib'; diff --git a/src/plugins/share/public/components/share_context_menu.tsx b/src/plugins/share/public/components/share_context_menu.tsx index 8e931c5c579fa..b15fbc32e8aa8 100644 --- a/src/plugins/share/public/components/share_context_menu.tsx +++ b/src/plugins/share/public/components/share_context_menu.tsx @@ -8,7 +8,7 @@ import React, { Component } from 'react'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiContextMenu, EuiContextMenuPanelDescriptor } from '@elastic/eui'; diff --git a/src/plugins/share/public/components/url_panel_content.tsx b/src/plugins/share/public/components/url_panel_content.tsx index 4fdf6f9b83092..899036fc7107f 100644 --- a/src/plugins/share/public/components/url_panel_content.tsx +++ b/src/plugins/share/public/components/url_panel_content.tsx @@ -25,7 +25,7 @@ import { import { format as formatUrl, parse as parseUrl } from 'url'; -import { FormattedMessage, I18nProvider } from '@kbn/i18n/react'; +import { FormattedMessage, I18nProvider } from '@kbn/i18n-react'; import { HttpStart } from 'kibana/public'; import { i18n } from '@kbn/i18n'; import type { Capabilities } from 'src/core/public'; diff --git a/src/plugins/share/public/services/share_menu_manager.tsx b/src/plugins/share/public/services/share_menu_manager.tsx index c7251ee4dd414..52f000512aa07 100644 --- a/src/plugins/share/public/services/share_menu_manager.tsx +++ b/src/plugins/share/public/services/share_menu_manager.tsx @@ -8,7 +8,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { EuiWrappingPopover } from '@elastic/eui'; import { CoreStart, HttpStart } from 'kibana/public'; diff --git a/src/plugins/telemetry/public/components/opt_in_banner.tsx b/src/plugins/telemetry/public/components/opt_in_banner.tsx index ca39d4699185e..0b13b8b792a4c 100644 --- a/src/plugins/telemetry/public/components/opt_in_banner.tsx +++ b/src/plugins/telemetry/public/components/opt_in_banner.tsx @@ -8,7 +8,7 @@ import * as React from 'react'; import { EuiButton, EuiCallOut, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { OptInMessage } from './opt_in_message'; interface Props { diff --git a/src/plugins/telemetry/public/components/opt_in_message.tsx b/src/plugins/telemetry/public/components/opt_in_message.tsx index 5a26f7bd99a9e..0c03585a9eae4 100644 --- a/src/plugins/telemetry/public/components/opt_in_message.tsx +++ b/src/plugins/telemetry/public/components/opt_in_message.tsx @@ -8,7 +8,7 @@ import * as React from 'react'; import { EuiLink } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { PRIVACY_STATEMENT_URL } from '../../common/constants'; export class OptInMessage extends React.PureComponent { diff --git a/src/plugins/telemetry/public/components/opted_in_notice_banner.tsx b/src/plugins/telemetry/public/components/opted_in_notice_banner.tsx index a10c26c22e3fa..1deccb9362c36 100644 --- a/src/plugins/telemetry/public/components/opted_in_notice_banner.tsx +++ b/src/plugins/telemetry/public/components/opted_in_notice_banner.tsx @@ -10,7 +10,7 @@ import * as React from 'react'; import { EuiButton, EuiLink, EuiCallOut, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { PATH_TO_ADVANCED_SETTINGS, PRIVACY_STATEMENT_URL } from '../../common/constants'; import { HttpSetup } from '../../../../core/public'; diff --git a/src/plugins/telemetry_management_section/public/components/opt_in_example_flyout.tsx b/src/plugins/telemetry_management_section/public/components/opt_in_example_flyout.tsx index e38378bdd6154..2685a3c3e133e 100644 --- a/src/plugins/telemetry_management_section/public/components/opt_in_example_flyout.tsx +++ b/src/plugins/telemetry_management_section/public/components/opt_in_example_flyout.tsx @@ -20,7 +20,7 @@ import { EuiTitle, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { loadingSpinner } from './loading_spinner'; interface Props { diff --git a/src/plugins/telemetry_management_section/public/components/telemetry_management_section.tsx b/src/plugins/telemetry_management_section/public/components/telemetry_management_section.tsx index 037603cb165d9..02e7e40528f68 100644 --- a/src/plugins/telemetry_management_section/public/components/telemetry_management_section.tsx +++ b/src/plugins/telemetry_management_section/public/components/telemetry_management_section.tsx @@ -9,7 +9,7 @@ import React, { Component, Fragment } from 'react'; import { EuiCallOut, EuiForm, EuiLink, EuiSpacer, EuiSplitPanel, EuiTitle } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import type { TelemetryPluginSetup } from 'src/plugins/telemetry/public'; import type { DocLinksStart, ToastsStart } from 'src/core/public'; diff --git a/src/plugins/telemetry_management_section/tsconfig.json b/src/plugins/telemetry_management_section/tsconfig.json index 0f00f12e71c20..1e2b2e57d51c8 100644 --- a/src/plugins/telemetry_management_section/tsconfig.json +++ b/src/plugins/telemetry_management_section/tsconfig.json @@ -16,7 +16,6 @@ { "path": "../kibana_utils/tsconfig.json" }, { "path": "../usage_collection/tsconfig.json" }, { "path": "../telemetry/tsconfig.json" }, - { "path": "../kibana_legacy/tsconfig.json"}, { "path": "../ui_actions/tsconfig.json" }, { "path": "../expressions/tsconfig.json" }, { "path": "../home/tsconfig.json" }, diff --git a/src/plugins/ui_actions/public/triggers/trigger_internal.ts b/src/plugins/ui_actions/public/triggers/trigger_internal.ts index 0fc228e20b599..b479317201288 100644 --- a/src/plugins/ui_actions/public/triggers/trigger_internal.ts +++ b/src/plugins/ui_actions/public/triggers/trigger_internal.ts @@ -15,9 +15,11 @@ import { UiActionsService } from '../service'; * within `ui_actions` plugin. */ export class TriggerInternal { - public readonly contract: TriggerContract = new TriggerContract(this); + public readonly contract: TriggerContract; - constructor(public readonly service: UiActionsService, public readonly trigger: Trigger) {} + constructor(public readonly service: UiActionsService, public readonly trigger: Trigger) { + this.contract = new TriggerContract(this); + } public async execute(context: Context, alwaysShowPopup?: boolean) { const triggerId = this.trigger.id; diff --git a/src/plugins/url_forwarding/tsconfig.json b/src/plugins/url_forwarding/tsconfig.json index c6ef2a0286da1..464cca51c6b9f 100644 --- a/src/plugins/url_forwarding/tsconfig.json +++ b/src/plugins/url_forwarding/tsconfig.json @@ -9,6 +9,5 @@ "include": ["public/**/*"], "references": [ { "path": "../../core/tsconfig.json" }, - { "path": "../kibana_legacy/tsconfig.json" } ] } diff --git a/src/plugins/vis_default_editor/public/components/agg_add.tsx b/src/plugins/vis_default_editor/public/components/agg_add.tsx index bbe235082e13e..afd830ff87fea 100644 --- a/src/plugins/vis_default_editor/public/components/agg_add.tsx +++ b/src/plugins/vis_default_editor/public/components/agg_add.tsx @@ -16,7 +16,7 @@ import { EuiPopover, EuiPopoverTitle, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { IAggConfig, AggGroupNames } from '../../../data/public'; import type { Schema } from '../../../visualizations/public'; diff --git a/src/plugins/vis_default_editor/public/components/agg_select.tsx b/src/plugins/vis_default_editor/public/components/agg_select.tsx index a381be48d494b..279658111cdf1 100644 --- a/src/plugins/vis_default_editor/public/components/agg_select.tsx +++ b/src/plugins/vis_default_editor/public/components/agg_select.tsx @@ -11,7 +11,7 @@ import React, { useEffect, useCallback, useState } from 'react'; import { EuiComboBox, EuiComboBoxOptionOption, EuiFormRow, EuiLink, EuiText } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { IAggType, IndexPattern } from 'src/plugins/data/public'; import { DocLinksStart } from '../../../../core/public'; diff --git a/src/plugins/vis_default_editor/public/components/controls/components/input_list.tsx b/src/plugins/vis_default_editor/public/components/controls/components/input_list.tsx index 5605f1a67dd7d..71fe29272fbab 100644 --- a/src/plugins/vis_default_editor/public/components/controls/components/input_list.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/components/input_list.tsx @@ -16,7 +16,7 @@ import { htmlIdGenerator, EuiButtonEmpty, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export interface InputListConfig { defaultValue: InputItemModel; diff --git a/src/plugins/vis_default_editor/public/components/controls/components/number_list/number_list.tsx b/src/plugins/vis_default_editor/public/components/controls/components/number_list/number_list.tsx index d15b70f93f5a5..145ba25c04ef9 100644 --- a/src/plugins/vis_default_editor/public/components/controls/components/number_list/number_list.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/components/number_list/number_list.tsx @@ -9,7 +9,7 @@ import React, { Fragment, useState, useEffect, useMemo, useCallback } from 'react'; import { EuiSpacer, EuiButtonEmpty, EuiFlexItem, EuiFormErrorText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { NumberRow, NumberRowModel } from './number_row'; import { parse, diff --git a/src/plugins/vis_default_editor/public/components/controls/components/simple_number_list.tsx b/src/plugins/vis_default_editor/public/components/controls/components/simple_number_list.tsx index 086cde324d1f2..757a1cd6eef78 100644 --- a/src/plugins/vis_default_editor/public/components/controls/components/simple_number_list.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/components/simple_number_list.tsx @@ -9,7 +9,7 @@ import React, { Fragment, useCallback, useEffect, useMemo, useState } from 'react'; import { isArray } from 'lodash'; import { EuiButtonEmpty, EuiFlexItem, EuiFormRow, EuiSpacer, htmlIdGenerator } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EMPTY_STRING, getInitModelList, getRange, parse } from './number_list/utils'; import { NumberRow, NumberRowModel } from './number_list/number_row'; import { AggParamEditorProps } from '../../agg_param_props'; diff --git a/src/plugins/vis_default_editor/public/components/controls/date_ranges.tsx b/src/plugins/vis_default_editor/public/components/controls/date_ranges.tsx index fd88659f472fa..22907ff16e24d 100644 --- a/src/plugins/vis_default_editor/public/components/controls/date_ranges.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/date_ranges.tsx @@ -22,7 +22,7 @@ import { EuiFormRow, } from '@elastic/eui'; import dateMath from '@elastic/datemath'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { isEqual, omit } from 'lodash'; import useMount from 'react-use/lib/useMount'; diff --git a/src/plugins/vis_default_editor/public/components/controls/filters.tsx b/src/plugins/vis_default_editor/public/components/controls/filters.tsx index fe3032f4d2cef..8a73520c91376 100644 --- a/src/plugins/vis_default_editor/public/components/controls/filters.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/filters.tsx @@ -9,7 +9,7 @@ import React, { useState, useEffect } from 'react'; import { omit, isEqual } from 'lodash'; import { htmlIdGenerator, EuiButton, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import useMount from 'react-use/lib/useMount'; import { Query, DataPublicPluginStart } from '../../../../data/public'; diff --git a/src/plugins/vis_default_editor/public/components/controls/max_bars.tsx b/src/plugins/vis_default_editor/public/components/controls/max_bars.tsx index f5065bee20bd7..6ad6f6179dfc8 100644 --- a/src/plugins/vis_default_editor/public/components/controls/max_bars.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/max_bars.tsx @@ -8,7 +8,7 @@ import React, { useCallback, useEffect } from 'react'; import { EuiFormRow, EuiFieldNumber, EuiFieldNumberProps, EuiIconTip } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { useKibana } from '../../../../kibana_react/public'; import { AggParamEditorProps } from '../agg_param_props'; diff --git a/src/plugins/vis_default_editor/public/components/controls/number_interval.tsx b/src/plugins/vis_default_editor/public/components/controls/number_interval.tsx index e999350b8b729..e5f90dc382e49 100644 --- a/src/plugins/vis_default_editor/public/components/controls/number_interval.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/number_interval.tsx @@ -20,7 +20,7 @@ import { EuiFlexItem, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { UI_SETTINGS } from '../../../../data/public'; import { AggParamEditorProps } from '../agg_param_props'; diff --git a/src/plugins/vis_default_editor/public/components/controls/radius_ratio_option.tsx b/src/plugins/vis_default_editor/public/components/controls/radius_ratio_option.tsx index 486a6a77fb84d..408204b2a2dfb 100644 --- a/src/plugins/vis_default_editor/public/components/controls/radius_ratio_option.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/radius_ratio_option.tsx @@ -9,7 +9,7 @@ import React, { useCallback } from 'react'; import { EuiFormRow, EuiIconTip, EuiRange, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import useMount from 'react-use/lib/useMount'; import { AggControlProps } from './agg_control_props'; diff --git a/src/plugins/vis_default_editor/public/components/controls/ranges.tsx b/src/plugins/vis_default_editor/public/components/controls/ranges.tsx index 439aa10d3cf80..1fc1e1ffaa80e 100644 --- a/src/plugins/vis_default_editor/public/components/controls/ranges.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/ranges.tsx @@ -21,7 +21,7 @@ import { EuiToolTip, EuiText, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { isEqual, omit } from 'lodash'; diff --git a/src/plugins/vis_default_editor/public/components/controls/size.tsx b/src/plugins/vis_default_editor/public/components/controls/size.tsx index 34c9c9884de1c..7f2d055effbc4 100644 --- a/src/plugins/vis_default_editor/public/components/controls/size.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/size.tsx @@ -9,7 +9,7 @@ import React, { useEffect } from 'react'; import { isUndefined } from 'lodash'; import { EuiFormRow, EuiFieldNumber } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { AggParamEditorProps } from '../agg_param_props'; diff --git a/src/plugins/vis_default_editor/public/components/controls/time_interval.tsx b/src/plugins/vis_default_editor/public/components/controls/time_interval.tsx index 8b054893387a8..9b5c450669eee 100644 --- a/src/plugins/vis_default_editor/public/components/controls/time_interval.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/time_interval.tsx @@ -10,7 +10,7 @@ import { get, find } from 'lodash'; import React, { useEffect } from 'react'; import { EuiFormRow, EuiIconTip, EuiComboBox, EuiComboBoxOptionOption } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { search, AggParamOption } from '../../../../data/public'; import { AggParamEditorProps } from '../agg_param_props'; diff --git a/src/plugins/vis_default_editor/public/components/controls/top_aggregate.tsx b/src/plugins/vis_default_editor/public/components/controls/top_aggregate.tsx index 0fc54dd4e6a72..35c352635a27c 100644 --- a/src/plugins/vis_default_editor/public/components/controls/top_aggregate.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/top_aggregate.tsx @@ -9,7 +9,7 @@ import React, { useEffect, useRef } from 'react'; import { EuiFormRow, EuiIconTip, EuiSelect } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { IAggConfig, diff --git a/src/plugins/vis_default_editor/public/components/options/color_schema.tsx b/src/plugins/vis_default_editor/public/components/options/color_schema.tsx index 87aeef4847a88..4e6fec5c98558 100644 --- a/src/plugins/vis_default_editor/public/components/options/color_schema.tsx +++ b/src/plugins/vis_default_editor/public/components/options/color_schema.tsx @@ -9,7 +9,7 @@ import React, { useEffect, useState } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiLink, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ColorSchemaParams, ColorSchema } from 'src/plugins/charts/public'; import { VisEditorOptionsProps } from 'src/plugins/visualizations/public'; diff --git a/src/plugins/vis_default_editor/public/components/options/long_legend_options.tsx b/src/plugins/vis_default_editor/public/components/options/long_legend_options.tsx index c06fb94376dbe..70514cfb6f63b 100644 --- a/src/plugins/vis_default_editor/public/components/options/long_legend_options.tsx +++ b/src/plugins/vis_default_editor/public/components/options/long_legend_options.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFieldNumber, EuiFormRow } from '@elastic/eui'; import { SwitchOption } from './switch'; diff --git a/src/plugins/vis_default_editor/public/components/options/percentage_mode.tsx b/src/plugins/vis_default_editor/public/components/options/percentage_mode.tsx index 74f254c6176bc..bfb6d2051452b 100644 --- a/src/plugins/vis_default_editor/public/components/options/percentage_mode.tsx +++ b/src/plugins/vis_default_editor/public/components/options/percentage_mode.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFieldText, EuiFormRow, EuiLink } from '@elastic/eui'; import { SwitchOption } from './switch'; import { useKibana } from '../../../../kibana_react/public'; diff --git a/src/plugins/vis_default_editor/public/components/sidebar/controls.tsx b/src/plugins/vis_default_editor/public/components/sidebar/controls.tsx index e757b5fe8f61d..b033a4d77a6c2 100644 --- a/src/plugins/vis_default_editor/public/components/sidebar/controls.tsx +++ b/src/plugins/vis_default_editor/public/components/sidebar/controls.tsx @@ -15,7 +15,7 @@ import { EuiToolTip, EuiIconTip, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import useDebounce from 'react-use/lib/useDebounce'; diff --git a/src/plugins/vis_default_editor/public/components/sidebar/sidebar_title.tsx b/src/plugins/vis_default_editor/public/components/sidebar/sidebar_title.tsx index 2740f4ff50b4e..af800c857f0cb 100644 --- a/src/plugins/vis_default_editor/public/components/sidebar/sidebar_title.tsx +++ b/src/plugins/vis_default_editor/public/components/sidebar/sidebar_title.tsx @@ -21,7 +21,7 @@ import { EuiTitle, EuiToolTip, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { Vis } from 'src/plugins/visualizations/public'; diff --git a/src/plugins/vis_default_editor/public/default_editor_controller.tsx b/src/plugins/vis_default_editor/public/default_editor_controller.tsx index 0de5d4a9df120..293190fe56bfd 100644 --- a/src/plugins/vis_default_editor/public/default_editor_controller.tsx +++ b/src/plugins/vis_default_editor/public/default_editor_controller.tsx @@ -13,6 +13,8 @@ import { EuiErrorBoundary, EuiLoadingChart } from '@elastic/eui'; import { Vis, VisualizeEmbeddableContract } from 'src/plugins/visualizations/public'; import { IEditorController, EditorRenderProps } from 'src/plugins/visualize/public'; +import { KibanaThemeProvider } from '../../kibana_react/public'; +import { getTheme } from './services'; // @ts-ignore const DefaultEditor = lazy(() => import('./default_editor')); @@ -27,29 +29,31 @@ class DefaultEditorController implements IEditorController { render(props: EditorRenderProps) { render( - - - -
- } - > - - - , + + + + + + } + > + + + + , this.el ); } diff --git a/src/plugins/vis_default_editor/public/plugin.ts b/src/plugins/vis_default_editor/public/plugin.ts index fd0d69bf297b6..5e67712e94856 100644 --- a/src/plugins/vis_default_editor/public/plugin.ts +++ b/src/plugins/vis_default_editor/public/plugin.ts @@ -10,6 +10,7 @@ import { CoreSetup, Plugin } from 'kibana/public'; import { VisualizePluginSetup } from '../../visualize/public'; import { DefaultEditorController } from './default_editor_controller'; +import { setTheme } from './services'; export interface VisDefaultEditorSetupDependencies { visualize: VisualizePluginSetup; @@ -19,6 +20,7 @@ export class VisDefaultEditorPlugin implements Plugin { public setup(core: CoreSetup, { visualize }: VisDefaultEditorSetupDependencies) { + setTheme(core.theme); if (visualize) { visualize.visEditorsRegistry.registerDefault(DefaultEditorController); } diff --git a/src/plugins/vis_default_editor/public/services.ts b/src/plugins/vis_default_editor/public/services.ts new file mode 100644 index 0000000000000..d76fbc4542f4c --- /dev/null +++ b/src/plugins/vis_default_editor/public/services.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 { ThemeServiceStart } from 'kibana/public'; +import { createGetterSetter } from '../../kibana_utils/common'; + +export const [getTheme, setTheme] = createGetterSetter('ThemeService'); diff --git a/src/plugins/vis_type_markdown/public/markdown_options.tsx b/src/plugins/vis_type_markdown/public/markdown_options.tsx index df40afa5114d8..f57f853e18636 100644 --- a/src/plugins/vis_type_markdown/public/markdown_options.tsx +++ b/src/plugins/vis_type_markdown/public/markdown_options.tsx @@ -16,7 +16,7 @@ import { EuiFlexItem, EuiText, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { VisEditorOptionsProps } from 'src/plugins/visualizations/public'; import { MarkdownVisParams } from './types'; diff --git a/src/plugins/vis_types/metric/public/components/metric_vis_options.tsx b/src/plugins/vis_types/metric/public/components/metric_vis_options.tsx index 22152b331a907..8a3873e134192 100644 --- a/src/plugins/vis_types/metric/public/components/metric_vis_options.tsx +++ b/src/plugins/vis_types/metric/public/components/metric_vis_options.tsx @@ -16,7 +16,7 @@ import { EuiTitle, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { VisEditorOptionsProps } from 'src/plugins/visualizations/public'; import { diff --git a/src/plugins/vis_types/metric/public/metric_vis_type.ts b/src/plugins/vis_types/metric/public/metric_vis_type.ts index ccacd4eae6bf9..d4db2ac9e4671 100644 --- a/src/plugins/vis_types/metric/public/metric_vis_type.ts +++ b/src/plugins/vis_types/metric/public/metric_vis_type.ts @@ -86,7 +86,7 @@ export const createMetricVisTypeDefinition = (): VisTypeDefinition => }), min: 0, max: 1, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], }, ], }, diff --git a/src/plugins/vis_types/pie/kibana.json b/src/plugins/vis_types/pie/kibana.json index b3a5c1fc8aa07..52e02024ec31c 100644 --- a/src/plugins/vis_types/pie/kibana.json +++ b/src/plugins/vis_types/pie/kibana.json @@ -4,7 +4,7 @@ "ui": true, "server": true, "requiredPlugins": ["charts", "data", "expressions", "visualizations", "usageCollection"], - "requiredBundles": ["visDefaultEditor"], + "requiredBundles": ["visDefaultEditor", "kibanaReact"], "extraPublicDirs": ["common/index"], "owner": { "name": "Vis Editors", diff --git a/src/plugins/vis_types/pie/public/editor/components/pie.tsx b/src/plugins/vis_types/pie/public/editor/components/pie.tsx index 78ae9527da3f9..50e599b5ef5f3 100644 --- a/src/plugins/vis_types/pie/public/editor/components/pie.tsx +++ b/src/plugins/vis_types/pie/public/editor/components/pie.tsx @@ -19,7 +19,7 @@ import { EuiFlexGroup, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { BasicOptions, diff --git a/src/plugins/vis_types/pie/public/pie_renderer.tsx b/src/plugins/vis_types/pie/public/pie_renderer.tsx index e8fb6311904a6..d930558151701 100644 --- a/src/plugins/vis_types/pie/public/pie_renderer.tsx +++ b/src/plugins/vis_types/pie/public/pie_renderer.tsx @@ -8,10 +8,11 @@ import React, { lazy } from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { ExpressionRenderDefinition } from '../../../expressions/public'; import { VisualizationContainer } from '../../../visualizations/public'; import type { PersistedState } from '../../../visualizations/public'; +import { KibanaThemeProvider } from '../../../kibana_react/public'; import { VisTypePieDependencies } from './plugin'; import { RenderValue, vislibPieName } from './pie_fn'; @@ -43,19 +44,21 @@ export const getPieVisRenderer: ( render( - - - + + + + + , domNode ); diff --git a/src/plugins/vis_types/pie/public/plugin.ts b/src/plugins/vis_types/pie/public/plugin.ts index 12be6dd5de10f..5de26975896ee 100644 --- a/src/plugins/vis_types/pie/public/plugin.ts +++ b/src/plugins/vis_types/pie/public/plugin.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { CoreSetup, DocLinksStart } from 'src/core/public'; +import { CoreSetup, DocLinksStart, ThemeServiceStart } from 'src/core/public'; import { VisualizationsSetup } from '../../../visualizations/public'; import { Plugin as ExpressionsPublicPlugin } from '../../../expressions/public'; import { ChartsPluginSetup } from '../../../charts/public'; @@ -35,7 +35,11 @@ export interface VisTypePiePluginStartDependencies { export interface VisTypePieDependencies { theme: ChartsPluginSetup['theme']; palettes: ChartsPluginSetup['palettes']; - getStartDeps: () => Promise<{ data: DataPublicPluginStart; docLinks: DocLinksStart }>; + getStartDeps: () => Promise<{ + data: DataPublicPluginStart; + docLinks: DocLinksStart; + kibanaTheme: ThemeServiceStart; + }>; } export class VisTypePiePlugin { @@ -49,6 +53,7 @@ export class VisTypePiePlugin { return { data: deps.data, docLinks: coreStart.docLinks, + kibanaTheme: coreStart.theme, }; }; const trackUiMetric = usageCollection?.reportUiCounter.bind(usageCollection, 'vis_type_pie'); diff --git a/src/plugins/vis_types/pie/public/sample_vis.test.mocks.ts b/src/plugins/vis_types/pie/public/sample_vis.test.mocks.ts index 26d9c526a8137..15a3675125f61 100644 --- a/src/plugins/vis_types/pie/public/sample_vis.test.mocks.ts +++ b/src/plugins/vis_types/pie/public/sample_vis.test.mocks.ts @@ -87,7 +87,7 @@ export const samplePieVis = { title: 'Split slices', min: 0, max: null, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], editor: false, params: [], }, @@ -98,7 +98,7 @@ export const samplePieVis = { mustBeFirst: true, min: 0, max: 1, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], params: [ { name: 'row', diff --git a/src/plugins/vis_types/pie/public/vis_type/pie.ts b/src/plugins/vis_types/pie/public/vis_type/pie.ts index cfe38442a1548..0d012ed95b5d9 100644 --- a/src/plugins/vis_types/pie/public/vis_type/pie.ts +++ b/src/plugins/vis_types/pie/public/vis_type/pie.ts @@ -80,7 +80,7 @@ export const getPieVisTypeDefinition = ({ }), min: 0, max: Infinity, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], }, { group: AggGroupNames.Buckets, @@ -91,7 +91,7 @@ export const getPieVisTypeDefinition = ({ mustBeFirst: true, min: 0, max: 1, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], }, ], }, diff --git a/src/plugins/vis_types/table/public/components/table_vis_controls.tsx b/src/plugins/vis_types/table/public/components/table_vis_controls.tsx index 28e4b84796d98..9ebda35e9caed 100644 --- a/src/plugins/vis_types/table/public/components/table_vis_controls.tsx +++ b/src/plugins/vis_types/table/public/components/table_vis_controls.tsx @@ -14,7 +14,7 @@ import { EuiPopover, EuiToolTip, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { DatatableColumn, DatatableRow } from 'src/plugins/expressions'; diff --git a/src/plugins/vis_types/table/public/components/table_vis_options.tsx b/src/plugins/vis_types/table/public/components/table_vis_options.tsx index 698aca6034a6b..c816778079dae 100644 --- a/src/plugins/vis_types/table/public/components/table_vis_options.tsx +++ b/src/plugins/vis_types/table/public/components/table_vis_options.tsx @@ -10,7 +10,7 @@ import { get } from 'lodash'; import React, { useEffect, useMemo } from 'react'; import { EuiIconTip, EuiPanel } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { VisEditorOptionsProps } from 'src/plugins/visualizations/public'; import { search } from '../../../../data/public'; diff --git a/src/plugins/vis_types/table/public/table_vis_renderer.tsx b/src/plugins/vis_types/table/public/table_vis_renderer.tsx index e9f2002b71062..09c6c57150e62 100644 --- a/src/plugins/vis_types/table/public/table_vis_renderer.tsx +++ b/src/plugins/vis_types/table/public/table_vis_renderer.tsx @@ -13,6 +13,7 @@ import { CoreStart } from 'kibana/public'; import { VisualizationContainer } from '../../../visualizations/public'; import { ExpressionRenderDefinition } from '../../../expressions/common/expression_renderers'; import { TableVisRenderValue } from './table_vis_fn'; +import { KibanaThemeProvider } from '../../../../../src/plugins/kibana_react/public'; const TableVisualizationComponent = lazy(() => import('./components/table_visualization')); @@ -30,18 +31,20 @@ export const getTableVisRenderer: ( visData.table?.rows.length === 0 || (!visData.table && visData.tables.length === 0); render( - - + - , + showNoResult={showNoResult} + > + + + , domNode ); }, diff --git a/src/plugins/vis_types/timelion/public/components/timelion_expression_input.tsx b/src/plugins/vis_types/timelion/public/components/timelion_expression_input.tsx index 88e6d255733ed..adaf87bfccd78 100644 --- a/src/plugins/vis_types/timelion/public/components/timelion_expression_input.tsx +++ b/src/plugins/vis_types/timelion/public/components/timelion_expression_input.tsx @@ -8,7 +8,7 @@ import React, { useEffect, useCallback, useRef, useMemo } from 'react'; import { EuiFormLabel } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { monaco } from '@kbn/monaco'; import { CodeEditor, useKibana } from '../../../../kibana_react/public'; diff --git a/src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts b/src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts index e9a076b4dc832..69a818b4ae16e 100644 --- a/src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts +++ b/src/plugins/vis_types/timelion/public/helpers/timelion_request_handler.ts @@ -8,11 +8,12 @@ import { i18n } from '@kbn/i18n'; import type { KibanaExecutionContext } from 'kibana/public'; +import { DataView } from 'src/plugins/data/common'; import { KibanaContext, TimeRange, Filter, esQuery, Query } from '../../../../data/public'; import { TimelionVisDependencies } from '../plugin'; import { getTimezone } from './get_timezone'; import { TimelionVisParams } from '../timelion_vis_fn'; -import { getDataSearch } from '../helpers/plugin_services'; +import { getDataSearch, getIndexPatterns } from '../helpers/plugin_services'; import { VisSeries } from '../../common/vis_data'; interface Stats { @@ -81,6 +82,14 @@ export function getTimelionRequestHandler({ ); } + let dataView: DataView | undefined; + const firstFilterIndex = filters[0]?.meta.index; + if (firstFilterIndex) { + dataView = await getIndexPatterns() + .get(firstFilterIndex) + .catch(() => undefined); + } + const esQueryConfigs = esQuery.getEsQueryConfig(uiSettings); // parse the time range client side to make sure it behaves like other charts @@ -100,7 +109,7 @@ export function getTimelionRequestHandler({ sheet: [expression], extended: { es: { - filter: esQuery.buildEsQuery(undefined, query, filters, esQueryConfigs), + filter: esQuery.buildEsQuery(dataView, query, filters, esQueryConfigs), }, }, time: { diff --git a/src/plugins/vis_types/timelion/public/plugin.ts b/src/plugins/vis_types/timelion/public/plugin.ts index d37e15a9938b8..fb2b1df6f522e 100644 --- a/src/plugins/vis_types/timelion/public/plugin.ts +++ b/src/plugins/vis_types/timelion/public/plugin.ts @@ -13,6 +13,7 @@ import type { PluginInitializerContext, IUiSettingsClient, HttpSetup, + ThemeServiceStart, } from 'kibana/public'; import type { Plugin as ExpressionsPlugin } from 'src/plugins/expressions/public'; import type { @@ -37,6 +38,7 @@ export interface TimelionVisDependencies extends Partial { uiSettings: IUiSettingsClient; http: HttpSetup; timefilter: TimefilterContract; + theme: ThemeServiceStart; } /** @internal */ @@ -71,13 +73,14 @@ export class TimelionVisPlugin constructor(public initializerContext: PluginInitializerContext) {} public setup( - { uiSettings, http }: CoreSetup, + { uiSettings, http, theme }: CoreSetup, { expressions, visualizations, data, charts }: TimelionVisSetupDependencies ) { const dependencies: TimelionVisDependencies = { http, uiSettings, timefilter: data.query.timefilter.timefilter, + theme, }; expressions.registerFunction(() => getTimelionVisualizationConfig(dependencies)); diff --git a/src/plugins/vis_types/timelion/public/timelion_vis_renderer.tsx b/src/plugins/vis_types/timelion/public/timelion_vis_renderer.tsx index 633f15a9824ea..1ee88e06bad8b 100644 --- a/src/plugins/vis_types/timelion/public/timelion_vis_renderer.tsx +++ b/src/plugins/vis_types/timelion/public/timelion_vis_renderer.tsx @@ -10,7 +10,7 @@ import React, { lazy } from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; import { ExpressionRenderDefinition } from 'src/plugins/expressions'; -import { KibanaContextProvider } from '../../../kibana_react/public'; +import { KibanaContextProvider, KibanaThemeProvider } from '../../../kibana_react/public'; import { VisualizationContainer } from '../../../visualizations/public'; import { TimelionVisDependencies } from './plugin'; import { TimelionRenderValue } from './timelion_vis_fn'; @@ -58,14 +58,16 @@ export const getTimelionVisRenderer: ( render( - - - + + + + + , domNode ); diff --git a/src/plugins/vis_types/timeseries/public/application/components/aggs/agg.tsx b/src/plugins/vis_types/timeseries/public/application/components/aggs/agg.tsx index bc74be2a562f9..c527d123d576e 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/aggs/agg.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/aggs/agg.tsx @@ -8,7 +8,7 @@ import React, { useMemo, useEffect, HTMLAttributes } from 'react'; import { EuiCode } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; // @ts-ignore import { aggToComponent } from '../lib/agg_to_component'; // @ts-ignore diff --git a/src/plugins/vis_types/timeseries/public/application/components/aggs/calculation.js b/src/plugins/vis_types/timeseries/public/application/components/aggs/calculation.js index f0b0f6afb2b2d..01dbad3215bd6 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/aggs/calculation.js +++ b/src/plugins/vis_types/timeseries/public/application/components/aggs/calculation.js @@ -16,7 +16,7 @@ import { createSelectHandler } from '../lib/create_select_handler'; import { createTextHandler } from '../lib/create_text_handler'; import { CalculationVars, newVariable } from './vars'; import { TSVB_METRIC_TYPES } from '../../../../common/enums'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { htmlIdGenerator, diff --git a/src/plugins/vis_types/timeseries/public/application/components/aggs/cumulative_sum.js b/src/plugins/vis_types/timeseries/public/application/components/aggs/cumulative_sum.js index cb609f75137dd..7152582f7cd7b 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/aggs/cumulative_sum.js +++ b/src/plugins/vis_types/timeseries/public/application/components/aggs/cumulative_sum.js @@ -14,7 +14,7 @@ import { MetricSelect } from './metric_select'; import { createChangeHandler } from '../lib/create_change_handler'; import { createSelectHandler } from '../lib/create_select_handler'; import { TSVB_METRIC_TYPES } from '../../../../common/enums'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { htmlIdGenerator, EuiFlexGroup, diff --git a/src/plugins/vis_types/timeseries/public/application/components/aggs/derivative.js b/src/plugins/vis_types/timeseries/public/application/components/aggs/derivative.js index 7214fd3e19f72..f70acfcdcdc24 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/aggs/derivative.js +++ b/src/plugins/vis_types/timeseries/public/application/components/aggs/derivative.js @@ -24,7 +24,7 @@ import { EuiFormRow, EuiSpacer, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { getIndexPatternKey } from '../../../../common/index_patterns_utils'; export const DerivativeAgg = (props) => { diff --git a/src/plugins/vis_types/timeseries/public/application/components/aggs/filter_ratio.js b/src/plugins/vis_types/timeseries/public/application/components/aggs/filter_ratio.js index 59a372ccc1107..9f8285bc97e29 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/aggs/filter_ratio.js +++ b/src/plugins/vis_types/timeseries/public/application/components/aggs/filter_ratio.js @@ -23,7 +23,7 @@ import { EuiSpacer, EuiFormRow, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { KBN_FIELD_TYPES } from '../../../../../../../plugins/data/public'; import { getSupportedFieldsByMetricType } from '../lib/get_supported_fields_by_metric_type'; import { getDataStart } from '../../../services'; diff --git a/src/plugins/vis_types/timeseries/public/application/components/aggs/math.js b/src/plugins/vis_types/timeseries/public/application/components/aggs/math.js index f9b8b8f9632a0..6a436eb73ddff 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/aggs/math.js +++ b/src/plugins/vis_types/timeseries/public/application/components/aggs/math.js @@ -26,7 +26,7 @@ import { EuiCode, EuiSpacer, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; const checkModel = (model) => Array.isArray(model.variables) && model.script !== undefined; diff --git a/src/plugins/vis_types/timeseries/public/application/components/aggs/percentile.js b/src/plugins/vis_types/timeseries/public/application/components/aggs/percentile.js index 3e4159cdf42dc..b9512249de945 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/aggs/percentile.js +++ b/src/plugins/vis_types/timeseries/public/application/components/aggs/percentile.js @@ -22,7 +22,7 @@ import { EuiFormLabel, EuiFormRow, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { KBN_FIELD_TYPES } from '../../../../../../../plugins/data/public'; import { Percentiles, newPercentile } from './percentile_ui'; import { PercentileHdr } from './percentile_hdr'; diff --git a/src/plugins/vis_types/timeseries/public/application/components/aggs/percentile_hdr.tsx b/src/plugins/vis_types/timeseries/public/application/components/aggs/percentile_hdr.tsx index 5255378c1d080..e9fd8272e3179 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/aggs/percentile_hdr.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/aggs/percentile_hdr.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiFieldNumber, EuiFormRow, EuiIconTip } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export interface PercentileHdrProps { value: number | undefined; diff --git a/src/plugins/vis_types/timeseries/public/application/components/aggs/percentile_rank/percentile_rank.tsx b/src/plugins/vis_types/timeseries/public/application/components/aggs/percentile_rank/percentile_rank.tsx index 8b71dec15f17c..664c59b27fa39 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/aggs/percentile_rank/percentile_rank.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/aggs/percentile_rank/percentile_rank.tsx @@ -15,7 +15,7 @@ import { EuiSpacer, EuiFlexGrid, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { AggSelect } from '../agg_select'; import { FieldSelect } from '../field_select'; // @ts-ignore diff --git a/src/plugins/vis_types/timeseries/public/application/components/aggs/percentile_ui.js b/src/plugins/vis_types/timeseries/public/application/components/aggs/percentile_ui.js index bfd41b9cdfafc..f03b807e55a46 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/aggs/percentile_ui.js +++ b/src/plugins/vis_types/timeseries/public/application/components/aggs/percentile_ui.js @@ -25,7 +25,7 @@ import { EuiPanel, } from '@elastic/eui'; import { ColorPicker } from '../color_picker'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const newPercentile = (opts) => { return _.assign({ id: uuid.v1(), mode: 'line', shade: 0.2, color: TSVB_DEFAULT_COLOR }, opts); diff --git a/src/plugins/vis_types/timeseries/public/application/components/aggs/positive_only.js b/src/plugins/vis_types/timeseries/public/application/components/aggs/positive_only.js index 1960fef98e78c..05b798fd7826b 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/aggs/positive_only.js +++ b/src/plugins/vis_types/timeseries/public/application/components/aggs/positive_only.js @@ -22,7 +22,7 @@ import { EuiFormRow, EuiSpacer, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { getIndexPatternKey } from '../../../../common/index_patterns_utils'; export const PositiveOnlyAgg = (props) => { diff --git a/src/plugins/vis_types/timeseries/public/application/components/aggs/positive_rate.js b/src/plugins/vis_types/timeseries/public/application/components/aggs/positive_rate.js index ea3f8542e8595..20ae5ecd24310 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/aggs/positive_rate.js +++ b/src/plugins/vis_types/timeseries/public/application/components/aggs/positive_rate.js @@ -24,7 +24,7 @@ import { EuiLink, EuiComboBox, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { KBN_FIELD_TYPES } from '../../../../../../../plugins/data/public'; diff --git a/src/plugins/vis_types/timeseries/public/application/components/aggs/serial_diff.js b/src/plugins/vis_types/timeseries/public/application/components/aggs/serial_diff.js index a9e9bf6dbf56a..7bd673e1f8175 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/aggs/serial_diff.js +++ b/src/plugins/vis_types/timeseries/public/application/components/aggs/serial_diff.js @@ -23,7 +23,7 @@ import { EuiFormRow, EuiSpacer, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { getIndexPatternKey } from '../../../../common/index_patterns_utils'; export const SerialDiffAgg = (props) => { diff --git a/src/plugins/vis_types/timeseries/public/application/components/aggs/series_agg.js b/src/plugins/vis_types/timeseries/public/application/components/aggs/series_agg.js index c6afbaaee47da..bbcee19453cf6 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/aggs/series_agg.js +++ b/src/plugins/vis_types/timeseries/public/application/components/aggs/series_agg.js @@ -22,7 +22,7 @@ import { EuiFormRow, EuiSpacer, } from '@elastic/eui'; -import { injectI18n, FormattedMessage } from '@kbn/i18n/react'; +import { injectI18n, FormattedMessage } from '@kbn/i18n-react'; function SeriesAggUi(props) { const { panel, model, intl } = props; diff --git a/src/plugins/vis_types/timeseries/public/application/components/aggs/static.js b/src/plugins/vis_types/timeseries/public/application/components/aggs/static.js index 8dfbb49e61221..946c2912ae20a 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/aggs/static.js +++ b/src/plugins/vis_types/timeseries/public/application/components/aggs/static.js @@ -22,7 +22,7 @@ import { EuiFormRow, EuiSpacer, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const Static = (props) => { const handleChange = createChangeHandler(props.onChange, props.model); diff --git a/src/plugins/vis_types/timeseries/public/application/components/aggs/std_agg.js b/src/plugins/vis_types/timeseries/public/application/components/aggs/std_agg.js index 9dd705031e5b3..f8e187525205d 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/aggs/std_agg.js +++ b/src/plugins/vis_types/timeseries/public/application/components/aggs/std_agg.js @@ -14,7 +14,7 @@ import { AggRow } from './agg_row'; import { createChangeHandler } from '../lib/create_change_handler'; import { createSelectHandler } from '../lib/create_select_handler'; import { htmlIdGenerator, EuiFlexGroup, EuiFlexItem, EuiFormLabel, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { getSupportedFieldsByMetricType } from '../lib/get_supported_fields_by_metric_type'; export function StandardAgg(props) { diff --git a/src/plugins/vis_types/timeseries/public/application/components/aggs/std_deviation.js b/src/plugins/vis_types/timeseries/public/application/components/aggs/std_deviation.js index 728cda8720268..f9a54cb111740 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/aggs/std_deviation.js +++ b/src/plugins/vis_types/timeseries/public/application/components/aggs/std_deviation.js @@ -24,7 +24,7 @@ import { EuiFormRow, EuiSpacer, } from '@elastic/eui'; -import { injectI18n, FormattedMessage } from '@kbn/i18n/react'; +import { injectI18n, FormattedMessage } from '@kbn/i18n-react'; import { KBN_FIELD_TYPES } from '../../../../../../../plugins/data/public'; const RESTRICT_FIELDS = KBN_FIELD_TYPES.NUMBER; diff --git a/src/plugins/vis_types/timeseries/public/application/components/aggs/std_sibling.js b/src/plugins/vis_types/timeseries/public/application/components/aggs/std_sibling.js index e61d15c34648f..0319b9d140350 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/aggs/std_sibling.js +++ b/src/plugins/vis_types/timeseries/public/application/components/aggs/std_sibling.js @@ -26,7 +26,7 @@ import { EuiFormRow, EuiSpacer, } from '@elastic/eui'; -import { injectI18n, FormattedMessage } from '@kbn/i18n/react'; +import { injectI18n, FormattedMessage } from '@kbn/i18n-react'; import { getIndexPatternKey } from '../../../../common/index_patterns_utils'; const StandardSiblingAggUi = (props) => { diff --git a/src/plugins/vis_types/timeseries/public/application/components/aggs/top_hit.js b/src/plugins/vis_types/timeseries/public/application/components/aggs/top_hit.js index caf601dfab83e..7fa708331ac55 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/aggs/top_hit.js +++ b/src/plugins/vis_types/timeseries/public/application/components/aggs/top_hit.js @@ -23,7 +23,7 @@ import { EuiSpacer, EuiFormRow, } from '@elastic/eui'; -import { injectI18n, FormattedMessage } from '@kbn/i18n/react'; +import { injectI18n, FormattedMessage } from '@kbn/i18n-react'; import { KBN_FIELD_TYPES } from '../../../../../../../plugins/data/public'; import { PANEL_TYPES } from '../../../../common/enums'; import { getIndexPatternKey } from '../../../../common/index_patterns_utils'; diff --git a/src/plugins/vis_types/timeseries/public/application/components/annotation_row.tsx b/src/plugins/vis_types/timeseries/public/application/components/annotation_row.tsx index 734bdfecac673..bc408aef7092a 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/annotation_row.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/annotation_row.tsx @@ -18,7 +18,7 @@ import { EuiSpacer, htmlIdGenerator, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { getDataStart } from '../../services'; import { KBN_FIELD_TYPES, Query } from '../../../../../../plugins/data/public'; diff --git a/src/plugins/vis_types/timeseries/public/application/components/annotations_editor.tsx b/src/plugins/vis_types/timeseries/public/application/components/annotations_editor.tsx index b3683602aa345..e524301ec7769 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/annotations_editor.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/annotations_editor.tsx @@ -9,7 +9,7 @@ import React, { useCallback } from 'react'; import uuid from 'uuid'; import { EuiSpacer, EuiTitle, EuiButton, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { AnnotationRow } from './annotation_row'; import { collectionActions, CollectionActionsProps } from './lib/collection_actions'; diff --git a/src/plugins/vis_types/timeseries/public/application/components/color_rules.tsx b/src/plugins/vis_types/timeseries/public/application/components/color_rules.tsx index 0cc64528ae3f3..361e7baa1720a 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/color_rules.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/color_rules.tsx @@ -16,7 +16,7 @@ import { EuiFlexItem, EuiComboBoxOptionOption, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { AddDeleteButtons } from './add_delete_buttons'; diff --git a/src/plugins/vis_types/timeseries/public/application/components/data_format_picker.tsx b/src/plugins/vis_types/timeseries/public/application/components/data_format_picker.tsx index fa76f8534f852..fdfdd1427b51d 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/data_format_picker.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/data_format_picker.tsx @@ -8,7 +8,7 @@ import React, { useEffect, useMemo, useCallback, useState, ChangeEvent } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { EuiComboBoxOptionOption } from '@elastic/eui'; import { htmlIdGenerator, diff --git a/src/plugins/vis_types/timeseries/public/application/components/error.js b/src/plugins/vis_types/timeseries/public/application/components/error.js index b3c1fb9281e57..e6189eec7a352 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/error.js +++ b/src/plugins/vis_types/timeseries/public/application/components/error.js @@ -10,7 +10,7 @@ import { EuiIcon, EuiSpacer, EuiText } from '@elastic/eui'; import PropTypes from 'prop-types'; import React from 'react'; import _ from 'lodash'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; const guidPattern = /\[[[a-f\d-\\]{36}\]/g; diff --git a/src/plugins/vis_types/timeseries/public/application/components/index_pattern.js b/src/plugins/vis_types/timeseries/public/application/components/index_pattern.js index b01dbae8531c1..d4cf9347f7ab4 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/index_pattern.js +++ b/src/plugins/vis_types/timeseries/public/application/components/index_pattern.js @@ -29,7 +29,7 @@ import { LastValueModePopover } from './last_value_mode_popover'; import { KBN_FIELD_TYPES } from '../../../../../data/public'; import { isGteInterval, validateReInterval, isAutoInterval } from './lib/get_interval'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { PANEL_TYPES, TIME_RANGE_DATA_MODES, TIME_RANGE_MODE_KEY } from '../../../common/enums'; import { AUTO_INTERVAL } from '../../../common/constants'; import { isTimerangeModeEnabled } from '../lib/check_ui_restrictions'; diff --git a/src/plugins/vis_types/timeseries/public/application/components/last_value_mode_indicator.tsx b/src/plugins/vis_types/timeseries/public/application/components/last_value_mode_indicator.tsx index 15dc0a421efbc..7f6574c64e9e5 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/last_value_mode_indicator.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/last_value_mode_indicator.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexItem, EuiToolTip, EuiFlexGroup, EuiBadge } from '@elastic/eui'; import { getUISettings } from '../../services'; import { convertIntervalIntoUnit, isAutoInterval, isGteInterval } from './lib/get_interval'; diff --git a/src/plugins/vis_types/timeseries/public/application/components/lib/external_url_error_modal.tsx b/src/plugins/vis_types/timeseries/public/application/components/lib/external_url_error_modal.tsx index ebb806387d9cf..4e384e354bf47 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/lib/external_url_error_modal.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/lib/external_url_error_modal.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiModal, diff --git a/src/plugins/vis_types/timeseries/public/application/components/lib/index_pattern_select/index_pattern_select.tsx b/src/plugins/vis_types/timeseries/public/application/components/lib/index_pattern_select/index_pattern_select.tsx index d28e2c5e0fb9a..840787e2af1af 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/lib/index_pattern_select/index_pattern_select.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/lib/index_pattern_select/index_pattern_select.tsx @@ -8,7 +8,7 @@ import React, { useContext, useCallback } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFormRow, EuiText, EuiLink, htmlIdGenerator } from '@elastic/eui'; import { getCoreStart } from '../../../../services'; diff --git a/src/plugins/vis_types/timeseries/public/application/components/lib/index_pattern_select/switch_mode_popover.tsx b/src/plugins/vis_types/timeseries/public/application/components/lib/index_pattern_select/switch_mode_popover.tsx index 16eeaff30c208..ccd80d51cb756 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/lib/index_pattern_select/switch_mode_popover.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/lib/index_pattern_select/switch_mode_popover.tsx @@ -8,7 +8,7 @@ import React, { useState, useCallback } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonIcon, diff --git a/src/plugins/vis_types/timeseries/public/application/components/markdown_editor.js b/src/plugins/vis_types/timeseries/public/application/components/markdown_editor.js index 610c694e08121..27a6f75e7f1f7 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/markdown_editor.js +++ b/src/plugins/vis_types/timeseries/public/application/components/markdown_editor.js @@ -19,7 +19,7 @@ import { CodeEditor, MarkdownLang } from '../../../../../kibana_react/public'; import { EuiText, EuiCodeBlock, EuiSpacer, EuiTitle } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { getDataStart } from '../../services'; import { fetchIndexPattern } from '../../../common/index_patterns_utils'; diff --git a/src/plugins/vis_types/timeseries/public/application/components/panel_config/gauge.tsx b/src/plugins/vis_types/timeseries/public/application/components/panel_config/gauge.tsx index 8dcb385df9d25..d10140bc244b3 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/panel_config/gauge.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/panel_config/gauge.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 { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import React, { Component } from 'react'; import uuid from 'uuid'; diff --git a/src/plugins/vis_types/timeseries/public/application/components/panel_config/markdown.tsx b/src/plugins/vis_types/timeseries/public/application/components/panel_config/markdown.tsx index eee5bf0c92b15..0e8e7108d8e38 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/panel_config/markdown.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/panel_config/markdown.tsx @@ -21,7 +21,7 @@ import { EuiTitle, EuiHorizontalRule, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; // @ts-expect-error not typed yet diff --git a/src/plugins/vis_types/timeseries/public/application/components/panel_config/metric.tsx b/src/plugins/vis_types/timeseries/public/application/components/panel_config/metric.tsx index 33931d6150220..5eafc7b8a1ec3 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/panel_config/metric.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/panel_config/metric.tsx @@ -6,7 +6,7 @@ * Side Public License, v 1. */ import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { Component } from 'react'; import uuid from 'uuid'; import { diff --git a/src/plugins/vis_types/timeseries/public/application/components/panel_config/panel_config.tsx b/src/plugins/vis_types/timeseries/public/application/components/panel_config/panel_config.tsx index 3f92f89979071..bddd83027611a 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/panel_config/panel_config.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/panel_config/panel_config.tsx @@ -7,7 +7,7 @@ */ import React, { useState, useEffect, useCallback, useRef } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { TimeseriesVisData } from '../../../../common/types'; import { FormValidationContext } from '../../contexts/form_validation_context'; diff --git a/src/plugins/vis_types/timeseries/public/application/components/panel_config/table.tsx b/src/plugins/vis_types/timeseries/public/application/components/panel_config/table.tsx index ecbd9767f34a6..57ae699d281a0 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/panel_config/table.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/panel_config/table.tsx @@ -25,7 +25,7 @@ import { EuiText, EuiComboBoxOptionOption, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { FieldSelect } from '../aggs/field_select'; diff --git a/src/plugins/vis_types/timeseries/public/application/components/panel_config/timeseries.tsx b/src/plugins/vis_types/timeseries/public/application/components/panel_config/timeseries.tsx index 905b23a49f795..7c2a0b4527a3e 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/panel_config/timeseries.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/panel_config/timeseries.tsx @@ -6,7 +6,7 @@ * Side Public License, v 1. */ import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { Component } from 'react'; import { diff --git a/src/plugins/vis_types/timeseries/public/application/components/panel_config/top_n.tsx b/src/plugins/vis_types/timeseries/public/application/components/panel_config/top_n.tsx index 3cf41aa335eb6..07e261eb0971b 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/panel_config/top_n.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/panel_config/top_n.tsx @@ -6,7 +6,7 @@ * Side Public License, v 1. */ import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { Component } from 'react'; import uuid from 'uuid'; import { diff --git a/src/plugins/vis_types/timeseries/public/application/components/series.js b/src/plugins/vis_types/timeseries/public/application/components/series.js index 094548c7c8bcb..e6c315768ad59 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/series.js +++ b/src/plugins/vis_types/timeseries/public/application/components/series.js @@ -16,7 +16,7 @@ import { TopNSeries as topN } from './vis_types/top_n/series'; import { TableSeries as table } from './vis_types/table/series'; import { GaugeSeries as gauge } from './vis_types/gauge/series'; import { MarkdownSeries as markdown } from './vis_types/markdown/series'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { VisDataContext } from '../contexts/vis_data_context'; const lookup = { diff --git a/src/plugins/vis_types/timeseries/public/application/components/series_config.js b/src/plugins/vis_types/timeseries/public/application/components/series_config.js index 8189925b2f838..7c40bfcaa8c24 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/series_config.js +++ b/src/plugins/vis_types/timeseries/public/application/components/series_config.js @@ -7,7 +7,7 @@ */ import { i18n } from '@kbn/i18n'; import { last } from 'lodash'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import PropTypes from 'prop-types'; import React, { useMemo, useCallback } from 'react'; import { DataFormatPicker } from './data_format_picker'; diff --git a/src/plugins/vis_types/timeseries/public/application/components/series_config_query_bar_with_ignore_global_filter.js b/src/plugins/vis_types/timeseries/public/application/components/series_config_query_bar_with_ignore_global_filter.js index 032c14ab76808..36668b580ce76 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/series_config_query_bar_with_ignore_global_filter.js +++ b/src/plugins/vis_types/timeseries/public/application/components/series_config_query_bar_with_ignore_global_filter.js @@ -9,7 +9,7 @@ import PropTypes from 'prop-types'; import React from 'react'; import { htmlIdGenerator, EuiFlexItem, EuiFormRow, EuiToolTip, EuiFlexGroup } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { YesNo } from './yes_no'; import { getDefaultQueryLanguage } from './lib/get_default_query_language'; import { QueryBarWrapper } from './query_bar_wrapper'; diff --git a/src/plugins/vis_types/timeseries/public/application/components/splits/everything.js b/src/plugins/vis_types/timeseries/public/application/components/splits/everything.js index 4652d0d9bee30..102d362cee97b 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/splits/everything.js +++ b/src/plugins/vis_types/timeseries/public/application/components/splits/everything.js @@ -11,7 +11,7 @@ import { GroupBySelect } from './group_by_select'; import PropTypes from 'prop-types'; import React from 'react'; import { htmlIdGenerator, EuiFlexGroup, EuiFlexItem, EuiFormRow } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const SplitByEverything = (props) => { const { onChange, model, uiRestrictions } = props; diff --git a/src/plugins/vis_types/timeseries/public/application/components/splits/filter.js b/src/plugins/vis_types/timeseries/public/application/components/splits/filter.js index a53dc291fb6f0..b1872fcbc33b5 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/splits/filter.js +++ b/src/plugins/vis_types/timeseries/public/application/components/splits/filter.js @@ -10,7 +10,7 @@ import { GroupBySelect } from './group_by_select'; import PropTypes from 'prop-types'; import React from 'react'; import { htmlIdGenerator, EuiFlexGroup, EuiFlexItem, EuiFormRow } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { getDefaultQueryLanguage } from '../lib/get_default_query_language'; import { QueryBarWrapper } from '../query_bar_wrapper'; diff --git a/src/plugins/vis_types/timeseries/public/application/components/splits/filter_items.js b/src/plugins/vis_types/timeseries/public/application/components/splits/filter_items.js index 739988b0c2107..e9dabd713b9e8 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/splits/filter_items.js +++ b/src/plugins/vis_types/timeseries/public/application/components/splits/filter_items.js @@ -14,7 +14,7 @@ import { AddDeleteButtons } from '../add_delete_buttons'; import { ColorPicker } from '../color_picker'; import uuid from 'uuid'; import { EuiFieldText, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { injectI18n } from '@kbn/i18n/react'; +import { injectI18n } from '@kbn/i18n-react'; import { getDefaultQueryLanguage } from '../lib/get_default_query_language'; import { QueryBarWrapper } from '../query_bar_wrapper'; class FilterItemsUi extends Component { diff --git a/src/plugins/vis_types/timeseries/public/application/components/splits/filters.js b/src/plugins/vis_types/timeseries/public/application/components/splits/filters.js index edb1ce5927939..bbfce7b7612e0 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/splits/filters.js +++ b/src/plugins/vis_types/timeseries/public/application/components/splits/filters.js @@ -11,7 +11,7 @@ import { FilterItems } from './filter_items'; import PropTypes from 'prop-types'; import React from 'react'; import { htmlIdGenerator, EuiFlexGroup, EuiFlexItem, EuiFormRow } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; const RESET_STATE = { split_filters: undefined, diff --git a/src/plugins/vis_types/timeseries/public/application/components/splits/group_by_select.js b/src/plugins/vis_types/timeseries/public/application/components/splits/group_by_select.js index 68367b0ea55eb..bca48cdcdf3e9 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/splits/group_by_select.js +++ b/src/plugins/vis_types/timeseries/public/application/components/splits/group_by_select.js @@ -9,7 +9,7 @@ import PropTypes from 'prop-types'; import React from 'react'; import { EuiComboBox } from '@elastic/eui'; -import { injectI18n } from '@kbn/i18n/react'; +import { injectI18n } from '@kbn/i18n-react'; import { isGroupByFieldsEnabled } from '../../lib/check_ui_restrictions'; function GroupBySelectUi(props) { diff --git a/src/plugins/vis_types/timeseries/public/application/components/splits/terms.js b/src/plugins/vis_types/timeseries/public/application/components/splits/terms.js index 8a85c9826e937..80810f552d3a1 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/splits/terms.js +++ b/src/plugins/vis_types/timeseries/public/application/components/splits/terms.js @@ -24,7 +24,7 @@ import { EuiComboBox, EuiFieldText, } from '@elastic/eui'; -import { injectI18n, FormattedMessage } from '@kbn/i18n/react'; +import { injectI18n, FormattedMessage } from '@kbn/i18n-react'; import { KBN_FIELD_TYPES } from '../../../../../../data/public'; import { STACKED_OPTIONS } from '../../visualizations/constants'; import { getIndexPatternKey } from '../../../../common/index_patterns_utils'; diff --git a/src/plugins/vis_types/timeseries/public/application/components/splits/unsupported_split.js b/src/plugins/vis_types/timeseries/public/application/components/splits/unsupported_split.js index 6c37bd3e11456..3bba46b77ba92 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/splits/unsupported_split.js +++ b/src/plugins/vis_types/timeseries/public/application/components/splits/unsupported_split.js @@ -19,7 +19,7 @@ import { EuiTitle, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const SplitUnsupported = (props) => { const { onChange, model, uiRestrictions } = props; diff --git a/src/plugins/vis_types/timeseries/public/application/components/use_index_patter_mode_callout.tsx b/src/plugins/vis_types/timeseries/public/application/components/use_index_patter_mode_callout.tsx index b448bd80c0270..65014face7aaf 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/use_index_patter_mode_callout.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/use_index_patter_mode_callout.tsx @@ -7,7 +7,7 @@ */ import React, { useMemo, useCallback } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import useLocalStorage from 'react-use/lib/useLocalStorage'; import { EuiButton, EuiCallOut, EuiFlexGroup, EuiLink } from '@elastic/eui'; import { getCoreStart } from '../../services'; diff --git a/src/plugins/vis_types/timeseries/public/application/components/vis_editor_visualization.js b/src/plugins/vis_types/timeseries/public/application/components/vis_editor_visualization.js index c16d119e07a3f..5dad045ce1947 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/vis_editor_visualization.js +++ b/src/plugins/vis_types/timeseries/public/application/components/vis_editor_visualization.js @@ -9,7 +9,7 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { keys, EuiFlexGroup, EuiFlexItem, EuiButton, EuiText, EuiSwitch } from '@elastic/eui'; -import { FormattedMessage, injectI18n } from '@kbn/i18n/react'; +import { FormattedMessage, injectI18n } from '@kbn/i18n-react'; import { pluck } from 'rxjs/operators'; const MIN_CHART_HEIGHT = 300; diff --git a/src/plugins/vis_types/timeseries/public/application/components/vis_types/gauge/series.js b/src/plugins/vis_types/timeseries/public/application/components/vis_types/gauge/series.js index 46cc8b6ebe635..56d3ff96a7407 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/vis_types/gauge/series.js +++ b/src/plugins/vis_types/timeseries/public/application/components/vis_types/gauge/series.js @@ -22,7 +22,7 @@ import { EuiButtonIcon, } from '@elastic/eui'; import { createTextHandler } from '../../lib/create_text_handler'; -import { injectI18n, FormattedMessage } from '@kbn/i18n/react'; +import { injectI18n, FormattedMessage } from '@kbn/i18n-react'; import { Aggs } from '../../aggs/aggs'; function GaugeSeriesUi(props) { diff --git a/src/plugins/vis_types/timeseries/public/application/components/vis_types/markdown/series.js b/src/plugins/vis_types/timeseries/public/application/components/vis_types/markdown/series.js index f9817242a101a..d3ebcfac3fadc 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/vis_types/markdown/series.js +++ b/src/plugins/vis_types/timeseries/public/application/components/vis_types/markdown/series.js @@ -20,7 +20,7 @@ import { EuiFieldText, EuiButtonIcon, } from '@elastic/eui'; -import { injectI18n, FormattedMessage } from '@kbn/i18n/react'; +import { injectI18n, FormattedMessage } from '@kbn/i18n-react'; import { Aggs } from '../../aggs/aggs'; import { SeriesDragHandler } from '../../series_drag_handler'; diff --git a/src/plugins/vis_types/timeseries/public/application/components/vis_types/metric/series.js b/src/plugins/vis_types/timeseries/public/application/components/vis_types/metric/series.js index 5ec2378792812..c5e8043312cc3 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/vis_types/metric/series.js +++ b/src/plugins/vis_types/timeseries/public/application/components/vis_types/metric/series.js @@ -22,7 +22,7 @@ import { EuiButtonIcon, } from '@elastic/eui'; import { createTextHandler } from '../../lib/create_text_handler'; -import { injectI18n, FormattedMessage } from '@kbn/i18n/react'; +import { injectI18n, FormattedMessage } from '@kbn/i18n-react'; import { Aggs } from '../../aggs/aggs'; function MetricSeriesUi(props) { diff --git a/src/plugins/vis_types/timeseries/public/application/components/vis_types/table/config.js b/src/plugins/vis_types/timeseries/public/application/components/vis_types/table/config.js index e7d13e1497f5c..3fe74f3495292 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/vis_types/table/config.js +++ b/src/plugins/vis_types/timeseries/public/application/components/vis_types/table/config.js @@ -30,7 +30,7 @@ import { EuiSpacer, EuiTitle, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { getDefaultQueryLanguage } from '../../lib/get_default_query_language'; import { checkIfNumericMetric } from '../../lib/check_if_numeric_metric'; import { QueryBarWrapper } from '../../query_bar_wrapper'; diff --git a/src/plugins/vis_types/timeseries/public/application/components/vis_types/table/series.js b/src/plugins/vis_types/timeseries/public/application/components/vis_types/table/series.js index acd2f4cc17d4a..1d456c733103e 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/vis_types/table/series.js +++ b/src/plugins/vis_types/timeseries/public/application/components/vis_types/table/series.js @@ -20,7 +20,7 @@ import { EuiButtonIcon, } from '@elastic/eui'; import { createTextHandler } from '../../lib/create_text_handler'; -import { FormattedMessage, injectI18n } from '@kbn/i18n/react'; +import { FormattedMessage, injectI18n } from '@kbn/i18n-react'; import { Aggs } from '../../aggs/aggs'; function TableSeriesUI(props) { diff --git a/src/plugins/vis_types/timeseries/public/application/components/vis_types/table/vis.js b/src/plugins/vis_types/timeseries/public/application/components/vis_types/table/vis.js index b3a48a997b301..7289c69ba501b 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/vis_types/table/vis.js +++ b/src/plugins/vis_types/timeseries/public/application/components/vis_types/table/vis.js @@ -19,7 +19,7 @@ import { EuiToolTip, EuiIcon } from '@elastic/eui'; import { replaceVars } from '../../lib/replace_vars'; import { ExternalUrlErrorModal } from '../../lib/external_url_error_modal'; import { FIELD_FORMAT_IDS } from '../../../../../../../../plugins/field_formats/common'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { getFieldFormats, getCoreStart } from '../../../../services'; import { DATA_FORMATTERS } from '../../../../../common/enums'; import { getValueOrEmpty } from '../../../../../common/empty_label'; diff --git a/src/plugins/vis_types/timeseries/public/application/components/vis_types/timeseries/config.js b/src/plugins/vis_types/timeseries/public/application/components/vis_types/timeseries/config.js index 208f9af9bb250..87e2efd818af6 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/vis_types/timeseries/config.js +++ b/src/plugins/vis_types/timeseries/public/application/components/vis_types/timeseries/config.js @@ -27,7 +27,7 @@ import { EuiHorizontalRule, EuiFieldNumber, } from '@elastic/eui'; -import { FormattedMessage, injectI18n } from '@kbn/i18n/react'; +import { FormattedMessage, injectI18n } from '@kbn/i18n-react'; import { SeriesConfigQueryBarWithIgnoreGlobalFilter } from '../../series_config_query_bar_with_ignore_global_filter'; import { PalettePicker } from '../../palette_picker'; import { getCharts } from '../../../../services'; diff --git a/src/plugins/vis_types/timeseries/public/application/components/vis_types/timeseries/series.js b/src/plugins/vis_types/timeseries/public/application/components/vis_types/timeseries/series.js index 30a5867d799cb..d9d5cdb576c03 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/vis_types/timeseries/series.js +++ b/src/plugins/vis_types/timeseries/public/application/components/vis_types/timeseries/series.js @@ -23,7 +23,7 @@ import { } from '@elastic/eui'; import { Split } from '../../split'; import { createTextHandler } from '../../lib/create_text_handler'; -import { FormattedMessage, injectI18n } from '@kbn/i18n/react'; +import { FormattedMessage, injectI18n } from '@kbn/i18n-react'; const TimeseriesSeriesUI = injectI18n(function (props) { const { diff --git a/src/plugins/vis_types/timeseries/public/application/components/vis_types/top_n/series.js b/src/plugins/vis_types/timeseries/public/application/components/vis_types/top_n/series.js index 61bb7e2473dd9..2045f0379b76d 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/vis_types/top_n/series.js +++ b/src/plugins/vis_types/timeseries/public/application/components/vis_types/top_n/series.js @@ -22,7 +22,7 @@ import { EuiButtonIcon, } from '@elastic/eui'; import { createTextHandler } from '../../lib/create_text_handler'; -import { FormattedMessage, injectI18n } from '@kbn/i18n/react'; +import { FormattedMessage, injectI18n } from '@kbn/i18n-react'; import { Aggs } from '../../aggs/aggs'; export const TopNSeries = injectI18n(function (props) { diff --git a/src/plugins/vis_types/timeseries/public/application/components/yes_no.tsx b/src/plugins/vis_types/timeseries/public/application/components/yes_no.tsx index 81ce4f50b0313..ad01a8577e1cf 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/yes_no.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/yes_no.tsx @@ -8,7 +8,7 @@ import React, { useCallback } from 'react'; import { EuiRadio, htmlIdGenerator } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { TimeseriesVisParams } from '../../types'; interface YesNoProps { diff --git a/src/plugins/vis_types/timeseries/public/application/editor_controller.tsx b/src/plugins/vis_types/timeseries/public/application/editor_controller.tsx index 2f5ee2b8a631d..ffe1c90132360 100644 --- a/src/plugins/vis_types/timeseries/public/application/editor_controller.tsx +++ b/src/plugins/vis_types/timeseries/public/application/editor_controller.tsx @@ -12,9 +12,10 @@ import type { EventEmitter } from 'events'; import type { Vis, VisualizeEmbeddableContract } from 'src/plugins/visualizations/public'; import type { IEditorController, EditorRenderProps } from 'src/plugins/visualize/public'; -import { getUISettings, getI18n } from '../services'; +import { getUISettings, getI18n, getCoreStart } from '../services'; import { VisEditor } from './components/vis_editor_lazy'; import type { TimeseriesVisParams } from '../types'; +import { KibanaThemeProvider } from '../../../../../../src/plugins/kibana_react/public'; export const TSVB_EDITOR_NAME = 'tsvbEditor'; @@ -31,16 +32,18 @@ export class EditorController implements IEditorController { render( - + + + , this.el ); diff --git a/src/plugins/vis_types/timeseries/public/plugin.ts b/src/plugins/vis_types/timeseries/public/plugin.ts index d6d83caa6eb0f..3d75c914826ce 100644 --- a/src/plugins/vis_types/timeseries/public/plugin.ts +++ b/src/plugins/vis_types/timeseries/public/plugin.ts @@ -56,6 +56,7 @@ export class MetricsPlugin implements Plugin { expressions.registerRenderer( getTimeseriesVisRenderer({ uiSettings: core.uiSettings, + theme: core.theme, }) ); setUISettings(core.uiSettings); diff --git a/src/plugins/vis_types/timeseries/public/timeseries_vis_renderer.tsx b/src/plugins/vis_types/timeseries/public/timeseries_vis_renderer.tsx index 9edc05893e24f..f1b68737c268e 100644 --- a/src/plugins/vis_types/timeseries/public/timeseries_vis_renderer.tsx +++ b/src/plugins/vis_types/timeseries/public/timeseries_vis_renderer.tsx @@ -10,8 +10,8 @@ import React, { lazy } from 'react'; import { get } from 'lodash'; import { render, unmountComponentAtNode } from 'react-dom'; -import { I18nProvider } from '@kbn/i18n/react'; -import { IUiSettingsClient } from 'kibana/public'; +import { I18nProvider } from '@kbn/i18n-react'; +import { IUiSettingsClient, ThemeServiceStart } from 'kibana/public'; import { VisualizationContainer, PersistedState } from '../../../visualizations/public'; @@ -21,6 +21,7 @@ import { isVisTableData } from '../common/vis_data_utils'; import type { TimeseriesVisParams } from './types'; import type { ExpressionRenderDefinition } from '../../../expressions/common'; import type { TimeseriesRenderValue } from './metrics_fn'; +import { KibanaThemeProvider } from '../../../../../src/plugins/kibana_react/public'; const TimeseriesVisualization = lazy( () => import('./application/components/timeseries_visualization') @@ -37,7 +38,8 @@ const checkIfDataExists = (visData: TimeseriesVisData | {}, model: TimeseriesVis export const getTimeseriesVisRenderer: (deps: { uiSettings: IUiSettingsClient; -}) => ExpressionRenderDefinition = ({ uiSettings }) => ({ + theme: ThemeServiceStart; +}) => ExpressionRenderDefinition = ({ uiSettings, theme }) => ({ name: 'timeseries_vis', reuseDomNode: true, render: async (domNode, config, handlers) => { @@ -54,22 +56,24 @@ export const getTimeseriesVisRenderer: (deps: { render( - - + - + showNoResult={showNoResult} + error={get(visData, [model.id, 'error'])} + > + + + , domNode, () => { diff --git a/src/plugins/vis_types/vega/public/components/deprecated_interval_info.tsx b/src/plugins/vis_types/vega/public/components/deprecated_interval_info.tsx index 23144a4c2084d..9d2a18d6e0077 100644 --- a/src/plugins/vis_types/vega/public/components/deprecated_interval_info.tsx +++ b/src/plugins/vis_types/vega/public/components/deprecated_interval_info.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiCallOut, EuiButtonIcon } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { VegaSpec } from '../data_model/types'; import { getDocLinks } from '../services'; diff --git a/src/plugins/vis_types/vega/public/components/experimental_map_vis_info.tsx b/src/plugins/vis_types/vega/public/components/experimental_map_vis_info.tsx index 8a1f2c2794974..6d6ed0a6c1cc8 100644 --- a/src/plugins/vis_types/vega/public/components/experimental_map_vis_info.tsx +++ b/src/plugins/vis_types/vega/public/components/experimental_map_vis_info.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiCallOut, EuiLink } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { VegaSpec } from '../data_model/types'; diff --git a/src/plugins/vis_types/vega/public/components/vega_actions_menu.tsx b/src/plugins/vis_types/vega/public/components/vega_actions_menu.tsx index 27f69cc45998b..d59593f29fb01 100644 --- a/src/plugins/vis_types/vega/public/components/vega_actions_menu.tsx +++ b/src/plugins/vis_types/vega/public/components/vega_actions_menu.tsx @@ -8,7 +8,7 @@ import React, { useState, useCallback } from 'react'; import { EuiButtonIcon, EuiContextMenuPanel, EuiContextMenuItem, EuiPopover } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; interface VegaActionsMenuProps { diff --git a/src/plugins/vis_types/vega/public/components/vega_help_menu.tsx b/src/plugins/vis_types/vega/public/components/vega_help_menu.tsx index f5b0f614458fd..589c84aac24c5 100644 --- a/src/plugins/vis_types/vega/public/components/vega_help_menu.tsx +++ b/src/plugins/vis_types/vega/public/components/vega_help_menu.tsx @@ -8,7 +8,7 @@ import React, { useCallback, useState } from 'react'; import { EuiButtonIcon, EuiContextMenuPanel, EuiContextMenuItem, EuiPopover } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { getDocLinks } from '../services'; diff --git a/src/plugins/vis_types/vega/public/vega_request_handler.ts b/src/plugins/vis_types/vega/public/vega_request_handler.ts index 2ae7169c2f732..78552ea2a170a 100644 --- a/src/plugins/vis_types/vega/public/vega_request_handler.ts +++ b/src/plugins/vis_types/vega/public/vega_request_handler.ts @@ -6,6 +6,7 @@ * Side Public License, v 1. */ import type { KibanaExecutionContext } from 'src/core/public'; +import { DataView } from 'src/plugins/data/common'; import { Filter, esQuery, TimeRange, Query } from '../../../data/public'; import { SearchAPI } from './data_model/search_api'; @@ -18,7 +19,7 @@ import { VegaInspectorAdapters } from './vega_inspector'; interface VegaRequestHandlerParams { query: Query; - filters: Filter; + filters: Filter[]; timeRange: TimeRange; visParams: VisParams; searchSessionId?: string; @@ -46,14 +47,14 @@ export function createVegaRequestHandler( searchSessionId, executionContext, }: VegaRequestHandlerParams) { - if (!searchAPI) { - const { search, indexPatterns } = getData(); + const { dataViews, search } = getData(); + if (!searchAPI) { searchAPI = new SearchAPI( { uiSettings, search, - indexPatterns, + indexPatterns: dataViews, injectedMetadata: getInjectedMetadata(), }, context.abortSignal, @@ -65,8 +66,14 @@ export function createVegaRequestHandler( timeCache.setTimeRange(timeRange); + let dataView: DataView; + const firstFilterIndex = filters[0]?.meta.index; + if (firstFilterIndex) { + dataView = await dataViews.get(firstFilterIndex).catch(() => undefined); + } + const esQueryConfigs = esQuery.getEsQueryConfig(uiSettings); - const filtersDsl = esQuery.buildEsQuery(undefined, query, filters, esQueryConfigs); + const filtersDsl = esQuery.buildEsQuery(dataView, query, filters, esQueryConfigs); const { VegaParser } = await import('./data_model/vega_parser'); const vp = new VegaParser(visParams.spec, searchAPI, timeCache, filtersDsl, getServiceSettings); diff --git a/src/plugins/vis_types/vega/public/vega_vis_renderer.tsx b/src/plugins/vis_types/vega/public/vega_vis_renderer.tsx index 77af6dfdcf042..e6a39f5a18e83 100644 --- a/src/plugins/vis_types/vega/public/vega_vis_renderer.tsx +++ b/src/plugins/vis_types/vega/public/vega_vis_renderer.tsx @@ -10,6 +10,7 @@ import React, { lazy } from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; import { ExpressionRenderDefinition } from 'src/plugins/expressions'; +import { KibanaThemeProvider } from '../../../kibana_react/public'; import { VisualizationContainer } from '../../../visualizations/public'; import { VegaVisualizationDependencies } from './plugin'; import { RenderValue } from './vega_fn'; @@ -26,14 +27,16 @@ export const getVegaVisRenderer: ( }); render( - - - , + + + + + , domNode ); }, diff --git a/src/plugins/vis_types/vislib/kibana.json b/src/plugins/vis_types/vislib/kibana.json index dfefa11cb06e5..f4bceb80d8c9e 100644 --- a/src/plugins/vis_types/vislib/kibana.json +++ b/src/plugins/vis_types/vislib/kibana.json @@ -4,7 +4,7 @@ "server": true, "ui": true, "requiredPlugins": ["charts", "data", "expressions", "visualizations"], - "requiredBundles": ["kibanaUtils", "visDefaultEditor", "visTypeXy", "visTypePie", "fieldFormats"], + "requiredBundles": ["kibanaUtils", "visDefaultEditor", "visTypeXy", "visTypePie", "fieldFormats", "kibanaReact"], "owner": { "name": "Vis Editors", "githubTeam": "kibana-vis-editors" diff --git a/src/plugins/vis_types/vislib/public/editor/components/gauge/labels_panel.tsx b/src/plugins/vis_types/vislib/public/editor/components/gauge/labels_panel.tsx index 4650a37d2f986..fb5c1594e601a 100644 --- a/src/plugins/vis_types/vislib/public/editor/components/gauge/labels_panel.tsx +++ b/src/plugins/vis_types/vislib/public/editor/components/gauge/labels_panel.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { EuiPanel, EuiSpacer, EuiTitle } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { SwitchOption, TextInputOption } from '../../../../../../vis_default_editor/public'; import { GaugeOptionsInternalProps } from '../gauge'; diff --git a/src/plugins/vis_types/vislib/public/editor/components/gauge/ranges_panel.tsx b/src/plugins/vis_types/vislib/public/editor/components/gauge/ranges_panel.tsx index 0cb6d7d5940fd..70626062642da 100644 --- a/src/plugins/vis_types/vislib/public/editor/components/gauge/ranges_panel.tsx +++ b/src/plugins/vis_types/vislib/public/editor/components/gauge/ranges_panel.tsx @@ -9,7 +9,7 @@ import React, { useCallback } from 'react'; import { EuiPanel, EuiSpacer, EuiTitle } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ColorRanges, SetColorRangeValue, diff --git a/src/plugins/vis_types/vislib/public/editor/components/gauge/style_panel.tsx b/src/plugins/vis_types/vislib/public/editor/components/gauge/style_panel.tsx index 30bdab93cdfa8..89594a1f21e96 100644 --- a/src/plugins/vis_types/vislib/public/editor/components/gauge/style_panel.tsx +++ b/src/plugins/vis_types/vislib/public/editor/components/gauge/style_panel.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { EuiPanel, EuiSpacer, EuiTitle } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { SelectOption } from '../../../../../../vis_default_editor/public'; import { GaugeOptionsInternalProps } from '../gauge'; diff --git a/src/plugins/vis_types/vislib/public/editor/components/heatmap/index.tsx b/src/plugins/vis_types/vislib/public/editor/components/heatmap/index.tsx index c0d89f2f66958..4e5d43eb7089a 100644 --- a/src/plugins/vis_types/vislib/public/editor/components/heatmap/index.tsx +++ b/src/plugins/vis_types/vislib/public/editor/components/heatmap/index.tsx @@ -10,7 +10,7 @@ import React, { useCallback, useEffect, useState } from 'react'; import { EuiPanel, EuiSpacer, EuiTitle } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { VisEditorOptionsProps } from 'src/plugins/visualizations/public'; import { ValueAxis } from '../../../../../xy/public'; diff --git a/src/plugins/vis_types/vislib/public/editor/components/heatmap/labels_panel.tsx b/src/plugins/vis_types/vislib/public/editor/components/heatmap/labels_panel.tsx index 05b8949901e79..e5e41500e39e7 100644 --- a/src/plugins/vis_types/vislib/public/editor/components/heatmap/labels_panel.tsx +++ b/src/plugins/vis_types/vislib/public/editor/components/heatmap/labels_panel.tsx @@ -10,7 +10,7 @@ import React, { useCallback } from 'react'; import { EuiColorPicker, EuiFormRow, EuiPanel, EuiSpacer, EuiTitle } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { VisEditorOptionsProps } from 'src/plugins/visualizations/public'; import { SwitchOption } from '../../../../../../vis_default_editor/public'; diff --git a/src/plugins/vis_types/vislib/public/gauge.ts b/src/plugins/vis_types/vislib/public/gauge.ts index e03abf5d90cbe..51cd7ea7622df 100644 --- a/src/plugins/vis_types/vislib/public/gauge.ts +++ b/src/plugins/vis_types/vislib/public/gauge.ts @@ -132,7 +132,7 @@ export const gaugeVisTypeDefinition: VisTypeDefinition = { }), min: 0, max: 1, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], }, ], }, diff --git a/src/plugins/vis_types/vislib/public/goal.ts b/src/plugins/vis_types/vislib/public/goal.ts index 5e6074b12ce47..05ad1f53904d7 100644 --- a/src/plugins/vis_types/vislib/public/goal.ts +++ b/src/plugins/vis_types/vislib/public/goal.ts @@ -96,7 +96,7 @@ export const goalVisTypeDefinition: VisTypeDefinition = { }), min: 0, max: 1, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], }, ], }, diff --git a/src/plugins/vis_types/vislib/public/heatmap.ts b/src/plugins/vis_types/vislib/public/heatmap.ts index 3ea3a4b1e4a06..3b0cc369541f4 100644 --- a/src/plugins/vis_types/vislib/public/heatmap.ts +++ b/src/plugins/vis_types/vislib/public/heatmap.ts @@ -107,7 +107,7 @@ export const heatmapVisTypeDefinition: VisTypeDefinition = { }), min: 0, max: 1, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], }, { group: AggGroupNames.Buckets, @@ -115,7 +115,7 @@ export const heatmapVisTypeDefinition: VisTypeDefinition = { title: i18n.translate('visTypeVislib.heatmap.groupTitle', { defaultMessage: 'Y-axis' }), min: 0, max: 1, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], }, { group: AggGroupNames.Buckets, @@ -125,7 +125,7 @@ export const heatmapVisTypeDefinition: VisTypeDefinition = { }), min: 0, max: 1, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], }, ], }, diff --git a/src/plugins/vis_types/vislib/public/plugin.ts b/src/plugins/vis_types/vislib/public/plugin.ts index 07e9b72aa429f..ba73e653e6a35 100644 --- a/src/plugins/vis_types/vislib/public/plugin.ts +++ b/src/plugins/vis_types/vislib/public/plugin.ts @@ -17,7 +17,7 @@ import { LEGACY_PIE_CHARTS_LIBRARY } from '../../pie/common/index'; import { createVisTypeVislibVisFn } from './vis_type_vislib_vis_fn'; import { createPieVisFn } from './pie_fn'; import { visLibVisTypeDefinitions, pieVisTypeDefinition } from './vis_type_vislib_vis_types'; -import { setFormatService, setDataActions } from './services'; +import { setFormatService, setDataActions, setTheme } from './services'; import { getVislibVisRenderer } from './vis_renderer'; /** @internal */ @@ -60,5 +60,6 @@ export class VisTypeVislibPlugin public start(core: CoreStart, { data }: VisTypeVislibPluginStartDependencies) { setFormatService(data.fieldFormats); setDataActions(data.actions); + setTheme(core.theme); } } diff --git a/src/plugins/vis_types/vislib/public/services.ts b/src/plugins/vis_types/vislib/public/services.ts index 21fb77a4d41ca..7afe16867bab4 100644 --- a/src/plugins/vis_types/vislib/public/services.ts +++ b/src/plugins/vis_types/vislib/public/services.ts @@ -6,6 +6,7 @@ * Side Public License, v 1. */ +import { ThemeServiceStart } from 'kibana/public'; import { createGetterSetter } from '../../../kibana_utils/public'; import { DataPublicPluginStart } from '../../../data/public'; @@ -15,3 +16,5 @@ export const [getDataActions, setDataActions] = export const [getFormatService, setFormatService] = createGetterSetter< DataPublicPluginStart['fieldFormats'] >('vislib data.fieldFormats'); + +export const [getTheme, setTheme] = createGetterSetter('vislib theme service'); diff --git a/src/plugins/vis_types/vislib/public/vis_renderer.tsx b/src/plugins/vis_types/vislib/public/vis_renderer.tsx index 04c4c3cedc9d2..906c8efb69cf2 100644 --- a/src/plugins/vis_types/vislib/public/vis_renderer.tsx +++ b/src/plugins/vis_types/vislib/public/vis_renderer.tsx @@ -9,6 +9,7 @@ import React, { lazy } from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; +import { KibanaThemeProvider } from '../../../kibana_react/public'; import { ExpressionRenderDefinition } from '../../../expressions/public'; import { VisualizationContainer } from '../../../visualizations/public'; import { ChartsPluginSetup } from '../../../charts/public'; @@ -44,9 +45,11 @@ export const getVislibVisRenderer: ( handlers.onDestroy(() => unmountComponentAtNode(domNode)); render( - - - , + + + + + , domNode ); }, diff --git a/src/plugins/vis_types/vislib/public/vislib/components/legend/legend.test.tsx b/src/plugins/vis_types/vislib/public/vislib/components/legend/legend.test.tsx index 34c1772ecdc17..7f948917764df 100644 --- a/src/plugins/vis_types/vislib/public/vislib/components/legend/legend.test.tsx +++ b/src/plugins/vis_types/vislib/public/vislib/components/legend/legend.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { mount, ReactWrapper } from 'enzyme'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { EuiButtonGroup } from '@elastic/eui'; import { VisLegend, VisLegendProps } from './legend'; diff --git a/src/plugins/vis_types/vislib/public/vislib/components/tooltip/_hierarchical_tooltip_formatter.js b/src/plugins/vis_types/vislib/public/vislib/components/tooltip/_hierarchical_tooltip_formatter.js index 288907dd39ac5..3dc2d4976f63d 100644 --- a/src/plugins/vis_types/vislib/public/vislib/components/tooltip/_hierarchical_tooltip_formatter.js +++ b/src/plugins/vis_types/vislib/public/vislib/components/tooltip/_hierarchical_tooltip_formatter.js @@ -11,7 +11,7 @@ import _ from 'lodash'; import numeral from '@elastic/numeral'; import { renderToStaticMarkup } from 'react-dom/server'; -import { FormattedMessage, I18nProvider } from '@kbn/i18n/react'; +import { FormattedMessage, I18nProvider } from '@kbn/i18n-react'; import { collectBranch } from './_collect_branch'; diff --git a/src/plugins/vis_types/vislib/public/vislib/partials/touchdown_template.tsx b/src/plugins/vis_types/vislib/public/vislib/partials/touchdown_template.tsx index 731fbed7482c4..4338b0bc99cca 100644 --- a/src/plugins/vis_types/vislib/public/vislib/partials/touchdown_template.tsx +++ b/src/plugins/vis_types/vislib/public/vislib/partials/touchdown_template.tsx @@ -9,6 +9,8 @@ import React from 'react'; import ReactDOM from 'react-dom/server'; import { EuiIcon } from '@elastic/eui'; +import { KibanaThemeProvider } from '../../../../../kibana_react/public'; +import { getTheme } from '../../services'; interface Props { wholeBucket: boolean; @@ -16,12 +18,14 @@ interface Props { export const touchdownTemplate = ({ wholeBucket }: Props) => { return ReactDOM.renderToStaticMarkup( -

- - - {wholeBucket ? 'Part of this bucket' : 'This area'} may contain partial data. The selected - time range does not fully cover it. - -

+ +

+ + + {wholeBucket ? 'Part of this bucket' : 'This area'} may contain partial data. The selected + time range does not fully cover it. + +

+
); }; diff --git a/src/plugins/vis_types/xy/kibana.json b/src/plugins/vis_types/xy/kibana.json index 1606af5944ad3..a37393b2439d4 100644 --- a/src/plugins/vis_types/xy/kibana.json +++ b/src/plugins/vis_types/xy/kibana.json @@ -4,7 +4,7 @@ "ui": true, "server": true, "requiredPlugins": ["charts", "data", "expressions", "visualizations", "usageCollection"], - "requiredBundles": ["kibanaUtils", "visDefaultEditor"], + "requiredBundles": ["kibanaUtils", "visDefaultEditor", "kibanaReact"], "extraPublicDirs": ["common/index"], "owner": { "name": "Vis Editors", diff --git a/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/category_axis_panel.tsx b/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/category_axis_panel.tsx index c3d1d2dcfee4d..ef3e591220efc 100644 --- a/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/category_axis_panel.tsx +++ b/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/category_axis_panel.tsx @@ -9,7 +9,7 @@ import React, { useCallback } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiPanel, EuiTitle, EuiSpacer } from '@elastic/eui'; import { Position } from '@elastic/charts'; diff --git a/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/label_options.tsx b/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/label_options.tsx index ed7ac178d3d8b..d24ebaa61d1d3 100644 --- a/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/label_options.tsx +++ b/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/label_options.tsx @@ -10,7 +10,7 @@ import React, { useCallback, useMemo } from 'react'; import { EuiTitle, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiToolTip } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { SelectOption, SwitchOption } from '../../../../../../../vis_default_editor/public'; import { Labels } from '../../../../../../../charts/public'; diff --git a/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/series_panel.tsx b/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/series_panel.tsx index 69fbbcf80e28b..1928b47c64a6e 100644 --- a/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/series_panel.tsx +++ b/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/series_panel.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { EuiPanel, EuiTitle, EuiSpacer, EuiAccordion } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Vis } from '../../../../../../../visualizations/public'; diff --git a/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/value_axes_panel.tsx b/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/value_axes_panel.tsx index 02bdb7b185288..2f19be2b1a4f0 100644 --- a/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/value_axes_panel.tsx +++ b/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/value_axes_panel.tsx @@ -18,7 +18,7 @@ import { EuiToolTip, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { SeriesParam, ValueAxis } from '../../../../types'; import { ValueAxisOptions } from './value_axis_options'; diff --git a/src/plugins/vis_types/xy/public/editor/components/options/point_series/grid_panel.tsx b/src/plugins/vis_types/xy/public/editor/components/options/point_series/grid_panel.tsx index c536d2866b8da..14a5c2667499f 100644 --- a/src/plugins/vis_types/xy/public/editor/components/options/point_series/grid_panel.tsx +++ b/src/plugins/vis_types/xy/public/editor/components/options/point_series/grid_panel.tsx @@ -9,7 +9,7 @@ import React, { useMemo, useCallback } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiPanel, EuiTitle, EuiSpacer } from '@elastic/eui'; import { SelectOption, SwitchOption } from '../../../../../../../vis_default_editor/public'; diff --git a/src/plugins/vis_types/xy/public/editor/components/options/point_series/point_series.mocks.ts b/src/plugins/vis_types/xy/public/editor/components/options/point_series/point_series.mocks.ts index b01a04c162375..41ab13d54f7c6 100644 --- a/src/plugins/vis_types/xy/public/editor/components/options/point_series/point_series.mocks.ts +++ b/src/plugins/vis_types/xy/public/editor/components/options/point_series/point_series.mocks.ts @@ -625,7 +625,7 @@ export const getVis = (bucketType: string) => { title: 'X-axis', min: 0, max: 1, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], params: [], }, { @@ -634,7 +634,7 @@ export const getVis = (bucketType: string) => { title: 'Split series', min: 0, max: 3, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], params: [], }, { @@ -643,7 +643,7 @@ export const getVis = (bucketType: string) => { title: 'Split chart', min: 0, max: 1, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], params: [ { name: 'row', @@ -688,7 +688,7 @@ export const getVis = (bucketType: string) => { title: 'X-axis', min: 0, max: 1, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], params: [], }, { @@ -697,7 +697,7 @@ export const getVis = (bucketType: string) => { title: 'Split series', min: 0, max: 3, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], params: [], }, { @@ -706,7 +706,7 @@ export const getVis = (bucketType: string) => { title: 'Split chart', min: 0, max: 1, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], params: [ { name: 'row', @@ -722,7 +722,7 @@ export const getVis = (bucketType: string) => { title: 'X-axis', min: 0, max: 1, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], params: [], }, { @@ -731,7 +731,7 @@ export const getVis = (bucketType: string) => { title: 'Split series', min: 0, max: 3, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], params: [], }, { @@ -740,7 +740,7 @@ export const getVis = (bucketType: string) => { title: 'Split chart', min: 0, max: 1, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], params: [ { name: 'row', diff --git a/src/plugins/vis_types/xy/public/editor/components/options/point_series/point_series.tsx b/src/plugins/vis_types/xy/public/editor/components/options/point_series/point_series.tsx index 62dbd94c516d7..151d25cb49c13 100644 --- a/src/plugins/vis_types/xy/public/editor/components/options/point_series/point_series.tsx +++ b/src/plugins/vis_types/xy/public/editor/components/options/point_series/point_series.tsx @@ -9,7 +9,7 @@ import React, { useMemo } from 'react'; import { EuiPanel, EuiTitle, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { BasicOptions, diff --git a/src/plugins/vis_types/xy/public/editor/components/options/point_series/threshold_panel.tsx b/src/plugins/vis_types/xy/public/editor/components/options/point_series/threshold_panel.tsx index 347354ac9d4f2..12588975a5a0e 100644 --- a/src/plugins/vis_types/xy/public/editor/components/options/point_series/threshold_panel.tsx +++ b/src/plugins/vis_types/xy/public/editor/components/options/point_series/threshold_panel.tsx @@ -9,7 +9,7 @@ import React, { useCallback } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiPanel, EuiTitle, EuiColorPicker, EuiFormRow, EuiSpacer } from '@elastic/eui'; import { diff --git a/src/plugins/vis_types/xy/public/plugin.ts b/src/plugins/vis_types/xy/public/plugin.ts index 0f1de387161e3..9f81d6848d2e5 100644 --- a/src/plugins/vis_types/xy/public/plugin.ts +++ b/src/plugins/vis_types/xy/public/plugin.ts @@ -72,6 +72,7 @@ export class VisTypeXyPlugin expressions.registerRenderer( getXYVisRenderer({ uiSettings: core.uiSettings, + theme: core.theme, }) ); expressions.registerFunction(expressionFunctions.visTypeXyVisFn); diff --git a/src/plugins/vis_types/xy/public/sample_vis.test.mocks.ts b/src/plugins/vis_types/xy/public/sample_vis.test.mocks.ts index de1ccdea1e79b..6077732a9cc6b 100644 --- a/src/plugins/vis_types/xy/public/sample_vis.test.mocks.ts +++ b/src/plugins/vis_types/xy/public/sample_vis.test.mocks.ts @@ -149,7 +149,7 @@ export const sampleAreaVis = { title: 'X-axis', min: 0, max: 1, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], editor: false, params: [], }, @@ -159,7 +159,7 @@ export const sampleAreaVis = { title: 'Split series', min: 0, max: 3, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], editor: false, params: [], }, @@ -169,7 +169,7 @@ export const sampleAreaVis = { title: 'Split chart', min: 0, max: 1, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], params: [ { name: 'row', diff --git a/src/plugins/vis_types/xy/public/vis_renderer.tsx b/src/plugins/vis_types/xy/public/vis_renderer.tsx index 77727761015a7..e4fb02af1ed49 100644 --- a/src/plugins/vis_types/xy/public/vis_renderer.tsx +++ b/src/plugins/vis_types/xy/public/vis_renderer.tsx @@ -8,9 +8,10 @@ import React, { lazy } from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; -import { I18nProvider } from '@kbn/i18n/react'; -import { IUiSettingsClient } from 'kibana/public'; +import { I18nProvider } from '@kbn/i18n-react'; +import { IUiSettingsClient, ThemeServiceStart } from 'kibana/public'; +import { KibanaThemeProvider } from '../../../kibana_react/public'; import { VisualizationContainer } from '../../../visualizations/public'; import type { PersistedState } from '../../../visualizations/public'; import type { ExpressionRenderDefinition } from '../../../expressions/public'; @@ -32,7 +33,8 @@ function shouldShowNoResultsMessage(visData: any, visType: XyVisType): boolean { export const getXYVisRenderer: (deps: { uiSettings: IUiSettingsClient; -}) => ExpressionRenderDefinition = ({ uiSettings }) => ({ + theme: ThemeServiceStart; +}) => ExpressionRenderDefinition = ({ uiSettings, theme }) => ({ name: visName, displayName: 'XY visualization', reuseDomNode: true, @@ -41,19 +43,21 @@ export const getXYVisRenderer: (deps: { handlers.onDestroy(() => unmountComponentAtNode(domNode)); render( - - - - - , + + + + + + + , domNode ); }, diff --git a/src/plugins/vis_types/xy/public/vis_types/area.ts b/src/plugins/vis_types/xy/public/vis_types/area.ts index a140164cf2eb8..45296fa99cdfe 100644 --- a/src/plugins/vis_types/xy/public/vis_types/area.ts +++ b/src/plugins/vis_types/xy/public/vis_types/area.ts @@ -155,7 +155,7 @@ export const areaVisTypeDefinition = { }), min: 0, max: 1, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], }, { group: AggGroupNames.Buckets, @@ -165,7 +165,7 @@ export const areaVisTypeDefinition = { }), min: 0, max: 3, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], }, { group: AggGroupNames.Buckets, @@ -175,7 +175,7 @@ export const areaVisTypeDefinition = { }), min: 0, max: 1, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], }, ], }, diff --git a/src/plugins/vis_types/xy/public/vis_types/histogram.ts b/src/plugins/vis_types/xy/public/vis_types/histogram.ts index c9d17c8ed4501..32b72e753af72 100644 --- a/src/plugins/vis_types/xy/public/vis_types/histogram.ts +++ b/src/plugins/vis_types/xy/public/vis_types/histogram.ts @@ -158,7 +158,7 @@ export const histogramVisTypeDefinition = { }), min: 0, max: 1, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], }, { group: AggGroupNames.Buckets, @@ -168,7 +168,7 @@ export const histogramVisTypeDefinition = { }), min: 0, max: 3, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], }, { group: AggGroupNames.Buckets, @@ -178,7 +178,7 @@ export const histogramVisTypeDefinition = { }), min: 0, max: 1, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], }, ], }, diff --git a/src/plugins/vis_types/xy/public/vis_types/horizontal_bar.ts b/src/plugins/vis_types/xy/public/vis_types/horizontal_bar.ts index f6d2a6e0e429a..ca24f06e6d1cb 100644 --- a/src/plugins/vis_types/xy/public/vis_types/horizontal_bar.ts +++ b/src/plugins/vis_types/xy/public/vis_types/horizontal_bar.ts @@ -157,7 +157,7 @@ export const horizontalBarVisTypeDefinition = { }), min: 0, max: 1, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], }, { group: AggGroupNames.Buckets, @@ -167,7 +167,7 @@ export const horizontalBarVisTypeDefinition = { }), min: 0, max: 3, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], }, { group: AggGroupNames.Buckets, @@ -177,7 +177,7 @@ export const horizontalBarVisTypeDefinition = { }), min: 0, max: 1, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], }, ], }, diff --git a/src/plugins/vis_types/xy/public/vis_types/line.ts b/src/plugins/vis_types/xy/public/vis_types/line.ts index 3b6c9dc1a2084..dd3196b1a7cb7 100644 --- a/src/plugins/vis_types/xy/public/vis_types/line.ts +++ b/src/plugins/vis_types/xy/public/vis_types/line.ts @@ -149,7 +149,7 @@ export const lineVisTypeDefinition = { title: i18n.translate('visTypeXy.line.segmentTitle', { defaultMessage: 'X-axis' }), min: 0, max: 1, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], }, { group: AggGroupNames.Buckets, @@ -159,7 +159,7 @@ export const lineVisTypeDefinition = { }), min: 0, max: 3, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], }, { group: AggGroupNames.Buckets, @@ -169,7 +169,7 @@ export const lineVisTypeDefinition = { }), min: 0, max: 1, - aggFilter: ['!geohash_grid', '!geotile_grid', '!filter'], + aggFilter: ['!geohash_grid', '!geotile_grid', '!filter', '!multi_terms'], }, ], }, diff --git a/src/plugins/visualizations/kibana.json b/src/plugins/visualizations/kibana.json index 32430c9d4e4fd..5152ddff40890 100644 --- a/src/plugins/visualizations/kibana.json +++ b/src/plugins/visualizations/kibana.json @@ -12,7 +12,7 @@ "savedObjects" ], "optionalPlugins": ["usageCollection", "spaces", "savedObjectsTaggingOss"], - "requiredBundles": ["kibanaUtils", "discover"], + "requiredBundles": ["kibanaUtils", "discover", "kibanaReact"], "extraPublicDirs": ["common/constants", "common/prepare_log_table", "common/expression_functions"], "owner": { "name": "Vis Editors", diff --git a/src/plugins/visualizations/public/embeddable/disabled_lab_embeddable.tsx b/src/plugins/visualizations/public/embeddable/disabled_lab_embeddable.tsx index 99bd06bbc412e..b363553e6c9b2 100644 --- a/src/plugins/visualizations/public/embeddable/disabled_lab_embeddable.tsx +++ b/src/plugins/visualizations/public/embeddable/disabled_lab_embeddable.tsx @@ -8,11 +8,13 @@ import React from 'react'; import ReactDOM from 'react-dom'; +import { KibanaThemeProvider } from '../../../kibana_react/public'; import { Embeddable, EmbeddableOutput } from '../../../../plugins/embeddable/public'; import { DisabledLabVisualization } from './disabled_lab_visualization'; import { VisualizeInput } from './visualize_embeddable'; import { VISUALIZE_EMBEDDABLE_TYPE } from './constants'; +import { getTheme } from '../services'; export class DisabledLabEmbeddable extends Embeddable { private domNode?: HTMLElement; @@ -26,7 +28,12 @@ export class DisabledLabEmbeddable extends Embeddable, domNode); + ReactDOM.render( + + + , + domNode + ); } } diff --git a/src/plugins/visualizations/public/embeddable/disabled_lab_visualization.tsx b/src/plugins/visualizations/public/embeddable/disabled_lab_visualization.tsx index ae5c4ac761e96..771a28eb429ef 100644 --- a/src/plugins/visualizations/public/embeddable/disabled_lab_visualization.tsx +++ b/src/plugins/visualizations/public/embeddable/disabled_lab_visualization.tsx @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { FormattedMessage, I18nProvider } from '@kbn/i18n/react'; +import { FormattedMessage, I18nProvider } from '@kbn/i18n-react'; import { EuiEmptyPrompt, EuiLink } from '@elastic/eui'; import React from 'react'; import { getDocLinks } from '../services'; diff --git a/src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx b/src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx index 37365fd613e5a..3a248732eac0c 100644 --- a/src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx +++ b/src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx @@ -12,6 +12,7 @@ import { i18n } from '@kbn/i18n'; import React from 'react'; import { render } from 'react-dom'; import { EuiLoadingChart } from '@elastic/eui'; +import { KibanaThemeProvider } from '../../../kibana_react/public'; import { VISUALIZE_EMBEDDABLE_TYPE } from './constants'; import { IndexPattern, @@ -38,7 +39,7 @@ import { ExpressionAstExpression, } from '../../../../plugins/expressions/public'; import { Vis, SerializedVis } from '../vis'; -import { getExpressions, getUiActions } from '../services'; +import { getExpressions, getTheme, getUiActions } from '../services'; import { VIS_EVENT_TO_TRIGGER } from './events'; import { VisualizeEmbeddableFactoryDeps } from './visualize_embeddable_factory'; import { SavedObjectAttributes } from '../../../../core/types'; @@ -303,9 +304,11 @@ export class VisualizeEmbeddable super.render(this.domNode); render( -
- -
, + +
+ +
+
, this.domNode ); diff --git a/src/plugins/visualizations/public/plugin.ts b/src/plugins/visualizations/public/plugin.ts index 60c50d018252b..4e671a145cc71 100644 --- a/src/plugins/visualizations/public/plugin.ts +++ b/src/plugins/visualizations/public/plugin.ts @@ -25,6 +25,7 @@ import { setEmbeddable, setDocLinks, setSpaces, + setTheme, } from './services'; import { VISUALIZE_EMBEDDABLE_TYPE, @@ -147,6 +148,7 @@ export class VisualizationsPlugin setUISettings(core.uiSettings); setUsageCollector(usageCollection); + setTheme(core.theme); expressions.registerFunction(rangeExpressionFunction); expressions.registerFunction(visDimensionExpressionFunction); diff --git a/src/plugins/visualizations/public/services.ts b/src/plugins/visualizations/public/services.ts index 95f5fa02c09a8..37aea45fa3f58 100644 --- a/src/plugins/visualizations/public/services.ts +++ b/src/plugins/visualizations/public/services.ts @@ -15,6 +15,7 @@ import type { OverlayStart, SavedObjectsStart, DocLinksStart, + ThemeServiceStart, } from '../../../core/public'; import type { TypesStart } from './vis_types'; import { createGetterSetter } from '../../../plugins/kibana_utils/public'; @@ -27,6 +28,8 @@ import type { SpacesPluginStart } from '../../../../x-pack/plugins/spaces/public export const [getUISettings, setUISettings] = createGetterSetter('UISettings'); +export const [getTheme, setTheme] = createGetterSetter('Theme'); + export const [getCapabilities, setCapabilities] = createGetterSetter('Capabilities'); export const [getHttp, setHttp] = createGetterSetter('Http'); diff --git a/src/plugins/visualizations/public/wizard/agg_based_selection/agg_based_selection.tsx b/src/plugins/visualizations/public/wizard/agg_based_selection/agg_based_selection.tsx index acbe226155397..0bfc478b2d539 100644 --- a/src/plugins/visualizations/public/wizard/agg_based_selection/agg_based_selection.tsx +++ b/src/plugins/visualizations/public/wizard/agg_based_selection/agg_based_selection.tsx @@ -7,7 +7,7 @@ */ import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { orderBy } from 'lodash'; import React, { ChangeEvent } from 'react'; diff --git a/src/plugins/visualizations/public/wizard/group_selection/group_selection.tsx b/src/plugins/visualizations/public/wizard/group_selection/group_selection.tsx index 3866bce796c22..a8080cac2c06c 100644 --- a/src/plugins/visualizations/public/wizard/group_selection/group_selection.tsx +++ b/src/plugins/visualizations/public/wizard/group_selection/group_selection.tsx @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useCallback, useMemo } from 'react'; import { orderBy } from 'lodash'; import { diff --git a/src/plugins/visualizations/public/wizard/search_selection/search_selection.tsx b/src/plugins/visualizations/public/wizard/search_selection/search_selection.tsx index 1d297a8d9ebcb..9d9098f00b753 100644 --- a/src/plugins/visualizations/public/wizard/search_selection/search_selection.tsx +++ b/src/plugins/visualizations/public/wizard/search_selection/search_selection.tsx @@ -8,7 +8,7 @@ import { EuiModalBody, EuiModalHeader, EuiModalHeaderTitle } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { IUiSettingsClient, SavedObjectsStart } from '../../../../../core/public'; diff --git a/src/plugins/visualizations/public/wizard/show_new_vis.tsx b/src/plugins/visualizations/public/wizard/show_new_vis.tsx index 76fabdedae48d..13e8cd1851bf1 100644 --- a/src/plugins/visualizations/public/wizard/show_new_vis.tsx +++ b/src/plugins/visualizations/public/wizard/show_new_vis.tsx @@ -9,7 +9,8 @@ import React, { lazy, Suspense } from 'react'; import ReactDOM from 'react-dom'; import { EuiPortal, EuiProgress } from '@elastic/eui'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; +import { KibanaThemeProvider } from '../../../kibana_react/public'; import { getHttp, getSavedObjects, @@ -19,6 +20,7 @@ import { getApplication, getEmbeddable, getDocLinks, + getTheme, } from '../services'; import type { BaseVisType } from '../vis_types'; @@ -61,33 +63,35 @@ export function showNewVisModal({ document.body.appendChild(container); const element = ( - - - - - } - > - - - + + + + + + } + > + + + + ); ReactDOM.render(element, container); diff --git a/src/plugins/visualize/public/application/components/experimental_vis_info.tsx b/src/plugins/visualize/public/application/components/experimental_vis_info.tsx index e0b456abe6f22..117f483403235 100644 --- a/src/plugins/visualize/public/application/components/experimental_vis_info.tsx +++ b/src/plugins/visualize/public/application/components/experimental_vis_info.tsx @@ -8,7 +8,7 @@ import React, { memo } from 'react'; import { EuiCallOut, EuiLink } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const InfoComponent = () => { const title = ( diff --git a/src/plugins/visualize/public/application/components/visualize_byvalue_editor.tsx b/src/plugins/visualize/public/application/components/visualize_byvalue_editor.tsx index c32d15c336cfb..bab18c7263a73 100644 --- a/src/plugins/visualize/public/application/components/visualize_byvalue_editor.tsx +++ b/src/plugins/visualize/public/application/components/visualize_byvalue_editor.tsx @@ -26,6 +26,7 @@ import { VisualizeConstants } from '../..'; export const VisualizeByValueEditor = ({ onAppLeave }: VisualizeAppProps) => { const [originatingApp, setOriginatingApp] = useState(); + const [originatingPath, setOriginatingPath] = useState(); const { services } = useKibana(); const [eventEmitter] = useState(new EventEmitter()); const [hasUnsavedChanges, setHasUnsavedChanges] = useState(false); @@ -39,8 +40,10 @@ export const VisualizeByValueEditor = ({ onAppLeave }: VisualizeAppProps) => { embeddableId: embeddableIdValue, valueInput: valueInputValue, searchSessionId, + originatingPath: pathValue, } = stateTransferService.getIncomingEditorState(VisualizeConstants.APP_ID) || {}; + setOriginatingPath(pathValue); setOriginatingApp(value); setValueInput(valueInputValue); setEmbeddableId(embeddableIdValue); @@ -64,7 +67,8 @@ export const VisualizeByValueEditor = ({ onAppLeave }: VisualizeAppProps) => { eventEmitter, isChromeVisible, valueInput, - originatingApp + originatingApp, + originatingPath ); const { appState, hasUnappliedChanges } = useVisualizeAppState( services, @@ -99,6 +103,7 @@ export const VisualizeByValueEditor = ({ onAppLeave }: VisualizeAppProps) => { isEmbeddableRendered={isEmbeddableRendered} originatingApp={originatingApp} setOriginatingApp={setOriginatingApp} + originatingPath={originatingPath} setHasUnsavedChanges={setHasUnsavedChanges} visEditorRef={visEditorRef} embeddableId={embeddableId} diff --git a/src/plugins/visualize/public/application/components/visualize_editor.tsx b/src/plugins/visualize/public/application/components/visualize_editor.tsx index e81a886cee5a1..7688080df3e2c 100644 --- a/src/plugins/visualize/public/application/components/visualize_editor.tsx +++ b/src/plugins/visualize/public/application/components/visualize_editor.tsx @@ -27,6 +27,7 @@ import { VisualizeConstants } from '../..'; export const VisualizeEditor = ({ onAppLeave }: VisualizeAppProps) => { const { id: visualizationIdFromUrl } = useParams<{ id: string }>(); const [originatingApp, setOriginatingApp] = useState(); + const [originatingPath, setOriginatingPath] = useState(); const [embeddableIdValue, setEmbeddableId] = useState(); const { services } = useKibana(); const [eventEmitter] = useState(new EventEmitter()); @@ -61,6 +62,7 @@ export const VisualizeEditor = ({ onAppLeave }: VisualizeAppProps) => { originatingApp: value, searchSessionId, embeddableId, + originatingPath: pathValue, } = stateTransferService.getIncomingEditorState(VisualizeConstants.APP_ID) || {}; if (searchSessionId) { @@ -71,6 +73,7 @@ export const VisualizeEditor = ({ onAppLeave }: VisualizeAppProps) => { setEmbeddableId(embeddableId); setOriginatingApp(value); + setOriginatingPath(pathValue); }, [services]); useEffect(() => { @@ -91,6 +94,7 @@ export const VisualizeEditor = ({ onAppLeave }: VisualizeAppProps) => { isEmbeddableRendered={isEmbeddableRendered} originatingApp={originatingApp} setOriginatingApp={setOriginatingApp} + originatingPath={originatingPath} visualizationIdFromUrl={visualizationIdFromUrl} setHasUnsavedChanges={setHasUnsavedChanges} visEditorRef={visEditorRef} diff --git a/src/plugins/visualize/public/application/components/visualize_editor_common.tsx b/src/plugins/visualize/public/application/components/visualize_editor_common.tsx index 6268ba5c936ef..4f017b56c534a 100644 --- a/src/plugins/visualize/public/application/components/visualize_editor_common.tsx +++ b/src/plugins/visualize/public/application/components/visualize_editor_common.tsx @@ -8,7 +8,7 @@ import './visualize_editor.scss'; import React, { RefObject, useCallback, useEffect } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiScreenReaderOnly } from '@elastic/eui'; import { AppMountParameters } from 'kibana/public'; @@ -37,6 +37,7 @@ interface VisualizeEditorCommonProps { visEditorRef: RefObject; originatingApp?: string; setOriginatingApp?: (originatingApp: string | undefined) => void; + originatingPath?: string; visualizationIdFromUrl?: string; embeddableId?: string; } @@ -52,6 +53,7 @@ export const VisualizeEditorCommon = ({ isEmbeddableRendered, onAppLeave, originatingApp, + originatingPath, setOriginatingApp, visualizationIdFromUrl, embeddableId, @@ -117,6 +119,7 @@ export const VisualizeEditorCommon = ({ isEmbeddableRendered={isEmbeddableRendered} hasUnappliedChanges={hasUnappliedChanges} originatingApp={originatingApp} + originatingPath={originatingPath} setOriginatingApp={setOriginatingApp} visInstance={visInstance} stateContainer={appState} diff --git a/src/plugins/visualize/public/application/components/visualize_listing.tsx b/src/plugins/visualize/public/application/components/visualize_listing.tsx index 7319a9b5e52f8..e4516cdd7fed3 100644 --- a/src/plugins/visualize/public/application/components/visualize_listing.tsx +++ b/src/plugins/visualize/public/application/components/visualize_listing.tsx @@ -11,7 +11,7 @@ import './visualize_listing.scss'; import React, { useCallback, useRef, useMemo, useEffect, MouseEvent } from 'react'; import { EuiCallOut, EuiLink, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import useUnmount from 'react-use/lib/useUnmount'; import useMount from 'react-use/lib/useMount'; diff --git a/src/plugins/visualize/public/application/components/visualize_no_match.tsx b/src/plugins/visualize/public/application/components/visualize_no_match.tsx index ad993af430086..e5c3cd52ddbf6 100644 --- a/src/plugins/visualize/public/application/components/visualize_no_match.tsx +++ b/src/plugins/visualize/public/application/components/visualize_no_match.tsx @@ -8,10 +8,10 @@ import React, { useEffect } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCallOut, EuiLink } from '@elastic/eui'; -import { useKibana, toMountPoint } from '../../../../kibana_react/public'; +import { useKibana, toMountPoint, KibanaThemeProvider } from '../../../../kibana_react/public'; import { VisualizeServices } from '../types'; import { VisualizeConstants } from '../visualize_constants'; @@ -35,21 +35,23 @@ export const VisualizeNoMatch = () => { bannerId = services.overlays.banners.replace( bannerId, toMountPoint( - -

- - {services.history.location.pathname} - - ), - }} - /> -

-
+ + +

+ + {services.history.location.pathname} + + ), + }} + /> +

+
+
) ); diff --git a/src/plugins/visualize/public/application/components/visualize_top_nav.tsx b/src/plugins/visualize/public/application/components/visualize_top_nav.tsx index ad933e597f0a7..c602b0193cf9c 100644 --- a/src/plugins/visualize/public/application/components/visualize_top_nav.tsx +++ b/src/plugins/visualize/public/application/components/visualize_top_nav.tsx @@ -29,6 +29,7 @@ interface VisualizeTopNavProps { setHasUnsavedChanges: (value: boolean) => void; hasUnappliedChanges: boolean; originatingApp?: string; + originatingPath?: string; visInstance: VisualizeEditorVisInstance; setOriginatingApp?: (originatingApp: string | undefined) => void; stateContainer: VisualizeAppStateContainer; @@ -46,6 +47,7 @@ const TopNav = ({ hasUnappliedChanges, originatingApp, setOriginatingApp, + originatingPath, visInstance, stateContainer, visualizationIdFromUrl, @@ -88,6 +90,7 @@ const TopNav = ({ openInspector, originatingApp, setOriginatingApp, + originatingPath, visInstance, stateContainer, visualizationIdFromUrl, @@ -104,6 +107,7 @@ const TopNav = ({ hasUnappliedChanges, openInspector, originatingApp, + originatingPath, visInstance, setOriginatingApp, stateContainer, diff --git a/src/plugins/visualize/public/application/index.tsx b/src/plugins/visualize/public/application/index.tsx index 8a7936c7bc44c..c3bc01deff020 100644 --- a/src/plugins/visualize/public/application/index.tsx +++ b/src/plugins/visualize/public/application/index.tsx @@ -11,7 +11,7 @@ import ReactDOM from 'react-dom'; import { Router } from 'react-router-dom'; import { AppMountParameters } from 'kibana/public'; -import { KibanaContextProvider } from '../../../kibana_react/public'; +import { KibanaContextProvider, KibanaThemeProvider } from '../../../kibana_react/public'; import { VisualizeApp } from './app'; import { VisualizeServices } from './types'; import { addHelpMenuToAppChrome, addBadgeToAppChrome } from './utils'; @@ -28,15 +28,17 @@ export const renderApp = ( } const app = ( - - - - - - - - - + + + + + + + + + + + ); ReactDOM.render(app, element); diff --git a/src/plugins/visualize/public/application/utils/get_table_columns.tsx b/src/plugins/visualize/public/application/utils/get_table_columns.tsx index 69383005deb07..6634563557eda 100644 --- a/src/plugins/visualize/public/application/utils/get_table_columns.tsx +++ b/src/plugins/visualize/public/application/utils/get_table_columns.tsx @@ -18,7 +18,7 @@ import { EuiBasicTableColumn, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ApplicationStart } from 'kibana/public'; import { IKbnUrlStateStorage } from 'src/plugins/kibana_utils/public'; import { VisualizationListItem } from 'src/plugins/visualizations/public'; diff --git a/src/plugins/visualize/public/application/utils/get_top_nav_config.tsx b/src/plugins/visualize/public/application/utils/get_top_nav_config.tsx index 772565734dac4..fd739a97e8cd0 100644 --- a/src/plugins/visualize/public/application/utils/get_top_nav_config.tsx +++ b/src/plugins/visualize/public/application/utils/get_top_nav_config.tsx @@ -54,6 +54,7 @@ export interface TopNavConfigParams { setHasUnsavedChanges: (value: boolean) => void; openInspector: () => void; originatingApp?: string; + originatingPath?: string; setOriginatingApp?: (originatingApp: string | undefined) => void; hasUnappliedChanges: boolean; visInstance: VisualizeEditorVisInstance; @@ -79,6 +80,7 @@ export const getTopNavConfig = ( setHasUnsavedChanges, openInspector, originatingApp, + originatingPath, setOriginatingApp, hasUnappliedChanges, visInstance, @@ -168,6 +170,8 @@ export const getTopNavConfig = ( if (saveOptions.dashboardId) { path = saveOptions.dashboardId === 'new' ? '#/create' : `#/view/${saveOptions.dashboardId}`; + } else if (originatingPath) { + path = originatingPath; } if (stateTransfer) { @@ -232,7 +236,8 @@ export const getTopNavConfig = ( type: VISUALIZE_EMBEDDABLE_TYPE, searchSessionId: data.search.session.getSessionId(), }; - stateTransfer.navigateToWithEmbeddablePackage(originatingApp, { state }); + + stateTransfer.navigateToWithEmbeddablePackage(originatingApp, { state, path: originatingPath }); }; const navigateToOriginatingApp = () => { diff --git a/src/plugins/visualize/public/application/utils/use/use_vis_byvalue.ts b/src/plugins/visualize/public/application/utils/use/use_vis_byvalue.ts index 27c9f77b98910..8e0b9692f8aab 100644 --- a/src/plugins/visualize/public/application/utils/use/use_vis_byvalue.ts +++ b/src/plugins/visualize/public/application/utils/use/use_vis_byvalue.ts @@ -19,7 +19,8 @@ export const useVisByValue = ( eventEmitter: EventEmitter, isChromeVisible: boolean | undefined, valueInput?: VisualizeInput, - originatingApp?: string + originatingApp?: string, + originatingPath?: string ) => { const [state, setState] = useState<{ byValueVisInstance?: ByValueVisInstance; @@ -55,7 +56,9 @@ export const useVisByValue = ( const originatingAppName = originatingApp ? stateTransferService.getAppNameFromId(originatingApp) : undefined; - const redirectToOrigin = originatingApp ? () => navigateToApp(originatingApp) : undefined; + const redirectToOrigin = originatingApp + ? () => navigateToApp(originatingApp, { path: originatingPath }) + : undefined; chrome?.setBreadcrumbs( getEditBreadcrumbs({ byValue: true, originatingAppName, redirectToOrigin }) ); @@ -76,6 +79,7 @@ export const useVisByValue = ( state.visEditorController, valueInput, originatingApp, + originatingPath, ]); useEffect(() => { diff --git a/src/plugins/visualize/public/application/utils/use/use_visualize_app_state.tsx b/src/plugins/visualize/public/application/utils/use/use_visualize_app_state.tsx index e8f163e30b153..dca1791d44149 100644 --- a/src/plugins/visualize/public/application/utils/use/use_visualize_app_state.tsx +++ b/src/plugins/visualize/public/application/utils/use/use_visualize_app_state.tsx @@ -12,7 +12,11 @@ import { map } from 'rxjs/operators'; import { EventEmitter } from 'events'; import { i18n } from '@kbn/i18n'; -import { MarkdownSimple, toMountPoint } from '../../../../../kibana_react/public'; +import { + KibanaThemeProvider, + MarkdownSimple, + toMountPoint, +} from '../../../../../kibana_react/public'; import { migrateLegacyQuery } from '../migrate_legacy_query'; import { esFilters, connectToQueryState } from '../../../../../data/public'; import { @@ -121,7 +125,11 @@ export const useVisualizeAppState = ( title: i18n.translate('visualize.visualizationLoadingFailedErrorMessage', { defaultMessage: 'Failed to load the visualization', }), - text: toMountPoint({error.message}), + text: toMountPoint( + + {error.message} + + ), }); services.history.replace( diff --git a/test/api_integration/apis/index_pattern_field_editor/constants.ts b/test/api_integration/apis/data_view_field_editor/constants.ts similarity index 100% rename from test/api_integration/apis/index_pattern_field_editor/constants.ts rename to test/api_integration/apis/data_view_field_editor/constants.ts diff --git a/test/api_integration/apis/index_pattern_field_editor/field_preview.ts b/test/api_integration/apis/data_view_field_editor/field_preview.ts similarity index 98% rename from test/api_integration/apis/index_pattern_field_editor/field_preview.ts rename to test/api_integration/apis/data_view_field_editor/field_preview.ts index c687f3094b6fd..4fea3229462d9 100644 --- a/test/api_integration/apis/index_pattern_field_editor/field_preview.ts +++ b/test/api_integration/apis/data_view_field_editor/field_preview.ts @@ -8,7 +8,7 @@ import expect from '@kbn/expect'; -import { getErrorCodeFromErrorReason } from '../../../../src/plugins/index_pattern_field_editor/public/lib/runtime_field_validation'; +import { getErrorCodeFromErrorReason } from '../../../../src/plugins/data_view_field_editor/public/lib/runtime_field_validation'; import { FtrProviderContext } from '../../ftr_provider_context'; import { API_BASE_PATH } from './constants'; diff --git a/test/api_integration/apis/index_pattern_field_editor/index.ts b/test/api_integration/apis/data_view_field_editor/index.ts similarity index 100% rename from test/api_integration/apis/index_pattern_field_editor/index.ts rename to test/api_integration/apis/data_view_field_editor/index.ts diff --git a/test/api_integration/apis/index.ts b/test/api_integration/apis/index.ts index bdbb9c0a1fae7..f7801f4d42e71 100644 --- a/test/api_integration/apis/index.ts +++ b/test/api_integration/apis/index.ts @@ -15,7 +15,7 @@ export default function ({ loadTestFile }: FtrProviderContext) { loadTestFile(require.resolve('./custom_integration')); loadTestFile(require.resolve('./general')); loadTestFile(require.resolve('./home')); - loadTestFile(require.resolve('./index_pattern_field_editor')); + loadTestFile(require.resolve('./data_view_field_editor')); loadTestFile(require.resolve('./index_patterns')); loadTestFile(require.resolve('./kql_telemetry')); loadTestFile(require.resolve('./saved_objects_management')); diff --git a/test/api_integration/apis/stats/stats.js b/test/api_integration/apis/stats/stats.js index 61936a73da38d..a95204b5fff4a 100644 --- a/test/api_integration/apis/stats/stats.js +++ b/test/api_integration/apis/stats/stats.js @@ -15,7 +15,7 @@ const assertStatsAndMetrics = (body) => { expect(body.kibana.transport_address).to.be.a('string'); expect(body.kibana.version).to.be.a('string'); expect(body.kibana.snapshot).to.be.a('boolean'); - expect(body.kibana.status).to.be('green'); + expect(body.kibana.status).to.be.a('string'); expect(body.process.memory.heap.total_bytes).to.be.a('number'); expect(body.process.memory.heap.used_bytes).to.be.a('number'); diff --git a/test/functional/apps/discover/_discover.ts b/test/functional/apps/discover/_discover.ts index 8374ccbc389f7..7becb217c877a 100644 --- a/test/functional/apps/discover/_discover.ts +++ b/test/functional/apps/discover/_discover.ts @@ -38,7 +38,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { after(async () => { await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] }); }); - describe('query', function () { + // FLAKY: https://github.com/elastic/kibana/issues/86602 + describe.skip('query', function () { const queryName1 = 'Query # 1'; it('should show correct time range string by timepicker', async function () { diff --git a/test/functional/apps/discover/_search_on_page_load.ts b/test/functional/apps/discover/_search_on_page_load.ts index 2a66e03c3cbb8..277d2e72d729f 100644 --- a/test/functional/apps/discover/_search_on_page_load.ts +++ b/test/functional/apps/discover/_search_on_page_load.ts @@ -76,6 +76,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { expect(await testSubjects.exists('refreshDataButton')).to.be(true); await retry.waitFor('number of fetches to be 0', waitForFetches(0)); + /** + * We should wait for debounce timeout expired 100 ms, + * otherwise click event will be skipped. See getFetch$ implementation. + */ + await PageObjects.common.sleep(100); await testSubjects.click('refreshDataButton'); await retry.waitFor('number of fetches to be 1', waitForFetches(1)); diff --git a/test/functional/apps/visualize/_tsvb_chart.ts b/test/functional/apps/visualize/_tsvb_chart.ts index c530b00364fd1..0efc4b2f1d1ae 100644 --- a/test/functional/apps/visualize/_tsvb_chart.ts +++ b/test/functional/apps/visualize/_tsvb_chart.ts @@ -27,8 +27,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ]); describe('visual builder', function describeIndexTests() { - this.tags('includeFirefox'); - before(async () => { await visualize.initTests(); }); diff --git a/test/functional/apps/visualize/_tsvb_time_series.ts b/test/functional/apps/visualize/_tsvb_time_series.ts index 69cc764c39b21..e9d0fabe0fefa 100644 --- a/test/functional/apps/visualize/_tsvb_time_series.ts +++ b/test/functional/apps/visualize/_tsvb_time_series.ts @@ -49,147 +49,157 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await visualBuilder.clickDataTab('timeSeries'); }); - it('should render all necessary components', async () => { - await visualBuilder.checkTimeSeriesChartIsPresent(); - await visualBuilder.checkTimeSeriesLegendIsPresent(); - }); + describe('basics', () => { + this.tags('includeFirefox'); - it('should show the correct count in the legend', async () => { - await retry.try(async () => { - const actualCount = await visualBuilder.getRhythmChartLegendValue(); - expect(actualCount).to.be('156'); + it('should render all necessary components', async () => { + await visualBuilder.checkTimeSeriesChartIsPresent(); + await visualBuilder.checkTimeSeriesLegendIsPresent(); }); - }); - - it('should show the correct count in the legend with 2h offset', async () => { - await visualBuilder.clickSeriesOption(); - await visualBuilder.enterOffsetSeries('2h'); - const actualCount = await visualBuilder.getRhythmChartLegendValue(); - expect(actualCount).to.be('293'); - }); - - it('should show the correct count in the legend with -2h offset', async () => { - await visualBuilder.clickSeriesOption(); - await visualBuilder.enterOffsetSeries('-2h'); - const actualCount = await visualBuilder.getRhythmChartLegendValue(); - expect(actualCount).to.be('53'); - }); - it('should open color picker, deactivate panel and clone series', async () => { - await visualBuilder.clickColorPicker(); - await visualBuilder.checkColorPickerPopUpIsPresent(); - await visualBuilder.clickColorPicker(); - - await visualBuilder.changePanelPreview(); - await visualBuilder.checkPreviewIsDisabled(); - await visualBuilder.changePanelPreview(); - - await visualBuilder.cloneSeries(); - const legend = await visualBuilder.getLegendItems(); - const series = await visualBuilder.getSeries(); - expect(legend.length).to.be(2); - expect(series.length).to.be(2); - }); - - it('should show the correct count in the legend with custom numeric formatter', async () => { - const expectedLegendValue = '$ 156'; + it('should show the correct count in the legend', async () => { + await retry.try(async () => { + const actualCount = await visualBuilder.getRhythmChartLegendValue(); + expect(actualCount).to.be('156'); + }); + }); - await visualBuilder.clickSeriesOption(); - await visualBuilder.changeDataFormatter('number'); - await visualBuilder.enterSeriesTemplate('$ {{value}}'); - await retry.try(async () => { + it('should show the correct count in the legend with 2h offset', async () => { + await visualBuilder.clickSeriesOption(); + await visualBuilder.enterOffsetSeries('2h'); const actualCount = await visualBuilder.getRhythmChartLegendValue(); - expect(actualCount).to.be(expectedLegendValue); + expect(actualCount).to.be('293'); }); - }); - it('should show the correct count in the legend with percent formatter', async () => { - const expectedLegendValue = '15,600%'; + it('should show the correct count in the legend with -2h offset', async () => { + await visualBuilder.clickSeriesOption(); + await visualBuilder.enterOffsetSeries('-2h'); + const actualCount = await visualBuilder.getRhythmChartLegendValue(); + expect(actualCount).to.be('53'); + }); - await visualBuilder.clickSeriesOption(); - await visualBuilder.changeDataFormatter('percent'); - const actualCount = await visualBuilder.getRhythmChartLegendValue(); - expect(actualCount).to.be(expectedLegendValue); - }); + it('should open color picker, deactivate panel and clone series', async () => { + await visualBuilder.clickColorPicker(); + await visualBuilder.checkColorPickerPopUpIsPresent(); + await visualBuilder.clickColorPicker(); - it('should show the correct count in the legend with bytes formatter', async () => { - const expectedLegendValue = '156B'; + await visualBuilder.changePanelPreview(); + await visualBuilder.checkPreviewIsDisabled(); + await visualBuilder.changePanelPreview(); - await visualBuilder.clickSeriesOption(); - await visualBuilder.changeDataFormatter('bytes'); - const actualCount = await visualBuilder.getRhythmChartLegendValue(); - expect(actualCount).to.be(expectedLegendValue); - }); + await visualBuilder.cloneSeries(); + const legend = await visualBuilder.getLegendItems(); + const series = await visualBuilder.getSeries(); + expect(legend.length).to.be(2); + expect(series.length).to.be(2); + }); - it('should show the correct count in the legend with "Human readable" duration formatter', async () => { - await visualBuilder.clickSeriesOption(); - await visualBuilder.changeDataFormatter('duration'); - await visualBuilder.setDurationFormatterSettings({ to: 'Human readable' }); - const actualCountDefault = await visualBuilder.getRhythmChartLegendValue(); - expect(actualCountDefault).to.be('a few seconds'); - - log.debug(`to: 'Human readable', from: 'Seconds'`); - await visualBuilder.setDurationFormatterSettings({ to: 'Human readable', from: 'Seconds' }); - const actualCountSec = await visualBuilder.getRhythmChartLegendValue(); - expect(actualCountSec).to.be('3 minutes'); - - log.debug(`to: 'Human readable', from: 'Minutes'`); - await visualBuilder.setDurationFormatterSettings({ to: 'Human readable', from: 'Minutes' }); - const actualCountMin = await visualBuilder.getRhythmChartLegendValue(); - expect(actualCountMin).to.be('3 hours'); - }); + it('should show the correct count in the legend with custom numeric formatter', async () => { + const expectedLegendValue = '$ 156'; - describe('Dark mode', () => { - before(async () => { - await kibanaServer.uiSettings.update({ - 'theme:darkMode': true, + await visualBuilder.clickSeriesOption(); + await visualBuilder.changeDataFormatter('number'); + await visualBuilder.enterSeriesTemplate('$ {{value}}'); + await retry.try(async () => { + const actualCount = await visualBuilder.getRhythmChartLegendValue(); + expect(actualCount).to.be(expectedLegendValue); }); }); - it(`viz should have light class when background color is white`, async () => { - await visualBuilder.clickPanelOptions('timeSeries'); - await visualBuilder.setBackgroundColor('#FFFFFF'); + it('should show the correct count in the legend with percent formatter', async () => { + const expectedLegendValue = '15,600%'; - expect(await visualBuilder.checkTimeSeriesIsLight()).to.be(true); + await visualBuilder.clickSeriesOption(); + await visualBuilder.changeDataFormatter('percent'); + const actualCount = await visualBuilder.getRhythmChartLegendValue(); + expect(actualCount).to.be(expectedLegendValue); }); - after(async () => { - await kibanaServer.uiSettings.update({ - 'theme:darkMode': false, - }); + it('should show the correct count in the legend with bytes formatter', async () => { + const expectedLegendValue = '156B'; + + await visualBuilder.clickSeriesOption(); + await visualBuilder.changeDataFormatter('bytes'); + const actualCount = await visualBuilder.getRhythmChartLegendValue(); + expect(actualCount).to.be(expectedLegendValue); }); - }); - describe('Clicking on the chart', () => { - it(`should create a filter`, async () => { - await visualBuilder.setMetricsGroupByTerms('machine.os.raw', { - include: 'win 7', - exclude: 'ios', - }); + it('should show the correct count in the legend with "Human readable" duration formatter', async () => { await visualBuilder.clickSeriesOption(); - await testSubjects.click('visualizeSaveButton'); + await visualBuilder.changeDataFormatter('duration'); + await visualBuilder.setDurationFormatterSettings({ to: 'Human readable' }); + const actualCountDefault = await visualBuilder.getRhythmChartLegendValue(); + expect(actualCountDefault).to.be('a few seconds'); + + log.debug(`to: 'Human readable', from: 'Seconds'`); + await visualBuilder.setDurationFormatterSettings({ + to: 'Human readable', + from: 'Seconds', + }); + const actualCountSec = await visualBuilder.getRhythmChartLegendValue(); + expect(actualCountSec).to.be('3 minutes'); - await timeToVisualize.saveFromModal('My TSVB viz 1', { - addToDashboard: 'new', - saveToLibrary: false, + log.debug(`to: 'Human readable', from: 'Minutes'`); + await visualBuilder.setDurationFormatterSettings({ + to: 'Human readable', + from: 'Minutes', }); + const actualCountMin = await visualBuilder.getRhythmChartLegendValue(); + expect(actualCountMin).to.be('3 hours'); + }); - await dashboard.waitForRenderComplete(); - const el = await elasticChart.getCanvas(); - // click on specific coordinates - await browser - .getActions() - .move({ x: 105, y: 115, origin: el._webElement }) - .click() - .perform(); + describe('Dark mode', () => { + before(async () => { + await kibanaServer.uiSettings.update({ + 'theme:darkMode': true, + }); + }); - await retry.try(async () => { - await testSubjects.click('applyFiltersPopoverButton'); - await testSubjects.missingOrFail('applyFiltersPopoverButton'); + it(`viz should have light class when background color is white`, async () => { + await visualBuilder.clickPanelOptions('timeSeries'); + await visualBuilder.setBackgroundColor('#FFFFFF'); + + expect(await visualBuilder.checkTimeSeriesIsLight()).to.be(true); + }); + + after(async () => { + await kibanaServer.uiSettings.update({ + 'theme:darkMode': false, + }); }); + }); - const hasMachineRawFilter = await filterBar.hasFilter('machine.os.raw', 'win 7'); - expect(hasMachineRawFilter).to.be(true); + describe('Clicking on the chart', () => { + it(`should create a filter`, async () => { + await visualBuilder.setMetricsGroupByTerms('machine.os.raw', { + include: 'win 7', + exclude: 'ios', + }); + await visualBuilder.clickSeriesOption(); + await testSubjects.click('visualizeSaveButton'); + + await timeToVisualize.saveFromModal('My TSVB viz 1', { + addToDashboard: 'new', + saveToLibrary: false, + }); + + await dashboard.waitForRenderComplete(); + const el = await elasticChart.getCanvas(); + // click on specific coordinates + await browser + .getActions() + .move({ x: 105, y: 115, origin: el._webElement }) + .click() + .perform(); + + await retry.try(async () => { + await testSubjects.click('applyFiltersPopoverButton'); + await testSubjects.missingOrFail('applyFiltersPopoverButton'); + }); + + const hasMachineRawFilter = await filterBar.hasFilter('machine.os.raw', 'win 7'); + expect(hasMachineRawFilter).to.be(true); + }); }); }); diff --git a/test/interpreter_functional/test_suites/run_pipeline/esaggs_multiterms.ts b/test/interpreter_functional/test_suites/run_pipeline/esaggs_multiterms.ts new file mode 100644 index 0000000000000..2e6516c2e0c37 --- /dev/null +++ b/test/interpreter_functional/test_suites/run_pipeline/esaggs_multiterms.ts @@ -0,0 +1,240 @@ +/* + * 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 expect from '@kbn/expect'; +import { ExpectExpression, expectExpressionProvider } from './helpers'; +import { FtrProviderContext } from '../../../functional/ftr_provider_context'; + +export default function ({ + getService, + updateBaselines, +}: FtrProviderContext & { updateBaselines: boolean }) { + let expectExpression: ExpectExpression; + + describe('esaggs multiterms tests', () => { + before(() => { + expectExpression = expectExpressionProvider({ getService, updateBaselines }); + }); + + const timeRange = { + from: '2015-09-21T00:00:00Z', + to: '2015-09-22T00:00:00Z', + }; + + it('can execute multi terms', async () => { + const expression = ` + kibana_context timeRange={timerange from='${timeRange.from}' to='${timeRange.to}'} + | esaggs index={indexPatternLoad id='logstash-*'} + aggs={aggMultiTerms id="0" enabled=true schema="bucket" fields="extension.raw" fields="geo.dest" size=5} + aggs={aggCount id="1" enabled=true schema="metric"} + `; + const result = await expectExpression('esaggs_multi_terms', expression).getResponse(); + expect(result.rows).to.eql([ + { 'col-0-0': { keys: ['jpg', 'CN'] }, 'col-1-1': 587 }, + { 'col-0-0': { keys: ['jpg', 'IN'] }, 'col-1-1': 472 }, + { 'col-0-0': { keys: ['jpg', 'US'] }, 'col-1-1': 253 }, + { 'col-0-0': { keys: ['css', 'CN'] }, 'col-1-1': 146 }, + { 'col-0-0': { keys: ['jpg', 'ID'] }, 'col-1-1': 105 }, + ]); + }); + + it('can include other bucket and ordering', async () => { + const expression = ` + kibana_context timeRange={timerange from='${timeRange.from}' to='${timeRange.to}'} + | esaggs index={indexPatternLoad id='logstash-*'} + aggs={aggMultiTerms id="0" enabled=true schema="bucket" fields="extension.raw" fields="geo.dest" size=3 orderAgg={aggAvg id="order" field="bytes" enabled=true schema="metric"} otherBucket=true} + aggs={aggCount id="1" enabled=true schema="metric"} + `; + const result = await expectExpression('esaggs_multi_terms_other', expression).getResponse(); + expect(result.rows).to.eql([ + { 'col-0-0': { keys: ['png', 'GH'] }, 'col-1-1': 1 }, + { 'col-0-0': { keys: ['png', 'PE'] }, 'col-1-1': 2 }, + { 'col-0-0': { keys: ['png', 'CL'] }, 'col-1-1': 2 }, + { 'col-0-0': { keys: ['__other__'] }, 'col-1-1': 4613 }, + ]); + }); + + it('can nest a regular terms', async () => { + const expression = ` + kibana_context timeRange={timerange from='${timeRange.from}' to='${timeRange.to}'} + | esaggs index={indexPatternLoad id='logstash-*'} + aggs={aggMultiTerms id="0" enabled=true schema="bucket" fields="extension.raw" fields="geo.dest" size=3 orderAgg={aggAvg id="order" field="bytes" enabled=true schema="metric"} otherBucket=true} + aggs={aggTerms id="1" enabled=true schema="bucket" field="geo.src" size=3 orderAgg={aggAvg id="order" field="bytes" enabled=true schema="metric"} otherBucket=true} + aggs={aggSum id="2" field="bytes" enabled=true schema="metric"} + `; + const result = await expectExpression('esaggs_multi_terms_nested', expression).getResponse(); + expect(result.rows).to.eql([ + { 'col-0-0': { keys: ['png', 'GH'] }, 'col-1-1': 'IN', 'col-2-2': 18787 }, + { 'col-0-0': { keys: ['png', 'PE'] }, 'col-1-1': 'GT', 'col-2-2': 19328 }, + { 'col-0-0': { keys: ['png', 'PE'] }, 'col-1-1': 'BD', 'col-2-2': 18042 }, + { 'col-0-0': { keys: ['png', 'CL'] }, 'col-1-1': 'US', 'col-2-2': 19579 }, + { 'col-0-0': { keys: ['png', 'CL'] }, 'col-1-1': 'CN', 'col-2-2': 17681 }, + { 'col-0-0': { keys: ['__other__'] }, 'col-1-1': 'DK', 'col-2-2': 20004 }, + { 'col-0-0': { keys: ['__other__'] }, 'col-1-1': 'FI', 'col-2-2': 58508 }, + { 'col-0-0': { keys: ['__other__'] }, 'col-1-1': 'QA', 'col-2-2': 9487 }, + { 'col-0-0': { keys: ['__other__'] }, 'col-1-1': '__other__', 'col-2-2': 26417178 }, + ]); + }); + + it('can be nested into a regular terms', async () => { + const expression = ` + kibana_context timeRange={timerange from='${timeRange.from}' to='${timeRange.to}'} + | esaggs index={indexPatternLoad id='logstash-*'} + aggs={aggTerms id="0" enabled=true schema="bucket" field="geo.src" size=3 orderAgg={aggAvg id="order" field="bytes" enabled=true schema="metric"} otherBucket=true} + aggs={aggMultiTerms id="1" enabled=true schema="bucket" fields="extension.raw" fields="geo.dest" size=3 orderAgg={aggAvg id="order" field="bytes" enabled=true schema="metric"} otherBucket=true} + aggs={aggSum id="2" field="bytes" enabled=true schema="metric"} + `; + const result = await expectExpression('esaggs_multi_terms_nested2', expression).getResponse(); + expect(result.rows).to.eql([ + { 'col-0-0': 'DK', 'col-1-1': { keys: ['png', 'IN'] }, 'col-2-2': 11004 }, + { 'col-0-0': 'DK', 'col-1-1': { keys: ['jpg', 'VN'] }, 'col-2-2': 9000 }, + { 'col-0-0': 'FI', 'col-1-1': { keys: ['png', 'CZ'] }, 'col-2-2': 16089 }, + { 'col-0-0': 'FI', 'col-1-1': { keys: ['png', 'MX'] }, 'col-2-2': 13360 }, + { 'col-0-0': 'FI', 'col-1-1': { keys: ['jpg', 'KH'] }, 'col-2-2': 8864 }, + { 'col-0-0': 'FI', 'col-1-1': { keys: ['__other__'] }, 'col-2-2': 20195 }, + { 'col-0-0': 'QA', 'col-1-1': { keys: ['css', 'CL'] }, 'col-2-2': 9487 }, + { 'col-0-0': '__other__', 'col-1-1': { keys: ['png', 'GH'] }, 'col-2-2': 18787 }, + { 'col-0-0': '__other__', 'col-1-1': { keys: ['png', 'PE'] }, 'col-2-2': 37370 }, + { 'col-0-0': '__other__', 'col-1-1': { keys: ['png', 'CL'] }, 'col-2-2': 37260 }, + { 'col-0-0': '__other__', 'col-1-1': { keys: ['__other__'] }, 'col-2-2': 26417178 }, + ]); + }); + + it('can be nested into itself', async () => { + const expression = ` + kibana_context timeRange={timerange from='${timeRange.from}' to='${timeRange.to}'} + | esaggs index={indexPatternLoad id='logstash-*'} + aggs={aggMultiTerms id="0" enabled=true schema="bucket" fields="geo.src" fields="host.raw" size=3 orderAgg={aggAvg id="order" field="bytes" enabled=true schema="metric"} otherBucket=true} + aggs={aggMultiTerms id="1" enabled=true schema="bucket" fields="extension.raw" fields="geo.dest" size=3 orderAgg={aggAvg id="order" field="bytes" enabled=true schema="metric"} otherBucket=true} + aggs={aggCount id="2" enabled=true schema="metric"} + `; + const result = await expectExpression('esaggs_multi_terms_nested3', expression).getResponse(); + expect(result.rows).to.eql([ + { + 'col-0-0': { + keys: ['DK', 'media-for-the-masses.theacademyofperformingartsandscience.org'], + }, + 'col-1-1': { keys: ['png', 'IN'] }, + 'col-2-2': 1, + }, + { + 'col-0-0': { + keys: ['DK', 'media-for-the-masses.theacademyofperformingartsandscience.org'], + }, + 'col-1-1': { keys: ['jpg', 'VN'] }, + 'col-2-2': 1, + }, + { + 'col-0-0': { keys: ['GB', 'theacademyofperformingartsandscience.org'] }, + 'col-1-1': { keys: ['php', 'IN'] }, + 'col-2-2': 1, + }, + { + 'col-0-0': { + keys: ['KH', 'media-for-the-masses.theacademyofperformingartsandscience.org'], + }, + 'col-1-1': { keys: ['png', 'CN'] }, + 'col-2-2': 1, + }, + { + 'col-0-0': { + keys: ['KH', 'media-for-the-masses.theacademyofperformingartsandscience.org'], + }, + 'col-1-1': { keys: ['jpg', 'RO'] }, + 'col-2-2': 1, + }, + { 'col-0-0': { keys: ['__other__'] }, 'col-1-1': { keys: ['png', 'GH'] }, 'col-2-2': 1 }, + { 'col-0-0': { keys: ['__other__'] }, 'col-1-1': { keys: ['png', 'PE'] }, 'col-2-2': 2 }, + { 'col-0-0': { keys: ['__other__'] }, 'col-1-1': { keys: ['png', 'CL'] }, 'col-2-2': 2 }, + { 'col-0-0': { keys: ['__other__'] }, 'col-1-1': { keys: ['__other__'] }, 'col-2-2': 4608 }, + ]); + }); + + it('can be nested into date histogram', async () => { + const expression = ` + kibana_context timeRange={timerange from='${timeRange.from}' to='${timeRange.to}'} + | esaggs index={indexPatternLoad id='logstash-*'} + aggs={aggDateHistogram id="0" enabled=true schema="bucket" field="@timestamp" interval="6h"} + aggs={aggMultiTerms id="1" enabled=true schema="bucket" fields="extension.raw" fields="geo.dest" size=3 orderAgg={aggAvg id="order" field="bytes" enabled=true schema="metric"} otherBucket=true} + aggs={aggSum id="2" field="bytes" enabled=true schema="metric"} + `; + const result = await expectExpression('esaggs_multi_terms_nested4', expression).getResponse(); + expect(result.rows).to.eql([ + { 'col-0-0': 1442781000000, 'col-1-1': { keys: ['png', 'IN'] }, 'col-2-2': 12097 }, + { 'col-0-0': 1442781000000, 'col-1-1': { keys: ['css', 'US'] }, 'col-2-2': 8768 }, + { 'col-0-0': 1442781000000, 'col-1-1': { keys: ['jpg', 'NG'] }, 'col-2-2': 8443 }, + { 'col-0-0': 1442781000000, 'col-1-1': { keys: ['__other__'] }, 'col-2-2': 131961 }, + { 'col-0-0': 1442802600000, 'col-1-1': { keys: ['png', 'SN'] }, 'col-2-2': 17545 }, + { 'col-0-0': 1442802600000, 'col-1-1': { keys: ['png', 'PR'] }, 'col-2-2': 16719 }, + { 'col-0-0': 1442802600000, 'col-1-1': { keys: ['png', 'JP'] }, 'col-2-2': 32921 }, + { 'col-0-0': 1442802600000, 'col-1-1': { keys: ['__other__'] }, 'col-2-2': 4146549 }, + { 'col-0-0': 1442824200000, 'col-1-1': { keys: ['png', 'GT'] }, 'col-2-2': 37794 }, + { 'col-0-0': 1442824200000, 'col-1-1': { keys: ['png', 'GH'] }, 'col-2-2': 18787 }, + { 'col-0-0': 1442824200000, 'col-1-1': { keys: ['png', 'PE'] }, 'col-2-2': 37370 }, + { 'col-0-0': 1442824200000, 'col-1-1': { keys: ['__other__'] }, 'col-2-2': 15724462 }, + { 'col-0-0': 1442845800000, 'col-1-1': { keys: ['png', 'ZA'] }, 'col-2-2': 19659 }, + { 'col-0-0': 1442845800000, 'col-1-1': { keys: ['png', 'CL'] }, 'col-2-2': 19579 }, + { 'col-0-0': 1442845800000, 'col-1-1': { keys: ['png', 'BF'] }, 'col-2-2': 18448 }, + { 'col-0-0': 1442845800000, 'col-1-1': { keys: ['__other__'] }, 'col-2-2': 6088917 }, + { 'col-0-0': 1442867400000, 'col-1-1': { keys: ['png', 'PL'] }, 'col-2-2': 14956 }, + { 'col-0-0': 1442867400000, 'col-1-1': { keys: ['jpg', 'BR'] }, 'col-2-2': 9474 }, + { 'col-0-0': 1442867400000, 'col-1-1': { keys: ['php', 'NL'] }, 'col-2-2': 9320 }, + { 'col-0-0': 1442867400000, 'col-1-1': { keys: ['__other__'] }, 'col-2-2': 224825 }, + ]); + }); + + it('can be used with filtered metric', async () => { + const expression = ` + kibana_context timeRange={timerange from='${timeRange.from}' to='${timeRange.to}'} + | esaggs index={indexPatternLoad id='logstash-*'} + aggs={aggMultiTerms id="0" enabled=true schema="bucket" fields="extension.raw" fields="geo.dest" size=3 orderAgg={aggFilteredMetric + id="order-1" + customBucket={aggFilter + id="order-1-filter" + enabled=true + schema="bucket" + filter={kql "geo.src:US"} + } + customMetric={aggSum id="order-2" + field="bytes" + enabled=true + schema="metric" + } + enabled=true + schema="metric" + } otherBucket=true} + aggs={aggFilteredMetric + id="1" + customBucket={aggFilter + id="1-filter" + enabled=true + schema="bucket" + filter={kql "geo.src:US"} + } + customMetric={aggSum id="2" + field="bytes" + enabled=true + schema="metric" + } + enabled=true + schema="metric" + } + `; + const result = await expectExpression( + 'esaggs_multi_terms_filtered_metric', + expression + ).getResponse(); + expect(result.rows).to.eql([ + { 'col-0-0': { keys: ['jpg', 'IN'] }, 'col-1-1': 225557 }, + { 'col-0-0': { keys: ['jpg', 'CN'] }, 'col-1-1': 219324 }, + { 'col-0-0': { keys: ['jpg', 'US'] }, 'col-1-1': 106761 }, + { 'col-0-0': { keys: ['__other__'] }, 'col-1-1': 1649102 }, + ]); + }); + }); +} diff --git a/test/interpreter_functional/test_suites/run_pipeline/index.ts b/test/interpreter_functional/test_suites/run_pipeline/index.ts index f8c37bab02b86..32f59fcf3df9c 100644 --- a/test/interpreter_functional/test_suites/run_pipeline/index.ts +++ b/test/interpreter_functional/test_suites/run_pipeline/index.ts @@ -43,5 +43,6 @@ export default function ({ getService, getPageObjects, loadTestFile }: FtrProvid loadTestFile(require.resolve('./metric')); loadTestFile(require.resolve('./esaggs')); loadTestFile(require.resolve('./esaggs_timeshift')); + loadTestFile(require.resolve('./esaggs_multiterms')); }); } diff --git a/test/tsconfig.json b/test/tsconfig.json index 288d152bf4bc0..64c85dad73312 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -51,7 +51,7 @@ { "path": "../src/plugins/ui_actions/tsconfig.json" }, { "path": "../src/plugins/url_forwarding/tsconfig.json" }, { "path": "../src/plugins/usage_collection/tsconfig.json" }, - { "path": "../src/plugins/index_pattern_management/tsconfig.json" }, + { "path": "../src/plugins/data_view_management/tsconfig.json" }, { "path": "../src/plugins/visualize/tsconfig.json" }, { "path": "interactive_setup_api_integration/fixtures/test_endpoints/tsconfig.json" }, { "path": "plugin_functional/plugins/core_app_status/tsconfig.json" }, diff --git a/typings/index.d.ts b/typings/index.d.ts index 85c001b26031b..cd2dc0a989c83 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -38,3 +38,27 @@ declare module 'react-syntax-highlighter/dist/cjs/prism-light'; declare module 'monaco-editor/esm/vs/basic-languages/markdown/markdown'; declare module 'monaco-editor/esm/vs/basic-languages/css/css'; declare module 'monaco-editor/esm/vs/basic-languages/yaml/yaml'; + +// Storybook uses this module and its types are defined in the source but not in the type output +declare module 'file-system-cache' { + interface Options { + basePath?: string; + ns?: string | string[]; + extension?: string; + } + + class FileSystemCache { + constructor(options: Options); + path(key: string): string; + fileExists(key: string): Promise; + ensureBasePath(): Promise; + get(key: string, defaultValue?: any): Promise; + getSync(key: string, defaultValue?: any): any | typeof defaultValue; + set(key: string, value: any): Promise<{ path: string }>; + setSync(key: string, value: any): this; + remove(key: string): Promise; + clear(): Promise; + save(): Promise<{ paths: string[] }>; + load(): Promise<{ files: Array<{ path: string; value: any }> }>; + } +} diff --git a/x-pack/examples/reporting_example/public/containers/main.tsx b/x-pack/examples/reporting_example/public/containers/main.tsx index e3f45b4359556..c6723c9839197 100644 --- a/x-pack/examples/reporting_example/public/containers/main.tsx +++ b/x-pack/examples/reporting_example/public/containers/main.tsx @@ -27,7 +27,7 @@ import { EuiContextMenuProps, } from '@elastic/eui'; import moment from 'moment'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import React, { useEffect, useState } from 'react'; import { parsePath } from 'history'; import { BrowserRouter as Router, useHistory } from 'react-router-dom'; diff --git a/x-pack/plugins/actions/server/builtin_action_types/jira/api.ts b/x-pack/plugins/actions/server/builtin_action_types/jira/api.ts index 4ac343b0ab9e8..fd02f86db8be6 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/jira/api.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/jira/api.ts @@ -80,6 +80,9 @@ const pushToServiceHandler = async ({ if (comments && Array.isArray(comments) && comments.length > 0) { res.comments = []; for (const currentComment of comments) { + if (!currentComment.comment) { + continue; + } const comment = await externalService.createComment({ incidentId: res.id, comment: currentComment, diff --git a/x-pack/plugins/actions/server/builtin_action_types/lib/create_jwt_assertion.test.ts b/x-pack/plugins/actions/server/builtin_action_types/lib/create_jwt_assertion.test.ts new file mode 100644 index 0000000000000..abeb14de4c43b --- /dev/null +++ b/x-pack/plugins/actions/server/builtin_action_types/lib/create_jwt_assertion.test.ts @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +jest.mock('jsonwebtoken', () => ({ + sign: jest.fn(), +})); +// eslint-disable-next-line import/no-extraneous-dependencies +import jwt from 'jsonwebtoken'; +import { Logger } from '../../../../../../src/core/server'; +import { loggingSystemMock } from '../../../../../../src/core/server/mocks'; +import { createJWTAssertion } from './create_jwt_assertion'; + +const jwtSign = jwt.sign as jest.Mock; +const mockLogger = loggingSystemMock.create().get() as jest.Mocked; + +describe('createJWTAssertion', () => { + test('creating a JWT token from provided claims with default values', () => { + jwtSign.mockReturnValueOnce('123456qwertyjwttoken'); + + const assertion = createJWTAssertion(mockLogger, 'test', '123456', { + audience: '1', + issuer: 'someappid', + subject: 'test@gmail.com', + }); + + expect(assertion).toMatchInlineSnapshot('"123456qwertyjwttoken"'); + }); + + test('throw the exception and log the proper error if token was not get successfuly', () => { + jwtSign.mockImplementationOnce(() => { + throw new Error('{"message": "jwt wrong header", "name": "JsonWebTokenError"}'); + }); + const fn = () => + createJWTAssertion(mockLogger, 'test', '123456', { + audience: '1', + issuer: 'someappid', + subject: 'test@gmail.com', + }); + expect(fn).toThrowError(); + + expect(mockLogger.warn.mock.calls[0]).toMatchInlineSnapshot(` + Array [ + "Unable to generate JWT token. Error: Error: {\\"message\\": \\"jwt wrong header\\", \\"name\\": \\"JsonWebTokenError\\"}", + ] + `); + }); +}); diff --git a/x-pack/plugins/actions/server/builtin_action_types/lib/create_jwt_assertion.ts b/x-pack/plugins/actions/server/builtin_action_types/lib/create_jwt_assertion.ts new file mode 100644 index 0000000000000..9f5102b336eda --- /dev/null +++ b/x-pack/plugins/actions/server/builtin_action_types/lib/create_jwt_assertion.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +// eslint-disable-next-line import/no-extraneous-dependencies +import jwt, { Algorithm } from 'jsonwebtoken'; +import { Logger } from '../../../../../../src/core/server'; + +export interface JWTClaims { + audience: string; + subject: string; + issuer: string; + expireInMilisecons?: number; + keyId?: string; +} + +export function createJWTAssertion( + logger: Logger, + privateKey: string, + privateKeyPassword: string, + reservedClaims: JWTClaims, + customClaims?: Record +): string { + const { subject, audience, issuer, expireInMilisecons, keyId } = reservedClaims; + const iat = Math.floor(Date.now() / 1000); + + const headerObj = { algorithm: 'RS256' as Algorithm, ...(keyId ? { keyid: keyId } : {}) }; + + const payloadObj = { + sub: subject, // subject claim identifies the principal that is the subject of the JWT + aud: audience, // audience claim identifies the recipients that the JWT is intended for + iss: issuer, // issuer claim identifies the principal that issued the JWT + iat, // issued at claim identifies the time at which the JWT was issued + exp: iat + (expireInMilisecons ?? 3600), // expiration time claim identifies the expiration time on or after which the JWT MUST NOT be accepted for processing + ...(customClaims ?? {}), + }; + + try { + const jwtToken = jwt.sign( + JSON.stringify(payloadObj), + { + key: privateKey, + passphrase: privateKeyPassword, + }, + headerObj + ); + return jwtToken; + } catch (error) { + const errorMessage = `Unable to generate JWT token. Error: ${error}`; + logger.warn(errorMessage); + throw new Error(errorMessage); + } +} diff --git a/x-pack/plugins/actions/server/builtin_action_types/lib/request_oauth_client_credentials_token.test.ts b/x-pack/plugins/actions/server/builtin_action_types/lib/request_oauth_client_credentials_token.test.ts index 6e967500e8627..a8dbe4ebc0743 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/lib/request_oauth_client_credentials_token.test.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/lib/request_oauth_client_credentials_token.test.ts @@ -11,8 +11,8 @@ jest.mock('axios', () => ({ import axios from 'axios'; import { Logger } from '../../../../../../src/core/server'; import { loggingSystemMock } from '../../../../../../src/core/server/mocks'; -import { requestOAuthClientCredentialsToken } from './request_oauth_client_credentials_token'; import { actionsConfigMock } from '../../actions_config.mock'; +import { requestOAuthClientCredentialsToken } from './request_oauth_client_credentials_token'; const createAxiosInstanceMock = axios.create as jest.Mock; const axiosInstanceMock = jest.fn(); @@ -122,7 +122,7 @@ describe('requestOAuthClientCredentialsToken', () => { expect(mockLogger.warn.mock.calls[0]).toMatchInlineSnapshot(` Array [ - "error thrown getting the access token from https://test for clientID: 123456: {\\"error\\":\\"invalid_scope\\",\\"error_description\\":\\"AADSTS70011: The provided value for the input parameter \'scope\' is not valid.\\"}", + "error thrown getting the access token from https://test for params: {\\"scope\\":\\"test\\",\\"client_id\\":\\"123456\\",\\"client_secret\\":\\"secrert123\\"}: {\\"error\\":\\"invalid_scope\\",\\"error_description\\":\\"AADSTS70011: The provided value for the input parameter 'scope' is not valid.\\"}", ] `); }); diff --git a/x-pack/plugins/actions/server/builtin_action_types/lib/request_oauth_client_credentials_token.ts b/x-pack/plugins/actions/server/builtin_action_types/lib/request_oauth_client_credentials_token.ts index b632cdf5f5219..3acd01be6954f 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/lib/request_oauth_client_credentials_token.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/lib/request_oauth_client_credentials_token.ts @@ -4,66 +4,40 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - -import qs from 'query-string'; -import axios from 'axios'; -import stringify from 'json-stable-stringify'; import { Logger } from '../../../../../../src/core/server'; -import { request } from './axios_utils'; import { ActionsConfigurationUtilities } from '../../actions_config'; +import { OAuthTokenResponse, requestOAuthToken } from './request_oauth_token'; +import { RewriteResponseCase } from '../../../../actions/common'; export const OAUTH_CLIENT_CREDENTIALS_GRANT_TYPE = 'client_credentials'; -interface ClientCredentialsRequestParams { +export interface ClientCredentialsOAuthRequestParams { scope?: string; clientId?: string; clientSecret?: string; } -export interface ClientCredentialsResponse { - tokenType: string; - accessToken: string; - expiresIn: number; -} +const rewriteBodyRequest: RewriteResponseCase = ({ + clientId, + clientSecret, + ...res +}) => ({ + ...res, + client_id: clientId, + client_secret: clientSecret, +}); export async function requestOAuthClientCredentialsToken( tokenUrl: string, logger: Logger, - params: ClientCredentialsRequestParams, + params: ClientCredentialsOAuthRequestParams, configurationUtilities: ActionsConfigurationUtilities -): Promise { - const axiosInstance = axios.create(); - const { clientId, clientSecret, scope } = params; - - const res = await request({ - axios: axiosInstance, - url: tokenUrl, - method: 'post', - logger, - data: qs.stringify({ - scope, - client_id: clientId, - client_secret: clientSecret, - grant_type: OAUTH_CLIENT_CREDENTIALS_GRANT_TYPE, - }), - headers: { - 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', - }, +): Promise { + return await requestOAuthToken( + tokenUrl, + OAUTH_CLIENT_CREDENTIALS_GRANT_TYPE, configurationUtilities, - validateStatus: () => true, - }); - - if (res.status === 200) { - return { - tokenType: res.data.token_type, - accessToken: res.data.access_token, - expiresIn: res.data.expires_in, - }; - } else { - const errString = stringify(res.data); - logger.warn( - `error thrown getting the access token from ${tokenUrl} for clientID: ${clientId}: ${errString}` - ); - throw new Error(errString); - } + logger, + rewriteBodyRequest(params) + ); } diff --git a/x-pack/plugins/actions/server/builtin_action_types/lib/request_oauth_jwt_token.test.ts b/x-pack/plugins/actions/server/builtin_action_types/lib/request_oauth_jwt_token.test.ts new file mode 100644 index 0000000000000..9ee510bd991f2 --- /dev/null +++ b/x-pack/plugins/actions/server/builtin_action_types/lib/request_oauth_jwt_token.test.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +jest.mock('axios', () => ({ + create: jest.fn(), +})); +import axios from 'axios'; +import { Logger } from '../../../../../../src/core/server'; +import { loggingSystemMock } from '../../../../../../src/core/server/mocks'; +import { actionsConfigMock } from '../../actions_config.mock'; +import { requestOAuthJWTToken } from './request_oauth_jwt_token'; + +const createAxiosInstanceMock = axios.create as jest.Mock; +const axiosInstanceMock = jest.fn(); + +const mockLogger = loggingSystemMock.create().get() as jest.Mocked; + +describe('requestOAuthJWTToken', () => { + beforeEach(() => { + createAxiosInstanceMock.mockReturnValue(axiosInstanceMock); + }); + + test('making a token request with the required options', async () => { + const configurationUtilities = actionsConfigMock.create(); + axiosInstanceMock.mockReturnValueOnce({ + status: 200, + data: { + tokenType: 'Bearer', + accessToken: 'dfjsdfgdjhfgsjdf', + expiresIn: 123, + }, + }); + await requestOAuthJWTToken( + 'https://test', + { + assertion: 'someJWTvalueishere', + clientId: 'client-id-1', + clientSecret: 'some-client-secret', + scope: 'test', + }, + mockLogger, + configurationUtilities + ); + + expect(axiosInstanceMock.mock.calls[0]).toMatchInlineSnapshot(` + Array [ + "https://test", + Object { + "data": "assertion=someJWTvalueishere&client_id=client-id-1&client_secret=some-client-secret&grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&scope=test", + "headers": Object { + "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", + }, + "httpAgent": undefined, + "httpsAgent": Agent { + "_events": Object { + "free": [Function], + "newListener": [Function], + }, + "_eventsCount": 2, + "_maxListeners": undefined, + "_sessionCache": Object { + "list": Array [], + "map": Object {}, + }, + "defaultPort": 443, + "freeSockets": Object {}, + "keepAlive": false, + "keepAliveMsecs": 1000, + "maxCachedSessions": 100, + "maxFreeSockets": 256, + "maxSockets": Infinity, + "maxTotalSockets": Infinity, + "options": Object { + "path": null, + "rejectUnauthorized": true, + }, + "protocol": "https:", + "requests": Object {}, + "scheduling": "lifo", + "sockets": Object {}, + "totalSocketCount": 0, + Symbol(kCapture): false, + }, + "maxContentLength": 1000000, + "method": "post", + "proxy": false, + "timeout": 360000, + "validateStatus": [Function], + }, + ] + `); + }); + + test('throw the exception and log the proper error if token was not get successfuly', async () => { + const configurationUtilities = actionsConfigMock.create(); + axiosInstanceMock.mockReturnValueOnce({ + status: 400, + data: { + error: 'invalid_scope', + error_description: + "AADSTS70011: The provided value for the input parameter 'scope' is not valid.", + }, + }); + + await expect( + requestOAuthJWTToken( + 'https://test', + { + assertion: 'someJWTvalueishere', + clientId: 'client-id-1', + clientSecret: 'some-client-secret', + scope: 'test', + }, + mockLogger, + configurationUtilities + ) + ).rejects.toThrowErrorMatchingInlineSnapshot( + '"{\\"error\\":\\"invalid_scope\\",\\"error_description\\":\\"AADSTS70011: The provided value for the input parameter \'scope\' is not valid.\\"}"' + ); + + expect(mockLogger.warn.mock.calls[0]).toMatchInlineSnapshot(` + Array [ + "error thrown getting the access token from https://test for params: {\\"assertion\\":\\"someJWTvalueishere\\",\\"scope\\":\\"test\\",\\"client_id\\":\\"client-id-1\\",\\"client_secret\\":\\"some-client-secret\\"}: {\\"error\\":\\"invalid_scope\\",\\"error_description\\":\\"AADSTS70011: The provided value for the input parameter 'scope' is not valid.\\"}", + ] + `); + }); +}); diff --git a/x-pack/plugins/actions/server/builtin_action_types/lib/request_oauth_jwt_token.ts b/x-pack/plugins/actions/server/builtin_action_types/lib/request_oauth_jwt_token.ts new file mode 100644 index 0000000000000..91c1d8a999b23 --- /dev/null +++ b/x-pack/plugins/actions/server/builtin_action_types/lib/request_oauth_jwt_token.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { Logger } from '../../../../../../src/core/server'; +import { ActionsConfigurationUtilities } from '../../actions_config'; +import { OAuthTokenResponse, requestOAuthToken } from './request_oauth_token'; +import { RewriteResponseCase } from '../../../../actions/common'; + +// This is a standard for JSON Web Token (JWT) Profile +// for OAuth 2.0 Client Authentication and Authorization Grants https://datatracker.ietf.org/doc/html/rfc7523#section-8.1 +export const OAUTH_JWT_BEARER_GRANT_TYPE = 'urn:ietf:params:oauth:grant-type:jwt-bearer'; + +interface JWTOAuthRequestParams { + assertion: string; + clientId?: string; + clientSecret?: string; + scope?: string; +} + +const rewriteBodyRequest: RewriteResponseCase = ({ + clientId, + clientSecret, + ...res +}) => ({ + ...res, + client_id: clientId, + client_secret: clientSecret, +}); + +export async function requestOAuthJWTToken( + tokenUrl: string, + params: JWTOAuthRequestParams, + logger: Logger, + configurationUtilities: ActionsConfigurationUtilities +): Promise { + return await requestOAuthToken( + tokenUrl, + OAUTH_JWT_BEARER_GRANT_TYPE, + configurationUtilities, + logger, + rewriteBodyRequest(params) + ); +} diff --git a/x-pack/plugins/actions/server/builtin_action_types/lib/request_oauth_token.test.ts b/x-pack/plugins/actions/server/builtin_action_types/lib/request_oauth_token.test.ts new file mode 100644 index 0000000000000..d8280d2fcdebd --- /dev/null +++ b/x-pack/plugins/actions/server/builtin_action_types/lib/request_oauth_token.test.ts @@ -0,0 +1,138 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +jest.mock('axios', () => ({ + create: jest.fn(), +})); +import axios from 'axios'; +import { Logger } from '../../../../../../src/core/server'; +import { loggingSystemMock } from '../../../../../../src/core/server/mocks'; +import { requestOAuthToken } from './request_oauth_token'; +import { actionsConfigMock } from '../../actions_config.mock'; + +const createAxiosInstanceMock = axios.create as jest.Mock; +const axiosInstanceMock = jest.fn(); + +const mockLogger = loggingSystemMock.create().get() as jest.Mocked; + +interface TestOAuthRequestParams { + someAdditionalParam?: string; + clientId?: string; + clientSecret?: string; +} + +describe('requestOAuthToken', () => { + beforeEach(() => { + createAxiosInstanceMock.mockReturnValue(axiosInstanceMock); + }); + + test('making a token request with the required options', async () => { + const configurationUtilities = actionsConfigMock.create(); + axiosInstanceMock.mockReturnValueOnce({ + status: 200, + data: { + tokenType: 'Bearer', + accessToken: 'dfjsdfgdjhfgsjdf', + expiresIn: 123, + }, + }); + + await requestOAuthToken( + 'https://test', + 'test', + configurationUtilities, + mockLogger, + { + client_id: '123456', + client_secret: 'secrert123', + some_additional_param: 'test', + } + ); + + expect(axiosInstanceMock.mock.calls[0]).toMatchInlineSnapshot(` + Array [ + "https://test", + Object { + "data": "client_id=123456&client_secret=secrert123&grant_type=test&some_additional_param=test", + "headers": Object { + "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", + }, + "httpAgent": undefined, + "httpsAgent": Agent { + "_events": Object { + "free": [Function], + "newListener": [Function], + }, + "_eventsCount": 2, + "_maxListeners": undefined, + "_sessionCache": Object { + "list": Array [], + "map": Object {}, + }, + "defaultPort": 443, + "freeSockets": Object {}, + "keepAlive": false, + "keepAliveMsecs": 1000, + "maxCachedSessions": 100, + "maxFreeSockets": 256, + "maxSockets": Infinity, + "maxTotalSockets": Infinity, + "options": Object { + "path": null, + "rejectUnauthorized": true, + }, + "protocol": "https:", + "requests": Object {}, + "scheduling": "lifo", + "sockets": Object {}, + "totalSocketCount": 0, + Symbol(kCapture): false, + }, + "maxContentLength": 1000000, + "method": "post", + "proxy": false, + "timeout": 360000, + "validateStatus": [Function], + }, + ] + `); + }); + + test('throw the exception and log the proper error if token was not get successfuly', async () => { + const configurationUtilities = actionsConfigMock.create(); + axiosInstanceMock.mockReturnValueOnce({ + status: 400, + data: { + error: 'invalid_scope', + error_description: + "AADSTS70011: The provided value for the input parameter 'scope' is not valid.", + }, + }); + + await expect( + requestOAuthToken( + 'https://test', + 'test', + configurationUtilities, + mockLogger, + { + client_id: '123456', + client_secret: 'secrert123', + some_additional_param: 'test', + } + ) + ).rejects.toThrowErrorMatchingInlineSnapshot( + '"{\\"error\\":\\"invalid_scope\\",\\"error_description\\":\\"AADSTS70011: The provided value for the input parameter \'scope\' is not valid.\\"}"' + ); + + expect(mockLogger.warn.mock.calls[0]).toMatchInlineSnapshot(` + Array [ + "error thrown getting the access token from https://test for params: {\\"client_id\\":\\"123456\\",\\"client_secret\\":\\"secrert123\\",\\"some_additional_param\\":\\"test\\"}: {\\"error\\":\\"invalid_scope\\",\\"error_description\\":\\"AADSTS70011: The provided value for the input parameter 'scope' is not valid.\\"}", + ] + `); + }); +}); diff --git a/x-pack/plugins/actions/server/builtin_action_types/lib/request_oauth_token.ts b/x-pack/plugins/actions/server/builtin_action_types/lib/request_oauth_token.ts new file mode 100644 index 0000000000000..6e4fc40ed21be --- /dev/null +++ b/x-pack/plugins/actions/server/builtin_action_types/lib/request_oauth_token.ts @@ -0,0 +1,62 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import qs from 'query-string'; +import axios from 'axios'; +import stringify from 'json-stable-stringify'; +import { Logger } from '../../../../../../src/core/server'; +import { request } from './axios_utils'; +import { ActionsConfigurationUtilities } from '../../actions_config'; +import { AsApiContract } from '../../../../actions/common'; + +export interface OAuthTokenResponse { + tokenType: string; + accessToken: string; + expiresIn: number; +} + +export async function requestOAuthToken( + tokenUrl: string, + grantType: string, + configurationUtilities: ActionsConfigurationUtilities, + logger: Logger, + bodyRequest: AsApiContract +): Promise { + const axiosInstance = axios.create(); + + const res = await request({ + axios: axiosInstance, + url: tokenUrl, + method: 'post', + logger, + data: qs.stringify({ + ...bodyRequest, + grant_type: grantType, + }), + headers: { + 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', + }, + configurationUtilities, + validateStatus: () => true, + }); + + if (res.status === 200) { + return { + tokenType: res.data.token_type, + accessToken: res.data.access_token, + expiresIn: res.data.expires_in, + }; + } else { + const errString = stringify(res.data); + logger.warn( + `error thrown getting the access token from ${tokenUrl} for params: ${JSON.stringify( + bodyRequest + )}: ${errString}` + ); + throw new Error(errString); + } +} diff --git a/x-pack/plugins/alerting/server/routes/health.test.ts b/x-pack/plugins/alerting/server/routes/health.test.ts index b8e023e4f4d1b..9779bcbb5ad07 100644 --- a/x-pack/plugins/alerting/server/routes/health.test.ts +++ b/x-pack/plugins/alerting/server/routes/health.test.ts @@ -14,6 +14,9 @@ import { encryptedSavedObjectsMock } from '../../../encrypted_saved_objects/serv import { rulesClientMock } from '../rules_client.mock'; import { HealthStatus } from '../types'; import { alertsMock } from '../mocks'; +import { RecoveredActionGroup } from '../../common'; +import { RegistryAlertTypeWithAuth } from '../authorization'; + const rulesClient = rulesClientMock.create(); jest.mock('../lib/license_api_access.ts', () => ({ @@ -22,6 +25,33 @@ jest.mock('../lib/license_api_access.ts', () => ({ const alerting = alertsMock.createStart(); const currentDate = new Date().toISOString(); +const ruleTypes = [ + { + id: '1', + name: 'name', + actionGroups: [ + { + id: 'default', + name: 'Default', + }, + ], + defaultActionGroupId: 'default', + minimumLicenseRequired: 'basic', + isExportable: true, + ruleTaskTimeout: '10m', + recoveryActionGroup: RecoveredActionGroup, + authorizedConsumers: {}, + actionVariables: { + context: [], + state: [], + }, + producer: 'test', + enabledInLicense: true, + minimumScheduleInterval: '1m', + defaultScheduleInterval: '10m', + } as RegistryAlertTypeWithAuth, +]; + beforeEach(() => { jest.resetAllMocks(); alerting.getFrameworkHealth.mockResolvedValue({ @@ -42,6 +72,7 @@ beforeEach(() => { describe('healthRoute', () => { it('registers the route', async () => { + rulesClient.listAlertTypes.mockResolvedValueOnce(new Set(ruleTypes)); const router = httpServiceMock.createRouter(); const licenseState = licenseStateMock.create(); @@ -54,6 +85,7 @@ describe('healthRoute', () => { }); it('queries the usage api', async () => { + rulesClient.listAlertTypes.mockResolvedValueOnce(new Set(ruleTypes)); const router = httpServiceMock.createRouter(); const licenseState = licenseStateMock.create(); @@ -76,7 +108,34 @@ describe('healthRoute', () => { expect(verifyApiAccess).toHaveBeenCalledWith(licenseState); }); + it('throws error when user does not have any access to any rule types', async () => { + rulesClient.listAlertTypes.mockResolvedValueOnce(new Set()); + const router = httpServiceMock.createRouter(); + + const licenseState = licenseStateMock.create(); + const encryptedSavedObjects = encryptedSavedObjectsMock.createSetup({ canEncrypt: false }); + healthRoute(router, licenseState, encryptedSavedObjects); + const [, handler] = router.get.mock.calls[0]; + + const [context, req, res] = mockHandlerArguments( + { + rulesClient, + getFrameworkHealth: alerting.getFrameworkHealth, + areApiKeysEnabled: () => Promise.resolve(true), + }, + {}, + ['ok'] + ); + + await handler(context, req, res); + + expect(res.forbidden).toHaveBeenCalledWith({ + body: { message: `Unauthorized to access alerting framework health` }, + }); + }); + it('evaluates whether Encrypted Saved Objects is missing encryption key', async () => { + rulesClient.listAlertTypes.mockResolvedValueOnce(new Set(ruleTypes)); const router = httpServiceMock.createRouter(); const licenseState = licenseStateMock.create(); @@ -117,6 +176,7 @@ describe('healthRoute', () => { }); test('when ES security status cannot be determined from license state, isSufficientlySecure should return false', async () => { + rulesClient.listAlertTypes.mockResolvedValueOnce(new Set(ruleTypes)); const router = httpServiceMock.createRouter(); const licenseState = licenseStateMock.create(); const encryptedSavedObjects = encryptedSavedObjectsMock.createSetup({ canEncrypt: true }); @@ -158,6 +218,7 @@ describe('healthRoute', () => { }); test('when ES security is disabled, isSufficientlySecure should return true', async () => { + rulesClient.listAlertTypes.mockResolvedValueOnce(new Set(ruleTypes)); const router = httpServiceMock.createRouter(); const licenseState = licenseStateMock.create(); const encryptedSavedObjects = encryptedSavedObjectsMock.createSetup({ canEncrypt: true }); @@ -199,6 +260,7 @@ describe('healthRoute', () => { }); test('when ES security is enabled but user cannot generate api keys, isSufficientlySecure should return false', async () => { + rulesClient.listAlertTypes.mockResolvedValueOnce(new Set(ruleTypes)); const router = httpServiceMock.createRouter(); const licenseState = licenseStateMock.create(); const encryptedSavedObjects = encryptedSavedObjectsMock.createSetup({ canEncrypt: true }); @@ -240,6 +302,7 @@ describe('healthRoute', () => { }); test('when ES security is enabled and user can generate api keys, isSufficientlySecure should return true', async () => { + rulesClient.listAlertTypes.mockResolvedValueOnce(new Set(ruleTypes)); const router = httpServiceMock.createRouter(); const licenseState = licenseStateMock.create(); const encryptedSavedObjects = encryptedSavedObjectsMock.createSetup({ canEncrypt: true }); diff --git a/x-pack/plugins/alerting/server/routes/health.ts b/x-pack/plugins/alerting/server/routes/health.ts index 4f3ed2b542611..66f8184e96fce 100644 --- a/x-pack/plugins/alerting/server/routes/health.ts +++ b/x-pack/plugins/alerting/server/routes/health.ts @@ -45,22 +45,30 @@ export const healthRoute = ( router.handleLegacyErrors( verifyAccessAndContext(licenseState, async function (context, req, res) { try { - const alertingFrameworkHeath = await context.alerting.getFrameworkHealth(); + // Verify that user has access to at least one rule type + const ruleTypes = Array.from(await context.alerting.getRulesClient().listAlertTypes()); + if (ruleTypes.length > 0) { + const alertingFrameworkHeath = await context.alerting.getFrameworkHealth(); - const securityHealth = await getSecurityHealth( - async () => (licenseState ? licenseState.getIsSecurityEnabled() : null), - async () => encryptedSavedObjects.canEncrypt, - context.alerting.areApiKeysEnabled - ); + const securityHealth = await getSecurityHealth( + async () => (licenseState ? licenseState.getIsSecurityEnabled() : null), + async () => encryptedSavedObjects.canEncrypt, + context.alerting.areApiKeysEnabled + ); - const frameworkHealth: AlertingFrameworkHealth = { - ...securityHealth, - alertingFrameworkHeath, - }; + const frameworkHealth: AlertingFrameworkHealth = { + ...securityHealth, + alertingFrameworkHeath, + }; - return res.ok({ - body: rewriteBodyRes(frameworkHealth), - }); + return res.ok({ + body: rewriteBodyRes(frameworkHealth), + }); + } else { + return res.forbidden({ + body: { message: `Unauthorized to access alerting framework health` }, + }); + } } catch (error) { return res.badRequest({ body: error }); } diff --git a/x-pack/plugins/alerting/server/routes/legacy/health.test.ts b/x-pack/plugins/alerting/server/routes/legacy/health.test.ts index 59ede356add00..7215723264fe2 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/health.test.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/health.test.ts @@ -11,9 +11,10 @@ import { mockHandlerArguments } from './../_mock_handler_arguments'; import { licenseStateMock } from '../../lib/license_state.mock'; import { encryptedSavedObjectsMock } from '../../../../encrypted_saved_objects/server/mocks'; import { rulesClientMock } from '../../rules_client.mock'; -import { HealthStatus } from '../../types'; +import { HealthStatus, RecoveredActionGroup } from '../../types'; import { alertsMock } from '../../mocks'; import { trackLegacyRouteUsage } from '../../lib/track_legacy_route_usage'; +import { RegistryAlertTypeWithAuth } from '../../authorization'; const rulesClient = rulesClientMock.create(); @@ -28,6 +29,34 @@ jest.mock('../../lib/track_legacy_route_usage', () => ({ const alerting = alertsMock.createStart(); const currentDate = new Date().toISOString(); + +const ruleTypes = [ + { + id: '1', + name: 'name', + actionGroups: [ + { + id: 'default', + name: 'Default', + }, + ], + defaultActionGroupId: 'default', + minimumLicenseRequired: 'basic', + isExportable: true, + ruleTaskTimeout: '10m', + recoveryActionGroup: RecoveredActionGroup, + authorizedConsumers: {}, + actionVariables: { + context: [], + state: [], + }, + producer: 'test', + enabledInLicense: true, + minimumScheduleInterval: '1m', + defaultScheduleInterval: '10m', + } as RegistryAlertTypeWithAuth, +]; + beforeEach(() => { jest.resetAllMocks(); alerting.getFrameworkHealth.mockResolvedValue({ @@ -48,6 +77,7 @@ beforeEach(() => { describe('healthRoute', () => { it('registers the route', async () => { + rulesClient.listAlertTypes.mockResolvedValueOnce(new Set(ruleTypes)); const router = httpServiceMock.createRouter(); const licenseState = licenseStateMock.create(); @@ -59,7 +89,34 @@ describe('healthRoute', () => { expect(config.path).toMatchInlineSnapshot(`"/api/alerts/_health"`); }); + it('throws error when user does not have any access to any rule types', async () => { + rulesClient.listAlertTypes.mockResolvedValueOnce(new Set()); + const router = httpServiceMock.createRouter(); + + const licenseState = licenseStateMock.create(); + const encryptedSavedObjects = encryptedSavedObjectsMock.createSetup({ canEncrypt: false }); + healthRoute(router, licenseState, encryptedSavedObjects); + const [, handler] = router.get.mock.calls[0]; + + const [context, req, res] = mockHandlerArguments( + { + rulesClient, + getFrameworkHealth: alerting.getFrameworkHealth, + areApiKeysEnabled: () => Promise.resolve(true), + }, + {}, + ['ok'] + ); + + await handler(context, req, res); + + expect(res.forbidden).toHaveBeenCalledWith({ + body: { message: `Unauthorized to access alerting framework health` }, + }); + }); + it('evaluates whether Encrypted Saved Objects is missing encryption key', async () => { + rulesClient.listAlertTypes.mockResolvedValueOnce(new Set(ruleTypes)); const router = httpServiceMock.createRouter(); const licenseState = licenseStateMock.create(); @@ -100,6 +157,7 @@ describe('healthRoute', () => { }); test('when ES security status cannot be determined from license state, isSufficientlySecure should return false', async () => { + rulesClient.listAlertTypes.mockResolvedValueOnce(new Set(ruleTypes)); const router = httpServiceMock.createRouter(); const licenseState = licenseStateMock.create(); const encryptedSavedObjects = encryptedSavedObjectsMock.createSetup({ canEncrypt: true }); @@ -141,6 +199,7 @@ describe('healthRoute', () => { }); test('when ES security is disabled, isSufficientlySecure should return true', async () => { + rulesClient.listAlertTypes.mockResolvedValueOnce(new Set(ruleTypes)); const router = httpServiceMock.createRouter(); const licenseState = licenseStateMock.create(); const encryptedSavedObjects = encryptedSavedObjectsMock.createSetup({ canEncrypt: true }); @@ -182,6 +241,7 @@ describe('healthRoute', () => { }); test('when ES security is enabled but user cannot generate api keys, isSufficientlySecure should return false', async () => { + rulesClient.listAlertTypes.mockResolvedValueOnce(new Set(ruleTypes)); const router = httpServiceMock.createRouter(); const licenseState = licenseStateMock.create(); const encryptedSavedObjects = encryptedSavedObjectsMock.createSetup({ canEncrypt: true }); @@ -223,6 +283,7 @@ describe('healthRoute', () => { }); test('when ES security is enabled and user can generate api keys, isSufficientlySecure should return true', async () => { + rulesClient.listAlertTypes.mockResolvedValueOnce(new Set(ruleTypes)); const router = httpServiceMock.createRouter(); const licenseState = licenseStateMock.create(); const encryptedSavedObjects = encryptedSavedObjectsMock.createSetup({ canEncrypt: true }); @@ -264,6 +325,7 @@ describe('healthRoute', () => { }); it('should track every call', async () => { + rulesClient.listAlertTypes.mockResolvedValueOnce(new Set(ruleTypes)); const licenseState = licenseStateMock.create(); const router = httpServiceMock.createRouter(); const encryptedSavedObjects = encryptedSavedObjectsMock.createSetup({ canEncrypt: true }); diff --git a/x-pack/plugins/alerting/server/routes/legacy/health.ts b/x-pack/plugins/alerting/server/routes/legacy/health.ts index abea724b63c6f..ea066220f8980 100644 --- a/x-pack/plugins/alerting/server/routes/legacy/health.ts +++ b/x-pack/plugins/alerting/server/routes/legacy/health.ts @@ -32,22 +32,30 @@ export function healthRoute( } trackLegacyRouteUsage('health', usageCounter); try { - const alertingFrameworkHeath = await context.alerting.getFrameworkHealth(); + // Verify that user has access to at least one rule type + const ruleTypes = Array.from(await context.alerting.getRulesClient().listAlertTypes()); + if (ruleTypes.length > 0) { + const alertingFrameworkHeath = await context.alerting.getFrameworkHealth(); - const securityHealth = await getSecurityHealth( - async () => (licenseState ? licenseState.getIsSecurityEnabled() : null), - async () => encryptedSavedObjects.canEncrypt, - context.alerting.areApiKeysEnabled - ); + const securityHealth = await getSecurityHealth( + async () => (licenseState ? licenseState.getIsSecurityEnabled() : null), + async () => encryptedSavedObjects.canEncrypt, + context.alerting.areApiKeysEnabled + ); - const frameworkHealth: AlertingFrameworkHealth = { - ...securityHealth, - alertingFrameworkHeath, - }; + const frameworkHealth: AlertingFrameworkHealth = { + ...securityHealth, + alertingFrameworkHeath, + }; - return res.ok({ - body: frameworkHealth, - }); + return res.ok({ + body: frameworkHealth, + }); + } else { + return res.forbidden({ + body: { message: `Unauthorized to access alerting framework health` }, + }); + } } catch (error) { return res.badRequest({ body: error }); } diff --git a/x-pack/plugins/alerting/server/saved_objects/migrations.test.ts b/x-pack/plugins/alerting/server/saved_objects/migrations.test.ts index 3822334579137..649c5c1526377 100644 --- a/x-pack/plugins/alerting/server/saved_objects/migrations.test.ts +++ b/x-pack/plugins/alerting/server/saved_objects/migrations.test.ts @@ -2011,6 +2011,50 @@ describe('successful migrations', () => { const alert = getMockData({}, true); expect(migration800(alert, migrationContext)).toEqual(alert); }); + + test('add threatIndicatorPath default value to threat match rules if missing', () => { + const migration800 = getMigrations(encryptedSavedObjectsSetup, isPreconfigured)['8.0.0']; + const alert = getMockData( + { params: { type: 'threat_match' }, alertTypeId: 'siem.signals' }, + true + ); + expect(migration800(alert, migrationContext).attributes.params.threatIndicatorPath).toEqual( + 'threatintel.indicator' + ); + }); + + test('doesnt change threatIndicatorPath value in threat match rules if value is present', () => { + const migration800 = getMigrations(encryptedSavedObjectsSetup, isPreconfigured)['8.0.0']; + const alert = getMockData( + { + params: { type: 'threat_match', threatIndicatorPath: 'custom.indicator.path' }, + alertTypeId: 'siem.signals', + }, + true + ); + expect(migration800(alert, migrationContext).attributes.params.threatIndicatorPath).toEqual( + 'custom.indicator.path' + ); + }); + + test('doesnt change threatIndicatorPath value in other rules', () => { + const migration800 = getMigrations(encryptedSavedObjectsSetup, isPreconfigured)['8.0.0']; + const alert = getMockData({ params: { type: 'eql' }, alertTypeId: 'siem.signals' }, true); + expect(migration800(alert, migrationContext).attributes.params.threatIndicatorPath).toEqual( + undefined + ); + }); + + test('doesnt change threatIndicatorPath value if not a siem.signals rule', () => { + const migration800 = getMigrations(encryptedSavedObjectsSetup, isPreconfigured)['8.0.0']; + const alert = getMockData( + { params: { type: 'threat_match' }, alertTypeId: 'not.siem.signals' }, + true + ); + expect(migration800(alert, migrationContext).attributes.params.threatIndicatorPath).toEqual( + undefined + ); + }); }); }); diff --git a/x-pack/plugins/alerting/server/saved_objects/migrations.ts b/x-pack/plugins/alerting/server/saved_objects/migrations.ts index 67ecca57216e5..9dd3bac7f37a2 100644 --- a/x-pack/plugins/alerting/server/saved_objects/migrations.ts +++ b/x-pack/plugins/alerting/server/saved_objects/migrations.ts @@ -25,6 +25,7 @@ import { extractRefsFromGeoContainmentAlert } from './geo_containment/migrations const SIEM_APP_ID = 'securitySolution'; const SIEM_SERVER_APP_ID = 'siem'; export const LEGACY_LAST_MODIFIED_VERSION = 'pre-7.10.0'; +export const FILEBEAT_7X_INDICATOR_PATH = 'threatintel.indicator'; interface AlertLogMeta extends LogMeta { migrations: { alertDocument: SavedObjectUnsanitizedDoc }; @@ -128,7 +129,7 @@ export function getMigrations( const migrationRules800 = createEsoMigration( encryptedSavedObjects, (doc: SavedObjectUnsanitizedDoc): doc is SavedObjectUnsanitizedDoc => true, - pipeMigrations(addRACRuleTypes) + pipeMigrations(addThreatIndicatorPathToThreatMatchRules, addRACRuleTypes) ); return { @@ -668,6 +669,25 @@ function addRACRuleTypes( : doc; } +function addThreatIndicatorPathToThreatMatchRules( + doc: SavedObjectUnsanitizedDoc +): SavedObjectUnsanitizedDoc { + return isSiemSignalsRuleType(doc) && + doc.attributes.params?.type === 'threat_match' && + !doc.attributes.params.threatIndicatorPath + ? { + ...doc, + attributes: { + ...doc.attributes, + params: { + ...doc.attributes.params, + threatIndicatorPath: FILEBEAT_7X_INDICATOR_PATH, + }, + }, + } + : doc; +} + function getRemovePreconfiguredConnectorsFromReferencesFn( isPreconfigured: (connectorId: string) => boolean ) { diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/errors/errors_page.spec.ts b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/errors/errors_page.spec.ts index fd6890d3a7bed..d08e22092d592 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/errors/errors_page.spec.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/errors/errors_page.spec.ts @@ -91,19 +91,13 @@ describe('Errors page', () => { it('sorts by ocurrences', () => { cy.visit(javaServiceErrorsPageHref); cy.contains('span', 'Occurrences').click(); - cy.url().should( - 'include', - '&sortField=occurrenceCount&sortDirection=asc' - ); + cy.url().should('include', '&sortField=occurrences&sortDirection=asc'); }); it('sorts by latest occurrences', () => { cy.visit(javaServiceErrorsPageHref); - cy.contains('span', 'Latest occurrence').click(); - cy.url().should( - 'include', - '&sortField=latestOccurrenceAt&sortDirection=asc' - ); + cy.contains('span', 'Last seen').click(); + cy.url().should('include', '&sortField=lastSeen&sortDirection=asc'); }); }); }); diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_overview/header_filters.spec.ts b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_overview/header_filters.spec.ts index a7667002d4ea9..49d7104f44a88 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_overview/header_filters.spec.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_overview/header_filters.spec.ts @@ -48,7 +48,7 @@ const apisToIntercept = [ }, { endpoint: - '/internal/apm/services/opbeans-node/error_groups/main_statistics?*', + '/internal/apm/services/opbeans-node/errors/groups/main_statistics?*', name: 'errorGroupsMainStatisticsRequest', }, { diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_overview/time_comparison.spec.ts b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_overview/time_comparison.spec.ts index e905c86a5854c..d513dcaef6842 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_overview/time_comparison.spec.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_overview/time_comparison.spec.ts @@ -40,7 +40,7 @@ const apisToIntercept = [ }, { endpoint: - '/internal/apm/services/opbeans-java/error_groups/detailed_statistics?*', + '/internal/apm/services/opbeans-java/errors/groups/detailed_statistics?*', name: 'errorGroupsDetailedRequest', }, { diff --git a/x-pack/plugins/apm/public/components/alerting/transaction_duration_anomaly_alert_trigger/select_anomaly_severity.test.tsx b/x-pack/plugins/apm/public/components/alerting/transaction_duration_anomaly_alert_trigger/select_anomaly_severity.test.tsx index 8c8f0aa8b9b24..66056ae3db80b 100644 --- a/x-pack/plugins/apm/public/components/alerting/transaction_duration_anomaly_alert_trigger/select_anomaly_severity.test.tsx +++ b/x-pack/plugins/apm/public/components/alerting/transaction_duration_anomaly_alert_trigger/select_anomaly_severity.test.tsx @@ -7,7 +7,7 @@ import { render } from '@testing-library/react'; import React, { ReactNode } from 'react'; -import { __IntlProvider as IntlProvider } from '@kbn/i18n/react'; +import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; import { ANOMALY_SEVERITY } from '../../../../common/ml_constants'; import { SelectAnomalySeverity } from './select_anomaly_severity'; diff --git a/x-pack/plugins/apm/public/components/alerting/transaction_duration_anomaly_alert_trigger/select_anomaly_severity.tsx b/x-pack/plugins/apm/public/components/alerting/transaction_duration_anomaly_alert_trigger/select_anomaly_severity.tsx index 88b5dc7c039c3..70d4702a326ef 100644 --- a/x-pack/plugins/apm/public/components/alerting/transaction_duration_anomaly_alert_trigger/select_anomaly_severity.tsx +++ b/x-pack/plugins/apm/public/components/alerting/transaction_duration_anomaly_alert_trigger/select_anomaly_severity.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiHealth, EuiSpacer, EuiSuperSelect, EuiText } from '@elastic/eui'; import { getSeverityColor } from '../../../../common/anomaly_detection'; import { diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/ActionMenu/index.tsx b/x-pack/plugins/apm/public/components/app/RumDashboard/ActionMenu/index.tsx index 2a1badd0ae1d8..6e18eb61f355c 100644 --- a/x-pack/plugins/apm/public/components/app/RumDashboard/ActionMenu/index.tsx +++ b/x-pack/plugins/apm/public/components/app/RumDashboard/ActionMenu/index.tsx @@ -26,7 +26,7 @@ const ANALYZE_MESSAGE = i18n.translate( 'xpack.apm.analyzeDataButtonLabel.message', { defaultMessage: - 'EXPERIMENTAL - Explore Data allows you to select and filter result data in any dimension and look for the cause or impact of performance problems.', + 'Explore Data allows you to select and filter result data in any dimension and look for the cause or impact of performance problems.', } ); diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/ImpactfulMetrics/JSErrors.tsx b/x-pack/plugins/apm/public/components/app/RumDashboard/ImpactfulMetrics/JSErrors.tsx index 7f481d1c14dc2..96ec397f5f94f 100644 --- a/x-pack/plugins/apm/public/components/app/RumDashboard/ImpactfulMetrics/JSErrors.tsx +++ b/x-pack/plugins/apm/public/components/app/RumDashboard/ImpactfulMetrics/JSErrors.tsx @@ -17,7 +17,7 @@ import { } from '@elastic/eui'; import numeral from '@elastic/numeral'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params'; import { FETCH_STATUS, useFetcher } from '../../../../hooks/use_fetcher'; import { I18LABELS } from '../translations'; diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/PageLoadDistribution/index.tsx b/x-pack/plugins/apm/public/components/app/RumDashboard/PageLoadDistribution/index.tsx index 6798fbe90e4de..0daf620dc5009 100644 --- a/x-pack/plugins/apm/public/components/app/RumDashboard/PageLoadDistribution/index.tsx +++ b/x-pack/plugins/apm/public/components/app/RumDashboard/PageLoadDistribution/index.tsx @@ -13,7 +13,7 @@ import { EuiSpacer, EuiTitle, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params'; import { useFetcher } from '../../../../hooks/use_fetcher'; import { I18LABELS } from '../translations'; diff --git a/x-pack/plugins/apm/public/components/app/RumDashboard/PageViewsTrend/index.tsx b/x-pack/plugins/apm/public/components/app/RumDashboard/PageViewsTrend/index.tsx index 16605a83505ff..a334c1e23892a 100644 --- a/x-pack/plugins/apm/public/components/app/RumDashboard/PageViewsTrend/index.tsx +++ b/x-pack/plugins/apm/public/components/app/RumDashboard/PageViewsTrend/index.tsx @@ -13,7 +13,7 @@ import { EuiSpacer, EuiTitle, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params'; import { useFetcher } from '../../../../hooks/use_fetcher'; import { I18LABELS } from '../translations'; diff --git a/x-pack/plugins/apm/public/components/app/Settings/anomaly_detection/jobs_list.tsx b/x-pack/plugins/apm/public/components/app/Settings/anomaly_detection/jobs_list.tsx index 13d70438ef3b0..2e199d1d726fb 100644 --- a/x-pack/plugins/apm/public/components/app/Settings/anomaly_detection/jobs_list.tsx +++ b/x-pack/plugins/apm/public/components/app/Settings/anomaly_detection/jobs_list.tsx @@ -15,7 +15,7 @@ import { RIGHT_ALIGNMENT, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { getEnvironmentLabel } from '../../../../../common/environment_filter_values'; import { FETCH_STATUS } from '../../../../hooks/use_fetcher'; diff --git a/x-pack/plugins/apm/public/components/app/Settings/schema/migrated/card_footer_content.tsx b/x-pack/plugins/apm/public/components/app/Settings/schema/migrated/card_footer_content.tsx index f5cfab03d94ae..62b4b242b1b68 100644 --- a/x-pack/plugins/apm/public/components/app/Settings/schema/migrated/card_footer_content.tsx +++ b/x-pack/plugins/apm/public/components/app/Settings/schema/migrated/card_footer_content.tsx @@ -7,7 +7,7 @@ import { EuiButton, EuiSpacer, EuiText } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { APMLink } from '../../../../shared/Links/apm/APMLink'; import { useFleetCloudAgentPolicyHref } from '../../../../shared/Links/kibana'; diff --git a/x-pack/plugins/apm/public/components/app/Settings/schema/migrated/upgrade_available_card.tsx b/x-pack/plugins/apm/public/components/app/Settings/schema/migrated/upgrade_available_card.tsx index 8c10236335961..eee8ca66dd08f 100644 --- a/x-pack/plugins/apm/public/components/app/Settings/schema/migrated/upgrade_available_card.tsx +++ b/x-pack/plugins/apm/public/components/app/Settings/schema/migrated/upgrade_available_card.tsx @@ -7,7 +7,7 @@ import { EuiCard, EuiIcon, EuiLink } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { useUpgradeApmPackagePolicyHref } from '../../../../shared/Links/kibana'; import { CardFooterContent } from './card_footer_content'; diff --git a/x-pack/plugins/apm/public/components/app/Settings/schema/schema_overview.tsx b/x-pack/plugins/apm/public/components/app/Settings/schema/schema_overview.tsx index cead6cd8a6fb4..44168542decc9 100644 --- a/x-pack/plugins/apm/public/components/app/Settings/schema/schema_overview.tsx +++ b/x-pack/plugins/apm/public/components/app/Settings/schema/schema_overview.tsx @@ -17,7 +17,7 @@ import { EuiToolTip, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import semverLt from 'semver/functions/lt'; import { SUPPORTED_APM_PACKAGE_VERSION } from '../../../../../common/fleet'; diff --git a/x-pack/plugins/apm/public/components/app/correlations/context_popover/context_popover.tsx b/x-pack/plugins/apm/public/components/app/correlations/context_popover/context_popover.tsx index 7165aa67a5e5a..f1d0d194749c5 100644 --- a/x-pack/plugins/apm/public/components/app/correlations/context_popover/context_popover.tsx +++ b/x-pack/plugins/apm/public/components/app/correlations/context_popover/context_popover.tsx @@ -18,7 +18,7 @@ import { } from '@elastic/eui'; import React, { Fragment, useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { FieldStats } from '../../../../../common/correlations/field_stats_types'; import { OnAddFilter, TopValues } from './top_values'; import { useTheme } from '../../../../hooks/use_theme'; diff --git a/x-pack/plugins/apm/public/components/app/correlations/empty_state_prompt.tsx b/x-pack/plugins/apm/public/components/app/correlations/empty_state_prompt.tsx index 9b161fc1b9fa9..93020ac1eacef 100644 --- a/x-pack/plugins/apm/public/components/app/correlations/empty_state_prompt.tsx +++ b/x-pack/plugins/apm/public/components/app/correlations/empty_state_prompt.tsx @@ -8,7 +8,7 @@ import { EuiEmptyPrompt, EuiSpacer, EuiText } from '@elastic/eui'; import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function CorrelationsEmptyStatePrompt() { return ( diff --git a/x-pack/plugins/apm/public/components/app/correlations/failed_transactions_correlations.tsx b/x-pack/plugins/apm/public/components/app/correlations/failed_transactions_correlations.tsx index f13d360444923..b2efae74c9c74 100644 --- a/x-pack/plugins/apm/public/components/app/correlations/failed_transactions_correlations.tsx +++ b/x-pack/plugins/apm/public/components/app/correlations/failed_transactions_correlations.tsx @@ -27,7 +27,7 @@ import type { EuiTableSortingType } from '@elastic/eui/src/components/basic_tabl import type { Direction } from '@elastic/eui/src/services/sort/sort_direction'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useUiTracker } from '../../../../../observability/public'; diff --git a/x-pack/plugins/apm/public/components/app/correlations/failed_transactions_correlations_help_popover.tsx b/x-pack/plugins/apm/public/components/app/correlations/failed_transactions_correlations_help_popover.tsx index 65f6f54ecf89e..2c529dce323d4 100644 --- a/x-pack/plugins/apm/public/components/app/correlations/failed_transactions_correlations_help_popover.tsx +++ b/x-pack/plugins/apm/public/components/app/correlations/failed_transactions_correlations_help_popover.tsx @@ -8,7 +8,7 @@ import { EuiCode } from '@elastic/eui'; import React, { useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { HelpPopover, HelpPopoverButton } from '../help_popover/help_popover'; export function FailedTransactionsCorrelationsHelpPopover() { diff --git a/x-pack/plugins/apm/public/components/app/correlations/latency_correlations.test.tsx b/x-pack/plugins/apm/public/components/app/correlations/latency_correlations.test.tsx index b6bd267e746b3..0656ab045efc2 100644 --- a/x-pack/plugins/apm/public/components/app/correlations/latency_correlations.test.tsx +++ b/x-pack/plugins/apm/public/components/app/correlations/latency_correlations.test.tsx @@ -10,7 +10,7 @@ import { createMemoryHistory } from 'history'; import React, { ReactNode } from 'react'; import { of } from 'rxjs'; -import { __IntlProvider as IntlProvider } from '@kbn/i18n/react'; +import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; import { CoreStart } from 'kibana/public'; import { merge } from 'lodash'; diff --git a/x-pack/plugins/apm/public/components/app/correlations/latency_correlations.tsx b/x-pack/plugins/apm/public/components/app/correlations/latency_correlations.tsx index b67adc03d40e9..629868fb88bf6 100644 --- a/x-pack/plugins/apm/public/components/app/correlations/latency_correlations.tsx +++ b/x-pack/plugins/apm/public/components/app/correlations/latency_correlations.tsx @@ -23,7 +23,7 @@ import { Direction } from '@elastic/eui/src/services/sort/sort_direction'; import { EuiTableSortingType } from '@elastic/eui/src/components/basic_table/table_types'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useUiTracker } from '../../../../../observability/public'; diff --git a/x-pack/plugins/apm/public/components/app/correlations/latency_correlations_help_popover.tsx b/x-pack/plugins/apm/public/components/app/correlations/latency_correlations_help_popover.tsx index 97bd13ebe37b5..b3612a89f2d37 100644 --- a/x-pack/plugins/apm/public/components/app/correlations/latency_correlations_help_popover.tsx +++ b/x-pack/plugins/apm/public/components/app/correlations/latency_correlations_help_popover.tsx @@ -7,7 +7,7 @@ import React, { useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { HelpPopover, HelpPopoverButton } from '../help_popover/help_popover'; export function LatencyCorrelationsHelpPopover() { diff --git a/x-pack/plugins/apm/public/components/app/correlations/progress_controls.tsx b/x-pack/plugins/apm/public/components/app/correlations/progress_controls.tsx index a581313d6a5d5..101713c34597c 100644 --- a/x-pack/plugins/apm/public/components/app/correlations/progress_controls.tsx +++ b/x-pack/plugins/apm/public/components/app/correlations/progress_controls.tsx @@ -13,7 +13,7 @@ import { EuiText, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; export function CorrelationsProgressControls({ diff --git a/x-pack/plugins/apm/public/components/app/error_group_overview/error_group_list/error_group_list.stories.tsx b/x-pack/plugins/apm/public/components/app/error_group_overview/error_group_list/error_group_list.stories.tsx index e61e43c8bb7ea..3d6a9af707955 100644 --- a/x-pack/plugins/apm/public/components/app/error_group_overview/error_group_list/error_group_list.stories.tsx +++ b/x-pack/plugins/apm/public/components/app/error_group_overview/error_group_list/error_group_list.stories.tsx @@ -38,52 +38,49 @@ export const Example: Story = (args) => { return ; }; Example.args = { - items: [ + mainStatistics: [ { - message: 'net/http: abort Handler', - occurrenceCount: 14, + name: 'net/http: abort Handler', + occurrences: 14, culprit: 'Main.func2', groupId: '83a653297ec29afed264d7b60d5cda7b', - latestOccurrenceAt: '2021-10-21T16:18:41.434Z', + lastSeen: 1634833121434, handled: false, type: 'errorString', }, { - message: 'POST /api/orders (500)', - occurrenceCount: 5, + name: 'POST /api/orders (500)', + occurrences: 5, culprit: 'logrusMiddleware', groupId: '7a640436a9be648fd708703d1ac84650', - latestOccurrenceAt: '2021-10-21T16:18:40.162Z', + lastSeen: 1634833121434, handled: false, type: 'OpError', }, { - message: - 'write tcp 10.36.2.24:3000->10.36.1.14:34232: write: connection reset by peer', - occurrenceCount: 4, + name: 'write tcp 10.36.2.24:3000->10.36.1.14:34232: write: connection reset by peer', + occurrences: 4, culprit: 'apiHandlers.getProductCustomers', groupId: '95ca0e312c109aa11e298bcf07f1445b', - latestOccurrenceAt: '2021-10-21T16:18:42.650Z', + lastSeen: 1634833121434, handled: false, type: 'OpError', }, { - message: - 'write tcp 10.36.0.21:3000->10.36.1.252:57070: write: connection reset by peer', - occurrenceCount: 3, + name: 'write tcp 10.36.0.21:3000->10.36.1.252:57070: write: connection reset by peer', + occurrences: 3, culprit: 'apiHandlers.getCustomers', groupId: '4053d7e33d2b716c819bd96d9d6121a2', - latestOccurrenceAt: '2021-10-21T16:07:44.078Z', + lastSeen: 1634833121434, handled: false, type: 'OpError', }, { - message: - 'write tcp 10.36.0.21:3000->10.36.0.88:33926: write: broken pipe', - occurrenceCount: 2, + name: 'write tcp 10.36.0.21:3000->10.36.0.88:33926: write: broken pipe', + occurrences: 2, culprit: 'apiHandlers.getOrders', groupId: '94f4ca8ec8c02e5318cf03f46ae4c1f3', - latestOccurrenceAt: '2021-10-21T16:13:45.742Z', + lastSeen: 1634833121434, handled: false, type: 'OpError', }, @@ -95,6 +92,6 @@ export const EmptyState: Story = (args) => { return ; }; EmptyState.args = { - items: [], + mainStatistics: [], serviceName: 'test service', }; diff --git a/x-pack/plugins/apm/public/components/app/error_group_overview/error_group_list/index.tsx b/x-pack/plugins/apm/public/components/app/error_group_overview/error_group_list/index.tsx index 7facc9a4ca376..e252eba15ade1 100644 --- a/x-pack/plugins/apm/public/components/app/error_group_overview/error_group_list/index.tsx +++ b/x-pack/plugins/apm/public/components/app/error_group_overview/error_group_list/index.tsx @@ -11,9 +11,9 @@ import { EuiToolTip, RIGHT_ALIGNMENT, } from '@elastic/eui'; -import numeral from '@elastic/numeral'; import { i18n } from '@kbn/i18n'; import React, { useMemo } from 'react'; +import { asInteger } from '../../../../../common/utils/formatters'; import { euiStyled } from '../../../../../../../../src/plugins/kibana_react/common'; import { NOT_AVAILABLE_LABEL } from '../../../../../common/i18n'; import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params'; @@ -24,6 +24,7 @@ import { ErrorOverviewLink } from '../../../shared/Links/apm/ErrorOverviewLink'; import { APMQueryParams } from '../../../shared/Links/url_helpers'; import { ITableColumn, ManagedTable } from '../../../shared/managed_table'; import { TimestampTooltip } from '../../../shared/TimestampTooltip'; +import { SparkPlot } from '../../../shared/charts/spark_plot'; const GroupIdLink = euiStyled(ErrorDetailLink)` font-family: ${({ theme }) => theme.eui.euiCodeFontFamily}; @@ -48,14 +49,23 @@ const Culprit = euiStyled.div` `; type ErrorGroupItem = - APIReturnType<'GET /internal/apm/services/{serviceName}/errors'>['errorGroups'][0]; + APIReturnType<'GET /internal/apm/services/{serviceName}/errors/groups/main_statistics'>['errorGroups'][0]; +type ErrorGroupDetailedStatistics = + APIReturnType<'GET /internal/apm/services/{serviceName}/errors/groups/detailed_statistics'>; interface Props { - items: ErrorGroupItem[]; + mainStatistics: ErrorGroupItem[]; serviceName: string; + detailedStatistics: ErrorGroupDetailedStatistics; + comparisonEnabled?: boolean; } -function ErrorGroupList({ items, serviceName }: Props) { +function ErrorGroupList({ + mainStatistics, + serviceName, + detailedStatistics, + comparisonEnabled, +}: Props) { const { urlParams } = useLegacyUrlParams(); const columns = useMemo(() => { @@ -132,13 +142,13 @@ function ErrorGroupList({ items, serviceName }: Props) { - {item.message || NOT_AVAILABLE_LABEL} + {item.name || NOT_AVAILABLE_LABEL}
@@ -167,46 +177,64 @@ function ErrorGroupList({ items, serviceName }: Props) { ), }, { + field: 'lastSeen', + sortable: true, + name: i18n.translate('xpack.apm.errorsTable.lastSeenColumnLabel', { + defaultMessage: 'Last seen', + }), + align: RIGHT_ALIGNMENT, + render: (_, { lastSeen }) => + lastSeen ? ( + + ) : ( + NOT_AVAILABLE_LABEL + ), + }, + { + field: 'occurrences', name: i18n.translate('xpack.apm.errorsTable.occurrencesColumnLabel', { defaultMessage: 'Occurrences', }), - field: 'occurrenceCount', sortable: true, dataType: 'number', - render: (_, { occurrenceCount }) => - occurrenceCount - ? numeral(occurrenceCount).format('0.[0]a') - : NOT_AVAILABLE_LABEL, - }, - { - field: 'latestOccurrenceAt', - sortable: true, - name: i18n.translate( - 'xpack.apm.errorsTable.latestOccurrenceColumnLabel', - { - defaultMessage: 'Latest occurrence', - } - ), align: RIGHT_ALIGNMENT, - render: (_, { latestOccurrenceAt }) => - latestOccurrenceAt ? ( - - ) : ( - NOT_AVAILABLE_LABEL - ), + render: (_, { occurrences, groupId }) => { + const currentPeriodTimeseries = + detailedStatistics?.currentPeriod?.[groupId]?.timeseries; + const previousPeriodTimeseries = + detailedStatistics?.previousPeriod?.[groupId]?.timeseries; + return ( + + ); + }, }, ] as Array>; - }, [serviceName, urlParams]); + }, [serviceName, urlParams, detailedStatistics, comparisonEnabled]); return ( diff --git a/x-pack/plugins/apm/public/components/app/error_group_overview/index.tsx b/x-pack/plugins/apm/public/components/app/error_group_overview/index.tsx index 9e113b37a1394..c836f5f7acd61 100644 --- a/x-pack/plugins/apm/public/components/app/error_group_overview/index.tsx +++ b/x-pack/plugins/apm/public/components/app/error_group_overview/index.tsx @@ -14,24 +14,60 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; +import uuid from 'uuid'; import { useApmServiceContext } from '../../../context/apm_service/use_apm_service_context'; import { ChartPointerEventContextProvider } from '../../../context/chart_pointer_event/chart_pointer_event_context'; import { useApmParams } from '../../../hooks/use_apm_params'; import { useErrorGroupDistributionFetcher } from '../../../hooks/use_error_group_distribution_fetcher'; import { useFetcher } from '../../../hooks/use_fetcher'; import { useTimeRange } from '../../../hooks/use_time_range'; +import { APIReturnType } from '../../../services/rest/createCallApmApi'; import { FailedTransactionRateChart } from '../../shared/charts/failed_transaction_rate_chart'; +import { getTimeRangeComparison } from '../../shared/time_comparison/get_time_range_comparison'; import { ErrorDistribution } from '../error_group_details/Distribution'; import { ErrorGroupList } from './error_group_list'; +type ErrorGroupMainStatistics = + APIReturnType<'GET /internal/apm/services/{serviceName}/errors/groups/main_statistics'>; +type ErrorGroupDetailedStatistics = + APIReturnType<'GET /internal/apm/services/{serviceName}/errors/groups/detailed_statistics'>; + +const INITIAL_STATE_MAIN_STATISTICS: { + errorGroupMainStatistics: ErrorGroupMainStatistics['errorGroups']; + requestId?: string; +} = { + errorGroupMainStatistics: [], + requestId: undefined, +}; + +const INITIAL_STATE_DETAILED_STATISTICS: ErrorGroupDetailedStatistics = { + currentPeriod: {}, + previousPeriod: {}, +}; + export function ErrorGroupOverview() { - const { serviceName } = useApmServiceContext(); + const { serviceName, transactionType } = useApmServiceContext(); const { - query: { environment, kuery, sortField, sortDirection, rangeFrom, rangeTo }, + query: { + environment, + kuery, + sortField, + sortDirection, + rangeFrom, + rangeTo, + comparisonType, + comparisonEnabled, + }, } = useApmParams('/services/{serviceName}/errors'); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); + const { comparisonStart, comparisonEnd } = getTimeRangeComparison({ + start, + end, + comparisonType, + comparisonEnabled, + }); const { errorDistributionData, status } = useErrorGroupDistributionFetcher({ serviceName, @@ -40,30 +76,90 @@ export function ErrorGroupOverview() { kuery, }); - const { data: errorGroupListData } = useFetcher( - (callApmApi) => { - const normalizedSortDirection = sortDirection === 'asc' ? 'asc' : 'desc'; + const { data: errorGroupListData = INITIAL_STATE_MAIN_STATISTICS } = + useFetcher( + (callApmApi) => { + const normalizedSortDirection = + sortDirection === 'asc' ? 'asc' : 'desc'; - if (start && end) { + if (start && end && transactionType) { + return callApmApi({ + endpoint: + 'GET /internal/apm/services/{serviceName}/errors/groups/main_statistics', + params: { + path: { + serviceName, + }, + query: { + environment, + transactionType, + kuery, + start, + end, + sortField, + sortDirection: normalizedSortDirection, + }, + }, + }).then((response) => { + return { + // Everytime the main statistics is refetched, updates the requestId making the comparison API to be refetched. + requestId: uuid(), + errorGroupMainStatistics: response.errorGroups, + }; + }); + } + }, + [ + environment, + kuery, + serviceName, + transactionType, + start, + end, + sortField, + sortDirection, + ] + ); + + const { requestId, errorGroupMainStatistics } = errorGroupListData; + + const { + data: errorGroupDetailedStatistics = INITIAL_STATE_DETAILED_STATISTICS, + } = useFetcher( + (callApmApi) => { + if ( + requestId && + errorGroupMainStatistics.length && + start && + end && + transactionType + ) { return callApmApi({ - endpoint: 'GET /internal/apm/services/{serviceName}/errors', + endpoint: + 'GET /internal/apm/services/{serviceName}/errors/groups/detailed_statistics', params: { - path: { - serviceName, - }, + path: { serviceName }, query: { environment, kuery, start, end, - sortField, - sortDirection: normalizedSortDirection, + numBuckets: 20, + transactionType, + groupIds: JSON.stringify( + errorGroupMainStatistics.map(({ groupId }) => groupId).sort() + ), + comparisonStart, + comparisonEnd, }, }, }); } }, - [environment, kuery, serviceName, start, end, sortField, sortDirection] + // only fetches agg results when requestId changes + // eslint-disable-next-line react-hooks/exhaustive-deps + [requestId], + { preservePreviousData: false } ); if (!errorDistributionData || !errorGroupListData) { @@ -110,8 +206,10 @@ export function ErrorGroupOverview() { diff --git a/x-pack/plugins/apm/public/components/app/service_node_metrics/index.tsx b/x-pack/plugins/apm/public/components/app/service_node_metrics/index.tsx index 19527cd084989..f8041b2e4a8e8 100644 --- a/x-pack/plugins/apm/public/components/app/service_node_metrics/index.tsx +++ b/x-pack/plugins/apm/public/components/app/service_node_metrics/index.tsx @@ -17,7 +17,7 @@ import { EuiToolTip, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { euiStyled } from '../../../../../../../src/plugins/kibana_react/common'; import { diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_errors_table/get_columns.tsx b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_errors_table/get_columns.tsx index 14a8b59cd7826..aba1073bfe9c2 100644 --- a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_errors_table/get_columns.tsx +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_errors_table/get_columns.tsx @@ -16,9 +16,9 @@ import { TimestampTooltip } from '../../../shared/TimestampTooltip'; import { TruncateWithTooltip } from '../../../shared/truncate_with_tooltip'; type ErrorGroupMainStatistics = - APIReturnType<'GET /internal/apm/services/{serviceName}/error_groups/main_statistics'>; + APIReturnType<'GET /internal/apm/services/{serviceName}/errors/groups/main_statistics'>; type ErrorGroupDetailedStatistics = - APIReturnType<'GET /internal/apm/services/{serviceName}/error_groups/detailed_statistics'>; + APIReturnType<'GET /internal/apm/services/{serviceName}/errors/groups/detailed_statistics'>; export function getColumns({ serviceName, @@ -28,14 +28,14 @@ export function getColumns({ serviceName: string; errorGroupDetailedStatistics: ErrorGroupDetailedStatistics; comparisonEnabled?: boolean; -}): Array> { +}): Array> { return [ { field: 'name', name: i18n.translate('xpack.apm.serviceOverview.errorsTableColumnName', { defaultMessage: 'Name', }), - render: (_, { name, group_id: errorGroupId }) => { + render: (_, { name, groupId: errorGroupId }) => { return ( { + render: (_, { occurrences, groupId: errorGroupId }) => { const currentPeriodTimeseries = errorGroupDetailedStatistics?.currentPeriod?.[errorGroupId] ?.timeseries; @@ -92,9 +92,9 @@ export function getColumns({ valueLabel={i18n.translate( 'xpack.apm.serviceOveriew.errorsTableOccurrences', { - defaultMessage: `{occurrencesCount} occ.`, + defaultMessage: `{occurrences} occ.`, values: { - occurrencesCount: asInteger(occurrences), + occurrences: asInteger(occurrences), }, } )} diff --git a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_errors_table/index.tsx b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_errors_table/index.tsx index ce4ba85b233e2..28824b3b8a399 100644 --- a/x-pack/plugins/apm/public/components/app/service_overview/service_overview_errors_table/index.tsx +++ b/x-pack/plugins/apm/public/components/app/service_overview/service_overview_errors_table/index.tsx @@ -30,9 +30,9 @@ interface Props { serviceName: string; } type ErrorGroupMainStatistics = - APIReturnType<'GET /internal/apm/services/{serviceName}/error_groups/main_statistics'>; + APIReturnType<'GET /internal/apm/services/{serviceName}/errors/groups/main_statistics'>; type ErrorGroupDetailedStatistics = - APIReturnType<'GET /internal/apm/services/{serviceName}/error_groups/detailed_statistics'>; + APIReturnType<'GET /internal/apm/services/{serviceName}/errors/groups/detailed_statistics'>; type SortDirection = 'asc' | 'desc'; type SortField = 'name' | 'lastSeen' | 'occurrences'; @@ -44,7 +44,7 @@ const DEFAULT_SORT = { }; const INITIAL_STATE_MAIN_STATISTICS: { - items: ErrorGroupMainStatistics['error_groups']; + items: ErrorGroupMainStatistics['errorGroups']; totalItems: number; requestId?: string; } = { @@ -97,7 +97,7 @@ export function ServiceOverviewErrorsTable({ serviceName }: Props) { } return callApmApi({ endpoint: - 'GET /internal/apm/services/{serviceName}/error_groups/main_statistics', + 'GET /internal/apm/services/{serviceName}/errors/groups/main_statistics', params: { path: { serviceName }, query: { @@ -110,7 +110,7 @@ export function ServiceOverviewErrorsTable({ serviceName }: Props) { }, }).then((response) => { const currentPageErrorGroups = orderBy( - response.error_groups, + response.errorGroups, field, direction ).slice(pageIndex * PAGE_SIZE, (pageIndex + 1) * PAGE_SIZE); @@ -119,7 +119,7 @@ export function ServiceOverviewErrorsTable({ serviceName }: Props) { // Everytime the main statistics is refetched, updates the requestId making the comparison API to be refetched. requestId: uuid(), items: currentPageErrorGroups, - totalItems: response.error_groups.length, + totalItems: response.errorGroups.length, }; }); }, @@ -150,7 +150,7 @@ export function ServiceOverviewErrorsTable({ serviceName }: Props) { if (requestId && items.length && start && end && transactionType) { return callApmApi({ endpoint: - 'GET /internal/apm/services/{serviceName}/error_groups/detailed_statistics', + 'GET /internal/apm/services/{serviceName}/errors/groups/detailed_statistics', params: { path: { serviceName }, query: { @@ -161,7 +161,7 @@ export function ServiceOverviewErrorsTable({ serviceName }: Props) { numBuckets: 20, transactionType, groupIds: JSON.stringify( - items.map(({ group_id: groupId }) => groupId).sort() + items.map(({ groupId: groupId }) => groupId).sort() ), comparisonStart, comparisonEnd, diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/distribution/index.test.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/distribution/index.test.tsx index acee2a964d1eb..8430e620f59ab 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/distribution/index.test.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/distribution/index.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { __IntlProvider as IntlProvider } from '@kbn/i18n/react'; +import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; import { render, screen, waitFor } from '@testing-library/react'; import { createMemoryHistory } from 'history'; import React, { ReactNode } from 'react'; diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/distribution/index.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/distribution/index.tsx index ee2f8fb50a0e5..e6c189ed0c74e 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/distribution/index.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/distribution/index.tsx @@ -18,7 +18,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useUiTracker } from '../../../../../../observability/public'; @@ -36,6 +36,7 @@ import { useWaterfallFetcher } from '../use_waterfall_fetcher'; import { WaterfallWithSummary } from '../waterfall_with_summary'; import { useTransactionDistributionChartData } from './use_transaction_distribution_chart_data'; +import { HeightRetainer } from '../../../shared/HeightRetainer'; // Enforce min height so it's consistent across all tabs on the same level // to prevent "flickering" behavior @@ -105,115 +106,120 @@ export function TransactionDistribution({ useTransactionDistributionChartData(); return ( -
- - - -
- {i18n.translate( - 'xpack.apm.transactionDetails.distribution.panelTitle', - { - defaultMessage: 'Latency distribution', - } - )} -
-
-
- {hasData && !selection && ( - - - - - - - {emptySelectionText} - - - - )} - {hasData && selection && ( - - - {i18n.translate( - 'xpack.apm.transactionDetails.distribution.selectionText', - { - defaultMessage: `Selection: {formattedSelection}`, - values: { - formattedSelection: getFormattedSelection(selection), - }, - } - )} - + +
+ + + +
+ {i18n.translate( + 'xpack.apm.transactionDetails.distribution.panelTitle', + { + defaultMessage: 'Latency distribution', + } + )} +
+
- )} -
- - - - - - ), - failedTransactions: ( - + + + + + + {emptySelectionText} + + + + )} + {hasData && selection && ( + + - - - ), - }} + {i18n.translate( + 'xpack.apm.transactionDetails.distribution.selectionText', + { + defaultMessage: `Selection: {formattedSelection}`, + values: { + formattedSelection: getFormattedSelection(selection), + }, + } + )} + + + )} + + + + + + + ), + failedTransactions: ( + + + + ), + }} + /> + + + + + + + + - - - - - - - - - -
+
+ ); } diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/transaction_details_tabs.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/transaction_details_tabs.tsx index f379369e86643..9f7d2977dfa84 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/transaction_details_tabs.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/transaction_details_tabs.tsx @@ -18,7 +18,6 @@ import { useApmParams } from '../../../hooks/use_apm_params'; import { useTransactionTraceSamplesFetcher } from '../../../hooks/use_transaction_trace_samples_fetcher'; import { maybe } from '../../../../common/utils/maybe'; -import { HeightRetainer } from '../../shared/HeightRetainer'; import { fromQuery, push, toQuery } from '../../shared/Links/url_helpers'; import { failedTransactionsCorrelationsTab } from './failed_transactions_correlations_tab'; @@ -131,20 +130,18 @@ export function TransactionDetailsTabs() { ))} - - - - - + + + ); } diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/MaybeViewTraceLink.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/MaybeViewTraceLink.tsx index c18bc42a98b2c..b146afae53907 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/MaybeViewTraceLink.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/MaybeViewTraceLink.tsx @@ -25,7 +25,7 @@ export function MaybeViewTraceLink({ environment: Environment; }) { const { - urlParams: { latencyAggregationType }, + urlParams: { latencyAggregationType, comparisonEnabled, comparisonType }, } = useLegacyUrlParams(); const viewFullTraceButtonLabel = i18n.translate( @@ -94,6 +94,8 @@ export function MaybeViewTraceLink({ transactionType={rootTransaction.transaction.type} environment={nextEnvironment} latencyAggregationType={latencyAggregationType} + comparisonEnabled={comparisonEnabled} + comparisonType={comparisonType} > {viewFullTraceButtonLabel} diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/FlyoutTopLevelProperties.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/FlyoutTopLevelProperties.tsx index e34fdd893ff7f..c81dfb6283c94 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/FlyoutTopLevelProperties.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/FlyoutTopLevelProperties.tsx @@ -25,7 +25,7 @@ interface Props { export function FlyoutTopLevelProperties({ transaction }: Props) { const { - urlParams: { latencyAggregationType }, + urlParams: { latencyAggregationType, comparisonEnabled, comparisonType }, } = useLegacyUrlParams(); const { query } = useApmParams('/services/{serviceName}/transactions/view'); @@ -67,6 +67,8 @@ export function FlyoutTopLevelProperties({ transaction }: Props) { transactionType={transaction.transaction.type} environment={nextEnvironment} latencyAggregationType={latencyAggregationType} + comparisonEnabled={comparisonEnabled} + comparisonType={comparisonType} > {transaction.transaction.name} diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/index.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/index.tsx index 5b4bf99f7dae6..50ec934961e1a 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/index.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/index.tsx @@ -12,7 +12,6 @@ import React, { useState } from 'react'; import { useHistory } from 'react-router-dom'; import { euiStyled } from '../../../../../../../../../../src/plugins/kibana_react/common'; import { Timeline } from '../../../../../shared/charts/Timeline'; -import { HeightRetainer } from '../../../../../shared/HeightRetainer'; import { fromQuery, toQuery } from '../../../../../shared/Links/url_helpers'; import { getAgentMarks } from '../Marks/get_agent_marks'; import { getErrorMarks } from '../Marks/get_error_marks'; @@ -76,62 +75,60 @@ export function Waterfall({ waterfall, waterfallItemId }: Props) { }; return ( - - - {waterfall.apiResponse.exceedsMax && ( - + {waterfall.apiResponse.exceedsMax && ( + + )} +
+
+ { + setIsAccordionOpen((isOpen) => !isOpen); + }} + /> + - )} -
-
- { - setIsAccordionOpen((isOpen) => !isOpen); - }} - /> - -
- - {!waterfall.entryWaterfallTransaction ? null : ( - - toggleFlyout({ history, item }) - } - /> - )} -
+ + {!waterfall.entryWaterfallTransaction ? null : ( + + toggleFlyout({ history, item }) + } + /> + )} + +
- - - + + ); } diff --git a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/span_flyout/sticky_span_properties.tsx b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/span_flyout/sticky_span_properties.tsx index cd8f8192beb40..9e7a32a6808ec 100644 --- a/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/span_flyout/sticky_span_properties.tsx +++ b/x-pack/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/Waterfall/span_flyout/sticky_span_properties.tsx @@ -34,7 +34,12 @@ interface Props { export function StickySpanProperties({ span, transaction }: Props) { const { query } = useApmParams('/services/{serviceName}/transactions/view'); - const { environment, latencyAggregationType } = query; + const { + environment, + latencyAggregationType, + comparisonEnabled, + comparisonType, + } = query; const trackEvent = useUiTracker(); @@ -82,6 +87,8 @@ export function StickySpanProperties({ span, transaction }: Props) { transactionType={transaction.transaction.type} environment={nextEnvironment} latencyAggregationType={latencyAggregationType} + comparisonEnabled={comparisonEnabled} + comparisonType={comparisonType} > {transaction.transaction.name} diff --git a/x-pack/plugins/apm/public/components/routing/templates/apm_service_template/analyze_data_button.tsx b/x-pack/plugins/apm/public/components/routing/templates/apm_service_template/analyze_data_button.tsx index 5fa37050e71a6..ec54fa1f228ce 100644 --- a/x-pack/plugins/apm/public/components/routing/templates/apm_service_template/analyze_data_button.tsx +++ b/x-pack/plugins/apm/public/components/routing/templates/apm_service_template/analyze_data_button.tsx @@ -79,7 +79,7 @@ export function AnalyzeDataButton() { position="top" content={i18n.translate('xpack.apm.analyzeDataButton.tooltip', { defaultMessage: - 'EXPERIMENTAL - Explore Data allows you to select and filter result data in any dimension, and look for the cause or impact of performance problems', + 'Explore Data allows you to select and filter result data in any dimension, and look for the cause or impact of performance problems', })} > diff --git a/x-pack/plugins/apm/public/components/shared/Links/apm/transaction_detail_link.tsx b/x-pack/plugins/apm/public/components/shared/Links/apm/transaction_detail_link.tsx index 3de16cf4db029..9df035515b040 100644 --- a/x-pack/plugins/apm/public/components/shared/Links/apm/transaction_detail_link.tsx +++ b/x-pack/plugins/apm/public/components/shared/Links/apm/transaction_detail_link.tsx @@ -14,7 +14,11 @@ import { useLegacyUrlParams } from '../../../../context/url_params_context/use_u import { pickKeys } from '../../../../../common/utils/pick_keys'; import { APMQueryParams } from '../url_helpers'; import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context'; -import { TimeRangeComparisonType } from '../../../../../common/runtime_types/comparison_type_rt'; +import { + TimeRangeComparisonEnum, + TimeRangeComparisonType, +} from '../../../../../common/runtime_types/comparison_type_rt'; +import { getComparisonEnabled } from '../../time_comparison/get_comparison_enabled'; interface Props extends APMLinkExtendProps { serviceName: string; @@ -42,11 +46,15 @@ export function TransactionDetailLink({ latencyAggregationType, environment, comparisonEnabled, - comparisonType, + comparisonType = TimeRangeComparisonEnum.DayBefore, ...rest }: Props) { const { urlParams } = useLegacyUrlParams(); const { core } = useApmPluginContext(); + const defaultComparisonEnabled = getComparisonEnabled({ + core, + urlComparisonEnabled: comparisonEnabled, + }); const location = useLocation(); const href = getLegacyApmHref({ basePath: core.http.basePath, @@ -56,7 +64,7 @@ export function TransactionDetailLink({ transactionId, transactionName, transactionType, - comparisonEnabled, + comparisonEnabled: defaultComparisonEnabled, comparisonType, ...pickKeys(urlParams as APMQueryParams, ...persistedFilters), ...pickBy({ latencyAggregationType, environment }, identity), diff --git a/x-pack/plugins/apm/public/components/shared/charts/transaction_distribution_chart/index.tsx b/x-pack/plugins/apm/public/components/shared/charts/transaction_distribution_chart/index.tsx index 80fbd864fd815..d5cd423b2b123 100644 --- a/x-pack/plugins/apm/public/components/shared/charts/transaction_distribution_chart/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/charts/transaction_distribution_chart/index.tsx @@ -267,6 +267,14 @@ export function TransactionDistributionChart({ yAccessors={['doc_count']} color={areaSeriesColors[i]} fit="lookahead" + // To make the area appear without the orphaned points technique, + // we changed the original data to replace values of 0 with 0.0001. + // To show the correct values again in tooltips, we use a custom tickFormat to round values. + // We can safely do this because all transaction values above 0 are without decimal points anyway. + // An update for Elastic Charts is in the works to be able to customize the above "fit" + // attribute. Once that is available we can get rid of the full workaround. + // Elastic Charts issue: https://github.com/elastic/elastic-charts/issues/1489 + tickFormat={(p) => `${Math.round(p)}`} /> ))} diff --git a/x-pack/plugins/apm/public/components/shared/transactions_table/index.tsx b/x-pack/plugins/apm/public/components/shared/transactions_table/index.tsx index 2d9f6584535fa..d2abd9dc4c15a 100644 --- a/x-pack/plugins/apm/public/components/shared/transactions_table/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/transactions_table/index.tsx @@ -16,7 +16,7 @@ import { orderBy } from 'lodash'; import React, { useState } from 'react'; import uuid from 'uuid'; import { EuiCallOut } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCode } from '@elastic/eui'; import { APIReturnType } from '../../../services/rest/createCallApmApi'; import { useApmServiceContext } from '../../../context/apm_service/use_apm_service_context'; diff --git a/x-pack/plugins/apm/public/tutorial/tutorial_fleet_instructions/index.tsx b/x-pack/plugins/apm/public/tutorial/tutorial_fleet_instructions/index.tsx index a922a10d6d6fc..69f3c4bbbc407 100644 --- a/x-pack/plugins/apm/public/tutorial/tutorial_fleet_instructions/index.tsx +++ b/x-pack/plugins/apm/public/tutorial/tutorial_fleet_instructions/index.tsx @@ -34,7 +34,7 @@ const CentralizedContainer = styled.div` align-items: center; `; -type APIResponseType = APIReturnType<'GET /internal/apm/fleet/has_data'>; +type APIResponseType = APIReturnType<'GET /internal/apm/fleet/migration_check'>; function TutorialFleetInstructions({ http, basePath, isDarkTheme }: Props) { const [data, setData] = useState(); @@ -44,7 +44,7 @@ function TutorialFleetInstructions({ http, basePath, isDarkTheme }: Props) { async function fetchData() { setIsLoading(true); try { - const response = await http.get('/internal/apm/fleet/has_data'); + const response = await http.get('/internal/apm/fleet/migration_check'); setData(response as APIResponseType); } catch (e) { setIsLoading(false); @@ -55,6 +55,22 @@ function TutorialFleetInstructions({ http, basePath, isDarkTheme }: Props) { fetchData(); }, [http]); + const hasApmIntegrations = !!data?.has_apm_integrations; + const cloudApmMigrationEnabled = !!data?.cloud_apm_migration_enabled; + const hasCloudAgentPolicy = !!data?.has_cloud_agent_policy; + const cloudApmPackagePolicy = data?.cloud_apm_package_policy; + const hasCloudApmPackagePolicy = !!cloudApmPackagePolicy; + const hasRequiredRole = !!data?.has_required_role; + const shouldLinkToMigration = + cloudApmMigrationEnabled && + hasCloudAgentPolicy && + !hasCloudApmPackagePolicy && + hasRequiredRole; + + const apmIntegrationHref = shouldLinkToMigration + ? `${basePath}/app/apm/settings/schema` + : `${basePath}/app/integrations/detail/apm-${SUPPORTED_APM_PACKAGE_VERSION}/overview`; + if (isLoading) { return ( @@ -64,9 +80,13 @@ function TutorialFleetInstructions({ http, basePath, isDarkTheme }: Props) { } // When APM integration is enable in Fleet - if (data?.hasData) { + if (hasApmIntegrations) { return ( - + {i18n.translate( 'xpack.apm.tutorial.apmServer.fleet.manageApmIntegration.button', { @@ -99,7 +119,7 @@ function TutorialFleetInstructions({ http, basePath, isDarkTheme }: Props) { {i18n.translate( 'xpack.apm.tutorial.apmServer.fleet.apmIntegration.button', diff --git a/x-pack/plugins/apm/server/deprecations/deprecations.test.ts b/x-pack/plugins/apm/server/deprecations/deprecations.test.ts index 8ab632deec809..11deff82de572 100644 --- a/x-pack/plugins/apm/server/deprecations/deprecations.test.ts +++ b/x-pack/plugins/apm/server/deprecations/deprecations.test.ts @@ -57,7 +57,13 @@ describe('getDeprecations', () => { cloudSetup: { isCloudEnabled: true } as unknown as CloudSetup, fleet: { start: () => ({ - agentPolicyService: { get: () => ({ id: 'foo' } as AgentPolicy) }, + agentPolicyService: { + get: () => + ({ + id: 'foo', + package_policies: [{ package: { name: 'apm' } }], + } as AgentPolicy), + }, }), } as unknown as APMRouteHandlerResources['plugins']['fleet'], }); diff --git a/x-pack/plugins/apm/server/deprecations/index.ts b/x-pack/plugins/apm/server/deprecations/index.ts index 92955fa0c6d0b..06d04eb037d73 100644 --- a/x-pack/plugins/apm/server/deprecations/index.ts +++ b/x-pack/plugins/apm/server/deprecations/index.ts @@ -9,7 +9,10 @@ import { GetDeprecationsContext, DeprecationsDetails } from 'src/core/server'; import { i18n } from '@kbn/i18n'; import { isEmpty } from 'lodash'; import { CloudSetup } from '../../../cloud/server'; -import { getCloudAgentPolicy } from '../routes/fleet/get_cloud_apm_package_policy'; +import { + getCloudAgentPolicy, + getApmPackagePolicy, +} from '../routes/fleet/get_cloud_apm_package_policy'; import { APMRouteHandlerResources } from '../'; export function getDeprecations({ @@ -36,12 +39,12 @@ export function getDeprecations({ }); const isCloudEnabled = !!cloudSetup?.isCloudEnabled; + const hasAPMPackagePolicy = !isEmpty(getApmPackagePolicy(cloudAgentPolicy)); - const hasCloudAgentPolicy = !isEmpty(cloudAgentPolicy); // TODO: remove when docs support "main" const docBranch = branch === 'main' ? 'master' : branch; - if (isCloudEnabled && !hasCloudAgentPolicy) { + if (isCloudEnabled && !hasAPMPackagePolicy) { deprecations.push({ title: i18n.translate('xpack.apm.deprecations.legacyModeTitle', { defaultMessage: 'APM Server running in legacy mode', diff --git a/x-pack/plugins/apm/server/routes/errors/__snapshots__/queries.test.ts.snap b/x-pack/plugins/apm/server/routes/errors/__snapshots__/queries.test.ts.snap index c0134170606d2..5602798c51ea4 100644 --- a/x-pack/plugins/apm/server/routes/errors/__snapshots__/queries.test.ts.snap +++ b/x-pack/plugins/apm/server/routes/errors/__snapshots__/queries.test.ts.snap @@ -78,11 +78,9 @@ Object { "@timestamp", ], "size": 1, - "sort": Array [ - Object { - "@timestamp": "desc", - }, - ], + "sort": Object { + "@timestamp": "desc", + }, }, }, }, @@ -103,6 +101,11 @@ Object { "service.name": "serviceName", }, }, + Object { + "term": Object { + "transaction.type": "request", + }, + }, Object { "range": Object { "@timestamp": Object { @@ -120,7 +123,7 @@ Object { } `; -exports[`error queries fetches multiple error groups when sortField = latestOccurrenceAt 1`] = ` +exports[`error queries fetches multiple error groups when sortField = lastSeen 1`] = ` Object { "apm": Object { "events": Array [ @@ -148,11 +151,9 @@ Object { "@timestamp", ], "size": 1, - "sort": Array [ - Object { - "@timestamp": "desc", - }, - ], + "sort": Object { + "@timestamp": "desc", + }, }, }, }, @@ -173,6 +174,11 @@ Object { "service.name": "serviceName", }, }, + Object { + "term": Object { + "transaction.type": "request", + }, + }, Object { "range": Object { "@timestamp": Object { diff --git a/x-pack/plugins/apm/server/routes/errors/get_error_groups.ts b/x-pack/plugins/apm/server/routes/errors/get_error_groups.ts deleted file mode 100644 index b26f3f4e7b4fe..0000000000000 --- a/x-pack/plugins/apm/server/routes/errors/get_error_groups.ts +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { AggregationsTermsAggregationOrder } from '@elastic/elasticsearch/lib/api/types'; -import { ProcessorEvent } from '../../../common/processor_event'; -import { environmentQuery } from '../../../common/utils/environment_query'; -import { kqlQuery, rangeQuery } from '../../../../observability/server'; -import { - ERROR_CULPRIT, - ERROR_EXC_HANDLED, - ERROR_EXC_MESSAGE, - ERROR_EXC_TYPE, - ERROR_GROUP_ID, - ERROR_LOG_MESSAGE, - SERVICE_NAME, -} from '../../../common/elasticsearch_fieldnames'; -import { getErrorName } from '../../lib/helpers/get_error_name'; -import { Setup } from '../../lib/helpers/setup_request'; - -export async function getErrorGroups({ - environment, - kuery, - serviceName, - sortField, - sortDirection = 'desc', - setup, - start, - end, -}: { - environment: string; - kuery: string; - serviceName: string; - sortField?: string; - sortDirection?: 'asc' | 'desc'; - setup: Setup; - start: number; - end: number; -}) { - const { apmEventClient } = setup; - - // sort buckets by last occurrence of error - const sortByLatestOccurrence = sortField === 'latestOccurrenceAt'; - - const maxTimestampAggKey = 'max_timestamp'; - const order: AggregationsTermsAggregationOrder = sortByLatestOccurrence - ? { [maxTimestampAggKey]: sortDirection } - : { _count: sortDirection }; - - const params = { - apm: { - events: [ProcessorEvent.error as const], - }, - body: { - size: 0, - query: { - bool: { - filter: [ - { term: { [SERVICE_NAME]: serviceName } }, - ...rangeQuery(start, end), - ...environmentQuery(environment), - ...kqlQuery(kuery), - ], - }, - }, - aggs: { - error_groups: { - terms: { - field: ERROR_GROUP_ID, - size: 500, - order, - }, - aggs: { - sample: { - top_hits: { - _source: [ - ERROR_LOG_MESSAGE, - ERROR_EXC_MESSAGE, - ERROR_EXC_HANDLED, - ERROR_EXC_TYPE, - ERROR_CULPRIT, - ERROR_GROUP_ID, - '@timestamp', - ], - sort: [{ '@timestamp': 'desc' as const }], - size: 1, - }, - }, - ...(sortByLatestOccurrence - ? { [maxTimestampAggKey]: { max: { field: '@timestamp' } } } - : {}), - }, - }, - }, - }, - }; - - const resp = await apmEventClient.search('get_error_groups', params); - - // aggregations can be undefined when no matching indices are found. - // this is an exception rather than the rule so the ES type does not account for this. - const hits = (resp.aggregations?.error_groups.buckets || []).map((bucket) => { - const source = bucket.sample.hits.hits[0]._source; - const message = getErrorName(source); - - return { - message, - occurrenceCount: bucket.doc_count, - culprit: source.error.culprit, - groupId: source.error.grouping_key, - latestOccurrenceAt: source['@timestamp'], - handled: source.error.exception?.[0].handled, - type: source.error.exception?.[0].type, - }; - }); - - return hits; -} diff --git a/x-pack/plugins/apm/server/routes/services/get_service_error_groups/get_service_error_group_detailed_statistics.ts b/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_detailed_statistics.ts similarity index 94% rename from x-pack/plugins/apm/server/routes/services/get_service_error_groups/get_service_error_group_detailed_statistics.ts rename to x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_detailed_statistics.ts index 17c538d0fd7ea..870c307a3f769 100644 --- a/x-pack/plugins/apm/server/routes/services/get_service_error_groups/get_service_error_group_detailed_statistics.ts +++ b/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_detailed_statistics.ts @@ -18,7 +18,7 @@ import { environmentQuery } from '../../../../common/utils/environment_query'; import { getBucketSize } from '../../../lib/helpers/get_bucket_size'; import { Setup } from '../../../lib/helpers/setup_request'; -export async function getServiceErrorGroupDetailedStatistics({ +export async function getErrorGroupDetailedStatistics({ kuery, serviceName, setup, @@ -106,7 +106,7 @@ export async function getServiceErrorGroupDetailedStatistics({ }); } -export async function getServiceErrorGroupPeriods({ +export async function getErrorGroupPeriods({ kuery, serviceName, setup, @@ -141,7 +141,7 @@ export async function getServiceErrorGroupPeriods({ groupIds, }; - const currentPeriodPromise = getServiceErrorGroupDetailedStatistics({ + const currentPeriodPromise = getErrorGroupDetailedStatistics({ ...commonProps, start, end, @@ -149,7 +149,7 @@ export async function getServiceErrorGroupPeriods({ const previousPeriodPromise = comparisonStart && comparisonEnd - ? getServiceErrorGroupDetailedStatistics({ + ? getErrorGroupDetailedStatistics({ ...commonProps, start: comparisonStart, end: comparisonEnd, diff --git a/x-pack/plugins/apm/server/routes/services/get_service_error_groups/get_service_error_group_main_statistics.ts b/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_main_statistics.ts similarity index 60% rename from x-pack/plugins/apm/server/routes/services/get_service_error_groups/get_service_error_group_main_statistics.ts rename to x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_main_statistics.ts index 8d174abb1bed5..e460991029915 100644 --- a/x-pack/plugins/apm/server/routes/services/get_service_error_groups/get_service_error_group_main_statistics.ts +++ b/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_main_statistics.ts @@ -5,9 +5,13 @@ * 2.0. */ +import { AggregationsTermsAggregationOrder } from '@elastic/elasticsearch/lib/api/types'; import { kqlQuery, rangeQuery } from '../../../../../observability/server'; import { + ERROR_CULPRIT, + ERROR_EXC_HANDLED, ERROR_EXC_MESSAGE, + ERROR_EXC_TYPE, ERROR_GROUP_ID, ERROR_LOG_MESSAGE, SERVICE_NAME, @@ -18,27 +22,40 @@ import { environmentQuery } from '../../../../common/utils/environment_query'; import { getErrorName } from '../../../lib/helpers/get_error_name'; import { Setup } from '../../../lib/helpers/setup_request'; -export async function getServiceErrorGroupMainStatistics({ +export async function getErrorGroupMainStatistics({ kuery, serviceName, setup, - transactionType, environment, + transactionType, + sortField, + sortDirection = 'desc', start, end, }: { kuery: string; serviceName: string; setup: Setup; - transactionType: string; environment: string; + transactionType: string; + sortField?: string; + sortDirection?: 'asc' | 'desc'; start: number; end: number; }) { const { apmEventClient } = setup; + // sort buckets by last occurrence of error + const sortByLatestOccurrence = sortField === 'lastSeen'; + + const maxTimestampAggKey = 'max_timestamp'; + + const order: AggregationsTermsAggregationOrder = sortByLatestOccurrence + ? { [maxTimestampAggKey]: sortDirection } + : { _count: sortDirection }; + const response = await apmEventClient.search( - 'get_service_error_group_main_statistics', + 'get_error_group_main_statistics', { apm: { events: [ProcessorEvent.error], @@ -61,20 +78,30 @@ export async function getServiceErrorGroupMainStatistics({ terms: { field: ERROR_GROUP_ID, size: 500, - order: { - _count: 'desc', - }, + order, }, aggs: { sample: { + // change to top_metrics top_hits: { size: 1, - _source: [ERROR_LOG_MESSAGE, ERROR_EXC_MESSAGE, '@timestamp'], + _source: [ + ERROR_LOG_MESSAGE, + ERROR_EXC_MESSAGE, + ERROR_EXC_HANDLED, + ERROR_EXC_TYPE, + ERROR_CULPRIT, + ERROR_GROUP_ID, + '@timestamp', + ], sort: { '@timestamp': 'desc', }, }, }, + ...(sortByLatestOccurrence + ? { [maxTimestampAggKey]: { max: { field: '@timestamp' } } } + : {}), }, }, }, @@ -82,19 +109,17 @@ export async function getServiceErrorGroupMainStatistics({ } ); - const errorGroups = + return ( response.aggregations?.error_groups.buckets.map((bucket) => ({ - group_id: bucket.key as string, + groupId: bucket.key as string, name: getErrorName(bucket.sample.hits.hits[0]._source), lastSeen: new Date( bucket.sample.hits.hits[0]?._source['@timestamp'] ).getTime(), occurrences: bucket.doc_count, - })) ?? []; - - return { - is_aggregation_accurate: - (response.aggregations?.error_groups.sum_other_doc_count ?? 0) === 0, - error_groups: errorGroups, - }; + culprit: bucket.sample.hits.hits[0]?._source.error.culprit, + handled: bucket.sample.hits.hits[0]?._source.error.exception?.[0].handled, + type: bucket.sample.hits.hits[0]?._source.error.exception?.[0].type, + })) ?? [] + ); } diff --git a/x-pack/plugins/apm/server/routes/errors/get_error_group_sample.ts b/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_sample.ts similarity index 79% rename from x-pack/plugins/apm/server/routes/errors/get_error_group_sample.ts rename to x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_sample.ts index 2c5073fb5dc66..d5a6e65417ac2 100644 --- a/x-pack/plugins/apm/server/routes/errors/get_error_group_sample.ts +++ b/x-pack/plugins/apm/server/routes/errors/get_error_groups/get_error_group_sample.ts @@ -5,17 +5,17 @@ * 2.0. */ -import { asMutableArray } from '../../../common/utils/as_mutable_array'; +import { asMutableArray } from '../../../../common/utils/as_mutable_array'; import { ERROR_GROUP_ID, SERVICE_NAME, TRANSACTION_SAMPLED, -} from '../../../common/elasticsearch_fieldnames'; -import { ProcessorEvent } from '../../../common/processor_event'; -import { rangeQuery, kqlQuery } from '../../../../observability/server'; -import { environmentQuery } from '../../../common/utils/environment_query'; -import { Setup } from '../../lib/helpers/setup_request'; -import { getTransaction } from '../transactions/get_transaction'; +} from '../../../../common/elasticsearch_fieldnames'; +import { ProcessorEvent } from '../../../../common/processor_event'; +import { rangeQuery, kqlQuery } from '../../../../../observability/server'; +import { environmentQuery } from '../../../../common/utils/environment_query'; +import { getTransaction } from '../../transactions/get_transaction'; +import { Setup } from '../../../lib/helpers/setup_request'; export async function getErrorGroupSample({ environment, diff --git a/x-pack/plugins/apm/server/routes/errors/queries.test.ts b/x-pack/plugins/apm/server/routes/errors/queries.test.ts index 529ed08b7e860..af4a4aef694fc 100644 --- a/x-pack/plugins/apm/server/routes/errors/queries.test.ts +++ b/x-pack/plugins/apm/server/routes/errors/queries.test.ts @@ -5,13 +5,13 @@ * 2.0. */ -import { getErrorGroupSample } from './get_error_group_sample'; -import { getErrorGroups } from './get_error_groups'; import { SearchParamsMock, inspectSearchParams, } from '../../utils/test_helpers'; import { ENVIRONMENT_ALL } from '../../../common/environment_filter_values'; +import { getErrorGroupMainStatistics } from './get_error_groups/get_error_group_main_statistics'; +import { getErrorGroupSample } from './get_error_groups/get_error_group_sample'; describe('error queries', () => { let mock: SearchParamsMock; @@ -38,10 +38,11 @@ describe('error queries', () => { it('fetches multiple error groups', async () => { mock = await inspectSearchParams((setup) => - getErrorGroups({ + getErrorGroupMainStatistics({ sortDirection: 'asc', sortField: 'foo', serviceName: 'serviceName', + transactionType: 'request', setup, environment: ENVIRONMENT_ALL.value, kuery: '', @@ -53,12 +54,13 @@ describe('error queries', () => { expect(mock.params).toMatchSnapshot(); }); - it('fetches multiple error groups when sortField = latestOccurrenceAt', async () => { + it('fetches multiple error groups when sortField = lastSeen', async () => { mock = await inspectSearchParams((setup) => - getErrorGroups({ + getErrorGroupMainStatistics({ sortDirection: 'asc', - sortField: 'latestOccurrenceAt', + sortField: 'lastSeen', serviceName: 'serviceName', + transactionType: 'request', setup, environment: ENVIRONMENT_ALL.value, kuery: '', diff --git a/x-pack/plugins/apm/server/routes/errors/route.ts b/x-pack/plugins/apm/server/routes/errors/route.ts index 602fed89be93c..f4e5ac172d5b0 100644 --- a/x-pack/plugins/apm/server/routes/errors/route.ts +++ b/x-pack/plugins/apm/server/routes/errors/route.ts @@ -5,11 +5,11 @@ * 2.0. */ +import { toNumberRt } from '@kbn/io-ts-utils/to_number_rt'; +import { jsonRt } from '@kbn/io-ts-utils/json_rt'; import * as t from 'io-ts'; import { createApmServerRoute } from '../apm_routes/create_apm_server_route'; import { getErrorDistribution } from './distribution/get_distribution'; -import { getErrorGroupSample } from './get_error_group_sample'; -import { getErrorGroups } from './get_error_groups'; import { setupRequest } from '../../lib/helpers/setup_request'; import { environmentRt, @@ -18,9 +18,13 @@ import { comparisonRangeRt, } from '../default_api_types'; import { createApmServerRouteRepository } from '../apm_routes/create_apm_server_route_repository'; +import { getErrorGroupMainStatistics } from './get_error_groups/get_error_group_main_statistics'; +import { getErrorGroupPeriods } from './get_error_groups/get_error_group_detailed_statistics'; +import { getErrorGroupSample } from './get_error_groups/get_error_group_sample'; -const errorsRoute = createApmServerRoute({ - endpoint: 'GET /internal/apm/services/{serviceName}/errors', +const errorsMainStatisticsRoute = createApmServerRoute({ + endpoint: + 'GET /internal/apm/services/{serviceName}/errors/groups/main_statistics', params: t.type({ path: t.type({ serviceName: t.string, @@ -33,6 +37,9 @@ const errorsRoute = createApmServerRoute({ environmentRt, kueryRt, rangeRt, + t.type({ + transactionType: t.string, + }), ]), }), options: { tags: ['access:apm'] }, @@ -40,13 +47,21 @@ const errorsRoute = createApmServerRoute({ const { params } = resources; const setup = await setupRequest(resources); const { serviceName } = params.path; - const { environment, kuery, sortField, sortDirection, start, end } = - params.query; + const { + environment, + transactionType, + kuery, + sortField, + sortDirection, + start, + end, + } = params.query; - const errorGroups = await getErrorGroups({ + const errorGroups = await getErrorGroupMainStatistics({ environment, kuery, serviceName, + transactionType, sortField, sortDirection, setup, @@ -58,6 +73,61 @@ const errorsRoute = createApmServerRoute({ }, }); +const errorsDetailedStatisticsRoute = createApmServerRoute({ + endpoint: + 'GET /internal/apm/services/{serviceName}/errors/groups/detailed_statistics', + params: t.type({ + path: t.type({ + serviceName: t.string, + }), + query: t.intersection([ + environmentRt, + kueryRt, + rangeRt, + comparisonRangeRt, + t.type({ + numBuckets: toNumberRt, + transactionType: t.string, + groupIds: jsonRt.pipe(t.array(t.string)), + }), + ]), + }), + options: { tags: ['access:apm'] }, + handler: async (resources) => { + const setup = await setupRequest(resources); + const { params } = resources; + + const { + path: { serviceName }, + query: { + environment, + kuery, + numBuckets, + transactionType, + groupIds, + comparisonStart, + comparisonEnd, + start, + end, + }, + } = params; + + return getErrorGroupPeriods({ + environment, + kuery, + serviceName, + setup, + numBuckets, + transactionType, + groupIds, + comparisonStart, + comparisonEnd, + start, + end, + }); + }, +}); + const errorGroupsRoute = createApmServerRoute({ endpoint: 'GET /internal/apm/services/{serviceName}/errors/{groupId}', params: t.type({ @@ -131,6 +201,7 @@ const errorDistributionRoute = createApmServerRoute({ }); export const errorsRouteRepository = createApmServerRouteRepository() - .add(errorsRoute) + .add(errorsMainStatisticsRoute) + .add(errorsDetailedStatisticsRoute) .add(errorGroupsRoute) .add(errorDistributionRoute); diff --git a/x-pack/plugins/apm/server/routes/fleet/route.ts b/x-pack/plugins/apm/server/routes/fleet/route.ts index e9e7f2254bcfe..b64d1764c8465 100644 --- a/x-pack/plugins/apm/server/routes/fleet/route.ts +++ b/x-pack/plugins/apm/server/routes/fleet/route.ts @@ -128,14 +128,16 @@ const getMigrationCheckRoute = createApmServerRoute({ endpoint: 'GET /internal/apm/fleet/migration_check', options: { tags: ['access:apm'] }, handler: async (resources) => { - const { plugins, context, config, request } = resources; + const { core, plugins, context, config, request } = resources; const cloudApmMigrationEnabled = config.agent.migrations.enabled; if (!plugins.fleet || !plugins.security) { throw Boom.internal(FLEET_SECURITY_REQUIRED_MESSAGE); } const savedObjectsClient = context.core.savedObjects.client; - const fleetPluginStart = await plugins.fleet.start(); - const securityPluginStart = await plugins.security.start(); + const [fleetPluginStart, securityPluginStart] = await Promise.all([ + plugins.fleet.start(), + plugins.security.start(), + ]); const hasRequiredRole = isSuperuser({ securityPluginStart, request }); const cloudAgentPolicy = hasRequiredRole ? await getCloudAgentPolicy({ @@ -144,12 +146,17 @@ const getMigrationCheckRoute = createApmServerRoute({ }) : undefined; const apmPackagePolicy = getApmPackagePolicy(cloudAgentPolicy); + const packagePolicies = await getApmPackgePolicies({ + core, + fleetPluginStart, + }); return { has_cloud_agent_policy: !!cloudAgentPolicy, has_cloud_apm_package_policy: !!apmPackagePolicy, cloud_apm_migration_enabled: cloudApmMigrationEnabled, has_required_role: hasRequiredRole, cloud_apm_package_policy: apmPackagePolicy, + has_apm_integrations: packagePolicies.total > 0, }; }, }); diff --git a/x-pack/plugins/apm/server/routes/services/get_service_error_groups/index.ts b/x-pack/plugins/apm/server/routes/services/get_service_error_groups/index.ts deleted file mode 100644 index 1a853231bb09a..0000000000000 --- a/x-pack/plugins/apm/server/routes/services/get_service_error_groups/index.ts +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { orderBy } from 'lodash'; -import { ValuesType } from 'utility-types'; -import { kqlQuery, rangeQuery } from '../../../../../observability/server'; -import { PromiseReturnType } from '../../../../../observability/typings/common'; -import { - ERROR_EXC_MESSAGE, - ERROR_GROUP_ID, - ERROR_LOG_MESSAGE, - SERVICE_NAME, - TRANSACTION_TYPE, -} from '../../../../common/elasticsearch_fieldnames'; -import { ProcessorEvent } from '../../../../common/processor_event'; -import { environmentQuery } from '../../../../common/utils/environment_query'; -import { withApmSpan } from '../../../utils/with_apm_span'; -import { getBucketSize } from '../../../lib/helpers/get_bucket_size'; -import { getErrorName } from '../../../lib/helpers/get_error_name'; -import { Setup } from '../../../lib/helpers/setup_request'; - -export type ServiceErrorGroupItem = ValuesType< - PromiseReturnType ->; - -export async function getServiceErrorGroups({ - environment, - kuery, - serviceName, - setup, - size, - numBuckets, - pageIndex, - sortDirection, - sortField, - transactionType, - start, - end, -}: { - environment: string; - kuery: string; - serviceName: string; - setup: Setup; - size: number; - pageIndex: number; - numBuckets: number; - sortDirection: 'asc' | 'desc'; - sortField: 'name' | 'lastSeen' | 'occurrences'; - transactionType: string; - start: number; - end: number; -}) { - return withApmSpan('get_service_error_groups', async () => { - const { apmEventClient } = setup; - - const { intervalString } = getBucketSize({ start, end, numBuckets }); - - const response = await apmEventClient.search( - 'get_top_service_error_groups', - { - apm: { - events: [ProcessorEvent.error], - }, - body: { - size: 0, - query: { - bool: { - filter: [ - { term: { [SERVICE_NAME]: serviceName } }, - { term: { [TRANSACTION_TYPE]: transactionType } }, - ...rangeQuery(start, end), - ...environmentQuery(environment), - ...kqlQuery(kuery), - ], - }, - }, - aggs: { - error_groups: { - terms: { - field: ERROR_GROUP_ID, - size: 500, - order: { - _count: 'desc', - }, - }, - aggs: { - sample: { - top_hits: { - size: 1, - _source: [ - ERROR_LOG_MESSAGE, - ERROR_EXC_MESSAGE, - '@timestamp', - ] as any as string, - sort: { - '@timestamp': 'desc', - }, - }, - }, - }, - }, - }, - }, - } - ); - - const errorGroups = - response.aggregations?.error_groups.buckets.map((bucket) => ({ - group_id: bucket.key as string, - name: getErrorName(bucket.sample.hits.hits[0]._source), - lastSeen: new Date( - bucket.sample.hits.hits[0]?._source['@timestamp'] - ).getTime(), - occurrences: { - value: bucket.doc_count, - }, - })) ?? []; - - // Sort error groups first, and only get timeseries for data in view. - // This is to limit the possibility of creating too many buckets. - - const sortedAndSlicedErrorGroups = orderBy( - errorGroups, - (group) => { - if (sortField === 'occurrences') { - return group.occurrences.value; - } - return group[sortField]; - }, - [sortDirection] - ).slice(pageIndex * size, pageIndex * size + size); - - const sortedErrorGroupIds = sortedAndSlicedErrorGroups.map( - (group) => group.group_id - ); - - const timeseriesResponse = await apmEventClient.search( - 'get_service_error_groups_timeseries', - { - apm: { - events: [ProcessorEvent.error], - }, - body: { - size: 0, - query: { - bool: { - filter: [ - { terms: { [ERROR_GROUP_ID]: sortedErrorGroupIds } }, - { term: { [SERVICE_NAME]: serviceName } }, - { term: { [TRANSACTION_TYPE]: transactionType } }, - ...rangeQuery(start, end), - ...environmentQuery(environment), - ...kqlQuery(kuery), - ], - }, - }, - aggs: { - error_groups: { - terms: { - field: ERROR_GROUP_ID, - size, - }, - aggs: { - timeseries: { - date_histogram: { - field: '@timestamp', - fixed_interval: intervalString, - min_doc_count: 0, - extended_bounds: { - min: start, - max: end, - }, - }, - }, - }, - }, - }, - }, - } - ); - - return { - total_error_groups: errorGroups.length, - is_aggregation_accurate: - (response.aggregations?.error_groups.sum_other_doc_count ?? 0) === 0, - error_groups: sortedAndSlicedErrorGroups.map((errorGroup) => ({ - ...errorGroup, - occurrences: { - ...errorGroup.occurrences, - timeseries: - timeseriesResponse.aggregations?.error_groups.buckets - .find((bucket) => bucket.key === errorGroup.group_id) - ?.timeseries.buckets.map((dateBucket) => ({ - x: dateBucket.key, - y: dateBucket.doc_count, - })) ?? null, - }, - })), - }; - }); -} diff --git a/x-pack/plugins/apm/server/routes/services/route.ts b/x-pack/plugins/apm/server/routes/services/route.ts index d395be4c6adce..6df0af26ad8d6 100644 --- a/x-pack/plugins/apm/server/routes/services/route.ts +++ b/x-pack/plugins/apm/server/routes/services/route.ts @@ -21,9 +21,6 @@ import { getServiceAgent } from './get_service_agent'; import { getServiceAlerts } from './get_service_alerts'; import { getServiceDependencies } from './get_service_dependencies'; import { getServiceInstanceMetadataDetails } from './get_service_instance_metadata_details'; -import { getServiceErrorGroupPeriods } from './get_service_error_groups/get_service_error_group_detailed_statistics'; -import { getServiceErrorGroupMainStatistics } from './get_service_error_groups/get_service_error_group_main_statistics'; -import { getServiceInstancesDetailedStatisticsPeriods } from './get_service_instances/detailed_statistics'; import { getServiceInstancesMainStatistics } from './get_service_instances/main_statistics'; import { getServiceMetadataDetails } from './get_service_metadata_details'; import { getServiceMetadataIcons } from './get_service_metadata_icons'; @@ -47,6 +44,7 @@ import { offsetPreviousPeriodCoordinates } from '../../../common/utils/offset_pr import { getServicesDetailedStatistics } from './get_services_detailed_statistics'; import { getServiceDependenciesBreakdown } from './get_service_dependencies_breakdown'; import { getBucketSizeForAggregatedTransactions } from '../../lib/helpers/get_bucket_size_for_aggregated_transactions'; +import { getServiceInstancesDetailedStatisticsPeriods } from './get_service_instances/detailed_statistics'; const servicesRoute = createApmServerRoute({ endpoint: 'GET /internal/apm/services', @@ -374,98 +372,6 @@ const serviceAnnotationsCreateRoute = createApmServerRoute({ }, }); -const serviceErrorGroupsMainStatisticsRoute = createApmServerRoute({ - endpoint: - 'GET /internal/apm/services/{serviceName}/error_groups/main_statistics', - params: t.type({ - path: t.type({ - serviceName: t.string, - }), - query: t.intersection([ - environmentRt, - kueryRt, - rangeRt, - t.type({ - transactionType: t.string, - }), - ]), - }), - options: { tags: ['access:apm'] }, - handler: async (resources) => { - const setup = await setupRequest(resources); - const { params } = resources; - const { - path: { serviceName }, - query: { kuery, transactionType, environment, start, end }, - } = params; - - return getServiceErrorGroupMainStatistics({ - kuery, - serviceName, - setup, - transactionType, - environment, - start, - end, - }); - }, -}); - -const serviceErrorGroupsDetailedStatisticsRoute = createApmServerRoute({ - endpoint: - 'GET /internal/apm/services/{serviceName}/error_groups/detailed_statistics', - params: t.type({ - path: t.type({ - serviceName: t.string, - }), - query: t.intersection([ - environmentRt, - kueryRt, - rangeRt, - comparisonRangeRt, - t.type({ - numBuckets: toNumberRt, - transactionType: t.string, - groupIds: jsonRt.pipe(t.array(t.string)), - }), - ]), - }), - options: { tags: ['access:apm'] }, - handler: async (resources) => { - const setup = await setupRequest(resources); - const { params } = resources; - - const { - path: { serviceName }, - query: { - environment, - kuery, - numBuckets, - transactionType, - groupIds, - comparisonStart, - comparisonEnd, - start, - end, - }, - } = params; - - return getServiceErrorGroupPeriods({ - environment, - kuery, - serviceName, - setup, - numBuckets, - transactionType, - groupIds, - comparisonStart, - comparisonEnd, - start, - end, - }); - }, -}); - const serviceThroughputRoute = createApmServerRoute({ endpoint: 'GET /internal/apm/services/{serviceName}/throughput', params: t.type({ @@ -952,8 +858,6 @@ export const serviceRouteRepository = createApmServerRouteRepository() .add(serviceNodeMetadataRoute) .add(serviceAnnotationsRoute) .add(serviceAnnotationsCreateRoute) - .add(serviceErrorGroupsMainStatisticsRoute) - .add(serviceErrorGroupsDetailedStatisticsRoute) .add(serviceInstancesMetadataDetails) .add(serviceThroughputRoute) .add(serviceInstancesMainStatisticsRoute) diff --git a/x-pack/plugins/apm/server/tutorial/envs/elastic_cloud.ts b/x-pack/plugins/apm/server/tutorial/envs/elastic_cloud.ts index c62e42f222194..654c0e675a053 100644 --- a/x-pack/plugins/apm/server/tutorial/envs/elastic_cloud.ts +++ b/x-pack/plugins/apm/server/tutorial/envs/elastic_cloud.ts @@ -25,10 +25,18 @@ import { createPhpAgentInstructions, } from '../../../common/tutorial/instructions/apm_agent_instructions'; import { CloudSetup } from '../../../../cloud/server'; +import { APMConfig } from '../..'; +import { getOnPremApmServerInstructionSet } from './on_prem_apm_server_instruction_set'; -export function createElasticCloudInstructions( - cloudSetup?: CloudSetup -): TutorialSchema['elasticCloud'] { +export function createElasticCloudInstructions({ + cloudSetup, + apmConfig, + isFleetPluginEnabled, +}: { + cloudSetup?: CloudSetup; + apmConfig: APMConfig; + isFleetPluginEnabled: boolean; +}): TutorialSchema['elasticCloud'] { const apmServerUrl = cloudSetup?.apm.url; const instructionSets = []; @@ -36,6 +44,9 @@ export function createElasticCloudInstructions( instructionSets.push(getApmServerInstructionSet(cloudSetup)); } + instructionSets.push( + getOnPremApmServerInstructionSet({ apmConfig, isFleetPluginEnabled }) + ); instructionSets.push(getApmAgentInstructionSet(cloudSetup)); return { diff --git a/x-pack/plugins/apm/server/tutorial/envs/on_prem.ts b/x-pack/plugins/apm/server/tutorial/envs/on_prem.ts index 8051ef2a72b6a..18e30fe07808a 100644 --- a/x-pack/plugins/apm/server/tutorial/envs/on_prem.ts +++ b/x-pack/plugins/apm/server/tutorial/envs/on_prem.ts @@ -23,15 +23,7 @@ import { createRackAgentInstructions, createRailsAgentInstructions, } from '../../../common/tutorial/instructions/apm_agent_instructions'; -import { - createDownloadServerDeb, - createDownloadServerOsx, - createDownloadServerRpm, - createEditConfig, - createStartServerUnix, - createStartServerUnixSysv, - createWindowsServerInstructions, -} from '../../../common/tutorial/instructions/apm_server_instructions'; +import { getOnPremApmServerInstructionSet } from './on_prem_apm_server_instruction_set'; export function onPremInstructions({ apmConfig, @@ -40,121 +32,9 @@ export function onPremInstructions({ apmConfig: APMConfig; isFleetPluginEnabled: boolean; }): InstructionsSchema { - const EDIT_CONFIG = createEditConfig(); - const START_SERVER_UNIX = createStartServerUnix(); - const START_SERVER_UNIX_SYSV = createStartServerUnixSysv(); - return { instructionSets: [ - { - title: i18n.translate('xpack.apm.tutorial.apmServer.title', { - defaultMessage: 'APM Server', - }), - callOut: { - title: i18n.translate('xpack.apm.tutorial.apmServer.callOut.title', { - defaultMessage: 'Important: Updating to 7.0 or higher', - }), - message: i18n.translate( - 'xpack.apm.tutorial.apmServer.callOut.message', - { - defaultMessage: `Please make sure your APM Server is updated to 7.0 or higher. \ - You can also migrate your 6.x data with the migration assistant found in Kibana's management section.`, - } - ), - iconType: 'alert', - }, - instructionVariants: [ - { - id: INSTRUCTION_VARIANT.DEB, - instructions: [ - createDownloadServerDeb(), - EDIT_CONFIG, - START_SERVER_UNIX_SYSV, - ], - }, - { - id: INSTRUCTION_VARIANT.RPM, - instructions: [ - createDownloadServerRpm(), - EDIT_CONFIG, - START_SERVER_UNIX_SYSV, - ], - }, - { - id: INSTRUCTION_VARIANT.OSX, - instructions: [ - createDownloadServerOsx(), - EDIT_CONFIG, - START_SERVER_UNIX, - ], - }, - { - id: INSTRUCTION_VARIANT.WINDOWS, - instructions: createWindowsServerInstructions(), - }, - // hides fleet section when plugin is disabled - ...(isFleetPluginEnabled - ? [ - { - id: INSTRUCTION_VARIANT.FLEET, - instructions: [ - { - title: i18n.translate('xpack.apm.tutorial.fleet.title', { - defaultMessage: 'Fleet', - }), - customComponentName: 'TutorialFleetInstructions', - }, - ], - }, - ] - : []), - ], - statusCheck: { - title: i18n.translate( - 'xpack.apm.tutorial.apmServer.statusCheck.title', - { - defaultMessage: 'APM Server status', - } - ), - text: i18n.translate( - 'xpack.apm.tutorial.apmServer.statusCheck.text', - { - defaultMessage: - 'Make sure APM Server is running before you start implementing the APM agents.', - } - ), - btnLabel: i18n.translate( - 'xpack.apm.tutorial.apmServer.statusCheck.btnLabel', - { - defaultMessage: 'Check APM Server status', - } - ), - success: i18n.translate( - 'xpack.apm.tutorial.apmServer.statusCheck.successMessage', - { - defaultMessage: 'You have correctly setup APM Server', - } - ), - error: i18n.translate( - 'xpack.apm.tutorial.apmServer.statusCheck.errorMessage', - { - defaultMessage: - 'No APM Server detected. Please make sure it is running and you have updated to 7.0 or higher.', - } - ), - esHitsCheck: { - index: apmConfig.indices.onboarding, - query: { - bool: { - filter: [ - { term: { 'processor.event': 'onboarding' } }, - { range: { 'observer.version_major': { gte: 7 } } }, - ], - }, - }, - }, - }, - }, + getOnPremApmServerInstructionSet({ apmConfig, isFleetPluginEnabled }), { title: i18n.translate('xpack.apm.tutorial.apmAgents.title', { defaultMessage: 'APM Agents', diff --git a/x-pack/plugins/apm/server/tutorial/envs/on_prem_apm_server_instruction_set.ts b/x-pack/plugins/apm/server/tutorial/envs/on_prem_apm_server_instruction_set.ts new file mode 100644 index 0000000000000..b9c491082f787 --- /dev/null +++ b/x-pack/plugins/apm/server/tutorial/envs/on_prem_apm_server_instruction_set.ts @@ -0,0 +1,136 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; +import { APMConfig } from '../..'; +import { + InstructionsSchema, + INSTRUCTION_VARIANT, +} from '../../../../../../src/plugins/home/server'; +import { + createDownloadServerDeb, + createDownloadServerOsx, + createDownloadServerRpm, + createEditConfig, + createStartServerUnix, + createStartServerUnixSysv, + createWindowsServerInstructions, +} from '../../../common/tutorial/instructions/apm_server_instructions'; + +const EDIT_CONFIG = createEditConfig(); +const START_SERVER_UNIX = createStartServerUnix(); +const START_SERVER_UNIX_SYSV = createStartServerUnixSysv(); + +export function getOnPremApmServerInstructionSet({ + apmConfig, + isFleetPluginEnabled, +}: { + apmConfig: APMConfig; + isFleetPluginEnabled: boolean; +}): InstructionsSchema['instructionSets'][0] { + return { + title: i18n.translate('xpack.apm.tutorial.apmServer.title', { + defaultMessage: 'APM Server', + }), + callOut: { + title: i18n.translate('xpack.apm.tutorial.apmServer.callOut.title', { + defaultMessage: 'Important: Updating to 7.0 or higher', + }), + message: i18n.translate('xpack.apm.tutorial.apmServer.callOut.message', { + defaultMessage: `Please make sure your APM Server is updated to 7.0 or higher. \ + You can also migrate your 6.x data with the migration assistant found in Kibana's management section.`, + }), + iconType: 'alert', + }, + instructionVariants: [ + { + id: INSTRUCTION_VARIANT.DEB, + instructions: [ + createDownloadServerDeb(), + EDIT_CONFIG, + START_SERVER_UNIX_SYSV, + ], + }, + { + id: INSTRUCTION_VARIANT.RPM, + instructions: [ + createDownloadServerRpm(), + EDIT_CONFIG, + START_SERVER_UNIX_SYSV, + ], + }, + { + id: INSTRUCTION_VARIANT.OSX, + instructions: [ + createDownloadServerOsx(), + EDIT_CONFIG, + START_SERVER_UNIX, + ], + }, + { + id: INSTRUCTION_VARIANT.WINDOWS, + instructions: createWindowsServerInstructions(), + }, + // hides fleet section when plugin is disabled + ...(isFleetPluginEnabled + ? [ + { + id: INSTRUCTION_VARIANT.FLEET, + instructions: [ + { + title: i18n.translate('xpack.apm.tutorial.fleet.title', { + defaultMessage: 'Fleet', + }), + customComponentName: 'TutorialFleetInstructions', + }, + ], + initialSelected: true, + }, + ] + : []), + ], + statusCheck: { + title: i18n.translate('xpack.apm.tutorial.apmServer.statusCheck.title', { + defaultMessage: 'APM Server status', + }), + text: i18n.translate('xpack.apm.tutorial.apmServer.statusCheck.text', { + defaultMessage: + 'Make sure APM Server is running before you start implementing the APM agents.', + }), + btnLabel: i18n.translate( + 'xpack.apm.tutorial.apmServer.statusCheck.btnLabel', + { + defaultMessage: 'Check APM Server status', + } + ), + success: i18n.translate( + 'xpack.apm.tutorial.apmServer.statusCheck.successMessage', + { + defaultMessage: 'You have correctly setup APM Server', + } + ), + error: i18n.translate( + 'xpack.apm.tutorial.apmServer.statusCheck.errorMessage', + { + defaultMessage: + 'No APM Server detected. Please make sure it is running and you have updated to 7.0 or higher.', + } + ), + esHitsCheck: { + index: apmConfig.indices.onboarding, + query: { + bool: { + filter: [ + { term: { 'processor.event': 'onboarding' } }, + { range: { 'observer.version_major': { gte: 7 } } }, + ], + }, + }, + }, + }, + }; +} diff --git a/x-pack/plugins/apm/server/tutorial/index.ts b/x-pack/plugins/apm/server/tutorial/index.ts index 5d3ff8636df4d..c9fc7eb6467d4 100644 --- a/x-pack/plugins/apm/server/tutorial/index.ts +++ b/x-pack/plugins/apm/server/tutorial/index.ts @@ -107,7 +107,11 @@ It allows you to monitor the performance of thousands of applications in real ti artifacts, customStatusCheckName: 'apm_fleet_server_status_check', onPrem: onPremInstructions({ apmConfig, isFleetPluginEnabled }), - elasticCloud: createElasticCloudInstructions(cloud), + elasticCloud: createElasticCloudInstructions({ + apmConfig, + isFleetPluginEnabled, + cloudSetup: cloud, + }), previewImagePath: '/plugins/apm/assets/apm.png', savedObjects, savedObjectsInstallMsg: i18n.translate( diff --git a/x-pack/plugins/apm/tsconfig.json b/x-pack/plugins/apm/tsconfig.json index 5db20725dd785..2c10a8d175ad1 100644 --- a/x-pack/plugins/apm/tsconfig.json +++ b/x-pack/plugins/apm/tsconfig.json @@ -22,7 +22,6 @@ { "path": "../../../src/plugins/data/tsconfig.json" }, { "path": "../../../src/plugins/embeddable/tsconfig.json" }, { "path": "../../../src/plugins/home/tsconfig.json" }, - { "path": "../../../src/plugins/index_pattern_management/tsconfig.json" }, { "path": "../../../src/plugins/inspector/tsconfig.json" }, { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, { "path": "../../../src/plugins/kibana_utils/tsconfig.json" }, diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_visualization.test.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_visualization.test.ts index 52c452e61bd55..8b7c77e20f7d2 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_visualization.test.ts +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_visualization.test.ts @@ -57,4 +57,15 @@ describe('savedVisualization', () => { const expression = fn(null, { ...args, title: '' }, {} as any); expect(expression.input.title).toEqual(''); }); + + it('accepts time range', () => { + const expression = fn( + null, + { ...args, timerange: { type: 'timerange', from: '15m-now', to: 'now' } }, + {} as any + ); + expect(expression.input.timeRange).toHaveProperty('from', '15m-now'); + expect(expression.input.timeRange).toHaveProperty('to', 'now'); + expect(expression.input.timeRange).not.toHaveProperty('type'); + }); }); diff --git a/x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_visualization.ts b/x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_visualization.ts index 31e3fb2a8c564..4a0668740bb4b 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_visualization.ts +++ b/x-pack/plugins/canvas/canvas_plugin_src/functions/external/saved_visualization.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { omit } from 'lodash'; import { ExpressionFunctionDefinition } from 'src/plugins/expressions'; import { VisualizeInput } from 'src/plugins/visualizations/public'; import { @@ -96,7 +97,7 @@ export function savedVisualization(): ExpressionFunctionDefinition< id, savedObjectId: id, disableTriggers: true, - timeRange: timerange || defaultTimeRange, + timeRange: timerange ? omit(timerange, 'type') : defaultTimeRange, filters: getQueryFilters(filters), vis: visOptions, title: title === null ? undefined : title, diff --git a/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.tsx b/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.tsx index 953746c280840..0b1adb9559e55 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.tsx +++ b/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.tsx @@ -20,6 +20,7 @@ import { RendererStrings } from '../../../i18n'; import { embeddableInputToExpression } from './embeddable_input_to_expression'; import { RendererFactory, EmbeddableInput } from '../../../types'; import { CANVAS_EMBEDDABLE_CLASSNAME } from '../../../common/lib'; +import type { EmbeddableContainerContext } from '../../../../../../src/plugins/embeddable/public/'; const { embeddable: strings } = RendererStrings; @@ -31,6 +32,10 @@ const embeddablesRegistry: { const renderEmbeddableFactory = (core: CoreStart, plugins: StartDeps) => { const I18nContext = core.i18n.Context; + const embeddableContainerContext: EmbeddableContainerContext = { + getCurrentPath: () => window.location.hash, + }; + return (embeddableObject: IEmbeddable) => { return (
{ style={{ width: '100%', height: '100%', cursor: 'auto' }} > - +
); diff --git a/x-pack/plugins/canvas/canvas_plugin_src/uis/datasources/essql.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/datasources/essql.js index 9f50bb76341ca..8321cc1026333 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/uis/datasources/essql.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/uis/datasources/essql.js @@ -7,7 +7,9 @@ import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; -import { EuiFormRow, EuiTextArea, EuiLink, EuiText } from '@elastic/eui'; +import { EsqlLang } from '@kbn/monaco'; +import { EuiFormRow, EuiLink, EuiText } from '@elastic/eui'; +import { CodeEditorField } from '../../../../../../src/plugins/kibana_react/public'; import { getSimpleArg, setSimpleArg } from '../../../public/lib/arg_helpers'; import { templateFromReactComponent } from '../../../public/lib/template_from_react_component'; import { DataSourceStrings, SQL_URL } from '../../../i18n'; @@ -50,12 +52,16 @@ class EssqlDatasource extends PureComponent { }); }; - onChange = (e) => { - const { value } = e.target; + onChange = (value) => { this.props.setInvalid(!value.trim()); this.setArg(this.getArgName(), value); }; + editorDidMount = (editor) => { + const model = editor.getModel(); + model?.updateOptions({ tabSize: 2 }); + }; + render() { const { isInvalid } = this.props; @@ -71,13 +77,24 @@ class EssqlDatasource extends PureComponent { } > - ); diff --git a/x-pack/plugins/canvas/canvas_plugin_src/uis/datasources/timelion.js b/x-pack/plugins/canvas/canvas_plugin_src/uis/datasources/timelion.js index 99fcf5588d4ea..936085b3e881f 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/uis/datasources/timelion.js +++ b/x-pack/plugins/canvas/canvas_plugin_src/uis/datasources/timelion.js @@ -17,7 +17,7 @@ import { EuiText, EuiLink, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { getSimpleArg, setSimpleArg } from '../../../public/lib/arg_helpers'; import { templateFromReactComponent } from '../../../public/lib/template_from_react_component'; import { DataSourceStrings, TIMELION_QUERY_URL, TIMELION, CANVAS } from '../../../i18n'; diff --git a/x-pack/plugins/canvas/kibana.json b/x-pack/plugins/canvas/kibana.json index 2fd312502a3c7..a00dd94ce346c 100644 --- a/x-pack/plugins/canvas/kibana.json +++ b/x-pack/plugins/canvas/kibana.json @@ -33,7 +33,6 @@ "requiredBundles": [ "discover", "home", - "kibanaLegacy", "kibanaReact", "kibanaUtils", "lens", diff --git a/x-pack/plugins/canvas/public/application.tsx b/x-pack/plugins/canvas/public/application.tsx index 937c9f56f948c..a286bca547bfa 100644 --- a/x-pack/plugins/canvas/public/application.tsx +++ b/x-pack/plugins/canvas/public/application.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { Store } from 'redux'; import ReactDOM from 'react-dom'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { Provider } from 'react-redux'; import { BehaviorSubject } from 'rxjs'; diff --git a/x-pack/plugins/canvas/public/components/arg_form/arg_template_form.tsx b/x-pack/plugins/canvas/public/components/arg_form/arg_template_form.tsx index 172b3f1a590e6..af58e624d1b3d 100644 --- a/x-pack/plugins/canvas/public/components/arg_form/arg_template_form.tsx +++ b/x-pack/plugins/canvas/public/components/arg_form/arg_template_form.tsx @@ -5,10 +5,10 @@ * 2.0. */ -import React, { useState, useEffect, useCallback, useRef } from 'react'; +import React, { useState, useEffect, useCallback, useRef, memo, ReactPortal } from 'react'; +import deepEqual from 'react-fast-compare'; import usePrevious from 'react-use/lib/usePrevious'; import useEffectOnce from 'react-use/lib/useEffectOnce'; -import { RenderToDom } from '../render_to_dom'; import { ExpressionFormHandlers } from '../../../common/lib/expression_form_handlers'; import { UpdatePropsRef } from '../../../types/arguments'; @@ -18,7 +18,7 @@ interface ArgTemplateFormProps { config: ArgTemplateFormProps['argumentProps'], handlers: ArgTemplateFormProps['handlers'], onMount?: (ref: UpdatePropsRef | null) => void - ) => void; + ) => ReactPortal | undefined; argumentProps: { valueMissing?: boolean; label?: string; @@ -37,7 +37,7 @@ interface ArgTemplateFormProps { const mergeWithFormHandlers = (handlers: ArgTemplateFormProps['handlers']) => Object.assign(new ExpressionFormHandlers(), handlers); -export const ArgTemplateForm: React.FunctionComponent = ({ +const ArgTemplateFormComponent: React.FunctionComponent = ({ template, argumentProps, handlers, @@ -45,27 +45,25 @@ export const ArgTemplateForm: React.FunctionComponent = ({ errorTemplate, }) => { const [updatedHandlers, setHandlers] = useState(mergeWithFormHandlers(handlers)); - const [mounted, setMounted] = useState(false); const prevError = usePrevious(error); - const prevMounted = usePrevious(mounted); - const mountedArgumentRef = useRef>(); + const [argument, setArgument] = useState(); - const domNodeRef = useRef(); + const mountedArgumentRef = useRef>(); + const domNodeRef = useRef(null); useEffectOnce(() => () => { mountedArgumentRef.current = undefined; }); + const onMount = useCallback((ref) => { + if (!mountedArgumentRef.current && ref) { + mountedArgumentRef.current = ref; + } + }, []); + const renderTemplate = useCallback( - (domNode) => - template && - template(domNode, argumentProps, updatedHandlers, (ref) => { - if (!mountedArgumentRef.current && ref) { - mountedArgumentRef.current = ref; - setMounted(true); - } - }), - [argumentProps, template, updatedHandlers] + (domNode) => template && template(domNode, argumentProps, updatedHandlers, onMount), + [argumentProps, onMount, template, updatedHandlers] ); const renderErrorTemplate = useCallback( @@ -74,20 +72,17 @@ export const ArgTemplateForm: React.FunctionComponent = ({ ); useEffect(() => { - setHandlers(mergeWithFormHandlers(handlers)); - }, [handlers]); - - useEffect(() => { - if (!prevError && error) { - updatedHandlers.destroy(); + if (!argument && domNodeRef.current) { + const arg = renderTemplate(domNodeRef.current); + if (arg) { + setArgument(arg); + } } - }, [prevError, error, updatedHandlers]); + }, [argument, renderTemplate]); useEffect(() => { - if ((!error && prevError && mounted) || (mounted && !prevMounted && !error)) { - renderTemplate(domNodeRef.current); - } - }, [error, mounted, prevError, prevMounted, renderTemplate]); + setHandlers(mergeWithFormHandlers(handlers)); + }, [handlers]); useEffect(() => { if (mountedArgumentRef.current) { @@ -95,6 +90,12 @@ export const ArgTemplateForm: React.FunctionComponent = ({ } }, [argumentProps]); + useEffect(() => { + if (!prevError && error) { + updatedHandlers.destroy(); + } + }, [prevError, error, updatedHandlers]); + if (error) { mountedArgumentRef.current = undefined; return renderErrorTemplate(); @@ -102,15 +103,15 @@ export const ArgTemplateForm: React.FunctionComponent = ({ if (!template) { mountedArgumentRef.current = undefined; - return null; } return ( - { - domNodeRef.current = domNode; - setMounted(true); - }} - /> +
+ {argument} +
); }; + +export const ArgTemplateForm = memo(ArgTemplateFormComponent, (prevProps, nextProps) => + deepEqual(prevProps, nextProps) +); diff --git a/x-pack/plugins/canvas/public/components/datasource/datasource_preview/datasource_preview.js b/x-pack/plugins/canvas/public/components/datasource/datasource_preview/datasource_preview.js index be8e9f673090b..cff085f504f9d 100644 --- a/x-pack/plugins/canvas/public/components/datasource/datasource_preview/datasource_preview.js +++ b/x-pack/plugins/canvas/public/components/datasource/datasource_preview/datasource_preview.js @@ -18,7 +18,7 @@ import { EuiEmptyPrompt, EuiSpacer, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { withSuspense } from '../../../../../../../src/plugins/presentation_util/public'; import { LazyErrorComponent } from '../../../../../../../src/plugins/expression_error/public'; import { Datatable } from '../../datatable'; diff --git a/x-pack/plugins/canvas/public/components/workpad_header/share_menu/flyout/flyout.component.tsx b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/flyout/flyout.component.tsx index 8c94e131b781c..4ad27791c3292 100644 --- a/x-pack/plugins/canvas/public/components/workpad_header/share_menu/flyout/flyout.component.tsx +++ b/x-pack/plugins/canvas/public/components/workpad_header/share_menu/flyout/flyout.component.tsx @@ -22,7 +22,7 @@ import { EuiFlexItem, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { CanvasRenderedWorkpad } from '../../../../../shareable_runtime/types'; import { useDownloadRenderedWorkpad } from '../../../hooks'; diff --git a/x-pack/plugins/canvas/public/expression_types/datasource.tsx b/x-pack/plugins/canvas/public/expression_types/datasource.tsx index 8ecfedbf948d7..e3cde6c683be9 100644 --- a/x-pack/plugins/canvas/public/expression_types/datasource.tsx +++ b/x-pack/plugins/canvas/public/expression_types/datasource.tsx @@ -5,27 +5,30 @@ * 2.0. */ -import React, { useEffect, useRef, useCallback } from 'react'; +import React, { useEffect, useRef, useCallback, ReactPortal, useState, memo } from 'react'; import useEffectOnce from 'react-use/lib/useEffectOnce'; +import deepEqual from 'react-fast-compare'; import { Ast } from '@kbn/interpreter/common'; -import { RenderToDom } from '../components/render_to_dom'; +import { createPortal } from 'react-dom'; import { BaseForm, BaseFormProps } from './base_form'; import { ExpressionFormHandlers } from '../../common/lib'; import { ExpressionFunction } from '../../types'; import { UpdatePropsRef } from '../../types/arguments'; -const defaultTemplate = () => ( -
-

This datasource has no interface. Use the expression editor to make changes.

-
-); +const defaultTemplate = (domNode: HTMLElement) => + createPortal( +
+

This datasource has no interface. Use the expression editor to make changes.

+
, + domNode + ); type TemplateFn = ( domNode: HTMLElement, config: DatasourceRenderProps, handlers: ExpressionFormHandlers, onMount?: (ref: UpdatePropsRef | null) => void -) => void; +) => ReactPortal | undefined; export type DatasourceProps = { template?: TemplateFn; @@ -49,27 +52,36 @@ interface DatasourceWrapperProps { datasourceProps: DatasourceRenderProps; } -const DatasourceWrapper: React.FunctionComponent = (props) => { - const domNodeRef = useRef(); +const DatasourceWrapperComponent: React.FunctionComponent = (props) => { + const domNodeRef = useRef(null); const datasourceRef = useRef>(); + const [argument, setArgument] = useState(); const { spec, datasourceProps, handlers } = props; - const callRenderFn = useCallback(() => { - const { template } = spec; - - if (!domNodeRef.current) { - return; - } - - template(domNodeRef.current, datasourceProps, handlers, (ref) => { - datasourceRef.current = ref ?? undefined; - }); - }, [datasourceProps, handlers, spec]); + const onMount = useCallback((ref) => { + datasourceRef.current = ref ?? undefined; + }, []); + + const callRenderFn = useCallback( + (domNode) => { + const { template } = spec; + if (!template) { + return null; + } + return template(domNode, datasourceProps, handlers, onMount); + }, + [datasourceProps, handlers, onMount, spec] + ); useEffect(() => { - callRenderFn(); - }, [callRenderFn]); + if (!argument && domNodeRef.current) { + const arg = callRenderFn(domNodeRef.current); + if (arg) { + setArgument(arg); + } + } + }, [argument, callRenderFn]); useEffect(() => { if (datasourceRef.current) { @@ -83,17 +95,18 @@ const DatasourceWrapper: React.FunctionComponent = (prop }); return ( - { - domNodeRef.current = domNode; - callRenderFn(); - }} - /> +
+ {argument} +
); }; +export const DatasourceWrapper = memo(DatasourceWrapperComponent, (prevProps, nextProps) => + deepEqual(prevProps, nextProps) +); + export class Datasource extends BaseForm { - template: TemplateFn | React.FC; + template?: TemplateFn; image?: string; requiresContext?: boolean; diff --git a/src/plugins/kibana_legacy/public/notify/lib/format_msg.test.js b/x-pack/plugins/canvas/public/lib/format_msg.test.ts similarity index 50% rename from src/plugins/kibana_legacy/public/notify/lib/format_msg.test.js rename to x-pack/plugins/canvas/public/lib/format_msg.test.ts index 30061141ee46d..0643e2a6f2b95 100644 --- a/src/plugins/kibana_legacy/public/notify/lib/format_msg.test.js +++ b/x-pack/plugins/canvas/public/lib/format_msg.test.ts @@ -1,13 +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. + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. */ -import { formatMsg } from './format_msg'; import expect from '@kbn/expect'; +import { formatMsg, formatESMsg } from './format_msg'; describe('formatMsg', () => { test('should prepend the second argument to result', () => { @@ -65,4 +64,59 @@ describe('formatMsg', () => { expect(actual).to.equal('I am the detailed message'); }); + + describe('formatESMsg', () => { + test('should return undefined if passed a basic error', () => { + const err = new Error('This is a normal error'); + + const actual = formatESMsg(err); + + expect(actual).to.be(undefined); + }); + + test('should return undefined if passed a string', () => { + const err = 'This is a error string'; + + const actual = formatESMsg(err); + + expect(actual).to.be(undefined); + }); + + test('should return the root_cause if passed an extended elasticsearch', () => { + const err: Record = new Error('This is an elasticsearch error'); + err.resp = { + error: { + root_cause: [ + { + reason: 'I am the detailed message', + }, + ], + }, + }; + + const actual = formatESMsg(err); + + expect(actual).to.equal('I am the detailed message'); + }); + + test('should combine the reason messages if more than one is returned.', () => { + const err: Record = new Error('This is an elasticsearch error'); + err.resp = { + error: { + root_cause: [ + { + reason: 'I am the detailed message 1', + }, + { + reason: 'I am the detailed message 2', + }, + ], + }, + }; + + const actual = formatESMsg(err); + + expect(actual).to.equal('I am the detailed message 1\nI am the detailed message 2'); + }); + }); }); diff --git a/src/plugins/kibana_legacy/public/notify/lib/format_msg.ts b/x-pack/plugins/canvas/public/lib/format_msg.ts similarity index 71% rename from src/plugins/kibana_legacy/public/notify/lib/format_msg.ts rename to x-pack/plugins/canvas/public/lib/format_msg.ts index 53fe0ba800a27..c996fe6c890be 100644 --- a/src/plugins/kibana_legacy/public/notify/lib/format_msg.ts +++ b/x-pack/plugins/canvas/public/lib/format_msg.ts @@ -1,16 +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. + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. */ import _ from 'lodash'; import { i18n } from '@kbn/i18n'; -import { formatESMsg } from './format_es_msg'; const has = _.has; +const getRootCause = (err: Record | string) => _.get(err, 'resp.error.root_cause'); + +/** + * Utilize the extended error information returned from elasticsearch + * @param {Error|String} err + * @returns {string} + */ +export const formatESMsg = (err: Record | string) => { + const rootCause = getRootCause(err); + + if (!Array.isArray(rootCause)) { + return; + } + + return rootCause.map((cause: Record) => cause.reason).join('\n'); +}; + /** * Formats the error message from an error object, extended elasticsearch * object or simple string; prepends optional second parameter to the message @@ -36,14 +51,14 @@ export function formatMsg(err: Record | string, source: string = '' // is an Angular $http "error object" if (err.status === -1) { // status = -1 indicates that the request was failed to reach the server - message += i18n.translate('kibana_legacy.notify.toaster.unavailableServerErrorMessage', { + message += i18n.translate('xpack.canvas.formatMsg.toaster.unavailableServerErrorMessage', { defaultMessage: 'An HTTP request has failed to connect. ' + 'Please check if the Kibana server is running and that your browser has a working connection, ' + 'or contact your system administrator.', }); } else { - message += i18n.translate('kibana_legacy.notify.toaster.errorStatusMessage', { + message += i18n.translate('xpack.canvas.formatMsg.toaster.errorStatusMessage', { defaultMessage: 'Error {errStatus} {errStatusText}: {errMessage}', values: { errStatus: err.status, diff --git a/x-pack/plugins/canvas/public/lib/template_from_react_component.tsx b/x-pack/plugins/canvas/public/lib/template_from_react_component.tsx index a783d6de2916d..b5ec01fb3d458 100644 --- a/x-pack/plugins/canvas/public/lib/template_from_react_component.tsx +++ b/x-pack/plugins/canvas/public/lib/template_from_react_component.tsx @@ -12,9 +12,9 @@ import React, { useImperativeHandle, useState, } from 'react'; -import { unmountComponentAtNode, render } from 'react-dom'; +import { unmountComponentAtNode, createPortal } from 'react-dom'; import PropTypes from 'prop-types'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { ErrorBoundary } from '../components/enhance/error_boundary'; import { ArgumentHandlers, UpdatePropsRef } from '../../types/arguments'; @@ -67,17 +67,17 @@ export const templateFromReactComponent = (Component: ComponentType) => { { + handlers.done(); onMount?.(ref); }} /> ); - render(el, domNode, () => { - handlers.done(); - }); handlers.onDestroy(() => { unmountComponentAtNode(domNode); }); + + return createPortal(el, domNode); } catch (err) { handlers.done(); config.renderError(); diff --git a/x-pack/plugins/canvas/public/services/kibana/notify.ts b/x-pack/plugins/canvas/public/services/kibana/notify.ts index 1752840127fe1..22d4b6f8a476d 100644 --- a/x-pack/plugins/canvas/public/services/kibana/notify.ts +++ b/x-pack/plugins/canvas/public/services/kibana/notify.ts @@ -8,7 +8,7 @@ import { get } from 'lodash'; import { KibanaPluginServiceFactory } from '../../../../../../src/plugins/presentation_util/public'; -import { formatMsg } from '../../../../../../src/plugins/kibana_legacy/public'; +import { formatMsg } from '../../lib/format_msg'; import { ToastInputFields } from '../../../../../../src/core/public'; import { CanvasStartDeps } from '../../plugin'; import { CanvasNotifyService } from '../notify'; diff --git a/x-pack/plugins/canvas/storybook/canvas.webpack.ts b/x-pack/plugins/canvas/storybook/canvas.webpack.ts index f4980741cc3e2..db59af20440e2 100644 --- a/x-pack/plugins/canvas/storybook/canvas.webpack.ts +++ b/x-pack/plugins/canvas/storybook/canvas.webpack.ts @@ -45,7 +45,6 @@ export const canvasWebpack = { test: [ resolve(KIBANA_ROOT, 'x-pack/plugins/canvas/public/components/embeddable_flyout'), resolve(KIBANA_ROOT, 'x-pack/plugins/reporting/public'), - resolve(KIBANA_ROOT, 'src/plugins/kibana_legacy/public/paginate'), ], use: 'null-loader', }, diff --git a/x-pack/plugins/canvas/storybook/decorators/services_decorator.tsx b/x-pack/plugins/canvas/storybook/decorators/services_decorator.tsx index 23dcc7b21a8b8..eaed712ba869f 100644 --- a/x-pack/plugins/canvas/storybook/decorators/services_decorator.tsx +++ b/x-pack/plugins/canvas/storybook/decorators/services_decorator.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { DecoratorFn } from '@storybook/react'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { PluginServiceRegistry } from '../../../../../src/plugins/presentation_util/public'; import { pluginServices, CanvasPluginServices } from '../../public/services'; diff --git a/x-pack/plugins/canvas/tsconfig.json b/x-pack/plugins/canvas/tsconfig.json index 5064bac975a9c..f0dd93fa0f7a0 100644 --- a/x-pack/plugins/canvas/tsconfig.json +++ b/x-pack/plugins/canvas/tsconfig.json @@ -39,7 +39,6 @@ { "path": "../../../src/plugins/expression_shape/tsconfig.json" }, { "path": "../../../src/plugins/home/tsconfig.json" }, { "path": "../../../src/plugins/inspector/tsconfig.json" }, - { "path": "../../../src/plugins/kibana_legacy/tsconfig.json" }, { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, { "path": "../../../src/plugins/kibana_utils/tsconfig.json" }, { "path": "../../../src/plugins/presentation_util/tsconfig.json" }, diff --git a/x-pack/plugins/cases/public/common/mock/test_providers.tsx b/x-pack/plugins/cases/public/common/mock/test_providers.tsx index 53f23fb1a0050..41754fad836b0 100644 --- a/x-pack/plugins/cases/public/common/mock/test_providers.tsx +++ b/x-pack/plugins/cases/public/common/mock/test_providers.tsx @@ -6,7 +6,7 @@ */ import { euiDarkVars } from '@kbn/ui-shared-deps-src/theme'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import React from 'react'; import { ThemeProvider } from 'styled-components'; import { SECURITY_SOLUTION_OWNER } from '../../../common'; diff --git a/x-pack/plugins/cases/public/components/configure_cases/index.tsx b/x-pack/plugins/cases/public/components/configure_cases/index.tsx index 8053804c2f779..6b19fd911d10d 100644 --- a/x-pack/plugins/cases/public/components/configure_cases/index.tsx +++ b/x-pack/plugins/cases/public/components/configure_cases/index.tsx @@ -8,7 +8,7 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react'; import styled, { css } from 'styled-components'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCallOut, EuiLink } from '@elastic/eui'; import { SUPPORTED_CONNECTORS } from '../../../common'; diff --git a/x-pack/plugins/cases/public/components/formatted_date/index.tsx b/x-pack/plugins/cases/public/components/formatted_date/index.tsx index caaf63a1add4c..c286855771794 100644 --- a/x-pack/plugins/cases/public/components/formatted_date/index.tsx +++ b/x-pack/plugins/cases/public/components/formatted_date/index.tsx @@ -7,7 +7,7 @@ import moment from 'moment-timezone'; import React from 'react'; -import { FormattedRelative } from '@kbn/i18n/react'; +import { FormattedRelative } from '@kbn/i18n-react'; import { useDateFormat, useTimeZone, useUiSetting$ } from '../../common/lib/kibana'; import { getOrEmptyTagFromValue } from '../empty_value'; diff --git a/x-pack/plugins/cases/public/components/localized_date_tooltip/index.tsx b/x-pack/plugins/cases/public/components/localized_date_tooltip/index.tsx index 3b140caeeda30..34825dfa5ae9d 100644 --- a/x-pack/plugins/cases/public/components/localized_date_tooltip/index.tsx +++ b/x-pack/plugins/cases/public/components/localized_date_tooltip/index.tsx @@ -6,7 +6,7 @@ */ import { EuiFlexGroup, EuiFlexItem, EuiToolTip } from '@elastic/eui'; -import { FormattedRelative } from '@kbn/i18n/react'; +import { FormattedRelative } from '@kbn/i18n-react'; import moment from 'moment'; import React from 'react'; diff --git a/x-pack/plugins/cases/public/components/markdown_editor/plugins/lens/plugin.tsx b/x-pack/plugins/cases/public/components/markdown_editor/plugins/lens/plugin.tsx index 106c9bf054549..0d3a62d312701 100644 --- a/x-pack/plugins/cases/public/components/markdown_editor/plugins/lens/plugin.tsx +++ b/x-pack/plugins/cases/public/components/markdown_editor/plugins/lens/plugin.tsx @@ -23,7 +23,7 @@ import { } from '@elastic/eui'; import React, { useCallback, useContext, useMemo, useEffect, useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useLocation } from 'react-router-dom'; import styled from 'styled-components'; diff --git a/x-pack/plugins/cases/public/components/use_push_to_service/helpers.tsx b/x-pack/plugins/cases/public/components/use_push_to_service/helpers.tsx index 7e5bb4b39ade9..625c15dee2e05 100644 --- a/x-pack/plugins/cases/public/components/use_push_to_service/helpers.tsx +++ b/x-pack/plugins/cases/public/components/use_push_to_service/helpers.tsx @@ -6,7 +6,7 @@ */ import { EuiLink } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import * as i18n from './translations'; diff --git a/x-pack/plugins/cases/public/components/user_action_tree/user_action_timestamp.test.tsx b/x-pack/plugins/cases/public/components/user_action_tree/user_action_timestamp.test.tsx index de2dc90ac43e9..f2e5d9793f3a8 100644 --- a/x-pack/plugins/cases/public/components/user_action_tree/user_action_timestamp.test.tsx +++ b/x-pack/plugins/cases/public/components/user_action_tree/user_action_timestamp.test.tsx @@ -10,8 +10,8 @@ import { mount, ReactWrapper } from 'enzyme'; import { TestProviders } from '../../common/mock'; import { UserActionTimestamp } from './user_action_timestamp'; -jest.mock('@kbn/i18n/react', () => { - const originalModule = jest.requireActual('@kbn/i18n/react'); +jest.mock('@kbn/i18n-react', () => { + const originalModule = jest.requireActual('@kbn/i18n-react'); const FormattedRelative = jest.fn(); FormattedRelative.mockImplementationOnce(() => '2 days ago'); FormattedRelative.mockImplementation(() => '20 hours ago'); diff --git a/x-pack/plugins/cases/public/components/user_action_tree/user_action_timestamp.tsx b/x-pack/plugins/cases/public/components/user_action_tree/user_action_timestamp.tsx index 51b60dae49848..45ad44932831d 100644 --- a/x-pack/plugins/cases/public/components/user_action_tree/user_action_timestamp.tsx +++ b/x-pack/plugins/cases/public/components/user_action_tree/user_action_timestamp.tsx @@ -7,7 +7,7 @@ import React, { memo } from 'react'; import { EuiTextColor } from '@elastic/eui'; -import { FormattedRelative } from '@kbn/i18n/react'; +import { FormattedRelative } from '@kbn/i18n-react'; import { LocalizedDateTooltip } from '../../components/localized_date_tooltip'; import * as i18n from './translations'; diff --git a/x-pack/plugins/cross_cluster_replication/public/app/app.tsx b/x-pack/plugins/cross_cluster_replication/public/app/app.tsx index dba5db9df5b8b..90d26f0d68288 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/app.tsx +++ b/x-pack/plugins/cross_cluster_replication/public/app/app.tsx @@ -9,7 +9,7 @@ import React, { Component } from 'react'; import { Route, Switch, Router, Redirect } from 'react-router-dom'; import { ScopedHistory, ApplicationStart } from 'kibana/public'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiEmptyPrompt, EuiPageContent } from '@elastic/eui'; diff --git a/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_delete_provider.js b/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_delete_provider.js index 034e08b5c6ab8..dd96b17cc4d7a 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_delete_provider.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_delete_provider.js @@ -8,7 +8,7 @@ import React, { PureComponent, Fragment } from 'react'; import { connect } from 'react-redux'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiConfirmModal } from '@elastic/eui'; import { deleteAutoFollowPattern } from '../store/actions'; diff --git a/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_form.js b/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_form.js index 04479133b3cea..449a43bc4e5bf 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_form.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_form.js @@ -8,7 +8,7 @@ import React, { PureComponent, Fragment } from 'react'; import PropTypes from 'prop-types'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, diff --git a/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_indices_preview.js b/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_indices_preview.js index 653710a49ca5b..8ea29de882dce 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_indices_preview.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_indices_preview.js @@ -9,7 +9,7 @@ import React from 'react'; import { EuiCallOut } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { getPreviewIndicesFromAutoFollowPattern } from '../services/auto_follow_pattern'; export const AutoFollowPatternIndicesPreview = ({ prefix, suffix, leaderIndexPatterns }) => { diff --git a/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_page_title.js b/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_page_title.js index 81d822d3882d8..05d0c5d7bb720 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_page_title.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_page_title.js @@ -7,7 +7,7 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiSpacer, EuiPageHeader, EuiButtonEmpty } from '@elastic/eui'; diff --git a/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_request_flyout.js b/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_request_flyout.js index 1bfdccd91caba..777755892b1f1 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_request_flyout.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/components/auto_follow_pattern_request_flyout.js @@ -6,7 +6,7 @@ */ import React, { PureComponent } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import PropTypes from 'prop-types'; import { diff --git a/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_actions_providers/follower_index_pause_provider.js b/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_actions_providers/follower_index_pause_provider.js index 34697a80121cc..dcc6a152420f5 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_actions_providers/follower_index_pause_provider.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_actions_providers/follower_index_pause_provider.js @@ -9,7 +9,7 @@ import React, { PureComponent, Fragment } from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiConfirmModal } from '@elastic/eui'; import { pauseFollowerIndex } from '../../store/actions'; diff --git a/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_actions_providers/follower_index_resume_provider.js b/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_actions_providers/follower_index_resume_provider.js index 91c6cb6e243ac..5420681335504 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_actions_providers/follower_index_resume_provider.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_actions_providers/follower_index_resume_provider.js @@ -9,7 +9,7 @@ import React, { PureComponent, Fragment } from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiConfirmModal, EuiLink } from '@elastic/eui'; import { reactRouterNavigate } from '../../../../../../../src/plugins/kibana_react/public'; import { routing } from '../../services/routing'; diff --git a/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_actions_providers/follower_index_unfollow_provider.js b/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_actions_providers/follower_index_unfollow_provider.js index 72d262bcf7af3..85b7b77c8ab67 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_actions_providers/follower_index_unfollow_provider.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_actions_providers/follower_index_unfollow_provider.js @@ -9,7 +9,7 @@ import React, { PureComponent, Fragment } from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiConfirmModal } from '@elastic/eui'; import { unfollowLeaderIndex } from '../../store/actions'; diff --git a/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_form/advanced_settings_fields.js b/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_form/advanced_settings_fields.js index e6efc8609562d..92a7a3670722b 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_form/advanced_settings_fields.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_form/advanced_settings_fields.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiLink } from '@elastic/eui'; import { getSettingDefault } from '../../services/follower_index_default_settings'; diff --git a/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_form/follower_index_form.js b/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_form/follower_index_form.js index 506946de609af..14ed354893e5d 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_form/follower_index_form.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_form/follower_index_form.js @@ -9,7 +9,7 @@ import React, { PureComponent, Fragment } from 'react'; import PropTypes from 'prop-types'; import { debounce } from 'lodash'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, diff --git a/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_form/follower_index_request_flyout.js b/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_form/follower_index_request_flyout.js index 91bc35671ea8e..116d26d838e80 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_form/follower_index_request_flyout.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_form/follower_index_request_flyout.js @@ -6,7 +6,7 @@ */ import React, { PureComponent } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import PropTypes from 'prop-types'; import { diff --git a/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_page_title.js b/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_page_title.js index 6d523cf2c470f..4a7fd5a6e83dd 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_page_title.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/components/follower_index_page_title.js @@ -7,7 +7,7 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiSpacer, EuiPageHeader, EuiButtonEmpty } from '@elastic/eui'; diff --git a/x-pack/plugins/cross_cluster_replication/public/app/components/form_entry_row.js b/x-pack/plugins/cross_cluster_replication/public/app/components/form_entry_row.js index 69fb1a54bec1e..a544d4ed2b2e3 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/components/form_entry_row.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/components/form_entry_row.js @@ -7,7 +7,7 @@ import React, { PureComponent, Fragment } from 'react'; import PropTypes from 'prop-types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, diff --git a/x-pack/plugins/cross_cluster_replication/public/app/components/remote_clusters_form_field.js b/x-pack/plugins/cross_cluster_replication/public/app/components/remote_clusters_form_field.js index 4e173618b1192..31e70e46c8575 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/components/remote_clusters_form_field.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/components/remote_clusters_form_field.js @@ -7,7 +7,7 @@ import React, { Fragment, PureComponent } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiButtonEmpty, diff --git a/x-pack/plugins/cross_cluster_replication/public/app/sections/auto_follow_pattern_add/auto_follow_pattern_add.js b/x-pack/plugins/cross_cluster_replication/public/app/sections/auto_follow_pattern_add/auto_follow_pattern_add.js index 118e3103008d0..0d7a3c7c9a3b3 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/sections/auto_follow_pattern_add/auto_follow_pattern_add.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/sections/auto_follow_pattern_add/auto_follow_pattern_add.js @@ -7,7 +7,7 @@ import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiPageContentBody, EuiPageContent } from '@elastic/eui'; import { listBreadcrumb, addBreadcrumb, setBreadcrumbs } from '../../services/breadcrumbs'; diff --git a/x-pack/plugins/cross_cluster_replication/public/app/sections/auto_follow_pattern_edit/auto_follow_pattern_edit.js b/x-pack/plugins/cross_cluster_replication/public/app/sections/auto_follow_pattern_edit/auto_follow_pattern_edit.js index fa97b28c8b472..ac568a233e7c1 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/sections/auto_follow_pattern_edit/auto_follow_pattern_edit.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/sections/auto_follow_pattern_edit/auto_follow_pattern_edit.js @@ -8,7 +8,7 @@ import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiPageContent, EuiEmptyPrompt, EuiPageContentBody } from '@elastic/eui'; diff --git a/x-pack/plugins/cross_cluster_replication/public/app/sections/follower_index_add/follower_index_add.js b/x-pack/plugins/cross_cluster_replication/public/app/sections/follower_index_add/follower_index_add.js index 325c23641580c..f7d2d7e93fd81 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/sections/follower_index_add/follower_index_add.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/sections/follower_index_add/follower_index_add.js @@ -7,7 +7,7 @@ import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiPageContentBody, EuiPageContent } from '@elastic/eui'; import { setBreadcrumbs, listBreadcrumb, addBreadcrumb } from '../../services/breadcrumbs'; diff --git a/x-pack/plugins/cross_cluster_replication/public/app/sections/follower_index_edit/follower_index_edit.js b/x-pack/plugins/cross_cluster_replication/public/app/sections/follower_index_edit/follower_index_edit.js index 618d97f186516..ffec09844326d 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/sections/follower_index_edit/follower_index_edit.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/sections/follower_index_edit/follower_index_edit.js @@ -8,7 +8,7 @@ import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, diff --git a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/auto_follow_pattern_list/auto_follow_pattern_list.js b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/auto_follow_pattern_list/auto_follow_pattern_list.js index 4d7eb107ea24b..3921fee1b12e0 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/auto_follow_pattern_list/auto_follow_pattern_list.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/auto_follow_pattern_list/auto_follow_pattern_list.js @@ -8,7 +8,7 @@ import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiPageContent, EuiButton, EuiEmptyPrompt, EuiText, EuiSpacer } from '@elastic/eui'; import { reactRouterNavigate } from '../../../../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/auto_follow_pattern_list/components/auto_follow_pattern_table/auto_follow_pattern_table.js b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/auto_follow_pattern_list/components/auto_follow_pattern_table/auto_follow_pattern_table.js index 6873c4f2920f6..1776e06cea8df 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/auto_follow_pattern_list/components/auto_follow_pattern_table/auto_follow_pattern_table.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/auto_follow_pattern_list/components/auto_follow_pattern_table/auto_follow_pattern_table.js @@ -8,7 +8,7 @@ import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiInMemoryTable, diff --git a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/auto_follow_pattern_list/components/detail_panel/detail_panel.js b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/auto_follow_pattern_list/components/detail_panel/detail_panel.js index a83da7e08cdfd..aa7bc965465c6 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/auto_follow_pattern_list/components/detail_panel/detail_panel.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/auto_follow_pattern_list/components/detail_panel/detail_panel.js @@ -7,7 +7,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import moment from 'moment'; import { getIndexListUri } from '../../../../../../../../../plugins/index_management/public'; diff --git a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/components/context_menu/context_menu.js b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/components/context_menu/context_menu.js index 866afa3e6e6dc..654ddf9d9125c 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/components/context_menu/context_menu.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/components/context_menu/context_menu.js @@ -6,7 +6,7 @@ */ import React, { PureComponent, Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import PropTypes from 'prop-types'; import { EuiButton, diff --git a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/components/detail_panel/detail_panel.js b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/components/detail_panel/detail_panel.js index 0c5883471e98c..5d5d29e4cdba4 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/components/detail_panel/detail_panel.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/components/detail_panel/detail_panel.js @@ -7,7 +7,7 @@ import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiButtonEmpty, diff --git a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/components/follower_indices_table/follower_indices_table.js b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/components/follower_indices_table/follower_indices_table.js index c3ae1678c3055..c0a05f1d86c5b 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/components/follower_indices_table/follower_indices_table.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/components/follower_indices_table/follower_indices_table.js @@ -8,7 +8,7 @@ import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiHealth, EuiButton, diff --git a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/follower_indices_list.js b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/follower_indices_list.js index 4b593799f5933..072e081de8df8 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/follower_indices_list.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/follower_indices_list/follower_indices_list.js @@ -8,7 +8,7 @@ import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiPageContent, EuiButton, EuiEmptyPrompt, EuiText, EuiSpacer } from '@elastic/eui'; import { reactRouterNavigate } from '../../../../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/home.js b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/home.js index 70d35dcb22569..662ffd108e2ee 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/sections/home/home.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/sections/home/home.js @@ -7,7 +7,7 @@ import React, { PureComponent } from 'react'; import { Route, Switch } from 'react-router-dom'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiSpacer, EuiPageHeader } from '@elastic/eui'; diff --git a/x-pack/plugins/cross_cluster_replication/public/app/services/auto_follow_pattern_validators.js b/x-pack/plugins/cross_cluster_replication/public/app/services/auto_follow_pattern_validators.js index a876e231e8615..d7fda8dc25aca 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/services/auto_follow_pattern_validators.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/services/auto_follow_pattern_validators.js @@ -7,7 +7,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { indexPatterns } from '../../../../../../src/plugins/data/public'; import { indices } from '../../shared_imports'; diff --git a/x-pack/plugins/cross_cluster_replication/public/app/services/input_validation.js b/x-pack/plugins/cross_cluster_replication/public/app/services/input_validation.js index 18810d28794da..143542fb2d59e 100644 --- a/x-pack/plugins/cross_cluster_replication/public/app/services/input_validation.js +++ b/x-pack/plugins/cross_cluster_replication/public/app/services/input_validation.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { indices } from '../../shared_imports'; diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/__mocks__/index.tsx b/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/__mocks__/index.tsx index d21b72b85f8d5..7c089c8db9634 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/__mocks__/index.tsx +++ b/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/__mocks__/index.tsx @@ -6,7 +6,7 @@ */ import React, { ReactNode } from 'react'; -import { __IntlProvider as IntlProvider } from '@kbn/i18n/react'; +import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; export function LocaleWrapper({ children }: { children?: ReactNode }) { return {children}; diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/delete_button.tsx b/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/delete_button.tsx index ebb6a9bdde489..3d1a3052e720b 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/delete_button.tsx +++ b/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/delete_button.tsx @@ -7,7 +7,7 @@ import { EuiConfirmModal } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useState } from 'react'; import { CoreStart } from 'kibana/public'; import { toMountPoint } from '../../../../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/extend_button.tsx b/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/extend_button.tsx index 47878972403e2..6989caeca359e 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/extend_button.tsx +++ b/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/extend_button.tsx @@ -7,7 +7,7 @@ import { EuiConfirmModal } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useState } from 'react'; import moment from 'moment'; import { CoreStart } from 'kibana/public'; diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/inspect_button.tsx b/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/inspect_button.tsx index 2272e4925ef8d..23c010e0fbc67 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/inspect_button.tsx +++ b/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/inspect_button.tsx @@ -6,7 +6,7 @@ */ import { EuiFlyoutBody, EuiFlyoutHeader, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { Fragment } from 'react'; import { CoreStart } from 'kibana/public'; import { UISession } from '../../types'; diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/rename_button.tsx b/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/rename_button.tsx index 99639e86c123d..beb773e057cb9 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/rename_button.tsx +++ b/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/actions/rename_button.tsx @@ -18,7 +18,7 @@ import { EuiModalHeaderTitle, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useState } from 'react'; import { CoreStart } from 'kibana/public'; import { SearchSessionsMgmtAPI } from '../../lib/api'; diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/main.tsx b/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/main.tsx index e82ab2bbb7043..8d83b9ab60138 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/main.tsx +++ b/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/main.tsx @@ -6,7 +6,7 @@ */ import { EuiButtonEmpty, EuiPageHeader, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { CoreStart, HttpStart } from 'kibana/public'; import React from 'react'; import type { SessionsConfigSchema } from '../'; diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/table/table.tsx b/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/table/table.tsx index 803a5f9c10273..4d08994ceb045 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/table/table.tsx +++ b/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/components/table/table.tsx @@ -6,7 +6,7 @@ */ import { EuiButton, EuiInMemoryTable, EuiSearchBarProps } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { CoreStart } from 'kibana/public'; import moment from 'moment'; import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; diff --git a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/get_columns.tsx b/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/get_columns.tsx index 865a2c9754747..4573a21dd9a4d 100644 --- a/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/get_columns.tsx +++ b/x-pack/plugins/data_enhanced/public/search/sessions_mgmt/lib/get_columns.tsx @@ -16,7 +16,7 @@ import { EuiToolTip, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { CoreStart } from 'kibana/public'; import { capitalize } from 'lodash'; import React from 'react'; diff --git a/x-pack/plugins/data_enhanced/public/search/ui/connected_search_session_indicator/connected_search_session_indicator.test.tsx b/x-pack/plugins/data_enhanced/public/search/ui/connected_search_session_indicator/connected_search_session_indicator.test.tsx index 2fcdd8a7a6745..6e9b06ad36df7 100644 --- a/x-pack/plugins/data_enhanced/public/search/ui/connected_search_session_indicator/connected_search_session_indicator.test.tsx +++ b/x-pack/plugins/data_enhanced/public/search/ui/connected_search_session_indicator/connected_search_session_indicator.test.tsx @@ -22,7 +22,7 @@ import { import { coreMock } from '../../../../../../../src/core/public/mocks'; import { TOUR_RESTORE_STEP_KEY, TOUR_TAKING_TOO_LONG_STEP_KEY } from './search_session_tour'; import userEvent from '@testing-library/user-event'; -import { __IntlProvider as IntlProvider } from '@kbn/i18n/react'; +import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; import { createSearchUsageCollectorMock } from '../../../../../../../src/plugins/data/public/search/collectors/mocks'; const coreStart = coreMock.createStart(); diff --git a/x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/components/search_session_name/search_session_name.tsx b/x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/components/search_session_name/search_session_name.tsx index a5088ab19ba38..4cb72dcbf4554 100644 --- a/x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/components/search_session_name/search_session_name.tsx +++ b/x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/components/search_session_name/search_session_name.tsx @@ -7,7 +7,7 @@ import React, { useEffect } from 'react'; import { EuiButtonEmpty, EuiButtonIcon, EuiFieldText, EuiFlexGroup, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; export interface SearchSessionNameProps { diff --git a/x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/search_session_indicator.test.tsx b/x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/search_session_indicator.test.tsx index 310379f90c789..69bd6931b6c5b 100644 --- a/x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/search_session_indicator.test.tsx +++ b/x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/search_session_indicator.test.tsx @@ -9,7 +9,7 @@ import React, { ReactNode } from 'react'; import { screen, render } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { SearchSessionIndicator } from './search_session_indicator'; -import { __IntlProvider as IntlProvider } from '@kbn/i18n/react'; +import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; import { SearchSessionState } from '../../../../../../../src/plugins/data/public'; function Container({ children }: { children?: ReactNode }) { diff --git a/x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/search_session_indicator.tsx b/x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/search_session_indicator.tsx index eb67a6c5889f0..205f04b07a944 100644 --- a/x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/search_session_indicator.tsx +++ b/x-pack/plugins/data_enhanced/public/search/ui/search_session_indicator/search_session_indicator.tsx @@ -20,7 +20,7 @@ import { EuiToolTip, } from '@elastic/eui'; import moment from 'moment'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { CheckInEmptyCircle, PartialClock } from './custom_icons'; import './search_session_indicator.scss'; diff --git a/x-pack/plugins/data_visualizer/kibana.json b/x-pack/plugins/data_visualizer/kibana.json index 81fc0a2fdfe02..8a4695cf08524 100644 --- a/x-pack/plugins/data_visualizer/kibana.json +++ b/x-pack/plugins/data_visualizer/kibana.json @@ -17,7 +17,7 @@ "maps", "home", "lens", - "indexPatternFieldEditor", + "dataViewFieldEditor", "customIntegrations" ], "requiredBundles": [ diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/_index.scss b/x-pack/plugins/data_visualizer/public/application/common/components/_index.scss index 02a8766b3d24c..232cb369a1d07 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/_index.scss +++ b/x-pack/plugins/data_visualizer/public/application/common/components/_index.scss @@ -1,3 +1,2 @@ -@import 'embedded_map/index'; @import 'stats_table/index'; @import 'top_values/top_values'; diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/combined_fields/combined_fields_form.tsx b/x-pack/plugins/data_visualizer/public/application/common/components/combined_fields/combined_fields_form.tsx index e77dc853fdc52..7ebc4476e0cba 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/combined_fields/combined_fields_form.tsx +++ b/x-pack/plugins/data_visualizer/public/application/common/components/combined_fields/combined_fields_form.tsx @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { Component } from 'react'; import { diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/combined_fields/geo_point.tsx b/x-pack/plugins/data_visualizer/public/application/common/components/combined_fields/geo_point.tsx index f6cfcc32e733a..24f933f015366 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/combined_fields/geo_point.tsx +++ b/x-pack/plugins/data_visualizer/public/application/common/components/combined_fields/geo_point.tsx @@ -7,7 +7,7 @@ import { i18n } from '@kbn/i18n'; import { debounce } from 'lodash'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { ChangeEvent, Component, Fragment } from 'react'; import { diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/document_count_content/total_count_header.tsx b/x-pack/plugins/data_visualizer/public/application/common/components/document_count_content/total_count_header.tsx index 387af8b695f94..2be544a49e05e 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/document_count_content/total_count_header.tsx +++ b/x-pack/plugins/data_visualizer/public/application/common/components/document_count_content/total_count_header.tsx @@ -6,7 +6,7 @@ */ import { EuiFlexItem, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; export const TotalCountHeader = ({ totalCount }: { totalCount: number }) => { diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/embedded_map/embedded_map.tsx b/x-pack/plugins/data_visualizer/public/application/common/components/embedded_map/embedded_map.tsx index cf357a462d9b3..6be247f5f39c9 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/embedded_map/embedded_map.tsx +++ b/x-pack/plugins/data_visualizer/public/application/common/components/embedded_map/embedded_map.tsx @@ -23,6 +23,7 @@ import { ViewMode, } from '../../../../../../../../src/plugins/embeddable/public'; import { useDataVisualizerKibana } from '../../../kibana_context'; +import './_embedded_map.scss'; export function EmbeddedMapComponent({ layerList, diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/examples_list/examples_list.tsx b/x-pack/plugins/data_visualizer/public/application/common/components/examples_list/examples_list.tsx index 1aa14a88a5248..c4792b314b6a6 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/examples_list/examples_list.tsx +++ b/x-pack/plugins/data_visualizer/public/application/common/components/examples_list/examples_list.tsx @@ -9,7 +9,7 @@ import React, { FC } from 'react'; import { EuiListGroup, EuiListGroupItem } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ExpandedRowFieldHeader } from '../stats_table/components/expanded_row_field_header'; import { ExpandedRowPanel } from '../stats_table/components/field_data_expanded_row/expanded_row_panel'; interface Props { diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/field_count_panel/field_count_panel.tsx b/x-pack/plugins/data_visualizer/public/application/common/components/field_count_panel/field_count_panel.tsx index ce98ecd2fa5c7..66db0afb8f895 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/field_count_panel/field_count_panel.tsx +++ b/x-pack/plugins/data_visualizer/public/application/common/components/field_count_panel/field_count_panel.tsx @@ -6,7 +6,7 @@ */ import { EuiFlexGroup, EuiFlexItem, EuiSwitch } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { FC } from 'react'; import type { MetricFieldsCountProps, diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/actions.ts b/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/actions.ts index 4c8949ca22224..8476e53b9143f 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/actions.ts +++ b/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/action_menu/actions.ts @@ -63,7 +63,7 @@ export function getActions( } // Allow to edit data view field - if (services.indexPatternFieldEditor?.userPermissions.editIndexPattern()) { + if (services.dataViewFieldEditor?.userPermissions.editIndexPattern()) { actions.push({ name: i18n.translate('xpack.dataVisualizer.index.dataGrid.editDataViewFieldTitle', { defaultMessage: 'Edit data view field', @@ -77,8 +77,8 @@ export function getActions( type: 'icon', icon: 'indexEdit', onClick: (item: FieldVisConfig) => { - actionFlyoutRef.current = services.indexPatternFieldEditor?.openEditor({ - ctx: { indexPattern }, + actionFlyoutRef.current = services.dataViewFieldEditor?.openEditor({ + ctx: { dataView: indexPattern }, fieldName: item.fieldName, onSave: refreshPage, }); @@ -101,8 +101,8 @@ export function getActions( return item.deletable === true; }, onClick: (item: FieldVisConfig) => { - actionFlyoutRef.current = services.indexPatternFieldEditor?.openDeleteModal({ - ctx: { indexPattern }, + actionFlyoutRef.current = services.dataViewFieldEditor?.openDeleteModal({ + ctx: { dataView: indexPattern }, fieldName: item.fieldName!, onDelete: refreshPage, }); diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/number_content_preview.tsx b/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/number_content_preview.tsx index 0e38be72b20a4..4992d70a1d4ad 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/number_content_preview.tsx +++ b/x-pack/plugins/data_visualizer/public/application/common/components/field_data_row/number_content_preview.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; import { FileBasedFieldVisConfig } from '../stats_table/types'; diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/filebeat_config_flyout/filebeat_config_flyout.tsx b/x-pack/plugins/data_visualizer/public/application/common/components/filebeat_config_flyout/filebeat_config_flyout.tsx index e43199fabf76c..2ecb4761f22f7 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/filebeat_config_flyout/filebeat_config_flyout.tsx +++ b/x-pack/plugins/data_visualizer/public/application/common/components/filebeat_config_flyout/filebeat_config_flyout.tsx @@ -6,7 +6,7 @@ */ import React, { FC, useState, useEffect } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlyout, EuiFlyoutFooter, diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/loading_indicator/loading_indicator.tsx b/x-pack/plugins/data_visualizer/public/application/common/components/loading_indicator/loading_indicator.tsx index 07733aaa54cc8..67b0d0805dbda 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/loading_indicator/loading_indicator.tsx +++ b/x-pack/plugins/data_visualizer/public/application/common/components/loading_indicator/loading_indicator.tsx @@ -9,7 +9,7 @@ import React, { FC, Fragment } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner, EuiSpacer, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const LoadingIndicator: FC = () => ( diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/multi_select_picker/multi_select_picker.tsx b/x-pack/plugins/data_visualizer/public/application/common/components/multi_select_picker/multi_select_picker.tsx index ff4701e22953f..8b95296b5f823 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/multi_select_picker/multi_select_picker.tsx +++ b/x-pack/plugins/data_visualizer/public/application/common/components/multi_select_picker/multi_select_picker.tsx @@ -16,7 +16,7 @@ import { EuiSpacer, } from '@elastic/eui'; import React, { FC, ReactNode, useEffect, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export interface Option { name?: string | ReactNode; diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/not_in_docs_content/not_in_docs_context.tsx b/x-pack/plugins/data_visualizer/public/application/common/components/not_in_docs_content/not_in_docs_context.tsx index 3ad4c445eb756..f047518a81665 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/not_in_docs_content/not_in_docs_context.tsx +++ b/x-pack/plugins/data_visualizer/public/application/common/components/not_in_docs_content/not_in_docs_context.tsx @@ -8,7 +8,7 @@ import React, { FC, Fragment } from 'react'; import { EuiIcon, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const NotInDocsContent: FC = () => ( diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/results_links/results_links.tsx b/x-pack/plugins/data_visualizer/public/application/common/components/results_links/results_links.tsx index ed6ab29748a86..3a24364e57c36 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/results_links/results_links.tsx +++ b/x-pack/plugins/data_visualizer/public/application/common/components/results_links/results_links.tsx @@ -7,7 +7,7 @@ import React, { FC, useState, useEffect } from 'react'; import moment from 'moment'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, EuiCard, EuiIcon } from '@elastic/eui'; import { DISCOVER_APP_URL_GENERATOR, diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_count_stats/metric_fields_count.tsx b/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_count_stats/metric_fields_count.tsx index 3b1dbf0c6376d..ebfba7d79b25a 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_count_stats/metric_fields_count.tsx +++ b/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_count_stats/metric_fields_count.tsx @@ -6,7 +6,7 @@ */ import { EuiFlexGroup, EuiFlexItem, EuiNotificationBadge, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { FC } from 'react'; export interface MetricFieldsStats { diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_count_stats/total_fields_count.tsx b/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_count_stats/total_fields_count.tsx index 53aa84c09d3a7..ac91da964dd9b 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_count_stats/total_fields_count.tsx +++ b/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_count_stats/total_fields_count.tsx @@ -6,7 +6,7 @@ */ import { EuiFlexGroup, EuiFlexItem, EuiNotificationBadge, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { FC } from 'react'; export interface TotalFieldsStats { diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/boolean_content.tsx b/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/boolean_content.tsx index f4060bc16a39c..907bc6166afff 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/boolean_content.tsx +++ b/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/boolean_content.tsx @@ -15,7 +15,7 @@ import { } from '@elastic/eui'; import { Axis, BarSeries, Chart, Settings, ScaleType } from '@elastic/charts'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import type { FieldDataRowProps } from '../../types/field_data_row'; import { ExpandedRowFieldHeader } from '../expanded_row_field_header'; diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/choropleth_map.tsx b/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/choropleth_map.tsx index 9192ea85d5868..507bfc36d47f0 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/choropleth_map.tsx +++ b/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/choropleth_map.tsx @@ -8,7 +8,7 @@ import React, { FC, useMemo } from 'react'; import { EuiSpacer, EuiText, htmlIdGenerator } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { FIELD_ORIGIN, LAYER_TYPE, diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/date_content.tsx b/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/date_content.tsx index 352782b4bb301..98370dabb1f0a 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/date_content.tsx +++ b/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/date_content.tsx @@ -9,7 +9,7 @@ import React, { FC, ReactNode } from 'react'; import { EuiBasicTable, HorizontalAlignment, LEFT_ALIGNMENT, RIGHT_ALIGNMENT } from '@elastic/eui'; // @ts-ignore import { formatDate } from '@elastic/eui/lib/services/format'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import type { FieldDataRowProps } from '../../types/field_data_row'; diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/document_stats.tsx b/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/document_stats.tsx index 9805514365903..0790d1d8c4b81 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/document_stats.tsx +++ b/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/document_stats.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { FC, ReactNode } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiBasicTable, HorizontalAlignment, LEFT_ALIGNMENT, RIGHT_ALIGNMENT } from '@elastic/eui'; diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/error_message.tsx b/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/error_message.tsx index 1d4a685457e25..e03bbb7361f23 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/error_message.tsx +++ b/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/error_message.tsx @@ -6,7 +6,7 @@ */ import { EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { DVErrorObject } from '../../../../../index_data_visualizer/utils/error_utils'; diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/number_content.tsx b/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/number_content.tsx index 23f3d35b703be..20d5434644793 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/number_content.tsx +++ b/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/number_content.tsx @@ -15,7 +15,7 @@ import { RIGHT_ALIGNMENT, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import type { FieldDataRowProps } from '../../types/field_data_row'; import { kibanaFieldFormat, numberAsOrdinal } from '../../../utils'; diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/text_content.tsx b/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/text_content.tsx index 4fc73f0831dfc..c1de8ce01eb54 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/text_content.tsx +++ b/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/text_content.tsx @@ -8,7 +8,7 @@ import React, { FC, Fragment } from 'react'; import { EuiCallOut, EuiSpacer, EuiFlexItem } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import type { FieldDataRowProps } from '../../types/field_data_row'; diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/metric_distribution_chart/metric_distribution_chart_tooltip_header.tsx b/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/metric_distribution_chart/metric_distribution_chart_tooltip_header.tsx index fd3bcdf4fb79b..e6ef32f090e45 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/metric_distribution_chart/metric_distribution_chart_tooltip_header.tsx +++ b/x-pack/plugins/data_visualizer/public/application/common/components/stats_table/components/metric_distribution_chart/metric_distribution_chart_tooltip_header.tsx @@ -7,7 +7,7 @@ import React, { FC } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { MetricDistributionChartData } from './metric_distribution_chart'; import { kibanaFieldFormat } from '../../../utils'; diff --git a/x-pack/plugins/data_visualizer/public/application/common/components/top_values/top_values.tsx b/x-pack/plugins/data_visualizer/public/application/common/components/top_values/top_values.tsx index 59ba70d00a5a6..bf12b7ecf33fc 100644 --- a/x-pack/plugins/data_visualizer/public/application/common/components/top_values/top_values.tsx +++ b/x-pack/plugins/data_visualizer/public/application/common/components/top_values/top_values.tsx @@ -15,7 +15,7 @@ import { EuiButtonIcon, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import classNames from 'classnames'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/about_panel/about_panel.tsx b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/about_panel/about_panel.tsx index a176450250ba9..ae8cf78955bde 100644 --- a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/about_panel/about_panel.tsx +++ b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/about_panel/about_panel.tsx @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { FC } from 'react'; import { diff --git a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/about_panel/welcome_content.tsx b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/about_panel/welcome_content.tsx index 13120b2b46dbe..3a162a805f9ae 100644 --- a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/about_panel/welcome_content.tsx +++ b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/about_panel/welcome_content.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { FC } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui'; diff --git a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/analysis_summary/analysis_summary.tsx b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/analysis_summary/analysis_summary.tsx index 2fd4151f71ecf..6d06f3dee530a 100644 --- a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/analysis_summary/analysis_summary.tsx +++ b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/analysis_summary/analysis_summary.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { FC } from 'react'; import { EuiTitle, EuiSpacer, EuiDescriptionList } from '@elastic/eui'; diff --git a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/bottom_bar/bottom_bar.tsx b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/bottom_bar/bottom_bar.tsx index fb8ba63af36dc..b19c02669f818 100644 --- a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/bottom_bar/bottom_bar.tsx +++ b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/bottom_bar/bottom_bar.tsx @@ -6,7 +6,7 @@ */ import React, { FC } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiBottomBar, EuiButton, diff --git a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/edit_flyout/edit_flyout.js b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/edit_flyout/edit_flyout.js index 7ffaf7a4e216e..b6b9ac1b299e3 100644 --- a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/edit_flyout/edit_flyout.js +++ b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/edit_flyout/edit_flyout.js @@ -5,7 +5,7 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { Component } from 'react'; import { diff --git a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/edit_flyout/overrides.js b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/edit_flyout/overrides.js index b7eb790d2cf4e..69f755889edd0 100644 --- a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/edit_flyout/overrides.js +++ b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/edit_flyout/overrides.js @@ -5,7 +5,7 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import React, { Component } from 'react'; diff --git a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/explanation_flyout/explanation_flyout.tsx b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/explanation_flyout/explanation_flyout.tsx index 9898dd53ec66a..dd9c2a8331079 100644 --- a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/explanation_flyout/explanation_flyout.tsx +++ b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/explanation_flyout/explanation_flyout.tsx @@ -6,7 +6,7 @@ */ import React, { FC } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlyout, EuiFlyoutFooter, diff --git a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/file_contents/file_contents.tsx b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/file_contents/file_contents.tsx index 9588cad9f72f7..ed0ccefbf7b13 100644 --- a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/file_contents/file_contents.tsx +++ b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/file_contents/file_contents.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { FC } from 'react'; import { EuiTitle, EuiSpacer } from '@elastic/eui'; diff --git a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/file_data_visualizer_view/file_data_visualizer_view.js b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/file_data_visualizer_view/file_data_visualizer_view.js index fa437cce29268..9a6507d01067a 100644 --- a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/file_data_visualizer_view/file_data_visualizer_view.js +++ b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/file_data_visualizer_view/file_data_visualizer_view.js @@ -5,7 +5,7 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { Component } from 'react'; import { EuiSpacer } from '@elastic/eui'; diff --git a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/file_data_visualizer_view/file_error_callouts.tsx b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/file_data_visualizer_view/file_error_callouts.tsx index 12e92f2936fff..9daac8604d661 100644 --- a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/file_data_visualizer_view/file_error_callouts.tsx +++ b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/file_data_visualizer_view/file_error_callouts.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { FC } from 'react'; import { EuiCallOut, EuiSpacer, EuiButtonEmpty, EuiHorizontalRule } from '@elastic/eui'; diff --git a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_errors/errors.tsx b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_errors/errors.tsx index 4a871a4c98ec6..20f01a82ebcdc 100644 --- a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_errors/errors.tsx +++ b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_errors/errors.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { FC } from 'react'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_progress/import_progress.tsx b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_progress/import_progress.tsx index 2950a7ca9ed88..ab0b3f8ff56e6 100644 --- a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_progress/import_progress.tsx +++ b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_progress/import_progress.tsx @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { FC } from 'react'; import { EuiStepsHorizontal, EuiProgress, EuiSpacer } from '@elastic/eui'; diff --git a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_settings/advanced.tsx b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_settings/advanced.tsx index 23ad2b967bc28..848c068fcf21b 100644 --- a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_settings/advanced.tsx +++ b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_settings/advanced.tsx @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { FC } from 'react'; import { diff --git a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_settings/create_data_view_tooltip.tsx b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_settings/create_data_view_tooltip.tsx index 84af5b08b3d49..f6fac9b61843b 100644 --- a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_settings/create_data_view_tooltip.tsx +++ b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_settings/create_data_view_tooltip.tsx @@ -6,7 +6,7 @@ */ import React, { FC } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiToolTip } from '@elastic/eui'; interface Props { diff --git a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_settings/simple.tsx b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_settings/simple.tsx index a080f62f54fc1..8fada751ac17c 100644 --- a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_settings/simple.tsx +++ b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_settings/simple.tsx @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { FC } from 'react'; import { EuiFieldText, EuiFormRow, EuiCheckbox, EuiSpacer } from '@elastic/eui'; diff --git a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_summary/failures.tsx b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_summary/failures.tsx index 184403ce22893..fe9d23d3b4c12 100644 --- a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_summary/failures.tsx +++ b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_summary/failures.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { Component } from 'react'; import { EuiAccordion, EuiPagination } from '@elastic/eui'; diff --git a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_summary/import_summary.tsx b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_summary/import_summary.tsx index fd4f956f9f69f..a35dd95135bc5 100644 --- a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_summary/import_summary.tsx +++ b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_summary/import_summary.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { FC } from 'react'; import { EuiSpacer, EuiDescriptionList, EuiCallOut } from '@elastic/eui'; diff --git a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_view/import_view.js b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_view/import_view.js index b65e2c35ff4ff..ebc323099c7a2 100644 --- a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_view/import_view.js +++ b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/import_view/import_view.js @@ -5,7 +5,7 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { Component } from 'react'; import { diff --git a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/results_view/results_view.tsx b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/results_view/results_view.tsx index ed2743fcc41d6..0670a87cd9830 100644 --- a/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/results_view/results_view.tsx +++ b/x-pack/plugins/data_visualizer/public/application/file_data_visualizer/components/results_view/results_view.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { FC } from 'react'; import { diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx index 186d3ef840c21..2d086ab5ae700 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/actions_panel/actions_panel.tsx @@ -7,7 +7,7 @@ import React, { FC, useState, useEffect } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiSpacer, EuiTitle } from '@elastic/eui'; import { diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.tsx b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.tsx index ebddd5527f5a2..084dcd139f9bf 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.tsx +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/full_time_range_selector/full_time_range_selector.tsx @@ -6,7 +6,7 @@ */ import React, { FC } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Query, IndexPattern, TimefilterContract } from 'src/plugins/data/public'; import { EuiButton } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx index f528d8378bcd2..7e6ae7de011dc 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx @@ -20,7 +20,7 @@ import { EuiTitle, } from '@elastic/eui'; import { EuiTableActionsColumnType } from '@elastic/eui/src/components/basic_table/table_types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Required } from 'utility-types'; import { i18n } from '@kbn/i18n'; import { Filter } from '@kbn/es-query'; diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_pattern_management/index_pattern_management.tsx b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_pattern_management/index_pattern_management.tsx index ade16e61050bc..eb3c5d278e94a 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_pattern_management/index_pattern_management.tsx +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/index_pattern_management/index_pattern_management.tsx @@ -27,12 +27,11 @@ export function DataVisualizerIndexPatternManagement( props: DataVisualizerIndexPatternManagementProps ) { const { - services: { indexPatternFieldEditor, application }, + services: { dataViewFieldEditor, application }, } = useDataVisualizerKibana(); const { useNewFieldsApi, currentIndexPattern } = props; - const indexPatternFieldEditPermission = - indexPatternFieldEditor?.userPermissions.editIndexPattern(); + const indexPatternFieldEditPermission = dataViewFieldEditor?.userPermissions.editIndexPattern(); const canEditIndexPatternField = !!indexPatternFieldEditPermission && useNewFieldsApi; const [isAddIndexPatternFieldPopoverOpen, setIsAddIndexPatternFieldPopoverOpen] = useState(false); @@ -46,14 +45,14 @@ export function DataVisualizerIndexPatternManagement( }; }, []); - if (indexPatternFieldEditor === undefined || !currentIndexPattern || !canEditIndexPatternField) { + if (dataViewFieldEditor === undefined || !currentIndexPattern || !canEditIndexPatternField) { return null; } const addField = () => { - closeFieldEditor.current = indexPatternFieldEditor.openEditor({ + closeFieldEditor.current = dataViewFieldEditor.openEditor({ ctx: { - indexPattern: currentIndexPattern, + dataView: currentIndexPattern, }, onSave: () => { const refresh: Refresh = { diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/shard_size_select.tsx b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/shard_size_select.tsx index 85f3d2b596105..4364a3f236a80 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/shard_size_select.tsx +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/components/search_panel/shard_size_select.tsx @@ -8,7 +8,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiIconTip, EuiSuperSelect } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React, { FC } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; interface Props { samplerShardSize: number; diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/embeddables/grid_embeddable/grid_embeddable.tsx b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/embeddables/grid_embeddable/grid_embeddable.tsx index 0391d5ae5d5d5..32dc19078e9ab 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/embeddables/grid_embeddable/grid_embeddable.tsx +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/embeddables/grid_embeddable/grid_embeddable.tsx @@ -13,7 +13,7 @@ import useObservable from 'react-use/lib/useObservable'; import { EuiEmptyPrompt, EuiIcon, EuiSpacer, EuiText } from '@elastic/eui'; import { Filter } from '@kbn/es-query'; import { Required } from 'utility-types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Embeddable, EmbeddableInput, diff --git a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/index_data_visualizer.tsx b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/index_data_visualizer.tsx index 83e013703c1fc..0970938f8099f 100644 --- a/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/index_data_visualizer.tsx +++ b/x-pack/plugins/data_visualizer/public/application/index_data_visualizer/index_data_visualizer.tsx @@ -178,7 +178,7 @@ export const DataVisualizerUrlStateContextProvider: FC = ({ additionalLinks }) => { const coreStart = getCoreStart(); - const { data, maps, embeddable, share, security, fileUpload, lens, indexPatternFieldEditor } = + const { data, maps, embeddable, share, security, fileUpload, lens, dataViewFieldEditor } = getPluginsStart(); const services = { data, @@ -188,7 +188,7 @@ export const IndexDataVisualizer: FC<{ additionalLinks: ResultLink[] }> = ({ add security, fileUpload, lens, - indexPatternFieldEditor, + dataViewFieldEditor, ...coreStart, }; diff --git a/x-pack/plugins/data_visualizer/public/plugin.ts b/x-pack/plugins/data_visualizer/public/plugin.ts index dd1d2acccf8cd..e1c6acf5c65a8 100644 --- a/x-pack/plugins/data_visualizer/public/plugin.ts +++ b/x-pack/plugins/data_visualizer/public/plugin.ts @@ -17,7 +17,7 @@ import type { FileUploadPluginStart } from '../../file_upload/public'; import type { MapsStartApi } from '../../maps/public'; import type { SecurityPluginSetup } from '../../security/public'; import type { LensPublicStart } from '../../lens/public'; -import type { IndexPatternFieldEditorStart } from '../../../../src/plugins/index_pattern_field_editor/public'; +import type { IndexPatternFieldEditorStart } from '../../../../src/plugins/data_view_field_editor/public'; import { getFileDataVisualizerComponent, getIndexDataVisualizerComponent } from './api'; import { getMaxBytesFormatted } from './application/common/util/get_max_bytes'; import { registerHomeAddData, registerHomeFeatureCatalogue } from './register_home'; @@ -36,7 +36,7 @@ export interface DataVisualizerStartDependencies { security?: SecurityPluginSetup; share: SharePluginStart; lens?: LensPublicStart; - indexPatternFieldEditor?: IndexPatternFieldEditorStart; + dataViewFieldEditor?: IndexPatternFieldEditorStart; fieldFormats: FieldFormatsStart; } diff --git a/x-pack/plugins/enterprise_search/common/__mocks__/initial_app_data.ts b/x-pack/plugins/enterprise_search/common/__mocks__/initial_app_data.ts index aa3020a9577f9..dd6dd58d02f70 100644 --- a/x-pack/plugins/enterprise_search/common/__mocks__/initial_app_data.ts +++ b/x-pack/plugins/enterprise_search/common/__mocks__/initial_app_data.ts @@ -6,6 +6,8 @@ */ export const DEFAULT_INITIAL_APP_DATA = { + kibanaVersion: '7.16.0', + enterpriseSearchVersion: '7.16.0', readOnlyMode: false, searchOAuth: { clientId: 'someUID', diff --git a/x-pack/plugins/enterprise_search/common/is_version_mismatch/index.test.ts b/x-pack/plugins/enterprise_search/common/is_version_mismatch/index.test.ts new file mode 100644 index 0000000000000..4cd7ceef0b758 --- /dev/null +++ b/x-pack/plugins/enterprise_search/common/is_version_mismatch/index.test.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { isVersionMismatch } from './index'; + +describe('isVersionMismatch', () => { + it('no mismatch if major and minor are the same', () => { + expect(isVersionMismatch('8.0.0', '8.0.1')).toBe(false); + }); + + it('mismatch if kibana minor is different than enterprise search minor', () => { + expect(isVersionMismatch('8.0.0', '8.1.0')).toBe(true); + }); + + it('mismatch if major is different', () => { + expect(isVersionMismatch('7.0.0', '8.0.0')).toBe(true); + }); + + it('no mismatch if versions are not available to analyze', () => { + expect(isVersionMismatch()).toBe(false); + }); +}); diff --git a/x-pack/plugins/enterprise_search/common/is_version_mismatch/index.ts b/x-pack/plugins/enterprise_search/common/is_version_mismatch/index.ts new file mode 100644 index 0000000000000..4147b17feefa5 --- /dev/null +++ b/x-pack/plugins/enterprise_search/common/is_version_mismatch/index.ts @@ -0,0 +1,15 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export const isVersionMismatch = (enterpriseSearchVersion?: string, kibanaVersion?: string) => { + // Don't consider it a mismatch unless we know for certain it is + if (!enterpriseSearchVersion || !kibanaVersion) return false; + const [enterpriseSearchMajor, enterpriseSearchMinor] = enterpriseSearchVersion.split('.'); + const [kibanaMajor, kibanaMinor] = kibanaVersion.split('.'); + if (enterpriseSearchMajor !== kibanaMajor || enterpriseSearchMinor !== kibanaMinor) return true; + return false; +}; diff --git a/x-pack/plugins/enterprise_search/common/types/index.ts b/x-pack/plugins/enterprise_search/common/types/index.ts index 8addf17f97476..57fe3f3807783 100644 --- a/x-pack/plugins/enterprise_search/common/types/index.ts +++ b/x-pack/plugins/enterprise_search/common/types/index.ts @@ -15,6 +15,8 @@ import { } from './workplace_search'; export interface InitialAppData { + enterpriseSearchVersion?: string; + kibanaVersion?: string; readOnlyMode?: boolean; searchOAuth?: SearchOAuth; configuredLimits?: ConfiguredLimits; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/components/api_logs_table.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/components/api_logs_table.test.tsx index 82d3d4715cbc5..55d1bb1198fda 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/components/api_logs_table.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/components/api_logs_table.test.tsx @@ -9,8 +9,8 @@ import { setMockValues, setMockActions } from '../../../../__mocks__/kea_logic'; // NOTE: We're mocking FormattedRelative here because it (currently) has // console warn issues, and it allows us to skip mocking dates -jest.mock('@kbn/i18n/react', () => ({ - ...(jest.requireActual('@kbn/i18n/react') as object), +jest.mock('@kbn/i18n-react', () => ({ + ...(jest.requireActual('@kbn/i18n-react') as object), FormattedRelative: jest.fn(() => '20 hours ago'), })); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/components/api_logs_table.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/components/api_logs_table.tsx index d5bb525cfd332..ed930695c1e2d 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/components/api_logs_table.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/api_logs/components/api_logs_table.tsx @@ -17,7 +17,7 @@ import { EuiButtonEmpty, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedRelative } from '@kbn/i18n/react'; +import { FormattedRelative } from '@kbn/i18n-react'; import { convertMetaToPagination, handlePageChange } from '../../../../shared/table_pagination'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/add_domain_form.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/add_domain_form.test.tsx index 636615404d0fc..f653ed801ac83 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/add_domain_form.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/add_domain_form.test.tsx @@ -13,7 +13,7 @@ import { shallow, ShallowWrapper } from 'enzyme'; import { EuiButton, EuiFieldText, EuiForm } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { rerender } from '../../../../../test_helpers'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/add_domain_form.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/add_domain_form.tsx index 493e319c29b74..6e0f18597db33 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/add_domain_form.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/add_domain/add_domain_form.tsx @@ -22,7 +22,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { AddDomainLogic } from './add_domain_logic'; import { AddDomainValidation } from './add_domain_validation'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_details_flyout/crawl_details_flyout.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_details_flyout/crawl_details_flyout.test.tsx new file mode 100644 index 0000000000000..1810b05a938da --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_details_flyout/crawl_details_flyout.test.tsx @@ -0,0 +1,130 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { setMockActions, setMockValues } from '../../../../../__mocks__/kea_logic'; +import '../../../../__mocks__/engine_logic.mock'; + +import React from 'react'; + +import { shallow } from 'enzyme'; + +import { EuiCodeBlock, EuiFlyout, EuiTab, EuiTabs } from '@elastic/eui'; + +import { Loading } from '../../../../../shared/loading'; + +import { CrawlDetailActions, CrawlDetailValues } from '../../crawl_detail_logic'; +import { CrawlRequestWithDetailsFromServer } from '../../types'; + +import { CrawlDetailsPreview } from './crawl_details_preview'; + +import { CrawlDetailsFlyout } from '.'; + +const MOCK_VALUES: Partial = { + dataLoading: false, + flyoutClosed: false, + crawlRequestFromServer: {} as CrawlRequestWithDetailsFromServer, +}; + +const MOCK_ACTIONS: Partial = { + setSelectedTab: jest.fn(), +}; + +describe('CrawlDetailsFlyout', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('renders a flyout ', () => { + setMockValues(MOCK_VALUES); + + const wrapper = shallow(); + + expect(wrapper.is(EuiFlyout)).toBe(true); + }); + + it('contains a tab group to control displayed content inside the flyout', () => { + setMockActions(MOCK_ACTIONS); + setMockValues(MOCK_VALUES); + + const wrapper = shallow(); + const tabs = wrapper.find(EuiTabs).find(EuiTab); + + expect(tabs).toHaveLength(2); + + tabs.at(0).simulate('click'); + + expect(MOCK_ACTIONS.setSelectedTab).toHaveBeenCalledWith('preview'); + + tabs.at(1).simulate('click'); + + expect(MOCK_ACTIONS.setSelectedTab).toHaveBeenCalledWith('json'); + }); + + describe('when the preview tab is selected', () => { + beforeEach(() => { + setMockValues({ + ...MOCK_VALUES, + selectedTab: 'preview', + }); + }); + + it('shows the correct tab is selected in the UX', () => { + const wrapper = shallow(); + const tabs = wrapper.find(EuiTabs).find(EuiTab); + + expect(tabs.at(0).prop('isSelected')).toBe(true); + expect(tabs.at(1).prop('isSelected')).toBe(false); + }); + + it('shows the human readable version of the crawl details', () => { + const wrapper = shallow(); + + expect(wrapper.find(CrawlDetailsPreview)).toHaveLength(1); + }); + }); + + describe('when the json tab is selected', () => { + beforeEach(() => { + setMockValues({ + ...MOCK_VALUES, + selectedTab: 'json', + }); + }); + + it('shows the correct tab is selected in the UX', () => { + const wrapper = shallow(); + const tabs = wrapper.find(EuiTabs).find(EuiTab); + + expect(tabs.at(0).prop('isSelected')).toBe(false); + expect(tabs.at(1).prop('isSelected')).toBe(true); + }); + + it('shows the raw json of the crawl details', () => { + const wrapper = shallow(); + + expect(wrapper.find(EuiCodeBlock)).toHaveLength(1); + }); + }); + + it('renders a loading screen when loading', () => { + setMockValues({ ...MOCK_VALUES, dataLoading: true }); + + const wrapper = shallow(); + + expect(wrapper.is(EuiFlyout)).toBe(true); + expect(wrapper.find(Loading)).toHaveLength(1); + }); + + it('is empty when the flyout is hidden', () => { + setMockValues({ + flyoutClosed: true, + }); + + const wrapper = shallow(); + + expect(wrapper.isEmptyRender()).toBe(true); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_details_flyout/crawl_details_flyout.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_details_flyout/crawl_details_flyout.tsx new file mode 100644 index 0000000000000..8ecd861304458 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_details_flyout/crawl_details_flyout.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import React from 'react'; + +import { useActions, useValues } from 'kea'; + +import { + EuiFlyout, + EuiFlyoutHeader, + EuiTitle, + EuiFlyoutBody, + EuiCodeBlock, + EuiTab, + EuiTabs, +} from '@elastic/eui'; + +import { i18n } from '@kbn/i18n'; + +import { Loading } from '../../../../../shared/loading'; +import { CrawlDetailLogic } from '../../crawl_detail_logic'; + +import { CrawlDetailsPreview } from './crawl_details_preview'; + +export const CrawlDetailsFlyout: React.FC = () => { + const { closeFlyout, setSelectedTab } = useActions(CrawlDetailLogic); + const { crawlRequestFromServer, dataLoading, flyoutClosed, selectedTab } = + useValues(CrawlDetailLogic); + + if (flyoutClosed) { + return null; + } + + return ( + + + +

+ {i18n.translate('xpack.enterpriseSearch.appSearch.crawler.crawlDetailsFlyout.title', { + defaultMessage: 'Crawl request details', + })} +

+
+ + setSelectedTab('preview')}> + {i18n.translate( + 'xpack.enterpriseSearch.appSearch.crawler.crawlDetailsFlyout.previewTabLabel', + { + defaultMessage: 'Preview', + } + )} + + setSelectedTab('json')}> + {i18n.translate( + 'xpack.enterpriseSearch.appSearch.crawler.crawlDetailsFlyout.rawJSONTabLabel', + { + defaultMessage: 'Raw JSON', + } + )} + + +
+ + {dataLoading ? ( + + ) : ( + <> + {selectedTab === 'preview' && } + {selectedTab === 'json' && ( + + {JSON.stringify(crawlRequestFromServer, null, 2)} + + )} + + )} + +
+ ); +}; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_details_flyout/crawl_details_preview.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_details_flyout/crawl_details_preview.test.tsx new file mode 100644 index 0000000000000..d7c69e5445167 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_details_flyout/crawl_details_preview.test.tsx @@ -0,0 +1,20 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; + +import { shallow } from 'enzyme'; + +import { CrawlDetailsPreview } from './crawl_details_preview'; + +describe('CrawlDetailsPreview', () => { + it('is empty', () => { + const wrapper = shallow(); + + expect(wrapper.isEmptyRender()).toBe(true); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_details_flyout/crawl_details_preview.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_details_flyout/crawl_details_preview.tsx new file mode 100644 index 0000000000000..7fa95d920c17b --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_details_flyout/crawl_details_preview.tsx @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; + +export const CrawlDetailsPreview: React.FC = () => null; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_details_flyout/index.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_details_flyout/index.ts new file mode 100644 index 0000000000000..2a3327679b914 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_details_flyout/index.ts @@ -0,0 +1,8 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { CrawlDetailsFlyout } from './crawl_details_flyout'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_requests_table.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_requests_table.test.tsx index e9ff60e4b6082..bc5f8bf87e100 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_requests_table.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_requests_table.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { setMockValues } from '../../../../__mocks__/kea_logic'; +import { setMockActions, setMockValues } from '../../../../__mocks__/kea_logic'; import '../../../__mocks__/engine_logic.mock'; import React from 'react'; @@ -35,9 +35,26 @@ const values: { events: CrawlEvent[] } = { domainAllowlist: ['https://www.elastic.co'], }, }, + { + id: '54325423aef7890543', + status: CrawlerStatus.Success, + stage: 'process', + createdAt: 'Mon, 31 Aug 2020 17:00:00 +0000', + beganAt: null, + completedAt: null, + type: CrawlType.Full, + crawlConfig: { + domainAllowlist: ['https://www.elastic.co'], + }, + }, ], }; +const actions = { + fetchCrawlRequest: jest.fn(), + openFlyout: jest.fn(), +}; + describe('CrawlRequestsTable', () => { let wrapper: ShallowWrapper; let tableContent: string; @@ -48,6 +65,7 @@ describe('CrawlRequestsTable', () => { describe('columns', () => { beforeAll(() => { + setMockActions(actions); setMockValues(values); wrapper = shallow(); tableContent = mountWithIntl() @@ -55,8 +73,21 @@ describe('CrawlRequestsTable', () => { .text(); }); - it('renders an id column', () => { - expect(tableContent).toContain('618d0e66abe97bc688328900'); + it('renders a id column ', () => { + expect(tableContent).toContain('Request ID'); + + const table = wrapper.find(EuiBasicTable); + const columns = table.prop('columns'); + + const crawlID = shallow(columns[0].render('618d0e66abe97bc688328900', { stage: 'crawl' })); + expect(crawlID.text()).toContain('618d0e66abe97bc688328900'); + + crawlID.simulate('click'); + expect(actions.fetchCrawlRequest).toHaveBeenCalledWith('618d0e66abe97bc688328900'); + expect(actions.openFlyout).toHaveBeenCalled(); + + const processCrawlID = shallow(columns[0].render('54325423aef7890543', { stage: 'process' })); + expect(processCrawlID.text()).toContain('54325423aef7890543'); }); it('renders a created at column', () => { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_requests_table.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_requests_table.tsx index c066e734827a8..0949be0ced0a6 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_requests_table.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/components/crawl_requests_table.tsx @@ -7,73 +7,98 @@ import React from 'react'; -import { useValues } from 'kea'; +import { useActions, useValues } from 'kea'; -import { EuiBadge, EuiBasicTable, EuiBasicTableColumn, EuiEmptyPrompt } from '@elastic/eui'; +import { + EuiBadge, + EuiBasicTable, + EuiBasicTableColumn, + EuiEmptyPrompt, + EuiLink, +} from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { CrawlDetailLogic } from '../crawl_detail_logic'; import { CrawlerLogic } from '../crawler_logic'; import { CrawlEvent, readableCrawlerStatuses } from '../types'; import { CrawlEventTypeBadge } from './crawl_event_type_badge'; import { CustomFormattedTimestamp } from './custom_formatted_timestamp'; -const columns: Array> = [ - { - field: 'id', - name: i18n.translate( - 'xpack.enterpriseSearch.appSearch.crawler.crawlRequestsTable.column.domainURL', - { - defaultMessage: 'Request ID', - } - ), - }, - { - field: 'createdAt', - name: i18n.translate( - 'xpack.enterpriseSearch.appSearch.crawler.crawlRequestsTable.column.created', - { - defaultMessage: 'Created', - } - ), - render: (createdAt: CrawlEvent['createdAt']) => ( - - ), - }, - { - field: 'type', - name: i18n.translate( - 'xpack.enterpriseSearch.appSearch.crawler.crawlRequestsTable.column.crawlType', - { - defaultMessage: 'Crawl type', - } - ), - render: (_, event: CrawlEvent) => , - }, - { - name: i18n.translate( - 'xpack.enterpriseSearch.appSearch.crawler.crawlRequestsTable.column.domains', - { - defaultMessage: 'Domains', - } - ), - render: (event: CrawlEvent) => {event.crawlConfig.domainAllowlist.length}, - }, - { - field: 'status', - name: i18n.translate( - 'xpack.enterpriseSearch.appSearch.crawler.crawlRequestsTable.column.status', - { - defaultMessage: 'Status', - } - ), - render: (status: CrawlEvent['status']) => readableCrawlerStatuses[status], - }, -]; - export const CrawlRequestsTable: React.FC = () => { const { events } = useValues(CrawlerLogic); + const { fetchCrawlRequest, openFlyout } = useActions(CrawlDetailLogic); + + const columns: Array> = [ + { + field: 'id', + name: i18n.translate( + 'xpack.enterpriseSearch.appSearch.crawler.crawlRequestsTable.column.domainURL', + { + defaultMessage: 'Request ID', + } + ), + render: (id: string, event: CrawlEvent) => { + if (event.stage === 'crawl') { + return ( + { + fetchCrawlRequest(id); + openFlyout(); + }} + > + {id} + + ); + } + return {id}; + }, + }, + { + field: 'createdAt', + name: i18n.translate( + 'xpack.enterpriseSearch.appSearch.crawler.crawlRequestsTable.column.created', + { + defaultMessage: 'Created', + } + ), + render: (createdAt: CrawlEvent['createdAt']) => ( + + ), + }, + { + field: 'type', + name: i18n.translate( + 'xpack.enterpriseSearch.appSearch.crawler.crawlRequestsTable.column.crawlType', + { + defaultMessage: 'Crawl type', + } + ), + render: (_, event: CrawlEvent) => , + }, + { + name: i18n.translate( + 'xpack.enterpriseSearch.appSearch.crawler.crawlRequestsTable.column.domains', + { + defaultMessage: 'Domains', + } + ), + render: (event: CrawlEvent) => ( + {event.crawlConfig.domainAllowlist.length} + ), + }, + { + field: 'status', + name: i18n.translate( + 'xpack.enterpriseSearch.appSearch.crawler.crawlRequestsTable.column.status', + { + defaultMessage: 'Status', + } + ), + render: (status: CrawlEvent['status']) => readableCrawlerStatuses[status], + }, + ]; return ( { + const { mount } = new LogicMounter(CrawlDetailLogic); + const { http } = mockHttpValues; + + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('has expected default values', () => { + mount(); + expect(CrawlDetailLogic.values).toEqual(DEFAULT_VALUES); + }); + + describe('actions', () => { + describe('closeFlyout', () => { + it('closes the flyout', () => { + mount({ flyoutClosed: false }); + + CrawlDetailLogic.actions.closeFlyout(); + + expect(CrawlDetailLogic.values).toEqual({ + ...DEFAULT_VALUES, + flyoutClosed: true, + }); + }); + }); + + describe('onRecieveCrawlRequest', () => { + it('saves the crawl request and sets data loading to false', () => { + mount({ + dataLoading: true, + request: null, + }); + + CrawlDetailLogic.actions.onRecieveCrawlRequest(crawlRequestResponse); + + expect(CrawlDetailLogic.values).toEqual({ + ...DEFAULT_VALUES, + dataLoading: false, + crawlRequestFromServer: crawlRequestResponse, + crawlRequest: clientCrawlRequest, + }); + }); + }); + + describe('setSelectedTab', () => { + it('sets the select tab', () => { + mount({ + selectedTab: 'preview', + }); + + CrawlDetailLogic.actions.setSelectedTab('json'); + + expect(CrawlDetailLogic.values).toEqual({ + ...DEFAULT_VALUES, + selectedTab: 'json', + }); + }); + }); + + describe('openFlyout', () => { + it('opens the flyout and resets the selected tab', () => { + mount({ + flyoutClosed: true, + selectedTab: 'json', + }); + + CrawlDetailLogic.actions.openFlyout(); + + expect(CrawlDetailLogic.values).toEqual({ + ...DEFAULT_VALUES, + flyoutClosed: false, + selectedTab: 'preview', + }); + }); + }); + + describe('fetchCrawlRequest', () => { + it('sets loading to true', () => { + mount({ + dataLoading: false, + }); + + CrawlDetailLogic.actions.fetchCrawlRequest('12345'); + + expect(CrawlDetailLogic.values).toEqual({ + ...DEFAULT_VALUES, + dataLoading: true, + }); + }); + + it('updates logic with data that has been converted from server to client', async () => { + mount(); + jest.spyOn(CrawlDetailLogic.actions, 'onRecieveCrawlRequest'); + + http.get.mockReturnValueOnce(Promise.resolve(crawlRequestResponse)); + + CrawlDetailLogic.actions.fetchCrawlRequest('12345'); + await nextTick(); + + expect(http.get).toHaveBeenCalledWith( + '/internal/app_search/engines/some-engine/crawler/crawl_requests/12345' + ); + expect(CrawlDetailLogic.actions.onRecieveCrawlRequest).toHaveBeenCalledWith( + crawlRequestResponse + ); + }); + + itShowsServerErrorAsFlashMessage(http.get, () => { + mount(); + CrawlDetailLogic.actions.fetchCrawlRequest('12345'); + }); + }); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawl_detail_logic.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawl_detail_logic.ts new file mode 100644 index 0000000000000..46180ad7c3235 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawl_detail_logic.ts @@ -0,0 +1,99 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { kea, MakeLogicType } from 'kea'; + +import { flashAPIErrors } from '../../../shared/flash_messages'; + +import { HttpLogic } from '../../../shared/http'; +import { EngineLogic } from '../engine'; + +import { CrawlRequestWithDetails, CrawlRequestWithDetailsFromServer } from './types'; +import { crawlRequestWithDetailsServerToClient } from './utils'; + +type CrawlDetailFlyoutTabs = 'preview' | 'json'; + +export interface CrawlDetailValues { + crawlRequest: CrawlRequestWithDetails | null; + crawlRequestFromServer: CrawlRequestWithDetailsFromServer | null; + dataLoading: boolean; + flyoutClosed: boolean; + selectedTab: CrawlDetailFlyoutTabs; +} + +export interface CrawlDetailActions { + closeFlyout(): void; + fetchCrawlRequest(requestId: string): { requestId: string }; + onRecieveCrawlRequest(crawlRequestFromServer: CrawlRequestWithDetailsFromServer): { + crawlRequestFromServer: CrawlRequestWithDetailsFromServer; + }; + openFlyout(): void; + setSelectedTab(selectedTab: CrawlDetailFlyoutTabs): { selectedTab: CrawlDetailFlyoutTabs }; +} + +export const CrawlDetailLogic = kea>({ + path: ['enterprise_search', 'app_search', 'crawler', 'crawl_detail_logic'], + actions: { + closeFlyout: true, + fetchCrawlRequest: (requestId) => ({ requestId }), + onRecieveCrawlRequest: (crawlRequestFromServer) => ({ crawlRequestFromServer }), + openFlyout: true, + setSelectedTab: (selectedTab) => ({ selectedTab }), + }, + reducers: { + crawlRequest: [ + null, + { + onRecieveCrawlRequest: (_, { crawlRequestFromServer }) => + crawlRequestWithDetailsServerToClient(crawlRequestFromServer), + }, + ], + crawlRequestFromServer: [ + null, + { + onRecieveCrawlRequest: (_, { crawlRequestFromServer }) => crawlRequestFromServer, + }, + ], + dataLoading: [ + true, + { + fetchCrawlRequest: () => true, + onRecieveCrawlRequest: () => false, + }, + ], + flyoutClosed: [ + true, + { + openFlyout: () => false, + closeFlyout: () => true, + }, + ], + selectedTab: [ + 'preview', + { + openFlyout: () => 'preview', + setSelectedTab: (_, { selectedTab }) => selectedTab, + }, + ], + }, + listeners: ({ actions }) => ({ + fetchCrawlRequest: async ({ requestId }) => { + const { http } = HttpLogic.values; + const { engineName } = EngineLogic.values; + + try { + const response = await http.get( + `/internal/app_search/engines/${engineName}/crawler/crawl_requests/${requestId}` + ); + + actions.onRecieveCrawlRequest(response); + } catch (e) { + flashAPIErrors(e); + } + }, + }), +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_overview.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_overview.test.tsx index 8a8d789ba5705..7c5510519d202 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_overview.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_overview.test.tsx @@ -17,6 +17,7 @@ import { getPageHeaderActions } from '../../../test_helpers'; import { AddDomainFlyout } from './components/add_domain/add_domain_flyout'; import { AddDomainForm } from './components/add_domain/add_domain_form'; import { AddDomainFormSubmitButton } from './components/add_domain/add_domain_form_submit_button'; +import { CrawlDetailsFlyout } from './components/crawl_details_flyout'; import { CrawlRequestsTable } from './components/crawl_requests_table'; import { CrawlerStatusBanner } from './components/crawler_status_banner'; import { CrawlerStatusIndicator } from './components/crawler_status_indicator/crawler_status_indicator'; @@ -176,4 +177,12 @@ describe('CrawlerOverview', () => { expect(wrapper.find(DomainsTable)).toHaveLength(1); expect(wrapper.find(CrawlRequestsTable)).toHaveLength(1); }); + + it('contains a crawl details flyout', () => { + setMockValues(mockValues); + + const wrapper = shallow(); + + expect(wrapper.find(CrawlDetailsFlyout)).toHaveLength(1); + }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_overview.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_overview.tsx index b6fa50e06c904..6c3cb51111ae1 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_overview.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_overview.tsx @@ -20,6 +20,7 @@ import { AppSearchPageTemplate } from '../layout'; import { AddDomainFlyout } from './components/add_domain/add_domain_flyout'; import { AddDomainForm } from './components/add_domain/add_domain_form'; import { AddDomainFormSubmitButton } from './components/add_domain/add_domain_form_submit_button'; +import { CrawlDetailsFlyout } from './components/crawl_details_flyout'; import { CrawlRequestsTable } from './components/crawl_requests_table'; import { CrawlerStatusBanner } from './components/crawler_status_banner'; import { CrawlerStatusIndicator } from './components/crawler_status_indicator/crawler_status_indicator'; @@ -131,6 +132,7 @@ export const CrawlerOverview: React.FC = () => { )} + ); }; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/types.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/types.ts index 260d63974c748..6cdccfdc78633 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/types.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/types.ts @@ -199,8 +199,6 @@ export interface CrawlRequest { completedAt: string | null; } -export type CrawlEventStage = 'crawl' | 'process'; - export interface CrawlConfig { domainAllowlist: string[]; } @@ -208,27 +206,32 @@ export interface CrawlConfig { export interface CrawlConfigFromServer { domain_allowlist: string[]; } -export interface CrawlEventFromServer { - id: string; + +export type CrawlRequestWithDetailsFromServer = CrawlRequestFromServer & { + type: CrawlType; + crawl_config: CrawlConfigFromServer; + // TODO add other properties like stats +}; + +export type CrawlRequestWithDetails = CrawlRequest & { + type: CrawlType; + crawlConfig: CrawlConfig; + // TODO add other properties like stats +}; + +export type CrawlEventStage = 'crawl' | 'process'; + +export type CrawlEventFromServer = CrawlRequestFromServer & { stage: CrawlEventStage; - status: CrawlerStatus; - created_at: string; - began_at: string | null; - completed_at: string | null; type: CrawlType; crawl_config: CrawlConfigFromServer; -} +}; -export interface CrawlEvent { - id: string; +export type CrawlEvent = CrawlRequest & { stage: CrawlEventStage; - status: CrawlerStatus; - createdAt: string; - beganAt: string | null; - completedAt: string | null; type: CrawlType; crawlConfig: CrawlConfig; -} +}; export const readableCrawlerStatuses: { [key in CrawlerStatus]: string } = { [CrawlerStatus.Pending]: i18n.translate( diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/utils.test.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/utils.test.ts index fa61a1a886be5..c104312f19edc 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/utils.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/utils.test.ts @@ -18,13 +18,19 @@ import { CrawlRequest, CrawlerDomain, CrawlType, + CrawlRequestWithDetailsFromServer, + CrawlRequestWithDetails, + CrawlEvent, + CrawlEventFromServer, } from './types'; import { crawlerDomainServerToClient, crawlerDataServerToClient, crawlDomainValidationToResult, + crawlEventServerToClient, crawlRequestServerToClient, + crawlRequestWithDetailsServerToClient, getDeleteDomainConfirmationMessage, getDeleteDomainSuccessMessage, getCrawlRulePathPatternTooltip, @@ -120,6 +126,98 @@ describe('crawlRequestServerToClient', () => { }); }); +describe('crawlRequestWithDetailsServerToClient', () => { + it('converts the API payload into properties matching our code style', () => { + const id = '507f1f77bcf86cd799439011'; + + const defaultServerPayload: CrawlRequestWithDetailsFromServer = { + id, + status: CrawlerStatus.Pending, + created_at: 'Mon, 31 Aug 2020 17:00:00 +0000', + began_at: null, + completed_at: null, + type: CrawlType.Full, + crawl_config: { + domain_allowlist: [], + }, + }; + + const defaultClientPayload: CrawlRequestWithDetails = { + id, + status: CrawlerStatus.Pending, + createdAt: 'Mon, 31 Aug 2020 17:00:00 +0000', + beganAt: null, + completedAt: null, + type: CrawlType.Full, + crawlConfig: { + domainAllowlist: [], + }, + }; + + expect(crawlRequestWithDetailsServerToClient(defaultServerPayload)).toStrictEqual( + defaultClientPayload + ); + expect( + crawlRequestWithDetailsServerToClient({ + ...defaultServerPayload, + began_at: 'Mon, 31 Aug 2020 17:00:00 +0000', + }) + ).toStrictEqual({ ...defaultClientPayload, beganAt: 'Mon, 31 Aug 2020 17:00:00 +0000' }); + expect( + crawlRequestWithDetailsServerToClient({ + ...defaultServerPayload, + completed_at: 'Mon, 31 Aug 2020 17:00:00 +0000', + }) + ).toStrictEqual({ ...defaultClientPayload, completedAt: 'Mon, 31 Aug 2020 17:00:00 +0000' }); + }); +}); + +describe('crawlEventServerToClient', () => { + it('converts the API payload into properties matching our code style', () => { + const id = '507f1f77bcf86cd799439011'; + + const defaultServerPayload: CrawlEventFromServer = { + id, + status: CrawlerStatus.Pending, + created_at: 'Mon, 31 Aug 2020 17:00:00 +0000', + began_at: null, + completed_at: null, + type: CrawlType.Full, + crawl_config: { + domain_allowlist: [], + }, + stage: 'crawl', + }; + + const defaultClientPayload: CrawlEvent = { + id, + status: CrawlerStatus.Pending, + createdAt: 'Mon, 31 Aug 2020 17:00:00 +0000', + beganAt: null, + completedAt: null, + type: CrawlType.Full, + crawlConfig: { + domainAllowlist: [], + }, + stage: 'crawl', + }; + + expect(crawlEventServerToClient(defaultServerPayload)).toStrictEqual(defaultClientPayload); + expect( + crawlEventServerToClient({ + ...defaultServerPayload, + began_at: 'Mon, 31 Aug 2020 17:00:00 +0000', + }) + ).toStrictEqual({ ...defaultClientPayload, beganAt: 'Mon, 31 Aug 2020 17:00:00 +0000' }); + expect( + crawlEventServerToClient({ + ...defaultServerPayload, + completed_at: 'Mon, 31 Aug 2020 17:00:00 +0000', + }) + ).toStrictEqual({ ...defaultClientPayload, completedAt: 'Mon, 31 Aug 2020 17:00:00 +0000' }); + }); +}); + describe('crawlerDataServerToClient', () => { let output: CrawlerData; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/utils.ts b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/utils.ts index b05ff582ac7a7..16e3dad5f46e9 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/utils.ts +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/utils.ts @@ -22,6 +22,8 @@ import { CrawlEvent, CrawlConfigFromServer, CrawlConfig, + CrawlRequestWithDetailsFromServer, + CrawlRequestWithDetails, } from './types'; export function crawlerDomainServerToClient(payload: CrawlerDomainFromServer): CrawlerDomain { @@ -90,7 +92,7 @@ export function crawlConfigServerToClient(crawlConfig: CrawlConfigFromServer): C }; } -export function crawlerEventServerToClient(event: CrawlEventFromServer): CrawlEvent { +export function crawlEventServerToClient(event: CrawlEventFromServer): CrawlEvent { const { id, stage, @@ -114,12 +116,37 @@ export function crawlerEventServerToClient(event: CrawlEventFromServer): CrawlEv }; } +export function crawlRequestWithDetailsServerToClient( + event: CrawlRequestWithDetailsFromServer +): CrawlRequestWithDetails { + const { + id, + status, + created_at: createdAt, + began_at: beganAt, + completed_at: completedAt, + type, + crawl_config: crawlConfig, + } = event; + + return { + id, + status, + createdAt, + beganAt, + completedAt, + type, + crawlConfig: crawlConfigServerToClient(crawlConfig), + // TODO add fields like stats + }; +} + export function crawlerDataServerToClient(payload: CrawlerDataFromServer): CrawlerData { const { domains, events, most_recent_crawl_request: mostRecentCrawlRequest } = payload; return { domains: domains.map((domain) => crawlerDomainServerToClient(domain)), - events: events.map((event) => crawlerEventServerToClient(event)), + events: events.map((event) => crawlEventServerToClient(event)), mostRecentCrawlRequest: mostRecentCrawlRequest && crawlRequestServerToClient(mostRecentCrawlRequest), }; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curation/documents/organic_documents.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curation/documents/organic_documents.tsx index ff7d64b59ec33..7c8abaa1377b9 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curation/documents/organic_documents.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/curation/documents/organic_documents.tsx @@ -11,7 +11,7 @@ import { useValues, useActions } from 'kea'; import { EuiLoadingContent, EuiEmptyPrompt, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { LeafIcon } from '../../../../../shared/icons'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_settings/curations_settings.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_settings/curations_settings.tsx index 29fbee8fa0242..d78ca852ee7d1 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_settings/curations_settings.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/curations/views/curations_settings/curations_settings.tsx @@ -22,7 +22,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { docLinks } from '../../../../../shared/doc_links'; import { LicensingLogic } from '../../../../../shared/licensing'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/creation_mode_components/api_code_example.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/creation_mode_components/api_code_example.tsx index e5f295f0368fb..793c6250d859c 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/creation_mode_components/api_code_example.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/creation_mode_components/api_code_example.tsx @@ -26,7 +26,7 @@ import { EuiFlexItem, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { CANCEL_BUTTON_LABEL } from '../../../../shared/constants'; import { getEnterpriseSearchUrl } from '../../../../shared/enterprise_search_url'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/document_creation_buttons.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/document_creation_buttons.tsx index 8d48460777b40..5366c00c0e7fc 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/document_creation_buttons.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/document_creation_buttons.tsx @@ -23,7 +23,7 @@ import { EuiIcon, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { parseQueryParams } from '../../../shared/query_params'; import { EuiCardTo } from '../../../shared/react_router_helpers'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/components/tables/shared_columns.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/components/tables/shared_columns.tsx index 2c8fcfdbc54cd..325760b641efd 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/components/tables/shared_columns.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/components/tables/shared_columns.tsx @@ -13,7 +13,7 @@ import { EuiTableActionsColumnType, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedNumber } from '@kbn/i18n/react'; +import { FormattedNumber } from '@kbn/i18n-react'; import { MANAGE_BUTTON_LABEL, DELETE_BUTTON_LABEL } from '../../../../../shared/constants'; import { FormattedDateTime } from '../../../../utils/formatted_date_time'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/constants.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/constants.tsx index 99b19989a3b60..8fbbf406cf5d3 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/constants.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/engines/constants.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { EuiLink } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { DOCS_PREFIX } from '../../routes'; import { diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/components/log_retention_callout.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/components/log_retention_callout.tsx index 801ed296137c7..2f7d02d0912df 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/components/log_retention_callout.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/components/log_retention_callout.tsx @@ -11,7 +11,7 @@ import { useValues, useActions } from 'kea'; import { EuiCallOut, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiLinkTo } from '../../../../shared/react_router_helpers'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/messaging/constants.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/messaging/constants.tsx index e30b6cec34d18..6ea9c361cd25e 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/messaging/constants.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/log_retention/messaging/constants.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedDate, FormattedMessage } from '@kbn/i18n/react'; +import { FormattedDate, FormattedMessage } from '@kbn/i18n-react'; import { LogRetentionOptions, LogRetentionSettings, LogRetentionPolicy } from '../types'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/meta_engine_creation/constants.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/meta_engine_creation/constants.tsx index 9659fa3f2dfc0..af7b6f3201b3e 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/meta_engine_creation/constants.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/meta_engine_creation/constants.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { EuiLink } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { DOCS_PREFIX } from '../../routes'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_callouts.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_callouts.tsx index bdbc414a22eaa..d8963b33b8ab2 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_callouts.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/relevance_tuning/relevance_tuning_callouts.tsx @@ -11,7 +11,7 @@ import { useValues } from 'kea'; import { EuiCallOut, EuiLink } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiLinkTo } from '../../../shared/react_router_helpers'; import { DOCS_PREFIX, ENGINE_SCHEMA_PATH } from '../../routes'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/result/result_header.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/result/result_header.tsx index 05af34c3fe3af..776b3fb070092 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/result/result_header.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/result/result_header.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { EuiBadge, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ResultActions } from './result_actions'; import { ResultHeaderItem } from './result_header_item'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/search_ui/search_ui.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/search_ui/search_ui.tsx index 63ebe6ddb27d8..2b210bd07ab4b 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/search_ui/search_ui.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/search_ui/search_ui.tsx @@ -10,7 +10,7 @@ import React, { useEffect } from 'react'; import { useActions, useValues } from 'kea'; import { EuiText, EuiFlexItem, EuiFlexGroup, EuiSpacer, EuiLink } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { DOCS_PREFIX } from '../../routes'; import { EngineLogic, getEngineBreadcrumbs } from '../engine'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/setup_guide/setup_guide.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/setup_guide/setup_guide.tsx index 0fc22d8b0d406..d460132dddbb1 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/setup_guide/setup_guide.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/setup_guide/setup_guide.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { EuiSpacer, EuiTitle, EuiText } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { APP_SEARCH_PLUGIN } from '../../../../../common/constants'; import { SetAppSearchChrome as SetPageChrome } from '../../../shared/kibana_chrome'; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/index.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/index.test.tsx index 6647b4032e4bc..2f415840a6c4a 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/index.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/index.test.tsx @@ -16,6 +16,7 @@ import { Redirect } from 'react-router-dom'; import { shallow, ShallowWrapper } from 'enzyme'; +import { VersionMismatchPage } from '../shared/version_mismatch'; import { rerender } from '../test_helpers'; jest.mock('./app_logic', () => ({ AppLogic: jest.fn() })); @@ -41,6 +42,12 @@ describe('AppSearch', () => { expect(wrapper.find(SetupGuide)).toHaveLength(1); }); + it('renders VersionMismatchPage when there are mismatching versions', () => { + const wrapper = shallow(); + + expect(wrapper.find(VersionMismatchPage)).toHaveLength(1); + }); + it('renders AppSearchUnconfigured when config.host is not set', () => { setMockValues({ config: { host: '' } }); const wrapper = shallow(); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/index.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/index.tsx index 11f706bff028f..027a4dbee5ef6 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/index.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/index.tsx @@ -10,9 +10,11 @@ import { Route, Redirect, Switch } from 'react-router-dom'; import { useValues } from 'kea'; +import { isVersionMismatch } from '../../../common/is_version_mismatch'; import { InitialAppData } from '../../../common/types'; import { HttpLogic } from '../shared/http'; import { KibanaLogic } from '../shared/kibana'; +import { VersionMismatchPage } from '../shared/version_mismatch'; import { AppLogic } from './app_logic'; import { Credentials } from './components/credentials'; @@ -43,21 +45,32 @@ import { export const AppSearch: React.FC = (props) => { const { config } = useValues(KibanaLogic); const { errorConnecting } = useValues(HttpLogic); + const { enterpriseSearchVersion, kibanaVersion } = props; + const incompatibleVersions = isVersionMismatch(enterpriseSearchVersion, kibanaVersion); + + const showView = () => { + if (!config.host) { + return ; + } else if (incompatibleVersions) { + return ( + + ); + } else if (errorConnecting) { + return ; + } + + return )} />; + }; return ( - - {!config.host ? ( - - ) : errorConnecting ? ( - - ) : ( - )} /> - )} - + {showView()} ); }; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/utils/formatted_date_time/index.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/utils/formatted_date_time/index.tsx index 87a377dbc21b6..74ee71185f920 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/utils/formatted_date_time/index.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/utils/formatted_date_time/index.tsx @@ -7,7 +7,7 @@ import React from 'react'; -import { FormattedDate, FormattedTime } from '@kbn/i18n/react'; +import { FormattedDate, FormattedTime } from '@kbn/i18n-react'; interface Props { date: Date; diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search/components/setup_guide/setup_guide.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search/components/setup_guide/setup_guide.tsx index c9dbe3882ba72..e82dbcaa41135 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search/components/setup_guide/setup_guide.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search/components/setup_guide/setup_guide.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { EuiSpacer, EuiTitle, EuiText } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ENTERPRISE_SEARCH_PLUGIN } from '../../../../../common/constants'; import { DOCS_PREFIX } from '../../../app_search/routes'; diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search/components/trial_callout/trial_callout.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search/components/trial_callout/trial_callout.tsx index 1140d42b9189f..2f77727789dd4 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search/components/trial_callout/trial_callout.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search/components/trial_callout/trial_callout.tsx @@ -11,7 +11,7 @@ import { useValues } from 'kea'; import moment from 'moment'; import { EuiCallOut, EuiLink, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { LicensingLogic } from '../../../shared/licensing'; diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search/index.test.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search/index.test.tsx index fbb3e58f198a7..7b5c748b013e5 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search/index.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search/index.test.tsx @@ -11,6 +11,7 @@ import React from 'react'; import { shallow } from 'enzyme'; +import { VersionMismatchPage } from '../shared/version_mismatch'; import { rerender } from '../test_helpers'; import { ErrorConnecting } from './components/error_connecting'; @@ -38,6 +39,7 @@ describe('EnterpriseSearch', () => { }); const wrapper = shallow(); + expect(wrapper.find(VersionMismatchPage)).toHaveLength(0); expect(wrapper.find(ErrorConnecting)).toHaveLength(1); expect(wrapper.find(ProductSelector)).toHaveLength(0); @@ -47,7 +49,22 @@ describe('EnterpriseSearch', () => { }); rerender(wrapper); + expect(wrapper.find(VersionMismatchPage)).toHaveLength(0); expect(wrapper.find(ErrorConnecting)).toHaveLength(0); expect(wrapper.find(ProductSelector)).toHaveLength(1); }); + + it('renders the version error message if versions mismatch and the host is configured', () => { + setMockValues({ + errorConnecting: false, + config: { host: 'localhost' }, + }); + const wrapper = shallow( + + ); + + expect(wrapper.find(VersionMismatchPage)).toHaveLength(1); + expect(wrapper.find(ErrorConnecting)).toHaveLength(0); + expect(wrapper.find(ProductSelector)).toHaveLength(0); + }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search/index.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search/index.tsx index 17387ae482325..81aa587e3a133 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search/index.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search/index.tsx @@ -10,33 +10,54 @@ import { Route, Switch } from 'react-router-dom'; import { useValues } from 'kea'; +import { isVersionMismatch } from '../../../common/is_version_mismatch'; import { InitialAppData } from '../../../common/types'; import { HttpLogic } from '../shared/http'; import { KibanaLogic } from '../shared/kibana'; +import { VersionMismatchPage } from '../shared/version_mismatch'; import { ErrorConnecting } from './components/error_connecting'; import { ProductSelector } from './components/product_selector'; import { SetupGuide } from './components/setup_guide'; import { ROOT_PATH, SETUP_GUIDE_PATH } from './routes'; -export const EnterpriseSearch: React.FC = ({ access = {}, workplaceSearch }) => { +export const EnterpriseSearch: React.FC = ({ + access = {}, + workplaceSearch, + enterpriseSearchVersion, + kibanaVersion, +}) => { const { errorConnecting } = useValues(HttpLogic); const { config } = useValues(KibanaLogic); const showErrorConnecting = !!(config.host && errorConnecting); + const incompatibleVersions = !!( + config.host && isVersionMismatch(enterpriseSearchVersion, kibanaVersion) + ); const isWorkplaceSearchAdmin = !!workplaceSearch?.account?.isAdmin; + const showView = () => { + if (incompatibleVersions) { + return ( + + ); + } else if (showErrorConnecting) { + return ; + } + + return ; + }; + return ( - {showErrorConnecting ? ( - - ) : ( - - )} + {showView()} ); diff --git a/x-pack/plugins/enterprise_search/public/applications/index.tsx b/x-pack/plugins/enterprise_search/public/applications/index.tsx index fef40ed00bfc1..f8db22563ec5a 100644 --- a/x-pack/plugins/enterprise_search/public/applications/index.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/index.tsx @@ -13,7 +13,7 @@ import { Router } from 'react-router-dom'; import { getContext, resetContext } from 'kea'; import { Store } from 'redux'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { AppMountParameters, CoreStart } from '../../../../../src/core/public'; import { EuiThemeProvider } from '../../../../../src/plugins/kibana_react/common'; diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/error_state/error_state_prompt.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/error_state/error_state_prompt.tsx index 2ecb6bffc8212..eff483df10c7f 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/error_state/error_state_prompt.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/error_state/error_state_prompt.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { useValues } from 'kea'; import { EuiEmptyPrompt, EuiCode } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { KibanaLogic } from '../kibana'; import { EuiButtonTo } from '../react_router_helpers'; diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/schema/add_field_modal/constants.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/schema/add_field_modal/constants.tsx index 3cc43532eda73..332d9e57b3783 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/schema/add_field_modal/constants.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/schema/add_field_modal/constants.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const FORM_ID = 'schemaAddFieldForm'; diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/schema/add_field_modal/index.test.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/schema/add_field_modal/index.test.tsx index 186560c694d24..e81f530f02ee9 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/schema/add_field_modal/index.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/schema/add_field_modal/index.test.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { shallow, mount } from 'enzyme'; import { EuiForm, EuiFieldText, EuiModal } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { SchemaFieldTypeSelect } from '../index'; import { SchemaType } from '../types'; diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/setup_guide/cloud/instructions.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/setup_guide/cloud/instructions.tsx index b355c88943a54..4845d682b8771 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/setup_guide/cloud/instructions.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/setup_guide/cloud/instructions.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { EuiPageContent, EuiSteps, EuiText, EuiLink, EuiCallOut } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { docLinks } from '../../doc_links'; diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/setup_guide/instructions.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/setup_guide/instructions.tsx index 5e39d1acdf189..aa8bbd6970f86 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/setup_guide/instructions.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/setup_guide/instructions.tsx @@ -18,7 +18,7 @@ import { EuiLink, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; interface Props { productName: string; diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/version_mismatch/index.ts b/x-pack/plugins/enterprise_search/public/applications/shared/version_mismatch/index.ts new file mode 100644 index 0000000000000..90d007d1d9411 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/shared/version_mismatch/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { VersionMismatchPage } from './version_mismatch_page'; +export { VersionMismatchError } from './version_mismatch_error'; diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/version_mismatch/version_mismatch_error.test.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/version_mismatch/version_mismatch_error.test.tsx new file mode 100644 index 0000000000000..f6d5ef4aa4212 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/shared/version_mismatch/version_mismatch_error.test.tsx @@ -0,0 +1,23 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; + +import { mount } from 'enzyme'; + +import { VersionMismatchError } from './version_mismatch_error'; + +describe('VersionMismatchError', () => { + it('renders', () => { + const wrapper = mount( + + ); + + expect(wrapper.find('EuiEmptyPrompt').text()).toContain('Enterprise Search version: 8.0.0'); + expect(wrapper.find('EuiEmptyPrompt').text()).toContain('Kibana version: 8.1.0'); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/version_mismatch/version_mismatch_error.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/version_mismatch/version_mismatch_error.tsx new file mode 100644 index 0000000000000..f2f913902f97f --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/shared/version_mismatch/version_mismatch_error.tsx @@ -0,0 +1,57 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; + +import { EuiEmptyPrompt, EuiSpacer } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; + +interface Props { + enterpriseSearchVersion?: string; + kibanaVersion?: string; +} + +export const VersionMismatchError: React.FC = ({ + enterpriseSearchVersion, + kibanaVersion, +}) => { + return ( + + {i18n.translate('xpack.enterpriseSearch.versionMismatch.title', { + defaultMessage: 'Incompatible version error', + })} + + } + titleSize="l" + body={ + <> + {i18n.translate('xpack.enterpriseSearch.versionMismatch.body', { + defaultMessage: + 'Your Kibana and Enterprise Search versions do not match. To access Enterprise Search, use the same major and minor version for each service.', + })} + +
+ {i18n.translate('xpack.enterpriseSearch.versionMismatch.enterpriseSearchVersionText', { + defaultMessage: 'Enterprise Search version: {enterpriseSearchVersion}', + values: { enterpriseSearchVersion }, + })} +
+
+ {i18n.translate('xpack.enterpriseSearch.versionMismatch.kibanaVersionText', { + defaultMessage: 'Kibana version: {kibanaVersion}', + values: { kibanaVersion }, + })} +
+ + } + /> + ); +}; diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/version_mismatch/version_mismatch_page.test.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/version_mismatch/version_mismatch_page.test.tsx new file mode 100644 index 0000000000000..d86a1187bd4b9 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/shared/version_mismatch/version_mismatch_page.test.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; + +import { shallow } from 'enzyme'; + +import { VersionMismatchError } from './version_mismatch_error'; +import { VersionMismatchPage } from './version_mismatch_page'; + +describe('VersionMismatchPage', () => { + it('renders', () => { + const wrapper = shallow( + + ); + expect(wrapper.find(VersionMismatchError).exists()).toBe(true); + expect(wrapper.find(VersionMismatchError).props()).toEqual({ + kibanaVersion: '8.1.0', + enterpriseSearchVersion: '8.0.0', + }); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/version_mismatch/version_mismatch_page.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/version_mismatch/version_mismatch_page.tsx new file mode 100644 index 0000000000000..f60ccf2d19e50 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/shared/version_mismatch/version_mismatch_page.tsx @@ -0,0 +1,23 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; + +import { KibanaPageTemplate } from '../../../../../../../src/plugins/kibana_react/public'; + +import { VersionMismatchError } from './version_mismatch_error'; + +interface Props { + enterpriseSearchVersion?: string; + kibanaVersion?: string; +} + +export const VersionMismatchPage: React.FC = (props) => ( + + + +); diff --git a/x-pack/plugins/enterprise_search/public/applications/test_helpers/mount_with_i18n.tsx b/x-pack/plugins/enterprise_search/public/applications/test_helpers/mount_with_i18n.tsx index 3a98616082412..0c4b505a09701 100644 --- a/x-pack/plugins/enterprise_search/public/applications/test_helpers/mount_with_i18n.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/test_helpers/mount_with_i18n.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { mount } from 'enzyme'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; /** * This helper wraps a component with @kbn/i18n's which diff --git a/x-pack/plugins/enterprise_search/public/applications/test_helpers/shallow_with_i18n.tsx b/x-pack/plugins/enterprise_search/public/applications/test_helpers/shallow_with_i18n.tsx index 7eb10c710a34a..9fed12505dda8 100644 --- a/x-pack/plugins/enterprise_search/public/applications/test_helpers/shallow_with_i18n.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/test_helpers/shallow_with_i18n.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { shallow, mount, ReactWrapper } from 'enzyme'; -import { I18nProvider, __IntlProvider } from '@kbn/i18n/react'; +import { I18nProvider, __IntlProvider } from '@kbn/i18n-react'; // Use fake component to extract `intl` property to use in tests. const { intl } = ( diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/product_button.test.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/product_button.test.tsx index e605e914df061..6133bd30eec16 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/product_button.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/product_button.test.tsx @@ -12,7 +12,7 @@ import React from 'react'; import { shallow } from 'enzyme'; import { EuiButton } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ProductButton } from './'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/product_button.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/product_button.tsx index 6199ad672f361..ac61a84ba7c8f 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/product_button.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/shared/product_button/product_button.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { useActions } from 'kea'; import { EuiButton, EuiButtonProps, EuiLinkProps } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { getWorkplaceSearchUrl } from '../../../../shared/enterprise_search_url'; import { TelemetryLogic } from '../../../../shared/telemetry'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.test.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.test.tsx index 3ddccde6abd33..7274ee8855705 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.test.tsx @@ -15,6 +15,8 @@ import { Redirect } from 'react-router-dom'; import { shallow } from 'enzyme'; +import { VersionMismatchPage } from '../shared/version_mismatch'; + import { WorkplaceSearchHeaderActions } from './components/layout'; import { SourceAdded } from './views/content_sources/components/source_added'; import { ErrorState } from './views/error_state'; @@ -24,6 +26,14 @@ import { SetupGuide } from './views/setup_guide'; import { WorkplaceSearch, WorkplaceSearchUnconfigured, WorkplaceSearchConfigured } from './'; describe('WorkplaceSearch', () => { + it('renders VersionMismatchPage when there are mismatching versions', () => { + const wrapper = shallow( + + ); + + expect(wrapper.find(VersionMismatchPage)).toHaveLength(1); + }); + it('renders WorkplaceSearchUnconfigured when config.host is not set', () => { setMockValues({ config: { host: '' } }); const wrapper = shallow(); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.tsx index 1ed77ea0fb1fd..2b24e09f96315 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/index.tsx @@ -10,9 +10,11 @@ import { Route, Redirect, Switch, useRouteMatch } from 'react-router-dom'; import { useActions, useValues } from 'kea'; +import { isVersionMismatch } from '../../../common/is_version_mismatch'; import { InitialAppData } from '../../../common/types'; import { HttpLogic } from '../shared/http'; import { KibanaLogic } from '../shared/kibana'; +import { VersionMismatchPage } from '../shared/version_mismatch'; import { AppLogic } from './app_logic'; import { WorkplaceSearchHeaderActions } from './components/layout'; @@ -47,13 +49,23 @@ import { SetupGuide } from './views/setup_guide'; export const WorkplaceSearch: React.FC = (props) => { const { config } = useValues(KibanaLogic); const { errorConnecting } = useValues(HttpLogic); - return !config.host ? ( - - ) : errorConnecting ? ( - - ) : ( - - ); + const { enterpriseSearchVersion, kibanaVersion } = props; + const incompatibleVersions = isVersionMismatch(enterpriseSearchVersion, kibanaVersion); + + if (!config.host) { + return ; + } else if (incompatibleVersions) { + return ( + + ); + } else if (errorConnecting) { + return ; + } + + return ; }; export const WorkplaceSearchConfigured: React.FC = (props) => { diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/routes.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/routes.ts index ec515eed91179..1be152ad5ca0b 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/routes.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/routes.ts @@ -73,6 +73,7 @@ export const ADD_CONFLUENCE_SERVER_PATH = `${SOURCES_PATH}/add/confluence_server export const ADD_DROPBOX_PATH = `${SOURCES_PATH}/add/dropbox`; export const ADD_GITHUB_ENTERPRISE_PATH = `${SOURCES_PATH}/add/github_enterprise_server`; export const ADD_GITHUB_PATH = `${SOURCES_PATH}/add/github`; +export const ADD_GITHUB_APP_PATH = `${SOURCES_PATH}/add/github_app`; export const ADD_GMAIL_PATH = `${SOURCES_PATH}/add/gmail`; export const ADD_GOOGLE_DRIVE_PATH = `${SOURCES_PATH}/add/google_drive`; export const ADD_JIRA_PATH = `${SOURCES_PATH}/add/jira_cloud`; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/config_completed.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/config_completed.tsx index 18e147100a410..167bf1af4b9b1 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/config_completed.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/config_completed.tsx @@ -19,7 +19,7 @@ import { EuiTextAlign, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiLinkTo, EuiButtonTo } from '../../../../../shared/react_router_helpers'; import { diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/configuration_intro.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/configuration_intro.tsx index 15941f14d5ab1..5c52537d4a738 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/configuration_intro.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/configuration_intro.tsx @@ -19,7 +19,7 @@ import { EuiTitle, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import connectionIllustration from '../../../../assets/connection_illustration.svg'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/configure_custom.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/configure_custom.tsx index 1529875e66af5..4682d4329a964 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/configure_custom.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/configure_custom.tsx @@ -18,7 +18,7 @@ import { EuiSpacer, EuiText, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { CUSTOM_SOURCE_DOCS_URL } from '../../../../routes'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/connect_instance.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/connect_instance.tsx index 5428e63a101b4..a6801cf9de3a3 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/connect_instance.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/connect_instance.tsx @@ -26,7 +26,7 @@ import { EuiTitle, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { LicensingLogic } from '../../../../../shared/licensing'; import { AppLogic } from '../../../../app_logic'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/github_app.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/github_app.tsx new file mode 100644 index 0000000000000..7f518d272d842 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/github_app.tsx @@ -0,0 +1,64 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; + +import { useValues } from 'kea'; + +import { EuiFlexGroup, EuiFlexItem, EuiHorizontalRule, EuiPanel, EuiSpacer } from '@elastic/eui'; + +import { AppLogic } from '../../../../app_logic'; +import { + WorkplaceSearchPageTemplate, + PersonalDashboardLayout, +} from '../../../../components/layout'; +import { NAV, SOURCE_NAMES } from '../../../../constants'; + +import { staticSourceData } from '../../source_data'; + +import { AddSourceHeader } from './add_source_header'; +import { SourceFeatures } from './source_features'; + +export const GitHubApp: React.FC = () => { + const { isOrganization } = useValues(AppLogic); + + const name = SOURCE_NAMES.GITHUB; + const data = staticSourceData.find((source) => (source.name = name)); + const Layout = isOrganization ? WorkplaceSearchPageTemplate : PersonalDashboardLayout; + + return ( + +
'TODO: use method from add_source_logic'}> + + + + + + + + + + + + + form goes here + + + +
+ ); +}; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/index.ts b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/index.ts index f4920451e67c3..033cf9f356342 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/index.ts +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/index.ts @@ -7,3 +7,4 @@ export { AddSource } from './add_source'; export { AddSourceList } from './add_source_list'; +export { GitHubApp } from './github_app'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/save_custom.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/save_custom.tsx index dbec5d1808167..8108f8211f93d 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/save_custom.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/save_custom.tsx @@ -22,7 +22,7 @@ import { EuiPanel, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { LicensingLogic } from '../../../../../shared/licensing'; import { EuiLinkTo } from '../../../../../shared/react_router_helpers'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/source_features.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/source_features.tsx index 940cb9cb7372a..edfb2897fce15 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/source_features.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/source_features.tsx @@ -18,7 +18,7 @@ import { EuiText, EuiTitle, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { LicensingLogic } from '../../../../../shared/licensing'; import { AppLogic } from '../../../../app_logic'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/overview.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/overview.tsx index b27f5f9ccd9d5..d506ed9c32ba5 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/overview.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/overview.tsx @@ -30,7 +30,7 @@ import { EuiTextColor, EuiTitle, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { CANCEL_BUTTON_LABEL, START_BUTTON_LABEL } from '../../../../shared/constants'; import { EuiListGroupItemTo, EuiLinkTo } from '../../../../shared/react_router_helpers'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/source_content.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/source_content.tsx index fdeb325730470..6b0e43fbce0c4 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/source_content.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/source_content.tsx @@ -29,7 +29,7 @@ import { EuiLink, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { TruncatedContent } from '../../../../shared/truncate'; import { ComponentLoader } from '../../../components/shared/component_loader'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/source_settings.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/source_settings.tsx index dd8625ebd7a7c..f0ccfb201e3b3 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/source_settings.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/source_settings.tsx @@ -18,7 +18,7 @@ import { EuiFlexItem, EuiFormRow, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { HttpLogic } from '../../../../shared/http'; import { EuiButtonEmptyTo } from '../../../../shared/react_router_helpers'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/synchronization/blocked_window_item.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/synchronization/blocked_window_item.tsx index 3399f41254004..c302cc16a40cd 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/synchronization/blocked_window_item.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/synchronization/blocked_window_item.tsx @@ -23,7 +23,7 @@ import { EuiSuperSelect, EuiText, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ALL_DAYS_LABEL, DAYS_OF_WEEK_LABELS } from '../../../../../shared/constants'; import { BLOCK_LABEL, BETWEEN_LABEL, ON_LABEL, REMOVE_BUTTON } from '../../../../constants'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/synchronization/frequency_item.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/synchronization/frequency_item.tsx index f0066f06466a7..445801904559d 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/synchronization/frequency_item.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/synchronization/frequency_item.tsx @@ -18,7 +18,7 @@ import { EuiSpacer, EuiText, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { MINUTES_UNIT_LABEL, diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/private_sources.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/private_sources.tsx index c9f55ff656561..bdadee7b1016e 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/private_sources.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/private_sources.tsx @@ -10,7 +10,7 @@ import React, { useEffect } from 'react'; import { useActions, useValues } from 'kea'; import { EuiCallOut, EuiEmptyPrompt, EuiSpacer, EuiPanel } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { LicensingLogic } from '../../../shared/licensing'; import { EuiButtonTo } from '../../../shared/react_router_helpers'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/sources_router.test.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/sources_router.test.tsx index 00cf56001f73b..bcf2b2792c5d5 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/sources_router.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/sources_router.test.tsx @@ -34,7 +34,7 @@ describe('SourcesRouter', () => { }); it('renders sources routes', () => { - const TOTAL_ROUTES = 61; + const TOTAL_ROUTES = 62; const wrapper = shallow(); expect(wrapper.find(Switch)).toHaveLength(1); diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/sources_router.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/sources_router.tsx index 2d47bab00810c..5142f5d6597ae 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/sources_router.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/sources_router.tsx @@ -14,6 +14,7 @@ import { useActions, useValues } from 'kea'; import { LicensingLogic } from '../../../shared/licensing'; import { AppLogic } from '../../app_logic'; import { + ADD_GITHUB_APP_PATH, ADD_SOURCE_PATH, SOURCE_DETAILS_PATH, PRIVATE_SOURCES_PATH, @@ -21,7 +22,7 @@ import { getSourcesPath, } from '../../routes'; -import { AddSource, AddSourceList } from './components/add_source'; +import { AddSource, AddSourceList, GitHubApp } from './components/add_source'; import { OrganizationSources } from './organization_sources'; import { PrivateSources } from './private_sources'; import { staticSourceData } from './source_data'; @@ -66,6 +67,9 @@ export const SourcesRouter: React.FC = () => { + + + {staticSourceData.map(({ addPath, accountContextOnly }, i) => ( {!hasPlatinumLicense && accountContextOnly ? ( diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/sources_view.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/sources_view.tsx index 1ef44a5f26ae0..8697f10f8afaf 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/sources_view.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/sources_view.tsx @@ -22,7 +22,7 @@ import { EuiText, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Loading } from '../../../shared/loading'; import { SourceIcon } from '../../components/shared/source_icon'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/oauth_authorize/oauth_authorize.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/oauth_authorize/oauth_authorize.tsx index 5c3114ae3199e..7645af50b593d 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/oauth_authorize/oauth_authorize.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/oauth_authorize/oauth_authorize.tsx @@ -27,7 +27,7 @@ import { EuiSpacer, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { FlashMessages } from '../../../shared/flash_messages'; import { Loading } from '../../../shared/loading'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/onboarding_steps.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/onboarding_steps.tsx index 13288bce98200..68afecef2800b 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/onboarding_steps.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/onboarding_steps.tsx @@ -19,7 +19,7 @@ import { EuiFlexGroup, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonTo } from '../../../shared/react_router_helpers'; import { TelemetryLogic } from '../../../shared/telemetry'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/organization_stats.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/organization_stats.tsx index 00ad69fbdf372..3528f97e16ad1 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/organization_stats.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/organization_stats.tsx @@ -11,7 +11,7 @@ import { useValues } from 'kea'; import { EuiFlexGrid, EuiPanel } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ContentSection } from '../../components/shared/content_section'; import { SOURCES_PATH, USERS_AND_ROLES_PATH } from '../../routes'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/recent_activity.test.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/recent_activity.test.tsx index 78e4954a4bf16..9cf332b7c540f 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/recent_activity.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/recent_activity.test.tsx @@ -14,7 +14,7 @@ import React from 'react'; import { shallow } from 'enzyme'; import { EuiEmptyPrompt } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiLinkTo } from '../../../shared/react_router_helpers'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/recent_activity.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/recent_activity.tsx index 51a6508986037..f69456c2553a9 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/recent_activity.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/overview/recent_activity.tsx @@ -11,7 +11,7 @@ import { useValues, useActions } from 'kea'; import moment from 'moment'; import { EuiEmptyPrompt, EuiPanel, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiLinkTo } from '../../../shared/react_router_helpers'; import { TelemetryLogic } from '../../../shared/telemetry'; diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/security/components/private_sources_table.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/security/components/private_sources_table.tsx index d2f8232168eb1..94906ab9f302d 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/security/components/private_sources_table.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/security/components/private_sources_table.tsx @@ -26,7 +26,7 @@ import { EuiSpacer, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { LicensingLogic } from '../../../../shared/licensing'; import { diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/setup_guide/setup_guide.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/setup_guide/setup_guide.tsx index cb07c196e7ab8..905ba20e4f660 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/setup_guide/setup_guide.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/setup_guide/setup_guide.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { EuiSpacer, EuiTitle, EuiText, EuiButton } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { WORKPLACE_SEARCH_PLUGIN } from '../../../../../common/constants'; import { SetWorkplaceSearchChrome as SetPageChrome } from '../../../shared/kibana_chrome'; diff --git a/x-pack/plugins/enterprise_search/server/lib/enterprise_search_config_api.test.ts b/x-pack/plugins/enterprise_search/server/lib/enterprise_search_config_api.test.ts index ba600de298976..f6e3280a8abb2 100644 --- a/x-pack/plugins/enterprise_search/server/lib/enterprise_search_config_api.test.ts +++ b/x-pack/plugins/enterprise_search/server/lib/enterprise_search_config_api.test.ts @@ -41,7 +41,7 @@ describe('callEnterpriseSearchConfigAPI', () => { const mockResponse = { version: { - number: '1.0.0', + number: '7.16.0', }, settings: { external_url: 'http://some.vanity.url/', @@ -120,6 +120,7 @@ describe('callEnterpriseSearchConfigAPI', () => { expect(await callEnterpriseSearchConfigAPI(mockDependencies)).toEqual({ ...DEFAULT_INITIAL_APP_DATA, + kibanaVersion: '1.0.0', access: { hasAppSearchAccess: true, hasWorkplaceSearchAccess: false, @@ -132,6 +133,7 @@ describe('callEnterpriseSearchConfigAPI', () => { (fetch as unknown as jest.Mock).mockReturnValueOnce(Promise.resolve(new Response('{}'))); expect(await callEnterpriseSearchConfigAPI(mockDependencies)).toEqual({ + kibanaVersion: '1.0.0', access: { hasAppSearchAccess: false, hasWorkplaceSearchAccess: false, diff --git a/x-pack/plugins/enterprise_search/server/lib/enterprise_search_config_api.ts b/x-pack/plugins/enterprise_search/server/lib/enterprise_search_config_api.ts index d652d56c28efe..a427beb6769c9 100644 --- a/x-pack/plugins/enterprise_search/server/lib/enterprise_search_config_api.ts +++ b/x-pack/plugins/enterprise_search/server/lib/enterprise_search_config_api.ts @@ -12,6 +12,7 @@ import { kibanaPackageJson } from '@kbn/utils'; import { KibanaRequest, Logger } from 'src/core/server'; +import { isVersionMismatch } from '../../common/is_version_mismatch'; import { stripTrailingSlash } from '../../common/strip_slashes'; import { InitialAppData } from '../../common/types'; import { ConfigType } from '../index'; @@ -68,6 +69,8 @@ export const callEnterpriseSearchConfigAPI = async ({ warnMismatchedVersions(data?.version?.number, log); return { + enterpriseSearchVersion: data?.version?.number, + kibanaVersion: kibanaPackageJson.version, access: { hasAppSearchAccess: !!data?.current_user?.access?.app_search, hasWorkplaceSearchAccess: !!data?.current_user?.access?.workplace_search, @@ -147,7 +150,7 @@ export const callEnterpriseSearchConfigAPI = async ({ export const warnMismatchedVersions = (enterpriseSearchVersion: string, log: Logger) => { const kibanaVersion = kibanaPackageJson.version; - if (enterpriseSearchVersion !== kibanaVersion) { + if (isVersionMismatch(enterpriseSearchVersion, kibanaVersion)) { log.warn( `Your Kibana instance (v${kibanaVersion}) is not the same version as your Enterprise Search instance (v${enterpriseSearchVersion}), which may cause unexpected behavior. Use matching versions for the best experience.` ); diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/crawler.test.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/crawler.test.ts index 01c2ff42fc010..3070be1e56b5b 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/crawler.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/crawler.test.ts @@ -76,6 +76,44 @@ describe('crawler routes', () => { }); }); + describe('GET /internal/app_search/engines/{name}/crawler/crawl_requests/{id}', () => { + let mockRouter: MockRouter; + + beforeEach(() => { + jest.clearAllMocks(); + mockRouter = new MockRouter({ + method: 'get', + path: '/internal/app_search/engines/{name}/crawler/crawl_requests/{id}', + }); + + registerCrawlerRoutes({ + ...mockDependencies, + router: mockRouter.router, + }); + }); + + it('creates a request to enterprise search', () => { + expect(mockRequestHandler.createRequest).toHaveBeenCalledWith({ + path: '/api/as/v0/engines/:name/crawler/crawl_requests/:id', + }); + }); + + it('validates correctly with name and id', () => { + const request = { params: { name: 'some-engine', id: '12345' } }; + mockRouter.shouldValidate(request); + }); + + it('fails validation without name', () => { + const request = { params: { id: '12345' } }; + mockRouter.shouldThrow(request); + }); + + it('fails validation without id', () => { + const request = { params: { name: 'some-engine' } }; + mockRouter.shouldThrow(request); + }); + }); + describe('POST /internal/app_search/engines/{name}/crawler/crawl_requests', () => { let mockRouter: MockRouter; diff --git a/x-pack/plugins/enterprise_search/server/routes/app_search/crawler.ts b/x-pack/plugins/enterprise_search/server/routes/app_search/crawler.ts index 9336d9ac93e70..f53b15dadd061 100644 --- a/x-pack/plugins/enterprise_search/server/routes/app_search/crawler.ts +++ b/x-pack/plugins/enterprise_search/server/routes/app_search/crawler.ts @@ -41,6 +41,21 @@ export function registerCrawlerRoutes({ }) ); + router.get( + { + path: '/internal/app_search/engines/{name}/crawler/crawl_requests/{id}', + validate: { + params: schema.object({ + name: schema.string(), + id: schema.string(), + }), + }, + }, + enterpriseSearchRequestHandler.createRequest({ + path: '/api/as/v0/engines/:name/crawler/crawl_requests/:id', + }) + ); + router.post( { path: '/internal/app_search/engines/{name}/crawler/crawl_requests', diff --git a/x-pack/plugins/file_upload/public/components/import_complete_view.tsx b/x-pack/plugins/file_upload/public/components/import_complete_view.tsx index 59862aea24701..f9fc46227db76 100644 --- a/x-pack/plugins/file_upload/public/components/import_complete_view.tsx +++ b/x-pack/plugins/file_upload/public/components/import_complete_view.tsx @@ -7,7 +7,7 @@ import React, { Component, Fragment } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonIcon, EuiCallOut, diff --git a/x-pack/plugins/fleet/common/authz.ts b/x-pack/plugins/fleet/common/authz.ts new file mode 100644 index 0000000000000..2a9205ada0e0f --- /dev/null +++ b/x-pack/plugins/fleet/common/authz.ts @@ -0,0 +1,64 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export interface FleetAuthz { + fleet: { + all: boolean; + setup: boolean; + readEnrollmentTokens: boolean; + }; + + integrations: { + readPackageInfo: boolean; + readInstalledPackages: boolean; + installPackages: boolean; + upgradePackages: boolean; + removePackages: boolean; + + readPackageSettings: boolean; + writePackageSettings: boolean; + + readIntegrationPolicies: boolean; + writeIntegrationPolicies: boolean; + }; +} + +interface CalculateParams { + fleet: { + all: boolean; + setup: boolean; + }; + + integrations: { + all: boolean; + read: boolean; + }; +} + +export const calculateAuthz = ({ fleet, integrations }: CalculateParams): FleetAuthz => ({ + fleet: { + all: fleet.all && (integrations.all || integrations.read), + + // These are currently used by Fleet Server setup + setup: fleet.all || fleet.setup, + readEnrollmentTokens: fleet.all || fleet.setup, + }, + + integrations: { + readPackageInfo: fleet.all || fleet.setup || integrations.all || integrations.read, + readInstalledPackages: integrations.all || integrations.read, + installPackages: fleet.all && integrations.all, + upgradePackages: fleet.all && integrations.all, + removePackages: fleet.all && integrations.all, + + readPackageSettings: fleet.all && integrations.all, + writePackageSettings: fleet.all && integrations.all, + + readIntegrationPolicies: fleet.all && integrations.all, + writeIntegrationPolicies: fleet.all && integrations.all, + }, +}); diff --git a/x-pack/plugins/fleet/common/index.ts b/x-pack/plugins/fleet/common/index.ts index 029460c1750c2..611e150323855 100644 --- a/x-pack/plugins/fleet/common/index.ts +++ b/x-pack/plugins/fleet/common/index.ts @@ -11,3 +11,5 @@ export * from './constants'; export * from './services'; export * from './types'; +export type { FleetAuthz } from './authz'; +export { calculateAuthz } from './authz'; diff --git a/x-pack/plugins/fleet/common/services/routes.ts b/x-pack/plugins/fleet/common/services/routes.ts index 77445d88356ce..8ab02c462cfa4 100644 --- a/x-pack/plugins/fleet/common/services/routes.ts +++ b/x-pack/plugins/fleet/common/services/routes.ts @@ -166,6 +166,9 @@ export const outputRoutesService = { getUpdatePath: (outputId: string) => OUTPUT_API_ROUTES.UPDATE_PATTERN.replace('{outputId}', outputId), getListPath: () => OUTPUT_API_ROUTES.LIST_PATTERN, + getDeletePath: (outputId: string) => + OUTPUT_API_ROUTES.DELETE_PATTERN.replace('{outputId}', outputId), + getCreatePath: () => OUTPUT_API_ROUTES.CREATE_PATTERN, }; export const settingsRoutesService = { diff --git a/x-pack/plugins/fleet/common/types/rest_spec/output.ts b/x-pack/plugins/fleet/common/types/rest_spec/output.ts index f8eb20b51f208..4e380feeb83a8 100644 --- a/x-pack/plugins/fleet/common/types/rest_spec/output.ts +++ b/x-pack/plugins/fleet/common/types/rest_spec/output.ts @@ -26,9 +26,25 @@ export interface PutOutputRequest { outputId: string; }; body: { + type?: 'elasticsearch'; + name?: string; hosts?: string[]; ca_sha256?: string; - config?: Record; + config_yaml?: string; + is_default?: boolean; + is_default_monitoring?: boolean; + }; +} + +export interface PostOutputRequest { + body: { + id?: string; + type: 'elasticsearch'; + name: string; + hosts?: string[]; + ca_sha256?: string; + is_default?: boolean; + is_default_monitoring?: boolean; config_yaml?: string; }; } diff --git a/x-pack/plugins/fleet/public/applications/fleet/app.tsx b/x-pack/plugins/fleet/public/applications/fleet/app.tsx index 73be40c3c32d9..c9ccd797b2eec 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/app.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/app.tsx @@ -11,7 +11,7 @@ import type { AppMountParameters } from 'kibana/public'; import { EuiCode, EuiEmptyPrompt, EuiErrorBoundary, EuiPanel } from '@elastic/eui'; import type { History } from 'history'; import { Router, Redirect, Route, Switch, useRouteMatch } from 'react-router-dom'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import styled from 'styled-components'; import useObservable from 'react-use/lib/useObservable'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/layouts/default/default.tsx b/x-pack/plugins/fleet/public/applications/fleet/layouts/default/default.tsx index c8dd428f0df5e..d1422f5b9d8c5 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/layouts/default/default.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/layouts/default/default.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { Section } from '../../sections'; import { useLink, useConfig } from '../../hooks'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/layouts/default/default_page_title.tsx b/x-pack/plugins/fleet/public/applications/fleet/layouts/default/default_page_title.tsx index 3d0a7717d1e1a..adc411e0e5f4e 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/layouts/default/default_page_title.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/layouts/default/default_page_title.tsx @@ -8,7 +8,7 @@ import type { FunctionComponent } from 'react'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, EuiTitle, EuiText } from '@elastic/eui'; export const DefaultPageTitle: FunctionComponent = () => { diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/actions_menu.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/actions_menu.tsx index 08b0507f7c621..65b5bb2320c02 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/actions_menu.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/actions_menu.tsx @@ -6,7 +6,7 @@ */ import React, { memo, useState, useMemo, useCallback } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiContextMenuItem, EuiPortal } from '@elastic/eui'; import type { AgentPolicy } from '../../../types'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_copy_provider.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_copy_provider.tsx index 68f05624a8664..fb77ee028e913 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_copy_provider.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_copy_provider.tsx @@ -8,7 +8,7 @@ import React, { Fragment, useRef, useState } from 'react'; import { EuiConfirmModal, EuiFormRow, EuiFieldText } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { AgentPolicy } from '../../../types'; import { sendCopyAgentPolicy, useStartServices } from '../../../hooks'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_delete_provider.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_delete_provider.tsx index b8d8f212a5451..4041766113991 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_delete_provider.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_delete_provider.tsx @@ -8,7 +8,7 @@ import React, { Fragment, useRef, useState } from 'react'; import { EuiConfirmModal, EuiCallOut } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { AGENTS_PREFIX } from '../../../constants'; import { sendDeleteAgentPolicy, useStartServices, useConfig, sendRequest } from '../../../hooks'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_form.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_form.tsx index 28b04e2fb69ac..fad45ba7b711b 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_form.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_form.tsx @@ -23,7 +23,7 @@ import { EuiLink, EuiFieldNumber, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import styled from 'styled-components'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_yaml_flyout.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_yaml_flyout.tsx index 8cc07556eee7f..97d7ef72a9ec6 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_yaml_flyout.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_yaml_flyout.tsx @@ -7,7 +7,7 @@ import React, { memo } from 'react'; import styled from 'styled-components'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { safeDump } from 'js-yaml'; import { EuiCodeBlock, diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/confirm_deploy_modal.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/confirm_deploy_modal.tsx index fc34680eab063..1198db3034dee 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/confirm_deploy_modal.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/confirm_deploy_modal.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiCallOut, EuiConfirmModal, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import type { AgentPolicy } from '../../../types'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/layout.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/layout.tsx index b7c7d263d2675..00ebbe33e5084 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/layout.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/layout.tsx @@ -6,7 +6,7 @@ */ import React, { memo, useMemo } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import styled from 'styled-components'; import { EuiFlexGroup, diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/multi_text_input.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/multi_text_input.tsx index e4e724199b493..66ec097624c41 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/multi_text_input.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/multi_text_input.tsx @@ -16,7 +16,7 @@ import { EuiSpacer, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; interface Props { value: string[]; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/package_policy_input_config.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/package_policy_input_config.tsx index b465ddeee97f8..50305249ab7f4 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/package_policy_input_config.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/package_policy_input_config.tsx @@ -7,7 +7,7 @@ import React, { useState, Fragment, memo, useMemo } from 'react'; import styled from 'styled-components'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGrid, EuiFlexGroup, diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/package_policy_input_panel.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/package_policy_input_panel.tsx index 050177850818a..e8366a38c0c60 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/package_policy_input_panel.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/package_policy_input_panel.tsx @@ -8,7 +8,7 @@ import React, { useState, Fragment, memo, useMemo } from 'react'; import styled from 'styled-components'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/package_policy_input_stream.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/package_policy_input_stream.tsx index 5cc1fc4130256..8e7dda174f363 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/package_policy_input_stream.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/package_policy_input_stream.tsx @@ -8,7 +8,7 @@ import React, { useState, Fragment, memo, useMemo } from 'react'; import ReactMarkdown from 'react-markdown'; import styled from 'styled-components'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGrid, EuiFlexGroup, diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/package_policy_input_var_field.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/package_policy_input_var_field.tsx index 954addd4202b1..20d77275eeaf7 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/package_policy_input_var_field.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/package_policy_input_var_field.tsx @@ -8,7 +8,7 @@ import React, { useState, memo, useMemo } from 'react'; import ReactMarkdown from 'react-markdown'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFormRow, EuiSwitch, diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/post_install_add_agent_modal.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/post_install_add_agent_modal.tsx index c91b6d348180d..47e05b951e58a 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/post_install_add_agent_modal.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/post_install_add_agent_modal.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiConfirmModal } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { AgentPolicy, PackageInfo } from '../../../../types'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/index.tsx index ac828f5fb40ac..4f1211a83ebba 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/index.tsx @@ -10,7 +10,7 @@ import React, { useState, useEffect, useMemo, useCallback, useRef } from 'react' import { useRouteMatch, useHistory, useLocation } from 'react-router-dom'; import styled from 'styled-components'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, EuiButton, diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/step_configure_package.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/step_configure_package.tsx index b3de6785a7dac..f18c7f5e0b43e 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/step_configure_package.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/step_configure_package.tsx @@ -13,7 +13,7 @@ import { EuiEmptyPrompt, EuiText, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { PackageInfo, NewPackagePolicy, NewPackagePolicyInput } from '../../../types'; import { Loading } from '../../../components'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/step_define_package_policy.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/step_define_package_policy.tsx index 63e9ba64ad753..2ac6d91ea35d0 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/step_define_package_policy.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/step_define_package_policy.tsx @@ -7,7 +7,7 @@ import React, { memo, useEffect, useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFormRow, EuiFieldText, @@ -328,34 +328,6 @@ export const StepDefinePackagePolicy: React.FunctionComponent<{ /> - - - } - helpText={ - - {i18n.translate( - 'xpack.fleet.createPackagePolicy.stepConfigure.packagePolicyDataRetentionLearnMoreLink', - { defaultMessage: 'Learn more' } - )} - - ), - }} - /> - } - > -
- - {/* Advanced vars */} {advancedVars.map((varDef) => { const { name: varName, type: varType } = varDef; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/step_select_agent_policy.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/step_select_agent_policy.tsx index 72bd829dcf61a..58af86b09ed03 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/step_select_agent_policy.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/step_select_agent_policy.tsx @@ -8,7 +8,7 @@ import React, { useEffect, useState, useMemo, useCallback } from 'react'; import styled from 'styled-components'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { EuiComboBoxOptionOption } from '@elastic/eui'; import { EuiFlexGroup, diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/package_policies/no_package_policies.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/package_policies/no_package_policies.tsx index 80b0c0a114f22..dede1dc905f85 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/package_policies/no_package_policies.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/package_policies/no_package_policies.tsx @@ -6,7 +6,7 @@ */ import React, { memo } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiEmptyPrompt } from '@elastic/eui'; import { useCapabilities, useStartServices } from '../../../../../hooks'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/package_policies/package_policies_table.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/package_policies/package_policies_table.tsx index 9f125533f36c2..09ecfc94ab7b6 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/package_policies/package_policies_table.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/package_policies/package_policies_table.tsx @@ -7,7 +7,7 @@ import React, { useMemo } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { EuiInMemoryTableProps } from '@elastic/eui'; import { EuiInMemoryTable, diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/settings/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/settings/index.tsx index 00cf3a5d4fcd6..0b4c61273cb5e 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/settings/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/settings/index.tsx @@ -17,7 +17,7 @@ import { EuiSpacer, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { AgentPolicy } from '../../../../../types'; import { diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/index.tsx index c1d0e089fcc65..b7aca72e8979c 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/index.tsx @@ -8,7 +8,7 @@ import React, { useMemo, useState } from 'react'; import { Redirect, useRouteMatch, Switch, Route, useHistory, useLocation } from 'react-router-dom'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage, FormattedDate } from '@kbn/i18n/react'; +import { FormattedMessage, FormattedDate } from '@kbn/i18n-react'; import { EuiButtonEmpty, EuiDescriptionList, diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.tsx index f082a2931681e..c0914e41872b1 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.tsx @@ -8,7 +8,7 @@ import React, { useState, useEffect, useCallback, useMemo, memo } from 'react'; import { useRouteMatch } from 'react-router-dom'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { safeLoad } from 'js-yaml'; import { EuiButtonEmpty, diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/list_page/components/create_agent_policy.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/list_page/components/create_agent_policy.tsx index 0ea9ca89f622c..e420b3ce4ce99 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/list_page/components/create_agent_policy.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/list_page/components/create_agent_policy.tsx @@ -8,7 +8,7 @@ import React, { useState } from 'react'; import styled from 'styled-components'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { EuiFlyoutProps } from '@elastic/eui'; import { EuiFlyout, diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/list_page/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/list_page/index.tsx index b940086effeaa..6a07be853f3ca 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/list_page/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/list_page/index.tsx @@ -19,7 +19,7 @@ import { } from '@elastic/eui'; import type { CriteriaWithPagination } from '@elastic/eui/src/components/basic_table/basic_table'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage, FormattedDate } from '@kbn/i18n/react'; +import { FormattedMessage, FormattedDate } from '@kbn/i18n-react'; import { useHistory } from 'react-router-dom'; import type { AgentPolicy } from '../../../types'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/actions_menu.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/actions_menu.tsx index 0e36c99432cf5..0f1c70f7cb481 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/actions_menu.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/actions_menu.tsx @@ -7,7 +7,7 @@ import React, { memo, useState, useMemo } from 'react'; import { EuiPortal, EuiContextMenuItem } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { Agent, AgentPolicy, PackagePolicy } from '../../../../types'; import { useCapabilities, useKibanaVersion } from '../../../../hooks'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details/agent_details_overview.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details/agent_details_overview.tsx index 9567fc3f372c7..c8da214135274 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details/agent_details_overview.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details/agent_details_overview.tsx @@ -18,7 +18,7 @@ import { EuiToolTip, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { Agent, AgentPolicy } from '../../../../../types'; import { useKibanaVersion } from '../../../../../hooks'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details/index.tsx index a0afa635beab8..32abf5c7845d1 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details/index.tsx @@ -8,7 +8,7 @@ import React, { memo } from 'react'; import styled from 'styled-components'; import { EuiFlexGroup, EuiFlexItem, EuiTitle, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { Agent, AgentPolicy } from '../../../../../types'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/agent_logs.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/agent_logs.tsx index 045c9c28c378c..c0685f72d9e5c 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/agent_logs.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/agent_logs.tsx @@ -22,7 +22,7 @@ import { EuiLink, } from '@elastic/eui'; import useMeasure from 'react-use/lib/useMeasure'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { fromKueryExpression } from '@kbn/es-query'; import semverGte from 'semver/functions/gte'; import semverCoerce from 'semver/functions/coerce'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/select_log_level.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/select_log_level.tsx index 5aadecf2ed27c..2b90c45d50fee 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/select_log_level.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_logs/select_log_level.tsx @@ -7,7 +7,7 @@ import React, { memo, useState, useCallback } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiSelect, EuiFormLabel, EuiButtonEmpty, EuiFlexItem, EuiFlexGroup } from '@elastic/eui'; import type { Agent } from '../../../../../types'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/index.tsx index f3430110ba283..4690e922a50d4 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/index.tsx @@ -18,7 +18,7 @@ import { EuiDescriptionListDescription, } from '@elastic/eui'; import type { Props as EuiTabProps } from '@elastic/eui/src/components/tabs/tab'; -import { FormattedMessage, FormattedRelative } from '@kbn/i18n/react'; +import { FormattedMessage, FormattedRelative } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiIconTip } from '@elastic/eui'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/bulk_actions.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/bulk_actions.tsx index b59ef1f749fb2..6fd34f0239996 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/bulk_actions.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/bulk_actions.tsx @@ -17,7 +17,7 @@ import { EuiIcon, EuiPortal, } from '@elastic/eui'; -import { FormattedMessage, FormattedNumber } from '@kbn/i18n/react'; +import { FormattedMessage, FormattedNumber } from '@kbn/i18n-react'; import { SO_SEARCH_LIMIT } from '../../../../constants'; import type { Agent } from '../../../../types'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/search_and_filter_bar.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/search_and_filter_bar.tsx index 5fa60eb72b2e5..46aafb8a31877 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/search_and_filter_bar.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/search_and_filter_bar.tsx @@ -17,7 +17,7 @@ import { EuiPortal, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { AgentPolicy } from '../../../../types'; import { AgentEnrollmentFlyout, SearchBar } from '../../../../components'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.tsx index 2e984a58bb429..0dbe947369ad3 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.tsx @@ -20,7 +20,7 @@ import { EuiPortal, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage, FormattedRelative } from '@kbn/i18n/react'; +import { FormattedMessage, FormattedRelative } from '@kbn/i18n-react'; import type { Agent, AgentPolicy, PackagePolicy, SimplifiedAgentStatus } from '../../../types'; import { diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_requirements_page/components/fleet_server_cloud_instructions.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_requirements_page/components/fleet_server_cloud_instructions.tsx index e2db1534597e0..7585bd31d57d1 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_requirements_page/components/fleet_server_cloud_instructions.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_requirements_page/components/fleet_server_cloud_instructions.tsx @@ -17,7 +17,7 @@ import { EuiSpacer, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useFleetStatus, useStartServices } from '../../../../hooks'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_requirements_page/components/fleet_server_on_prem_instructions.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_requirements_page/components/fleet_server_on_prem_instructions.tsx index 0b4461e26851e..4efff98fe39b2 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_requirements_page/components/fleet_server_on_prem_instructions.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_requirements_page/components/fleet_server_on_prem_instructions.tsx @@ -27,7 +27,7 @@ import { import type { EuiStepProps } from '@elastic/eui/src/components/steps/step'; import styled from 'styled-components'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { DownloadStep } from '../../../../components'; import { diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_requirements_page/es_requirements_page.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_requirements_page/es_requirements_page.tsx index 5aff449a923b3..9191dc39c142c 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_requirements_page/es_requirements_page.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_requirements_page/es_requirements_page.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiPageBody, EuiPageContent, diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_health.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_health.tsx index 3d7b717fcb13f..8d04a6f3cefc3 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_health.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_health.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage, FormattedRelative } from '@kbn/i18n/react'; +import { FormattedMessage, FormattedRelative } from '@kbn/i18n-react'; import { EuiBadge, EuiToolTip } from '@elastic/eui'; import { euiLightVars as euiVars } from '@kbn/ui-shared-deps-src/theme'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_reassign_policy_modal/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_reassign_policy_modal/index.tsx index 2109fa46de71a..566bc7f4363ab 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_reassign_policy_modal/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_reassign_policy_modal/index.tsx @@ -15,7 +15,7 @@ import { EuiSelect, EuiFormRow, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { Agent } from '../../../../types'; import { diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_unenroll_modal/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_unenroll_modal/index.tsx index fae88fcda4bc8..8397285265886 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_unenroll_modal/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_unenroll_modal/index.tsx @@ -8,7 +8,7 @@ import React, { useState } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiCallOut, EuiConfirmModal, EuiFormFieldset, EuiCheckbox, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { Agent } from '../../../../types'; import { diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_upgrade_modal/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_upgrade_modal/index.tsx index 19ef618c144cc..37b1ad7a05bd5 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_upgrade_modal/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_upgrade_modal/index.tsx @@ -8,7 +8,7 @@ import React, { useState } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiConfirmModal, EuiBetaBadge, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { Agent } from '../../../../types'; import { diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/fleet_server_callouts/fleet_server_cloud_unhealthy_callout.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/fleet_server_callouts/fleet_server_cloud_unhealthy_callout.tsx index a2128b52db999..073a602dd47e5 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/fleet_server_callouts/fleet_server_cloud_unhealthy_callout.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/fleet_server_callouts/fleet_server_cloud_unhealthy_callout.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCallOut, EuiLink, EuiButton, EuiSpacer } from '@elastic/eui'; import { useStartServices } from '../../../../hooks'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/fleet_server_callouts/fleet_server_on_prem_required_callout.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/fleet_server_callouts/fleet_server_on_prem_required_callout.tsx index 74703a32a500c..49b01657d0d4b 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/fleet_server_callouts/fleet_server_on_prem_required_callout.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/fleet_server_callouts/fleet_server_on_prem_required_callout.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCallOut, EuiLink } from '@elastic/eui'; import { useStartServices } from '../../../../hooks'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/fleet_server_callouts/fleet_server_on_prem_unhealthy_callout.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/fleet_server_callouts/fleet_server_on_prem_unhealthy_callout.tsx index aedd682831db5..34ca37fda82f2 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/fleet_server_callouts/fleet_server_on_prem_unhealthy_callout.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/fleet_server_callouts/fleet_server_on_prem_unhealthy_callout.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCallOut, EuiLink, EuiButton, EuiSpacer } from '@elastic/eui'; import { useStartServices } from '../../../../hooks'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/fleet_server_upgrade_modal.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/fleet_server_upgrade_modal.tsx index b1f6fa794ffd8..2d963ea0ddf30 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/fleet_server_upgrade_modal.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/fleet_server_upgrade_modal.tsx @@ -21,7 +21,7 @@ import { EuiSpacer, EuiText, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/enrollment_token_list_page/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/enrollment_token_list_page/index.tsx index a62c76882b2a1..b8b66b42b533d 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/enrollment_token_list_page/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/enrollment_token_list_page/index.tsx @@ -19,7 +19,7 @@ import { EuiIcon, EuiText, } from '@elastic/eui'; -import { FormattedMessage, FormattedDate } from '@kbn/i18n/react'; +import { FormattedMessage, FormattedDate } from '@kbn/i18n-react'; import { ENROLLMENT_API_KEYS_INDEX } from '../../../constants'; import { NewEnrollmentTokenModal } from '../../../components'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/error_pages/enforce_security.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/error_pages/enforce_security.tsx index bc5c097914a8e..74475aca10d5d 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/error_pages/enforce_security.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/error_pages/enforce_security.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage, injectI18n } from '@kbn/i18n/react'; +import { FormattedMessage, injectI18n } from '@kbn/i18n-react'; import { NoDataLayout } from './components/no_data_layout'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/error_pages/invalid_license.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/error_pages/invalid_license.tsx index 88f5e71890b69..66f4d5fca19ca 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/error_pages/invalid_license.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/error_pages/invalid_license.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage, injectI18n } from '@kbn/i18n/react'; +import { FormattedMessage, injectI18n } from '@kbn/i18n-react'; import { NoDataLayout } from './components/no_data_layout'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/error_pages/no_access.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/error_pages/no_access.tsx index 93ecb107f633b..8bb8cf6094ef3 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/error_pages/no_access.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/error_pages/no_access.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage, injectI18n } from '@kbn/i18n/react'; +import { FormattedMessage, injectI18n } from '@kbn/i18n-react'; import { NoDataLayout } from './components/no_data_layout'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/index.tsx index 18a684baad60d..3f9f9220c5015 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/index.tsx @@ -6,7 +6,7 @@ */ import React, { useCallback, useEffect, useState, useMemo } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Router, Route, Switch, useHistory } from 'react-router-dom'; import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiPortal } from '@elastic/eui'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/data_stream/list_page/components/data_stream_row_actions.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/data_stream/list_page/components/data_stream_row_actions.tsx index 4dedfc1bfdb4e..18c71c2396621 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/data_stream/list_page/components/data_stream_row_actions.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/data_stream/list_page/components/data_stream_row_actions.tsx @@ -7,7 +7,7 @@ import React, { memo } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { DataStream } from '../../../../types'; import { useKibanaLink } from '../../../../hooks'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/data_stream/list_page/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/data_stream/list_page/index.tsx index 655488e3ae6a7..aed6c34712012 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/data_stream/list_page/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/data_stream/list_page/index.tsx @@ -16,7 +16,7 @@ import { EuiInMemoryTable, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage, FormattedDate } from '@kbn/i18n/react'; +import { FormattedMessage, FormattedDate } from '@kbn/i18n-react'; import type { DataStream } from '../../../types'; import { useGetDataStreams, useStartServices, usePagination, useBreadcrumbs } from '../../../hooks'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/index.tsx new file mode 100644 index 0000000000000..824eec081e28b --- /dev/null +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/index.tsx @@ -0,0 +1,229 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { + EuiFlyout, + EuiFlyoutBody, + EuiFlyoutHeader, + EuiTitle, + EuiFlyoutFooter, + EuiFlexGroup, + EuiFlexItem, + EuiButtonEmpty, + EuiButton, + EuiForm, + EuiFormRow, + EuiFieldText, + EuiSelect, + EuiSwitch, + EuiCallOut, + EuiSpacer, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; + +import { HostsInput } from '../hosts_input'; +import type { Output } from '../../../../types'; +import { FLYOUT_MAX_WIDTH } from '../../constants'; + +import { YamlCodeEditorWithPlaceholder } from './yaml_code_editor_with_placeholder'; +import { useOutputForm } from './use_output_form'; + +export interface EditOutputFlyoutProps { + output?: Output; + onClose: () => void; +} + +export const EditOutputFlyout: React.FunctionComponent = ({ + onClose, + output, +}) => { + const form = useOutputForm(onClose, output); + const inputs = form.inputs; + + return ( + + + +

+ {!output ? ( + + ) : ( + + )} +

+
+
+ + {output?.is_preconfigured && ( + <> + + } + > + + + + + )} + + + } + {...inputs.nameInput.formRowProps} + > + + + + } + > + + + + + + + + + + + ), + }} + /> + } + /> + + + + + + ), + }} + /> + } + /> + + + + + + + + + + + + + + + + + +
+ ); +}; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_form_validators.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_form_validators.test.tsx new file mode 100644 index 0000000000000..1ad49dc091412 --- /dev/null +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_form_validators.test.tsx @@ -0,0 +1,75 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { validateHosts, validateYamlConfig } from './output_form_validators'; + +describe('Output form validation', () => { + describe('validateHosts', () => { + it('should work without any urls', () => { + const res = validateHosts([]); + + expect(res).toBeUndefined(); + }); + + it('should work with valid url', () => { + const res = validateHosts(['https://test.fr:9200']); + + expect(res).toBeUndefined(); + }); + + it('should return an error with invalid url', () => { + const res = validateHosts(['toto']); + + expect(res).toEqual([{ index: 0, message: 'Invalid URL' }]); + }); + + it('should return an error with url with invalid port', () => { + const res = validateHosts(['https://test.fr:qwerty9200']); + + expect(res).toEqual([{ index: 0, message: 'Invalid URL' }]); + }); + + it('should return an error with multiple invalid urls', () => { + const res = validateHosts(['toto', 'tata']); + + expect(res).toEqual([ + { index: 0, message: 'Invalid URL' }, + { index: 1, message: 'Invalid URL' }, + ]); + }); + it('should return an error with duplicate urls', () => { + const res = validateHosts(['http://test.fr', 'http://test.fr']); + + expect(res).toEqual([ + { index: 0, message: 'Duplicate URL' }, + { index: 1, message: 'Duplicate URL' }, + ]); + }); + }); + describe('validateYamlConfig', () => { + it('should work with an empty yaml', () => { + const res = validateYamlConfig(``); + + expect(res).toBeUndefined(); + }); + + it('should work with valid yaml', () => { + const res = validateYamlConfig(`test: 123`); + + expect(res).toBeUndefined(); + }); + + it('should return an error with invalid yaml', () => { + const res = validateYamlConfig(`{}}`); + + expect(res).toBeDefined(); + if (typeof res !== 'undefined') { + expect(res[0]).toContain('Invalid YAML: '); + } + }); + }); +}); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_form_validators.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_form_validators.tsx new file mode 100644 index 0000000000000..5d4bebb3cb7d8 --- /dev/null +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_form_validators.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; +import { safeLoad } from 'js-yaml'; + +export function validateHosts(value: string[]) { + const res: Array<{ message: string; index: number }> = []; + const urlIndexes: { [key: string]: number[] } = {}; + value.forEach((val, idx) => { + try { + const urlParsed = new URL(val); + if (!['http:', 'https:'].includes(urlParsed.protocol)) { + throw new Error('Invalid protocol'); + } + } catch (error) { + res.push({ + message: i18n.translate('xpack.fleet.settings.outputForm.elasticHostError', { + defaultMessage: 'Invalid URL', + }), + index: idx, + }); + } + + const curIndexes = urlIndexes[val] || []; + urlIndexes[val] = [...curIndexes, idx]; + }); + + Object.values(urlIndexes) + .filter(({ length }) => length > 1) + .forEach((indexes) => { + indexes.forEach((index) => + res.push({ + message: i18n.translate('xpack.fleet.settings.outputForm.elasticHostDuplicateError', { + defaultMessage: 'Duplicate URL', + }), + index, + }) + ); + }); + + if (res.length) { + return res; + } +} + +export function validateYamlConfig(value: string) { + try { + safeLoad(value); + return; + } catch (error) { + return [ + i18n.translate('xpack.fleet.settings.outputForm.invalidYamlFormatErrorMessage', { + defaultMessage: 'Invalid YAML: {reason}', + values: { reason: error.message }, + }), + ]; + } +} + +export function validateName(value: string) { + if (!value || value === '') { + return [ + i18n.translate('xpack.fleet.settings.outputForm.nameIsRequiredErrorMessage', { + defaultMessage: 'Name is required', + }), + ]; + } +} diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/use_output_form.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/use_output_form.tsx new file mode 100644 index 0000000000000..e9cf312621a0e --- /dev/null +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/use_output_form.tsx @@ -0,0 +1,210 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useCallback, useState } from 'react'; + +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; + +import { + sendPostOutput, + useComboInput, + useInput, + useSwitchInput, + useStartServices, + sendPutOutput, +} from '../../../../hooks'; +import type { Output, PostOutputRequest } from '../../../../types'; +import { useConfirmModal } from '../../hooks/use_confirm_modal'; +import { getAgentAndPolicyCountForOutput } from '../../services/agent_and_policies_count'; + +import { validateName, validateHosts, validateYamlConfig } from './output_form_validators'; + +const ConfirmTitle = () => ( + +); + +interface ConfirmDescriptionProps { + output: Output; + agentCount: number; + agentPolicyCount: number; +} + +const ConfirmDescription: React.FunctionComponent = ({ + output, + agentCount, + agentPolicyCount, +}) => ( + {output.name}, + agents: ( + + + + ), + policies: ( + + + + ), + }} + /> +); + +async function confirmUpdate( + output: Output, + confirm: ReturnType['confirm'] +) { + const { agentCount, agentPolicyCount } = await getAgentAndPolicyCountForOutput(output); + return confirm( + , + + ); +} + +export function useOutputForm(onSucess: () => void, output?: Output) { + const [isLoading, setIsloading] = useState(false); + const { notifications } = useStartServices(); + const { confirm } = useConfirmModal(); + + // preconfigured output do not allow edition + const isPreconfigured = output?.is_preconfigured ?? false; + + // Define inputs + const nameInput = useInput(output?.name ?? '', validateName, isPreconfigured); + const typeInput = useInput(output?.type ?? '', undefined, isPreconfigured); + const elasticsearchUrlInput = useComboInput( + 'esHostsComboxBox', + output?.hosts ?? [], + validateHosts, + isPreconfigured + ); + const additionalYamlConfigInput = useInput( + output?.config_yaml ?? '', + validateYamlConfig, + isPreconfigured + ); + + const defaultOutputInput = useSwitchInput( + output?.is_default ?? false, + isPreconfigured || output?.is_default + ); + const defaultMonitoringOutputInput = useSwitchInput( + output?.is_default_monitoring ?? false, + isPreconfigured || output?.is_default_monitoring + ); + + const inputs = { + nameInput, + typeInput, + elasticsearchUrlInput, + additionalYamlConfigInput, + defaultOutputInput, + defaultMonitoringOutputInput, + }; + + const hasChanged = Object.values(inputs).some((input) => input.hasChanged); + + const validate = useCallback(() => { + const nameInputValid = nameInput.validate(); + const elasticsearchUrlsValid = elasticsearchUrlInput.validate(); + const additionalYamlConfigValid = additionalYamlConfigInput.validate(); + + if (!elasticsearchUrlsValid || !additionalYamlConfigValid || !nameInputValid) { + return false; + } + + return true; + }, [nameInput, elasticsearchUrlInput, additionalYamlConfigInput]); + + const submit = useCallback(async () => { + try { + if (!validate()) { + return; + } + setIsloading(true); + + const data: PostOutputRequest['body'] = { + name: nameInput.value, + type: 'elasticsearch', + hosts: elasticsearchUrlInput.value, + is_default: defaultOutputInput.value, + is_default_monitoring: defaultMonitoringOutputInput.value, + config_yaml: additionalYamlConfigInput.value, + }; + + if (output) { + // Update + if (!(await confirmUpdate(output, confirm))) { + setIsloading(false); + return; + } + + const res = await sendPutOutput(output.id, data); + if (res.error) { + throw res.error; + } + } else { + // Create + const res = await sendPostOutput(data); + if (res.error) { + throw res.error; + } + } + + onSucess(); + setIsloading(false); + } catch (err) { + setIsloading(false); + notifications.toasts.addError(err, { + title: i18n.translate('xpack.fleet.settings.outputForm.errorToastTitle', { + defaultMessage: 'Error while saving output', + }), + }); + } + }, [ + validate, + confirm, + additionalYamlConfigInput.value, + defaultMonitoringOutputInput.value, + defaultOutputInput.value, + elasticsearchUrlInput.value, + nameInput.value, + notifications.toasts, + onSucess, + output, + ]); + + return { + inputs, + submit, + isLoading, + isDisabled: isLoading || isPreconfigured || (output && !hasChanged), + }; +} diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/yaml_code_editor_with_placeholder.stories.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/yaml_code_editor_with_placeholder.stories.tsx new file mode 100644 index 0000000000000..320d2bb7cbef8 --- /dev/null +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/yaml_code_editor_with_placeholder.stories.tsx @@ -0,0 +1,42 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useState } from 'react'; + +import { YamlCodeEditorWithPlaceholder as Component } from './yaml_code_editor_with_placeholder'; + +export default { + component: Component, + title: 'Sections/Fleet/Settings/YamlCodeEditorWithPlaceholder', +}; + +interface Args { + width: number; + placeholder: string; +} + +const args: Args = { + width: 1200, + placeholder: '# Place holder example', +}; + +export const YamlCodeEditorWithPlaceholder = ({ width, placeholder }: Args) => { + const [value, setValue] = useState(''); + + // This component is not renderable in tests + if (typeof jest !== 'undefined') { + return null; + } + + return ( +
+ +
+ ); +}; + +YamlCodeEditorWithPlaceholder.args = args; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/yaml_code_editor_with_placeholder.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/yaml_code_editor_with_placeholder.tsx new file mode 100644 index 0000000000000..a59c61262e0b9 --- /dev/null +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/yaml_code_editor_with_placeholder.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import styled from 'styled-components'; + +import { i18n } from '@kbn/i18n'; +import { EuiCodeBlock, EuiTextColor } from '@elastic/eui'; + +import { CodeEditor } from '../../../../../../../../../../src/plugins/kibana_react/public'; +import type { CodeEditorProps } from '../../../../../../../../../../src/plugins/kibana_react/public'; + +const CodeEditorContainer = styled.div` + min-height: 0; + position: relative; + height: 116px; +`; + +const CodeEditorPlaceholder = styled(EuiTextColor).attrs((props) => ({ + color: 'subdued', + size: 'xs', +}))` + position: absolute; + top: 0; + left: 0; + // Matches monaco editor + font-family: Menlo, Monaco, 'Courier New', monospace; + font-size: 12px; + line-height: 21px; + pointer-events: none; +`; + +const CODE_EDITOR_OPTIONS: CodeEditorProps['options'] = { + minimap: { + enabled: false, + }, + + ariaLabel: i18n.translate('xpack.fleet.settings.yamlCodeEditor', { + defaultMessage: 'YAML Code Editor', + }), + scrollBeyondLastLine: false, + wordWrap: 'on', + wrappingIndent: 'indent', + automaticLayout: true, + tabSize: 2, + // To avoid left margin + lineNumbers: 'off', + lineNumbersMinChars: 0, + glyphMargin: false, + folding: false, + lineDecorationsWidth: 0, +}; + +export type YamlCodeEditorWithPlaceholderProps = Pick & { + placeholder: string; + disabled?: boolean; +}; + +export const YamlCodeEditorWithPlaceholder: React.FunctionComponent = + (props) => { + const { placeholder, disabled, ...editorProps } = props; + + if (disabled) { + return ( + +
{editorProps.value}
+
+ ); + } + + return ( + + + {(!editorProps.value || editorProps.value === '') && ( + {placeholder} + )} + + ); + }; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/fleet_server_hosts_flyout/index.stories.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/fleet_server_hosts_flyout/index.stories.tsx index 6736b5a30d23e..c4ff6917867ca 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/fleet_server_hosts_flyout/index.stories.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/fleet_server_hosts_flyout/index.stories.tsx @@ -5,19 +5,13 @@ * 2.0. */ -import { addParameters } from '@storybook/react'; import React from 'react'; import { FleetServerHostsFlyout as Component } from '.'; -addParameters({ - docs: { - inlineStories: false, - }, -}); export default { component: Component, - title: 'Sections/Fleet/Settings', + title: 'Sections/Fleet/Settings/FleetServerHostFlyout', }; interface Args { diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/fleet_server_hosts_flyout/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/fleet_server_hosts_flyout/index.tsx index 07593ffe3e6c5..42a2a5a87b036 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/fleet_server_hosts_flyout/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/fleet_server_hosts_flyout/index.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlyout, EuiFlyoutBody, @@ -19,15 +19,15 @@ import { EuiFlexItem, EuiButtonEmpty, EuiButton, + EuiSpacer, } from '@elastic/eui'; import { HostsInput } from '../hosts_input'; import { useStartServices } from '../../../../hooks'; +import { FLYOUT_MAX_WIDTH } from '../../constants'; import { useFleetServerHostsForm } from './use_fleet_server_host_form'; -const FLYOUT_MAX_WIDTH = 800; - export interface FleetServerHostsFlyoutProps { onClose: () => void; fleetServerHosts: string[]; @@ -74,6 +74,7 @@ export const FleetServerHostsFlyout: React.FunctionComponent + @@ -90,7 +91,7 @@ export const FleetServerHostsFlyout: React.FunctionComponent ( + +); + +interface ConfirmDescriptionProps { + agentCount: number; + agentPolicyCount: number; +} + +const ConfirmDescription: React.FunctionComponent = ({ + agentCount, + agentPolicyCount, +}) => ( + + + + ), + policies: ( + + + + ), + }} + /> +); + function validateFleetServerHosts(value: string[]) { if (value.length === 0) { return [ @@ -76,7 +124,7 @@ export function useFleetServerHostsForm( fleetServerHostsDefaultValue: string[], onSuccess: () => void ) { - const [isLoading, setIsLoading] = React.useState(false); + const [isLoading, setIsLoading] = useState(false); const { notifications } = useStartServices(); const { confirm } = useConfirmModal(); @@ -97,15 +145,11 @@ export function useFleetServerHostsForm( if (!validate) { return; } + const { agentCount, agentPolicyCount } = await getAgentAndPolicyCount(); if ( !(await confirm( - i18n.translate('xpack.fleet.settings.fleetServerHostsFlyout.confirmModalTitle', { - defaultMessage: 'Save and deploy changes?', - }), - i18n.translate('xpack.fleet.settings.fleetServerHostsFlyout.confirmModalDescription', { - defaultMessage: - 'This action will update all of your agent policies and all of your agents. Are you sure you wish to continue?', - }) + , + )) ) { return; @@ -136,6 +180,7 @@ export function useFleetServerHostsForm( return { isLoading, + isDisabled: isLoading || !fleetServerHostsInput.hasChanged, submit, fleetServerHostsInput, }; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/hosts_input/index.stories.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/hosts_input/index.stories.tsx index 64ac34c52d112..9b4674f3ce778 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/hosts_input/index.stories.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/hosts_input/index.stories.tsx @@ -19,22 +19,24 @@ addParameters({ export default { component: Component, - title: 'Sections/Fleet/Settings', + title: 'Sections/Fleet/Settings/HostInput', }; interface Args { width: number; label: string; helpText: string; + disabled: boolean; } const args: Args = { width: 250, label: 'Demo label', helpText: 'Demo helpText', + disabled: false, }; -export const HostsInput = ({ width, label, helpText }: Args) => { +export const HostsInput = ({ width, label, helpText, disabled }: Args) => { const [value, setValue] = useState([]); return (
@@ -44,9 +46,31 @@ export const HostsInput = ({ width, label, helpText }: Args) => { value={value} onChange={setValue} label={label} + disabled={disabled} />
); }; - HostsInput.args = args; + +export const HostsInputDisabled = ({ value }: { value: string[] }) => { + return ( +
+ {}} + label={'Host input label'} + disabled={true} + /> +
+ ); +}; + +HostsInputDisabled.args = { value: ['http://test1.fr', 'http://test2.fr'] }; +HostsInputDisabled.argTypes = { + value: { + control: { type: 'object' }, + }, +}; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/hosts_input/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/hosts_input/index.tsx index 6b169a207ea73..712bc72569776 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/hosts_input/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/hosts_input/index.tsx @@ -25,7 +25,7 @@ import { EuiFormErrorText, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { EuiTheme } from '../../../../../../../../../../src/plugins/kibana_react/common'; @@ -37,6 +37,7 @@ export interface HostInputProps { helpText?: ReactNode; errors?: Array<{ message: string; index?: number }>; isInvalid?: boolean; + disabled?: boolean; } interface SortableTextFieldProps { @@ -47,6 +48,7 @@ interface SortableTextFieldProps { onDelete: (index: number) => void; errors?: string[]; autoFocus?: boolean; + disabled?: boolean; } const DraggableDiv = sytled.div` @@ -62,7 +64,7 @@ function displayErrors(errors?: string[]) { } const SortableTextField: FunctionComponent = React.memo( - ({ id, index, value, onChange, onDelete, autoFocus, errors }) => { + ({ id, index, value, onChange, onDelete, autoFocus, errors, disabled }) => { const onDeleteHandler = useCallback(() => { onDelete(index); }, [onDelete, index]); @@ -75,6 +77,7 @@ const SortableTextField: FunctionComponent = React.memo( spacing="m" index={index} draggableId={id} + isDragDisabled={disabled} customDragHandle={true} style={{ paddingLeft: 0, @@ -109,6 +112,7 @@ const SortableTextField: FunctionComponent = React.memo( onChange={onChange} autoFocus={autoFocus} isInvalid={isInvalid} + disabled={disabled} placeholder={i18n.translate('xpack.fleet.hostsInput.placeholder', { defaultMessage: 'Specify host URL', })} @@ -120,6 +124,7 @@ const SortableTextField: FunctionComponent = React.memo( color="text" onClick={onDeleteHandler} iconType="cross" + disabled={disabled} aria-label={i18n.translate('xpack.fleet.settings.deleteHostButton', { defaultMessage: 'Delete host', })} @@ -140,6 +145,7 @@ export const HostsInput: FunctionComponent = ({ label, isInvalid, errors, + disabled, }) => { const [autoFocus, setAutoFocus] = useState(false); const value = useMemo(() => { @@ -214,7 +220,7 @@ export const HostsInput: FunctionComponent = ({ <> {helpText} - + {helpText && } {rows.map((row, idx) => ( @@ -228,6 +234,7 @@ export const HostsInput: FunctionComponent = ({ value={row.value} autoFocus={autoFocus} errors={indexedErrors[idx]} + disabled={disabled} /> ) : ( <> @@ -239,6 +246,7 @@ export const HostsInput: FunctionComponent = ({ placeholder={i18n.translate('xpack.fleet.hostsInput.placeholder', { defaultMessage: 'Specify host URL', })} + disabled={disabled} /> {displayErrors(indexedErrors[idx])} @@ -249,7 +257,13 @@ export const HostsInput: FunctionComponent = ({ {displayErrors(globalErrors)} - + diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/legacy_settings_form/confirm_modal.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/legacy_settings_form/confirm_modal.tsx deleted file mode 100644 index c4de3fe513214..0000000000000 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/legacy_settings_form/confirm_modal.tsx +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; -import { - EuiModal, - EuiModalHeader, - EuiModalHeaderTitle, - EuiModalFooter, - EuiModalBody, - EuiCallOut, - EuiButton, - EuiButtonEmpty, - EuiBasicTable, - EuiText, - EuiSpacer, -} from '@elastic/eui'; -import type { EuiBasicTableProps } from '@elastic/eui'; - -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; - -export interface SettingsConfirmModalProps { - changes: Array<{ - type: 'elasticsearch' | 'fleet_server'; - direction: 'removed' | 'added'; - urls: string[]; - }>; - onConfirm: () => void; - onClose: () => void; -} - -type Change = SettingsConfirmModalProps['changes'][0]; - -const TABLE_COLUMNS: EuiBasicTableProps['columns'] = [ - { - name: i18n.translate('xpack.fleet.settingsConfirmModal.fieldLabel', { - defaultMessage: 'Field', - }), - field: 'label', - render: (_, item) => getLabel(item), - width: '180px', - }, - { - field: 'urls', - name: i18n.translate('xpack.fleet.settingsConfirmModal.valueLabel', { - defaultMessage: 'Value', - }), - render: (_, item) => { - return ( - - {item.urls.map((url) => ( -
{url}
- ))} -
- ); - }, - }, -]; - -function getLabel(change: Change) { - if (change.type === 'elasticsearch' && change.direction === 'removed') { - return i18n.translate('xpack.fleet.settingsConfirmModal.elasticsearchRemovedLabel', { - defaultMessage: 'Elasticsearch hosts (old)', - }); - } - - if (change.type === 'elasticsearch' && change.direction === 'added') { - return i18n.translate('xpack.fleet.settingsConfirmModal.elasticsearchAddedLabel', { - defaultMessage: 'Elasticsearch hosts (new)', - }); - } - - if (change.type === 'fleet_server' && change.direction === 'removed') { - return i18n.translate('xpack.fleet.settingsConfirmModal.fleetServerRemovedLabel', { - defaultMessage: 'Fleet Server hosts (old)', - }); - } - - if (change.type === 'fleet_server' && change.direction === 'added') { - return i18n.translate('xpack.fleet.settingsConfirmModal.fleetServerAddedLabel', { - defaultMessage: 'Fleet Server hosts (new)', - }); - } - - return i18n.translate('xpack.fleet.settingsConfirmModal.defaultChangeLabel', { - defaultMessage: 'Unknown setting', - }); -} - -export const SettingsConfirmModal = React.memo( - ({ changes, onConfirm, onClose }) => { - const hasESChanges = changes.some((change) => change.type === 'elasticsearch'); - const hasFleetServerChanges = changes.some((change) => change.type === 'fleet_server'); - - return ( - - - - - - - - - - } - color="warning" - iconType="alert" - > - - {hasFleetServerChanges && ( -

- - - - ), - }} - /> -

- )} - - {hasESChanges && ( -

- - - - ), - }} - /> -

- )} -
-
- - {changes.length > 0 && ( - <> - - - - )} -
- - - - - - - - - -
- ); - } -); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/legacy_settings_form/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/legacy_settings_form/index.tsx deleted file mode 100644 index 6c52475400bdc..0000000000000 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/legacy_settings_form/index.tsx +++ /dev/null @@ -1,370 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React, { useEffect, useCallback } from 'react'; -import styled from 'styled-components'; -import { i18n } from '@kbn/i18n'; -import { - EuiPortal, - EuiTitle, - EuiFlexGroup, - EuiFlexItem, - EuiSpacer, - EuiButton, - EuiForm, - EuiFormRow, - EuiCode, - EuiPanel, - EuiTextColor, -} from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; -import { EuiText } from '@elastic/eui'; -import { safeLoad } from 'js-yaml'; - -import { - useComboInput, - useStartServices, - useGetSettings, - useInput, - useDefaultOutput, - sendPutOutput, -} from '../../../../../../hooks'; -import { normalizeHostsForAgents } from '../../../../../../../common'; -import { CodeEditor } from '../../../../../../../../../../src/plugins/kibana_react/public'; -import { HostsInput } from '../hosts_input'; - -import { SettingsConfirmModal } from './confirm_modal'; -import type { SettingsConfirmModalProps } from './confirm_modal'; - -const CodeEditorContainer = styled.div` - min-height: 0; - position: relative; - height: 250px; -`; - -const CodeEditorPlaceholder = styled(EuiTextColor).attrs((props) => ({ - color: 'subdued', - size: 'xs', -}))` - position: absolute; - top: 0; - left: 0; - // Matches monaco editor - font-family: Menlo, Monaco, 'Courier New', monospace; - font-size: 12px; - line-height: 21px; - pointer-events: none; -`; - -const URL_REGEX = /^(https?):\/\/[^\s$.?#].[^\s]*$/gm; - -function normalizeHosts(hostsInput: string[]) { - return hostsInput.map((host) => { - try { - return normalizeHostsForAgents(host); - } catch (err) { - return host; - } - }); -} - -function isSameArrayValueWithNormalizedHosts(arrayA: string[] = [], arrayB: string[] = []) { - const hostsA = normalizeHosts(arrayA); - const hostsB = normalizeHosts(arrayB); - return hostsA.length === hostsB.length && hostsA.every((val, index) => val === hostsB[index]); -} - -function useSettingsForm(outputId: string | undefined) { - const [isLoading, setIsloading] = React.useState(false); - const { notifications } = useStartServices(); - - const elasticsearchUrlInput = useComboInput('esHostsComboxBox', [], (value) => { - const res: Array<{ message: string; index: number }> = []; - const urlIndexes: { [key: string]: number[] } = {}; - value.forEach((val, idx) => { - if (!val.match(URL_REGEX)) { - res.push({ - message: i18n.translate('xpack.fleet.settings.elasticHostError', { - defaultMessage: 'Invalid URL', - }), - index: idx, - }); - } - const curIndexes = urlIndexes[val] || []; - urlIndexes[val] = [...curIndexes, idx]; - }); - - Object.values(urlIndexes) - .filter(({ length }) => length > 1) - .forEach((indexes) => { - indexes.forEach((index) => - res.push({ - message: i18n.translate('xpack.fleet.settings.elasticHostDuplicateError', { - defaultMessage: 'Duplicate URL', - }), - index, - }) - ); - }); - - if (res.length) { - return res; - } - }); - - const additionalYamlConfigInput = useInput('', (value) => { - try { - safeLoad(value); - return; - } catch (error) { - return [ - i18n.translate('xpack.fleet.settings.invalidYamlFormatErrorMessage', { - defaultMessage: 'Invalid YAML: {reason}', - values: { reason: error.message }, - }), - ]; - } - }); - - const validate = useCallback(() => { - const elasticsearchUrlsValid = elasticsearchUrlInput.validate(); - const additionalYamlConfigValid = additionalYamlConfigInput.validate(); - - if (!elasticsearchUrlsValid || !additionalYamlConfigValid) { - return false; - } - - return true; - }, [elasticsearchUrlInput, additionalYamlConfigInput]); - - return { - isLoading, - validate, - submit: async () => { - try { - setIsloading(true); - if (!outputId) { - throw new Error('Unable to load outputs'); - } - const outputResponse = await sendPutOutput(outputId, { - hosts: elasticsearchUrlInput.value, - config_yaml: additionalYamlConfigInput.value, - }); - if (outputResponse.error) { - throw outputResponse.error; - } - - notifications.toasts.addSuccess( - i18n.translate('xpack.fleet.settings.success.message', { - defaultMessage: 'Output saved', - }) - ); - setIsloading(false); - } catch (error) { - setIsloading(false); - notifications.toasts.addError(error, { - title: 'Error', - }); - } - }, - inputs: { - elasticsearchUrl: elasticsearchUrlInput, - additionalYamlConfig: additionalYamlConfigInput, - }, - }; -} - -export const LegacySettingsForm: React.FunctionComponent = () => { - const settingsRequest = useGetSettings(); - const settings = settingsRequest?.data?.item; - const { output } = useDefaultOutput(); - const { inputs, submit, validate, isLoading } = useSettingsForm(output?.id); - - const [isConfirmModalVisible, setConfirmModalVisible] = React.useState(false); - - const onSubmit = useCallback(() => { - if (validate()) { - setConfirmModalVisible(true); - } - }, [validate, setConfirmModalVisible]); - - const onConfirm = useCallback(() => { - setConfirmModalVisible(false); - submit(); - }, [submit]); - - const onConfirmModalClose = useCallback(() => { - setConfirmModalVisible(false); - }, [setConfirmModalVisible]); - - useEffect(() => { - if (output) { - inputs.elasticsearchUrl.setValue(output.hosts || []); - inputs.additionalYamlConfig.setValue(output.config_yaml || ''); - } - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [output]); - - const isUpdated = React.useMemo(() => { - if (!settings || !output) { - return false; - } - return ( - !isSameArrayValueWithNormalizedHosts(output.hosts, inputs.elasticsearchUrl.value) || - (output.config_yaml || '') !== inputs.additionalYamlConfig.value - ); - }, [settings, inputs, output]); - - const changes = React.useMemo(() => { - if (!settings || !output || !isConfirmModalVisible) { - return []; - } - - const tmpChanges: SettingsConfirmModalProps['changes'] = []; - if (!isSameArrayValueWithNormalizedHosts(output.hosts, inputs.elasticsearchUrl.value)) { - tmpChanges.push( - { - type: 'elasticsearch', - direction: 'removed', - urls: normalizeHosts(output.hosts || []), - }, - { - type: 'elasticsearch', - direction: 'added', - urls: normalizeHosts(inputs.elasticsearchUrl.value), - } - ); - } - - return tmpChanges; - }, [settings, inputs, output, isConfirmModalVisible]); - - const body = settings && ( - - - outputs, - }} - /> - - - - - - - - - - - {(!inputs.additionalYamlConfig.value || inputs.additionalYamlConfig.value === '') && ( - - {`# YAML settings here will be added to the Elasticsearch output section of each policy`} - - )} - - - - - ); - - return ( - <> - {isConfirmModalVisible && ( - - - - )} - <> - <> - -

- -

-
- - <>{body} - <> - - - - - {isLoading ? ( - - ) : ( - - )} - - - - - - - ); -}; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/outputs_table/badges.stories.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/outputs_table/badges.stories.tsx new file mode 100644 index 0000000000000..fe29bd8d7192b --- /dev/null +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/outputs_table/badges.stories.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; + +import { + DefaultMonitoringOutputBadge as DefaultMonitoringOutputBadgeComponent, + DefaultOutputBadge as DefaultOutputBadgeComponent, + DefaultBadges as Component, +} from './badges'; + +export default { + component: Component, + subcomponents: { + DefaultMonitoringOutputBadge: DefaultMonitoringOutputBadgeComponent, + DefaultOutputBadge: DefaultOutputBadgeComponent, + }, + title: 'Sections/Fleet/Settings/OutputsTable/DefaultBadges', +}; + +export const DefaultBadges = () => { + return ( +
+ +
+ ); +}; + +export const DefaultMonitoringOutputBadge = () => { + return ; +}; + +export const DefaultOutputBadge = () => { + return ; +}; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/outputs_table/badges.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/outputs_table/badges.tsx new file mode 100644 index 0000000000000..a414c7f7632ef --- /dev/null +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/outputs_table/badges.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useMemo } from 'react'; +import { EuiBadge, EuiBadgeGroup } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n-react'; + +import type { Output } from '../../../../types'; + +export const DefaultBadges = React.memo<{ + output: Pick; +}>(({ output }) => { + const badges = useMemo(() => { + const badgesArray = []; + if (output.is_default) { + badgesArray.push(); + } + if (output.is_default_monitoring) { + badgesArray.push(); + } + + return badgesArray; + }, [output]); + return {badges.map((badge, idx) => badge)}; +}); + +export const DefaultOutputBadge = () => ( + + + +); + +export const DefaultMonitoringOutputBadge = () => ( + + + +); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/outputs_table/index.stories.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/outputs_table/index.stories.tsx new file mode 100644 index 0000000000000..70fb81b9f33db --- /dev/null +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/outputs_table/index.stories.tsx @@ -0,0 +1,104 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; + +import type { Output } from '../../../../types'; + +import { OutputsTable as Component } from '.'; + +export default { + component: Component, + title: 'Sections/Fleet/Settings/OutputsTable', +}; + +interface Args { + width: number; +} + +const args: Args = { + width: 1200, +}; + +const outputs: Output[] = [ + { + id: 'output1', + name: 'Demo output 1', + is_default: true, + is_default_monitoring: false, + type: 'elasticsearch', + hosts: ['http://elasticsearch-host-test.fr:9200'], + }, + { + id: 'output2', + name: 'Demo output 2', + is_default: false, + is_default_monitoring: true, + type: 'elasticsearch', + hosts: ['http://test.fr:9200'], + }, + { + id: 'output3', + name: 'Demo output 3', + is_default: false, + is_default_monitoring: false, + type: 'elasticsearch', + hosts: ['http://elasticsearch-host-test.fr:9200'], + }, + { + id: 'output4', + name: 'Demo output 4 preconfigured', + is_default: false, + is_default_monitoring: false, + is_preconfigured: true, + type: 'elasticsearch', + hosts: ['http://elasticsearch-host-test.fr:9200'], + }, + { + id: 'output5', + name: 'Demo output 5 preconfigured with a long name really long name', + is_default: false, + is_default_monitoring: false, + is_preconfigured: true, + type: 'elasticsearch', + hosts: ['http://elasticsearch-host-test.fr:9200'], + }, + { + id: 'output6', + name: 'Demo output 6 multiple hosts', + is_default: false, + is_default_monitoring: false, + type: 'elasticsearch', + hosts: ['http://elasticsearch-host-test1.fr:443', 'http://elasticsearch-host-test2.fr:443'], + }, + { + id: 'output7', + name: 'Demo output 7 both default', + is_default: true, + is_default_monitoring: true, + type: 'elasticsearch', + hosts: ['http://test.fr:9200'], + }, + { + id: 'output8', + name: 'Demo output 8 long host name', + is_default: true, + is_default_monitoring: true, + type: 'elasticsearch', + hosts: ['http://elasticsearch-host-with-a-very-long-name-very-very-long.fr:9200'], + }, +]; + +export const OutputsTable = ({ width }: Args) => { + return ( +
+ {}} outputs={outputs} /> +
+ ); +}; + +OutputsTable.args = args; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/outputs_table/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/outputs_table/index.tsx new file mode 100644 index 0000000000000..a2b85cbbc5ef2 --- /dev/null +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/outputs_table/index.tsx @@ -0,0 +1,144 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useMemo } from 'react'; +import styled from 'styled-components'; +import { EuiBasicTable, EuiButtonIcon, EuiFlexGroup, EuiFlexItem, EuiIcon } from '@elastic/eui'; +import type { EuiBasicTableColumn } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; + +import { useLink } from '../../../../hooks'; +import type { Output } from '../../../../types'; + +import { DefaultBadges } from './badges'; + +export interface OutputsTableProps { + outputs: Output[]; + deleteOutput: (output: Output) => void; +} + +const NameFlexItemWithMaxWidth = styled(EuiFlexItem)` + max-width: 250px; +`; + +// Allow child to be truncated +const FlexGroupWithMinWidth = styled(EuiFlexGroup)` + min-width: 0px; +`; + +function displayOutputType(type: string) { + switch (type) { + case 'elasticsearch': + return i18n.translate('xpack.fleet.settings.outputsTable.elasticsearchTypeLabel', { + defaultMessage: 'Elasticsearch', + }); + default: + return type; + } +} + +export const OutputsTable: React.FunctionComponent = ({ + outputs, + deleteOutput, +}) => { + const { getHref } = useLink(); + + const columns = useMemo((): Array> => { + return [ + { + render: (output: Output) => ( + + +

+ {output.name} +

+
+ {output.is_preconfigured && ( + + + + )} +
+ ), + width: '288px', + name: i18n.translate('xpack.fleet.settings.outputsTable.nameColomnTitle', { + defaultMessage: 'Name', + }), + }, + { + width: '172px', + render: (output: Output) => displayOutputType(output.type), + name: i18n.translate('xpack.fleet.settings.outputsTable.typeColomnTitle', { + defaultMessage: 'Type', + }), + }, + { + truncateText: true, + render: (output: Output) => ( + + {(output.hosts || []).map((host) => ( + +

+ {host} +

+
+ ))} +
+ ), + name: i18n.translate('xpack.fleet.settings.outputsTable.hostColomnTitle', { + defaultMessage: 'Hosts', + }), + }, + { + render: (output: Output) => , + width: '200px', + name: i18n.translate('xpack.fleet.settings.outputSection.defaultColomnTitle', { + defaultMessage: 'Default', + }), + }, + { + width: '68px', + render: (output: Output) => { + const isDeleteVisible = + !output.is_default && !output.is_default_monitoring && !output.is_preconfigured; + + return ( + + + {isDeleteVisible && ( + deleteOutput(output)} + title={i18n.translate('xpack.fleet.settings.outputSection.deleteButtonTitle', { + defaultMessage: 'Delete', + })} + /> + )} + + + + + + ); + }, + name: i18n.translate('xpack.fleet.settings.outputSection.actionsColomnTitle', { + defaultMessage: 'Actions', + }), + }, + ]; + }, [deleteOutput, getHref]); + + return ; +}; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/settings_page/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/settings_page/index.tsx index 66a95a7952c35..6aacaa5dc4038 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/settings_page/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/settings_page/index.tsx @@ -8,21 +8,28 @@ import React from 'react'; import { EuiSpacer } from '@elastic/eui'; -import type { Settings } from '../../../../types'; -import { LegacySettingsForm } from '../legacy_settings_form'; +import type { Output, Settings } from '../../../../types'; import { SettingsSection } from './settings_section'; +import { OutputSection } from './output_section'; export interface SettingsPageProps { settings: Settings; + outputs: Output[]; + deleteOutput: (output: Output) => void; } -export const SettingsPage: React.FunctionComponent = ({ settings }) => { +export const SettingsPage: React.FunctionComponent = ({ + settings, + outputs, + deleteOutput, +}) => { return ( <> - + + ); }; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/settings_page/output_section.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/settings_page/output_section.tsx new file mode 100644 index 0000000000000..835a3576da77b --- /dev/null +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/settings_page/output_section.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { EuiTitle, EuiText, EuiSpacer, EuiButtonEmpty } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n-react'; + +import { useLink } from '../../../../hooks'; +import type { Output } from '../../../../types'; +import { OutputsTable } from '../outputs_table'; +import { FEATURE_ADD_OUTPUT_ENABLED } from '../../constants'; + +export interface OutputSectionProps { + outputs: Output[]; + deleteOutput: (output: Output) => void; +} + +export const OutputSection: React.FunctionComponent = ({ + outputs, + deleteOutput, +}) => { + const { getHref } = useLink(); + + return ( + <> + +

+ +

+
+ + + + + + + + {FEATURE_ADD_OUTPUT_ENABLED && ( + + + + )} + + ); +}; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/settings_page/settings_section.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/settings_page/settings_section.tsx index 9aef2bb3f6380..8129943e0e6c0 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/settings_page/settings_section.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/settings_page/settings_section.tsx @@ -8,7 +8,7 @@ import React, { useMemo } from 'react'; import { EuiTitle, EuiLink, EuiText, EuiSpacer, EuiBasicTable, EuiButtonEmpty } from '@elastic/eui'; import type { EuiBasicTableColumn } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { useLink, useStartServices } from '../../../../hooks'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/constants/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/constants/index.tsx new file mode 100644 index 0000000000000..b609c4c25308f --- /dev/null +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/constants/index.tsx @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export const FLYOUT_MAX_WIDTH = 670; + +export const FEATURE_ADD_OUTPUT_ENABLED = false; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/hooks/use_confirm_modal.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/hooks/use_confirm_modal.tsx index b8663f8cb2977..542c9a1e1d154 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/hooks/use_confirm_modal.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/hooks/use_confirm_modal.tsx @@ -6,16 +6,22 @@ */ import { EuiConfirmModal, EuiPortal } from '@elastic/eui'; +import type { EuiConfirmModalProps } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React, { useCallback, useContext, useState } from 'react'; interface ModalState { title?: React.ReactNode; description?: React.ReactNode; + buttonColor?: EuiConfirmModalProps['buttonColor']; onConfirm: () => void; onCancel: () => void; } +interface ModalOptions { + buttonColor?: EuiConfirmModalProps['buttonColor']; +} + const ModalContext = React.createContext void; }>(null); @@ -24,7 +30,7 @@ export function useConfirmModal() { const context = useContext(ModalContext); const confirm = useCallback( - async (title: React.ReactNode, description: React.ReactNode) => { + async (title: React.ReactNode, description: React.ReactNode, options?: ModalOptions) => { if (context === null) { throw new Error('Context need to be provided to use useConfirmModal'); } @@ -34,6 +40,7 @@ export function useConfirmModal() { description, onConfirm: () => resolve(true), onCancel: () => resolve(false), + buttonColor: options?.buttonColor, }); }); }, @@ -45,6 +52,14 @@ export function useConfirmModal() { }; } +export function withConfirmModalProvider(WrappedComponent: React.FunctionComponent) { + return (props: T) => ( + + + + ); +} + export const ConfirmModalProvider: React.FunctionComponent = ({ children }) => { const [isVisible, setIsVisible] = useState(false); const [modal, setModal] = useState({ @@ -74,6 +89,7 @@ export const ConfirmModalProvider: React.FunctionComponent = ({ children }) => { ( + +); + +interface ConfirmDescriptionProps { + output: Output; + agentCount: number; + agentPolicyCount: number; +} + +const ConfirmDescription: React.FunctionComponent = ({ + output, + agentCount, + agentPolicyCount, +}) => ( + {output.name}, + agents: ( + + + + ), + policies: ( + + + + ), + }} + /> +); + +export function useDeleteOutput(onSuccess: () => void) { + const { confirm } = useConfirmModal(); + const { notifications } = useStartServices(); + const deleteOutput = useCallback( + async (output: Output) => { + try { + const { agentCount, agentPolicyCount } = await getAgentAndPolicyCountForOutput(output); + + const isConfirmed = await confirm( + , + , + { + buttonColor: 'danger', + } + ); + + if (!isConfirmed) { + return; + } + + const res = await sendDeleteOutput(output.id); + + if (res.error) { + throw res.error; + } + + onSuccess(); + } catch (err) { + notifications.toasts.addError(err, { + title: i18n.translate('xpack.fleet.settings.deleteOutputs.errorToastTitle', { + defaultMessage: 'Error deleting output', + }), + }); + } + }, + [confirm, notifications.toasts, onSuccess] + ); + + return { deleteOutput }; +} diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/index.tsx index 212b2d9191e24..5a393ee74ea7b 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/index.tsx @@ -7,31 +7,44 @@ import React, { useCallback } from 'react'; import { EuiPortal } from '@elastic/eui'; -import { Router, Route, Switch, useHistory } from 'react-router-dom'; +import { Router, Route, Switch, useHistory, Redirect } from 'react-router-dom'; -import { useBreadcrumbs, useGetSettings } from '../../hooks'; +import { useBreadcrumbs, useGetOutputs, useGetSettings } from '../../hooks'; import { FLEET_ROUTING_PATHS, pagePathGetters } from '../../constants'; import { DefaultLayout } from '../../layouts'; import { Loading } from '../../components'; import { SettingsPage } from './components/settings_page'; -import { ConfirmModalProvider } from './hooks/use_confirm_modal'; +import { withConfirmModalProvider } from './hooks/use_confirm_modal'; import { FleetServerHostsFlyout } from './components/fleet_server_hosts_flyout'; +import { EditOutputFlyout } from './components/edit_output_flyout'; +import { useDeleteOutput } from './hooks/use_delete_output'; +import { FEATURE_ADD_OUTPUT_ENABLED } from './constants'; -export const SettingsApp = () => { +export const SettingsApp = withConfirmModalProvider(() => { useBreadcrumbs('settings'); const history = useHistory(); const settings = useGetSettings(); + const outputs = useGetOutputs(); + + const { deleteOutput } = useDeleteOutput(outputs.resendRequest); const resendSettingsRequest = settings.resendRequest; + const resendOutputRequest = outputs.resendRequest; const onCloseCallback = useCallback(() => { resendSettingsRequest(); + resendOutputRequest(); history.replace(pagePathGetters.settings()[1]); - }, [history, resendSettingsRequest]); + }, [history, resendSettingsRequest, resendOutputRequest]); - if (settings.isLoading || !settings.data?.item) { + if ( + (settings.isLoading && settings.isInitialRequest) || + !settings.data?.item || + (outputs.isLoading && outputs.isInitialRequest) || + !outputs.data?.items + ) { return ( @@ -41,21 +54,45 @@ export const SettingsApp = () => { return ( - - - - + + + + + + + + {FEATURE_ADD_OUTPUT_ENABLED && ( + - + - - - - + )} + + {(route: { match: { params: { outputId: string } } }) => { + const output = outputs.data?.items.find((o) => route.match.params.outputId === o.id); + + if (!output) { + return ; + } + + return ( + + + + ); + }} + + + + ); -}; +}); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/services/agent_and_policies_count.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/services/agent_and_policies_count.tsx new file mode 100644 index 0000000000000..be115af946799 --- /dev/null +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/services/agent_and_policies_count.tsx @@ -0,0 +1,68 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { sendGetAgentPolicies, sendGetAgents } from '../../../hooks'; +import type { Output } from '../../../types'; +import { AGENT_POLICY_SAVED_OBJECT_TYPE } from '../../../constants'; + +export async function getAgentAndPolicyCountForOutput(output: Output) { + let kuery = `${AGENT_POLICY_SAVED_OBJECT_TYPE}.data_output_id:"${output.id}" or ${AGENT_POLICY_SAVED_OBJECT_TYPE}.monitoring_output_id:"${output.id}"`; + if (output.is_default) { + kuery += ` or (not ${AGENT_POLICY_SAVED_OBJECT_TYPE}.data_output_id:*)`; + } + const agentPolicies = await sendGetAgentPolicies({ + kuery, + }); + + if (agentPolicies.error) { + throw agentPolicies.error; + } + const agentPolicyCount = agentPolicies.data?.items?.length ?? 0; + + let agentCount = 0; + if (agentPolicyCount > 0) { + const agents = await sendGetAgents({ + page: 1, + perPage: 0, // We only need the count here + showInactive: false, + kuery: agentPolicies.data?.items.map((policy) => `policy_id:"${policy.id}"`).join(' or '), + }); + + if (agents.error) { + throw agents.error; + } + + agentCount = agents.data?.total ?? 0; + } + + return { agentPolicyCount, agentCount }; +} + +export async function getAgentAndPolicyCount() { + const agentPolicies = await sendGetAgentPolicies({ + perPage: 0, + }); + + if (agentPolicies.error) { + throw agentPolicies.error; + } + const agentPolicyCount = agentPolicies.data?.total ?? 0; + + const agents = await sendGetAgents({ + page: 1, + perPage: 0, // We only need the count here + showInactive: false, + }); + + if (agents.error) { + throw agents.error; + } + + const agentCount = agents.data?.total ?? 0; + + return { agentPolicyCount, agentCount }; +} diff --git a/x-pack/plugins/fleet/public/applications/integrations/hooks/use_package_install.tsx b/x-pack/plugins/fleet/public/applications/integrations/hooks/use_package_install.tsx index a59d4422348fb..ad6f492bc5fce 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/hooks/use_package_install.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/hooks/use_package_install.tsx @@ -8,7 +8,7 @@ import createContainer from 'constate'; import React, { useCallback, useState } from 'react'; import { useHistory } from 'react-router-dom'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { NotificationsStart } from 'src/core/public'; import { toMountPoint } from '../../../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/fleet/public/applications/integrations/layouts/default.tsx b/x-pack/plugins/fleet/public/applications/integrations/layouts/default.tsx index d6d6dedf753ef..920cdeb2d8faa 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/layouts/default.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/layouts/default.tsx @@ -6,7 +6,7 @@ */ import React, { memo } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useLink } from '../../../hooks'; import type { Section } from '../sections'; diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/assets_facet_group.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/assets_facet_group.tsx index 2380a1fb87756..0e9aae706f194 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/assets_facet_group.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/assets_facet_group.tsx @@ -17,7 +17,7 @@ import { EuiTitle, } from '@elastic/eui'; import styled from 'styled-components'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { AssetsGroupedByServiceByType, diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/integration_preference.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/integration_preference.tsx index fa9b9a7ed190e..b99683adbf8f4 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/integration_preference.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/integration_preference.tsx @@ -9,7 +9,7 @@ import React from 'react'; import styled from 'styled-components'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiPanel, EuiLink, diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_list_grid.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_list_grid.tsx index 3dc704399c914..e8627bb36d946 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_list_grid.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_list_grid.tsx @@ -19,7 +19,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Loading } from '../../../components'; import { useLocalSearch, searchIdField } from '../../../hooks'; diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/assets/assets.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/assets/assets.tsx index a8d27580e0bd1..16a16205261c9 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/assets/assets.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/assets/assets.tsx @@ -7,7 +7,7 @@ import React, { useEffect, useState } from 'react'; import { Redirect } from 'react-router-dom'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, EuiTitle, EuiSpacer } from '@elastic/eui'; import { groupBy } from 'lodash'; diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/components/keep_policies_up_to_date_switch.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/components/keep_policies_up_to_date_switch.tsx index 364b24ab48912..7a9afd5e45900 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/components/keep_policies_up_to_date_switch.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/components/keep_policies_up_to_date_switch.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiSwitch, EuiSpacer, EuiText, EuiFlexGroup, EuiFlexItem, EuiIcon } from '@elastic/eui'; interface Props { diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/index.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/index.tsx index b6f236852f940..1a3a5c7eadd35 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/index.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/index.tsx @@ -24,7 +24,7 @@ import { EuiToolTip, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import semverLt from 'semver/functions/lt'; import { @@ -454,7 +454,7 @@ export function Detail() { name: ( ), isSelected: panel === 'policies', diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/details.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/details.tsx index 9799f7a9afecb..0d7ae2d9053aa 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/details.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/details.tsx @@ -5,7 +5,7 @@ * 2.0. */ import React, { memo, useCallback, useMemo, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/notice_modal.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/notice_modal.tsx index 239bd133d3c91..f933912754889 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/notice_modal.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/notice_modal.tsx @@ -17,7 +17,7 @@ import { EuiButton, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { sendGetFileByPath, useStartServices } from '../../../../../hooks'; diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/screenshots.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/screenshots.tsx index a2a765cf41165..d368b07b62e41 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/screenshots.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/screenshots.tsx @@ -6,7 +6,7 @@ */ import React, { useState, useMemo, memo } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, EuiImage, EuiText, EuiPagination } from '@elastic/eui'; import type { ScreenshotItem } from '../../../../../types'; diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/policies/components/package_policy_agents_cell.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/policies/components/package_policy_agents_cell.tsx index fc3007b174ced..28490316f83eb 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/policies/components/package_policy_agents_cell.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/policies/components/package_policy_agents_cell.tsx @@ -8,7 +8,7 @@ import React, { useState } from 'react'; import { EuiButton } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { LinkedAgentCount, AddAgentHelpPopover } from '../../../../../../components'; diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/policies/package_policies.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/policies/package_policies.tsx index 425781e81483d..c4f06d4d7d5ab 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/policies/package_policies.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/policies/package_policies.tsx @@ -22,7 +22,7 @@ import { EuiSpacer, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedRelative, FormattedMessage } from '@kbn/i18n/react'; +import { FormattedRelative, FormattedMessage } from '@kbn/i18n-react'; import { InstallStatus } from '../../../../../types'; import type { GetAgentPoliciesResponseItem, InMemoryPackagePolicy } from '../../../../../types'; @@ -211,7 +211,7 @@ export const PackagePoliciesPage = ({ name, version }: PackagePoliciesPanelProps { field: 'packagePolicy.name', name: i18n.translate('xpack.fleet.epm.packageDetails.integrationList.name', { - defaultMessage: 'Integration Policy', + defaultMessage: 'Integration policy', }), render(_, { packagePolicy }) { return ; @@ -269,7 +269,7 @@ export const PackagePoliciesPage = ({ name, version }: PackagePoliciesPanelProps { field: 'packagePolicy.updated_by', name: i18n.translate('xpack.fleet.epm.packageDetails.integrationList.updatedBy', { - defaultMessage: 'Last Updated By', + defaultMessage: 'Last updated by', }), truncateText: true, render(updatedBy) { @@ -279,7 +279,7 @@ export const PackagePoliciesPage = ({ name, version }: PackagePoliciesPanelProps { field: 'packagePolicy.updated_at', name: i18n.translate('xpack.fleet.epm.packageDetails.integrationList.updatedAt', { - defaultMessage: 'Last Updated', + defaultMessage: 'Last updated', }), truncateText: true, render(updatedAt: InMemoryPackagePolicyAndAgentPolicy['packagePolicy']['updated_at']) { diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/settings/confirm_package_install.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/settings/confirm_package_install.tsx index 5144b2a648786..31e4fc32233e9 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/settings/confirm_package_install.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/settings/confirm_package_install.tsx @@ -7,7 +7,7 @@ import { EuiCallOut, EuiConfirmModal, EuiSpacer } from '@elastic/eui'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; interface ConfirmPackageInstallProps { onCancel: () => void; diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/settings/confirm_package_uninstall.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/settings/confirm_package_uninstall.tsx index 2def57b040944..a029aab3e2b1d 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/settings/confirm_package_uninstall.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/settings/confirm_package_uninstall.tsx @@ -7,7 +7,7 @@ import { EuiCallOut, EuiConfirmModal, EuiSpacer } from '@elastic/eui'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; interface ConfirmPackageUninstallProps { onCancel: () => void; diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/settings/install_button.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/settings/install_button.tsx index f2813058afe5a..5d5dfbda7bec6 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/settings/install_button.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/settings/install_button.tsx @@ -7,7 +7,7 @@ import { EuiButton } from '@elastic/eui'; import React, { Fragment, useCallback, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { PackageInfo, UpgradePackagePolicyDryRunResponse } from '../../../../../types'; import { InstallStatus } from '../../../../../types'; diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/settings/settings.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/settings/settings.tsx index 31a01ffd7bdc8..73c762d34a2cf 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/settings/settings.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/settings/settings.tsx @@ -7,7 +7,7 @@ import React, { memo, useCallback, useEffect, useMemo, useState } from 'react'; import styled from 'styled-components'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import semverLt from 'semver/functions/lt'; import { diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/settings/uninstall_button.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/settings/uninstall_button.tsx index 00b6ccc2f7912..cf9482a080aed 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/settings/uninstall_button.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/settings/uninstall_button.tsx @@ -7,7 +7,7 @@ import { EuiButton } from '@elastic/eui'; import React, { useCallback, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { InstallStatus } from '../../../../../types'; import type { PackageInfo } from '../../../../../types'; diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/settings/update_button.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/settings/update_button.tsx index 48d4ef5d846d4..0ade85354bdd7 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/settings/update_button.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/settings/update_button.tsx @@ -8,7 +8,7 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { useHistory } from 'react-router-dom'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/home/available_packages.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/home/available_packages.tsx index 62f911ffdbbb7..81d1701c4a986 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/home/available_packages.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/home/available_packages.tsx @@ -10,7 +10,7 @@ import React, { memo, useMemo, useState } from 'react'; import { useLocation, useHistory, useParams } from 'react-router-dom'; import _ from 'lodash'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiHorizontalRule, EuiFlexItem, @@ -312,17 +312,16 @@ export const AvailablePackages: React.FC = memo(() => { <> - + } - href={addBasePath('/app/integrations/detail/endpoint/')} - title={i18n.translate('xpack.fleet.featuredSecurityTitle', { - defaultMessage: 'Endpoint Security', + data-test-subj="integration-card:epr:app_search_web_crawler:featured" + icon={} + href={addBasePath('/app/enterprise_search/app_search/engines/new?method=crawler')} + title={i18n.translate('xpack.fleet.featuredSearchTitle', { + defaultMessage: 'Web site crawler', })} - description={i18n.translate('xpack.fleet.featuredSecurityDesc', { - defaultMessage: - 'Protect your hosts with threat prevention, detection, and deep security data visibility.', + description={i18n.translate('xpack.fleet.featuredSearchDesc', { + defaultMessage: 'Add search to your website with the App Search web crawler.', })} /> @@ -344,16 +343,17 @@ export const AvailablePackages: React.FC = memo(() => { - + } - href={addBasePath('/app/enterprise_search/app_search/engines/new?method=crawler')} - title={i18n.translate('xpack.fleet.featuredSearchTitle', { - defaultMessage: 'Web site crawler', + data-test-subj="integration-card:epr:endpoint:featured" + icon={} + href={addBasePath('/app/integrations/detail/endpoint/')} + title={i18n.translate('xpack.fleet.featuredSecurityTitle', { + defaultMessage: 'Endpoint Security', })} - description={i18n.translate('xpack.fleet.featuredSearchDesc', { - defaultMessage: 'Add search to your website with the App Search web crawler.', + description={i18n.translate('xpack.fleet.featuredSecurityDesc', { + defaultMessage: + 'Protect your hosts with threat prevention, detection, and deep security data visibility.', })} /> diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/home/installed_packages.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/home/installed_packages.tsx index cf1369b421fd3..964994c250aa0 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/home/installed_packages.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/home/installed_packages.tsx @@ -9,7 +9,7 @@ import React, { memo, useMemo } from 'react'; import { useLocation, useHistory, useParams } from 'react-router-dom'; import semverLt from 'semver/functions/lt'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCallOut, EuiLink } from '@elastic/eui'; diff --git a/x-pack/plugins/fleet/public/components/add_agent_help_popover.tsx b/x-pack/plugins/fleet/public/components/add_agent_help_popover.tsx index 32d974324f13f..fd502f768656f 100644 --- a/x-pack/plugins/fleet/public/components/add_agent_help_popover.tsx +++ b/x-pack/plugins/fleet/public/components/add_agent_help_popover.tsx @@ -7,7 +7,7 @@ import type { ReactElement } from 'react'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { NoArgCallback } from '@elastic/eui'; import { EuiTourStep, EuiLink, EuiText } from '@elastic/eui'; diff --git a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/advanced_agent_authentication_settings.tsx b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/advanced_agent_authentication_settings.tsx index 26e7fc909402e..3d069c1d0336b 100644 --- a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/advanced_agent_authentication_settings.tsx +++ b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/advanced_agent_authentication_settings.tsx @@ -8,7 +8,7 @@ import type { FunctionComponent } from 'react'; import React, { useEffect, useState, useCallback } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, EuiButton, EuiCallOut, EuiSelect, EuiSpacer, EuiText } from '@elastic/eui'; import { SO_SEARCH_LIMIT } from '../../applications/fleet/constants'; diff --git a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/agent_policy_selection.tsx b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/agent_policy_selection.tsx index d9d1aa2e77f86..717b5a436d7bc 100644 --- a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/agent_policy_selection.tsx +++ b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/agent_policy_selection.tsx @@ -7,7 +7,7 @@ import React, { useState, useEffect } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiSelect, EuiSpacer, EuiText } from '@elastic/eui'; import type { AgentPolicy } from '../../types'; diff --git a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/index.tsx b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/index.tsx index 62bf3e8d6564a..571f36359473e 100644 --- a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/index.tsx +++ b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/index.tsx @@ -20,7 +20,7 @@ import { EuiTab, EuiTabs, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useGetSettings, sendGetOneAgentPolicy, useFleetStatus } from '../../hooks'; import { FLEET_SERVER_PACKAGE } from '../../constants'; diff --git a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/managed_instructions.tsx b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/managed_instructions.tsx index 95f716acf89e4..a78d2df06b486 100644 --- a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/managed_instructions.tsx +++ b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/managed_instructions.tsx @@ -9,7 +9,7 @@ import React, { useState, useMemo } from 'react'; import { EuiSteps, EuiLink, EuiText, EuiSpacer } from '@elastic/eui'; import type { EuiContainedStepProps } from '@elastic/eui/src/components/steps/steps'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useGetOneEnrollmentAPIKey, useLink, useFleetStatus } from '../../hooks'; diff --git a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/missing_fleet_server_host_callout.tsx b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/missing_fleet_server_host_callout.tsx index 220b98f07cd35..52b5a0d6f7d5e 100644 --- a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/missing_fleet_server_host_callout.tsx +++ b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/missing_fleet_server_host_callout.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCallOut, EuiLink, EuiButton, EuiSpacer } from '@elastic/eui'; import { useLink, useStartServices } from '../../hooks'; diff --git a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/standalone_instructions.tsx b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/standalone_instructions.tsx index f9d4c2d162c5f..f1ab855059c3c 100644 --- a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/standalone_instructions.tsx +++ b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/standalone_instructions.tsx @@ -20,7 +20,7 @@ import { } from '@elastic/eui'; import type { EuiContainedStepProps } from '@elastic/eui/src/components/steps/steps'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { safeDump } from 'js-yaml'; import { diff --git a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/steps.tsx b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/steps.tsx index aa40e2ffc9140..8cdae7eaf90be 100644 --- a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/steps.tsx +++ b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/steps.tsx @@ -7,7 +7,7 @@ import React, { useCallback, useMemo } from 'react'; import { EuiText, EuiButton, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import semverMajor from 'semver/functions/major'; import semverMinor from 'semver/functions/minor'; diff --git a/x-pack/plugins/fleet/public/components/agent_policy_package_badges.tsx b/x-pack/plugins/fleet/public/components/agent_policy_package_badges.tsx index 9db4f77a02c37..b8dbe74a9f242 100644 --- a/x-pack/plugins/fleet/public/components/agent_policy_package_badges.tsx +++ b/x-pack/plugins/fleet/public/components/agent_policy_package_badges.tsx @@ -7,7 +7,7 @@ import React, { useMemo } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiSpacer, EuiText, EuiFlexGroup, EuiFlexItem, EuiBadge, EuiCallOut } from '@elastic/eui'; import { FLEET_SERVER_PACKAGE } from '../../common/constants'; diff --git a/x-pack/plugins/fleet/public/components/alpha_flyout.tsx b/x-pack/plugins/fleet/public/components/alpha_flyout.tsx index b8606968c22dd..d8ee580934859 100644 --- a/x-pack/plugins/fleet/public/components/alpha_flyout.tsx +++ b/x-pack/plugins/fleet/public/components/alpha_flyout.tsx @@ -16,7 +16,7 @@ import { EuiText, EuiTitle, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useStartServices } from '../hooks'; diff --git a/x-pack/plugins/fleet/public/components/alpha_messaging.tsx b/x-pack/plugins/fleet/public/components/alpha_messaging.tsx index af550868c126b..4db54e25c5378 100644 --- a/x-pack/plugins/fleet/public/components/alpha_messaging.tsx +++ b/x-pack/plugins/fleet/public/components/alpha_messaging.tsx @@ -7,7 +7,7 @@ import React, { useState } from 'react'; import styled from 'styled-components'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiText, EuiLink } from '@elastic/eui'; import { AlphaFlyout } from './alpha_flyout'; diff --git a/x-pack/plugins/fleet/public/components/enrollment_instructions/manual/index.tsx b/x-pack/plugins/fleet/public/components/enrollment_instructions/manual/index.tsx index 425fe6c6bd67e..574a04dfd54df 100644 --- a/x-pack/plugins/fleet/public/components/enrollment_instructions/manual/index.tsx +++ b/x-pack/plugins/fleet/public/components/enrollment_instructions/manual/index.tsx @@ -8,7 +8,7 @@ import React from 'react'; import styled from 'styled-components'; import { EuiText, EuiSpacer, EuiLink, EuiCodeBlock, EuiButtonGroup } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import type { EnrollmentAPIKey } from '../../../types'; diff --git a/x-pack/plugins/fleet/public/components/fleet_setup_loading.tsx b/x-pack/plugins/fleet/public/components/fleet_setup_loading.tsx index e8aa74ba664ac..a46ca4abc690e 100644 --- a/x-pack/plugins/fleet/public/components/fleet_setup_loading.tsx +++ b/x-pack/plugins/fleet/public/components/fleet_setup_loading.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiEmptyPrompt, EuiLoadingSpinner } from '@elastic/eui'; export const FleetSetupLoading: React.FunctionComponent = () => ( diff --git a/x-pack/plugins/fleet/public/components/home_integration/tutorial_directory_header_link.tsx b/x-pack/plugins/fleet/public/components/home_integration/tutorial_directory_header_link.tsx index 18fdd875c7379..4708239bc22b1 100644 --- a/x-pack/plugins/fleet/public/components/home_integration/tutorial_directory_header_link.tsx +++ b/x-pack/plugins/fleet/public/components/home_integration/tutorial_directory_header_link.tsx @@ -6,7 +6,7 @@ */ import React, { memo, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty } from '@elastic/eui'; import type { TutorialDirectoryHeaderLinkComponent } from 'src/plugins/home/public'; diff --git a/x-pack/plugins/fleet/public/components/home_integration/tutorial_module_notice.tsx b/x-pack/plugins/fleet/public/components/home_integration/tutorial_module_notice.tsx index 1b0d90098fa48..fef12f5940947 100644 --- a/x-pack/plugins/fleet/public/components/home_integration/tutorial_module_notice.tsx +++ b/x-pack/plugins/fleet/public/components/home_integration/tutorial_module_notice.tsx @@ -6,7 +6,7 @@ */ import React, { memo } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiText, EuiLink, EuiSpacer, EuiIcon } from '@elastic/eui'; import type { TutorialModuleNoticeComponent } from 'src/plugins/home/public'; diff --git a/x-pack/plugins/fleet/public/components/link_and_revision.tsx b/x-pack/plugins/fleet/public/components/link_and_revision.tsx index dd36e4b1e239c..99f85a09356c8 100644 --- a/x-pack/plugins/fleet/public/components/link_and_revision.tsx +++ b/x-pack/plugins/fleet/public/components/link_and_revision.tsx @@ -7,7 +7,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiIconTip, EuiLink, EuiText } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { CSSProperties } from 'react'; import React, { memo } from 'react'; diff --git a/x-pack/plugins/fleet/public/components/linked_agent_count.tsx b/x-pack/plugins/fleet/public/components/linked_agent_count.tsx index dcbda2e1445c7..ce0a21e7759eb 100644 --- a/x-pack/plugins/fleet/public/components/linked_agent_count.tsx +++ b/x-pack/plugins/fleet/public/components/linked_agent_count.tsx @@ -6,7 +6,7 @@ */ import React, { memo } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { EuiLinkAnchorProps } from '@elastic/eui'; import { EuiLink } from '@elastic/eui'; diff --git a/x-pack/plugins/fleet/public/components/package_policy_actions_menu.tsx b/x-pack/plugins/fleet/public/components/package_policy_actions_menu.tsx index 754a3fb1c76b5..516f3d4dc55c1 100644 --- a/x-pack/plugins/fleet/public/components/package_policy_actions_menu.tsx +++ b/x-pack/plugins/fleet/public/components/package_policy_actions_menu.tsx @@ -8,7 +8,7 @@ import React, { useMemo, useState } from 'react'; import { EuiContextMenuItem, EuiPortal } from '@elastic/eui'; import type { EuiStepProps } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { AgentPolicy, InMemoryPackagePolicy } from '../types'; diff --git a/x-pack/plugins/fleet/public/components/package_policy_delete_provider.tsx b/x-pack/plugins/fleet/public/components/package_policy_delete_provider.tsx index 7c2703ec8437b..958cfe3bdb439 100644 --- a/x-pack/plugins/fleet/public/components/package_policy_delete_provider.tsx +++ b/x-pack/plugins/fleet/public/components/package_policy_delete_provider.tsx @@ -8,7 +8,7 @@ import React, { Fragment, useMemo, useRef, useState } from 'react'; import { EuiCallOut, EuiConfirmModal, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useStartServices, sendRequest, sendDeletePackagePolicy, useConfig } from '../hooks'; import { AGENT_API_ROUTES, AGENTS_PREFIX } from '../../common/constants'; diff --git a/x-pack/plugins/fleet/public/constants/page_paths.ts b/x-pack/plugins/fleet/public/constants/page_paths.ts index 39b6e4c6da075..3f90dcb65a151 100644 --- a/x-pack/plugins/fleet/public/constants/page_paths.ts +++ b/x-pack/plugins/fleet/public/constants/page_paths.ts @@ -16,7 +16,8 @@ export type StaticPage = | 'enrollment_tokens' | 'data_streams' | 'settings' - | 'settings_edit_fleet_server_hosts'; + | 'settings_edit_fleet_server_hosts' + | 'settings_create_outputs'; export type DynamicPage = | 'integrations_all' @@ -33,7 +34,8 @@ export type DynamicPage = | 'upgrade_package_policy' | 'agent_list' | 'agent_details' - | 'agent_details_logs'; + | 'agent_details_logs' + | 'settings_edit_outputs'; export type Page = StaticPage | DynamicPage; @@ -61,6 +63,8 @@ export const FLEET_ROUTING_PATHS = { data_streams: '/data-streams', settings: '/settings', settings_edit_fleet_server_hosts: '/settings/edit-fleet-server-hosts', + settings_create_outputs: '/settings/create-outputs', + settings_edit_outputs: '/settings/outputs/:outputId', // TODO: Move this to the integrations app add_integration_to_policy: '/integrations/:pkgkey/add-integration/:integration?', @@ -154,4 +158,9 @@ export const pagePathGetters: { FLEET_BASE_PATH, FLEET_ROUTING_PATHS.settings_edit_fleet_server_hosts, ], + settings_edit_outputs: ({ outputId }) => [ + FLEET_BASE_PATH, + FLEET_ROUTING_PATHS.settings_edit_outputs.replace(':outputId', outputId), + ], + settings_create_outputs: () => [FLEET_BASE_PATH, FLEET_ROUTING_PATHS.settings_create_outputs], }; diff --git a/x-pack/plugins/fleet/public/hooks/use_input.ts b/x-pack/plugins/fleet/public/hooks/use_input.ts index 908c3f4f717ca..1c89fb232a66e 100644 --- a/x-pack/plugins/fleet/public/hooks/use_input.ts +++ b/x-pack/plugins/fleet/public/hooks/use_input.ts @@ -5,20 +5,38 @@ * 2.0. */ -import { useState, useCallback } from 'react'; +import { useState, useCallback, useEffect } from 'react'; import type React from 'react'; +import type { EuiSwitchEvent } from '@elastic/eui'; -export function useInput(defaultValue = '', validate?: (value: string) => string[] | undefined) { +export function useInput( + defaultValue = '', + validate?: (value: string) => string[] | undefined, + disabled: boolean = false +) { const [value, setValue] = useState(defaultValue); const [errors, setErrors] = useState(); + const [hasChanged, setHasChanged] = useState(false); - const onChange = (e: React.ChangeEvent) => { - const newValue = e.target.value; - setValue(newValue); - if (errors && validate && validate(newValue) === undefined) { - setErrors(undefined); + const onChange = useCallback( + (e: React.ChangeEvent) => { + const newValue = e.target.value; + setValue(newValue); + if (errors && validate && validate(newValue) === undefined) { + setErrors(undefined); + } + }, + [errors, validate] + ); + + useEffect(() => { + if (hasChanged) { + return; } - }; + if (value !== defaultValue) { + setHasChanged(true); + } + }, [hasChanged, value, defaultValue]); const isInvalid = errors !== undefined; @@ -29,6 +47,7 @@ export function useInput(defaultValue = '', validate?: (value: string) => string onChange, value, isInvalid, + disabled, }, formRowProps: { error: errors, @@ -47,16 +66,62 @@ export function useInput(defaultValue = '', validate?: (value: string) => string return true; }, setValue, + hasChanged, + }; +} + +export function useSwitchInput(defaultValue = false, disabled = false) { + const [value, setValue] = useState(defaultValue); + const [hasChanged, setHasChanged] = useState(false); + + useEffect(() => { + if (hasChanged) { + return; + } + if (value !== defaultValue) { + setHasChanged(true); + } + }, [hasChanged, value, defaultValue]); + + const onChange = (e: EuiSwitchEvent) => { + const newValue = e.target.checked; + setValue(newValue); + }; + + return { + value, + props: { + onChange, + checked: value, + disabled, + }, + formRowProps: {}, + setValue, + hasChanged, }; } export function useComboInput( id: string, defaultValue: string[] = [], - validate?: (value: string[]) => Array<{ message: string; index?: number }> | undefined + validate?: (value: string[]) => Array<{ message: string; index?: number }> | undefined, + disabled = false ) { const [value, setValue] = useState(defaultValue); const [errors, setErrors] = useState | undefined>(); + const [hasChanged, setHasChanged] = useState(false); + + useEffect(() => { + if (hasChanged) { + return; + } + if ( + value.length !== defaultValue.length || + value.some((val, idx) => val !== defaultValue[idx]) + ) { + setHasChanged(true); + } + }, [hasChanged, value, defaultValue]); const isInvalid = errors !== undefined; @@ -77,6 +142,7 @@ export function useComboInput( onChange, errors, isInvalid, + disabled, }, value, clear: () => { @@ -93,5 +159,6 @@ export function useComboInput( return true; }, + hasChanged, }; } diff --git a/x-pack/plugins/fleet/public/hooks/use_request/outputs.ts b/x-pack/plugins/fleet/public/hooks/use_request/outputs.ts index 214fa5f5ed142..8c56ee811e465 100644 --- a/x-pack/plugins/fleet/public/hooks/use_request/outputs.ts +++ b/x-pack/plugins/fleet/public/hooks/use_request/outputs.ts @@ -6,7 +6,7 @@ */ import { outputRoutesService } from '../../services'; -import type { PutOutputRequest, GetOutputsResponse } from '../../types'; +import type { PutOutputRequest, GetOutputsResponse, PostOutputRequest } from '../../types'; import { sendRequest, useRequest } from './use_request'; @@ -31,3 +31,18 @@ export function sendPutOutput(outputId: string, body: PutOutputRequest['body']) body, }); } + +export function sendPostOutput(body: PostOutputRequest['body']) { + return sendRequest({ + method: 'post', + path: outputRoutesService.getCreatePath(), + body, + }); +} + +export function sendDeleteOutput(outputId: string) { + return sendRequest({ + method: 'delete', + path: outputRoutesService.getDeletePath(outputId), + }); +} diff --git a/x-pack/plugins/fleet/public/mock/fleet_start_services.tsx b/x-pack/plugins/fleet/public/mock/fleet_start_services.tsx index 675eaaa1905ea..b0a6a15add991 100644 --- a/x-pack/plugins/fleet/public/mock/fleet_start_services.tsx +++ b/x-pack/plugins/fleet/public/mock/fleet_start_services.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import type { MockedKeys } from '@kbn/utility-types/jest'; import { coreMock } from '../../../../../src/core/public/mocks'; @@ -14,6 +14,8 @@ import type { IStorage } from '../../../../../src/plugins/kibana_utils/public'; import { Storage } from '../../../../../src/plugins/kibana_utils/public'; import { setHttpClient } from '../hooks/use_request'; +import type { FleetAuthz } from '../../common'; + import { createStartDepsMock } from './plugin_dependencies'; import type { MockedFleetStartServices } from './types'; @@ -28,6 +30,25 @@ const createMockStore = (): MockedKeys => { }; }; +const fleetAuthzMock: FleetAuthz = { + fleet: { + all: true, + setup: true, + readEnrollmentTokens: true, + }, + integrations: { + readPackageInfo: true, + readInstalledPackages: true, + installPackages: true, + upgradePackages: true, + removePackages: true, + readPackageSettings: true, + writePackageSettings: true, + readIntegrationPolicies: true, + writeIntegrationPolicies: true, + }, +}; + const configureStartServices = (services: MockedFleetStartServices): void => { // Store the http for use by useRequest setHttpClient(services.http); @@ -52,6 +73,7 @@ export const createStartServices = (basePath: string = '/mock'): MockedFleetStar ...coreMock.createStart({ basePath }), ...createStartDepsMock(), storage: new Storage(createMockStore()) as jest.Mocked, + authz: fleetAuthzMock, }; configureStartServices(startServices); diff --git a/x-pack/plugins/fleet/public/mock/plugin_interfaces.ts b/x-pack/plugins/fleet/public/mock/plugin_interfaces.ts index 134bd408d8c3c..054ef958c1914 100644 --- a/x-pack/plugins/fleet/public/mock/plugin_interfaces.ts +++ b/x-pack/plugins/fleet/public/mock/plugin_interfaces.ts @@ -14,5 +14,23 @@ export const createStartMock = (extensionsStorage: UIExtensionsStorage = {}): Mo return { isInitialized: jest.fn().mockResolvedValue(true), registerExtension: createExtensionRegistrationCallback(extensionsStorage), + authz: { + fleet: { + all: true, + setup: true, + readEnrollmentTokens: true, + }, + integrations: { + readPackageInfo: true, + readInstalledPackages: true, + installPackages: true, + upgradePackages: true, + removePackages: true, + readPackageSettings: true, + writePackageSettings: true, + readIntegrationPolicies: true, + writeIntegrationPolicies: true, + }, + }, }; }; diff --git a/x-pack/plugins/fleet/public/plugin.ts b/x-pack/plugins/fleet/public/plugin.ts index 039c1da9b934c..e188b8e99b5b9 100644 --- a/x-pack/plugins/fleet/public/plugin.ts +++ b/x-pack/plugins/fleet/public/plugin.ts @@ -38,8 +38,14 @@ import { Storage } from '../../../../src/plugins/kibana_utils/public'; import type { LicensingPluginSetup } from '../../licensing/public'; import type { CloudSetup } from '../../cloud/public'; import type { GlobalSearchPluginSetup } from '../../global_search/public'; -import { PLUGIN_ID, INTEGRATIONS_PLUGIN_ID, setupRouteService, appRoutesService } from '../common'; -import type { CheckPermissionsResponse, PostFleetSetupResponse } from '../common'; +import { + PLUGIN_ID, + INTEGRATIONS_PLUGIN_ID, + setupRouteService, + appRoutesService, + calculateAuthz, +} from '../common'; +import type { CheckPermissionsResponse, PostFleetSetupResponse, FleetAuthz } from '../common'; import type { FleetConfigType } from '../common/types'; @@ -65,6 +71,8 @@ export interface FleetSetup {} * Describes public Fleet plugin contract returned at the `start` stage. */ export interface FleetStart { + /** Authorization for the current user */ + authz: FleetAuthz; registerExtension: UIExtensionRegistrationCallback; isInitialized: () => Promise; } @@ -90,6 +98,7 @@ export interface FleetStartServices extends CoreStart, FleetStartDeps { storage: Storage; share: SharePluginStart; cloud?: CloudSetup; + authz: FleetAuthz; } export class FleetPlugin implements Plugin { @@ -103,7 +112,7 @@ export class FleetPlugin implements Plugin, deps: FleetSetupDeps) { const config = this.config; const kibanaVersion = this.kibanaVersion; const extensions = this.extensions; @@ -129,16 +138,13 @@ export class FleetPlugin implements Plugin { - const [coreStartServices, startDepsServices] = (await core.getStartServices()) as [ - CoreStart, - FleetStartDeps, - FleetStart - ]; + const [coreStartServices, startDepsServices, fleetStart] = await core.getStartServices(); const startServices: FleetStartServices = { ...coreStartServices, ...startDepsServices, storage: this.storage, cloud: deps.cloud, + authz: fleetStart.authz, }; const { renderApp, teardownIntegrations } = await import('./applications/integrations'); @@ -169,16 +175,13 @@ export class FleetPlugin implements Plugin { - const [coreStartServices, startDepsServices] = (await core.getStartServices()) as [ - CoreStart, - FleetStartDeps, - FleetStart - ]; + const [coreStartServices, startDepsServices, fleetStart] = await core.getStartServices(); const startServices: FleetStartServices = { ...coreStartServices, ...startDepsServices, storage: this.storage, cloud: deps.cloud, + authz: fleetStart.authz, }; const { renderApp, teardownFleet } = await import('./applications/fleet'); const unmount = renderApp(startServices, params, config, kibanaVersion, extensions); @@ -243,7 +246,23 @@ export class FleetPlugin implements Plugin { if (!successPromise) { successPromise = Promise.resolve().then(async () => { diff --git a/x-pack/plugins/fleet/public/types/index.ts b/x-pack/plugins/fleet/public/types/index.ts index d61223f0cebc7..ead44a798cfc7 100644 --- a/x-pack/plugins/fleet/public/types/index.ts +++ b/x-pack/plugins/fleet/public/types/index.ts @@ -75,6 +75,7 @@ export type { GetOutputsResponse, PutOutputRequest, PutOutputResponse, + PostOutputRequest, GetSettingsResponse, PutSettingsRequest, PutSettingsResponse, diff --git a/x-pack/plugins/fleet/server/constants/fleet_es_assets.ts b/x-pack/plugins/fleet/server/constants/fleet_es_assets.ts index 5f9a4bfde6335..8cdb93be28148 100644 --- a/x-pack/plugins/fleet/server/constants/fleet_es_assets.ts +++ b/x-pack/plugins/fleet/server/constants/fleet_es_assets.ts @@ -5,12 +5,16 @@ * 2.0. */ +import { getESAssetMetadata } from '../services/epm/elasticsearch/meta'; + +const meta = getESAssetMetadata(); + export const FLEET_FINAL_PIPELINE_ID = '.fleet_final_pipeline-1'; export const FLEET_GLOBAL_COMPONENT_TEMPLATE_NAME = '.fleet_component_template-1'; export const FLEET_GLOBAL_COMPONENT_TEMPLATE_CONTENT = { - _meta: {}, + _meta: meta, template: { settings: { index: { @@ -36,10 +40,14 @@ export const FLEET_GLOBAL_COMPONENT_TEMPLATE_CONTENT = { }, }; -export const FLEET_FINAL_PIPELINE_VERSION = 1; +export const FLEET_FINAL_PIPELINE_VERSION = 2; + // If the content is updated you probably need to update the FLEET_FINAL_PIPELINE_VERSION too to allow upgrade of the pipeline export const FLEET_FINAL_PIPELINE_CONTENT = `--- version: ${FLEET_FINAL_PIPELINE_VERSION} +_meta: + managed_by: ${meta.managed_by} + managed: ${meta.managed} description: > Final pipeline for processing all incoming Fleet Agent documents. processors: diff --git a/x-pack/plugins/fleet/server/mocks/index.ts b/x-pack/plugins/fleet/server/mocks/index.ts index 943f100c94f72..bd7f192dc7fd2 100644 --- a/x-pack/plugins/fleet/server/mocks/index.ts +++ b/x-pack/plugins/fleet/server/mocks/index.ts @@ -20,6 +20,7 @@ import type { PackagePolicyServiceInterface } from '../services/package_policy'; import type { AgentPolicyServiceInterface, AgentService } from '../services'; import type { FleetAppContext } from '../plugin'; import { createMockTelemetryEventsSender } from '../telemetry/__mocks__'; +import type { FleetAuthz } from '../../common'; // Export all mocks from artifacts export * from '../services/artifacts/mocks'; @@ -120,3 +121,25 @@ export const createMockAgentService = (): jest.Mocked => { listAgents: jest.fn(), }; }; + +/** + * Creates mock `authz` object + */ +export const fleetAuthzMock: FleetAuthz = { + fleet: { + all: true, + setup: true, + readEnrollmentTokens: true, + }, + integrations: { + readPackageInfo: true, + readInstalledPackages: true, + installPackages: true, + upgradePackages: true, + removePackages: true, + readPackageSettings: true, + writePackageSettings: true, + readIntegrationPolicies: true, + writeIntegrationPolicies: true, + }, +}; diff --git a/x-pack/plugins/fleet/server/plugin.ts b/x-pack/plugins/fleet/server/plugin.ts index f7593e32c25c9..3ee83a91e0df5 100644 --- a/x-pack/plugins/fleet/server/plugin.ts +++ b/x-pack/plugins/fleet/server/plugin.ts @@ -15,6 +15,7 @@ import type { PluginInitializerContext, SavedObjectsServiceStart, HttpServiceSetup, + KibanaRequest, } from 'kibana/server'; import type { UsageCollectionSetup } from 'src/plugins/usage_collection/server'; @@ -29,7 +30,7 @@ import type { } from '../../encrypted_saved_objects/server'; import type { SecurityPluginSetup, SecurityPluginStart } from '../../security/server'; import type { PluginSetupContract as FeaturesPluginSetup } from '../../features/server'; -import type { FleetConfigType } from '../common'; +import type { FleetConfigType, FleetAuthz } from '../common'; import { INTEGRATIONS_PLUGIN_ID } from '../common'; import type { CloudSetup } from '../../cloud/server'; @@ -79,7 +80,7 @@ import { } from './services/agents'; import { registerFleetUsageCollector } from './collectors/register'; import { getInstallation, ensureInstalledPackage } from './services/epm/packages'; -import { RouterWrappers } from './routes/security'; +import { getAuthzFromRequest, RouterWrappers } from './routes/security'; import { FleetArtifactsClient } from './services/artifacts'; import type { FleetRouter } from './types/request_context'; import { TelemetryEventsSender } from './telemetry/sender'; @@ -142,6 +143,9 @@ export interface FleetStartContract { * services */ fleetSetupCompleted: () => Promise; + authz: { + fromRequest(request: KibanaRequest): Promise; + }; esIndexPatternService: ESIndexPatternService; packageService: PackageService; agentService: AgentService; @@ -205,7 +209,7 @@ export class FleetPlugin // TODO: Flesh out privileges if (deps.features) { deps.features.registerKibanaFeature({ - id: PLUGIN_ID, + id: 'fleet', name: 'Fleet and Integrations', category: DEFAULT_APP_CATEGORIES.management, app: [PLUGIN_ID, INTEGRATIONS_PLUGIN_ID, 'kibana'], @@ -230,7 +234,7 @@ export class FleetPlugin }, privileges: { all: { - api: [`${PLUGIN_ID}-read`, `${PLUGIN_ID}-all`], + api: [`fleet-read`, `fleet-all`, `integrations-all`, `integrations-read`], app: [PLUGIN_ID, INTEGRATIONS_PLUGIN_ID, 'kibana'], catalogue: ['fleet'], savedObject: { @@ -240,7 +244,7 @@ export class FleetPlugin ui: ['show', 'read', 'write'], }, read: { - api: [`${PLUGIN_ID}-read`], + api: [`fleet-read`, `integrations-read`], app: [PLUGIN_ID, INTEGRATIONS_PLUGIN_ID, 'kibana'], catalogue: ['fleet'], // TODO: check if this is actually available to read user savedObject: { @@ -255,7 +259,8 @@ export class FleetPlugin core.http.registerRouteHandlerContext( 'fleet', - (coreContext, request) => ({ + async (coreContext, request) => ({ + authz: await getAuthzFromRequest(request), epm: { // Use a lazy getter to avoid constructing this client when not used by a request handler get internalSoClient() { @@ -348,6 +353,9 @@ export class FleetPlugin })(); return { + authz: { + fromRequest: getAuthzFromRequest, + }, fleetSetupCompleted: () => fleetSetupPromise, esIndexPatternService: new ESIndexPatternSavedObjectService(), packageService: { diff --git a/x-pack/plugins/fleet/server/routes/output/handler.ts b/x-pack/plugins/fleet/server/routes/output/handler.ts index 98b42775ae223..21d337455b1ec 100644 --- a/x-pack/plugins/fleet/server/routes/output/handler.ts +++ b/x-pack/plugins/fleet/server/routes/output/handler.ts @@ -21,6 +21,7 @@ import type { } from '../../../common'; import { outputService } from '../../services/output'; import { defaultIngestErrorHandler } from '../../errors'; +import { agentPolicyService } from '../../services'; export const getOutputsHandler: RequestHandler = async (context, request, response) => { const soClient = context.core.savedObjects.client; @@ -68,9 +69,15 @@ export const putOuputHandler: RequestHandler< TypeOf > = async (context, request, response) => { const soClient = context.core.savedObjects.client; + const esClient = context.core.elasticsearch.client.asInternalUser; try { await outputService.update(soClient, request.params.outputId, request.body); const output = await outputService.get(soClient, request.params.outputId); + if (output.is_default || output.is_default_monitoring) { + await agentPolicyService.bumpAllAgentPolicies(soClient, esClient); + } else { + await agentPolicyService.bumpAllAgentPoliciesForOutput(soClient, esClient, output.id); + } const body: GetOneOutputResponse = { item: output, @@ -94,9 +101,13 @@ export const postOuputHandler: RequestHandler< TypeOf > = async (context, request, response) => { const soClient = context.core.savedObjects.client; + const esClient = context.core.elasticsearch.client.asInternalUser; try { const { id, ...data } = request.body; const output = await outputService.create(soClient, data, { id }); + if (output.is_default || output.is_default_monitoring) { + await agentPolicyService.bumpAllAgentPolicies(soClient, esClient); + } const body: GetOneOutputResponse = { item: output, diff --git a/x-pack/plugins/fleet/server/routes/security.ts b/x-pack/plugins/fleet/server/routes/security.ts index 8a67a7066742a..0b7065edf63ba 100644 --- a/x-pack/plugins/fleet/server/routes/security.ts +++ b/x-pack/plugins/fleet/server/routes/security.ts @@ -12,6 +12,9 @@ import type { RequestHandlerContext, } from 'src/core/server'; +import type { FleetAuthz } from '../../common'; +import { calculateAuthz } from '../../common'; + import { appContextService } from '../services'; const SUPERUSER_AUTHZ_MESSAGE = @@ -120,6 +123,48 @@ function makeRouterEnforcingFleetSetupPrivilege { + const security = appContextService.getSecurity(); + + if (security.authz.mode.useRbacForRequest(req)) { + const checkPrivileges = security.authz.checkPrivilegesDynamicallyWithRequest(req); + const { privileges } = await checkPrivileges({ + kibana: [ + security.authz.actions.api.get('fleet-all'), + security.authz.actions.api.get('fleet-setup'), + security.authz.actions.api.get('integrations-all'), + security.authz.actions.api.get('integrations-read'), + ], + }); + + const [fleetAll, fleetSetup, intAll, intRead] = privileges.kibana; + + return calculateAuthz({ + fleet: { + all: fleetAll.authorized, + setup: fleetSetup.authorized, + }, + + integrations: { + all: intAll.authorized, + read: intRead.authorized, + }, + }); + } + + return calculateAuthz({ + fleet: { + all: true, + setup: true, + }, + + integrations: { + all: true, + read: true, + }, + }); +} + export type RouterWrapper = (route: IRouter) => IRouter; interface RouterWrappersSetup { diff --git a/x-pack/plugins/fleet/server/routes/setup/handlers.test.ts b/x-pack/plugins/fleet/server/routes/setup/handlers.test.ts index ffdec9509b05c..4f034a0add32f 100644 --- a/x-pack/plugins/fleet/server/routes/setup/handlers.test.ts +++ b/x-pack/plugins/fleet/server/routes/setup/handlers.test.ts @@ -9,7 +9,7 @@ import { httpServerMock, savedObjectsClientMock } from 'src/core/server/mocks'; import type { PostFleetSetupResponse } from '../../../common'; import { RegistryError } from '../../errors'; -import { createAppContextStartContractMock, xpackMocks } from '../../mocks'; +import { createAppContextStartContractMock, xpackMocks, fleetAuthzMock } from '../../mocks'; import { appContextService } from '../../services/app_context'; import { setupFleet } from '../../services/setup'; import type { FleetRequestHandlerContext } from '../../types'; @@ -34,6 +34,7 @@ describe('FleetSetupHandler', () => { context = { ...xpackMocks.createRequestHandlerContext(), fleet: { + authz: fleetAuthzMock, epm: { internalSoClient: savedObjectsClientMock.create(), }, diff --git a/x-pack/plugins/fleet/server/services/agent_policy.ts b/x-pack/plugins/fleet/server/services/agent_policy.ts index bb9360b834b37..69859855d74f0 100644 --- a/x-pack/plugins/fleet/server/services/agent_policy.ts +++ b/x-pack/plugins/fleet/server/services/agent_policy.ts @@ -781,7 +781,8 @@ export async function addPackageToAgentPolicy( defaultOutput: Output, packagePolicyName?: string, packagePolicyDescription?: string, - transformPackagePolicy?: (p: NewPackagePolicy) => NewPackagePolicy + transformPackagePolicy?: (p: NewPackagePolicy) => NewPackagePolicy, + bumpAgentPolicyRevison = false ) { const packageInfo = await getPackageInfo({ savedObjectsClient: soClient, @@ -803,7 +804,10 @@ export async function addPackageToAgentPolicy( : basePackagePolicy; await packagePolicyService.create(soClient, esClient, newPackagePolicy, { - bumpRevision: false, + bumpRevision: bumpAgentPolicyRevison, skipEnsureInstalled: true, + skipUniqueNameVerification: true, + overwrite: true, + force: true, // To add package to managed policy we need the force flag }); } diff --git a/x-pack/plugins/fleet/server/services/agents/crud.test.ts b/x-pack/plugins/fleet/server/services/agents/crud.test.ts new file mode 100644 index 0000000000000..01b7d21ef2809 --- /dev/null +++ b/x-pack/plugins/fleet/server/services/agents/crud.test.ts @@ -0,0 +1,195 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { ElasticsearchClient } from 'kibana/server'; + +import type { Agent } from '../../types'; + +import { getAgentsByKuery } from './crud'; + +jest.mock('../../../common', () => ({ + ...jest.requireActual('../../../common'), + isAgentUpgradeable: jest.fn().mockImplementation((agent: Agent) => agent.id.includes('up')), +})); + +describe('Agents CRUD test', () => { + let esClientMock: ElasticsearchClient; + let searchMock: jest.Mock; + describe('getAgentsByKuery', () => { + beforeEach(() => { + searchMock = jest.fn(); + esClientMock = { + search: searchMock, + } as unknown as ElasticsearchClient; + }); + function getEsResponse(ids: string[], total: number) { + return { + body: { + hits: { + total: { value: total }, + hits: ids.map((id: string) => ({ + _id: id, + _source: {}, + })), + }, + }, + }; + } + it('should return upgradeable on first page', async () => { + searchMock + .mockImplementationOnce(() => Promise.resolve(getEsResponse(['1', '2', '3', '4', '5'], 7))) + .mockImplementationOnce(() => + Promise.resolve(getEsResponse(['1', '2', '3', '4', '5', 'up', '7'], 7)) + ); + const result = await getAgentsByKuery(esClientMock, { + showUpgradeable: true, + showInactive: false, + page: 1, + perPage: 5, + }); + + expect(result).toEqual({ + agents: [ + { + access_api_key: undefined, + id: 'up', + packages: [], + policy_revision: undefined, + status: 'inactive', + }, + ], + page: 1, + perPage: 5, + total: 1, + }); + }); + + it('should return upgradeable from all pages', async () => { + searchMock + .mockImplementationOnce(() => Promise.resolve(getEsResponse(['1', '2', '3', 'up', '5'], 7))) + .mockImplementationOnce(() => + Promise.resolve(getEsResponse(['1', '2', '3', 'up', '5', 'up2', '7'], 7)) + ); + const result = await getAgentsByKuery(esClientMock, { + showUpgradeable: true, + showInactive: false, + page: 1, + perPage: 5, + }); + + expect(result).toEqual({ + agents: [ + { + access_api_key: undefined, + id: 'up', + packages: [], + policy_revision: undefined, + status: 'inactive', + }, + { + access_api_key: undefined, + id: 'up2', + packages: [], + policy_revision: undefined, + status: 'inactive', + }, + ], + page: 1, + perPage: 5, + total: 2, + }); + }); + + it('should return upgradeable on second page', async () => { + searchMock + .mockImplementationOnce(() => Promise.resolve(getEsResponse(['up6', '7'], 7))) + .mockImplementationOnce(() => + Promise.resolve(getEsResponse(['up1', 'up2', 'up3', 'up4', 'up5', 'up6', '7'], 7)) + ); + const result = await getAgentsByKuery(esClientMock, { + showUpgradeable: true, + showInactive: false, + page: 2, + perPage: 5, + }); + + expect(result).toEqual({ + agents: [ + { + access_api_key: undefined, + id: 'up6', + packages: [], + policy_revision: undefined, + status: 'inactive', + }, + ], + page: 2, + perPage: 5, + total: 6, + }); + }); + + it('should return upgradeable from one page when total is more than limit', async () => { + searchMock.mockImplementationOnce(() => + Promise.resolve(getEsResponse(['1', '2', '3', 'up', '5'], 10001)) + ); + const result = await getAgentsByKuery(esClientMock, { + showUpgradeable: true, + showInactive: false, + page: 1, + perPage: 5, + }); + + expect(result).toEqual({ + agents: [ + { + access_api_key: undefined, + id: 'up', + packages: [], + policy_revision: undefined, + status: 'inactive', + }, + ], + page: 1, + perPage: 5, + total: 10001, + }); + }); + + it('should return second page', async () => { + searchMock.mockImplementationOnce(() => Promise.resolve(getEsResponse(['6', '7'], 7))); + const result = await getAgentsByKuery(esClientMock, { + showUpgradeable: false, + showInactive: false, + page: 2, + perPage: 5, + }); + + expect(result).toEqual({ + agents: [ + { + access_api_key: undefined, + id: '6', + packages: [], + policy_revision: undefined, + status: 'inactive', + }, + { + access_api_key: undefined, + id: '7', + packages: [], + policy_revision: undefined, + status: 'inactive', + }, + ], + page: 2, + perPage: 5, + total: 7, + }); + }); + }); +}); diff --git a/x-pack/plugins/fleet/server/services/agents/crud.ts b/x-pack/plugins/fleet/server/services/agents/crud.ts index 516acf5a120de..6a00e2d5a6e1d 100644 --- a/x-pack/plugins/fleet/server/services/agents/crud.ts +++ b/x-pack/plugins/fleet/server/services/agents/crud.ts @@ -122,30 +122,46 @@ export async function getAgentsByKuery( const kueryNode = _joinFilters(filters); const body = kueryNode ? { query: toElasticsearchQuery(kueryNode) } : {}; - const res = await esClient.search({ - index: AGENTS_INDEX, - from: (page - 1) * perPage, - size: perPage, - track_total_hits: true, - ignore_unavailable: true, - body: { - ...body, - sort: [{ [sortField]: { order: sortOrder } }], - }, - }); + const queryAgents = async (from: number, size: number) => + esClient.search({ + index: AGENTS_INDEX, + from, + size, + track_total_hits: true, + ignore_unavailable: true, + body: { + ...body, + sort: [{ [sortField]: { order: sortOrder } }], + }, + }); + const res = await queryAgents((page - 1) * perPage, perPage); let agents = res.body.hits.hits.map(searchHitToAgent); + let total = (res.body.hits.total as estypes.SearchTotalHits).value; // filtering for a range on the version string will not work, // nor does filtering on a flattened field (local_metadata), so filter here if (showUpgradeable) { - agents = agents.filter((agent) => - isAgentUpgradeable(agent, appContextService.getKibanaVersion()) - ); + // fixing a bug where upgradeable filter was not returning right results https://github.com/elastic/kibana/issues/117329 + // query all agents, then filter upgradeable, and return the requested page and correct total + // if there are more than SO_SEARCH_LIMIT agents, the logic falls back to same as before + if (total < SO_SEARCH_LIMIT) { + const response = await queryAgents(0, SO_SEARCH_LIMIT); + agents = response.body.hits.hits + .map(searchHitToAgent) + .filter((agent) => isAgentUpgradeable(agent, appContextService.getKibanaVersion())); + total = agents.length; + const start = (page - 1) * perPage; + agents = agents.slice(start, start + perPage); + } else { + agents = agents.filter((agent) => + isAgentUpgradeable(agent, appContextService.getKibanaVersion()) + ); + } } return { agents, - total: (res.body.hits.total as estypes.SearchTotalHits).value, + total, page, perPage, }; diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/datastream_ilm/install.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/datastream_ilm/install.ts index 4f114e0df11cc..2e43fe44527b7 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/datastream_ilm/install.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/datastream_ilm/install.ts @@ -17,6 +17,8 @@ import { getInstallation } from '../../packages'; import { saveInstalledEsRefs } from '../../packages/install'; import { getAsset } from '../transform/common'; +import { getESAssetMetadata } from '../meta'; + import { deleteIlmRefs, deleteIlms } from './remove'; interface IlmInstallation { @@ -77,9 +79,12 @@ export const installIlmForDataStream = async ( const ilmInstallations: IlmInstallation[] = ilmPathDatasets.map( (ilmPathDataset: IlmPathDataset) => { + const content = JSON.parse(getAsset(ilmPathDataset.path).toString('utf-8')); + content.policy._meta = getESAssetMetadata({ packageName: installation?.name }); + return { installationName: getIlmNameForInstallation(ilmPathDataset), - content: getAsset(ilmPathDataset.path).toString('utf-8'), + content, }; } ); diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/ilm/install.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/ilm/install.ts index 8d6f37345902e..380bd0e913d6d 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/ilm/install.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/ilm/install.ts @@ -7,15 +7,25 @@ import type { ElasticsearchClient } from 'kibana/server'; +import type { InstallablePackage } from '../../../../types'; + import { ElasticsearchAssetType } from '../../../../types'; import { getAsset, getPathParts } from '../../archive'; +import { getESAssetMetadata } from '../meta'; -export async function installILMPolicy(paths: string[], esClient: ElasticsearchClient) { +export async function installILMPolicy( + packageInfo: InstallablePackage, + paths: string[], + esClient: ElasticsearchClient +) { const ilmPaths = paths.filter((path) => isILMPolicy(path)); if (!ilmPaths.length) return; await Promise.all( ilmPaths.map(async (path) => { - const body = getAsset(path).toString('utf-8'); + const body = JSON.parse(getAsset(path).toString('utf-8')); + + body.policy._meta = getESAssetMetadata({ packageName: packageInfo.name }); + const { file } = getPathParts(path); const name = file.substr(0, file.lastIndexOf('.')); try { diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/install.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/install.ts index 42e1bff6ab370..560ff08331044 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/install.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/install.ts @@ -20,6 +20,8 @@ import { FLEET_FINAL_PIPELINE_VERSION, } from '../../../../constants'; +import { appendMetadataToIngestPipeline } from '../meta'; + import { deletePipelineRefs } from './remove'; interface RewriteSubstitution { @@ -104,7 +106,7 @@ export const installPipelines = async ( dataStream, esClient, paths: pipelinePaths, - pkgVersion: installablePackage.version, + installablePackage, }) ); } @@ -118,7 +120,7 @@ export const installPipelines = async ( dataStream: undefined, esClient, paths: topLevelPipelinePaths, - pkgVersion: installablePackage.version, + installablePackage, }) ); } @@ -149,14 +151,14 @@ export function rewriteIngestPipeline( export async function installAllPipelines({ esClient, - pkgVersion, paths, dataStream, + installablePackage, }: { esClient: ElasticsearchClient; - pkgVersion: string; paths: string[]; dataStream?: RegistryDataStream; + installablePackage: InstallablePackage; }): Promise { const pipelinePaths = dataStream ? paths.filter((path) => isDataStreamPipeline(path, dataStream.path)) @@ -169,7 +171,7 @@ export async function installAllPipelines({ const nameForInstallation = getPipelineNameForInstallation({ pipelineName: name, dataStream, - packageVersion: pkgVersion, + packageVersion: installablePackage.version, }); const content = getAsset(path).toString('utf-8'); pipelines.push({ @@ -193,7 +195,7 @@ export async function installAllPipelines({ }); const installationPromises = pipelines.map(async (pipeline) => { - return installPipeline({ esClient, pipeline }); + return installPipeline({ esClient, pipeline, installablePackage }); }); return Promise.all(installationPromises); @@ -202,20 +204,27 @@ export async function installAllPipelines({ async function installPipeline({ esClient, pipeline, + installablePackage, }: { esClient: ElasticsearchClient; pipeline: any; + installablePackage?: InstallablePackage; }): Promise { + const pipelineWithMetadata = appendMetadataToIngestPipeline({ + pipeline, + packageName: installablePackage?.name, + }); + const esClientParams = { - id: pipeline.nameForInstallation, - body: pipeline.contentForInstallation, + id: pipelineWithMetadata.nameForInstallation, + body: pipelineWithMetadata.contentForInstallation, }; const esClientRequestOptions: TransportRequestOptions = { ignore: [404], }; - if (pipeline.extension === 'yml') { + if (pipelineWithMetadata.extension === 'yml') { esClientRequestOptions.headers = { // pipeline is YAML 'Content-Type': 'application/yaml', @@ -226,7 +235,10 @@ async function installPipeline({ await esClient.ingest.putPipeline(esClientParams, esClientRequestOptions); - return { id: pipeline.nameForInstallation, type: ElasticsearchAssetType.ingestPipeline }; + return { + id: pipelineWithMetadata.nameForInstallation, + type: ElasticsearchAssetType.ingestPipeline, + }; } export async function ensureFleetFinalPipelineIsInstalled(esClient: ElasticsearchClient) { diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/meta.test.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/meta.test.ts new file mode 100644 index 0000000000000..5d6668a6b862b --- /dev/null +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/meta.test.ts @@ -0,0 +1,28 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { getESAssetMetadata } from './meta'; + +describe('getESAssetMetadata', () => { + describe('with package name', () => { + it('generates expected JSON', () => { + const packageName = 'foo'; + + const meta = getESAssetMetadata({ packageName }); + + expect(meta).toEqual({ managed_by: 'fleet', managed: true, package: { name: packageName } }); + }); + }); + + describe('without package name', () => { + it('generates expected JSON', () => { + const meta = getESAssetMetadata(); + + expect(meta).toEqual({ managed_by: 'fleet', managed: true }); + }); + }); +}); diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/meta.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/meta.ts new file mode 100644 index 0000000000000..a3ceaf44100d7 --- /dev/null +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/meta.ts @@ -0,0 +1,69 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { safeLoad, safeDump } from 'js-yaml'; + +const MANAGED_BY_DEFAULT = 'fleet'; + +export interface ESAssetMetadata { + package?: { + name: string; + }; + managed_by: string; + managed: boolean; +} + +/** + * Build common metadata object for Elasticsearch assets installed by Fleet. Result should be + * stored on a `_meta` field on the generated assets. + */ +export function getESAssetMetadata({ + packageName, +}: { packageName?: string } = {}): ESAssetMetadata { + const meta: ESAssetMetadata = { + managed_by: MANAGED_BY_DEFAULT, + managed: true, + }; + + if (packageName) { + meta.package = { + name: packageName, + }; + } + + return meta; +} + +export function appendMetadataToIngestPipeline({ + pipeline, + packageName, +}: { + pipeline: any; + packageName?: string; +}): any { + const meta = getESAssetMetadata({ packageName }); + + if (pipeline.extension === 'yml') { + // Convert the YML content to JSON, append the `_meta` value, then convert it back to + // YML and return the resulting YML + const parsedPipelineContent = safeLoad(pipeline.contentForInstallation); + parsedPipelineContent._meta = meta; + + return { + ...pipeline, + contentForInstallation: `---\n${safeDump(parsedPipelineContent)}`, + }; + } + + const parsedPipelineContent = JSON.parse(pipeline.contentForInstallation); + parsedPipelineContent._meta = meta; + + return { + ...pipeline, + contentForInstallation: parsedPipelineContent, + }; +} diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/__snapshots__/template.test.ts.snap b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/__snapshots__/template.test.ts.snap index 0425573c5afaa..e977c41cd69d8 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/__snapshots__/template.test.ts.snap +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/__snapshots__/template.test.ts.snap @@ -75,11 +75,11 @@ exports[`EPM template tests loading base.yml: base.yml 1`] = ` } }, "_meta": { + "managed_by": "fleet", + "managed": true, "package": { "name": "nginx" - }, - "managed_by": "ingest-manager", - "managed": true + } } } }, @@ -88,11 +88,11 @@ exports[`EPM template tests loading base.yml: base.yml 1`] = ` ".fleet_component_template-1" ], "_meta": { + "managed_by": "fleet", + "managed": true, "package": { "name": "nginx" - }, - "managed_by": "ingest-manager", - "managed": true + } } } `; @@ -168,11 +168,11 @@ exports[`EPM template tests loading coredns.logs.yml: coredns.logs.yml 1`] = ` } }, "_meta": { + "managed_by": "fleet", + "managed": true, "package": { "name": "coredns" - }, - "managed_by": "ingest-manager", - "managed": true + } } } }, @@ -181,11 +181,11 @@ exports[`EPM template tests loading coredns.logs.yml: coredns.logs.yml 1`] = ` ".fleet_component_template-1" ], "_meta": { + "managed_by": "fleet", + "managed": true, "package": { "name": "coredns" - }, - "managed_by": "ingest-manager", - "managed": true + } } } `; @@ -1645,11 +1645,11 @@ exports[`EPM template tests loading system.yml: system.yml 1`] = ` } }, "_meta": { + "managed_by": "fleet", + "managed": true, "package": { "name": "system" - }, - "managed_by": "ingest-manager", - "managed": true + } } } }, @@ -1658,11 +1658,11 @@ exports[`EPM template tests loading system.yml: system.yml 1`] = ` ".fleet_component_template-1" ], "_meta": { + "managed_by": "fleet", + "managed": true, "package": { "name": "system" - }, - "managed_by": "ingest-manager", - "managed": true + } } } `; diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/install.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/install.ts index 67b57dea6e310..de64b99c787ad 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/install.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/install.ts @@ -27,6 +27,9 @@ import { FLEET_GLOBAL_COMPONENT_TEMPLATE_CONTENT, } from '../../../../constants'; +import type { ESAssetMetadata } from '../meta'; +import { getESAssetMetadata } from '../meta'; + import { generateMappings, generateTemplateName, @@ -171,7 +174,7 @@ export async function installTemplateForDataStream({ } interface TemplateMapEntry { - _meta: { package?: { name: string } }; + _meta: ESAssetMetadata; template: | { mappings: NonNullable; @@ -220,7 +223,7 @@ function buildComponentTemplates(params: { const userSettingsTemplateName = `${templateName}${userSettingsSuffix}`; const templatesMap: TemplateMap = {}; - const _meta = { package: { name: packageName } }; + const _meta = getESAssetMetadata({ packageName }); if (registryElasticsearch && registryElasticsearch['index_template.mappings']) { templatesMap[mappingsTemplateName] = { diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts index 16cb4a29bcc7e..5bad33defc578 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts @@ -17,6 +17,7 @@ import type { import { appContextService } from '../../../'; import { getRegistryDataStreamAssetBaseName } from '../index'; import { FLEET_GLOBAL_COMPONENT_TEMPLATE_NAME } from '../../../../constants'; +import { getESAssetMetadata } from '../meta'; interface Properties { [key: string]: any; @@ -367,13 +368,7 @@ function getBaseTemplate( hidden?: boolean ): IndexTemplate { // Meta information to identify Ingest Manager's managed templates and indices - const _meta = { - package: { - name: packageName, - }, - managed_by: 'ingest-manager', - managed: true, - }; + const _meta = getESAssetMetadata({ packageName }); return { priority: templatePriority, diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/transform/install.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/transform/install.ts index 93181d4f26d02..8b76b5a026fc0 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/transform/install.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/transform/install.ts @@ -15,12 +15,14 @@ import type { EsAssetReference, InstallablePackage } from '../../../../../common import { getInstallation } from '../../packages'; import { appContextService } from '../../../app_context'; +import { getESAssetMetadata } from '../meta'; + import { deleteTransforms, deleteTransformRefs } from './remove'; import { getAsset } from './common'; interface TransformInstallation { installationName: string; - content: string; + content: any; } export const installTransform = async ( @@ -71,13 +73,16 @@ export const installTransform = async ( await saveInstalledEsRefs(savedObjectsClient, installablePackage.name, transformRefs); const transforms: TransformInstallation[] = transformPaths.map((path: string) => { + const content = JSON.parse(getAsset(path).toString('utf-8')); + content._meta = getESAssetMetadata({ packageName: installablePackage.name }); + return { installationName: getTransformNameForInstallation( installablePackage, path, installNameSuffix ), - content: getAsset(path).toString('utf-8'), + content, }; }); @@ -123,7 +128,6 @@ async function handleTransformInstall({ await esClient.transform.putTransform({ transform_id: transform.installationName, defer_validation: true, - // @ts-expect-error expect object, but given a string body: transform.content, }); } catch (err) { diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/transform/transform.test.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/transform/transform.test.ts index 5f6f64576ad64..1aef95a49fdcb 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/transform/transform.test.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/transform/transform.test.ts @@ -31,8 +31,10 @@ import { savedObjectsClientMock } from '../../../../../../../../src/core/server/ import { elasticsearchClientMock } from '../../../../../../../../src/core/server/elasticsearch/client/mocks'; import { appContextService } from '../../../app_context'; -import { getAsset } from './common'; +import { getESAssetMetadata } from '../meta'; + import { installTransform } from './install'; +import { getAsset } from './common'; describe('test transform install', () => { let esClient: DeeplyMockedKeys; @@ -195,19 +197,21 @@ describe('test transform install', () => { ], ]); + const meta = getESAssetMetadata({ packageName: 'endpoint' }); + expect(esClient.transform.putTransform.mock.calls).toEqual([ [ { transform_id: 'endpoint.metadata-default-0.16.0-dev.0', defer_validation: true, - body: '{"content": "data"}', + body: { content: 'data', _meta: meta }, }, ], [ { transform_id: 'endpoint.metadata_current-default-0.16.0-dev.0', defer_validation: true, - body: '{"content": "data"}', + body: { content: 'data', _meta: meta }, }, ], ]); @@ -328,12 +332,14 @@ describe('test transform install', () => { savedObjectsClient ); + const meta = getESAssetMetadata({ packageName: 'endpoint' }); + expect(esClient.transform.putTransform.mock.calls).toEqual([ [ { transform_id: 'endpoint.metadata_current-default-0.16.0-dev.0', defer_validation: true, - body: '{"content": "data"}', + body: { content: 'data', _meta: meta }, }, ], ]); @@ -553,12 +559,14 @@ describe('test transform install', () => { savedObjectsClient ); + const meta = getESAssetMetadata({ packageName: 'endpoint' }); + expect(esClient.transform.putTransform.mock.calls).toEqual([ [ { transform_id: 'endpoint.metadata_current-default-0.16.0-dev.0', defer_validation: true, - body: '{"content": "data"}', + body: { content: 'data', _meta: meta }, }, ], ]); diff --git a/x-pack/plugins/fleet/server/services/epm/packages/_install_package.ts b/x-pack/plugins/fleet/server/services/epm/packages/_install_package.ts index da91921ecd7e1..776a3d3cd6bc1 100644 --- a/x-pack/plugins/fleet/server/services/epm/packages/_install_package.ts +++ b/x-pack/plugins/fleet/server/services/epm/packages/_install_package.ts @@ -131,7 +131,7 @@ export async function _installPackage({ // currently only the base package has an ILM policy // at some point ILM policies can be installed/modified // per data stream and we should then save them - await installILMPolicy(paths, esClient); + await installILMPolicy(packageInfo, paths, esClient); const installedDataStreamIlm = await installIlmForDataStream( packageInfo, diff --git a/x-pack/plugins/fleet/server/services/output.ts b/x-pack/plugins/fleet/server/services/output.ts index 0626caa37df9a..511aba4e6a932 100644 --- a/x-pack/plugins/fleet/server/services/output.ts +++ b/x-pack/plugins/fleet/server/services/output.ts @@ -193,6 +193,8 @@ class OutputService { type: SAVED_OBJECT_TYPE, page: 1, perPage: SO_SEARCH_LIMIT, + sortField: 'is_default', + sortOrder: 'desc', }); return { diff --git a/x-pack/plugins/fleet/server/services/package_policy.ts b/x-pack/plugins/fleet/server/services/package_policy.ts index 4a91979224017..535d93cc3eceb 100644 --- a/x-pack/plugins/fleet/server/services/package_policy.ts +++ b/x-pack/plugins/fleet/server/services/package_policy.ts @@ -96,17 +96,22 @@ class PackagePolicyService { bumpRevision?: boolean; force?: boolean; skipEnsureInstalled?: boolean; + skipUniqueNameVerification?: boolean; + overwrite?: boolean; } ): Promise { - const existingPoliciesWithName = await this.list(soClient, { - perPage: 1, - kuery: `${PACKAGE_POLICY_SAVED_OBJECT_TYPE}.name: "${packagePolicy.name}"`, - }); + if (!options?.skipUniqueNameVerification) { + const existingPoliciesWithName = await this.list(soClient, { + perPage: 1, + kuery: `${PACKAGE_POLICY_SAVED_OBJECT_TYPE}.name: "${packagePolicy.name}"`, + }); - // Check that the name does not exist already - if (existingPoliciesWithName.items.length > 0) { - throw new IngestManagerError('There is already a package with the same name'); + // Check that the name does not exist already + if (existingPoliciesWithName.items.length > 0) { + throw new IngestManagerError('There is already an integration policy with the same name'); + } } + let elasticsearch: PackagePolicy['elasticsearch']; // Add ids to stream const packagePolicyId = options?.id || uuid.v4(); @@ -366,7 +371,7 @@ class PackagePolicyService { const filtered = (existingPoliciesWithName?.items || []).filter((p) => p.id !== id); if (filtered.length > 0) { - throw new IngestManagerError('There is already a package with the same name'); + throw new IngestManagerError('There is already an integration policy with the same name'); } let inputs = restOfPackagePolicy.inputs.map((input) => diff --git a/x-pack/plugins/fleet/server/services/preconfiguration.test.ts b/x-pack/plugins/fleet/server/services/preconfiguration.test.ts index 6fefc4631239d..4b87c0957c961 100644 --- a/x-pack/plugins/fleet/server/services/preconfiguration.test.ts +++ b/x-pack/plugins/fleet/server/services/preconfiguration.test.ts @@ -5,12 +5,14 @@ * 2.0. */ +import uuid from 'uuid'; import { elasticsearchServiceMock, savedObjectsClientMock } from 'src/core/server/mocks'; import { SavedObjectsErrorHelpers } from '../../../../../src/core/server'; import type { InstallResult, + PackagePolicy, PreconfiguredAgentPolicy, PreconfiguredOutput, } from '../../common/types'; @@ -27,11 +29,13 @@ import { cleanPreconfiguredOutputs, } from './preconfiguration'; import { outputService } from './output'; +import { packagePolicyService } from './package_policy'; jest.mock('./agent_policy_update'); jest.mock('./output'); const mockedOutputService = outputService as jest.Mocked; +const mockedPackagePolicyService = packagePolicyService as jest.Mocked; const mockInstalledPackages = new Map(); const mockInstallPackageErrors = new Map(); @@ -57,7 +61,7 @@ function getPutPreconfiguredPackagesMock() { return { saved_objects: [ { - id: `mocked-${id}`, + id, attributes, type: type as string, score: 1, @@ -80,8 +84,9 @@ function getPutPreconfiguredPackagesMock() { soClient.get.mockImplementation(async (type, id) => { const attributes = mockConfiguredPolicies.get(id); if (!attributes) throw SavedObjectsErrorHelpers.createGenericNotFoundError(type, id); + return { - id: `mocked-${id}`, + id, attributes, type: type as string, references: [], @@ -92,7 +97,7 @@ function getPutPreconfiguredPackagesMock() { const { id } = options!; mockConfiguredPolicies.set(id, attributes); return { - id: `mocked-${id}`, + id: id || uuid.v4(), attributes, type, references: [], @@ -163,13 +168,15 @@ jest.mock('./package_policy', () => ({ packagePolicyService: { getByIDs: jest.fn().mockReturnValue([]), listIds: jest.fn().mockReturnValue({ items: [] }), - create(soClient: any, esClient: any, newPackagePolicy: NewPackagePolicy) { - return { - id: 'mocked', - version: 'mocked', - ...newPackagePolicy, - }; - }, + create: jest + .fn() + .mockImplementation((soClient: any, esClient: any, newPackagePolicy: NewPackagePolicy) => { + return { + id: 'mocked', + version: 'mocked', + ...newPackagePolicy, + }; + }), get(soClient: any, id: string) { return { id: 'mocked', @@ -201,6 +208,7 @@ const spyAgentPolicyServicBumpAllAgentPoliciesForOutput = jest.spyOn( describe('policy preconfiguration', () => { beforeEach(() => { + mockedPackagePolicyService.create.mockReset(); mockInstalledPackages.clear(); mockInstallPackageErrors.clear(); mockConfiguredPolicies.clear(); @@ -267,11 +275,116 @@ describe('policy preconfiguration', () => { ); expect(policies.length).toEqual(1); - expect(policies[0].id).toBe('mocked-test-id'); + expect(policies[0].id).toBe('test-id'); expect(packages).toEqual(expect.arrayContaining(['test_package-3.0.0'])); expect(nonFatalErrors.length).toBe(0); }); + it('should not add new package policy to existing non managed policies', async () => { + const soClient = getPutPreconfiguredPackagesMock(); + const esClient = elasticsearchServiceMock.createClusterClient().asInternalUser; + mockedPackagePolicyService.getByIDs.mockResolvedValue([ + { name: 'test_package1' } as PackagePolicy, + ]); + + mockConfiguredPolicies.set('test-id', { + name: 'Test policy', + description: 'Test policy description', + unenroll_timeout: 120, + namespace: 'default', + id: 'test-id', + package_policies: [ + { + name: 'test_package1', + }, + ], + } as PreconfiguredAgentPolicy); + + await ensurePreconfiguredPackagesAndPolicies( + soClient, + esClient, + [ + { + name: 'Test policy', + namespace: 'default', + id: 'test-id', + is_managed: false, + package_policies: [ + { + package: { name: 'test_package' }, + name: 'test_package1', + }, + { + package: { name: 'test_package' }, + name: 'test_package2', + }, + ], + }, + ] as PreconfiguredAgentPolicy[], + [{ name: 'test_package', version: '3.0.0' }], + mockDefaultOutput + ); + + expect(mockedPackagePolicyService.create).not.toBeCalled(); + }); + + it('should add new package policy to existing managed policies', async () => { + const soClient = getPutPreconfiguredPackagesMock(); + const esClient = elasticsearchServiceMock.createClusterClient().asInternalUser; + mockedPackagePolicyService.getByIDs.mockResolvedValue([ + { name: 'test_package1' } as PackagePolicy, + ]); + + mockConfiguredPolicies.set('test-id', { + name: 'Test policy', + description: 'Test policy description', + unenroll_timeout: 120, + namespace: 'default', + id: 'test-id', + package_policies: [ + { + name: 'test_package1', + }, + ], + is_managed: true, + } as PreconfiguredAgentPolicy); + + await ensurePreconfiguredPackagesAndPolicies( + soClient, + esClient, + [ + { + name: 'Test policy', + namespace: 'default', + id: 'test-id', + is_managed: true, + package_policies: [ + { + package: { name: 'test_package' }, + name: 'test_package1', + }, + { + package: { name: 'test_package' }, + name: 'test_package2', + }, + ], + }, + ] as PreconfiguredAgentPolicy[], + [{ name: 'test_package', version: '3.0.0' }], + mockDefaultOutput + ); + + expect(mockedPackagePolicyService.create).toBeCalledTimes(1); + expect(mockedPackagePolicyService.create).toBeCalledWith( + expect.anything(), // so client + expect.anything(), // es client + expect.objectContaining({ + name: 'test_package2', + }), + expect.anything() // options + ); + }); + it('should throw an error when trying to install duplicate packages', async () => { const soClient = getPutPreconfiguredPackagesMock(); const esClient = elasticsearchServiceMock.createClusterClient().asInternalUser; @@ -352,6 +465,7 @@ describe('policy preconfiguration', () => { '[Test policy] could not be added. [test_package] is not installed, add [test_package] to [xpack.fleet.packages] or remove it from [Test package].' ); }); + it('should not attempt to recreate or modify an agent policy if its ID is unchanged', async () => { const soClient = getPutPreconfiguredPackagesMock(); const esClient = elasticsearchServiceMock.createClusterClient().asInternalUser; @@ -373,7 +487,7 @@ describe('policy preconfiguration', () => { ); expect(policiesA.length).toEqual(1); - expect(policiesA[0].id).toBe('mocked-test-id'); + expect(policiesA[0].id).toBe('test-id'); expect(nonFatalErrorsA.length).toBe(0); const { policies: policiesB, nonFatalErrors: nonFatalErrorsB } = @@ -398,7 +512,7 @@ describe('policy preconfiguration', () => { ); expect(policiesB.length).toEqual(1); - expect(policiesB[0].id).toBe('mocked-test-id'); + expect(policiesB[0].id).toBe('test-id'); expect(policiesB[0].updated_at).toEqual(policiesA[0].updated_at); expect(nonFatalErrorsB.length).toBe(0); }); diff --git a/x-pack/plugins/fleet/server/services/preconfiguration.ts b/x-pack/plugins/fleet/server/services/preconfiguration.ts index b16eae266d28c..8b906b68556a4 100644 --- a/x-pack/plugins/fleet/server/services/preconfiguration.ts +++ b/x-pack/plugins/fleet/server/services/preconfiguration.ts @@ -19,12 +19,9 @@ import type { PreconfiguredPackage, PreconfigurationError, PreconfiguredOutput, + PackagePolicy, } from '../../common'; -import { - AGENT_POLICY_SAVED_OBJECT_TYPE, - SO_SEARCH_LIMIT, - normalizeHostsForAgents, -} from '../../common'; +import { SO_SEARCH_LIMIT, normalizeHostsForAgents } from '../../common'; import { PRECONFIGURATION_DELETION_RECORD_SAVED_OBJECT_TYPE, PRECONFIGURATION_LATEST_KEYWORD, @@ -284,65 +281,69 @@ export async function ensurePreconfiguredPackagesAndPolicies( } fulfilledPolicies.push(policyResult.value); const { created, policy, shouldAddIsManagedFlag } = policyResult.value; - if (created) { - try { - const preconfiguredAgentPolicy = policies[i]; - const { package_policies: packagePolicies } = preconfiguredAgentPolicy; - - const installedPackagePolicies = await Promise.all( - packagePolicies.map(async ({ package: pkg, name, ...newPackagePolicy }) => { - const installedPackage = await getInstallation({ - savedObjectsClient: soClient, - pkgName: pkg.name, - }); - if (!installedPackage) { - const rejectedPackage = rejectedPackages.find((rp) => rp.package?.name === pkg.name); - - if (rejectedPackage) { - throw new Error( - i18n.translate('xpack.fleet.preconfiguration.packageRejectedError', { - defaultMessage: `[{agentPolicyName}] could not be added. [{pkgName}] could not be installed due to error: [{errorMessage}]`, - values: { - agentPolicyName: preconfiguredAgentPolicy.name, - pkgName: pkg.name, - errorMessage: rejectedPackage.error.toString(), - }, - }) - ); - } + if (created || policies[i].is_managed) { + const preconfiguredAgentPolicy = policies[i]; + const { package_policies: packagePolicies } = preconfiguredAgentPolicy; + const agentPolicyWithPackagePolicies = await agentPolicyService.get( + soClient, + policy!.id, + true + ); + const installedPackagePolicies = await Promise.all( + packagePolicies.map(async ({ package: pkg, name, ...newPackagePolicy }) => { + const installedPackage = await getInstallation({ + savedObjectsClient: soClient, + pkgName: pkg.name, + }); + if (!installedPackage) { + const rejectedPackage = rejectedPackages.find((rp) => rp.package?.name === pkg.name); + + if (rejectedPackage) { throw new Error( - i18n.translate('xpack.fleet.preconfiguration.packageMissingError', { - defaultMessage: - '[{agentPolicyName}] could not be added. [{pkgName}] is not installed, add [{pkgName}] to [{packagesConfigValue}] or remove it from [{packagePolicyName}].', + i18n.translate('xpack.fleet.preconfiguration.packageRejectedError', { + defaultMessage: `[{agentPolicyName}] could not be added. [{pkgName}] could not be installed due to error: [{errorMessage}]`, values: { agentPolicyName: preconfiguredAgentPolicy.name, - packagePolicyName: name, pkgName: pkg.name, - packagesConfigValue: 'xpack.fleet.packages', + errorMessage: rejectedPackage.error.toString(), }, }) ); } - return { name, installedPackage, ...newPackagePolicy }; - }) - ); - await addPreconfiguredPolicyPackages( - soClient, - esClient, - policy!, - installedPackagePolicies!, - defaultOutput + + throw new Error( + i18n.translate('xpack.fleet.preconfiguration.packageMissingError', { + defaultMessage: + '[{agentPolicyName}] could not be added. [{pkgName}] is not installed, add [{pkgName}] to [{packagesConfigValue}] or remove it from [{packagePolicyName}].', + values: { + agentPolicyName: preconfiguredAgentPolicy.name, + packagePolicyName: name, + pkgName: pkg.name, + packagesConfigValue: 'xpack.fleet.packages', + }, + }) + ); + } + return { name, installedPackage, ...newPackagePolicy }; + }) + ); + + const packagePoliciesToAdd = installedPackagePolicies.filter((installablePackagePolicy) => { + return !(agentPolicyWithPackagePolicies?.package_policies as PackagePolicy[]).some( + (packagePolicy) => packagePolicy.name === installablePackagePolicy.name ); - // If ann error happens while adding a package to the policy we will delete the policy so the setup can be retried later - } catch (err) { - await soClient - .delete(AGENT_POLICY_SAVED_OBJECT_TYPE, policy!.id) - // swallow error - .catch((deleteErr) => logger.error(deleteErr)); - - throw err; - } + }); + + await addPreconfiguredPolicyPackages( + soClient, + esClient, + policy!, + packagePoliciesToAdd!, + defaultOutput, + !created + ); + // Add the is_managed flag after configuring package policies to avoid errors if (shouldAddIsManagedFlag) { await agentPolicyService.update(soClient, esClient, policy!.id, { is_managed: true }); @@ -408,7 +409,8 @@ async function addPreconfiguredPolicyPackages( inputs?: InputsOverride[]; } >, - defaultOutput: Output + defaultOutput: Output, + bumpAgentPolicyRevison = false ) { // Add packages synchronously to avoid overwriting for (const { installedPackage, name, description, inputs } of installedPackagePolicies) { @@ -426,7 +428,8 @@ async function addPreconfiguredPolicyPackages( defaultOutput, name, description, - (policy) => overridePackageInputs(policy, packageInfo, inputs) + (policy) => overridePackageInputs(policy, packageInfo, inputs), + bumpAgentPolicyRevison ); } } diff --git a/x-pack/plugins/fleet/server/telemetry/sender.test.ts b/x-pack/plugins/fleet/server/telemetry/sender.test.ts index a1ba0693bf3f3..1ed77d43b06ad 100644 --- a/x-pack/plugins/fleet/server/telemetry/sender.test.ts +++ b/x-pack/plugins/fleet/server/telemetry/sender.test.ts @@ -32,6 +32,15 @@ describe('TelemetryEventsSender', () => { beforeEach(() => { logger = loggingSystemMock.createLogger(); sender = new TelemetryEventsSender(logger); + sender['fetchClusterInfo'] = jest.fn(async () => { + return { + cluster_uuid: '1', + cluster_name: 'name', + version: { + number: '8.0.0', + }, + } as InfoResponse; + }); sender.start(undefined, { elasticsearch: { client: { asInternalUser: { info: jest.fn(async () => ({})) } } }, } as any); @@ -76,7 +85,7 @@ describe('TelemetryEventsSender', () => { expect(sender['sendEvents']).toHaveBeenCalledWith( 'https://telemetry-staging.elastic.co/v3/send/fleet-upgrades', - undefined, + { cluster_name: 'name', cluster_uuid: '1', version: { number: '8.0.0' } }, expect.anything() ); }); @@ -113,16 +122,6 @@ describe('TelemetryEventsSender', () => { ), }; - sender['fetchClusterInfo'] = jest.fn(async () => { - return { - cluster_uuid: '1', - cluster_name: 'name', - version: { - number: '8.0.0', - }, - } as InfoResponse; - }); - const myChannelEvents = [{ 'event.kind': '1' }, { 'event.kind': '2' }]; // @ts-ignore sender.queueTelemetryEvents('my-channel', myChannelEvents); diff --git a/x-pack/plugins/fleet/server/telemetry/sender.ts b/x-pack/plugins/fleet/server/telemetry/sender.ts index e7413872b6245..473ff470842bf 100644 --- a/x-pack/plugins/fleet/server/telemetry/sender.ts +++ b/x-pack/plugins/fleet/server/telemetry/sender.ts @@ -34,6 +34,7 @@ export class TelemetryEventsSender { private queuesPerChannel: { [channel: string]: TelemetryQueue } = {}; private isOptedIn?: boolean = true; // Assume true until the first check private esClient?: ElasticsearchClient; + private clusterInfo?: InfoResponse; constructor(logger: Logger) { this.logger = logger; @@ -46,6 +47,7 @@ export class TelemetryEventsSender { public async start(telemetryStart?: TelemetryPluginStart, core?: CoreStart) { this.telemetryStart = telemetryStart; this.esClient = core?.elasticsearch.client.asInternalUser; + this.clusterInfo = await this.fetchClusterInfo(); this.logger.debug(`Starting local task`); setTimeout(() => { @@ -92,12 +94,10 @@ export class TelemetryEventsSender { return; } - const clusterInfo = await this.fetchClusterInfo(); - for (const channel of Object.keys(this.queuesPerChannel)) { await this.sendEvents( await this.fetchTelemetryUrl(channel), - clusterInfo, + this.clusterInfo, this.queuesPerChannel[channel] ); } diff --git a/x-pack/plugins/fleet/server/types/models/agent_policy.ts b/x-pack/plugins/fleet/server/types/models/agent_policy.ts index 840dbd0ccb607..2e17c4ffe898e 100644 --- a/x-pack/plugins/fleet/server/types/models/agent_policy.ts +++ b/x-pack/plugins/fleet/server/types/models/agent_policy.ts @@ -22,6 +22,8 @@ export const AgentPolicyBaseSchema = { schema.oneOf([schema.literal(dataTypes.Logs), schema.literal(dataTypes.Metrics)]) ) ), + data_output_id: schema.maybe(schema.string()), + data_monitoring_output_id: schema.maybe(schema.string()), }; export const NewAgentPolicySchema = schema.object({ diff --git a/x-pack/plugins/fleet/server/types/request_context.ts b/x-pack/plugins/fleet/server/types/request_context.ts index 0d0da9145f073..8de68c91f4ef3 100644 --- a/x-pack/plugins/fleet/server/types/request_context.ts +++ b/x-pack/plugins/fleet/server/types/request_context.ts @@ -13,10 +13,12 @@ import type { SavedObjectsClientContract, IRouter, } from '../../../../../src/core/server'; +import type { FleetAuthz } from '../../common/authz'; /** @internal */ export interface FleetRequestHandlerContext extends RequestHandlerContext { fleet: { + authz: FleetAuthz; epm: { /** * Saved Objects client configured to use kibana_system privileges instead of end-user privileges. Should only be diff --git a/x-pack/plugins/fleet/server/types/rest_spec/output.ts b/x-pack/plugins/fleet/server/types/rest_spec/output.ts index 05a307009d527..dc60b26087219 100644 --- a/x-pack/plugins/fleet/server/types/rest_spec/output.ts +++ b/x-pack/plugins/fleet/server/types/rest_spec/output.ts @@ -39,6 +39,7 @@ export const PutOutputRequestSchema = { outputId: schema.string(), }), body: schema.object({ + type: schema.maybe(schema.oneOf([schema.literal('elasticsearch')])), name: schema.maybe(schema.string()), is_default: schema.maybe(schema.boolean()), is_default_monitoring: schema.maybe(schema.boolean()), diff --git a/x-pack/plugins/fleet/storybook/context/index.tsx b/x-pack/plugins/fleet/storybook/context/index.tsx index ae18f393970f7..bb40962f823bb 100644 --- a/x-pack/plugins/fleet/storybook/context/index.tsx +++ b/x-pack/plugins/fleet/storybook/context/index.tsx @@ -11,7 +11,7 @@ import { EMPTY } from 'rxjs'; import type { StoryContext } from '@storybook/react'; import { createBrowserHistory } from 'history'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { ScopedHistory } from '../../../../../src/core/public'; import { getStorybookContextProvider } from '../../../../../src/plugins/custom_integrations/storybook'; @@ -73,6 +73,24 @@ export const StorybookContext: React.FC<{ storyContext?: StoryContext }> = ({ theme: { theme$: EMPTY, }, + authz: { + fleet: { + all: true, + setup: true, + readEnrollmentTokens: true, + }, + integrations: { + readPackageInfo: true, + readInstalledPackages: true, + installPackages: true, + upgradePackages: true, + removePackages: true, + readPackageSettings: true, + writePackageSettings: true, + readIntegrationPolicies: true, + writeIntegrationPolicies: true, + }, + }, }), [isCloudEnabled] ); diff --git a/x-pack/plugins/fleet/storybook/preview.tsx b/x-pack/plugins/fleet/storybook/preview.tsx index 353342a2572b0..7d8ac74f2fa80 100644 --- a/x-pack/plugins/fleet/storybook/preview.tsx +++ b/x-pack/plugins/fleet/storybook/preview.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { addDecorator } from '@storybook/react'; -import { Title, Subtitle, Description, Primary, Stories } from '@storybook/addon-docs/blocks'; +import { Title, Subtitle, Description, Primary, Stories } from '@storybook/addon-docs'; import { decorator } from './decorator'; diff --git a/x-pack/plugins/global_search/server/routes/integration_tests/find.test.ts b/x-pack/plugins/global_search/server/routes/integration_tests/find.test.ts index 4aa3e05feff75..e032aa19fd8b4 100644 --- a/x-pack/plugins/global_search/server/routes/integration_tests/find.test.ts +++ b/x-pack/plugins/global_search/server/routes/integration_tests/find.test.ts @@ -136,7 +136,7 @@ describe('POST /internal/global_search/find', () => { expect(response.body).toEqual( expect.objectContaining({ - message: 'An internal server error occurred.', + message: 'An internal server error occurred. Check Kibana server logs for details.', statusCode: 500, }) ); diff --git a/x-pack/plugins/global_search/server/routes/integration_tests/get_searchable_types.test.ts b/x-pack/plugins/global_search/server/routes/integration_tests/get_searchable_types.test.ts index cd093c8009a92..d1a9f692c2e9f 100644 --- a/x-pack/plugins/global_search/server/routes/integration_tests/get_searchable_types.test.ts +++ b/x-pack/plugins/global_search/server/routes/integration_tests/get_searchable_types.test.ts @@ -73,7 +73,7 @@ describe('GET /internal/global_search/searchable_types', () => { expect(response.body).toEqual( expect.objectContaining({ - message: 'An internal server error occurred.', + message: 'An internal server error occurred. Check Kibana server logs for details.', statusCode: 500, }) ); diff --git a/x-pack/plugins/global_search_bar/public/components/search_bar.test.tsx b/x-pack/plugins/global_search_bar/public/components/search_bar.test.tsx index dd7b1f2666943..df9096fa1d0fa 100644 --- a/x-pack/plugins/global_search_bar/public/components/search_bar.test.tsx +++ b/x-pack/plugins/global_search_bar/public/components/search_bar.test.tsx @@ -13,7 +13,7 @@ import { applicationServiceMock } from '../../../../../src/core/public/mocks'; import { globalSearchPluginMock } from '../../../global_search/public/mocks'; import { GlobalSearchBatchedResults, GlobalSearchResult } from '../../../global_search/public'; import { SearchBar } from './search_bar'; -import { __IntlProvider as IntlProvider } from '@kbn/i18n/react'; +import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; jest.mock( 'react-virtualized-auto-sizer', diff --git a/x-pack/plugins/global_search_bar/public/components/search_bar.tsx b/x-pack/plugins/global_search_bar/public/components/search_bar.tsx index 97e19bab3d2d6..fbf412ca704d8 100644 --- a/x-pack/plugins/global_search_bar/public/components/search_bar.tsx +++ b/x-pack/plugins/global_search_bar/public/components/search_bar.tsx @@ -21,7 +21,7 @@ import { } from '@elastic/eui'; import { METRIC_TYPE, UiCounterMetricType } from '@kbn/analytics'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ApplicationStart } from 'kibana/public'; import React, { ReactNode, useCallback, useRef, useState, useEffect } from 'react'; import useDebounce from 'react-use/lib/useDebounce'; diff --git a/x-pack/plugins/global_search_bar/public/plugin.tsx b/x-pack/plugins/global_search_bar/public/plugin.tsx index dfce09bd12edc..f2917e27bb556 100644 --- a/x-pack/plugins/global_search_bar/public/plugin.tsx +++ b/x-pack/plugins/global_search_bar/public/plugin.tsx @@ -8,7 +8,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { UiCounterMetricType } from '@kbn/analytics'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { ApplicationStart } from 'kibana/public'; import { CoreStart, Plugin } from 'src/core/public'; import { UsageCollectionSetup } from '../../../../src/plugins/usage_collection/public'; diff --git a/x-pack/plugins/graph/kibana.json b/x-pack/plugins/graph/kibana.json index 03729c706df25..e8b651a9eb0ea 100644 --- a/x-pack/plugins/graph/kibana.json +++ b/x-pack/plugins/graph/kibana.json @@ -8,8 +8,7 @@ "licensing", "data", "navigation", - "savedObjects", - "kibanaLegacy" + "savedObjects" ], "optionalPlugins": [ "home", diff --git a/x-pack/plugins/graph/public/application.ts b/x-pack/plugins/graph/public/application.ts index fc6c6170509d9..5a7f931538bf6 100644 --- a/x-pack/plugins/graph/public/application.ts +++ b/x-pack/plugins/graph/public/application.ts @@ -25,9 +25,9 @@ import { LicensingPluginStart } from '../../licensing/public'; import { checkLicense } from '../common/check_license'; import { NavigationPublicPluginStart as NavigationStart } from '../../../../src/plugins/navigation/public'; import { Storage } from '../../../../src/plugins/kibana_utils/public'; -import { KibanaLegacyStart } from '../../../../src/plugins/kibana_legacy/public'; import './index.scss'; +import('./font_awesome'); import { SavedObjectsStart } from '../../../../src/plugins/saved_objects/public'; import { GraphSavePolicy } from './types'; import { graphRouter } from './router'; @@ -60,18 +60,16 @@ export interface GraphDependencies { graphSavePolicy: GraphSavePolicy; overlays: OverlayStart; savedObjects: SavedObjectsStart; - kibanaLegacy: KibanaLegacyStart; setHeaderActionMenu: AppMountParameters['setHeaderActionMenu']; uiSettings: IUiSettingsClient; history: ScopedHistory; spaces?: SpacesApi; } -export type GraphServices = Omit; +export type GraphServices = Omit; -export const renderApp = ({ history, kibanaLegacy, element, ...deps }: GraphDependencies) => { +export const renderApp = ({ history, element, ...deps }: GraphDependencies) => { const { chrome, capabilities } = deps; - kibanaLegacy.loadFontAwesome(); if (!capabilities.graph.save) { chrome.setBadge({ diff --git a/x-pack/plugins/graph/public/apps/listing_route.tsx b/x-pack/plugins/graph/public/apps/listing_route.tsx index e7457f18005e6..4ed0789f33fdf 100644 --- a/x-pack/plugins/graph/public/apps/listing_route.tsx +++ b/x-pack/plugins/graph/public/apps/listing_route.tsx @@ -7,7 +7,7 @@ import React, { Fragment, useCallback, useEffect } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage, I18nProvider } from '@kbn/i18n/react'; +import { FormattedMessage, I18nProvider } from '@kbn/i18n-react'; import { EuiEmptyPrompt, EuiLink, EuiButton } from '@elastic/eui'; import { ApplicationStart } from 'kibana/public'; import { useHistory, useLocation } from 'react-router-dom'; diff --git a/x-pack/plugins/graph/public/apps/workspace_route.tsx b/x-pack/plugins/graph/public/apps/workspace_route.tsx index 55f481bf504f1..2961d0eea08ec 100644 --- a/x-pack/plugins/graph/public/apps/workspace_route.tsx +++ b/x-pack/plugins/graph/public/apps/workspace_route.tsx @@ -6,7 +6,7 @@ */ import React, { useMemo, useRef, useState } from 'react'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { Provider } from 'react-redux'; import { useHistory } from 'react-router-dom'; import { KibanaContextProvider } from '../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/graph/public/components/control_panel/selected_node_editor.tsx b/x-pack/plugins/graph/public/components/control_panel/selected_node_editor.tsx index a0eed56fac672..f205c80ea2708 100644 --- a/x-pack/plugins/graph/public/components/control_panel/selected_node_editor.tsx +++ b/x-pack/plugins/graph/public/components/control_panel/selected_node_editor.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { EuiToolTip } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Workspace, WorkspaceNode } from '../../types'; interface SelectedNodeEditorProps { diff --git a/x-pack/plugins/graph/public/components/guidance_panel/guidance_panel.tsx b/x-pack/plugins/graph/public/components/guidance_panel/guidance_panel.tsx index 65c48e8a4361f..282c44ee94445 100644 --- a/x-pack/plugins/graph/public/components/guidance_panel/guidance_panel.tsx +++ b/x-pack/plugins/graph/public/components/guidance_panel/guidance_panel.tsx @@ -18,7 +18,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import classNames from 'classnames'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { connect } from 'react-redux'; import { IDataPluginServices } from 'src/plugins/data/public'; import { diff --git a/x-pack/plugins/graph/public/components/inspect_panel.tsx b/x-pack/plugins/graph/public/components/inspect_panel.tsx index 5e5547ea341fb..5a0ad8b5f291c 100644 --- a/x-pack/plugins/graph/public/components/inspect_panel.tsx +++ b/x-pack/plugins/graph/public/components/inspect_panel.tsx @@ -8,7 +8,7 @@ import React, { useMemo, useState } from 'react'; import { EuiTab, EuiTabs, EuiText } from '@elastic/eui'; import { monaco, XJsonLang } from '@kbn/monaco'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { IndexPattern } from '../../../../../src/plugins/data/public'; import { CodeEditor } from '../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/graph/public/components/search_bar.test.tsx b/x-pack/plugins/graph/public/components/search_bar.test.tsx index 9237acb4741f1..7d39e8027e92b 100644 --- a/x-pack/plugins/graph/public/components/search_bar.test.tsx +++ b/x-pack/plugins/graph/public/components/search_bar.test.tsx @@ -13,7 +13,7 @@ import { act } from 'react-dom/test-utils'; import { IndexPattern, QueryStringInput } from '../../../../../src/plugins/data/public'; import { KibanaContextProvider } from '../../../../../src/plugins/kibana_react/public'; -import { I18nProvider, InjectedIntl } from '@kbn/i18n/react'; +import { I18nProvider, InjectedIntl } from '@kbn/i18n-react'; import { openSourceModal } from '../services/source_modal'; diff --git a/x-pack/plugins/graph/public/components/settings/blocklist_form.tsx b/x-pack/plugins/graph/public/components/settings/blocklist_form.tsx index 8954e812bdb88..d7d54c0f3e6c6 100644 --- a/x-pack/plugins/graph/public/components/settings/blocklist_form.tsx +++ b/x-pack/plugins/graph/public/components/settings/blocklist_form.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiListGroup, EuiListGroupItem, diff --git a/x-pack/plugins/graph/public/components/source_modal.tsx b/x-pack/plugins/graph/public/components/source_modal.tsx index a46528e48e8ea..31279d18eab3c 100644 --- a/x-pack/plugins/graph/public/components/source_modal.tsx +++ b/x-pack/plugins/graph/public/components/source_modal.tsx @@ -6,7 +6,7 @@ */ import { EuiModalBody, EuiModalHeader, EuiModalHeaderTitle } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { SourcePicker, SourcePickerProps } from './source_picker'; diff --git a/src/plugins/kibana_legacy/public/font_awesome/font_awesome.scss b/x-pack/plugins/graph/public/font_awesome/font_awesome.scss similarity index 100% rename from src/plugins/kibana_legacy/public/font_awesome/font_awesome.scss rename to x-pack/plugins/graph/public/font_awesome/font_awesome.scss diff --git a/x-pack/plugins/graph/public/font_awesome/index.ts b/x-pack/plugins/graph/public/font_awesome/index.ts new file mode 100644 index 0000000000000..162622c9dc526 --- /dev/null +++ b/x-pack/plugins/graph/public/font_awesome/index.ts @@ -0,0 +1,8 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import './font_awesome.scss'; diff --git a/x-pack/plugins/graph/public/plugin.ts b/x-pack/plugins/graph/public/plugin.ts index a1bc8a93f7f7a..1782f8202c415 100644 --- a/x-pack/plugins/graph/public/plugin.ts +++ b/x-pack/plugins/graph/public/plugin.ts @@ -20,7 +20,6 @@ import { } from '../../../../src/core/public'; import { Storage } from '../../../../src/plugins/kibana_utils/public'; -import { KibanaLegacyStart } from '../../../../src/plugins/kibana_legacy/public'; import { NavigationPublicPluginStart as NavigationStart } from '../../../../src/plugins/navigation/public'; import { DataPublicPluginStart } from '../../../../src/plugins/data/public'; @@ -43,7 +42,6 @@ export interface GraphPluginStartDependencies { licensing: LicensingPluginStart; data: DataPublicPluginStart; savedObjects: SavedObjectsStart; - kibanaLegacy: KibanaLegacyStart; home?: HomePublicPluginStart; spaces?: SpacesApi; } @@ -99,7 +97,6 @@ export class GraphPlugin coreStart, navigation: pluginsStart.navigation, data: pluginsStart.data, - kibanaLegacy: pluginsStart.kibanaLegacy, savedObjectsClient: coreStart.savedObjects.client, addBasePath: core.http.basePath.prepend, getBasePath: core.http.basePath.get, diff --git a/x-pack/plugins/graph/tsconfig.json b/x-pack/plugins/graph/tsconfig.json index 6a5623b311d5e..bd7e4907ed4e4 100644 --- a/x-pack/plugins/graph/tsconfig.json +++ b/x-pack/plugins/graph/tsconfig.json @@ -21,7 +21,6 @@ { "path": "../../../src/plugins/data/tsconfig.json"}, { "path": "../../../src/plugins/navigation/tsconfig.json" }, { "path": "../../../src/plugins/saved_objects/tsconfig.json"}, - { "path": "../../../src/plugins/kibana_legacy/tsconfig.json"}, { "path": "../../../src/plugins/home/tsconfig.json"}, { "path": "../../../src/plugins/kibana_utils/tsconfig.json" }, { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, diff --git a/x-pack/plugins/grokdebugger/public/components/custom_patterns_input/custom_patterns_input.js b/x-pack/plugins/grokdebugger/public/components/custom_patterns_input/custom_patterns_input.js index b1f6c2dff50e7..cac942fa44694 100644 --- a/x-pack/plugins/grokdebugger/public/components/custom_patterns_input/custom_patterns_input.js +++ b/x-pack/plugins/grokdebugger/public/components/custom_patterns_input/custom_patterns_input.js @@ -7,7 +7,7 @@ import React from 'react'; import { EuiAccordion, EuiCallOut, EuiCodeBlock, EuiFormRow, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EDITOR } from '../../../common/constants'; import { EuiCodeEditor } from '../../shared_imports'; diff --git a/x-pack/plugins/grokdebugger/public/components/event_input/event_input.js b/x-pack/plugins/grokdebugger/public/components/event_input/event_input.js index fe31f40fd8f94..35b3be399fdce 100644 --- a/x-pack/plugins/grokdebugger/public/components/event_input/event_input.js +++ b/x-pack/plugins/grokdebugger/public/components/event_input/event_input.js @@ -7,7 +7,7 @@ import React from 'react'; import { EuiFormRow } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EDITOR } from '../../../common/constants'; import { EuiCodeEditor } from '../../shared_imports'; diff --git a/x-pack/plugins/grokdebugger/public/components/event_output/event_output.js b/x-pack/plugins/grokdebugger/public/components/event_output/event_output.js index 4aa00954bf0ab..a2a02259c3fdf 100644 --- a/x-pack/plugins/grokdebugger/public/components/event_output/event_output.js +++ b/x-pack/plugins/grokdebugger/public/components/event_output/event_output.js @@ -7,7 +7,7 @@ import React from 'react'; import { EuiFormRow } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCodeEditor } from '../../shared_imports'; diff --git a/x-pack/plugins/grokdebugger/public/components/grok_debugger/grok_debugger.js b/x-pack/plugins/grokdebugger/public/components/grok_debugger/grok_debugger.js index 17a6408298b07..348c23c63937a 100644 --- a/x-pack/plugins/grokdebugger/public/components/grok_debugger/grok_debugger.js +++ b/x-pack/plugins/grokdebugger/public/components/grok_debugger/grok_debugger.js @@ -27,7 +27,7 @@ import { CustomPatternsInput } from '../custom_patterns_input'; import { EventOutput } from '../event_output'; import { GrokdebuggerRequest } from '../../models/grokdebugger_request'; import { withKibana } from '../../../../../../src/plugins/kibana_react/public'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; const i18nTexts = { simulate: { diff --git a/x-pack/plugins/grokdebugger/public/components/inactive_license.js b/x-pack/plugins/grokdebugger/public/components/inactive_license.js index de841b0bc62d1..e7515868ddd11 100644 --- a/x-pack/plugins/grokdebugger/public/components/inactive_license.js +++ b/x-pack/plugins/grokdebugger/public/components/inactive_license.js @@ -17,7 +17,7 @@ import { EuiPageContentBody, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const InactiveLicenseSlate = () => { const registerLicenseLinkLabel = i18n.translate('xpack.grokDebugger.registerLicenseLinkLabel', { diff --git a/x-pack/plugins/grokdebugger/public/components/pattern_input/pattern_input.js b/x-pack/plugins/grokdebugger/public/components/pattern_input/pattern_input.js index 9994e648dc91e..75af1453c6b40 100644 --- a/x-pack/plugins/grokdebugger/public/components/pattern_input/pattern_input.js +++ b/x-pack/plugins/grokdebugger/public/components/pattern_input/pattern_input.js @@ -7,7 +7,7 @@ import React from 'react'; import { EuiFormRow } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EDITOR } from '../../../common/constants'; import { EuiCodeEditor } from '../../shared_imports'; diff --git a/x-pack/plugins/grokdebugger/public/render_app.js b/x-pack/plugins/grokdebugger/public/render_app.js index d4f572ac37e8a..9666d69d978f0 100644 --- a/x-pack/plugins/grokdebugger/public/render_app.js +++ b/x-pack/plugins/grokdebugger/public/render_app.js @@ -10,7 +10,7 @@ import { render, unmountComponentAtNode } from 'react-dom'; import { GrokDebugger } from './components/grok_debugger'; import { GrokdebuggerService } from './services/grokdebugger/grokdebugger_service'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { KibanaContextProvider } from '../../../../src/plugins/kibana_react/public'; import { InactiveLicenseSlate } from './components/inactive_license'; diff --git a/x-pack/plugins/index_lifecycle_management/public/application/components/index_templates_flyout.tsx b/x-pack/plugins/index_lifecycle_management/public/application/components/index_templates_flyout.tsx index 457ed5540278f..5015e724ee75d 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/components/index_templates_flyout.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/components/index_templates_flyout.tsx @@ -6,7 +6,7 @@ */ import React, { FunctionComponent } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiButtonEmpty, diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/edit_warning.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/edit_warning.tsx index b78deb8c87bc4..8b0c21e9999c0 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/edit_warning.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/edit_warning.tsx @@ -7,7 +7,7 @@ import React, { FunctionComponent, useState } from 'react'; import { EuiLink, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useEditPolicyContext } from '../edit_policy_context'; import { getIndicesListPath } from '../../../services/navigation'; import { useKibana } from '../../../../shared_imports'; diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/learn_more_link.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/learn_more_link.tsx index c517130d55aa4..5e7923898a99a 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/learn_more_link.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/learn_more_link.tsx @@ -7,7 +7,7 @@ import React, { ReactNode } from 'react'; import { EuiLink } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { createDocLink } from '../../../services/documentation'; diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/optional_label.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/optional_label.tsx index f65898951919e..1525b27ac4ca0 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/optional_label.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/optional_label.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const OptionalLabel = () => { return ( diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/delete_phase/delete_phase.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/delete_phase/delete_phase.tsx index 4b4962cc7c3a4..75c94961b9ff3 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/delete_phase/delete_phase.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/delete_phase/delete_phase.tsx @@ -17,7 +17,7 @@ import { EuiComment, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useFormData } from '../../../../../../shared_imports'; import { i18nTexts } from '../../../i18n_texts'; diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/hot_phase/hot_phase.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/hot_phase/hot_phase.tsx index d6a36b99c20aa..3e67cabf570a4 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/hot_phase/hot_phase.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/hot_phase/hot_phase.tsx @@ -7,7 +7,7 @@ import React, { FunctionComponent } from 'react'; import { get } from 'lodash'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiSpacer, EuiCallOut, EuiTextColor, EuiSwitch, EuiText } from '@elastic/eui'; diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/phase/phase.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/phase/phase.tsx index f5ab67c0b3ee7..d458c6ed9e3f9 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/phase/phase.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/phase/phase.tsx @@ -18,7 +18,7 @@ import { EuiBadge, } from '@elastic/eui'; import { get } from 'lodash'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { PhaseExceptDelete } from '../../../../../../../common/types'; import { ToggleField, useFormData } from '../../../../../../shared_imports'; diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/data_tier_allocation_field/components/loading_error.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/data_tier_allocation_field/components/loading_error.tsx index e7d26e99427bd..a53b0be12021d 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/data_tier_allocation_field/components/loading_error.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/data_tier_allocation_field/components/loading_error.tsx @@ -6,7 +6,7 @@ */ import React, { FunctionComponent } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCallOut, EuiButton, EuiSpacer } from '@elastic/eui'; interface Props { diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/data_tier_allocation_field/components/no_custom_attributes_messages.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/data_tier_allocation_field/components/no_custom_attributes_messages.tsx index f3738805a8d48..d31818e3557b1 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/data_tier_allocation_field/components/no_custom_attributes_messages.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/data_tier_allocation_field/components/no_custom_attributes_messages.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiLink } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { DocLinksStart } from 'src/core/public'; import { getNodeAllocationMigrationLink } from '../../../../../../../services/documentation'; diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/data_tier_allocation_field/components/node_allocation.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/data_tier_allocation_field/components/node_allocation.tsx index e7b1f7420d132..323f5144ac837 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/data_tier_allocation_field/components/node_allocation.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/data_tier_allocation_field/components/node_allocation.tsx @@ -8,7 +8,7 @@ import { i18n } from '@kbn/i18n'; import React, { useState, FunctionComponent } from 'react'; import { get } from 'lodash'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, EuiText, EuiSpacer } from '@elastic/eui'; import { SelectField, useFormData } from '../../../../../../../../shared_imports'; diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/data_tier_allocation_field/components/node_attrs_details.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/data_tier_allocation_field/components/node_attrs_details.tsx index f2d090f8dcd85..d5a27d7e667e9 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/data_tier_allocation_field/components/node_attrs_details.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/data_tier_allocation_field/components/node_attrs_details.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlyoutBody, diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/forcemerge_field.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/forcemerge_field.tsx index 8cb566ceae25a..d6f5e97c166e4 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/forcemerge_field.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/forcemerge_field.tsx @@ -6,7 +6,7 @@ */ import React, { useMemo } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import uuid from 'uuid'; import { EuiCheckbox, EuiSpacer, EuiFlexGroup, EuiFlexItem, EuiIconTip } from '@elastic/eui'; diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/index_priority_field.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/index_priority_field.tsx index 0f5288df36119..1665e4a360ad0 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/index_priority_field.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/index_priority_field.tsx @@ -7,7 +7,7 @@ import { i18n } from '@kbn/i18n'; import React, { FunctionComponent, useMemo } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiSpacer, EuiTextColor } from '@elastic/eui'; import { PhaseExceptDelete } from '../../../../../../../common/types'; diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/min_age_field/min_age_field.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/min_age_field/min_age_field.tsx index b6c6102425d12..d1c06430c1b12 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/min_age_field/min_age_field.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/min_age_field/min_age_field.tsx @@ -7,7 +7,7 @@ import { i18n } from '@kbn/i18n'; import React, { FunctionComponent, useEffect } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { get } from 'lodash'; import { diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/readonly_field.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/readonly_field.tsx index 40687e29c2a9e..85805f1a266af 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/readonly_field.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/readonly_field.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiTextColor } from '@elastic/eui'; import { LearnMoreLink } from '../../learn_more_link'; import { ToggleFieldWithDescribedFormRow } from '../../described_form_row'; diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/searchable_snapshot_field/searchable_snapshot_field.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/searchable_snapshot_field/searchable_snapshot_field.tsx index 0ce98351c9672..3cfb83878812f 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/searchable_snapshot_field/searchable_snapshot_field.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/searchable_snapshot_field/searchable_snapshot_field.tsx @@ -8,7 +8,7 @@ import React, { FunctionComponent, useState, useEffect } from 'react'; import { i18n } from '@kbn/i18n'; import { get } from 'lodash'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiTextColor, EuiSpacer, EuiCallOut, EuiLink } from '@elastic/eui'; import { useKibana, useFormData } from '../../../../../../../shared_imports'; diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/shrink_field.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/shrink_field.tsx index 1becf90de4d46..9439afd1c071d 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/shrink_field.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/shrink_field.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiTextColor, EuiRadioGroup, EuiSpacer } from '@elastic/eui'; import React, { FunctionComponent } from 'react'; diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/snapshot_policies_field.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/snapshot_policies_field.tsx index 720d39695cf0e..89e43b2675854 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/snapshot_policies_field.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/snapshot_policies_field.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { get } from 'lodash'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/policy_json_flyout.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/policy_json_flyout.tsx index ae7b1ebaffc02..243c5a7e2d1dd 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/policy_json_flyout.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/policy_json_flyout.tsx @@ -7,7 +7,7 @@ import React, { useCallback, useEffect, useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, EuiCodeBlock, diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/timeline/timeline.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/timeline/timeline.tsx index de5c258ab82fa..b04445162e48b 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/timeline/timeline.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/timeline/timeline.tsx @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { FunctionComponent, memo } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiTitle, EuiText, EuiIconTip } from '@elastic/eui'; diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/edit_policy.container.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/edit_policy.container.tsx index b0bde0bb68f3e..bfca2b57178ee 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/edit_policy.container.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/edit_policy.container.tsx @@ -8,7 +8,7 @@ import React, { useEffect } from 'react'; import { RouteComponentProps } from 'react-router-dom'; import { EuiButton, EuiEmptyPrompt, EuiLoadingSpinner, EuiPageContent } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { MIN_SEARCHABLE_SNAPSHOT_LICENSE } from '../../../../common/constants'; import { useKibana, attemptToURIDecode } from '../../../shared_imports'; diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/edit_policy.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/edit_policy.tsx index 5e5146ea5f720..1f06df358e408 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/edit_policy.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/edit_policy.tsx @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { Fragment, useEffect, useMemo, useState } from 'react'; import { get } from 'lodash'; diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/components/add_policy_to_template_confirm_modal.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/components/add_policy_to_template_confirm_modal.tsx index 18852ac5ab68f..2bbdd123f711a 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/components/add_policy_to_template_confirm_modal.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/components/add_policy_to_template_confirm_modal.tsx @@ -7,7 +7,7 @@ import React, { Fragment, useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCallOut, EuiComboBox, diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/components/confirm_delete.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/components/confirm_delete.tsx index a36adf6135f84..c2772410737db 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/components/confirm_delete.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/components/confirm_delete.tsx @@ -7,7 +7,7 @@ import React, { Component } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiConfirmModal } from '@elastic/eui'; import { PolicyFromES } from '../../../../../common/types'; diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/policy_list.container.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/policy_list.container.tsx index ed5c8d26a46c8..441851dc61b27 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/policy_list.container.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/policy_list.container.tsx @@ -7,7 +7,7 @@ import React, { useEffect } from 'react'; import { EuiButton, EuiEmptyPrompt, EuiLoadingSpinner, EuiPageContent } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { PolicyList as PresentationComponent } from './policy_list'; import { useKibana } from '../../../shared_imports'; import { useLoadPoliciesList } from '../../services/api'; diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/policy_list.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/policy_list.tsx index e25a43cc6d4dc..30d882e760297 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/policy_list.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/policy_list/policy_list.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiEmptyPrompt, EuiSpacer, EuiPageHeader, EuiPageContent } from '@elastic/eui'; import { useHistory } from 'react-router-dom'; diff --git a/x-pack/plugins/index_lifecycle_management/public/extend_index_management/components/add_lifecycle_confirm_modal.tsx b/x-pack/plugins/index_lifecycle_management/public/extend_index_management/components/add_lifecycle_confirm_modal.tsx index 3fbf98c9d2c5f..94071271eac2d 100644 --- a/x-pack/plugins/index_lifecycle_management/public/extend_index_management/components/add_lifecycle_confirm_modal.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/extend_index_management/components/add_lifecycle_confirm_modal.tsx @@ -8,7 +8,7 @@ import React, { Component, Fragment } from 'react'; import { get } from 'lodash'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ApplicationStart } from 'kibana/public'; import { diff --git a/x-pack/plugins/index_lifecycle_management/public/extend_index_management/components/index_lifecycle_summary.tsx b/x-pack/plugins/index_lifecycle_management/public/extend_index_management/components/index_lifecycle_summary.tsx index dbe07eebbbe6b..4a34a4eb11ea4 100644 --- a/x-pack/plugins/index_lifecycle_management/public/extend_index_management/components/index_lifecycle_summary.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/extend_index_management/components/index_lifecycle_summary.tsx @@ -8,7 +8,7 @@ import React, { Component, Fragment } from 'react'; import moment from 'moment-timezone'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, EuiCallOut, diff --git a/x-pack/plugins/index_lifecycle_management/public/extend_index_management/components/remove_lifecycle_confirm_modal.tsx b/x-pack/plugins/index_lifecycle_management/public/extend_index_management/components/remove_lifecycle_confirm_modal.tsx index 2f22a0b347db9..82f8717d72fdd 100644 --- a/x-pack/plugins/index_lifecycle_management/public/extend_index_management/components/remove_lifecycle_confirm_modal.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/extend_index_management/components/remove_lifecycle_confirm_modal.tsx @@ -7,7 +7,7 @@ import React, { Component, Fragment } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiConfirmModal } from '@elastic/eui'; import { removeLifecycleForIndex } from '../../application/services/api'; diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_details/component_template_details.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_details/component_template_details.tsx index 6dbf1b15174e9..f63a7a624d4e4 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_details/component_template_details.tsx +++ b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_details/component_template_details.tsx @@ -6,7 +6,7 @@ */ import React, { useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlyoutHeader, diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_details/manage_button.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_details/manage_button.tsx index 58100f269e8eb..60a8cce1d7445 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_details/manage_button.tsx +++ b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_details/manage_button.tsx @@ -6,7 +6,7 @@ */ import React, { useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiPopover, diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_details/tab_summary.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_details/tab_summary.tsx index 1321143a6f392..edba90affee70 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_details/tab_summary.tsx +++ b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_details/tab_summary.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescriptionList, diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/component_template_list.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/component_template_list.tsx index 6ff7c5826459e..c314dd1ce0b99 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/component_template_list.tsx +++ b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/component_template_list.tsx @@ -9,7 +9,7 @@ import React, { useState, useEffect, useCallback } from 'react'; import { RouteComponentProps } from 'react-router-dom'; import { i18n } from '@kbn/i18n'; import { METRIC_TYPE } from '@kbn/analytics'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ScopedHistory } from 'kibana/public'; import { EuiLink, EuiText, EuiSpacer } from '@elastic/eui'; diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/delete_modal.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/delete_modal.tsx index 0b20bebf43143..fff949182119f 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/delete_modal.tsx +++ b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/delete_modal.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiConfirmModal } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useComponentTemplatesContext } from '../component_templates_context'; diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/empty_prompt.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/empty_prompt.tsx index 50f4948a0eb2d..f7124bce4a999 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/empty_prompt.tsx +++ b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/empty_prompt.tsx @@ -7,7 +7,7 @@ import React, { FunctionComponent } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { RouteComponentProps } from 'react-router-dom'; import { EuiEmptyPrompt, EuiLink, EuiButton } from '@elastic/eui'; diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/table.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/table.tsx index e71dc13e7f678..32b093a9caf07 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/table.tsx +++ b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/table.tsx @@ -8,7 +8,7 @@ import React, { FunctionComponent, useState } from 'react'; import { i18n } from '@kbn/i18n'; import { METRIC_TYPE } from '@kbn/analytics'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiInMemoryTable, EuiButton, diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/with_privileges.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/with_privileges.tsx index eecb56768df9a..cc52e5a6d720d 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/with_privileges.tsx +++ b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/with_privileges.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { FunctionComponent } from 'react'; import { diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_selector/component_templates.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_selector/component_templates.tsx index 04fec17c9f46d..d0f6575ace85d 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_selector/component_templates.tsx +++ b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_selector/component_templates.tsx @@ -8,7 +8,7 @@ import classNames from 'classnames'; import React, { useState, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, EuiFieldSearch, EuiEmptyPrompt, EuiButton } from '@elastic/eui'; import { ComponentTemplateListItem } from '../../../../../common'; diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_selector/component_templates_selector.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_selector/component_templates_selector.tsx index 41be138ea9fa5..0b14fc68d9de5 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_selector/component_templates_selector.tsx +++ b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_selector/component_templates_selector.tsx @@ -8,7 +8,7 @@ import classNames from 'classnames'; import React, { useState, useEffect, useRef } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiEmptyPrompt, EuiLink, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { ComponentTemplateListItem } from '../../../../../common'; diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_selector/components/create_button_popover.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_selector/components/create_button_popover.tsx index 327432f41678a..5bc64933289ea 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_selector/components/create_button_popover.tsx +++ b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_selector/components/create_button_popover.tsx @@ -6,7 +6,7 @@ */ import React, { useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiPopover, EuiButton, EuiContextMenu } from '@elastic/eui'; diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_selector/components/filter_list_button.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_selector/components/filter_list_button.tsx index ce7b164eb7995..fd07eb1f54867 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_selector/components/filter_list_button.tsx +++ b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_selector/components/filter_list_button.tsx @@ -6,7 +6,7 @@ */ import React, { useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFilterButton, EuiPopover, EuiFilterSelectItem, EuiFilterGroup } from '@elastic/eui'; interface Filter { diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_clone/component_template_clone.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_clone/component_template_clone.tsx index 1889da7c1336f..e6869789523f1 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_clone/component_template_clone.tsx +++ b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_clone/component_template_clone.tsx @@ -8,7 +8,7 @@ import React, { FunctionComponent, useEffect } from 'react'; import { RouteComponentProps } from 'react-router-dom'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { PageLoading, attemptToURIDecode } from '../../shared_imports'; import { useComponentTemplatesContext } from '../../component_templates_context'; diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_create/component_template_create.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_create/component_template_create.tsx index 8fe2c193daa0c..6b00564b3b0fb 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_create/component_template_create.tsx +++ b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_create/component_template_create.tsx @@ -7,7 +7,7 @@ import React, { useState, useEffect } from 'react'; import { RouteComponentProps } from 'react-router-dom'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiPageContentBody, EuiSpacer, EuiPageHeader } from '@elastic/eui'; import { ComponentTemplateDeserialized } from '../../shared_imports'; diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_edit/component_template_edit.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_edit/component_template_edit.tsx index 6ac831b5dacce..adc2398836263 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_edit/component_template_edit.tsx +++ b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_edit/component_template_edit.tsx @@ -7,7 +7,7 @@ import React, { useState, useEffect } from 'react'; import { RouteComponentProps } from 'react-router-dom'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiPageContentBody, EuiPageHeader, EuiSpacer } from '@elastic/eui'; import { useComponentTemplatesContext } from '../../component_templates_context'; diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_form/component_template_form.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_form/component_template_form.tsx index 8d5e61c81120f..74a13fb2b33ce 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_form/component_template_form.tsx +++ b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_form/component_template_form.tsx @@ -7,7 +7,7 @@ import React, { useCallback } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiSpacer, EuiCallOut } from '@elastic/eui'; import { diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_form/steps/step_logistics.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_form/steps/step_logistics.tsx index 0e2d24cec3f7f..597f96625082c 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_form/steps/step_logistics.tsx +++ b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_form/steps/step_logistics.tsx @@ -15,7 +15,7 @@ import { EuiSwitch, EuiLink, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { useForm, diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_form/steps/step_logistics_schema.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_form/steps/step_logistics_schema.tsx index 14fd1ffb58e1d..1ce0af1b511d7 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_form/steps/step_logistics_schema.tsx +++ b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_form/steps/step_logistics_schema.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiCode } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { FIELD_TYPES, fieldValidators, fieldFormatters, FormSchema } from '../../../shared_imports'; diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_form/steps/step_review.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_form/steps/step_review.tsx index a95062a80c519..3243ef5d865b8 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_form/steps/step_review.tsx +++ b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_wizard/component_template_form/steps/step_review.tsx @@ -19,7 +19,7 @@ import { EuiText, EuiCodeBlock, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ComponentTemplateDeserialized, diff --git a/x-pack/plugins/index_management/public/application/components/index_templates/legacy_index_template_deprecation.tsx b/x-pack/plugins/index_management/public/application/components/index_templates/legacy_index_template_deprecation.tsx index 6fbea1760f3a4..165288fa5946a 100644 --- a/x-pack/plugins/index_management/public/application/components/index_templates/legacy_index_template_deprecation.tsx +++ b/x-pack/plugins/index_management/public/application/components/index_templates/legacy_index_template_deprecation.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiCallOut, EuiLink } from '@elastic/eui'; import { ScopedHistory } from 'kibana/public'; diff --git a/x-pack/plugins/index_management/public/application/components/index_templates/simulate_template/simulate_template.tsx b/x-pack/plugins/index_management/public/application/components/index_templates/simulate_template/simulate_template.tsx index 82c3b35e0a91b..8379f266108c5 100644 --- a/x-pack/plugins/index_management/public/application/components/index_templates/simulate_template/simulate_template.tsx +++ b/x-pack/plugins/index_management/public/application/components/index_templates/simulate_template/simulate_template.tsx @@ -6,7 +6,7 @@ */ import React, { useState, useCallback, useEffect } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCodeBlock, EuiCallOut } from '@elastic/eui'; import { serializers } from '../../../../shared_imports'; diff --git a/x-pack/plugins/index_management/public/application/components/index_templates/simulate_template/simulate_template_flyout.tsx b/x-pack/plugins/index_management/public/application/components/index_templates/simulate_template/simulate_template_flyout.tsx index 8ce52e1bb1b59..ae88fe9a04917 100644 --- a/x-pack/plugins/index_management/public/application/components/index_templates/simulate_template/simulate_template_flyout.tsx +++ b/x-pack/plugins/index_management/public/application/components/index_templates/simulate_template/simulate_template_flyout.tsx @@ -6,7 +6,7 @@ */ import React, { useState, useCallback, useEffect, useRef } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiFlyoutHeader, diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/configuration_form/configuration_form_schema.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/configuration_form/configuration_form_schema.tsx index 4bfe218ef6ebd..b5fa5f25b865b 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/configuration_form/configuration_form_schema.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/configuration_form/configuration_form_schema.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiLink, EuiCode } from '@elastic/eui'; import { documentationService } from '../../../../services/documentation'; diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/configuration_form/dynamic_mapping_section/dynamic_mapping_section.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/configuration_form/dynamic_mapping_section/dynamic_mapping_section.tsx index da8f9b6b0b4d2..349f128915468 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/configuration_form/dynamic_mapping_section/dynamic_mapping_section.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/configuration_form/dynamic_mapping_section/dynamic_mapping_section.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiLink, EuiSpacer } from '@elastic/eui'; import { documentationService } from '../../../../../services/documentation'; diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/configuration_form/meta_field_section/meta_field_section.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/configuration_form/meta_field_section/meta_field_section.tsx index 49c3fa5fbd83c..cc1a3859c1c69 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/configuration_form/meta_field_section/meta_field_section.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/configuration_form/meta_field_section/meta_field_section.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiLink } from '@elastic/eui'; import { documentationService } from '../../../../../services/documentation'; diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/configuration_form/routing_section.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/configuration_form/routing_section.tsx index f3eeb3d832da6..9dbcc2361177d 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/configuration_form/routing_section.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/configuration_form/routing_section.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiLink } from '@elastic/eui'; import { documentationService } from '../../../../services/documentation'; diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/configuration_form/source_field_section/source_field_section.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/configuration_form/source_field_section/source_field_section.tsx index 47aac884ba1bf..44b37a0f9cc2a 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/configuration_form/source_field_section/source_field_section.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/configuration_form/source_field_section/source_field_section.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiLink, EuiSpacer, EuiComboBox, EuiFormRow, EuiCallOut } from '@elastic/eui'; import { documentationService } from '../../../../../services/documentation'; diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/document_fields_header.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/document_fields_header.tsx index a1aa6e79379d7..4ddf2b9060698 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/document_fields_header.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/document_fields_header.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { EuiText, EuiLink, EuiFlexGroup, EuiFlexItem, EuiFieldSearch } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { documentationService } from '../../../../services/documentation'; interface Props { diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/enabled_parameter.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/enabled_parameter.tsx index 4e07b112b70ff..69c6b4bf38886 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/enabled_parameter.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/enabled_parameter.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCode } from '@elastic/eui'; import { documentationService } from '../../../../../services/documentation'; diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/fielddata_frequency_filter_absolute.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/fielddata_frequency_filter_absolute.tsx index aa4296592de94..8c1ddacb9ed0b 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/fielddata_frequency_filter_absolute.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/fielddata_frequency_filter_absolute.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFormControlLayoutDelimited, EuiFieldNumber, diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/fielddata_frequency_filter_percentage.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/fielddata_frequency_filter_percentage.tsx index 8a1e9aa2504a1..66bb9da0ae0c9 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/fielddata_frequency_filter_percentage.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/fielddata_frequency_filter_percentage.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDualRange, EuiFormRow } from '@elastic/eui'; import { FieldHook } from '../../../shared_imports'; diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/fielddata_parameter.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/fielddata_parameter.tsx index 295296ea60605..593b5f7eae23b 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/fielddata_parameter.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/fielddata_parameter.tsx @@ -8,7 +8,7 @@ import React, { useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiSpacer, EuiText, diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/format_parameter.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/format_parameter.tsx index feee47df2a367..2fdc4da9cfd31 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/format_parameter.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/format_parameter.tsx @@ -9,7 +9,7 @@ import React, { useState } from 'react'; import { EuiComboBox, EuiFormRow, EuiCode } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EditFieldFormRow } from '../fields/edit_field'; import { UseField } from '../../../shared_imports'; diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/locale_parameter.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/locale_parameter.tsx index 46e6acd7108bc..2382cbe8391f8 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/locale_parameter.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/locale_parameter.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiLink } from '@elastic/eui'; import { EditFieldFormRow } from '../fields/edit_field'; diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/relations_parameter.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/relations_parameter.tsx index ebe2b14b26b54..07c03de38ca97 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/relations_parameter.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/relations_parameter.tsx @@ -17,7 +17,7 @@ import { EuiBasicTableColumn, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { UseField, diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/search_fields/search_result.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/search_fields/search_result.tsx index 65a4d1a221737..fa2cdbb2e0661 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/search_fields/search_result.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/search_fields/search_result.tsx @@ -8,7 +8,7 @@ import React from 'react'; import VirtualList from 'react-tiny-virtual-list'; import { EuiEmptyPrompt, EuiButton } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { SearchResult as SearchResultType, State } from '../../../types'; import { useDispatch } from '../../../mappings_state_context'; diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/load_mappings/load_mappings_provider.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/load_mappings/load_mappings_provider.tsx index 8f023156456dc..c07a4953d476c 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/load_mappings/load_mappings_provider.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/load_mappings/load_mappings_provider.tsx @@ -7,7 +7,7 @@ import React, { useState, useRef, useCallback } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiConfirmModal, EuiCallOut, EuiText, EuiSpacer, EuiButtonEmpty } from '@elastic/eui'; import { JsonEditor, OnJsonEditorUpdateHandler } from '../../shared_imports'; diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/multiple_mappings_warning.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/multiple_mappings_warning.tsx index 82b2292343732..61ee27534f7b6 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/multiple_mappings_warning.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/multiple_mappings_warning.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCallOut, EuiLink } from '@elastic/eui'; import { documentationService } from '../../../services/documentation'; diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/runtime_fields/empty_prompt.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/runtime_fields/empty_prompt.tsx index edf39d85312e0..f3d6ab6dece86 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/runtime_fields/empty_prompt.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/runtime_fields/empty_prompt.tsx @@ -7,7 +7,7 @@ import React, { FunctionComponent } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiEmptyPrompt, EuiLink, EuiButton } from '@elastic/eui'; interface Props { diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/runtime_fields/runtime_fields_list.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/runtime_fields/runtime_fields_list.tsx index 13cbd8e227328..839df308c33b7 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/runtime_fields/runtime_fields_list.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/runtime_fields/runtime_fields_list.tsx @@ -7,7 +7,7 @@ import React, { useCallback, useEffect } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiSpacer, EuiButtonEmpty, EuiText, EuiLink } from '@elastic/eui'; import { useMappingsState, useDispatch } from '../../mappings_state_context'; diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/templates_form/templates_form.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/templates_form/templates_form.tsx index d7221bd48d091..7177a9f92c084 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/templates_form/templates_form.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/templates_form/templates_form.tsx @@ -7,7 +7,7 @@ import React, { useEffect, useRef } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiText, EuiLink, EuiSpacer } from '@elastic/eui'; import { useForm, Form, SerializerFunc, UseField, JsonEditorField } from '../../shared_imports'; diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/constants/data_types_definition.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/constants/data_types_definition.tsx index d7db98731427d..bd224f1ca8f20 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/constants/data_types_definition.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/constants/data_types_definition.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiLink, EuiCode } from '@elastic/eui'; import { documentationService } from '../../../services/documentation'; diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/constants/parameters_definition.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/constants/parameters_definition.tsx index 4b58ba257ac66..ae5915a032b8e 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/constants/parameters_definition.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/constants/parameters_definition.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import * as t from 'io-ts'; diff --git a/x-pack/plugins/index_management/public/application/components/no_match/no_match.tsx b/x-pack/plugins/index_management/public/application/components/no_match/no_match.tsx index 8546a179fafdf..e972a0ff6948d 100644 --- a/x-pack/plugins/index_management/public/application/components/no_match/no_match.tsx +++ b/x-pack/plugins/index_management/public/application/components/no_match/no_match.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const NoMatch = () => (
diff --git a/x-pack/plugins/index_management/public/application/components/shared/components/details_panel/tab_aliases.tsx b/x-pack/plugins/index_management/public/application/components/shared/components/details_panel/tab_aliases.tsx index 99b978b908bc9..269f4265ecff3 100644 --- a/x-pack/plugins/index_management/public/application/components/shared/components/details_panel/tab_aliases.tsx +++ b/x-pack/plugins/index_management/public/application/components/shared/components/details_panel/tab_aliases.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCodeBlock, EuiCallOut } from '@elastic/eui'; import { Aliases } from '../../../../../../common'; diff --git a/x-pack/plugins/index_management/public/application/components/shared/components/details_panel/tab_mappings.tsx b/x-pack/plugins/index_management/public/application/components/shared/components/details_panel/tab_mappings.tsx index 34b90ca548882..05d1f0d8f6aeb 100644 --- a/x-pack/plugins/index_management/public/application/components/shared/components/details_panel/tab_mappings.tsx +++ b/x-pack/plugins/index_management/public/application/components/shared/components/details_panel/tab_mappings.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCodeBlock, EuiCallOut } from '@elastic/eui'; import { Mappings } from '../../../../../../common'; diff --git a/x-pack/plugins/index_management/public/application/components/shared/components/details_panel/tab_settings.tsx b/x-pack/plugins/index_management/public/application/components/shared/components/details_panel/tab_settings.tsx index 919d6b9e93595..8f749af20b61b 100644 --- a/x-pack/plugins/index_management/public/application/components/shared/components/details_panel/tab_settings.tsx +++ b/x-pack/plugins/index_management/public/application/components/shared/components/details_panel/tab_settings.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCodeBlock, EuiCallOut } from '@elastic/eui'; import { IndexSettings } from '../../../../../../common'; diff --git a/x-pack/plugins/index_management/public/application/components/shared/components/wizard_steps/step_aliases.tsx b/x-pack/plugins/index_management/public/application/components/shared/components/wizard_steps/step_aliases.tsx index 2d7be72056e18..b22030be2d30b 100644 --- a/x-pack/plugins/index_management/public/application/components/shared/components/wizard_steps/step_aliases.tsx +++ b/x-pack/plugins/index_management/public/application/components/shared/components/wizard_steps/step_aliases.tsx @@ -17,7 +17,7 @@ import { EuiText, EuiCode, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCodeEditor, Forms } from '../../../../../shared_imports'; import { useJsonStep } from './use_json_step'; diff --git a/x-pack/plugins/index_management/public/application/components/shared/components/wizard_steps/step_mappings.tsx b/x-pack/plugins/index_management/public/application/components/shared/components/wizard_steps/step_mappings.tsx index 4ce7a3b5e0650..20ac616915a69 100644 --- a/x-pack/plugins/index_management/public/application/components/shared/components/wizard_steps/step_mappings.tsx +++ b/x-pack/plugins/index_management/public/application/components/shared/components/wizard_steps/step_mappings.tsx @@ -6,7 +6,7 @@ */ import React, { useCallback, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, diff --git a/x-pack/plugins/index_management/public/application/components/shared/components/wizard_steps/step_settings.tsx b/x-pack/plugins/index_management/public/application/components/shared/components/wizard_steps/step_settings.tsx index 359e1091c1303..f370ea3642491 100644 --- a/x-pack/plugins/index_management/public/application/components/shared/components/wizard_steps/step_settings.tsx +++ b/x-pack/plugins/index_management/public/application/components/shared/components/wizard_steps/step_settings.tsx @@ -17,7 +17,7 @@ import { EuiText, EuiCode, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCodeEditor, Forms } from '../../../../../shared_imports'; import { useJsonStep } from './use_json_step'; diff --git a/x-pack/plugins/index_management/public/application/components/template_delete_modal.tsx b/x-pack/plugins/index_management/public/application/components/template_delete_modal.tsx index f22fa2a3b4f8a..1b54cc14f1f5e 100644 --- a/x-pack/plugins/index_management/public/application/components/template_delete_modal.tsx +++ b/x-pack/plugins/index_management/public/application/components/template_delete_modal.tsx @@ -8,7 +8,7 @@ import React, { Fragment, useState } from 'react'; import { EuiConfirmModal, EuiCallOut, EuiCheckbox, EuiBadge } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { deleteTemplates } from '../services/api'; import { notificationService } from '../services/notification'; diff --git a/x-pack/plugins/index_management/public/application/components/template_form/steps/step_components.tsx b/x-pack/plugins/index_management/public/application/components/template_form/steps/step_components.tsx index 65a5e0d68caec..9ca8a6878fb50 100644 --- a/x-pack/plugins/index_management/public/application/components/template_form/steps/step_components.tsx +++ b/x-pack/plugins/index_management/public/application/components/template_form/steps/step_components.tsx @@ -6,7 +6,7 @@ */ import React, { useState, useCallback } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiTitle, EuiText, diff --git a/x-pack/plugins/index_management/public/application/components/template_form/steps/step_logistics.tsx b/x-pack/plugins/index_management/public/application/components/template_form/steps/step_logistics.tsx index fb3806afa7135..ccc94736e0800 100644 --- a/x-pack/plugins/index_management/public/application/components/template_form/steps/step_logistics.tsx +++ b/x-pack/plugins/index_management/public/application/components/template_form/steps/step_logistics.tsx @@ -14,7 +14,7 @@ import { EuiSpacer, EuiLink, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { diff --git a/x-pack/plugins/index_management/public/application/components/template_form/steps/step_review.tsx b/x-pack/plugins/index_management/public/application/components/template_form/steps/step_review.tsx index bef07c6517ff7..b46105be11e5f 100644 --- a/x-pack/plugins/index_management/public/application/components/template_form/steps/step_review.tsx +++ b/x-pack/plugins/index_management/public/application/components/template_form/steps/step_review.tsx @@ -21,7 +21,7 @@ import { EuiLink, EuiCodeBlock, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { serializers } from '../../../../shared_imports'; import { serializeLegacyTemplate, serializeTemplate } from '../../../../../common/lib'; diff --git a/x-pack/plugins/index_management/public/application/components/template_form/template_form.tsx b/x-pack/plugins/index_management/public/application/components/template_form/template_form.tsx index a0362b440cb0b..03b3452642c96 100644 --- a/x-pack/plugins/index_management/public/application/components/template_form/template_form.tsx +++ b/x-pack/plugins/index_management/public/application/components/template_form/template_form.tsx @@ -7,7 +7,7 @@ import React, { useState, useCallback, useRef } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiSpacer, EuiButton, EuiPageHeader } from '@elastic/eui'; import { ScopedHistory } from 'kibana/public'; diff --git a/x-pack/plugins/index_management/public/application/components/template_form/template_form_schemas.tsx b/x-pack/plugins/index_management/public/application/components/template_form/template_form_schemas.tsx index 9427d7bac2444..77cbca87c7655 100644 --- a/x-pack/plugins/index_management/public/application/components/template_form/template_form_schemas.tsx +++ b/x-pack/plugins/index_management/public/application/components/template_form/template_form_schemas.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCode } from '@elastic/eui'; import { diff --git a/x-pack/plugins/index_management/public/application/sections/home/components/filter_list_button.tsx b/x-pack/plugins/index_management/public/application/sections/home/components/filter_list_button.tsx index 4bd9a01380c0e..db36ce0fd9dcc 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/components/filter_list_button.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/components/filter_list_button.tsx @@ -6,7 +6,7 @@ */ import React, { useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFilterButton, EuiFilterGroup, EuiPopover, EuiFilterSelectItem } from '@elastic/eui'; interface Filter { diff --git a/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_badges.tsx b/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_badges.tsx index 3e98b93361c8a..39c6f61e75dde 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_badges.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_badges.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiBadge, EuiBadgeGroup } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { DataStream } from '../../../../../common'; import { isFleetManaged } from '../../../lib/data_streams'; diff --git a/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_list.tsx b/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_list.tsx index 583d1fcb83ed4..f483a37a42d1b 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_list.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_list.tsx @@ -7,7 +7,7 @@ import React, { useMemo, useState } from 'react'; import { RouteComponentProps } from 'react-router-dom'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiFlexGroup, diff --git a/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_table/data_stream_table.tsx b/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_table/data_stream_table.tsx index cbfe133b2909d..44ffe4741e471 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_table/data_stream_table.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/data_stream_table/data_stream_table.tsx @@ -7,7 +7,7 @@ import React, { useState, Fragment } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiInMemoryTable, EuiBasicTableColumn, EuiButton, EuiLink } from '@elastic/eui'; import { ScopedHistory } from 'kibana/public'; diff --git a/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/delete_data_stream_confirmation_modal/delete_data_stream_confirmation_modal.tsx b/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/delete_data_stream_confirmation_modal/delete_data_stream_confirmation_modal.tsx index f555706a28cdd..f10718788eeab 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/delete_data_stream_confirmation_modal/delete_data_stream_confirmation_modal.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/delete_data_stream_confirmation_modal/delete_data_stream_confirmation_modal.tsx @@ -8,7 +8,7 @@ import React, { Fragment } from 'react'; import { EuiCallOut, EuiConfirmModal, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { deleteDataStreams } from '../../../../services/api'; import { notificationService } from '../../../../services/notification'; diff --git a/x-pack/plugins/index_management/public/application/sections/home/home.tsx b/x-pack/plugins/index_management/public/application/sections/home/home.tsx index 8fce2d354f87b..8a43c4dab4f9a 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/home.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/home.tsx @@ -7,7 +7,7 @@ import React, { useEffect } from 'react'; import { Route, RouteComponentProps, Switch } from 'react-router-dom'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, EuiPageHeader, EuiSpacer } from '@elastic/eui'; import { documentationService } from '../../services/documentation'; import { DataStreamList } from './data_stream_list'; diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/detail_panel.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/detail_panel.js index 23021eba781a9..15df66db46c19 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/detail_panel.js +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/detail_panel.js @@ -7,7 +7,7 @@ import React, { Fragment } from 'react'; import { Route } from 'react-router-dom'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCallOut, EuiFlexGroup, diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/edit_settings_json/edit_settings_json.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/edit_settings_json/edit_settings_json.js index 1891d7c109257..2337485e6c82b 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/edit_settings_json/edit_settings_json.js +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/edit_settings_json/edit_settings_json.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { documentationService } from '../../../../../services/documentation'; import { diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/summary/summary.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/summary/summary.js index 901ee9dbec3cf..3e78188ebbd24 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/summary/summary.js +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/detail_panel/summary/summary.js @@ -7,7 +7,7 @@ import React, { Fragment } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/index_actions_context_menu/index_actions_context_menu.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/index_actions_context_menu/index_actions_context_menu.js index cc78f8c99a4c6..80f830bdc7b99 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/index_actions_context_menu/index_actions_context_menu.js +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/index_actions_context_menu/index_actions_context_menu.js @@ -6,7 +6,7 @@ */ import React, { Component, Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { every } from 'lodash'; import { diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/index_table/index_table.js b/x-pack/plugins/index_management/public/application/sections/home/index_list/index_table/index_table.js index 83c7df52fb679..63e4503180f23 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/index_table/index_table.js +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/index_table/index_table.js @@ -8,7 +8,7 @@ import React, { Component, Fragment } from 'react'; import { i18n } from '@kbn/i18n'; import { METRIC_TYPE } from '@kbn/analytics'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Route } from 'react-router-dom'; import qs from 'query-string'; diff --git a/x-pack/plugins/index_management/public/application/sections/home/template_list/legacy_templates/template_table/template_table.tsx b/x-pack/plugins/index_management/public/application/sections/home/template_list/legacy_templates/template_table/template_table.tsx index b39bfd60bf2e0..cd7615ddfb1b9 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/template_list/legacy_templates/template_table/template_table.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/template_list/legacy_templates/template_table/template_table.tsx @@ -7,7 +7,7 @@ import React, { useState, Fragment } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { METRIC_TYPE } from '@kbn/analytics'; import { EuiInMemoryTable, EuiButton, EuiLink, EuiBasicTableColumn } from '@elastic/eui'; import { ScopedHistory } from 'kibana/public'; diff --git a/x-pack/plugins/index_management/public/application/sections/home/template_list/template_details/tabs/tab_preview.tsx b/x-pack/plugins/index_management/public/application/sections/home/template_list/template_details/tabs/tab_preview.tsx index bb33af8657449..38f4a8b4f787b 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/template_list/template_details/tabs/tab_preview.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/template_list/template_details/tabs/tab_preview.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiText, EuiSpacer } from '@elastic/eui'; import { TemplateDeserialized } from '../../../../../../../common'; import { SimulateTemplate } from '../../../../../components/index_templates'; diff --git a/x-pack/plugins/index_management/public/application/sections/home/template_list/template_details/tabs/tab_summary.tsx b/x-pack/plugins/index_management/public/application/sections/home/template_list/template_details/tabs/tab_summary.tsx index c17ccd9ced932..b4edeefbae8cf 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/template_list/template_details/tabs/tab_summary.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/template_list/template_details/tabs/tab_summary.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescriptionList, EuiDescriptionListTitle, diff --git a/x-pack/plugins/index_management/public/application/sections/home/template_list/template_details/template_details_content.tsx b/x-pack/plugins/index_management/public/application/sections/home/template_list/template_details/template_details_content.tsx index 1a82cb3bfbdd1..4f00409d2c3cf 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/template_list/template_details/template_details_content.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/template_list/template_details/template_details_content.tsx @@ -6,7 +6,7 @@ */ import React, { useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { METRIC_TYPE } from '@kbn/analytics'; import { diff --git a/x-pack/plugins/index_management/public/application/sections/home/template_list/template_list.tsx b/x-pack/plugins/index_management/public/application/sections/home/template_list/template_list.tsx index 2df312771ca12..8c4828da5f04a 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/template_list/template_list.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/template_list/template_list.tsx @@ -7,7 +7,7 @@ import React, { useState, useEffect, useMemo } from 'react'; import { RouteComponentProps } from 'react-router-dom'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { METRIC_TYPE } from '@kbn/analytics'; import { ScopedHistory } from 'kibana/public'; diff --git a/x-pack/plugins/index_management/public/application/sections/home/template_list/template_table/template_table.tsx b/x-pack/plugins/index_management/public/application/sections/home/template_list/template_table/template_table.tsx index 50911f09c5792..08b00b8376520 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/template_list/template_table/template_table.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/template_list/template_table/template_table.tsx @@ -7,7 +7,7 @@ import React, { useState, Fragment } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { METRIC_TYPE } from '@kbn/analytics'; import { EuiInMemoryTable, EuiBasicTableColumn, EuiButton, EuiLink, EuiIcon } from '@elastic/eui'; import { ScopedHistory } from 'kibana/public'; diff --git a/x-pack/plugins/index_management/public/application/sections/template_clone/template_clone.tsx b/x-pack/plugins/index_management/public/application/sections/template_clone/template_clone.tsx index bf71461554760..5c871a8f8cef5 100644 --- a/x-pack/plugins/index_management/public/application/sections/template_clone/template_clone.tsx +++ b/x-pack/plugins/index_management/public/application/sections/template_clone/template_clone.tsx @@ -7,7 +7,7 @@ import React, { useEffect, useState } from 'react'; import { RouteComponentProps } from 'react-router-dom'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiPageContentBody } from '@elastic/eui'; import { ScopedHistory } from 'kibana/public'; diff --git a/x-pack/plugins/index_management/public/application/sections/template_create/template_create.tsx b/x-pack/plugins/index_management/public/application/sections/template_create/template_create.tsx index 6eba112b11939..31646164a6623 100644 --- a/x-pack/plugins/index_management/public/application/sections/template_create/template_create.tsx +++ b/x-pack/plugins/index_management/public/application/sections/template_create/template_create.tsx @@ -7,7 +7,7 @@ import React, { useEffect, useState } from 'react'; import { RouteComponentProps } from 'react-router-dom'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiPageContentBody } from '@elastic/eui'; import { useLocation } from 'react-router-dom'; import { parse } from 'query-string'; diff --git a/x-pack/plugins/index_management/public/application/sections/template_edit/template_edit.tsx b/x-pack/plugins/index_management/public/application/sections/template_edit/template_edit.tsx index ff6909d4666f8..e15e25d88df2e 100644 --- a/x-pack/plugins/index_management/public/application/sections/template_edit/template_edit.tsx +++ b/x-pack/plugins/index_management/public/application/sections/template_edit/template_edit.tsx @@ -8,7 +8,7 @@ import React, { useEffect, useState, Fragment } from 'react'; import { RouteComponentProps } from 'react-router-dom'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiPageContentBody, EuiSpacer, EuiCallOut } from '@elastic/eui'; import { ScopedHistory } from 'kibana/public'; diff --git a/x-pack/plugins/infra/public/alerting/common/components/metrics_alert_dropdown.tsx b/x-pack/plugins/infra/public/alerting/common/components/metrics_alert_dropdown.tsx index b92144d37eaa1..21a47ff18cd76 100644 --- a/x-pack/plugins/infra/public/alerting/common/components/metrics_alert_dropdown.tsx +++ b/x-pack/plugins/infra/public/alerting/common/components/metrics_alert_dropdown.tsx @@ -13,7 +13,7 @@ import { EuiContextMenu, EuiContextMenuPanelDescriptor, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; import { PrefilledInventoryAlertFlyout } from '../../inventory/components/alert_flyout'; import { PrefilledThresholdAlertFlyout } from '../../metric_threshold/components/alert_flyout'; diff --git a/x-pack/plugins/infra/public/alerting/common/criterion_preview_chart/criterion_preview_chart.tsx b/x-pack/plugins/infra/public/alerting/common/criterion_preview_chart/criterion_preview_chart.tsx index 9ea53dfb4e33b..3694e49bb7d02 100644 --- a/x-pack/plugins/infra/public/alerting/common/criterion_preview_chart/criterion_preview_chart.tsx +++ b/x-pack/plugins/infra/public/alerting/common/criterion_preview_chart/criterion_preview_chart.tsx @@ -12,7 +12,7 @@ import { sum, min as getMin, max as getMax } from 'lodash'; import moment from 'moment'; import { i18n } from '@kbn/i18n'; import { EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { formatNumber } from '../../../../common/formatters/number'; import { GetLogAlertsChartPreviewDataSuccessResponsePayload } from '../../../../common/http_api'; diff --git a/x-pack/plugins/infra/public/alerting/inventory/components/expression.tsx b/x-pack/plugins/infra/public/alerting/inventory/components/expression.tsx index 95ea78ac98ee9..350a4b9a087f3 100644 --- a/x-pack/plugins/infra/public/alerting/inventory/components/expression.tsx +++ b/x-pack/plugins/infra/public/alerting/inventory/components/expression.tsx @@ -23,7 +23,7 @@ import { EuiIcon, EuiHealth, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { toMetricOpt } from '../../../../common/snapshot_metric_i18n'; import { diff --git a/x-pack/plugins/infra/public/alerting/inventory/components/expression_chart.tsx b/x-pack/plugins/infra/public/alerting/inventory/components/expression_chart.tsx index b1a58a869e011..3152edf9d5cfd 100644 --- a/x-pack/plugins/infra/public/alerting/inventory/components/expression_chart.tsx +++ b/x-pack/plugins/infra/public/alerting/inventory/components/expression_chart.tsx @@ -9,7 +9,7 @@ import { Axis, Chart, niceTimeFormatter, Position, Settings } from '@elastic/cha import { first, last } from 'lodash'; import moment from 'moment'; import { EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Color } from '../../../../common/color_palette'; import { MetricsExplorerRow, MetricsExplorerAggregation } from '../../../../common/http_api'; import { MetricExplorerSeriesChart } from '../../../pages/metrics/metrics_explorer/components/series_chart'; diff --git a/x-pack/plugins/infra/public/alerting/inventory/components/manage_alerts_context_menu_item.tsx b/x-pack/plugins/infra/public/alerting/inventory/components/manage_alerts_context_menu_item.tsx index c9b6275264f91..ef352dc7b5a33 100644 --- a/x-pack/plugins/infra/public/alerting/inventory/components/manage_alerts_context_menu_item.tsx +++ b/x-pack/plugins/infra/public/alerting/inventory/components/manage_alerts_context_menu_item.tsx @@ -7,7 +7,7 @@ import { EuiContextMenuItem } from '@elastic/eui'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useLinkProps } from '../../../hooks/use_link_props'; export const ManageAlertsContextMenuItem = () => { diff --git a/x-pack/plugins/infra/public/alerting/inventory/components/metric.tsx b/x-pack/plugins/infra/public/alerting/inventory/components/metric.tsx index 3d9116905fb25..0c88e2e56ed07 100644 --- a/x-pack/plugins/infra/public/alerting/inventory/components/metric.tsx +++ b/x-pack/plugins/infra/public/alerting/inventory/components/metric.tsx @@ -7,7 +7,7 @@ import React, { useState, useCallback, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { debounce } from 'lodash'; import { EuiExpression, diff --git a/x-pack/plugins/infra/public/alerting/inventory/components/node_type.tsx b/x-pack/plugins/infra/public/alerting/inventory/components/node_type.tsx index bd7812acac678..530743d95541c 100644 --- a/x-pack/plugins/infra/public/alerting/inventory/components/node_type.tsx +++ b/x-pack/plugins/infra/public/alerting/inventory/components/node_type.tsx @@ -7,7 +7,7 @@ import React, { useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiExpression, EuiPopover, EuiFlexGroup, EuiFlexItem, EuiSelect } from '@elastic/eui'; import { EuiPopoverTitle, EuiButtonIcon } from '@elastic/eui'; import { InventoryItemType } from '../../../../common/inventory_models/types'; diff --git a/x-pack/plugins/infra/public/alerting/log_threshold/components/alert_dropdown.tsx b/x-pack/plugins/infra/public/alerting/log_threshold/components/alert_dropdown.tsx index ca291c49e49d1..a447fbf837d80 100644 --- a/x-pack/plugins/infra/public/alerting/log_threshold/components/alert_dropdown.tsx +++ b/x-pack/plugins/infra/public/alerting/log_threshold/components/alert_dropdown.tsx @@ -8,7 +8,7 @@ import React, { useState, useCallback, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiPopover, EuiContextMenuItem, EuiContextMenuPanel, EuiHeaderLink } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { AlertFlyout } from './alert_flyout'; import { useLinkProps } from '../../../hooks/use_link_props'; import { useKibanaContextForPlugin } from '../../../hooks/use_kibana'; diff --git a/x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criteria.tsx b/x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criteria.tsx index 553c052601838..9ff9b602fac3b 100644 --- a/x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criteria.tsx +++ b/x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criteria.tsx @@ -7,7 +7,7 @@ import React, { useCallback } from 'react'; import { EuiFlexItem, EuiFlexGroup, EuiButtonEmpty, EuiAccordion, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { IFieldType } from 'src/plugins/data/public'; import { Criterion } from './criterion'; diff --git a/x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion_preview_chart.tsx b/x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion_preview_chart.tsx index c5f5ace2f5470..38330b51e7d50 100644 --- a/x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion_preview_chart.tsx +++ b/x-pack/plugins/infra/public/alerting/log_threshold/components/expression_editor/criterion_preview_chart.tsx @@ -19,7 +19,7 @@ import { LineAnnotation, } from '@elastic/charts'; import { EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useKibana } from '../../../../../../../../src/plugins/kibana_react/public'; import { ChartContainer, diff --git a/x-pack/plugins/infra/public/alerting/metric_anomaly/components/expression.tsx b/x-pack/plugins/infra/public/alerting/metric_anomaly/components/expression.tsx index 5c821c89ad317..ca38f98534db3 100644 --- a/x-pack/plugins/infra/public/alerting/metric_anomaly/components/expression.tsx +++ b/x-pack/plugins/infra/public/alerting/metric_anomaly/components/expression.tsx @@ -7,7 +7,7 @@ import React, { useCallback, useState, useMemo, useEffect } from 'react'; import { EuiFlexGroup, EuiSpacer, EuiText, EuiLoadingContent } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { useInfraMLCapabilities } from '../../../containers/ml/infra_ml_capabilities'; import { SubscriptionSplashPrompt } from '../../../components/subscription_splash_content'; diff --git a/x-pack/plugins/infra/public/alerting/metric_anomaly/components/node_type.tsx b/x-pack/plugins/infra/public/alerting/metric_anomaly/components/node_type.tsx index 6ddcf8fd5cb65..fe43db40a41e5 100644 --- a/x-pack/plugins/infra/public/alerting/metric_anomaly/components/node_type.tsx +++ b/x-pack/plugins/infra/public/alerting/metric_anomaly/components/node_type.tsx @@ -7,7 +7,7 @@ import React, { useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiExpression, EuiPopover, EuiFlexGroup, EuiFlexItem, EuiSelect } from '@elastic/eui'; import { EuiPopoverTitle, EuiButtonIcon } from '@elastic/eui'; import { MetricAnomalyParams } from '../../../../common/alerting/metrics'; diff --git a/x-pack/plugins/infra/public/alerting/metric_anomaly/components/severity_threshold.tsx b/x-pack/plugins/infra/public/alerting/metric_anomaly/components/severity_threshold.tsx index 2dc561ff172b9..d93e088fe25a7 100644 --- a/x-pack/plugins/infra/public/alerting/metric_anomaly/components/severity_threshold.tsx +++ b/x-pack/plugins/infra/public/alerting/metric_anomaly/components/severity_threshold.tsx @@ -7,7 +7,7 @@ import React, { useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiExpression, EuiPopover, EuiFlexGroup, EuiFlexItem, EuiSelect } from '@elastic/eui'; import { EuiPopoverTitle, EuiButtonIcon } from '@elastic/eui'; import { ANOMALY_THRESHOLD } from '../../../../common/infra_ml'; diff --git a/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression.tsx b/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression.tsx index 095ce9f78cdff..97817f15c66a9 100644 --- a/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression.tsx +++ b/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression.tsx @@ -21,7 +21,7 @@ import { EuiPanel, EuiLink, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { Comparator, Aggregators } from '../../../../common/alerting/metrics'; import { ForLastExpression } from '../../../../../triggers_actions_ui/public'; diff --git a/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_chart.tsx b/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_chart.tsx index 6a68c01e26017..87bc52322c7d3 100644 --- a/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_chart.tsx +++ b/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_chart.tsx @@ -8,7 +8,7 @@ import React, { useMemo, useCallback } from 'react'; import { Axis, Chart, niceTimeFormatter, Position, Settings } from '@elastic/charts'; import { EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { DataViewBase } from '@kbn/es-query'; import { first, last } from 'lodash'; diff --git a/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_row.tsx b/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_row.tsx index b4472b90efdb2..82b3e7d3802b8 100644 --- a/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_row.tsx +++ b/x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_row.tsx @@ -7,7 +7,7 @@ import { omit } from 'lodash'; import React, { useCallback, useState, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, diff --git a/x-pack/plugins/infra/public/components/data_search_error_callout.tsx b/x-pack/plugins/infra/public/components/data_search_error_callout.tsx index 9abea9359acdb..0a06bb657f66f 100644 --- a/x-pack/plugins/infra/public/components/data_search_error_callout.tsx +++ b/x-pack/plugins/infra/public/components/data_search_error_callout.tsx @@ -6,7 +6,7 @@ */ import { EuiButton, EuiCallOut } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { AbortedRequestSearchStrategyError, diff --git a/x-pack/plugins/infra/public/components/error_page.tsx b/x-pack/plugins/infra/public/components/error_page.tsx index da6716ddc7f72..5fba453feba85 100644 --- a/x-pack/plugins/infra/public/components/error_page.tsx +++ b/x-pack/plugins/infra/public/components/error_page.tsx @@ -6,7 +6,7 @@ */ import { EuiButton, EuiCallOut, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { PageTemplate } from './page_template'; diff --git a/x-pack/plugins/infra/public/components/log_stream/log_stream.stories.mdx b/x-pack/plugins/infra/public/components/log_stream/log_stream.stories.mdx index 99580adfed5bb..82b02059ecc1f 100644 --- a/x-pack/plugins/infra/public/components/log_stream/log_stream.stories.mdx +++ b/x-pack/plugins/infra/public/components/log_stream/log_stream.stories.mdx @@ -2,7 +2,7 @@ import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs/blocks'; import { defer, of, Subject } from 'rxjs'; import { delay } from 'rxjs/operators'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { KBN_FIELD_TYPES } from '../../../../../../src/plugins/data/public'; import { EuiThemeProvider } from '../../../../../../src/plugins/kibana_react/common'; import { KibanaContextProvider } from '../../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/infra/public/components/log_stream/log_stream_error_boundary.tsx b/x-pack/plugins/infra/public/components/log_stream/log_stream_error_boundary.tsx index 41a9e13dcc178..c2e025dcd5e75 100644 --- a/x-pack/plugins/infra/public/components/log_stream/log_stream_error_boundary.tsx +++ b/x-pack/plugins/infra/public/components/log_stream/log_stream_error_boundary.tsx @@ -6,7 +6,7 @@ */ import { EuiCodeBlock, EuiEmptyPrompt } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { KQLSyntaxError } from '@kbn/es-query'; import { RenderErrorFunc, ResettableErrorBoundary } from '../resettable_error_boundary'; diff --git a/x-pack/plugins/infra/public/components/logging/log_analysis_job_status/job_configuration_outdated_callout.tsx b/x-pack/plugins/infra/public/components/logging/log_analysis_job_status/job_configuration_outdated_callout.tsx index 69bc2315f7140..877ac4a9e3b35 100644 --- a/x-pack/plugins/infra/public/components/logging/log_analysis_job_status/job_configuration_outdated_callout.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_analysis_job_status/job_configuration_outdated_callout.tsx @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { RecreateJobCallout } from './recreate_job_callout'; diff --git a/x-pack/plugins/infra/public/components/logging/log_analysis_job_status/job_definition_outdated_callout.tsx b/x-pack/plugins/infra/public/components/logging/log_analysis_job_status/job_definition_outdated_callout.tsx index 77b242eeb1ec8..41777477a3897 100644 --- a/x-pack/plugins/infra/public/components/logging/log_analysis_job_status/job_definition_outdated_callout.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_analysis_job_status/job_definition_outdated_callout.tsx @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { RecreateJobCallout } from './recreate_job_callout'; diff --git a/x-pack/plugins/infra/public/components/logging/log_analysis_job_status/job_stopped_callout.tsx b/x-pack/plugins/infra/public/components/logging/log_analysis_job_status/job_stopped_callout.tsx index c6aba92fa8f56..8f1568768a101 100644 --- a/x-pack/plugins/infra/public/components/logging/log_analysis_job_status/job_stopped_callout.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_analysis_job_status/job_stopped_callout.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiCallOut } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const JobStoppedCallout: React.FC = () => ( diff --git a/x-pack/plugins/infra/public/components/logging/log_analysis_job_status/quality_warning_notices.tsx b/x-pack/plugins/infra/public/components/logging/log_analysis_job_status/quality_warning_notices.tsx index cd0dfe90c7f6d..170764f917abb 100644 --- a/x-pack/plugins/infra/public/components/logging/log_analysis_job_status/quality_warning_notices.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_analysis_job_status/quality_warning_notices.tsx @@ -14,7 +14,7 @@ import { htmlIdGenerator, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { groupBy } from 'lodash'; import React, { Fragment, useState } from 'react'; import { euiStyled } from '../../../../../../../src/plugins/kibana_react/common'; diff --git a/x-pack/plugins/infra/public/components/logging/log_analysis_results/analyze_in_ml_button.tsx b/x-pack/plugins/infra/public/components/logging/log_analysis_results/analyze_in_ml_button.tsx index 00c6b1f93ef88..40cff5143e0ea 100644 --- a/x-pack/plugins/infra/public/components/logging/log_analysis_results/analyze_in_ml_button.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_analysis_results/analyze_in_ml_button.tsx @@ -6,7 +6,7 @@ */ import { EuiButton } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useCallback } from 'react'; import { useKibanaContextForPlugin } from '../../../hooks/use_kibana'; import { shouldHandleLinkEvent } from '../../../hooks/use_link_props'; diff --git a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/create_job_button.tsx b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/create_job_button.tsx index 5d7513cfac90e..bf245cf4d4c0d 100644 --- a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/create_job_button.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/create_job_button.tsx @@ -6,7 +6,7 @@ */ import { EuiButton, PropsOf } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { MissingSetupPrivilegesToolTip } from './missing_setup_privileges_tooltip'; diff --git a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/initial_configuration_step/analysis_setup_indices_form.tsx b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/initial_configuration_step/analysis_setup_indices_form.tsx index 8c176e0365a43..79de96af8c1f4 100644 --- a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/initial_configuration_step/analysis_setup_indices_form.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/initial_configuration_step/analysis_setup_indices_form.tsx @@ -7,7 +7,7 @@ import { EuiTitle, EuiText, EuiFormRow, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useCallback } from 'react'; import { QualityWarning } from '../../../../../common/log_analysis'; import { LoadingOverlayWrapper } from '../../../loading_overlay_wrapper'; diff --git a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/initial_configuration_step/analysis_setup_timerange_form.tsx b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/initial_configuration_step/analysis_setup_timerange_form.tsx index 0a2fb3e38280c..957391694cbbf 100644 --- a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/initial_configuration_step/analysis_setup_timerange_form.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/initial_configuration_step/analysis_setup_timerange_form.tsx @@ -14,7 +14,7 @@ import { EuiFormRow, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import moment, { Moment } from 'moment'; import React, { useMemo, useState } from 'react'; import { FixedDatePicker } from '../../../fixed_datepicker'; diff --git a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/initial_configuration_step/index_setup_dataset_filter.tsx b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/initial_configuration_step/index_setup_dataset_filter.tsx index 1ff1727ebec8c..0626a946f8848 100644 --- a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/initial_configuration_step/index_setup_dataset_filter.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/initial_configuration_step/index_setup_dataset_filter.tsx @@ -14,7 +14,7 @@ import { EuiSelectable, EuiSelectableOption, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useCallback, useMemo } from 'react'; import { DatasetFilter, QualityWarning } from '../../../../../common/log_analysis'; import { useVisibilityState } from '../../../../utils/use_visibility_state'; diff --git a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/initial_configuration_step/index_setup_row.tsx b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/initial_configuration_step/index_setup_row.tsx index b7a726c10744f..5a4d4ce6be466 100644 --- a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/initial_configuration_step/index_setup_row.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/initial_configuration_step/index_setup_row.tsx @@ -6,7 +6,7 @@ */ import { EuiCheckbox, EuiCode, EuiIconTip, EuiSpacer, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useCallback, useMemo } from 'react'; import { DatasetFilter, QualityWarning } from '../../../../../common/log_analysis'; import { IndexSetupDatasetFilter } from './index_setup_dataset_filter'; diff --git a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/initial_configuration_step/initial_configuration_step.tsx b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/initial_configuration_step/initial_configuration_step.tsx index 968529dd0a58e..08f467540a02f 100644 --- a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/initial_configuration_step/initial_configuration_step.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/initial_configuration_step/initial_configuration_step.tsx @@ -8,7 +8,7 @@ import { EuiCallOut, EuiForm, EuiSpacer } from '@elastic/eui'; import { EuiContainedStepProps } from '@elastic/eui/src/components/steps/steps'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useMemo } from 'react'; import { QualityWarning, SetupStatus } from '../../../../../common/log_analysis'; import { AnalysisSetupIndicesForm } from './analysis_setup_indices_form'; diff --git a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/manage_jobs_button.tsx b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/manage_jobs_button.tsx index 1e9f7ba6eac3b..0b12b0000fb3c 100644 --- a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/manage_jobs_button.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/manage_jobs_button.tsx @@ -6,7 +6,7 @@ */ import { EuiButton, PropsOf } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; export const ManageJobsButton: React.FunctionComponent> = (props) => ( diff --git a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/ml_unavailable_prompt.tsx b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/ml_unavailable_prompt.tsx index 9425aa79af712..1d013b65c5b22 100644 --- a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/ml_unavailable_prompt.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/ml_unavailable_prompt.tsx @@ -7,7 +7,7 @@ import { EuiButton, EuiEmptyPrompt, EuiLink } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { euiStyled } from '../../../../../../../src/plugins/kibana_react/common'; diff --git a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/process_step/create_ml_jobs_button.tsx b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/process_step/create_ml_jobs_button.tsx index 0b4b324858bd7..cfeead4e37d96 100644 --- a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/process_step/create_ml_jobs_button.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/process_step/create_ml_jobs_button.tsx @@ -6,7 +6,7 @@ */ import { EuiButton } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; export const CreateMLJobsButton: React.FunctionComponent<{ diff --git a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/process_step/process_step.tsx b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/process_step/process_step.tsx index 987ae87423fda..52bf508fa1568 100644 --- a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/process_step/process_step.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/process_step/process_step.tsx @@ -17,7 +17,7 @@ import { } from '@elastic/eui'; import { EuiContainedStepProps } from '@elastic/eui/src/components/steps/steps'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { SetupStatus } from '../../../../../common/log_analysis'; diff --git a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/process_step/recreate_ml_jobs_button.tsx b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/process_step/recreate_ml_jobs_button.tsx index 237f928a8ea7c..f38f07073d5a6 100644 --- a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/process_step/recreate_ml_jobs_button.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/process_step/recreate_ml_jobs_button.tsx @@ -6,7 +6,7 @@ */ import { EuiButton } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; export const RecreateMLJobsButton: React.FunctionComponent<{ diff --git a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/setup_flyout/module_list_card.tsx b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/setup_flyout/module_list_card.tsx index 4424410f552c6..7cb3c5a144a99 100644 --- a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/setup_flyout/module_list_card.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/setup_flyout/module_list_card.tsx @@ -6,7 +6,7 @@ */ import { EuiCard, EuiIcon, EuiButtonEmpty, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useEffect, useState } from 'react'; import { SetupStatus } from '../../../../../common/log_analysis'; import { CreateJobButton, RecreateJobButton } from '../../log_analysis_setup/create_job_button'; diff --git a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/setup_flyout/setup_flyout.tsx b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/setup_flyout/setup_flyout.tsx index 77ebb9084dbe3..07511146025af 100644 --- a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/setup_flyout/setup_flyout.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/setup_flyout/setup_flyout.tsx @@ -14,7 +14,7 @@ import { EuiFlyoutHeader, EuiTitle, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { LogEntryCategoriesSetupView } from './log_entry_categories_setup_view'; import { LogEntryRateSetupView } from './log_entry_rate_setup_view'; diff --git a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/setup_status_unknown_prompt.tsx b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/setup_status_unknown_prompt.tsx index a052f9fca5712..bf11c22bde995 100644 --- a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/setup_status_unknown_prompt.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/setup_status_unknown_prompt.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiEmptyPrompt, EuiButton } from '@elastic/eui'; import { euiStyled } from '../../../../../../../src/plugins/kibana_react/common'; diff --git a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/user_management_link.tsx b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/user_management_link.tsx index 3b0eb6fa89856..55b0f0b53d29f 100644 --- a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/user_management_link.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/user_management_link.tsx @@ -6,7 +6,7 @@ */ import { EuiButton, EuiButtonProps } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { useLinkProps } from '../../../hooks/use_link_props'; import { useKibanaContextForPlugin } from '../../../hooks/use_kibana'; diff --git a/x-pack/plugins/infra/public/components/logging/log_customization_menu.tsx b/x-pack/plugins/infra/public/components/logging/log_customization_menu.tsx index 28198ddee0e54..3820327030bba 100644 --- a/x-pack/plugins/infra/public/components/logging/log_customization_menu.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_customization_menu.tsx @@ -6,7 +6,7 @@ */ import { EuiButtonEmpty, EuiPopover } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import * as React from 'react'; import { euiStyled } from '../../../../../../src/plugins/kibana_react/common'; diff --git a/x-pack/plugins/infra/public/components/logging/log_datepicker.tsx b/x-pack/plugins/infra/public/components/logging/log_datepicker.tsx index 4f396ca7da495..6eba6de14f992 100644 --- a/x-pack/plugins/infra/public/components/logging/log_datepicker.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_datepicker.tsx @@ -7,7 +7,7 @@ import React, { useCallback } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiSuperDatePicker, EuiButton } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; interface LogDatepickerProps { startDateExpression: string; diff --git a/x-pack/plugins/infra/public/components/logging/log_entry_examples/log_entry_examples_empty_indicator.tsx b/x-pack/plugins/infra/public/components/logging/log_entry_examples/log_entry_examples_empty_indicator.tsx index 02028811e1838..94a3f70313add 100644 --- a/x-pack/plugins/infra/public/components/logging/log_entry_examples/log_entry_examples_empty_indicator.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_entry_examples/log_entry_examples_empty_indicator.tsx @@ -6,7 +6,7 @@ */ import { EuiButton, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; export const LogEntryExampleMessagesEmptyIndicator: React.FunctionComponent<{ diff --git a/x-pack/plugins/infra/public/components/logging/log_entry_examples/log_entry_examples_failure_indicator.tsx b/x-pack/plugins/infra/public/components/logging/log_entry_examples/log_entry_examples_failure_indicator.tsx index 2e4ff9dfc81c5..e9930086c7c50 100644 --- a/x-pack/plugins/infra/public/components/logging/log_entry_examples/log_entry_examples_failure_indicator.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_entry_examples/log_entry_examples_failure_indicator.tsx @@ -6,7 +6,7 @@ */ import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiTextColor } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; export const LogEntryExampleMessagesFailureIndicator: React.FunctionComponent<{ diff --git a/x-pack/plugins/infra/public/components/logging/log_entry_flyout/log_entry_actions_menu.tsx b/x-pack/plugins/infra/public/components/logging/log_entry_flyout/log_entry_actions_menu.tsx index 6deb3fc5ca067..f0ea8152ce41c 100644 --- a/x-pack/plugins/infra/public/components/logging/log_entry_flyout/log_entry_actions_menu.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_entry_flyout/log_entry_actions_menu.tsx @@ -6,7 +6,7 @@ */ import { EuiButton, EuiContextMenuItem, EuiContextMenuPanel, EuiPopover } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useMemo } from 'react'; import { useVisibilityState } from '../../../utils/use_visibility_state'; import { getApmTraceUrl } from '../../../../../observability/public'; diff --git a/x-pack/plugins/infra/public/components/logging/log_entry_flyout/log_entry_flyout.tsx b/x-pack/plugins/infra/public/components/logging/log_entry_flyout/log_entry_flyout.tsx index a296b7063282a..c985f0e9f0bf1 100644 --- a/x-pack/plugins/infra/public/components/logging/log_entry_flyout/log_entry_flyout.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_entry_flyout/log_entry_flyout.tsx @@ -16,7 +16,7 @@ import { EuiTitle, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useEffect } from 'react'; import type { Query } from '../../../../../../../src/plugins/data/public'; import { TimeKey } from '../../../../common/time'; diff --git a/x-pack/plugins/infra/public/components/logging/log_highlights_menu.tsx b/x-pack/plugins/infra/public/components/logging/log_highlights_menu.tsx index 7c5745dba550a..79425a6ec913f 100644 --- a/x-pack/plugins/infra/public/components/logging/log_highlights_menu.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_highlights_menu.tsx @@ -15,7 +15,7 @@ import { EuiPopover, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { debounce } from 'lodash'; import React, { useCallback, useMemo, useState } from 'react'; diff --git a/x-pack/plugins/infra/public/components/logging/log_minimap/search_marker.tsx b/x-pack/plugins/infra/public/components/logging/log_minimap/search_marker.tsx index 91153a20117e3..9006aa1d1b6d8 100644 --- a/x-pack/plugins/infra/public/components/logging/log_minimap/search_marker.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_minimap/search_marker.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import * as React from 'react'; import { euiStyled, keyframes } from '../../../../../../../src/plugins/kibana_react/common'; diff --git a/x-pack/plugins/infra/public/components/logging/log_search_controls/log_search_buttons.tsx b/x-pack/plugins/infra/public/components/logging/log_search_controls/log_search_buttons.tsx index 5a865703c5854..7d6427f865dcb 100644 --- a/x-pack/plugins/infra/public/components/logging/log_search_controls/log_search_buttons.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_search_controls/log_search_buttons.tsx @@ -6,7 +6,7 @@ */ import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import classNames from 'classnames'; import * as React from 'react'; diff --git a/x-pack/plugins/infra/public/components/logging/log_source_error_page.tsx b/x-pack/plugins/infra/public/components/logging/log_source_error_page.tsx index 6c757f7383a06..651e0be02e931 100644 --- a/x-pack/plugins/infra/public/components/logging/log_source_error_page.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_source_error_page.tsx @@ -6,7 +6,7 @@ */ import { EuiButton, EuiButtonEmpty, EuiCallOut, EuiEmptyPrompt, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { SavedObjectNotFound } from '../../../../../../src/plugins/kibana_utils/common'; import { diff --git a/x-pack/plugins/infra/public/components/logging/log_text_scale_controls.tsx b/x-pack/plugins/infra/public/components/logging/log_text_scale_controls.tsx index 1e02067c86374..bd00002aa460f 100644 --- a/x-pack/plugins/infra/public/components/logging/log_text_scale_controls.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_text_scale_controls.tsx @@ -6,7 +6,7 @@ */ import { EuiFormRow, EuiRadioGroup } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import * as React from 'react'; import { isTextScale, TextScale } from '../../../common/log_text_scale'; diff --git a/x-pack/plugins/infra/public/components/logging/log_text_stream/jump_to_tail.tsx b/x-pack/plugins/infra/public/components/logging/log_text_stream/jump_to_tail.tsx index c1b86d70cb8e9..9371bc9a8a216 100644 --- a/x-pack/plugins/infra/public/components/logging/log_text_stream/jump_to_tail.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_text_stream/jump_to_tail.tsx @@ -6,7 +6,7 @@ */ import { EuiButtonEmpty, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import * as React from 'react'; import { euiStyled } from '../../../../../../../src/plugins/kibana_react/common'; diff --git a/x-pack/plugins/infra/public/components/logging/log_text_stream/loading_item_view.tsx b/x-pack/plugins/infra/public/components/logging/log_text_stream/loading_item_view.tsx index bad2c2a4cb5ff..286fc5f769cad 100644 --- a/x-pack/plugins/infra/public/components/logging/log_text_stream/loading_item_view.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_text_stream/loading_item_view.tsx @@ -13,7 +13,7 @@ import { EuiLoadingSpinner, EuiButton, } from '@elastic/eui'; -import { FormattedMessage, FormattedTime, FormattedRelative } from '@kbn/i18n/react'; +import { FormattedMessage, FormattedTime, FormattedRelative } from '@kbn/i18n-react'; import * as React from 'react'; import { Unit } from '@elastic/datemath'; diff --git a/x-pack/plugins/infra/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx b/x-pack/plugins/infra/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx index a12ebc4445ecc..32d8497632021 100644 --- a/x-pack/plugins/infra/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_text_stream/scrollable_log_text_stream_view.tsx @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { Fragment } from 'react'; import moment from 'moment'; diff --git a/x-pack/plugins/infra/public/components/logging/log_text_wrap_controls.tsx b/x-pack/plugins/infra/public/components/logging/log_text_wrap_controls.tsx index eb45cf9b35d2d..c84643a6f394a 100644 --- a/x-pack/plugins/infra/public/components/logging/log_text_wrap_controls.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_text_wrap_controls.tsx @@ -6,7 +6,7 @@ */ import { EuiFormRow, EuiSwitch } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import * as React from 'react'; interface LogTextWrapControlsProps { diff --git a/x-pack/plugins/infra/public/components/saved_views/create_modal.tsx b/x-pack/plugins/infra/public/components/saved_views/create_modal.tsx index 9aae695395614..59789217bd869 100644 --- a/x-pack/plugins/infra/public/components/saved_views/create_modal.tsx +++ b/x-pack/plugins/infra/public/components/saved_views/create_modal.tsx @@ -7,7 +7,7 @@ import React, { useCallback, useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, EuiButton, diff --git a/x-pack/plugins/infra/public/components/saved_views/manage_views_flyout.tsx b/x-pack/plugins/infra/public/components/saved_views/manage_views_flyout.tsx index 2b75a60c97580..4d93a4718c198 100644 --- a/x-pack/plugins/infra/public/components/saved_views/manage_views_flyout.tsx +++ b/x-pack/plugins/infra/public/components/saved_views/manage_views_flyout.tsx @@ -20,7 +20,7 @@ import { EuiPortal, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { SavedView } from '../../containers/saved_view/saved_view'; interface Props { diff --git a/x-pack/plugins/infra/public/components/saved_views/update_modal.tsx b/x-pack/plugins/infra/public/components/saved_views/update_modal.tsx index c6d87d9a8ca15..60a9d2e0bdccc 100644 --- a/x-pack/plugins/infra/public/components/saved_views/update_modal.tsx +++ b/x-pack/plugins/infra/public/components/saved_views/update_modal.tsx @@ -7,7 +7,7 @@ import React, { useCallback, useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, EuiButton, diff --git a/x-pack/plugins/infra/public/components/saved_views/view_list_modal.tsx b/x-pack/plugins/infra/public/components/saved_views/view_list_modal.tsx index 2f746ad7e4e13..1c01d504de14d 100644 --- a/x-pack/plugins/infra/public/components/saved_views/view_list_modal.tsx +++ b/x-pack/plugins/infra/public/components/saved_views/view_list_modal.tsx @@ -8,7 +8,7 @@ import React, { useCallback, useState, useMemo } from 'react'; import { EuiButtonEmpty, EuiModalFooter, EuiButton } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiModal, EuiModalHeader, EuiModalHeaderTitle, EuiModalBody } from '@elastic/eui'; import { EuiSelectable } from '@elastic/eui'; import { EuiSelectableOption } from '@elastic/eui'; diff --git a/x-pack/plugins/infra/public/components/source_error_page.tsx b/x-pack/plugins/infra/public/components/source_error_page.tsx index 81e0aa54b6a3d..4cc0fa4487725 100644 --- a/x-pack/plugins/infra/public/components/source_error_page.tsx +++ b/x-pack/plugins/infra/public/components/source_error_page.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { ErrorPage } from './error_page'; diff --git a/x-pack/plugins/infra/public/components/source_loading_page.tsx b/x-pack/plugins/infra/public/components/source_loading_page.tsx index aedf45db5e68e..412f02b7f0c84 100644 --- a/x-pack/plugins/infra/public/components/source_loading_page.tsx +++ b/x-pack/plugins/infra/public/components/source_loading_page.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { LoadingPage } from './loading_page'; diff --git a/x-pack/plugins/infra/public/components/subscription_splash_content.tsx b/x-pack/plugins/infra/public/components/subscription_splash_content.tsx index 5d7f28e7d2f84..947a5ed395315 100644 --- a/x-pack/plugins/infra/public/components/subscription_splash_content.tsx +++ b/x-pack/plugins/infra/public/components/subscription_splash_content.tsx @@ -8,7 +8,7 @@ import React, { useEffect } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiText, EuiButton, EuiEmptyPrompt } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useKibana } from '../../../../../src/plugins/kibana_react/public'; import { HttpStart } from '../../../../../src/core/public'; import { useTrialStatus } from '../hooks/use_trial_status'; diff --git a/x-pack/plugins/infra/public/pages/404.tsx b/x-pack/plugins/infra/public/pages/404.tsx index 2b51ad55097e1..e163da904230d 100644 --- a/x-pack/plugins/infra/public/pages/404.tsx +++ b/x-pack/plugins/infra/public/pages/404.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; export class NotFoundPage extends React.PureComponent { diff --git a/x-pack/plugins/infra/public/pages/error.tsx b/x-pack/plugins/infra/public/pages/error.tsx index 18cb2a14a9214..f133bd70c230a 100644 --- a/x-pack/plugins/infra/public/pages/error.tsx +++ b/x-pack/plugins/infra/public/pages/error.tsx @@ -14,7 +14,7 @@ import { EuiPageHeaderSection, EuiTitle, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { euiStyled } from '../../../../../src/plugins/kibana_react/common'; diff --git a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/page_setup_content.tsx b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/page_setup_content.tsx index c012d97dd1fc0..6ab8e5d3a264c 100644 --- a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/page_setup_content.tsx +++ b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/page_setup_content.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiText, EuiButton, EuiEmptyPrompt } from '@elastic/eui'; import { useTrackPageview } from '../../../../../observability/public'; diff --git a/x-pack/plugins/infra/public/pages/logs/log_entry_rate/page_setup_content.tsx b/x-pack/plugins/infra/public/pages/logs/log_entry_rate/page_setup_content.tsx index 9c7b393e4c200..b94eb1ebd8748 100644 --- a/x-pack/plugins/infra/public/pages/logs/log_entry_rate/page_setup_content.tsx +++ b/x-pack/plugins/infra/public/pages/logs/log_entry_rate/page_setup_content.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiText, EuiButton, EuiEmptyPrompt } from '@elastic/eui'; import { useTrackPageview } from '../../../../../observability/public'; diff --git a/x-pack/plugins/infra/public/pages/logs/settings/add_log_column_popover.tsx b/x-pack/plugins/infra/public/pages/logs/settings/add_log_column_popover.tsx index e3fd4e3fa2ff9..c076b2063825e 100644 --- a/x-pack/plugins/infra/public/pages/logs/settings/add_log_column_popover.tsx +++ b/x-pack/plugins/infra/public/pages/logs/settings/add_log_column_popover.tsx @@ -13,7 +13,7 @@ import { EuiSelectable, EuiSelectableOption, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useCallback, useMemo } from 'react'; import { v4 as uuidv4 } from 'uuid'; import { euiStyled } from '../../../../../../../src/plugins/kibana_react/common'; diff --git a/x-pack/plugins/infra/public/pages/logs/settings/index_names_configuration_panel.tsx b/x-pack/plugins/infra/public/pages/logs/settings/index_names_configuration_panel.tsx index fa19c7e12a8a5..49e847e944694 100644 --- a/x-pack/plugins/infra/public/pages/logs/settings/index_names_configuration_panel.tsx +++ b/x-pack/plugins/infra/public/pages/logs/settings/index_names_configuration_panel.tsx @@ -16,7 +16,7 @@ import { EuiTitle, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { useTrackPageview } from '../../../../../observability/public'; import { LogIndexNameReference } from '../../../../common/log_sources'; diff --git a/x-pack/plugins/infra/public/pages/logs/settings/index_pattern_configuration_panel.tsx b/x-pack/plugins/infra/public/pages/logs/settings/index_pattern_configuration_panel.tsx index b5720f61e5e93..c7cae13a93c4b 100644 --- a/x-pack/plugins/infra/public/pages/logs/settings/index_pattern_configuration_panel.tsx +++ b/x-pack/plugins/infra/public/pages/logs/settings/index_pattern_configuration_panel.tsx @@ -6,7 +6,7 @@ */ import { EuiDescribedFormGroup, EuiFormRow, EuiLink, EuiSpacer, EuiTitle } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useCallback, useMemo } from 'react'; import { useTrackPageview } from '../../../../../observability/public'; import { LogIndexPatternReference } from '../../../../common/log_sources'; diff --git a/x-pack/plugins/infra/public/pages/logs/settings/indices_configuration_panel.stories.tsx b/x-pack/plugins/infra/public/pages/logs/settings/indices_configuration_panel.stories.tsx index cf0f302136fbf..ac1415466e708 100644 --- a/x-pack/plugins/infra/public/pages/logs/settings/indices_configuration_panel.stories.tsx +++ b/x-pack/plugins/infra/public/pages/logs/settings/indices_configuration_panel.stories.tsx @@ -6,7 +6,7 @@ */ import { EuiCodeBlock, EuiPage, EuiPageBody, EuiPageContent, PropsOf } from '@elastic/eui'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { Meta, Story } from '@storybook/react/types-6-0'; import React from 'react'; import { KBN_FIELD_TYPES } from '../../../../../../../src/plugins/data/public'; diff --git a/x-pack/plugins/infra/public/pages/logs/settings/log_columns_configuration_panel.tsx b/x-pack/plugins/infra/public/pages/logs/settings/log_columns_configuration_panel.tsx index 148a18391b937..de435500d3b32 100644 --- a/x-pack/plugins/infra/public/pages/logs/settings/log_columns_configuration_panel.tsx +++ b/x-pack/plugins/infra/public/pages/logs/settings/log_columns_configuration_panel.tsx @@ -20,7 +20,7 @@ import { EuiTitle, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useCallback } from 'react'; import { DragHandleProps, DropResult } from '../../../../../observability/public'; import { diff --git a/x-pack/plugins/infra/public/pages/logs/settings/name_configuration_panel.tsx b/x-pack/plugins/infra/public/pages/logs/settings/name_configuration_panel.tsx index 54158b654fee3..11758dd32077d 100644 --- a/x-pack/plugins/infra/public/pages/logs/settings/name_configuration_panel.tsx +++ b/x-pack/plugins/infra/public/pages/logs/settings/name_configuration_panel.tsx @@ -13,7 +13,7 @@ import { EuiSpacer, EuiTitle, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useMemo } from 'react'; import { FormElement } from './form_elements'; import { getFormRowProps, getStringInputFieldProps } from './form_field_props'; diff --git a/x-pack/plugins/infra/public/pages/logs/settings/source_configuration_form_errors.tsx b/x-pack/plugins/infra/public/pages/logs/settings/source_configuration_form_errors.tsx index 740a446d74f47..c6a185aeda7ca 100644 --- a/x-pack/plugins/infra/public/pages/logs/settings/source_configuration_form_errors.tsx +++ b/x-pack/plugins/infra/public/pages/logs/settings/source_configuration_form_errors.tsx @@ -7,7 +7,7 @@ import { EuiCallOut, EuiCode } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { FormValidationError } from './validation_errors'; diff --git a/x-pack/plugins/infra/public/pages/logs/settings/source_configuration_settings.tsx b/x-pack/plugins/infra/public/pages/logs/settings/source_configuration_settings.tsx index b7fbef74781fc..b2614ea84b0a9 100644 --- a/x-pack/plugins/infra/public/pages/logs/settings/source_configuration_settings.tsx +++ b/x-pack/plugins/infra/public/pages/logs/settings/source_configuration_settings.tsx @@ -14,7 +14,7 @@ import { EuiSpacer, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useCallback, useMemo } from 'react'; import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; import { useTrackPageview } from '../../../../../observability/public'; diff --git a/x-pack/plugins/infra/public/pages/logs/stream/page_view_log_in_context.tsx b/x-pack/plugins/infra/public/pages/logs/stream/page_view_log_in_context.tsx index da507fac5272c..954384b50ffa1 100644 --- a/x-pack/plugins/infra/public/pages/logs/stream/page_view_log_in_context.tsx +++ b/x-pack/plugins/infra/public/pages/logs/stream/page_view_log_in_context.tsx @@ -13,7 +13,7 @@ import { EuiTextColor, EuiToolTip, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { isEmpty } from 'lodash'; import React, { useCallback, useContext, useMemo } from 'react'; import { LogEntry } from '../../../../common/log_entry'; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/anomalies_table/anomalies_table.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/anomalies_table/anomalies_table.tsx index 05227dd1ed5e4..17c0b9178dac4 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/anomalies_table/anomalies_table.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/anomalies_table/anomalies_table.tsx @@ -26,7 +26,7 @@ import { EuiText, OnTimeChangeProps, } from '@elastic/eui'; -import { FormattedMessage, FormattedDate } from '@kbn/i18n/react'; +import { FormattedMessage, FormattedDate } from '@kbn/i18n-react'; import { datemathToEpochMillis } from '../../../../../../../utils/datemath'; import { SnapshotMetricType } from '../../../../../../../../common/inventory_models/types'; import { withTheme } from '../../../../../../../../../../../src/plugins/kibana_react/common'; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/anomaly_detection_flyout.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/anomaly_detection_flyout.tsx index 1fcec291fcc29..32d38d245d902 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/anomaly_detection_flyout.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/anomaly_detection_flyout.tsx @@ -7,7 +7,7 @@ import React, { useState, useCallback } from 'react'; import { EuiHeaderLink, EuiFlyout } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { FlyoutHome } from './flyout_home'; import { JobSetupScreen } from './job_setup_screen'; import { useInfraMLCapabilities } from '../../../../../../containers/ml/infra_ml_capabilities'; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/flyout_home.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/flyout_home.tsx index c7443618e458f..972887fb60bbe 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/flyout_home.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/flyout_home.tsx @@ -7,7 +7,7 @@ import React, { useState, useCallback, useEffect } from 'react'; import { EuiFlyoutHeader, EuiTitle, EuiFlyoutBody, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiText, EuiFlexGroup, EuiFlexItem, EuiCard, EuiIcon } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { EuiCallOut } from '@elastic/eui'; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/job_setup_screen.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/job_setup_screen.tsx index fd75aa3bec7a6..da439d71b6b89 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/job_setup_screen.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/ml/anomaly_detection/job_setup_screen.tsx @@ -9,7 +9,7 @@ import React, { useState, useCallback, useMemo, useEffect } from 'react'; import { EuiForm, EuiDescribedFormGroup, EuiFormRow } from '@elastic/eui'; import { EuiText, EuiSpacer } from '@elastic/eui'; import { EuiFlyoutHeader, EuiTitle, EuiFlyoutBody } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlyoutFooter } from '@elastic/eui'; import { EuiButton } from '@elastic/eui'; import { EuiFlexGroup, EuiFlexItem, EuiButtonEmpty } from '@elastic/eui'; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/overlay.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/overlay.tsx index f4c9f9b804135..047c7e8724d7b 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/overlay.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/overlay.tsx @@ -6,7 +6,7 @@ */ import { EuiPortal, EuiTabs, EuiTab, EuiPanel, EuiTitle, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useMemo, useState } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiButtonEmpty } from '@elastic/eui'; import { EuiOutsideClickDetector } from '@elastic/eui'; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/logs.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/logs.tsx index 8b5224068589c..c63d48fdf9c12 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/logs.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/logs.tsx @@ -7,7 +7,7 @@ import React, { useCallback, useMemo, useState } from 'react'; import useThrottle from 'react-use/lib/useThrottle'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiFieldSearch } from '@elastic/eui'; import { EuiFlexGroup } from '@elastic/eui'; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/processes_table.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/processes_table.tsx index 8c51fbf9d805b..1f6bed056f238 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/processes_table.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/processes/processes_table.tsx @@ -8,7 +8,7 @@ import React, { useMemo, useState, useCallback } from 'react'; import { omit } from 'lodash'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiTable, EuiTableHeader, @@ -218,7 +218,7 @@ const StyledTableBody = euiStyled(EuiTableBody)` & .euiTableCellContent { padding-top: 0; padding-bottom: 0; - + } `; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/properties/table.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/properties/table.tsx index 996e90c03f3db..97c15a0cffc5b 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/properties/table.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/properties/table.tsx @@ -18,7 +18,7 @@ import { import { i18n } from '@kbn/i18n'; import { first } from 'lodash'; import React, { useCallback, useMemo, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; interface Row { name: string; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/timeline/timeline.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/timeline/timeline.tsx index 0a511589298d0..70e613d536ef3 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/timeline/timeline.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/timeline/timeline.tsx @@ -7,7 +7,7 @@ import React, { useMemo, useCallback, useEffect } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import moment from 'moment'; import { first, last } from 'lodash'; import { EuiLoadingChart, EuiText, EuiEmptyPrompt, EuiButton } from '@elastic/eui'; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/interval_label.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/interval_label.tsx index 895c061cdd24b..8c2b6c0cd6de9 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/interval_label.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/interval_label.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiIconTip } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; interface Props { intervalAsString?: string; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/legend_controls.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/legend_controls.tsx index bd7d0ad2f2a49..c7479434424a6 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/legend_controls.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/legend_controls.tsx @@ -23,7 +23,7 @@ import { EuiFlexItem, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { SyntheticEvent, useState, useCallback, useEffect } from 'react'; import { first, last } from 'lodash'; import { euiStyled } from '../../../../../../../../../src/plugins/kibana_react/common'; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/custom_metric_form.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/custom_metric_form.tsx index 38018bf233205..fbd95440fc139 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/custom_metric_form.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/custom_metric_form.tsx @@ -22,7 +22,7 @@ import { } from '@elastic/eui'; import { IFieldType } from 'src/plugins/data/public'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { SnapshotCustomAggregation, SnapshotCustomMetricInput, diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/mode_switcher.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/mode_switcher.tsx index a0efed2b512d4..8c2cb77d339e2 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/mode_switcher.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/mode_switcher.tsx @@ -8,7 +8,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiButtonEmpty, EuiButton } from '@elastic/eui'; import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { CustomMetricMode } from './types'; import { SnapshotCustomMetricInput } from '../../../../../../../common/http_api/snapshot_api'; import { EuiTheme, withTheme } from '../../../../../../../../../../src/plugins/kibana_react/common'; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/node_context_menu.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/node_context_menu.tsx index 0d7741ca5477e..65d8fbbca7a2d 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/node_context_menu.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/node_context_menu.tsx @@ -7,7 +7,7 @@ import { EuiCode } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useMemo, useState } from 'react'; import { AlertFlyout } from '../../../../../alerting/inventory/components/alert_flyout'; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.tsx index ff40a269aed42..8d64515e4050e 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_group_by_controls.tsx @@ -13,7 +13,7 @@ import { EuiPopover, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { IFieldType } from 'src/plugins/data/public'; import { InfraGroupByOptions } from '../../../../../lib/lib'; diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_time_controls.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_time_controls.tsx index 8c85ed718ad6b..d6be501ec8f24 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_time_controls.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/waffle_time_controls.tsx @@ -6,7 +6,7 @@ */ import { EuiButton, EuiDatePicker, EuiFlexGroup, EuiFlexItem, EuiToolTip } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import moment, { Moment } from 'moment'; import React, { useCallback } from 'react'; import { convertIntervalToString } from '../../../../../utils/convert_interval_to_string'; diff --git a/x-pack/plugins/infra/public/pages/metrics/metric_detail/components/invalid_node.tsx b/x-pack/plugins/infra/public/pages/metrics/metric_detail/components/invalid_node.tsx index 17e6382ce65cc..784002999b03e 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metric_detail/components/invalid_node.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/metric_detail/components/invalid_node.tsx @@ -6,7 +6,7 @@ */ import { EuiButton, EuiEmptyPrompt, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { euiStyled } from '../../../../../../../../src/plugins/kibana_react/common'; import { ViewSourceConfigurationButton } from '../../../../components/source_configuration/view_source_configuration_button'; diff --git a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/chart_options.tsx b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/chart_options.tsx index aa051bc3ff442..a44cbb36af2c8 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/chart_options.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/chart_options.tsx @@ -6,7 +6,7 @@ */ import React, { useState, useCallback } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiRadioGroup, diff --git a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/charts.tsx b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/charts.tsx index 68faaf1f45145..e81849120c23c 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/charts.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/charts.tsx @@ -7,7 +7,7 @@ import { EuiButton, EuiFlexGrid, EuiFlexItem, EuiText, EuiHorizontalRule } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { MetricsSourceConfigurationProperties } from '../../../../../common/metrics_sources'; import { MetricsExplorerResponse } from '../../../../../common/http_api/metrics_explorer'; diff --git a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/empty_chart.tsx b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/empty_chart.tsx index 67d86d78a3757..c2e98d276d58d 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/empty_chart.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/empty_chart.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiEmptyPrompt } from '@elastic/eui'; export const MetricsExplorerEmptyChart = () => { diff --git a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/no_metrics.tsx b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/no_metrics.tsx index b32a3757864ca..98934fff1f8f0 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/no_metrics.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/no_metrics.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiEmptyPrompt } from '@elastic/eui'; export const MetricsExplorerNoMetrics = () => { diff --git a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/toolbar.tsx b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/toolbar.tsx index 01b2d129a1f9e..b182a56d867b5 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/toolbar.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/toolbar.tsx @@ -6,7 +6,7 @@ */ import { EuiFlexGroup, EuiFlexItem, EuiSuperDatePicker, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { DataViewBase } from '@kbn/es-query'; import { UI_SETTINGS } from '../../../../../../../../src/plugins/data/public'; diff --git a/x-pack/plugins/infra/public/pages/metrics/settings/indices_configuration_panel.tsx b/x-pack/plugins/infra/public/pages/metrics/settings/indices_configuration_panel.tsx index c1e0d2ffefa80..1dc67b4daa289 100644 --- a/x-pack/plugins/infra/public/pages/metrics/settings/indices_configuration_panel.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/settings/indices_configuration_panel.tsx @@ -14,7 +14,7 @@ import { EuiSpacer, EuiTitle, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { METRICS_INDEX_PATTERN } from '../../../../common/constants'; import { InputFieldProps } from './input_fields'; diff --git a/x-pack/plugins/infra/public/pages/metrics/settings/input_fields.tsx b/x-pack/plugins/infra/public/pages/metrics/settings/input_fields.tsx index a7a842417ebc2..60c976c734707 100644 --- a/x-pack/plugins/infra/public/pages/metrics/settings/input_fields.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/settings/input_fields.tsx @@ -7,7 +7,7 @@ import React, { ReactText } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export interface InputFieldProps< Value extends string = string, diff --git a/x-pack/plugins/infra/public/pages/metrics/settings/ml_configuration_panel.tsx b/x-pack/plugins/infra/public/pages/metrics/settings/ml_configuration_panel.tsx index 630820156e0e5..18da5470acc41 100644 --- a/x-pack/plugins/infra/public/pages/metrics/settings/ml_configuration_panel.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/settings/ml_configuration_panel.tsx @@ -13,7 +13,7 @@ import { EuiSpacer, EuiTitle, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { InputRangeFieldProps } from './input_fields'; diff --git a/x-pack/plugins/infra/public/pages/metrics/settings/name_configuration_panel.tsx b/x-pack/plugins/infra/public/pages/metrics/settings/name_configuration_panel.tsx index bb36d12ff3767..b662e9298c0f2 100644 --- a/x-pack/plugins/infra/public/pages/metrics/settings/name_configuration_panel.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/settings/name_configuration_panel.tsx @@ -13,7 +13,7 @@ import { EuiSpacer, EuiTitle, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { InputFieldProps } from './input_fields'; diff --git a/x-pack/plugins/infra/public/pages/metrics/settings/source_configuration_settings.tsx b/x-pack/plugins/infra/public/pages/metrics/settings/source_configuration_settings.tsx index f10bd7cf9e38a..b144b39d26dd4 100644 --- a/x-pack/plugins/infra/public/pages/metrics/settings/source_configuration_settings.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/settings/source_configuration_settings.tsx @@ -14,7 +14,7 @@ import { EuiSpacer, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useCallback, useContext, useMemo } from 'react'; import { SourceLoadingPage } from '../../../components/source_loading_page'; import { Source } from '../../../containers/metrics_source'; diff --git a/x-pack/plugins/ingest_pipelines/public/application/app.tsx b/x-pack/plugins/ingest_pipelines/public/application/app.tsx index 971a52d0b25b7..99624cbcf9967 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/app.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/app.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiPageContent, EuiEmptyPrompt } from '@elastic/eui'; import React, { FunctionComponent } from 'react'; import { Router, Switch, Route } from 'react-router-dom'; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/load_from_json/modal_provider.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/load_from_json/modal_provider.tsx index c0f9c758fc278..8fdd3a9c3bef4 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/load_from_json/modal_provider.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/load_from_json/modal_provider.tsx @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { FunctionComponent, useRef, useState, useCallback } from 'react'; import { EuiConfirmModal, EuiSpacer, EuiText, EuiCallOut } from '@elastic/eui'; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/on_failure_processors_title.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/on_failure_processors_title.tsx index 658ffe08607d8..1d8ad1a4abbf3 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/on_failure_processors_title.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/on_failure_processors_title.tsx @@ -8,7 +8,7 @@ import { EuiLink, EuiText, EuiTitle } from '@elastic/eui'; import React, { FunctionComponent } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useKibana } from '../../../../shared_imports'; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/add_processor_form.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/add_processor_form.tsx index 0a584cabc448a..5ec60e66c83d5 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/add_processor_form.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/add_processor_form.tsx @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { FunctionComponent, useEffect } from 'react'; import { EuiButton, diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/edit_processor_form.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/edit_processor_form.tsx index c80b9b136339d..ff782d077156e 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/edit_processor_form.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/edit_processor_form.tsx @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { FunctionComponent, useEffect, useState } from 'react'; import { EuiButton, diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/circle.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/circle.tsx index 87e08eaeea6e6..e7edeec1949a2 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/circle.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/circle.tsx @@ -6,7 +6,7 @@ */ import React, { FunctionComponent } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiCode } from '@elastic/eui'; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/ignore_missing_field.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/ignore_missing_field.tsx index 744e9798c4fb0..fe5f0e1d48dba 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/ignore_missing_field.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/ignore_missing_field.tsx @@ -7,7 +7,7 @@ import React, { FunctionComponent } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCode } from '@elastic/eui'; import { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/community_id.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/community_id.tsx index cd6f97d0a299e..5a2aa91547c94 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/community_id.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/community_id.tsx @@ -7,7 +7,7 @@ import React, { FunctionComponent } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiSpacer, EuiCode, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { FieldsConfig, from } from './shared'; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/csv.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/csv.tsx index 1fbfba387dcb6..0c17399ad9110 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/csv.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/csv.tsx @@ -8,7 +8,7 @@ import React, { FunctionComponent } from 'react'; import { EuiCode } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { FIELD_TYPES, diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/date.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/date.tsx index 90138757c97aa..4434ad1063422 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/date.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/date.tsx @@ -8,7 +8,7 @@ import React, { FunctionComponent } from 'react'; import { EuiCode } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { FIELD_TYPES, diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/date_index_name.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/date_index_name.tsx index d4fb74c73ff0c..8822530312f08 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/date_index_name.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/date_index_name.tsx @@ -8,7 +8,7 @@ import React, { FunctionComponent } from 'react'; import { EuiCode } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { FIELD_TYPES, diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/dissect.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/dissect.tsx index be55000bf374a..111fdc13b8849 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/dissect.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/dissect.tsx @@ -8,7 +8,7 @@ import React, { FunctionComponent } from 'react'; import { EuiCode, EuiLink } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { TextEditor } from '../field_components'; import { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/enrich.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/enrich.tsx index 1c6292795d587..f5e2bd2f79d4c 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/enrich.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/enrich.tsx @@ -7,7 +7,7 @@ import React, { FunctionComponent } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiLink } from '@elastic/eui'; import { FIELD_TYPES, diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/fingerprint.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/fingerprint.tsx index 5e52d560020c0..35d0ab75263ce 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/fingerprint.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/fingerprint.tsx @@ -8,7 +8,7 @@ import React, { FunctionComponent } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiCode } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { FieldsConfig, from, to } from './shared'; import { TargetField } from './common_fields/target_field'; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/geoip.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/geoip.tsx index 6a1f86977d8db..cf5d4d31a1704 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/geoip.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/geoip.tsx @@ -7,7 +7,7 @@ import React, { FunctionComponent } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCode } from '@elastic/eui'; import { FIELD_TYPES, UseField, Field, ToggleField } from '../../../../../../shared_imports'; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/inference.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/inference.tsx index 9c3601c368342..7cb0243c61e34 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/inference.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/inference.tsx @@ -7,7 +7,7 @@ import React, { FunctionComponent } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCode, EuiLink } from '@elastic/eui'; import { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/kv.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/kv.tsx index 0c8a6ee9c9e29..1907d167100cd 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/kv.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/kv.tsx @@ -7,7 +7,7 @@ import React, { FunctionComponent } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCode } from '@elastic/eui'; import { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/network_direction.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/network_direction.tsx index ab8744ee01ab8..5f5647910c4dc 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/network_direction.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/network_direction.tsx @@ -8,7 +8,7 @@ import React, { FunctionComponent, useState, useCallback, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; import { isEmpty } from 'lodash'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCode, EuiLink, EuiText } from '@elastic/eui'; import { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/script.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/script.tsx index 3c66279357843..18da4097eaf2c 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/script.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/script.tsx @@ -7,7 +7,7 @@ import React, { useState, useEffect } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { PainlessLang } from '@kbn/monaco'; import { EuiCode, EuiSwitch, EuiFormRow } from '@elastic/eui'; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/set.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/set.tsx index 6bbda366826f7..82ee3d3869d7b 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/set.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/set.tsx @@ -9,7 +9,7 @@ import React, { FunctionComponent, useState, useCallback, useMemo } from 'react' import { i18n } from '@kbn/i18n'; import { isEmpty } from 'lodash'; import { EuiCode, EuiLink, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { FIELD_TYPES, diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/set_security_user.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/set_security_user.tsx index 2529f4780b7c9..12d48cb7387dd 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/set_security_user.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/set_security_user.tsx @@ -7,7 +7,7 @@ import React, { FunctionComponent } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCode } from '@elastic/eui'; import { FIELD_TYPES, UseField, ComboBoxField } from '../../../../../../shared_imports'; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/uri_parts.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/uri_parts.tsx index 2e073fbf61bff..ae286a4ced01f 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/uri_parts.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/uri_parts.tsx @@ -7,7 +7,7 @@ import React, { FunctionComponent } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCode } from '@elastic/eui'; import { FIELD_TYPES, UseField, ToggleField } from '../../../../../../shared_imports'; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/user_agent.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/user_agent.tsx index 2b5a68f799b7e..0f5b1b462561c 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/user_agent.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/user_agent.tsx @@ -7,7 +7,7 @@ import React, { FunctionComponent } from 'react'; import { EuiCode, EuiBetaBadge, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiComboBoxOptionOption } from '@elastic/eui'; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_remove_modal.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_remove_modal.tsx index 26ae69ead3b5b..177287be04192 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_remove_modal.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_remove_modal.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { EuiConfirmModal } from '@elastic/eui'; import { ProcessorInternal, ProcessorSelector } from '../types'; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processors_empty_prompt.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processors_empty_prompt.tsx index 87684929e0c68..9c88deed5de8a 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processors_empty_prompt.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processors_empty_prompt.tsx @@ -7,7 +7,7 @@ import React, { FunctionComponent } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiEmptyPrompt, EuiSpacer, EuiLink } from '@elastic/eui'; import { useKibana } from '../../../../shared_imports'; import { usePipelineProcessorsContext } from '../context'; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processors_header.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processors_header.tsx index c1e412dd755fa..bb973f000574c 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processors_header.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processors_header.tsx @@ -8,7 +8,7 @@ import React, { FunctionComponent } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiLink, EuiText, EuiTitle } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useKibana } from '../../../../shared_imports'; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/shared/map_processor_type_to_form.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/shared/map_processor_type_to_form.tsx index eae48a6b46dd1..93425218733d6 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/shared/map_processor_type_to_form.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/shared/map_processor_type_to_form.tsx @@ -7,7 +7,7 @@ import { i18n } from '@kbn/i18n'; import React, { ReactNode } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCode, EuiLink } from '@elastic/eui'; import { diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_flyout.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_flyout.tsx index 13005cc03bcd2..073a9c24c71f4 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_flyout.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_flyout.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlyout, diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/add_docs_accordion/add_docs_accordion.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/add_docs_accordion/add_docs_accordion.tsx index ee9241dc966e6..ed817498586a6 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/add_docs_accordion/add_docs_accordion.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/add_docs_accordion/add_docs_accordion.tsx @@ -7,7 +7,7 @@ import React, { FunctionComponent, useState, useEffect } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiAccordion, EuiText, EuiSpacer, EuiLink } from '@elastic/eui'; import { UrlGeneratorsDefinition } from 'src/plugins/share/public'; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/tab_documents.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/tab_documents.tsx index e6e9968ab4511..467299433b145 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/tab_documents.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/tab_documents.tsx @@ -6,7 +6,7 @@ */ import React, { FunctionComponent, useCallback, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiSpacer, EuiText, EuiButton, EuiLink, EuiCode, EuiButtonEmpty } from '@elastic/eui'; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_output.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_output.tsx index 195406fd3ab81..1557db5fbcea9 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_output.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_output.tsx @@ -6,7 +6,7 @@ */ import React, { useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCodeBlock, EuiSpacer, diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/test_pipeline_tabs.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/test_pipeline_tabs.tsx index 7850c3edb0eb5..2e520874357c2 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/test_pipeline_tabs.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/test_pipeline_tabs.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiTab, EuiTabs } from '@elastic/eui'; export type TestPipelineFlyoutTab = 'documents' | 'output'; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form.tsx index eeda40c96418c..36e7a78c87d92 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form.tsx @@ -6,7 +6,7 @@ */ import React, { useState, useCallback, useRef } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; import { useForm, Form, FormConfig } from '../../../shared_imports'; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_fields.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_fields.tsx index 4043502634bde..7beb057cef30e 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_fields.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_fields.tsx @@ -6,7 +6,7 @@ */ import React, { useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiSpacer, EuiSwitch } from '@elastic/eui'; import { Processor } from '../../../../common/types'; diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_request_flyout/pipeline_request_flyout.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_request_flyout/pipeline_request_flyout.tsx index 55815403dc0a0..feb7d55145083 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_request_flyout/pipeline_request_flyout.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_request_flyout/pipeline_request_flyout.tsx @@ -6,7 +6,7 @@ */ import React, { useRef } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_clone/pipelines_clone.tsx b/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_clone/pipelines_clone.tsx index ffa9d16d13097..9140efd688e03 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_clone/pipelines_clone.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_clone/pipelines_clone.tsx @@ -9,7 +9,7 @@ import React, { FunctionComponent, useEffect } from 'react'; import { RouteComponentProps } from 'react-router-dom'; import { i18n } from '@kbn/i18n'; import { EuiPageContent } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { SectionLoading, useKibana, attemptToURIDecode } from '../../../shared_imports'; diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create/pipelines_create.tsx b/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create/pipelines_create.tsx index a8068a6521406..5b437d3da69ab 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create/pipelines_create.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create/pipelines_create.tsx @@ -7,7 +7,7 @@ import React, { useState, useEffect, useMemo } from 'react'; import { RouteComponentProps } from 'react-router-dom'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiPageHeader, EuiButtonEmpty, EuiSpacer } from '@elastic/eui'; import { getListPath } from '../../services/navigation'; diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create_from_csv/error_display.tsx b/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create_from_csv/error_display.tsx index b6ad59df3fbc4..a1308b3cf4b23 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create_from_csv/error_display.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create_from_csv/error_display.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { FC } from 'react'; import { EuiCallOut } from '@elastic/eui'; diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create_from_csv/instructions.tsx b/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create_from_csv/instructions.tsx index 42c6c3d348e3f..44f671b96863f 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create_from_csv/instructions.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create_from_csv/instructions.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { FC } from 'react'; import { EuiCode, EuiFlexGroup, EuiFlexItem, EuiLink, EuiSpacer, EuiText } from '@elastic/eui'; @@ -18,7 +18,7 @@ export const Instructions: FC = () => {

- - - - - - } - /> - - - - - - - , + + + + + + + + } + /> + + + + + + + + , params.element ); return () => { diff --git a/x-pack/plugins/lens/public/assets/chart_mosaic.tsx b/x-pack/plugins/lens/public/assets/chart_mosaic.tsx new file mode 100644 index 0000000000000..c385f0df1a008 --- /dev/null +++ b/x-pack/plugins/lens/public/assets/chart_mosaic.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import type { EuiIconProps } from '@elastic/eui'; + +export const LensIconChartMosaic = ({ title, titleId, ...props }: Omit) => ( + + {title ? : null} + + + +); diff --git a/x-pack/plugins/lens/public/datatable_visualization/components/constants.ts b/x-pack/plugins/lens/public/datatable_visualization/components/constants.ts index 84ee4f0e8a18e..b1053631b0117 100644 --- a/x-pack/plugins/lens/public/datatable_visualization/components/constants.ts +++ b/x-pack/plugins/lens/public/datatable_visualization/components/constants.ts @@ -8,3 +8,4 @@ export const LENS_EDIT_SORT_ACTION = 'sort'; export const LENS_EDIT_RESIZE_ACTION = 'resize'; export const LENS_TOGGLE_ACTION = 'toggle'; +export const LENS_EDIT_PAGESIZE_ACTION = 'pagesize'; diff --git a/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.test.tsx b/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.test.tsx index 22407f2b39771..f71d2b9ec6326 100644 --- a/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.test.tsx +++ b/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.test.tsx @@ -6,12 +6,16 @@ */ import React from 'react'; -import { ReactWrapper, shallow } from 'enzyme'; +import { ReactWrapper, shallow, mount } from 'enzyme'; import { act } from 'react-dom/test-utils'; import { mountWithIntl } from '@kbn/test/jest'; import { EuiDataGrid } from '@elastic/eui'; import { IAggType } from 'src/plugins/data/public'; -import { IFieldFormat } from 'src/plugins/field_formats/common'; +import { + FieldFormatParams, + IFieldFormat, + SerializedFieldFormat, +} from 'src/plugins/field_formats/common'; import { VisualizationContainer } from '../../visualization_container'; import { EmptyPlaceholder } from '../../shared_components'; import { LensIconChartDatatable } from '../../assets/chart_datatable'; @@ -20,6 +24,9 @@ import { LensMultiTable } from '../../../common'; import { DatatableProps } from '../../../common/expressions'; import { chartPluginMock } from 'src/plugins/charts/public/mocks'; import { IUiSettingsClient } from 'kibana/public'; +import { RenderMode } from 'src/plugins/expressions'; + +import { LENS_EDIT_PAGESIZE_ACTION } from './constants'; function sampleArgs() { const indexPatternId = 'indexPatternId'; @@ -82,7 +89,7 @@ function sampleArgs() { return { data, args }; } -function copyData(data: LensMultiTable): LensMultiTable { +function copyData(data: T): T { return JSON.parse(JSON.stringify(data)); } @@ -658,4 +665,133 @@ describe('DatatableComponent', () => { expect(wrapper.find('[data-test-subj="lnsDataTable-footer-c"]').exists()).toBe(false); }); + + describe('pagination', () => { + it('enables pagination', async () => { + const { data, args } = sampleArgs(); + + args.pageSize = 10; + + const wrapper = mount( + x as IFieldFormat} + dispatchEvent={onDispatchEvent} + getType={jest.fn()} + paletteService={chartPluginMock.createPaletteRegistry()} + uiSettings={{ get: jest.fn() } as unknown as IUiSettingsClient} + renderMode="edit" + /> + ); + + const paginationConfig = wrapper.find(EuiDataGrid).prop('pagination'); + expect(paginationConfig).toBeTruthy(); + expect(paginationConfig?.pageIndex).toBe(0); // should start at 0 + expect(paginationConfig?.pageSize).toBe(args.pageSize); + + // trigger new page + const newIndex = 3; + act(() => paginationConfig?.onChangePage(newIndex)); + wrapper.update(); + + const updatedConfig = wrapper.find(EuiDataGrid).prop('pagination'); + expect(updatedConfig).toBeTruthy(); + expect(updatedConfig?.pageIndex).toBe(newIndex); + expect(updatedConfig?.pageSize).toBe(args.pageSize); + }); + + it('disables pagination by default', async () => { + const { data, args } = sampleArgs(); + + delete args.pageSize; + + const wrapper = mount( + x as IFieldFormat} + dispatchEvent={onDispatchEvent} + getType={jest.fn()} + paletteService={chartPluginMock.createPaletteRegistry()} + uiSettings={{ get: jest.fn() } as unknown as IUiSettingsClient} + renderMode="edit" + /> + ); + + const paginationConfig = wrapper.find(EuiDataGrid).prop('pagination'); + expect(paginationConfig).not.toBeTruthy(); + }); + + it('dynamically toggles pagination', async () => { + const { data, args } = sampleArgs(); + + const argsWithPagination = copyData(args); + argsWithPagination.pageSize = 20; + + const argsWithoutPagination = copyData(args); + delete argsWithoutPagination.pageSize; + + const defaultProps = { + data, + formatFactory: (x?: SerializedFieldFormat) => x as IFieldFormat, + dispatchEvent: onDispatchEvent, + getType: jest.fn(), + paletteService: chartPluginMock.createPaletteRegistry(), + uiSettings: { get: jest.fn() } as unknown as IUiSettingsClient, + renderMode: 'edit' as RenderMode, + }; + + const wrapper = mount( + + ); + wrapper.update(); + + expect(wrapper.find(EuiDataGrid).prop('pagination')).not.toBeTruthy(); + + wrapper.setProps({ args: argsWithPagination }); + wrapper.update(); + + expect(wrapper.find(EuiDataGrid).prop('pagination')).toBeTruthy(); + + wrapper.setProps({ args: argsWithoutPagination }); + wrapper.update(); + + expect(wrapper.find(EuiDataGrid).prop('pagination')).not.toBeTruthy(); + }); + + it('dispatches event when page size changed', async () => { + const { data, args } = sampleArgs(); + + args.pageSize = 10; + + const wrapper = mount( + x as IFieldFormat} + dispatchEvent={onDispatchEvent} + getType={jest.fn()} + paletteService={chartPluginMock.createPaletteRegistry()} + uiSettings={{ get: jest.fn() } as unknown as IUiSettingsClient} + renderMode="edit" + /> + ); + + const paginationConfig = wrapper.find(EuiDataGrid).prop('pagination'); + expect(paginationConfig).toBeTruthy(); + + const sizeToChangeTo = 100; + paginationConfig?.onChangeItemsPerPage(sizeToChangeTo); + + expect(onDispatchEvent).toHaveBeenCalledTimes(1); + expect(onDispatchEvent).toHaveBeenCalledWith({ + name: 'edit', + data: { + action: LENS_EDIT_PAGESIZE_ACTION, + size: sizeToChangeTo, + }, + }); + }); + }); }); diff --git a/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.tsx b/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.tsx index f8a2bb1fabf81..6635ada9a4036 100644 --- a/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.tsx +++ b/x-pack/plugins/lens/public/datatable_visualization/components/table_basic.tsx @@ -7,7 +7,7 @@ import './table_basic.scss'; -import React, { useCallback, useMemo, useRef, useState, useContext } from 'react'; +import React, { useCallback, useMemo, useRef, useState, useContext, useEffect } from 'react'; import { i18n } from '@kbn/i18n'; import useDeepCompareEffect from 'react-use/lib/useDeepCompareEffect'; import { @@ -30,6 +30,7 @@ import type { LensSortAction, LensResizeAction, LensToggleAction, + LensPagesizeAction, } from './types'; import { createGridColumns } from './columns'; import { createGridCell } from './cell_value'; @@ -50,6 +51,9 @@ const gridStyle: EuiDataGridStyle = { header: 'underline', }; +export const DEFAULT_PAGE_SIZE = 10; +const PAGE_SIZE_OPTIONS = [DEFAULT_PAGE_SIZE, 20, 30, 50, 100]; + export const DatatableComponent = (props: DatatableRenderProps) => { const [firstTable] = Object.values(props.data.tables); @@ -60,6 +64,22 @@ export const DatatableComponent = (props: DatatableRenderProps) => { }); const [firstLocalTable, updateTable] = useState(firstTable); + // ** Pagination config + const [pagination, setPagination] = useState<{ pageIndex: number; pageSize: number } | undefined>( + undefined + ); + + useEffect(() => { + setPagination( + props.args.pageSize + ? { + pageIndex: 0, + pageSize: props.args.pageSize ?? DEFAULT_PAGE_SIZE, + } + : undefined + ); + }, [props.args.pageSize]); + useDeepCompareEffect(() => { setColumnConfig({ columns: props.args.columns, @@ -102,11 +122,35 @@ export const DatatableComponent = (props: DatatableRenderProps) => { ); const onEditAction = useCallback( - (data: LensSortAction['data'] | LensResizeAction['data'] | LensToggleAction['data']) => { + ( + data: + | LensSortAction['data'] + | LensResizeAction['data'] + | LensToggleAction['data'] + | LensPagesizeAction['data'] + ) => { dispatchEvent({ name: 'edit', data }); }, [dispatchEvent] ); + + const onChangeItemsPerPage = useCallback( + (pageSize) => onEditAction({ action: 'pagesize', size: pageSize }), + [onEditAction] + ); + + // active page isn't persisted, so we manage this state locally + const onChangePage = useCallback( + (pageIndex) => { + setPagination((_pagination) => { + if (_pagination) { + return { pageSize: _pagination?.pageSize, pageIndex }; + } + }); + }, + [setPagination] + ); + const onRowContextMenuClick = useCallback( (data: LensTableRowContextMenuEvent['data']) => { dispatchEvent({ name: 'tableRowContextMenuClick', data }); @@ -346,6 +390,15 @@ export const DatatableComponent = (props: DatatableRenderProps) => { }} > id).join('-') + '-' + pagination.pageSize, + } + : {}) + } aria-label={dataGridAriaLabel} data-test-subj="lnsDataTable" rowHeightsOptions={ @@ -362,6 +415,14 @@ export const DatatableComponent = (props: DatatableRenderProps) => { renderCellValue={renderCellValue} gridStyle={gridStyle} sorting={sorting} + pagination={ + pagination && { + ...pagination, + pageSizeOptions: PAGE_SIZE_OPTIONS, + onChangeItemsPerPage, + onChangePage, + } + } onColumnResize={onColumnResize} toolbarVisibility={false} renderFooterCellValue={renderSummaryRow} diff --git a/x-pack/plugins/lens/public/datatable_visualization/components/toolbar.test.tsx b/x-pack/plugins/lens/public/datatable_visualization/components/toolbar.test.tsx new file mode 100644 index 0000000000000..35e5c81cb72c4 --- /dev/null +++ b/x-pack/plugins/lens/public/datatable_visualization/components/toolbar.test.tsx @@ -0,0 +1,125 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { FormEvent } from 'react'; +import { mountWithIntl } from '@kbn/test/jest'; +import { DataTableToolbar } from './toolbar'; +import { DatatableVisualizationState } from '../visualization'; +import { FramePublicAPI, VisualizationToolbarProps } from '../../types'; +import { ToolbarButton } from 'src/plugins/kibana_react/public'; +import { ReactWrapper } from 'enzyme'; +import { PagingState } from '../../../common/expressions'; + +class Harness { + wrapper: ReactWrapper; + + constructor(wrapper: ReactWrapper) { + this.wrapper = wrapper; + } + + togglePopover() { + this.wrapper.find(ToolbarButton).simulate('click'); + } + + public get fitRowToContentSwitch() { + return this.wrapper.find('EuiSwitch[data-test-subj="lens-legend-auto-height-switch"]'); + } + + toggleFitRowToContent() { + this.fitRowToContentSwitch.prop('onChange')!({} as FormEvent); + } + + public get paginationSwitch() { + return this.wrapper.find('EuiSwitch[data-test-subj="lens-table-pagination-switch"]'); + } + + togglePagination() { + this.paginationSwitch.prop('onChange')!({} as FormEvent); + } +} + +describe('datatable toolbar', () => { + const defaultPagingState: PagingState = { + size: 10, + enabled: true, + }; + + let harness: Harness; + let defaultProps: VisualizationToolbarProps; + + beforeEach(() => { + defaultProps = { + setState: jest.fn(), + frame: {} as FramePublicAPI, + state: { + fitRowToContent: false, + } as DatatableVisualizationState, + }; + + harness = new Harness(mountWithIntl()); + }); + + it('should reflect state in the UI', async () => { + harness.togglePopover(); + + expect(harness.fitRowToContentSwitch.prop('checked')).toBe(false); + expect(harness.paginationSwitch.prop('checked')).toBe(false); + + harness.wrapper.setProps({ + state: { + fitRowToContent: true, + paging: defaultPagingState, + }, + }); + + expect(harness.fitRowToContentSwitch.prop('checked')).toBe(true); + expect(harness.paginationSwitch.prop('checked')).toBe(true); + }); + + it('should toggle fit-row-to-content', async () => { + harness.togglePopover(); + + harness.toggleFitRowToContent(); + + expect(defaultProps.setState).toHaveBeenCalledTimes(1); + expect(defaultProps.setState).toHaveBeenNthCalledWith(1, { + fitRowToContent: true, + }); + + harness.wrapper.setProps({ state: { fitRowToContent: true } }); // update state manually + harness.toggleFitRowToContent(); // turn it off + + expect(defaultProps.setState).toHaveBeenCalledTimes(2); + expect(defaultProps.setState).toHaveBeenNthCalledWith(2, { + fitRowToContent: false, + }); + }); + + it('should toggle table pagination', async () => { + harness.togglePopover(); + + harness.togglePagination(); + + expect(defaultProps.setState).toHaveBeenCalledTimes(1); + expect(defaultProps.setState).toHaveBeenNthCalledWith(1, { + paging: defaultPagingState, + fitRowToContent: false, + }); + + // update state manually + harness.wrapper.setProps({ + state: { fitRowToContent: false, paging: defaultPagingState }, + }); + harness.togglePagination(); // turn it off. this should disable pagination but preserve the default page size + + expect(defaultProps.setState).toHaveBeenCalledTimes(2); + expect(defaultProps.setState).toHaveBeenNthCalledWith(2, { + fitRowToContent: false, + paging: { ...defaultPagingState, enabled: false }, + }); + }); +}); diff --git a/x-pack/plugins/lens/public/datatable_visualization/components/toolbar.tsx b/x-pack/plugins/lens/public/datatable_visualization/components/toolbar.tsx index 8da980af64462..e95ae98e37563 100644 --- a/x-pack/plugins/lens/public/datatable_visualization/components/toolbar.tsx +++ b/x-pack/plugins/lens/public/datatable_visualization/components/toolbar.tsx @@ -7,15 +7,16 @@ import React, { useCallback } from 'react'; import { i18n } from '@kbn/i18n'; -import { EuiFlexGroup, EuiFormRow, EuiSwitch } from '@elastic/eui'; +import { EuiFlexGroup, EuiFormRow, EuiSwitch, EuiToolTip } from '@elastic/eui'; import { ToolbarPopover } from '../../shared_components'; import type { VisualizationToolbarProps } from '../../types'; import type { DatatableVisualizationState } from '../visualization'; +import { DEFAULT_PAGE_SIZE } from './table_basic'; export function DataTableToolbar(props: VisualizationToolbarProps) { const { state, setState } = props; - const onChange = useCallback(() => { + const onToggleFitRow = useCallback(() => { const current = state.fitRowToContent ?? false; setState({ ...state, @@ -23,6 +24,15 @@ export function DataTableToolbar(props: VisualizationToolbarProps { + const current = state.paging ?? { size: DEFAULT_PAGE_SIZE, enabled: false }; + + setState({ + ...state, + paging: { ...current, enabled: !current.enabled }, + }); + }, [setState, state]); + return ( + + + ); diff --git a/x-pack/plugins/lens/public/datatable_visualization/components/types.ts b/x-pack/plugins/lens/public/datatable_visualization/components/types.ts index f3d81c2d13340..e7be5b78545e8 100644 --- a/x-pack/plugins/lens/public/datatable_visualization/components/types.ts +++ b/x-pack/plugins/lens/public/datatable_visualization/components/types.ts @@ -10,7 +10,12 @@ import { CustomPaletteState, PaletteRegistry } from 'src/plugins/charts/public'; import type { IAggType } from 'src/plugins/data/public'; import type { Datatable, RenderMode } from 'src/plugins/expressions'; import type { ILensInterpreterRenderHandlers, LensEditEvent } from '../../types'; -import { LENS_EDIT_SORT_ACTION, LENS_EDIT_RESIZE_ACTION, LENS_TOGGLE_ACTION } from './constants'; +import { + LENS_EDIT_SORT_ACTION, + LENS_EDIT_RESIZE_ACTION, + LENS_TOGGLE_ACTION, + LENS_EDIT_PAGESIZE_ACTION, +} from './constants'; import type { FormatFactory } from '../../../common'; import type { DatatableProps, LensGridDirection } from '../../../common/expressions'; @@ -28,9 +33,14 @@ export interface LensToggleActionData { columnId: string; } +export interface LensPagesizeActionData { + size: number; +} + export type LensSortAction = LensEditEvent; export type LensResizeAction = LensEditEvent; export type LensToggleAction = LensEditEvent; +export type LensPagesizeAction = LensEditEvent; export type DatatableRenderProps = DatatableProps & { formatFactory: FormatFactory; diff --git a/x-pack/plugins/lens/public/datatable_visualization/expression.tsx b/x-pack/plugins/lens/public/datatable_visualization/expression.tsx index 03691d56ee56a..2417e395792e0 100644 --- a/x-pack/plugins/lens/public/datatable_visualization/expression.tsx +++ b/x-pack/plugins/lens/public/datatable_visualization/expression.tsx @@ -8,12 +8,13 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { i18n } from '@kbn/i18n'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import type { IAggType } from 'src/plugins/data/public'; import { PaletteRegistry } from 'src/plugins/charts/public'; -import { IUiSettingsClient } from 'kibana/public'; +import { IUiSettingsClient, ThemeServiceStart } from 'kibana/public'; import { ExpressionRenderDefinition } from 'src/plugins/expressions'; +import { KibanaThemeProvider } from '../../../../../src/plugins/kibana_react/public'; import { DatatableComponent } from './components/table_basic'; import type { ILensInterpreterRenderHandlers } from '../types'; @@ -25,6 +26,7 @@ export const getDatatableRenderer = (dependencies: { getType: Promise<(name: string) => IAggType>; paletteService: PaletteRegistry; uiSettings: IUiSettingsClient; + theme: ThemeServiceStart; }): ExpressionRenderDefinition => ({ name: 'lens_datatable_renderer', displayName: i18n.translate('xpack.lens.datatable.visualizationName', { @@ -69,18 +71,20 @@ export const getDatatableRenderer = (dependencies: { } ReactDOM.render( - - - , + + + + + , domNode, () => { handlers.done(); diff --git a/x-pack/plugins/lens/public/datatable_visualization/index.ts b/x-pack/plugins/lens/public/datatable_visualization/index.ts index 51f1f54cc03ce..5ab970e84d043 100644 --- a/x-pack/plugins/lens/public/datatable_visualization/index.ts +++ b/x-pack/plugins/lens/public/datatable_visualization/index.ts @@ -34,6 +34,7 @@ export class DatatableVisualization { expressions.registerRenderer(() => getDatatableRenderer({ formatFactory, + theme: core.theme, getType: core .getStartServices() .then(([_, { data: dataStart }]) => dataStart.search.aggs.types.get), @@ -42,7 +43,7 @@ export class DatatableVisualization { }) ); - return getDatatableVisualization({ paletteService: palettes }); + return getDatatableVisualization({ paletteService: palettes, theme: core.theme }); }); } } diff --git a/x-pack/plugins/lens/public/datatable_visualization/visualization.test.tsx b/x-pack/plugins/lens/public/datatable_visualization/visualization.test.tsx index 64d5a6f8f25a6..b3aabea46b874 100644 --- a/x-pack/plugins/lens/public/datatable_visualization/visualization.test.tsx +++ b/x-pack/plugins/lens/public/datatable_visualization/visualization.test.tsx @@ -7,7 +7,7 @@ import { Ast } from '@kbn/interpreter/common'; import { buildExpression } from '../../../../../src/plugins/expressions/public'; -import { createMockDatasource, createMockFramePublicAPI } from '../mocks'; +import { createMockDatasource, createMockFramePublicAPI, DatasourceMock } from '../mocks'; import { DatatableVisualizationState, getDatatableVisualization } from './visualization'; import { Operation, @@ -18,6 +18,7 @@ import { } from '../types'; import { chartPluginMock } from 'src/plugins/charts/public/mocks'; import { layerTypes } from '../../common'; +import { themeServiceMock } from '../../../../../src/core/public/mocks'; function mockFrame(): FramePublicAPI { return { @@ -28,6 +29,7 @@ function mockFrame(): FramePublicAPI { const datatableVisualization = getDatatableVisualization({ paletteService: chartPluginMock.createPaletteRegistry(), + theme: themeServiceMock.createStartContract(), }); describe('Datatable Visualization', () => { @@ -453,11 +455,29 @@ describe('Datatable Visualization', () => { }); describe('#toExpression', () => { - it('reorders the rendered colums based on the order from the datasource', () => { - const datasource = createMockDatasource('test'); - const frame = mockFrame(); - frame.datasourceLayers = { a: datasource.publicAPIMock }; + const getDatatableExpressionArgs = (state: DatatableVisualizationState) => + buildExpression( + datatableVisualization.toExpression(state, frame.datasourceLayers) as Ast + ).findFunction('lens_datatable')[0].arguments; + + const defaultExpressionTableState = { + layerId: 'a', + layerType: layerTypes.DATA, + columns: [{ columnId: 'b' }, { columnId: 'c' }], + }; + + let datasource: DatasourceMock; + let frame: FramePublicAPI; + + beforeEach(() => { + datasource = createMockDatasource('test'); datasource.publicAPIMock.getTableSpec.mockReturnValue([{ columnId: 'c' }, { columnId: 'b' }]); + + frame = mockFrame(); + frame.datasourceLayers = { a: datasource.publicAPIMock }; + }); + + it('reorders the rendered colums based on the order from the datasource', () => { datasource.publicAPIMock.getOperationForColumnId.mockReturnValue({ dataType: 'string', isBucketed: false, // <= make them metrics @@ -465,11 +485,7 @@ describe('Datatable Visualization', () => { }); const expression = datatableVisualization.toExpression( - { - layerId: 'a', - layerType: layerTypes.DATA, - columns: [{ columnId: 'b' }, { columnId: 'c' }], - }, + defaultExpressionTableState, frame.datasourceLayers ) as Ast; @@ -509,10 +525,6 @@ describe('Datatable Visualization', () => { }); it('returns no expression if the metric dimension is not defined', () => { - const datasource = createMockDatasource('test'); - const frame = mockFrame(); - frame.datasourceLayers = { a: datasource.publicAPIMock }; - datasource.publicAPIMock.getTableSpec.mockReturnValue([{ columnId: 'c' }, { columnId: 'b' }]); datasource.publicAPIMock.getOperationForColumnId.mockReturnValue({ dataType: 'string', isBucketed: true, // move it from the metric to the break down by side @@ -520,16 +532,46 @@ describe('Datatable Visualization', () => { }); const expression = datatableVisualization.toExpression( - { - layerId: 'a', - layerType: layerTypes.DATA, - columns: [{ columnId: 'b' }, { columnId: 'c' }], - }, + defaultExpressionTableState, frame.datasourceLayers ); expect(expression).toEqual(null); }); + + it('sets pagination based on state', () => { + expect(getDatatableExpressionArgs({ ...defaultExpressionTableState }).pageSize).toEqual([]); + + expect( + getDatatableExpressionArgs({ + ...defaultExpressionTableState, + paging: { size: 20, enabled: false }, + }).pageSize + ).toEqual([]); + + expect( + getDatatableExpressionArgs({ + ...defaultExpressionTableState, + paging: { size: 20, enabled: true }, + }).pageSize + ).toEqual([20]); + }); + + it('sets fitRowToContent based on state', () => { + expect( + getDatatableExpressionArgs({ ...defaultExpressionTableState }).fitRowToContent + ).toEqual([false]); + + expect( + getDatatableExpressionArgs({ ...defaultExpressionTableState, fitRowToContent: false }) + .fitRowToContent + ).toEqual([false]); + + expect( + getDatatableExpressionArgs({ ...defaultExpressionTableState, fitRowToContent: true }) + .fitRowToContent + ).toEqual([true]); + }); }); describe('#getErrorMessages', () => { @@ -628,5 +670,23 @@ describe('Datatable Visualization', () => { columns: [{ columnId: 'saved', width: undefined }], }); }); + + it('should update page size', () => { + const currentState: DatatableVisualizationState = { + layerId: 'foo', + layerType: layerTypes.DATA, + columns: [{ columnId: 'saved', width: 5000 }], + paging: { enabled: true, size: 10 }, + }; + expect( + datatableVisualization.onEditAction!(currentState, { + name: 'edit', + data: { action: 'pagesize', size: 30 }, + }) + ).toEqual({ + ...currentState, + paging: { enabled: true, size: 30 }, + }); + }); }); }); diff --git a/x-pack/plugins/lens/public/datatable_visualization/visualization.tsx b/x-pack/plugins/lens/public/datatable_visualization/visualization.tsx index a953da4c380f0..139d85b51cee7 100644 --- a/x-pack/plugins/lens/public/datatable_visualization/visualization.tsx +++ b/x-pack/plugins/lens/public/datatable_visualization/visualization.tsx @@ -8,9 +8,11 @@ import React from 'react'; import { render } from 'react-dom'; import { Ast } from '@kbn/interpreter/common'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import type { PaletteRegistry } from 'src/plugins/charts/public'; +import { ThemeServiceStart } from 'kibana/public'; +import { KibanaThemeProvider } from '../../../../../src/plugins/kibana_react/public'; import type { SuggestionRequest, Visualization, @@ -22,7 +24,7 @@ import { TableDimensionEditor } from './components/dimension_editor'; import { CUSTOM_PALETTE } from '../shared_components/coloring/constants'; import { getStopsForFixedMode } from '../shared_components'; import { LayerType, layerTypes } from '../../common'; -import { getDefaultSummaryLabel } from '../../common/expressions'; +import { getDefaultSummaryLabel, PagingState } from '../../common/expressions'; import type { ColumnState, SortingState } from '../../common/expressions'; import { DataTableToolbar } from './components/toolbar'; export interface DatatableVisualizationState { @@ -31,6 +33,7 @@ export interface DatatableVisualizationState { layerType: LayerType; sorting?: SortingState; fitRowToContent?: boolean; + paging?: PagingState; } const visualizationLabel = i18n.translate('xpack.lens.datatable.label', { @@ -39,8 +42,10 @@ const visualizationLabel = i18n.translate('xpack.lens.datatable.label', { export const getDatatableVisualization = ({ paletteService, + theme, }: { paletteService: PaletteRegistry; + theme: ThemeServiceStart; }): Visualization => ({ id: 'lnsDatatable', @@ -294,9 +299,11 @@ export const getDatatableVisualization = ({ }, renderDimensionEditor(domElement, props) { render( - - - , + + + + + , domElement ); }, @@ -391,6 +398,7 @@ export const getDatatableVisualization = ({ sortingColumnId: [state.sorting?.columnId || ''], sortingDirection: [state.sorting?.direction || 'none'], fitRowToContent: [state.fitRowToContent ?? false], + pageSize: state.paging?.enabled ? [state.paging.size] : [], }, }, ], @@ -403,9 +411,11 @@ export const getDatatableVisualization = ({ renderToolbar(domElement, props) { render( - - - , + + + + + , domElement ); }, @@ -421,10 +431,11 @@ export const getDatatableVisualization = ({ }, }; case 'toggle': + const toggleColumnId = event.data.columnId; return { ...state, columns: state.columns.map((column) => { - if (column.columnId === event.data.columnId) { + if (column.columnId === toggleColumnId) { return { ...column, hidden: !column.hidden, @@ -436,10 +447,11 @@ export const getDatatableVisualization = ({ }; case 'resize': const targetWidth = event.data.width; + const resizeColumnId = event.data.columnId; return { ...state, columns: state.columns.map((column) => { - if (column.columnId === event.data.columnId) { + if (column.columnId === resizeColumnId) { return { ...column, width: targetWidth, @@ -449,6 +461,14 @@ export const getDatatableVisualization = ({ } }), }; + case 'pagesize': + return { + ...state, + paging: { + enabled: state.paging?.enabled || false, + size: event.data.size, + }, + }; default: return state; } diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/buttons/empty_dimension_button.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/buttons/empty_dimension_button.tsx index be09d6d3a4957..ac79a78ff7d6d 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/buttons/empty_dimension_button.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/buttons/empty_dimension_button.tsx @@ -7,7 +7,7 @@ import React, { useMemo, useState, useEffect, useContext } from 'react'; import { EuiButtonEmpty } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { generateId } from '../../../../id_generator'; import { DragDrop, DragDropIdentifier, DragContext } from '../../../../drag_drop'; diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.test.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.test.tsx index 92633d5e7305b..a6be4acfbbcf1 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.test.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.test.tsx @@ -225,7 +225,39 @@ describe('LayerPanel', () => { const group = instance .find(EuiFormRow) - .findWhere((e) => e.prop('error') === 'Required dimension'); + .findWhere((e) => e.prop('error') === 'Requires field'); + + expect(group).toHaveLength(1); + }); + + it('should render the required warning when only one group is configured (with requiredMinDimensionCount)', async () => { + mockVisualization.getConfiguration.mockReturnValue({ + groups: [ + { + groupLabel: 'A', + groupId: 'a', + accessors: [{ columnId: 'x' }], + filterOperations: () => true, + supportsMoreColumns: false, + dataTestSubj: 'lnsGroup', + }, + { + groupLabel: 'B', + groupId: 'b', + accessors: [{ columnId: 'y' }], + filterOperations: () => true, + supportsMoreColumns: true, + dataTestSubj: 'lnsGroup', + requiredMinDimensionCount: 2, + }, + ], + }); + + const { instance } = await mountWithProvider(); + + const group = instance + .find(EuiFormRow) + .findWhere((e) => e.prop('error') === 'Requires 2 fields'); expect(group).toHaveLength(1); }); diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.tsx index 6af3d88b17d41..84c7722ca1b88 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.tsx @@ -385,7 +385,27 @@ export function LayerPanel( {groups.map((group, groupIndex) => { - const isMissing = !isEmptyLayer && group.required && group.accessors.length === 0; + let isMissing = false; + + if (!isEmptyLayer) { + if (group.requiredMinDimensionCount) { + isMissing = group.accessors.length < group.requiredMinDimensionCount; + } else if (group.required) { + isMissing = group.accessors.length === 0; + } + } + + const isMissingError = group.requiredMinDimensionCount + ? i18n.translate('xpack.lens.editorFrame.requiresTwoOrMoreFieldsWarningLabel', { + defaultMessage: 'Requires {requiredMinDimensionCount} fields', + values: { + requiredMinDimensionCount: group.requiredMinDimensionCount, + }, + }) + : i18n.translate('xpack.lens.editorFrame.requiresFieldWarningLabel', { + defaultMessage: 'Requires field', + }); + const isOptional = !group.required; return ( <> {group.accessors.length ? ( diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_panel.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_panel.tsx index 2f5ca01774ba1..7a74e0c9cc5aa 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_panel.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_panel.tsx @@ -9,7 +9,7 @@ import './suggestion_panel.scss'; import { camelCase, pick } from 'lodash'; import React, { useState, useEffect, useMemo, useRef, useCallback } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import useLocalStorage from 'react-use/lib/useLocalStorage'; import { EuiIcon, diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/chart_switch.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/chart_switch.tsx index 250359822e068..fe054edfb2917 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/chart_switch.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/chart_switch.tsx @@ -19,7 +19,7 @@ import { EuiBadge, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Visualization, FramePublicAPI, diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/geo_field_workspace_panel.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/geo_field_workspace_panel.tsx index b50b6463c5a25..0d523747c5901 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/geo_field_workspace_panel.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/geo_field_workspace_panel.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiPageContentBody, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { UiActionsStart, diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx index 4b98b2842a01b..b8885e53d5e42 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx @@ -7,7 +7,7 @@ import React, { useState, useEffect, useMemo, useContext, useCallback } from 'react'; import classNames from 'classnames'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { toExpression } from '@kbn/interpreter/common'; import { i18n } from '@kbn/i18n'; import { diff --git a/x-pack/plugins/lens/public/embeddable/embeddable.test.tsx b/x-pack/plugins/lens/public/embeddable/embeddable.test.tsx index 59d6325e1c0ce..4300b67856d8a 100644 --- a/x-pack/plugins/lens/public/embeddable/embeddable.test.tsx +++ b/x-pack/plugins/lens/public/embeddable/embeddable.test.tsx @@ -18,7 +18,7 @@ import { Query, TimeRange, Filter, IndexPatternsContract } from 'src/plugins/dat import { Document } from '../persistence'; import { dataPluginMock } from '../../../../../src/plugins/data/public/mocks'; import { VIS_EVENT_TO_TRIGGER } from '../../../../../src/plugins/visualizations/public/embeddable'; -import { coreMock, httpServiceMock } from '../../../../../src/core/public/mocks'; +import { coreMock, httpServiceMock, themeServiceMock } from '../../../../../src/core/public/mocks'; import { IBasePath } from '../../../../../src/core/public'; import { AttributeService, ViewMode } from '../../../../../src/plugins/embeddable/public'; import { LensAttributeService } from '../lens_attribute_service'; @@ -126,6 +126,7 @@ describe('embeddable', () => { }, inspector: inspectorPluginMock.createStartContract(), getTrigger, + theme: themeServiceMock.createStartContract(), visualizationMap: {}, documentToExpression: () => Promise.resolve({ @@ -168,6 +169,7 @@ describe('embeddable', () => { capabilities: { canSaveDashboards: true, canSaveVisualizations: true }, getTrigger, visualizationMap: {}, + theme: themeServiceMock.createStartContract(), documentToExpression: () => Promise.resolve({ ast: { @@ -213,6 +215,7 @@ describe('embeddable', () => { }, getTrigger, visualizationMap: {}, + theme: themeServiceMock.createStartContract(), documentToExpression: () => Promise.resolve({ ast: { @@ -260,6 +263,7 @@ describe('embeddable', () => { }, getTrigger, visualizationMap: {}, + theme: themeServiceMock.createStartContract(), documentToExpression: () => Promise.resolve({ ast: { @@ -303,6 +307,7 @@ describe('embeddable', () => { }, getTrigger, visualizationMap: {}, + theme: themeServiceMock.createStartContract(), documentToExpression: () => Promise.resolve({ ast: { @@ -343,6 +348,7 @@ describe('embeddable', () => { }, getTrigger, visualizationMap: {}, + theme: themeServiceMock.createStartContract(), documentToExpression: () => Promise.resolve({ ast: { @@ -386,6 +392,7 @@ describe('embeddable', () => { capabilities: { canSaveDashboards: true, canSaveVisualizations: true }, getTrigger, visualizationMap: {}, + theme: themeServiceMock.createStartContract(), documentToExpression: () => Promise.resolve({ ast: { @@ -436,6 +443,7 @@ describe('embeddable', () => { }, getTrigger, visualizationMap: {}, + theme: themeServiceMock.createStartContract(), documentToExpression: () => Promise.resolve({ ast: { @@ -484,6 +492,7 @@ describe('embeddable', () => { }, getTrigger, visualizationMap: {}, + theme: themeServiceMock.createStartContract(), documentToExpression: () => Promise.resolve({ ast: { @@ -539,6 +548,7 @@ describe('embeddable', () => { }, getTrigger, visualizationMap: {}, + theme: themeServiceMock.createStartContract(), documentToExpression: () => Promise.resolve({ ast: { @@ -595,6 +605,7 @@ describe('embeddable', () => { }, getTrigger, visualizationMap: {}, + theme: themeServiceMock.createStartContract(), documentToExpression: () => Promise.resolve({ ast: { @@ -654,6 +665,7 @@ describe('embeddable', () => { }, getTrigger, visualizationMap: {}, + theme: themeServiceMock.createStartContract(), documentToExpression: () => Promise.resolve({ ast: { @@ -697,6 +709,7 @@ describe('embeddable', () => { }, getTrigger, visualizationMap: {}, + theme: themeServiceMock.createStartContract(), documentToExpression: () => Promise.resolve({ ast: { @@ -740,6 +753,7 @@ describe('embeddable', () => { }, getTrigger, visualizationMap: {}, + theme: themeServiceMock.createStartContract(), documentToExpression: () => Promise.resolve({ ast: { @@ -783,6 +797,7 @@ describe('embeddable', () => { }, getTrigger, visualizationMap: {}, + theme: themeServiceMock.createStartContract(), documentToExpression: () => Promise.resolve({ ast: { @@ -841,6 +856,7 @@ describe('embeddable', () => { }, getTrigger, visualizationMap: {}, + theme: themeServiceMock.createStartContract(), documentToExpression: () => Promise.resolve({ ast: { @@ -915,6 +931,7 @@ describe('embeddable', () => { }, getTrigger, visualizationMap: {}, + theme: themeServiceMock.createStartContract(), documentToExpression: () => Promise.resolve({ ast: { @@ -964,6 +981,7 @@ describe('embeddable', () => { }, getTrigger, visualizationMap: {}, + theme: themeServiceMock.createStartContract(), documentToExpression: () => Promise.resolve({ ast: { @@ -1013,6 +1031,7 @@ describe('embeddable', () => { }, getTrigger, visualizationMap: {}, + theme: themeServiceMock.createStartContract(), documentToExpression: () => Promise.resolve({ ast: { @@ -1082,6 +1101,7 @@ describe('embeddable', () => { canSaveVisualizations: true, }, getTrigger, + theme: themeServiceMock.createStartContract(), visualizationMap: { [visDocument.visualizationType as string]: { onEditAction: onEditActionMock, diff --git a/x-pack/plugins/lens/public/embeddable/embeddable.tsx b/x-pack/plugins/lens/public/embeddable/embeddable.tsx index 2960e74efe97f..da4a97049a519 100644 --- a/x-pack/plugins/lens/public/embeddable/embeddable.tsx +++ b/x-pack/plugins/lens/public/embeddable/embeddable.tsx @@ -27,6 +27,7 @@ import { map, distinctUntilChanged, skip } from 'rxjs/operators'; import fastIsEqual from 'fast-deep-equal'; import { UsageCollectionSetup } from 'src/plugins/usage_collection/public'; import { METRIC_TYPE } from '@kbn/analytics'; +import { KibanaThemeProvider } from '../../../../../src/plugins/kibana_react/public'; import { ExpressionRendererEvent, ReactExpressionRendererType, @@ -58,7 +59,7 @@ import { import { IndexPatternsContract } from '../../../../../src/plugins/data/public'; import { getEditPath, DOC_TYPE, PLUGIN_ID } from '../../common'; -import { IBasePath } from '../../../../../src/core/public'; +import { IBasePath, ThemeServiceStart } from '../../../../../src/core/public'; import { LensAttributeService } from '../lens_attribute_service'; import type { ErrorMessage } from '../editor_frame_service/types'; import { getLensInspectorService, LensInspector } from '../lens_inspector_service'; @@ -111,6 +112,7 @@ export interface LensEmbeddableDeps { capabilities: { canSaveVisualizations: boolean; canSaveDashboards: boolean }; usageCollection?: UsageCollectionSetup; spaces?: SpacesPluginStart; + theme: ThemeServiceStart; } const getExpressionFromDocument = async ( @@ -399,29 +401,31 @@ export class Embeddable const input = this.getInput(); render( - { - this.logError('runtime'); - }} - />, + + { + this.logError('runtime'); + }} + /> + , domNode ); } diff --git a/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts b/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts index 811f391e32f9a..63b07affcb9ed 100644 --- a/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts +++ b/x-pack/plugins/lens/public/embeddable/embeddable_factory.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { Capabilities, HttpSetup } from 'kibana/public'; +import type { Capabilities, HttpSetup, ThemeServiceStart } from 'kibana/public'; import { i18n } from '@kbn/i18n'; import { RecursiveReadonly } from '@kbn/utility-types'; import { Ast } from '@kbn/interpreter/common'; @@ -42,6 +42,7 @@ export interface LensEmbeddableStartServices { ) => Promise<{ ast: Ast | null; errors: ErrorMessage[] | undefined }>; visualizationMap: VisualizationMap; spaces?: SpacesPluginStart; + theme: ThemeServiceStart; } export class EmbeddableFactory implements EmbeddableFactoryDefinition { @@ -94,6 +95,7 @@ export class EmbeddableFactory implements EmbeddableFactoryDefinition { indexPatternService, capabilities, usageCollection, + theme, inspector, spaces, } = await this.getStartServices(); @@ -117,6 +119,7 @@ export class EmbeddableFactory implements EmbeddableFactoryDefinition { canSaveVisualizations: Boolean(capabilities.visualize.save), }, usageCollection, + theme, spaces, }, input, diff --git a/x-pack/plugins/lens/public/embeddable/expression_wrapper.tsx b/x-pack/plugins/lens/public/embeddable/expression_wrapper.tsx index 4c57bf7e7a53a..b93f2a3280ebc 100644 --- a/x-pack/plugins/lens/public/embeddable/expression_wrapper.tsx +++ b/x-pack/plugins/lens/public/embeddable/expression_wrapper.tsx @@ -6,8 +6,8 @@ */ import React from 'react'; -import { I18nProvider } from '@kbn/i18n/react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, EuiText, EuiIcon, EuiEmptyPrompt } from '@elastic/eui'; import { ExpressionRendererEvent, diff --git a/x-pack/plugins/lens/public/heatmap_visualization/expression.tsx b/x-pack/plugins/lens/public/heatmap_visualization/expression.tsx index 84c8f987f524d..20147c44b0966 100644 --- a/x-pack/plugins/lens/public/heatmap_visualization/expression.tsx +++ b/x-pack/plugins/lens/public/heatmap_visualization/expression.tsx @@ -6,9 +6,11 @@ */ import { i18n } from '@kbn/i18n'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import ReactDOM from 'react-dom'; import React from 'react'; +import { ThemeServiceStart } from 'kibana/public'; +import { KibanaThemeProvider } from '../../../../../src/plugins/kibana_react/public'; import type { IInterpreterRenderHandlers } from '../../../../../src/plugins/expressions'; import type { LensBrushEvent, LensFilterEvent } from '../types'; import type { FormatFactory } from '../../common'; @@ -22,6 +24,7 @@ export const getHeatmapRenderer = (dependencies: { chartsThemeService: ChartsPluginSetup['theme']; paletteService: PaletteRegistry; timeZone: string; + kibanaTheme: ThemeServiceStart; }) => ({ name: LENS_HEATMAP_RENDERER, displayName: i18n.translate('xpack.lens.heatmap.visualizationName', { @@ -43,19 +46,21 @@ export const getHeatmapRenderer = (dependencies: { }; ReactDOM.render( - - { - - } - , + + + { + + } + + , domNode, () => { handlers.done(); diff --git a/x-pack/plugins/lens/public/heatmap_visualization/index.ts b/x-pack/plugins/lens/public/heatmap_visualization/index.ts index 3ac3f769e4b5f..b2722c88b2a64 100644 --- a/x-pack/plugins/lens/public/heatmap_visualization/index.ts +++ b/x-pack/plugins/lens/public/heatmap_visualization/index.ts @@ -35,9 +35,10 @@ export class HeatmapVisualization { chartsThemeService: charts.theme, paletteService: palettes, timeZone, + kibanaTheme: core.theme, }) ); - return getHeatmapVisualization({ paletteService: palettes }); + return getHeatmapVisualization({ paletteService: palettes, theme: core.theme }); }); } } diff --git a/x-pack/plugins/lens/public/heatmap_visualization/visualization.test.ts b/x-pack/plugins/lens/public/heatmap_visualization/visualization.test.ts index 91b90e11470fc..653254afb32bf 100644 --- a/x-pack/plugins/lens/public/heatmap_visualization/visualization.test.ts +++ b/x-pack/plugins/lens/public/heatmap_visualization/visualization.test.ts @@ -23,6 +23,7 @@ import type { HeatmapVisualizationState } from './types'; import type { DatasourcePublicAPI, Operation } from '../types'; import { chartPluginMock } from 'src/plugins/charts/public/mocks'; import { layerTypes } from '../../common'; +import { themeServiceMock } from '../../../../../src/core/public/mocks'; function exampleState(): HeatmapVisualizationState { return { @@ -46,6 +47,7 @@ function exampleState(): HeatmapVisualizationState { } const paletteService = chartPluginMock.createPaletteRegistry(); +const theme = themeServiceMock.createStartContract(); describe('heatmap', () => { let frame: ReturnType; @@ -56,7 +58,7 @@ describe('heatmap', () => { describe('#intialize', () => { test('returns a default state', () => { - expect(getHeatmapVisualization({ paletteService }).initialize(() => 'l1')).toEqual({ + expect(getHeatmapVisualization({ paletteService, theme }).initialize(() => 'l1')).toEqual({ layerId: 'l1', layerType: layerTypes.DATA, title: 'Empty Heatmap chart', @@ -79,7 +81,10 @@ describe('heatmap', () => { test('returns persisted state', () => { expect( - getHeatmapVisualization({ paletteService }).initialize(() => 'test-layer', exampleState()) + getHeatmapVisualization({ paletteService, theme }).initialize( + () => 'test-layer', + exampleState() + ) ).toEqual(exampleState()); }); }); @@ -117,6 +122,7 @@ describe('heatmap', () => { expect( getHeatmapVisualization({ paletteService, + theme, }).getConfiguration({ state, frame, layerId: 'first' }) ).toEqual({ groups: [ @@ -174,6 +180,7 @@ describe('heatmap', () => { expect( getHeatmapVisualization({ paletteService, + theme, }).getConfiguration({ state, frame, layerId: 'first' }) ).toEqual({ groups: [ @@ -226,6 +233,7 @@ describe('heatmap', () => { expect( getHeatmapVisualization({ paletteService, + theme, }).getConfiguration({ state, frame, layerId: 'first' }) ).toEqual({ groups: [ @@ -280,6 +288,7 @@ describe('heatmap', () => { expect( getHeatmapVisualization({ paletteService, + theme, }).setDimension({ prevState, layerId: 'first', @@ -304,6 +313,7 @@ describe('heatmap', () => { expect( getHeatmapVisualization({ paletteService, + theme, }).removeDimension({ prevState, layerId: 'first', @@ -322,6 +332,7 @@ describe('heatmap', () => { expect( getHeatmapVisualization({ paletteService, + theme, }).getSupportedLayers() ).toHaveLength(1); }); @@ -336,6 +347,7 @@ describe('heatmap', () => { }; const instance = getHeatmapVisualization({ paletteService, + theme, }); expect(instance.getLayerType('test-layer', state)).toEqual(layerTypes.DATA); expect(instance.getLayerType('foo', state)).toBeUndefined(); @@ -372,6 +384,7 @@ describe('heatmap', () => { expect( getHeatmapVisualization({ paletteService, + theme, }).toExpression(state, datasourceLayers, attributes) ).toEqual({ type: 'expression', @@ -459,6 +472,7 @@ describe('heatmap', () => { expect( getHeatmapVisualization({ paletteService, + theme, }).toExpression(state, datasourceLayers, attributes) ).toEqual(null); }); @@ -490,6 +504,7 @@ describe('heatmap', () => { expect( getHeatmapVisualization({ paletteService, + theme, }).toPreviewExpression!(state, datasourceLayers) ).toEqual({ type: 'expression', @@ -568,6 +583,7 @@ describe('heatmap', () => { expect( getHeatmapVisualization({ paletteService, + theme, }).getErrorMessages(mockState) ).toEqual(undefined); }); @@ -580,6 +596,7 @@ describe('heatmap', () => { expect( getHeatmapVisualization({ paletteService, + theme, }).getErrorMessages(mockState) ).toEqual([ { @@ -612,6 +629,7 @@ describe('heatmap', () => { expect( getHeatmapVisualization({ paletteService, + theme, }).getWarningMessages!(mockState, frame) ).toEqual(undefined); }); @@ -632,6 +650,7 @@ describe('heatmap', () => { expect( getHeatmapVisualization({ paletteService, + theme, }).getWarningMessages!(mockState, frame) ).toEqual(undefined); }); @@ -657,6 +676,7 @@ describe('heatmap', () => { expect( getHeatmapVisualization({ paletteService, + theme, }).getWarningMessages!(mockState, frame) ).toHaveLength(1); }); diff --git a/x-pack/plugins/lens/public/heatmap_visualization/visualization.tsx b/x-pack/plugins/lens/public/heatmap_visualization/visualization.tsx index aa053d4aea06d..626c9975141c4 100644 --- a/x-pack/plugins/lens/public/heatmap_visualization/visualization.tsx +++ b/x-pack/plugins/lens/public/heatmap_visualization/visualization.tsx @@ -8,9 +8,11 @@ import React from 'react'; import { render } from 'react-dom'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage, I18nProvider } from '@kbn/i18n/react'; +import { FormattedMessage, I18nProvider } from '@kbn/i18n-react'; import { Ast } from '@kbn/interpreter/common'; import { Position } from '@elastic/charts'; +import { ThemeServiceStart } from 'kibana/public'; +import { KibanaThemeProvider } from '../../../../../src/plugins/kibana_react/public'; import { PaletteRegistry } from '../../../../../src/plugins/charts/public'; import type { OperationMetadata, Visualization } from '../types'; import type { HeatmapVisualizationState } from './types'; @@ -39,6 +41,7 @@ const groupLabelForHeatmap = i18n.translate('xpack.lens.heatmapVisualization.hea interface HeatmapVisualizationDeps { paletteService: PaletteRegistry; + theme: ThemeServiceStart; } function getAxisName(axis: 'x' | 'y') { @@ -95,6 +98,7 @@ function computePaletteParams(params: CustomPaletteParams) { export const getHeatmapVisualization = ({ paletteService, + theme, }: HeatmapVisualizationDeps): Visualization => ({ id: LENS_HEATMAP_ID, @@ -258,18 +262,22 @@ export const getHeatmapVisualization = ({ renderDimensionEditor(domElement, props) { render( - - - , + + + + + , domElement ); }, renderToolbar(domElement, props) { render( - - - , + + + + + , domElement ); }, diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.test.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.test.tsx index 6fe61d3e3c29a..27d03a1e3edc8 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.test.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.test.tsx @@ -23,7 +23,7 @@ import { EuiProgress, EuiLoadingSpinner } from '@elastic/eui'; import { documentField } from './document_field'; import { chartPluginMock } from '../../../../../src/plugins/charts/public/mocks'; import { fieldFormatsServiceMock } from '../../../../../src/plugins/field_formats/public/mocks'; -import { indexPatternFieldEditorPluginMock } from '../../../../../src/plugins/index_pattern_field_editor/public/mocks'; +import { indexPatternFieldEditorPluginMock } from '../../../../../src/plugins/data_view_field_editor/public/mocks'; import { getFieldByNameFactory } from './pure_helpers'; import { uiActionsPluginMock } from '../../../../../src/plugins/ui_actions/public/mocks'; import { TermsIndexPatternColumn } from './operations'; @@ -876,7 +876,7 @@ describe('IndexPattern Data Panel', () => { expect(props.indexPatternFieldEditor.openEditor).toHaveBeenCalledWith( expect.objectContaining({ ctx: expect.objectContaining({ - indexPattern: mockIndexPattern, + dataView: mockIndexPattern, }), }) ); diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx index f48e704846133..f772509619273 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/datapanel.tsx @@ -24,7 +24,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import type { EsQueryConfig, Query, Filter } from '@kbn/es-query'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { CoreStart } from 'kibana/public'; import type { DataPublicPluginStart } from 'src/plugins/data/public'; import type { FieldFormatsStart } from 'src/plugins/field_formats/public'; @@ -42,7 +42,7 @@ import { loadIndexPatterns, syncExistingFields } from './loader'; import { fieldExists } from './pure_helpers'; import { Loader } from '../loader'; import { esQuery } from '../../../../../src/plugins/data/public'; -import { IndexPatternFieldEditorStart } from '../../../../../src/plugins/index_pattern_field_editor/public'; +import { IndexPatternFieldEditorStart } from '../../../../../src/plugins/data_view_field_editor/public'; import { VISUALIZE_GEO_FIELD_TRIGGER } from '../../../../../src/plugins/ui_actions/public'; export type Props = Omit, 'core'> & { @@ -522,7 +522,7 @@ export const InnerIndexPatternDataPanel = function InnerIndexPatternDataPanel({ const indexPatternInstance = await data.indexPatterns.get(currentIndexPattern.id); closeFieldEditor.current = indexPatternFieldEditor.openEditor({ ctx: { - indexPattern: indexPatternInstance, + dataView: indexPatternInstance, }, fieldName, onSave: async () => { @@ -543,7 +543,7 @@ export const InnerIndexPatternDataPanel = function InnerIndexPatternDataPanel({ const indexPatternInstance = await data.indexPatterns.get(currentIndexPattern.id); closeFieldEditor.current = indexPatternFieldEditor.openDeleteModal({ ctx: { - indexPattern: indexPatternInstance, + dataView: indexPatternInstance, }, fieldName, onDelete: async () => { diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/index.ts b/x-pack/plugins/lens/public/indexpattern_datasource/index.ts index 5ec90d84f6c4d..386cd7a58ae01 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/index.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/index.ts @@ -9,7 +9,7 @@ import type { CoreSetup } from 'kibana/public'; import { createStartServicesGetter, Storage } from '../../../../../src/plugins/kibana_utils/public'; import type { ExpressionsSetup } from '../../../../../src/plugins/expressions/public'; import type { ChartsPluginSetup } from '../../../../../src/plugins/charts/public'; -import type { IndexPatternFieldEditorStart } from '../../../../../src/plugins/index_pattern_field_editor/public'; +import type { IndexPatternFieldEditorStart } from '../../../../../src/plugins/data_view_field_editor/public'; import type { DataPublicPluginSetup, DataPublicPluginStart, @@ -32,7 +32,7 @@ export interface IndexPatternDatasourceSetupPlugins { export interface IndexPatternDatasourceStartPlugins { data: DataPublicPluginStart; fieldFormats: FieldFormatsStart; - indexPatternFieldEditor: IndexPatternFieldEditorStart; + dataViewFieldEditor: IndexPatternFieldEditorStart; uiActions: UiActionsStart; } @@ -60,7 +60,7 @@ export class IndexPatternDatasource { fieldFormatsSetup.register([suffixFormatter]); } - const [coreStart, { indexPatternFieldEditor, uiActions, data, fieldFormats }] = + const [coreStart, { dataViewFieldEditor, uiActions, data, fieldFormats }] = await core.getStartServices(); return getIndexPatternDatasource({ @@ -69,7 +69,7 @@ export class IndexPatternDatasource { storage: new Storage(localStorage), data, charts, - indexPatternFieldEditor, + dataViewFieldEditor, uiActions, }); }); diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.test.ts b/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.test.ts index e6b9eccbc7da1..da5e39c907d07 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.test.ts +++ b/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.test.ts @@ -26,7 +26,7 @@ import { FormulaIndexPatternColumn, } from './operations'; import { createMockedFullReference } from './operations/mocks'; -import { indexPatternFieldEditorPluginMock } from 'src/plugins/index_pattern_field_editor/public/mocks'; +import { indexPatternFieldEditorPluginMock } from 'src/plugins/data_view_field_editor/public/mocks'; import { uiActionsPluginMock } from '../../../../../src/plugins/ui_actions/public/mocks'; import { fieldFormatsServiceMock } from '../../../../../src/plugins/field_formats/public/mocks'; import { TinymathAST } from 'packages/kbn-tinymath'; @@ -185,7 +185,7 @@ describe('IndexPattern Data Source', () => { data: dataPluginMock.createStartContract(), fieldFormats: fieldFormatsServiceMock.createStartContract(), charts: chartPluginMock.createSetupContract(), - indexPatternFieldEditor: indexPatternFieldEditorPluginMock.createStartContract(), + dataViewFieldEditor: indexPatternFieldEditorPluginMock.createStartContract(), uiActions: uiActionsPluginMock.createStartContract(), }); diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.tsx index fc9e2c7ed44a8..402371930b93e 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.tsx @@ -7,12 +7,12 @@ import React from 'react'; import { render } from 'react-dom'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import type { CoreStart, SavedObjectReference } from 'kibana/public'; import { i18n } from '@kbn/i18n'; import type { IStorageWrapper } from 'src/plugins/kibana_utils/public'; import type { FieldFormatsStart } from 'src/plugins/field_formats/public'; -import type { IndexPatternFieldEditorStart } from '../../../../../src/plugins/index_pattern_field_editor/public'; +import type { IndexPatternFieldEditorStart } from '../../../../../src/plugins/data_view_field_editor/public'; import type { DatasourceDimensionEditorProps, DatasourceDimensionTriggerProps, @@ -46,7 +46,10 @@ import { isColumnInvalid, isDraggedField, normalizeOperationDataType } from './u import { LayerPanel } from './layerpanel'; import { GenericIndexPatternColumn, getErrorMessages, insertNewColumn } from './operations'; import { IndexPatternField, IndexPatternPrivateState, IndexPatternPersistedState } from './types'; -import { KibanaContextProvider } from '../../../../../src/plugins/kibana_react/public'; +import { + KibanaContextProvider, + KibanaThemeProvider, +} from '../../../../../src/plugins/kibana_react/public'; import { DataPublicPluginStart } from '../../../../../src/plugins/data/public'; import { VisualizeFieldContext } from '../../../../../src/plugins/ui_actions/public'; import { mergeLayer } from './state_helpers'; @@ -88,7 +91,7 @@ export function getIndexPatternDatasource({ data, fieldFormats, charts, - indexPatternFieldEditor, + dataViewFieldEditor, uiActions, }: { core: CoreStart; @@ -96,7 +99,7 @@ export function getIndexPatternDatasource({ data: DataPublicPluginStart; fieldFormats: FieldFormatsStart; charts: ChartsPluginSetup; - indexPatternFieldEditor: IndexPatternFieldEditorStart; + dataViewFieldEditor: IndexPatternFieldEditorStart; uiActions: UiActionsStart; }) { const uiSettings = core.uiSettings; @@ -224,18 +227,20 @@ export function getIndexPatternDatasource({ props: DatasourceDataPanelProps ) { render( - - - , + + + + + , domElement ); }, @@ -285,21 +290,26 @@ export function getIndexPatternDatasource({ const columnLabelMap = indexPatternDatasource.uniqueLabels(props.state); render( - - - - - , + + + + + + + , domElement ); }, @@ -311,30 +321,32 @@ export function getIndexPatternDatasource({ const columnLabelMap = indexPatternDatasource.uniqueLabels(props.state); render( - - - - - , + + + + + + + , domElement ); }, @@ -344,21 +356,23 @@ export function getIndexPatternDatasource({ props: DatasourceLayerPanelProps ) => { render( - { - changeLayerIndexPattern({ - indexPatternId, - setState: props.setState, - state: props.state, - layerId: props.layerId, - onError: onIndexPatternLoadError, - replaceIfPossible: true, - storage, - indexPatternsService, - }); - }} - {...props} - />, + + { + changeLayerIndexPattern({ + indexPatternId, + setState: props.setState, + state: props.state, + layerId: props.layerId, + onError: onIndexPatternLoadError, + replaceIfPossible: true, + storage, + indexPatternsService, + }); + }} + {...props} + /> + , domElement ); }, diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/layerpanel.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/layerpanel.tsx index 27813846883b8..f8548321e49bd 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/layerpanel.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/layerpanel.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { DatasourceLayerPanelProps } from '../types'; import { IndexPatternPrivateState } from './types'; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/calculations/moving_average.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/calculations/moving_average.tsx index 7a26253c41f09..211a022c5444a 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/calculations/moving_average.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/calculations/moving_average.tsx @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useState } from 'react'; import { EuiFieldNumber, EuiFormRow } from '@elastic/eui'; import { useDebounceWithOptions } from '../../../../shared_components'; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/date_histogram.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/date_histogram.tsx index efc7a10090cfa..58bd40368656b 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/date_histogram.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/date_histogram.tsx @@ -7,7 +7,7 @@ import React, { useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiBasicTable, diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/range_editor.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/range_editor.tsx index 69460c649c3e1..ce9657a8899e4 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/range_editor.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/ranges/range_editor.tsx @@ -7,7 +7,7 @@ import React, { useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, EuiButtonIcon, diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/time_shift_utils.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/time_shift_utils.tsx index d7f238171128d..4e18e2f376c70 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/time_shift_utils.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/time_shift_utils.tsx @@ -8,7 +8,7 @@ import { i18n } from '@kbn/i18n'; import React from 'react'; import { uniq } from 'lodash'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { IndexPattern, GenericIndexPatternColumn, diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/utils.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/utils.tsx index f1f8f2cfe3e62..6baba7e19716a 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/utils.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/utils.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { DocLinksStart } from 'kibana/public'; import { EuiLink, EuiTextColor } from '@elastic/eui'; diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/visualize_geo_field_button.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/visualize_geo_field_button.tsx index 3101fb12b933a..7b0a64a9b9233 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/visualize_geo_field_button.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/visualize_geo_field_button.tsx @@ -7,7 +7,7 @@ import React, { MouseEvent, useEffect, useState } from 'react'; import { EuiButton } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { visualizeGeoFieldTrigger, VISUALIZE_GEO_FIELD_TRIGGER, diff --git a/x-pack/plugins/lens/public/metric_visualization/expression.tsx b/x-pack/plugins/lens/public/metric_visualization/expression.tsx index fd4b4f20c5c50..4c92864776045 100644 --- a/x-pack/plugins/lens/public/metric_visualization/expression.tsx +++ b/x-pack/plugins/lens/public/metric_visualization/expression.tsx @@ -6,10 +6,11 @@ */ import './expression.scss'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import React from 'react'; import ReactDOM from 'react-dom'; -import { IUiSettingsClient } from 'kibana/public'; +import { IUiSettingsClient, ThemeServiceStart } from 'kibana/public'; +import { KibanaThemeProvider } from '../../../../../src/plugins/kibana_react/public'; import type { ExpressionRenderDefinition, IInterpreterRenderHandlers, @@ -29,7 +30,8 @@ export type { MetricChartProps, MetricState, MetricConfig } from '../../common/e export const getMetricChartRenderer = ( formatFactory: FormatFactory, - uiSettings: IUiSettingsClient + uiSettings: IUiSettingsClient, + theme: ThemeServiceStart ): ExpressionRenderDefinition => ({ name: 'lens_metric_chart_renderer', displayName: 'Metric chart', @@ -38,9 +40,11 @@ export const getMetricChartRenderer = ( reuseDomNode: true, render: (domNode: Element, config: MetricChartProps, handlers: IInterpreterRenderHandlers) => { ReactDOM.render( - - - , + + + + + , domNode, () => { handlers.done(); diff --git a/x-pack/plugins/lens/public/metric_visualization/index.ts b/x-pack/plugins/lens/public/metric_visualization/index.ts index bff5f71f8ba1d..8740a3af5435c 100644 --- a/x-pack/plugins/lens/public/metric_visualization/index.ts +++ b/x-pack/plugins/lens/public/metric_visualization/index.ts @@ -27,8 +27,10 @@ export class MetricVisualization { const { getMetricVisualization, getMetricChartRenderer } = await import('../async_services'); const palettes = await charts.palettes.getPalettes(); - expressions.registerRenderer(() => getMetricChartRenderer(formatFactory, core.uiSettings)); - return getMetricVisualization({ paletteService: palettes }); + expressions.registerRenderer(() => + getMetricChartRenderer(formatFactory, core.uiSettings, core.theme) + ); + return getMetricVisualization({ paletteService: palettes, theme: core.theme }); }); } } diff --git a/x-pack/plugins/lens/public/metric_visualization/visualization.test.ts b/x-pack/plugins/lens/public/metric_visualization/visualization.test.ts index 889b711739fb3..bba08c1aa2442 100644 --- a/x-pack/plugins/lens/public/metric_visualization/visualization.test.ts +++ b/x-pack/plugins/lens/public/metric_visualization/visualization.test.ts @@ -13,6 +13,7 @@ import { generateId } from '../id_generator'; import { DatasourcePublicAPI, FramePublicAPI } from '../types'; import { chartPluginMock } from 'src/plugins/charts/public/mocks'; import { ColorMode } from 'src/plugins/charts/common'; +import { themeServiceMock } from '../../../../../src/core/public/mocks'; jest.mock('../id_generator'); @@ -36,6 +37,7 @@ function mockFrame(): FramePublicAPI { const metricVisualization = getMetricVisualization({ paletteService: chartPluginMock.createPaletteRegistry(), + theme: themeServiceMock.createStartContract(), }); describe('metric_visualization', () => { diff --git a/x-pack/plugins/lens/public/metric_visualization/visualization.tsx b/x-pack/plugins/lens/public/metric_visualization/visualization.tsx index 63da7c4b44317..857bfa676faf4 100644 --- a/x-pack/plugins/lens/public/metric_visualization/visualization.tsx +++ b/x-pack/plugins/lens/public/metric_visualization/visualization.tsx @@ -7,9 +7,11 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { render } from 'react-dom'; import { Ast } from '@kbn/interpreter/common'; +import { ThemeServiceStart } from 'kibana/public'; +import { KibanaThemeProvider } from '../../../../../src/plugins/kibana_react/public'; import { ColorMode } from '../../../../../src/plugins/charts/common'; import { PaletteRegistry } from '../../../../../src/plugins/charts/public'; import { getSuggestions } from './metric_suggestions'; @@ -73,8 +75,10 @@ const toExpression = ( }; export const getMetricVisualization = ({ paletteService, + theme, }: { paletteService: PaletteRegistry; + theme: ThemeServiceStart; }): Visualization => ({ id: 'lnsMetric', @@ -191,9 +195,11 @@ export const getMetricVisualization = ({ renderDimensionEditor(domElement, props) { render( - - - , + + + + + , domElement ); }, diff --git a/x-pack/plugins/lens/public/pie_visualization/constants.ts b/x-pack/plugins/lens/public/pie_visualization/constants.ts index 9a2f39e7d34a5..be0afc65aed3b 100644 --- a/x-pack/plugins/lens/public/pie_visualization/constants.ts +++ b/x-pack/plugins/lens/public/pie_visualization/constants.ts @@ -6,41 +6,100 @@ */ import { i18n } from '@kbn/i18n'; +import { PartitionLayout } from '@elastic/charts'; import { LensIconChartDonut } from '../assets/chart_donut'; import { LensIconChartPie } from '../assets/chart_pie'; import { LensIconChartTreemap } from '../assets/chart_treemap'; +import { LensIconChartMosaic } from '../assets/chart_mosaic'; + +import type { SharedPieLayerState } from '../../common/expressions'; + +interface CategoryOption { + value: SharedPieLayerState['categoryDisplay']; + inputDisplay: string; +} const groupLabel = i18n.translate('xpack.lens.pie.groupLabel', { defaultMessage: 'Proportion', }); +const categoryOptions: CategoryOption[] = [ + { + value: 'default', + inputDisplay: i18n.translate('xpack.lens.pieChart.showCategoriesLabel', { + defaultMessage: 'Inside or outside', + }), + }, + { + value: 'inside', + inputDisplay: i18n.translate('xpack.lens.pieChart.fitInsideOnlyLabel', { + defaultMessage: 'Inside only', + }), + }, + { + value: 'hide', + inputDisplay: i18n.translate('xpack.lens.pieChart.categoriesInLegendLabel', { + defaultMessage: 'Hide labels', + }), + }, +]; + +const categoryOptionsTreemap: CategoryOption[] = [ + { + value: 'default', + inputDisplay: i18n.translate('xpack.lens.pieChart.showTreemapCategoriesLabel', { + defaultMessage: 'Show labels', + }), + }, + { + value: 'hide', + inputDisplay: i18n.translate('xpack.lens.pieChart.categoriesInLegendLabel', { + defaultMessage: 'Hide labels', + }), + }, +]; + export const CHART_NAMES = { donut: { icon: LensIconChartDonut, label: i18n.translate('xpack.lens.pie.donutLabel', { defaultMessage: 'Donut', }), + partitionType: PartitionLayout.sunburst, groupLabel, + categoryOptions, }, pie: { icon: LensIconChartPie, label: i18n.translate('xpack.lens.pie.pielabel', { defaultMessage: 'Pie', }), - + partitionType: PartitionLayout.sunburst, groupLabel, + categoryOptions, }, treemap: { icon: LensIconChartTreemap, label: i18n.translate('xpack.lens.pie.treemaplabel', { defaultMessage: 'Treemap', }), - + partitionType: PartitionLayout.treemap, + groupLabel, + categoryOptions: categoryOptionsTreemap, + }, + mosaic: { + icon: LensIconChartMosaic, + label: i18n.translate('xpack.lens.pie.mosaiclabel', { + defaultMessage: 'Mosaic', + }), + partitionType: PartitionLayout.mosaic, groupLabel, + categoryOptions: [] as CategoryOption[], }, }; export const MAX_PIE_BUCKETS = 3; export const MAX_TREEMAP_BUCKETS = 2; +export const MAX_MOSAIC_BUCKETS = 2; export const DEFAULT_PERCENT_DECIMALS = 2; diff --git a/x-pack/plugins/lens/public/pie_visualization/expression.tsx b/x-pack/plugins/lens/public/pie_visualization/expression.tsx index d26289450bd0f..bf52fb6ba5e5e 100644 --- a/x-pack/plugins/lens/public/pie_visualization/expression.tsx +++ b/x-pack/plugins/lens/public/pie_visualization/expression.tsx @@ -8,11 +8,13 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { i18n } from '@kbn/i18n'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import type { IInterpreterRenderHandlers, ExpressionRenderDefinition, } from 'src/plugins/expressions/public'; +import { ThemeServiceStart } from 'kibana/public'; +import { KibanaThemeProvider } from '../../../../../src/plugins/kibana_react/public'; import type { LensFilterEvent } from '../types'; import { PieComponent } from './render_function'; import type { FormatFactory } from '../../common'; @@ -23,6 +25,7 @@ export const getPieRenderer = (dependencies: { formatFactory: FormatFactory; chartsThemeService: ChartsPluginSetup['theme']; paletteService: PaletteRegistry; + kibanaTheme: ThemeServiceStart; }): ExpressionRenderDefinition => ({ name: 'lens_pie_renderer', displayName: i18n.translate('xpack.lens.pie.visualizationName', { @@ -37,18 +40,20 @@ export const getPieRenderer = (dependencies: { }; ReactDOM.render( - - - , + + + + + , domNode, () => { handlers.done(); diff --git a/x-pack/plugins/lens/public/pie_visualization/index.ts b/x-pack/plugins/lens/public/pie_visualization/index.ts index b4670b3b9c9dd..ce54f53c1cc93 100644 --- a/x-pack/plugins/lens/public/pie_visualization/index.ts +++ b/x-pack/plugins/lens/public/pie_visualization/index.ts @@ -37,9 +37,10 @@ export class PieVisualization { formatFactory, chartsThemeService: charts.theme, paletteService: palettes, + kibanaTheme: core.theme, }) ); - return getPieVisualization({ paletteService: palettes }); + return getPieVisualization({ paletteService: palettes, kibanaTheme: core.theme }); }); } } diff --git a/x-pack/plugins/lens/public/pie_visualization/render_function.tsx b/x-pack/plugins/lens/public/pie_visualization/render_function.tsx index 05b9ca9c34168..7bc5f4037c3e8 100644 --- a/x-pack/plugins/lens/public/pie_visualization/render_function.tsx +++ b/x-pack/plugins/lens/public/pie_visualization/render_function.tsx @@ -7,7 +7,7 @@ import { uniq } from 'lodash'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiText } from '@elastic/eui'; import { Chart, @@ -16,7 +16,6 @@ import { Partition, PartitionConfig, PartitionLayer, - PartitionLayout, PartitionFillLabel, RecursivePartial, Position, @@ -29,7 +28,13 @@ import { VisualizationContainer } from '../visualization_container'; import { CHART_NAMES, DEFAULT_PERCENT_DECIMALS } from './constants'; import type { FormatFactory } from '../../common'; import type { PieExpressionProps } from '../../common/expressions'; -import { getSliceValue, getFilterContext } from './render_helpers'; +import { + getSliceValue, + getFilterContext, + isTreemapOrMosaicShape, + byDataColorPaletteMap, + extractUniqTermsMap, +} from './render_helpers'; import { EmptyPlaceholder } from '../shared_components'; import './visualization.scss'; import { @@ -110,6 +115,22 @@ export function PieComponent( }) ).length; + const shouldUseByDataPalette = !syncColors && ['mosaic'].includes(shape) && bucketColumns[1]?.id; + let byDataPalette: ReturnType; + if (shouldUseByDataPalette) { + byDataPalette = byDataColorPaletteMap( + firstTable, + bucketColumns[1].id, + paletteService.get(palette.name), + palette + ); + } + + let sortingMap: Record; + if (shape === 'mosaic') { + sortingMap = extractUniqTermsMap(firstTable, bucketColumns[0].id); + } + const layers: PartitionLayer[] = bucketColumns.map((col, layerIndex) => { return { groupByRollup: (d: Datum) => d[col.id] ?? EMPTY_SLICE, @@ -124,13 +145,29 @@ export function PieComponent( return String(d); }, fillLabel, + sortPredicate: + shape === 'mosaic' + ? ([name1, node1], [, node2]) => { + // Sorting for first group + if (bucketColumns.length === 1 || (node1.children.length && name1 in sortingMap)) { + return sortingMap[name1]; + } + // Sorting for second group + return node2.value - node1.value; + } + : undefined, shape: { fillColor: (d) => { const seriesLayers: SeriesLayer[] = []; + // Mind the difference here: the contrast computation for the text ignores the alpha/opacity + // therefore change it for dask mode + const defaultColor = isDarkMode ? 'rgba(0,0,0,0)' : 'rgba(255,255,255,0)'; + // Color is determined by round-robin on the index of the innermost slice // This has to be done recursively until we get to the slice index let tempParent: typeof d | typeof d['parent'] = d; + while (tempParent.parent && tempParent.depth > 0) { seriesLayers.unshift({ name: String(tempParent.parent.children[tempParent.sortIndex][0]), @@ -140,12 +177,14 @@ export function PieComponent( tempParent = tempParent.parent; } - if (shape === 'treemap') { + if (byDataPalette && seriesLayers[1]) { + return byDataPalette.getColor(seriesLayers[1].name) || defaultColor; + } + + if (isTreemapOrMosaicShape(shape)) { // Only highlight the innermost color of the treemap, as it accurately represents area if (layerIndex < bucketColumns.length - 1) { - // Mind the difference here: the contrast computation for the text ignores the alpha/opacity - // therefore change it for dask mode - return isDarkMode ? 'rgba(0,0,0,0)' : 'rgba(255,255,255,0)'; + return defaultColor; } // only use the top level series layer for coloring if (seriesLayers.length > 1) { @@ -164,14 +203,14 @@ export function PieComponent( palette.params ); - return outputColor || 'rgba(0,0,0,0)'; + return outputColor || defaultColor; }, }, }; }); const config: RecursivePartial = { - partitionLayout: shape === 'treemap' ? PartitionLayout.treemap : PartitionLayout.sunburst, + partitionLayout: CHART_NAMES[shape].partitionType, fontFamily: chartTheme.barSeriesStyle?.displayValue?.fontFamily, outerSizeRatio: 1, specialFirstInnermostSector: true, @@ -191,7 +230,7 @@ export function PieComponent( sectorLineWidth: 1.5, circlePadding: 4, }; - if (shape === 'treemap') { + if (isTreemapOrMosaicShape(shape)) { if (hideLabels || categoryDisplay === 'hide') { config.fillLabel = { textColor: 'rgba(0,0,0,0)' }; } @@ -279,7 +318,9 @@ export function PieComponent( showLegend={ !hideLabels && (legendDisplay === 'show' || - (legendDisplay === 'default' && bucketColumns.length > 1 && shape !== 'treemap')) + (legendDisplay === 'default' && + bucketColumns.length > 1 && + !isTreemapOrMosaicShape(shape))) } legendPosition={legendPosition || Position.Right} legendMaxDepth={nestedLegend ? undefined : 1 /* Color is based only on first layer */} diff --git a/x-pack/plugins/lens/public/pie_visualization/render_helpers.test.ts b/x-pack/plugins/lens/public/pie_visualization/render_helpers.test.ts index 7c55c0fa61931..dd27632b36e44 100644 --- a/x-pack/plugins/lens/public/pie_visualization/render_helpers.test.ts +++ b/x-pack/plugins/lens/public/pie_visualization/render_helpers.test.ts @@ -5,8 +5,16 @@ * 2.0. */ -import { Datatable } from 'src/plugins/expressions/public'; -import { getSliceValue, getFilterContext } from './render_helpers'; +import type { Datatable } from 'src/plugins/expressions/public'; +import type { PaletteDefinition, PaletteOutput } from 'src/plugins/charts/public'; + +import { + getSliceValue, + getFilterContext, + byDataColorPaletteMap, + extractUniqTermsMap, +} from './render_helpers'; +import { chartPluginMock } from '../../../../../src/plugins/charts/public/mocks'; describe('render helpers', () => { describe('#getSliceValue', () => { @@ -200,4 +208,113 @@ describe('render helpers', () => { }); }); }); + + describe('#extractUniqTermsMap', () => { + it('should extract map', () => { + const table: Datatable = { + type: 'datatable', + columns: [ + { id: 'a', name: 'A', meta: { type: 'string' } }, + { id: 'b', name: 'B', meta: { type: 'string' } }, + { id: 'c', name: 'C', meta: { type: 'number' } }, + ], + rows: [ + { a: 'Hi', b: 'Two', c: 2 }, + { a: 'Test', b: 'Two', c: 5 }, + { a: 'Foo', b: 'Three', c: 6 }, + ], + }; + expect(extractUniqTermsMap(table, 'a')).toMatchInlineSnapshot(` + Object { + "Foo": 2, + "Hi": 0, + "Test": 1, + } + `); + expect(extractUniqTermsMap(table, 'b')).toMatchInlineSnapshot(` + Object { + "Three": 1, + "Two": 0, + } + `); + }); + }); + + describe('#byDataColorPaletteMap', () => { + let datatable: Datatable; + let paletteDefinition: PaletteDefinition; + let palette: PaletteOutput; + const columnId = 'foo'; + + beforeEach(() => { + datatable = { + rows: [ + { + [columnId]: '1', + }, + { + [columnId]: '2', + }, + ], + } as unknown as Datatable; + paletteDefinition = chartPluginMock.createPaletteRegistry().get('default'); + palette = { type: 'palette' } as PaletteOutput; + }); + + it('should create byDataColorPaletteMap', () => { + expect(byDataColorPaletteMap(datatable, columnId, paletteDefinition, palette)) + .toMatchInlineSnapshot(` + Object { + "getColor": [Function], + } + `); + }); + + it('should get color', () => { + const colorPaletteMap = byDataColorPaletteMap( + datatable, + columnId, + paletteDefinition, + palette + ); + + expect(colorPaletteMap.getColor('1')).toBe('black'); + }); + + it('should return undefined in case if values not in datatable', () => { + const colorPaletteMap = byDataColorPaletteMap( + datatable, + columnId, + paletteDefinition, + palette + ); + + expect(colorPaletteMap.getColor('wrong')).toBeUndefined(); + }); + + it('should increase rankAtDepth for each new value', () => { + const colorPaletteMap = byDataColorPaletteMap( + datatable, + columnId, + paletteDefinition, + palette + ); + colorPaletteMap.getColor('1'); + colorPaletteMap.getColor('2'); + + expect(paletteDefinition.getCategoricalColor).toHaveBeenNthCalledWith( + 1, + [{ name: '1', rankAtDepth: 0, totalSeriesAtDepth: 2 }], + { behindText: false }, + undefined + ); + + expect(paletteDefinition.getCategoricalColor).toHaveBeenNthCalledWith( + 2, + [{ name: '2', rankAtDepth: 1, totalSeriesAtDepth: 2 }], + { behindText: false }, + undefined + ); + }); + }); }); diff --git a/x-pack/plugins/lens/public/pie_visualization/render_helpers.ts b/x-pack/plugins/lens/public/pie_visualization/render_helpers.ts index d2858efa90153..bdffacde65639 100644 --- a/x-pack/plugins/lens/public/pie_visualization/render_helpers.ts +++ b/x-pack/plugins/lens/public/pie_visualization/render_helpers.ts @@ -5,9 +5,11 @@ * 2.0. */ -import { Datum, LayerValue } from '@elastic/charts'; -import { Datatable, DatatableColumn } from 'src/plugins/expressions/public'; -import { LensFilterEvent } from '../types'; +import type { Datum, LayerValue } from '@elastic/charts'; +import type { Datatable, DatatableColumn } from 'src/plugins/expressions/public'; +import type { LensFilterEvent } from '../types'; +import type { PieChartTypes } from '../../common/expressions/pie_chart/types'; +import type { PaletteDefinition, PaletteOutput } from '../../../../../src/plugins/charts/public'; export function getSliceValue(d: Datum, metricColumn: DatatableColumn) { const value = d[metricColumn.id]; @@ -35,3 +37,61 @@ export function getFilterContext( })), }; } + +export const isPartitionShape = (shape: PieChartTypes | string) => + ['donut', 'pie', 'treemap', 'mosaic'].includes(shape); + +export const isTreemapOrMosaicShape = (shape: PieChartTypes | string) => + ['treemap', 'mosaic'].includes(shape); + +export const extractUniqTermsMap = (dataTable: Datatable, columnId: string) => + [...new Set(dataTable.rows.map((item) => item[columnId]))].reduce( + (acc, item, index) => ({ + ...acc, + [item]: index, + }), + {} + ); + +export const byDataColorPaletteMap = ( + dataTable: Datatable, + columnId: string, + paletteDefinition: PaletteDefinition, + { params }: PaletteOutput +) => { + const colorMap = new Map( + dataTable.rows.map((item) => [String(item[columnId]), undefined]) + ); + let rankAtDepth = 0; + + return { + getColor: (item: unknown) => { + const key = String(item); + + if (colorMap.has(key)) { + let color = colorMap.get(key); + + if (color) { + return color; + } + color = + paletteDefinition.getCategoricalColor( + [ + { + name: key, + totalSeriesAtDepth: colorMap.size, + rankAtDepth: rankAtDepth++, + }, + ], + { + behindText: false, + }, + params + ) || undefined; + + colorMap.set(key, color); + return color; + } + }, + }; +}; diff --git a/x-pack/plugins/lens/public/pie_visualization/suggestions.test.ts b/x-pack/plugins/lens/public/pie_visualization/suggestions.test.ts index 5a57371eb6459..656d00960766e 100644 --- a/x-pack/plugins/lens/public/pie_visualization/suggestions.test.ts +++ b/x-pack/plugins/lens/public/pie_visualization/suggestions.test.ts @@ -6,9 +6,9 @@ */ import { PaletteOutput } from 'src/plugins/charts/public'; -import { DataType, SuggestionRequest } from '../types'; import { suggestions } from './suggestions'; -import { PieVisualizationState } from '../../common/expressions'; +import type { DataType, SuggestionRequest } from '../types'; +import type { PieLayerState, PieVisualizationState } from '../../common/expressions'; import { layerTypes } from '../../common'; describe('suggestions', () => { @@ -144,6 +144,38 @@ describe('suggestions', () => { ).toHaveLength(0); }); + it('should not reject histogram operations in case of switching between partition charts', () => { + expect( + suggestions({ + table: { + layerId: 'first', + isMultiRow: true, + columns: [ + { + columnId: 'b', + operation: { + label: 'Durations', + dataType: 'number' as DataType, + isBucketed: true, + scale: 'interval', + }, + }, + { + columnId: 'c', + operation: { label: 'Count', dataType: 'number' as DataType, isBucketed: false }, + }, + ], + changeType: 'initial', + }, + state: { + shape: 'mosaic', + layers: [{} as PieLayerState], + }, + keptLayerIds: ['first'], + }).length + ).toBeGreaterThan(0); + }); + it('should reject when there are too many buckets', () => { expect( suggestions({ @@ -272,7 +304,7 @@ describe('suggestions', () => { state: undefined, keptLayerIds: ['first'], }); - expect(currentSuggestions).toHaveLength(3); + expect(currentSuggestions).toHaveLength(4); expect(currentSuggestions.every((s) => s.hide)).toEqual(true); }); @@ -292,7 +324,7 @@ describe('suggestions', () => { state: undefined, keptLayerIds: ['first'], }); - expect(currentSuggestions).toHaveLength(3); + expect(currentSuggestions).toHaveLength(4); expect(currentSuggestions.every((s) => s.hide)).toEqual(true); }); @@ -721,4 +753,172 @@ describe('suggestions', () => { ); }); }); + + describe('mosaic', () => { + it('should reject when currently active and unchanged data', () => { + expect( + suggestions({ + table: { + layerId: 'first', + isMultiRow: true, + columns: [], + changeType: 'unchanged', + }, + state: { + shape: 'mosaic', + layers: [ + { + layerId: 'first', + layerType: layerTypes.DATA, + groups: [], + metric: 'a', + + numberDisplay: 'hidden', + categoryDisplay: 'default', + legendDisplay: 'default', + }, + ], + }, + keptLayerIds: ['first'], + }) + ).toHaveLength(0); + }); + + it('mosaic type should be added only in case of 2 groups', () => { + expect( + suggestions({ + table: { + layerId: 'first', + isMultiRow: true, + columns: [ + { + columnId: 'a', + operation: { label: 'Top 5', dataType: 'string' as DataType, isBucketed: true }, + }, + { + columnId: 'b', + operation: { label: 'Top 6', dataType: 'string' as DataType, isBucketed: true }, + }, + { + columnId: 'c', + operation: { label: 'Count', dataType: 'number' as DataType, isBucketed: false }, + }, + ], + changeType: 'unchanged', + }, + state: { + shape: 'treemap', + layers: [ + { + layerId: 'first', + layerType: layerTypes.DATA, + groups: ['a', 'b'], + metric: 'c', + + numberDisplay: 'hidden', + categoryDisplay: 'inside', + legendDisplay: 'show', + percentDecimals: 0, + legendMaxLines: 1, + truncateLegend: true, + nestedLegend: true, + }, + ], + }, + keptLayerIds: ['first'], + }).filter(({ hide, state }) => !hide && state.shape === 'mosaic') + ).toMatchInlineSnapshot(` + Array [ + Object { + "hide": false, + "previewIcon": "bullseye", + "score": 0.6, + "state": Object { + "layers": Array [ + Object { + "categoryDisplay": "default", + "groups": Array [ + "a", + "b", + ], + "layerId": "first", + "layerType": "data", + "legendDisplay": "show", + "legendMaxLines": 1, + "metric": "c", + "nestedLegend": true, + "numberDisplay": "hidden", + "percentDecimals": 0, + "truncateLegend": true, + }, + ], + "palette": undefined, + "shape": "mosaic", + }, + "title": "As Mosaic", + }, + ] + `); + }); + + it('mosaic type should be added only in case of 2 groups (negative test)', () => { + const meta: Parameters[0] = { + table: { + layerId: 'first', + isMultiRow: true, + columns: [ + { + columnId: 'a', + operation: { label: 'Top 5', dataType: 'string' as DataType, isBucketed: true }, + }, + { + columnId: 'c', + operation: { label: 'Count', dataType: 'number' as DataType, isBucketed: false }, + }, + ], + changeType: 'unchanged', + }, + state: { + shape: 'pie', + layers: [ + { + layerId: 'first', + layerType: layerTypes.DATA, + groups: ['a', 'b'], + metric: 'c', + + numberDisplay: 'hidden', + categoryDisplay: 'inside', + legendDisplay: 'show', + percentDecimals: 0, + legendMaxLines: 1, + truncateLegend: true, + nestedLegend: true, + }, + ], + }, + keptLayerIds: ['first'], + }; + + // test with 1 group + expect( + suggestions(meta).filter(({ hide, state }) => !hide && state.shape === 'mosaic') + ).toMatchInlineSnapshot(`Array []`); + + meta.table.columns.push({ + columnId: 'b', + operation: { label: 'Top 6', dataType: 'string' as DataType, isBucketed: true }, + }); + + meta.table.columns.push({ + columnId: 'c', + operation: { label: 'Top 7', dataType: 'string' as DataType, isBucketed: true }, + }); + + // test with 3 groups + expect( + suggestions(meta).filter(({ hide, state }) => !hide && state.shape === 'mosaic') + ).toMatchInlineSnapshot(`Array []`); + }); + }); }); diff --git a/x-pack/plugins/lens/public/pie_visualization/suggestions.ts b/x-pack/plugins/lens/public/pie_visualization/suggestions.ts index 9078e18588a2f..30cd63752f420 100644 --- a/x-pack/plugins/lens/public/pie_visualization/suggestions.ts +++ b/x-pack/plugins/lens/public/pie_visualization/suggestions.ts @@ -7,17 +7,26 @@ import { partition } from 'lodash'; import { i18n } from '@kbn/i18n'; -import type { SuggestionRequest, VisualizationSuggestion } from '../types'; +import type { SuggestionRequest, TableSuggestionColumn, VisualizationSuggestion } from '../types'; import { layerTypes } from '../../common'; import type { PieVisualizationState } from '../../common/expressions'; -import { CHART_NAMES, MAX_PIE_BUCKETS, MAX_TREEMAP_BUCKETS } from './constants'; +import { CHART_NAMES, MAX_MOSAIC_BUCKETS, MAX_PIE_BUCKETS, MAX_TREEMAP_BUCKETS } from './constants'; +import { isPartitionShape, isTreemapOrMosaicShape } from './render_helpers'; + +function hasIntervalScale(columns: TableSuggestionColumn[]) { + return columns.some((col) => col.operation.scale === 'interval'); +} + +function shouldReject({ table, keptLayerIds, state }: SuggestionRequest) { + // Histograms are not good for pi. But we should not reject them on switching between partition charts. + const shouldRejectIntervals = + state?.shape && isPartitionShape(state.shape) ? false : hasIntervalScale(table.columns); -function shouldReject({ table, keptLayerIds }: SuggestionRequest) { return ( keptLayerIds.length > 1 || (keptLayerIds.length && table.layerId !== keptLayerIds[0]) || table.changeType === 'reorder' || - table.columns.some((col) => col.operation.scale === 'interval') // Histograms are not good for pie + shouldRejectIntervals ); } @@ -52,7 +61,7 @@ export function suggestions({ const results: Array> = []; - if (groups.length <= MAX_PIE_BUCKETS && subVisualizationId !== 'treemap') { + if (groups.length <= MAX_PIE_BUCKETS && !isTreemapOrMosaicShape(subVisualizationId!)) { let newShape: PieVisualizationState['shape'] = (subVisualizationId as PieVisualizationState['shape']) || 'donut'; if (groups.length !== 1 && !subVisualizationId) { @@ -65,7 +74,7 @@ export function suggestions({ values: { chartName: CHART_NAMES[newShape].label }, description: 'chartName is already translated', }), - score: state && state.shape !== 'treemap' ? 0.6 : 0.4, + score: state && !isTreemapOrMosaicShape(state.shape) ? 0.6 : 0.4, state: { shape: newShape, palette: mainPalette || state?.palette, @@ -92,7 +101,10 @@ export function suggestions({ }, previewIcon: 'bullseye', // dont show suggestions for same type - hide: table.changeType === 'reduced' || (state && state.shape !== 'treemap'), + hide: + table.changeType === 'reduced' || + hasIntervalScale(groups) || + (state && !isTreemapOrMosaicShape(state.shape)), }; results.push(baseSuggestion); @@ -153,7 +165,54 @@ export function suggestions({ }, previewIcon: 'bullseye', // hide treemap suggestions from bottom bar, but keep them for chart switcher - hide: table.changeType === 'reduced' || !state || (state && state.shape === 'treemap'), + hide: + table.changeType === 'reduced' || + !state || + hasIntervalScale(groups) || + (state && state.shape === 'treemap'), + }); + } + + if ( + groups.length <= MAX_MOSAIC_BUCKETS && + (!subVisualizationId || subVisualizationId === 'mosaic') + ) { + results.push({ + title: i18n.translate('xpack.lens.pie.mosaicSuggestionLabel', { + defaultMessage: 'As Mosaic', + }), + score: state?.shape === 'mosaic' ? 0.7 : 0.5, + state: { + shape: 'mosaic', + palette: mainPalette || state?.palette, + layers: [ + state?.layers[0] + ? { + ...state.layers[0], + layerId: table.layerId, + groups: groups.map((col) => col.columnId), + metric: metricColumnId, + categoryDisplay: 'default', + layerType: layerTypes.DATA, + } + : { + layerId: table.layerId, + groups: groups.map((col) => col.columnId), + metric: metricColumnId, + numberDisplay: 'percent', + categoryDisplay: 'default', + legendDisplay: 'default', + nestedLegend: false, + layerType: layerTypes.DATA, + }, + ], + }, + previewIcon: 'bullseye', + hide: + groups.length !== 2 || + table.changeType === 'reduced' || + hasIntervalScale(groups) || + (state && state.shape === 'mosaic'), }); } diff --git a/x-pack/plugins/lens/public/pie_visualization/toolbar.tsx b/x-pack/plugins/lens/public/pie_visualization/toolbar.tsx index 685a8392dcfd3..23003a4ec3404 100644 --- a/x-pack/plugins/lens/public/pie_visualization/toolbar.tsx +++ b/x-pack/plugins/lens/public/pie_visualization/toolbar.tsx @@ -17,7 +17,7 @@ import { } from '@elastic/eui'; import type { Position } from '@elastic/charts'; import type { PaletteRegistry } from 'src/plugins/charts/public'; -import { DEFAULT_PERCENT_DECIMALS } from './constants'; +import { DEFAULT_PERCENT_DECIMALS, CHART_NAMES } from './constants'; import type { PieVisualizationState, SharedPieLayerState } from '../../common/expressions'; import { VisualizationDimensionEditorProps, VisualizationToolbarProps } from '../types'; import { ToolbarPopover, LegendSettingsPopover, useDebouncedValue } from '../shared_components'; @@ -47,48 +47,6 @@ const numberOptions: Array<{ }, ]; -const categoryOptions: Array<{ - value: SharedPieLayerState['categoryDisplay']; - inputDisplay: string; -}> = [ - { - value: 'default', - inputDisplay: i18n.translate('xpack.lens.pieChart.showCategoriesLabel', { - defaultMessage: 'Inside or outside', - }), - }, - { - value: 'inside', - inputDisplay: i18n.translate('xpack.lens.pieChart.fitInsideOnlyLabel', { - defaultMessage: 'Inside only', - }), - }, - { - value: 'hide', - inputDisplay: i18n.translate('xpack.lens.pieChart.categoriesInLegendLabel', { - defaultMessage: 'Hide labels', - }), - }, -]; - -const categoryOptionsTreemap: Array<{ - value: SharedPieLayerState['categoryDisplay']; - inputDisplay: string; -}> = [ - { - value: 'default', - inputDisplay: i18n.translate('xpack.lens.pieChart.showTreemapCategoriesLabel', { - defaultMessage: 'Show labels', - }), - }, - { - value: 'hide', - inputDisplay: i18n.translate('xpack.lens.pieChart.categoriesInLegendLabel', { - defaultMessage: 'Hide labels', - }), - }, -]; - const legendOptions: Array<{ value: SharedPieLayerState['legendDisplay']; label: string; @@ -133,25 +91,27 @@ export function PieToolbar(props: VisualizationToolbarProps - - { - setState({ - ...state, - layers: [{ ...layer, categoryDisplay: option }], - }); - }} - /> - + {state.shape && CHART_NAMES[state.shape].categoryOptions.length ? ( + + { + setState({ + ...state, + layers: [{ ...layer, categoryDisplay: option }], + }); + }} + /> + + ) : null} op.isBucketed; const numberMetricOperations = (op: OperationMetadata) => !op.isBucketed && op.dataType === 'number'; +const applyPaletteToColumnConfig = ( + columns: AccessorConfig[], + { shape, palette }: PieVisualizationState, + paletteService: PaletteRegistry +) => { + const colorPickerIndex = shape === 'mosaic' ? columns.length - 1 : 0; + + if (colorPickerIndex >= 0) { + columns[colorPickerIndex] = { + columnId: columns[colorPickerIndex].columnId, + triggerIcon: 'colorBy', + palette: paletteService + .get(palette?.name || 'default') + .getCategoricalColors(10, palette?.params), + }; + } +}; + export const getPieVisualization = ({ paletteService, + kibanaTheme, }: { paletteService: PaletteRegistry; + kibanaTheme: ThemeServiceStart; }): Visualization => ({ id: 'lnsPie', @@ -61,6 +88,13 @@ export const getPieVisualization = ({ label: CHART_NAMES.treemap.label, groupLabel: CHART_NAMES.treemap.groupLabel, }, + { + id: 'mosaic', + icon: CHART_NAMES.mosaic.icon, + label: CHART_NAMES.mosaic.label, + showExperimentalBadge: true, + groupLabel: CHART_NAMES.mosaic.groupLabel, + }, ], getVisualizationTypeId(state) { @@ -79,13 +113,7 @@ export const getPieVisualization = ({ }, getDescription(state) { - if (state.shape === 'treemap') { - return CHART_NAMES.treemap; - } - if (state.shape === 'donut') { - return CHART_NAMES.donut; - } - return CHART_NAMES.pie; + return CHART_NAMES[state.shape] ?? CHART_NAMES.pie; }, switchVisualizationType: (visualizationTypeId, state) => ({ @@ -122,76 +150,58 @@ export const getPieVisualization = ({ const sortedColumns: AccessorConfig[] = Array.from( new Set(originalOrder.concat(layer.groups)) ).map((accessor) => ({ columnId: accessor })); - if (sortedColumns.length > 0) { - sortedColumns[0] = { - columnId: sortedColumns[0].columnId, - triggerIcon: 'colorBy', - palette: paletteService - .get(state.palette?.name || 'default') - .getCategoricalColors(10, state.palette?.params), - }; + + if (sortedColumns.length) { + applyPaletteToColumnConfig(sortedColumns, state, paletteService); } - if (state.shape === 'treemap') { - return { - groups: [ - { - groupId: 'groups', + const getSliceByGroup = (): VisualizationDimensionGroupConfig => { + const baseProps = { + required: true, + groupId: 'groups', + accessors: sortedColumns, + enableDimensionEditor: true, + filterOperations: bucketedOperations, + }; + + switch (state.shape) { + case 'mosaic': + case 'treemap': + return { + ...baseProps, groupLabel: i18n.translate('xpack.lens.pie.treemapGroupLabel', { defaultMessage: 'Group by', }), - layerId, - accessors: sortedColumns, supportsMoreColumns: sortedColumns.length < MAX_TREEMAP_BUCKETS, - filterOperations: bucketedOperations, - required: true, dataTestSubj: 'lnsPie_groupByDimensionPanel', - enableDimensionEditor: true, - }, - { - groupId: 'metric', - groupLabel: i18n.translate('xpack.lens.pie.groupsizeLabel', { - defaultMessage: 'Size by', + requiredMinDimensionCount: state.shape === 'mosaic' ? 2 : undefined, + }; + default: + return { + ...baseProps, + groupLabel: i18n.translate('xpack.lens.pie.sliceGroupLabel', { + defaultMessage: 'Slice by', }), - layerId, - accessors: layer.metric ? [{ columnId: layer.metric }] : [], - supportsMoreColumns: !layer.metric, - filterOperations: numberMetricOperations, - required: true, - dataTestSubj: 'lnsPie_sizeByDimensionPanel', - }, - ], - }; - } + supportsMoreColumns: sortedColumns.length < MAX_PIE_BUCKETS, + dataTestSubj: 'lnsPie_sliceByDimensionPanel', + }; + } + }; + + const getMetricGroup = (): VisualizationDimensionGroupConfig => ({ + groupId: 'metric', + groupLabel: i18n.translate('xpack.lens.pie.groupsizeLabel', { + defaultMessage: 'Size by', + }), + accessors: layer.metric ? [{ columnId: layer.metric }] : [], + supportsMoreColumns: !layer.metric, + filterOperations: numberMetricOperations, + required: true, + dataTestSubj: 'lnsPie_sizeByDimensionPanel', + }); return { - groups: [ - { - groupId: 'groups', - groupLabel: i18n.translate('xpack.lens.pie.sliceGroupLabel', { - defaultMessage: 'Slice by', - }), - layerId, - accessors: sortedColumns, - supportsMoreColumns: sortedColumns.length < MAX_PIE_BUCKETS, - filterOperations: bucketedOperations, - required: true, - dataTestSubj: 'lnsPie_sliceByDimensionPanel', - enableDimensionEditor: true, - }, - { - groupId: 'metric', - groupLabel: i18n.translate('xpack.lens.pie.groupsizeLabel', { - defaultMessage: 'Size by', - }), - layerId, - accessors: layer.metric ? [{ columnId: layer.metric }] : [], - supportsMoreColumns: !layer.metric, - filterOperations: numberMetricOperations, - required: true, - dataTestSubj: 'lnsPie_sizeByDimensionPanel', - }, - ], + groups: [getSliceByGroup(), getMetricGroup()], }; }, @@ -226,9 +236,11 @@ export const getPieVisualization = ({ }, renderDimensionEditor(domElement, props) { render( - - - , + + + + + , domElement ); }, @@ -254,9 +266,11 @@ export const getPieVisualization = ({ renderToolbar(domElement, props) { render( - - - , + + + + + , domElement ); }, diff --git a/x-pack/plugins/lens/public/plugin.ts b/x-pack/plugins/lens/public/plugin.ts index fb0a922c7e9a2..b89492d7e7588 100644 --- a/x-pack/plugins/lens/public/plugin.ts +++ b/x-pack/plugins/lens/public/plugin.ts @@ -35,7 +35,7 @@ import type { ChartsPluginSetup, ChartsPluginStart } from '../../../../src/plugi import type { PresentationUtilPluginStart } from '../../../../src/plugins/presentation_util/public'; import { EmbeddableStateTransfer } from '../../../../src/plugins/embeddable/public'; import type { EditorFrameService as EditorFrameServiceType } from './editor_frame_service'; -import { IndexPatternFieldEditorStart } from '../../../../src/plugins/index_pattern_field_editor/public'; +import { IndexPatternFieldEditorStart } from '../../../../src/plugins/data_view_field_editor/public'; import type { IndexPatternDatasource as IndexPatternDatasourceType, IndexPatternDatasourceSetupPlugins, @@ -109,7 +109,7 @@ export interface LensPluginStartDependencies { charts: ChartsPluginStart; savedObjectsTagging?: SavedObjectTaggingPluginStart; presentationUtil: PresentationUtilPluginStart; - indexPatternFieldEditor: IndexPatternFieldEditorStart; + dataViewFieldEditor: IndexPatternFieldEditorStart; inspector: InspectorStartContract; spaces: SpacesPluginStart; usageCollection?: UsageCollectionStart; @@ -216,6 +216,7 @@ export class LensPlugin { usageCollection, inspector: plugins.inspector, spaces: plugins.spaces, + theme: core.theme, }; }; diff --git a/x-pack/plugins/lens/public/shared_components/empty_placeholder.tsx b/x-pack/plugins/lens/public/shared_components/empty_placeholder.tsx index 8115a9f647e94..ab69c6cc3139d 100644 --- a/x-pack/plugins/lens/public/shared_components/empty_placeholder.tsx +++ b/x-pack/plugins/lens/public/shared_components/empty_placeholder.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiIcon, EuiText, IconType, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; const noResultsMessage = ( diff --git a/x-pack/plugins/lens/public/types.ts b/x-pack/plugins/lens/public/types.ts index a9a9539064659..35620982447a5 100644 --- a/x-pack/plugins/lens/public/types.ts +++ b/x-pack/plugins/lens/public/types.ts @@ -26,6 +26,7 @@ import type { LensSortActionData, LensResizeActionData, LensToggleActionData, + LensPagesizeActionData, } from './datatable_visualization/components/types'; import type { UiActionsStart, @@ -37,6 +38,7 @@ import { LENS_EDIT_SORT_ACTION, LENS_EDIT_RESIZE_ACTION, LENS_TOGGLE_ACTION, + LENS_EDIT_PAGESIZE_ACTION, } from './datatable_visualization/components/constants'; import type { LensInspector } from './lens_inspector_service'; @@ -470,6 +472,7 @@ export type VisualizationDimensionGroupConfig = SharedDimensionProps & { supportsMoreColumns: boolean; /** If required, a warning will appear if accessors are empty */ required?: boolean; + requiredMinDimensionCount?: number; dataTestSubj?: string; /** @@ -782,6 +785,7 @@ export interface LensEditContextMapping { [LENS_EDIT_SORT_ACTION]: LensSortActionData; [LENS_EDIT_RESIZE_ACTION]: LensResizeActionData; [LENS_TOGGLE_ACTION]: LensToggleActionData; + [LENS_EDIT_PAGESIZE_ACTION]: LensPagesizeActionData; } type LensEditSupportedActions = keyof LensEditContextMapping; diff --git a/x-pack/plugins/lens/public/xy_visualization/expression.tsx b/x-pack/plugins/lens/public/xy_visualization/expression.tsx index 60d0fe85ed546..d22a8034cdf2b 100644 --- a/x-pack/plugins/lens/public/xy_visualization/expression.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/expression.tsx @@ -34,7 +34,7 @@ import { AxisStyle, ScaleType, } from '@elastic/charts'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import type { ExpressionRenderDefinition, Datatable, @@ -43,6 +43,8 @@ import type { import { IconType } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { RenderMode } from 'src/plugins/expressions'; +import { ThemeServiceStart } from 'kibana/public'; +import { KibanaThemeProvider } from '../../../../../src/plugins/kibana_react/public'; import type { ILensInterpreterRenderHandlers, LensFilterEvent, LensBrushEvent } from '../types'; import type { LensMultiTable, FormatFactory } from '../../common'; import { layerTypes } from '../../common'; @@ -134,6 +136,7 @@ export const getXyChartRenderer = (dependencies: { paletteService: PaletteRegistry; timeZone: string; useLegacyTimeAxis: boolean; + kibanaTheme: ThemeServiceStart; }): ExpressionRenderDefinition => ({ name: 'lens_xy_chart_renderer', displayName: 'XY chart', @@ -156,23 +159,25 @@ export const getXyChartRenderer = (dependencies: { }; ReactDOM.render( - - - , + + + + + , domNode, () => handlers.done() ); diff --git a/x-pack/plugins/lens/public/xy_visualization/index.ts b/x-pack/plugins/lens/public/xy_visualization/index.ts index 8ac9076919dd9..9697ba149e16e 100644 --- a/x-pack/plugins/lens/public/xy_visualization/index.ts +++ b/x-pack/plugins/lens/public/xy_visualization/index.ts @@ -39,9 +39,15 @@ export class XyVisualization { paletteService: palettes, timeZone: getTimeZone(core.uiSettings), useLegacyTimeAxis, + kibanaTheme: core.theme, }) ); - return getXyVisualization({ paletteService: palettes, fieldFormats, useLegacyTimeAxis }); + return getXyVisualization({ + paletteService: palettes, + fieldFormats, + useLegacyTimeAxis, + kibanaTheme: core.theme, + }); }); } } diff --git a/x-pack/plugins/lens/public/xy_visualization/to_expression.test.ts b/x-pack/plugins/lens/public/xy_visualization/to_expression.test.ts index 033e324a5d02d..ea4db04080f65 100644 --- a/x-pack/plugins/lens/public/xy_visualization/to_expression.test.ts +++ b/x-pack/plugins/lens/public/xy_visualization/to_expression.test.ts @@ -14,11 +14,13 @@ import { createMockDatasource, createMockFramePublicAPI } from '../mocks'; import { layerTypes } from '../../common'; import { fieldFormatsServiceMock } from '../../../../../src/plugins/field_formats/public/mocks'; import { defaultReferenceLineColor } from './color_assignment'; +import { themeServiceMock } from '../../../../../src/core/public/mocks'; describe('#toExpression', () => { const xyVisualization = getXyVisualization({ paletteService: chartPluginMock.createPaletteRegistry(), fieldFormats: fieldFormatsServiceMock.createStartContract(), + kibanaTheme: themeServiceMock.createStartContract(), useLegacyTimeAxis: false, }); let mockDatasource: ReturnType; diff --git a/x-pack/plugins/lens/public/xy_visualization/visualization.test.ts b/x-pack/plugins/lens/public/xy_visualization/visualization.test.ts index 029cfe8ecbe40..086e05b3e4622 100644 --- a/x-pack/plugins/lens/public/xy_visualization/visualization.test.ts +++ b/x-pack/plugins/lens/public/xy_visualization/visualization.test.ts @@ -16,6 +16,7 @@ import { LensIconChartBar } from '../assets/chart_bar'; import { chartPluginMock } from '../../../../../src/plugins/charts/public/mocks'; import { fieldFormatsServiceMock } from '../../../../../src/plugins/field_formats/public/mocks'; import { Datatable } from 'src/plugins/expressions'; +import { themeServiceMock } from '../../../../../src/core/public/mocks'; function exampleState(): State { return { @@ -41,6 +42,7 @@ const xyVisualization = getXyVisualization({ paletteService: paletteServiceMock, fieldFormats: fieldFormatsMock, useLegacyTimeAxis: false, + kibanaTheme: themeServiceMock.createStartContract(), }); describe('xy_visualization', () => { diff --git a/x-pack/plugins/lens/public/xy_visualization/visualization.tsx b/x-pack/plugins/lens/public/xy_visualization/visualization.tsx index 0ba74f4b8bb3a..d536a18b6ab79 100644 --- a/x-pack/plugins/lens/public/xy_visualization/visualization.tsx +++ b/x-pack/plugins/lens/public/xy_visualization/visualization.tsx @@ -9,10 +9,12 @@ import React from 'react'; import { groupBy, uniq } from 'lodash'; import { render } from 'react-dom'; import { Position } from '@elastic/charts'; -import { FormattedMessage, I18nProvider } from '@kbn/i18n/react'; +import { FormattedMessage, I18nProvider } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { PaletteRegistry } from 'src/plugins/charts/public'; import { FieldFormatsStart } from 'src/plugins/field_formats/public'; +import { ThemeServiceStart } from 'kibana/public'; +import { KibanaThemeProvider } from '../../../../../src/plugins/kibana_react/public'; import { getSuggestions } from './xy_suggestions'; import { XyToolbar, DimensionEditor } from './xy_config_panel'; import { LayerHeader } from './xy_config_panel/layer_header'; @@ -99,10 +101,12 @@ export const getXyVisualization = ({ paletteService, fieldFormats, useLegacyTimeAxis, + kibanaTheme, }: { paletteService: PaletteRegistry; fieldFormats: FieldFormatsStart; useLegacyTimeAxis: boolean; + kibanaTheme: ThemeServiceStart; }): Visualization => ({ id: 'lnsXY', @@ -565,31 +569,37 @@ export const getXyVisualization = ({ renderLayerHeader(domElement, props) { render( - - - , + + + + + , domElement ); }, renderToolbar(domElement, props) { render( - - - , + + + + + , domElement ); }, renderDimensionEditor(domElement, props) { render( - - - , + + + + + , domElement ); }, diff --git a/x-pack/plugins/lens/public/xy_visualization/xy_suggestions.test.ts b/x-pack/plugins/lens/public/xy_visualization/xy_suggestions.test.ts index fb2dd7aa85f36..d7b48553ce73a 100644 --- a/x-pack/plugins/lens/public/xy_visualization/xy_suggestions.test.ts +++ b/x-pack/plugins/lens/public/xy_visualization/xy_suggestions.test.ts @@ -14,6 +14,7 @@ import { chartPluginMock } from '../../../../../src/plugins/charts/public/mocks' import { PaletteOutput } from 'src/plugins/charts/public'; import { layerTypes } from '../../common'; import { fieldFormatsServiceMock } from '../../../../../src/plugins/field_formats/public/mocks'; +import { themeServiceMock } from '../../../../../src/core/public/mocks'; jest.mock('../id_generator'); @@ -21,6 +22,7 @@ const xyVisualization = getXyVisualization({ paletteService: chartPluginMock.createPaletteRegistry(), fieldFormats: fieldFormatsServiceMock.createStartContract(), useLegacyTimeAxis: false, + kibanaTheme: themeServiceMock.createStartContract(), }); describe('xy_suggestions', () => { diff --git a/x-pack/plugins/lens/tsconfig.json b/x-pack/plugins/lens/tsconfig.json index 16287ae596df3..25b7789d1e096 100644 --- a/x-pack/plugins/lens/tsconfig.json +++ b/x-pack/plugins/lens/tsconfig.json @@ -21,7 +21,7 @@ { "path": "../global_search/tsconfig.json"}, { "path": "../saved_objects_tagging/tsconfig.json"}, { "path": "../../../src/plugins/data/tsconfig.json"}, - { "path": "../../../src/plugins/index_pattern_field_editor/tsconfig.json"}, + { "path": "../../../src/plugins/data_view_field_editor/tsconfig.json"}, { "path": "../../../src/plugins/charts/tsconfig.json"}, { "path": "../../../src/plugins/expressions/tsconfig.json"}, { "path": "../../../src/plugins/navigation/tsconfig.json" }, diff --git a/x-pack/plugins/license_management/public/application/app.js b/x-pack/plugins/license_management/public/application/app.js index 4b5a6144dbdc9..b260c4ebfb7a8 100644 --- a/x-pack/plugins/license_management/public/application/app.js +++ b/x-pack/plugins/license_management/public/application/app.js @@ -6,7 +6,7 @@ */ import React, { Component } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { LicenseDashboard, UploadLicense } from './sections'; import { Switch, Route } from 'react-router-dom'; import { APP_PERMISSION } from '../../common/constants'; diff --git a/x-pack/plugins/license_management/public/application/components/telemetry_opt_in/telemetry_opt_in.tsx b/x-pack/plugins/license_management/public/application/components/telemetry_opt_in/telemetry_opt_in.tsx index d2179ac7e9107..f04506ef0e2c2 100644 --- a/x-pack/plugins/license_management/public/application/components/telemetry_opt_in/telemetry_opt_in.tsx +++ b/x-pack/plugins/license_management/public/application/components/telemetry_opt_in/telemetry_opt_in.tsx @@ -15,7 +15,7 @@ import { EuiPopover, EuiLoadingSpinner, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { TelemetryPluginStart } from '../../lib/telemetry'; const OptInExampleFlyout = React.lazy(() => import('./opt_in_example_flyout')); diff --git a/x-pack/plugins/license_management/public/application/sections/license_dashboard/add_license/add_license.js b/x-pack/plugins/license_management/public/application/sections/license_dashboard/add_license/add_license.js index 90de14b167e52..c0abdda244140 100644 --- a/x-pack/plugins/license_management/public/application/sections/license_dashboard/add_license/add_license.js +++ b/x-pack/plugins/license_management/public/application/sections/license_dashboard/add_license/add_license.js @@ -8,7 +8,7 @@ import React from 'react'; import { EuiCard, EuiButton } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useAppContext } from '../../../app_context'; import { reactRouterNavigate } from '../../../../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/license_management/public/application/sections/license_dashboard/license_page_header/license_page_header.js b/x-pack/plugins/license_management/public/application/sections/license_dashboard/license_page_header/license_page_header.js index df41d46ac5789..8990cd4b8df29 100644 --- a/x-pack/plugins/license_management/public/application/sections/license_dashboard/license_page_header/license_page_header.js +++ b/x-pack/plugins/license_management/public/application/sections/license_dashboard/license_page_header/license_page_header.js @@ -7,7 +7,7 @@ import React from 'react'; import { useSelector } from 'react-redux'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiPageHeader, EuiSpacer } from '@elastic/eui'; import { getLicenseState } from '../../../store/reducers/license_management'; diff --git a/x-pack/plugins/license_management/public/application/sections/license_dashboard/request_trial_extension/request_trial_extension.js b/x-pack/plugins/license_management/public/application/sections/license_dashboard/request_trial_extension/request_trial_extension.js index e578c372b9c9f..ae7708890d12b 100644 --- a/x-pack/plugins/license_management/public/application/sections/license_dashboard/request_trial_extension/request_trial_extension.js +++ b/x-pack/plugins/license_management/public/application/sections/license_dashboard/request_trial_extension/request_trial_extension.js @@ -8,7 +8,7 @@ import React from 'react'; import { EuiFlexItem, EuiCard, EuiLink, EuiButton } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EXTERNAL_LINKS } from '../../../../../common/constants'; export const RequestTrialExtension = ({ shouldShowRequestTrialExtension }) => { diff --git a/x-pack/plugins/license_management/public/application/sections/license_dashboard/revert_to_basic/revert_to_basic.js b/x-pack/plugins/license_management/public/application/sections/license_dashboard/revert_to_basic/revert_to_basic.js index bf827aa8b8c06..0a3c6d25ec5ac 100644 --- a/x-pack/plugins/license_management/public/application/sections/license_dashboard/revert_to_basic/revert_to_basic.js +++ b/x-pack/plugins/license_management/public/application/sections/license_dashboard/revert_to_basic/revert_to_basic.js @@ -8,7 +8,7 @@ import React from 'react'; import { EuiFlexItem, EuiCard, EuiButton, EuiLink, EuiConfirmModal, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EXTERNAL_LINKS } from '../../../../../common/constants'; export class RevertToBasic extends React.PureComponent { diff --git a/x-pack/plugins/license_management/public/application/sections/license_dashboard/start_trial/start_trial.tsx b/x-pack/plugins/license_management/public/application/sections/license_dashboard/start_trial/start_trial.tsx index 585b915c90d81..ff01d2ee7739a 100644 --- a/x-pack/plugins/license_management/public/application/sections/license_dashboard/start_trial/start_trial.tsx +++ b/x-pack/plugins/license_management/public/application/sections/license_dashboard/start_trial/start_trial.tsx @@ -22,7 +22,7 @@ import { EuiModalHeaderTitle, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { TelemetryOptIn } from '../../../components/telemetry_opt_in'; import { EXTERNAL_LINKS } from '../../../../../common/constants'; import { AppContextConsumer, AppDependencies } from '../../../app_context'; diff --git a/x-pack/plugins/license_management/public/application/sections/upload_license/upload_license.js b/x-pack/plugins/license_management/public/application/sections/upload_license/upload_license.js index 22933c6207a72..d10ca6278e86f 100644 --- a/x-pack/plugins/license_management/public/application/sections/upload_license/upload_license.js +++ b/x-pack/plugins/license_management/public/application/sections/upload_license/upload_license.js @@ -22,7 +22,7 @@ import { } from '@elastic/eui'; import { TelemetryOptIn } from '../../components/telemetry_opt_in'; import { shouldShowTelemetryOptIn } from '../../lib/telemetry'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { reactRouterNavigate } from '../../../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/licensing/public/expired_banner.tsx b/x-pack/plugins/licensing/public/expired_banner.tsx index 8a8021cd2def4..9a0d7473dc8d9 100644 --- a/x-pack/plugins/licensing/public/expired_banner.tsx +++ b/x-pack/plugins/licensing/public/expired_banner.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiCallOut } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { toMountPoint } from '../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/logstash/public/application/components/pipeline_editor/confirm_delete_pipeline_modal.js b/x-pack/plugins/logstash/public/application/components/pipeline_editor/confirm_delete_pipeline_modal.js index d8cf85919bd42..c559fbc605048 100644 --- a/x-pack/plugins/logstash/public/application/components/pipeline_editor/confirm_delete_pipeline_modal.js +++ b/x-pack/plugins/logstash/public/application/components/pipeline_editor/confirm_delete_pipeline_modal.js @@ -8,7 +8,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { EuiConfirmModal, EUI_MODAL_CANCEL_BUTTON } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { PIPELINE_EDITOR } from './constants'; export function ConfirmDeletePipelineModal({ id, cancelDeleteModal, confirmDeletePipeline }) { diff --git a/x-pack/plugins/logstash/public/application/components/pipeline_editor/pipeline_editor.js b/x-pack/plugins/logstash/public/application/components/pipeline_editor/pipeline_editor.js index 9d5f3b2d4af06..47692a5f94767 100644 --- a/x-pack/plugins/logstash/public/application/components/pipeline_editor/pipeline_editor.js +++ b/x-pack/plugins/logstash/public/application/components/pipeline_editor/pipeline_editor.js @@ -7,7 +7,7 @@ import React from 'react'; import { PropTypes } from 'prop-types'; -import { injectI18n, FormattedMessage } from '@kbn/i18n/react'; +import { injectI18n, FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import 'brace/mode/plain_text'; diff --git a/x-pack/plugins/logstash/public/application/components/pipeline_list/add_role_alert.js b/x-pack/plugins/logstash/public/application/components/pipeline_list/add_role_alert.js index be4d94bc516f5..a33ee33743e62 100644 --- a/x-pack/plugins/logstash/public/application/components/pipeline_list/add_role_alert.js +++ b/x-pack/plugins/logstash/public/application/components/pipeline_list/add_role_alert.js @@ -7,7 +7,7 @@ import React from 'react'; import { EuiCode } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function AddRoleAlert() { return ( diff --git a/x-pack/plugins/logstash/public/application/components/pipeline_list/alert_call_out.js b/x-pack/plugins/logstash/public/application/components/pipeline_list/alert_call_out.js index e191f1342231a..018e8be39e6ad 100644 --- a/x-pack/plugins/logstash/public/application/components/pipeline_list/alert_call_out.js +++ b/x-pack/plugins/logstash/public/application/components/pipeline_list/alert_call_out.js @@ -7,7 +7,7 @@ import React from 'react'; import { EuiCallOut } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { PIPELINE_LIST } from './constants'; export function AlertCallOut(props) { diff --git a/x-pack/plugins/logstash/public/application/components/pipeline_list/confirm_delete_modal.js b/x-pack/plugins/logstash/public/application/components/pipeline_list/confirm_delete_modal.js index 5dbefd2ae58e8..f7fe9b24bb5be 100644 --- a/x-pack/plugins/logstash/public/application/components/pipeline_list/confirm_delete_modal.js +++ b/x-pack/plugins/logstash/public/application/components/pipeline_list/confirm_delete_modal.js @@ -7,7 +7,7 @@ import React from 'react'; import { EuiConfirmModal, EUI_MODAL_CANCEL_BUTTON } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function ConfirmDeleteModal({ cancelDeletePipelines, diff --git a/x-pack/plugins/logstash/public/application/components/pipeline_list/enable_monitoring_alert.js b/x-pack/plugins/logstash/public/application/components/pipeline_list/enable_monitoring_alert.js index bb62ddb3f8e40..315ad8888c840 100644 --- a/x-pack/plugins/logstash/public/application/components/pipeline_list/enable_monitoring_alert.js +++ b/x-pack/plugins/logstash/public/application/components/pipeline_list/enable_monitoring_alert.js @@ -7,7 +7,7 @@ import React from 'react'; import { EuiCode } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function EnableMonitoringAlert() { return ( diff --git a/x-pack/plugins/logstash/public/application/components/pipeline_list/pipeline_list.js b/x-pack/plugins/logstash/public/application/components/pipeline_list/pipeline_list.js index 4772669daec62..a88f332b233a9 100644 --- a/x-pack/plugins/logstash/public/application/components/pipeline_list/pipeline_list.js +++ b/x-pack/plugins/logstash/public/application/components/pipeline_list/pipeline_list.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { injectI18n, FormattedMessage } from '@kbn/i18n/react'; +import { injectI18n, FormattedMessage } from '@kbn/i18n-react'; import { EuiCallOut, diff --git a/x-pack/plugins/logstash/public/application/components/pipeline_list/pipelines_table.js b/x-pack/plugins/logstash/public/application/components/pipeline_list/pipelines_table.js index 48ab288c9876c..002c4818e0815 100644 --- a/x-pack/plugins/logstash/public/application/components/pipeline_list/pipelines_table.js +++ b/x-pack/plugins/logstash/public/application/components/pipeline_list/pipelines_table.js @@ -8,7 +8,7 @@ import React from 'react'; import { EuiButton, EuiButtonEmpty, EuiIconTip, EuiInMemoryTable, EuiLink } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { injectI18n, FormattedMessage } from '@kbn/i18n/react'; +import { injectI18n, FormattedMessage } from '@kbn/i18n-react'; import { PIPELINE_LIST } from './constants'; function getColumns(openPipeline, clonePipeline) { diff --git a/x-pack/plugins/maps/public/classes/layers/heatmap_layer/heatmap_layer.ts b/x-pack/plugins/maps/public/classes/layers/heatmap_layer/heatmap_layer.ts index ff1aafab8d1b0..2bc79bfaea746 100644 --- a/x-pack/plugins/maps/public/classes/layers/heatmap_layer/heatmap_layer.ts +++ b/x-pack/plugins/maps/public/classes/layers/heatmap_layer/heatmap_layer.ts @@ -5,19 +5,16 @@ * 2.0. */ -import type { Map as MbMap, GeoJSONSource as MbGeoJSONSource } from '@kbn/mapbox-gl'; -import { FeatureCollection } from 'geojson'; +import type { Map as MbMap, VectorSource as MbVectorSource } from '@kbn/mapbox-gl'; import { AbstractLayer } from '../layer'; import { HeatmapStyle } from '../../styles/heatmap/heatmap_style'; -import { EMPTY_FEATURE_COLLECTION, LAYER_TYPE } from '../../../../common/constants'; +import { LAYER_TYPE } from '../../../../common/constants'; import { HeatmapLayerDescriptor } from '../../../../common/descriptor_types'; import { ESGeoGridSource } from '../../sources/es_geo_grid_source'; -import { addGeoJsonMbSource, getVectorSourceBounds, syncVectorSource } from '../vector_layer'; +import { getVectorSourceBounds, MvtSourceData, syncMvtSourceData } from '../vector_layer'; import { DataRequestContext } from '../../../actions'; -import { DataRequestAbortError } from '../../util/data_request'; import { buildVectorRequestMeta } from '../build_vector_request_meta'; - -const SCALED_PROPERTY_NAME = '__kbn_heatmap_weight__'; // unique name to store scaled value for weighting +import { ITiledSingleLayerVectorSource } from '../../sources/tiled_single_layer_vector_source'; export class HeatmapLayer extends AbstractLayer { private readonly _style: HeatmapStyle; @@ -67,11 +64,6 @@ export class HeatmapLayer extends AbstractLayer { return this._style; } - _getPropKeyOfSelectedMetric() { - const metricfields = this.getSource().getMetricFields(); - return metricfields[0].getName(); - } - _getHeatmapLayerId() { return this.makeMbLayerId('heatmap'); } @@ -89,81 +81,96 @@ export class HeatmapLayer extends AbstractLayer { } async syncData(syncContext: DataRequestContext) { - if (this.isLoadingBounds()) { - return; + await syncMvtSourceData({ + layerId: this.getId(), + prevDataRequest: this.getSourceDataRequest(), + requestMeta: buildVectorRequestMeta( + this.getSource(), + this.getSource().getFieldNames(), + syncContext.dataFilters, + this.getQuery(), + syncContext.isForceRefresh + ), + source: this.getSource() as ITiledSingleLayerVectorSource, + syncContext, + }); + } + + _requiresPrevSourceCleanup(mbMap: MbMap): boolean { + const mbSource = mbMap.getSource(this.getMbSourceId()) as MbVectorSource; + if (!mbSource) { + return false; } - try { - await syncVectorSource({ - layerId: this.getId(), - layerName: await this.getDisplayName(this.getSource()), - prevDataRequest: this.getSourceDataRequest(), - requestMeta: buildVectorRequestMeta( - this.getSource(), - this.getSource().getFieldNames(), - syncContext.dataFilters, - this.getQuery(), - syncContext.isForceRefresh - ), - syncContext, - source: this.getSource(), - getUpdateDueToTimeslice: () => { - return true; - }, - }); - } catch (error) { - if (!(error instanceof DataRequestAbortError)) { - throw error; - } + const sourceDataRequest = this.getSourceDataRequest(); + if (!sourceDataRequest) { + return false; } + const sourceData = sourceDataRequest.getData() as MvtSourceData | undefined; + if (!sourceData) { + return false; + } + + return mbSource.tiles?.[0] !== sourceData.urlTemplate; } syncLayerWithMB(mbMap: MbMap) { - addGeoJsonMbSource(this._getMbSourceId(), this.getMbLayerIds(), mbMap); + this._removeStaleMbSourcesAndLayers(mbMap); + + const sourceDataRequest = this.getSourceDataRequest(); + const sourceData = sourceDataRequest + ? (sourceDataRequest.getData() as MvtSourceData) + : undefined; + if (!sourceData) { + return; + } + + const mbSourceId = this.getMbSourceId(); + const mbSource = mbMap.getSource(mbSourceId); + if (!mbSource) { + mbMap.addSource(mbSourceId, { + type: 'vector', + tiles: [sourceData.urlTemplate], + minzoom: sourceData.minSourceZoom, + maxzoom: sourceData.maxSourceZoom, + }); + } const heatmapLayerId = this._getHeatmapLayerId(); if (!mbMap.getLayer(heatmapLayerId)) { mbMap.addLayer({ id: heatmapLayerId, type: 'heatmap', - source: this.getId(), + source: mbSourceId, + ['source-layer']: sourceData.layerName, paint: {}, }); } - const mbGeoJSONSource = mbMap.getSource(this.getId()) as MbGeoJSONSource; - const sourceDataRequest = this.getSourceDataRequest(); - const featureCollection = sourceDataRequest - ? (sourceDataRequest.getData() as FeatureCollection) - : null; - if (!featureCollection) { - mbGeoJSONSource.setData(EMPTY_FEATURE_COLLECTION); + const metricFields = this.getSource().getMetricFields(); + if (!metricFields.length) { return; } - - const propertyKey = this._getPropKeyOfSelectedMetric(); - const dataBoundToMap = AbstractLayer.getBoundDataForSource(mbMap, this.getId()); - if (featureCollection !== dataBoundToMap) { - let max = 1; // max will be at least one, since counts or sums will be at least one. - for (let i = 0; i < featureCollection.features.length; i++) { - max = Math.max(featureCollection.features[i].properties?.[propertyKey], max); + const metricField = metricFields[0]; + + // do not use tile meta features from previous urlTemplate to avoid styling new tiles from previous tile meta features + const tileMetaFeatures = this._requiresPrevSourceCleanup(mbMap) ? [] : this._getMetaFromTiles(); + let max = 0; + for (let i = 0; i < tileMetaFeatures.length; i++) { + const range = metricField.pluckRangeFromTileMetaFeature(tileMetaFeatures[i]); + if (range) { + max = Math.max(range.max, max); } - for (let i = 0; i < featureCollection.features.length; i++) { - if (featureCollection.features[i].properties) { - featureCollection.features[i].properties![SCALED_PROPERTY_NAME] = - featureCollection.features[i].properties![propertyKey] / max; - } - } - mbGeoJSONSource.setData(featureCollection); } - - this.syncVisibilityWithMb(mbMap, heatmapLayerId); this.getCurrentStyle().setMBPaintProperties({ mbMap, layerId: heatmapLayerId, - propertyName: SCALED_PROPERTY_NAME, + propertyName: metricField.getMbFieldName(), + max, resolution: this.getSource().getGridResolution(), }); + + this.syncVisibilityWithMb(mbMap, heatmapLayerId); mbMap.setPaintProperty(heatmapLayerId, 'heatmap-opacity', this.getAlpha()); mbMap.setLayerZoomRange(heatmapLayerId, this.getMinZoom(), this.getMaxZoom()); } diff --git a/x-pack/plugins/maps/public/classes/layers/layer.tsx b/x-pack/plugins/maps/public/classes/layers/layer.tsx index afd6519a100c1..99afa21a3f003 100644 --- a/x-pack/plugins/maps/public/classes/layers/layer.tsx +++ b/x-pack/plugins/maps/public/classes/layers/layer.tsx @@ -29,6 +29,7 @@ import { LayerDescriptor, MapExtent, StyleDescriptor, + TileMetaFeature, Timeslice, StyleMetaDescriptor, } from '../../../common/descriptor_types'; @@ -75,6 +76,11 @@ export interface ILayer { */ getMbLayerIds(): string[]; + /* + * ILayer.getMbSourceId returns mapbox source id assoicated with this layer. + */ + getMbSourceId(): string; + ownsMbLayerId(mbLayerId: string): boolean; ownsMbSourceId(mbSourceId: string): boolean; syncLayerWithMB(mbMap: MbMap, timeslice?: Timeslice): void; @@ -295,7 +301,7 @@ export class AbstractLayer implements ILayer { return this._source.getMinZoom(); } - _getMbSourceId() { + getMbSourceId() { return this.getId(); } @@ -475,4 +481,8 @@ export class AbstractLayer implements ILayer { isBasemap(order: number): boolean { return false; } + + _getMetaFromTiles(): TileMetaFeature[] { + return this._descriptor.__metaFromTiles || []; + } } diff --git a/x-pack/plugins/maps/public/classes/layers/tile_layer/tile_layer.ts b/x-pack/plugins/maps/public/classes/layers/tile_layer/tile_layer.ts index b8a9924606198..009b447402f9e 100644 --- a/x-pack/plugins/maps/public/classes/layers/tile_layer/tile_layer.ts +++ b/x-pack/plugins/maps/public/classes/layers/tile_layer/tile_layer.ts @@ -102,7 +102,7 @@ export class TileLayer extends AbstractLayer { return; } - const mbSourceId = this._getMbSourceId(); + const mbSourceId = this.getMbSourceId(); mbMap.addSource(mbSourceId, { type: 'raster', tiles: [tmsSourceData.url], diff --git a/x-pack/plugins/maps/public/classes/layers/vector_layer/geojson_vector_layer/geojson_vector_layer.tsx b/x-pack/plugins/maps/public/classes/layers/vector_layer/geojson_vector_layer/geojson_vector_layer.tsx index d675b4bfb2c4d..3f7c782ca469b 100644 --- a/x-pack/plugins/maps/public/classes/layers/vector_layer/geojson_vector_layer/geojson_vector_layer.tsx +++ b/x-pack/plugins/maps/public/classes/layers/vector_layer/geojson_vector_layer/geojson_vector_layer.tsx @@ -139,7 +139,7 @@ export class GeoJsonVectorLayer extends AbstractVectorLayer { } syncLayerWithMB(mbMap: MbMap, timeslice?: Timeslice) { - addGeoJsonMbSource(this._getMbSourceId(), this.getMbLayerIds(), mbMap); + addGeoJsonMbSource(this.getMbSourceId(), this.getMbLayerIds(), mbMap); this._syncFeatureCollectionWithMb(mbMap); diff --git a/x-pack/plugins/maps/public/classes/layers/vector_layer/index.ts b/x-pack/plugins/maps/public/classes/layers/vector_layer/index.ts index b3d7c47fbc71f..2f46bfa871934 100644 --- a/x-pack/plugins/maps/public/classes/layers/vector_layer/index.ts +++ b/x-pack/plugins/maps/public/classes/layers/vector_layer/index.ts @@ -15,4 +15,5 @@ export { isVectorLayer, NO_RESULTS_ICON_AND_TOOLTIPCONTENT } from './vector_laye export { BlendedVectorLayer } from './blended_vector_layer'; export { GeoJsonVectorLayer } from './geojson_vector_layer'; -export { MvtVectorLayer } from './mvt_vector_layer'; +export { MvtVectorLayer, syncMvtSourceData } from './mvt_vector_layer'; +export type { MvtSourceData } from './mvt_vector_layer'; diff --git a/x-pack/plugins/maps/public/classes/layers/vector_layer/mvt_vector_layer/index.ts b/x-pack/plugins/maps/public/classes/layers/vector_layer/mvt_vector_layer/index.ts index 85ff76f716a7b..f332ace6b26e0 100644 --- a/x-pack/plugins/maps/public/classes/layers/vector_layer/mvt_vector_layer/index.ts +++ b/x-pack/plugins/maps/public/classes/layers/vector_layer/mvt_vector_layer/index.ts @@ -6,3 +6,5 @@ */ export { MvtVectorLayer } from './mvt_vector_layer'; +export { syncMvtSourceData } from './mvt_source_data'; +export type { MvtSourceData } from './mvt_source_data'; diff --git a/x-pack/plugins/maps/public/classes/layers/vector_layer/mvt_vector_layer/mvt_source_data.test.ts b/x-pack/plugins/maps/public/classes/layers/vector_layer/mvt_vector_layer/mvt_source_data.test.ts new file mode 100644 index 0000000000000..0862ae69376d8 --- /dev/null +++ b/x-pack/plugins/maps/public/classes/layers/vector_layer/mvt_vector_layer/mvt_source_data.test.ts @@ -0,0 +1,292 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +jest.mock('uuid/v4', () => { + return function () { + return '12345'; + }; +}); + +import sinon from 'sinon'; +import { MockSyncContext } from '../../__fixtures__/mock_sync_context'; +import { ITiledSingleLayerVectorSource } from '../../../sources/tiled_single_layer_vector_source'; +import { DataRequest } from '../../../util/data_request'; +import { syncMvtSourceData } from './mvt_source_data'; + +const mockSource = { + getLayerName: () => { + return 'aggs'; + }, + getMinZoom: () => { + return 4; + }, + getMaxZoom: () => { + return 14; + }, + getUrlTemplateWithMeta: () => { + return { + refreshTokenParamName: 'token', + layerName: 'aggs', + minSourceZoom: 4, + maxSourceZoom: 14, + urlTemplate: 'https://example.com/{x}/{y}/{z}.pbf', + }; + }, + isTimeAware: () => { + return true; + }, + isFieldAware: () => { + return false; + }, + isQueryAware: () => { + return false; + }, + isGeoGridPrecisionAware: () => { + return false; + }, +} as unknown as ITiledSingleLayerVectorSource; + +describe('syncMvtSourceData', () => { + test('Should sync source data when there are no previous data request', async () => { + const syncContext = new MockSyncContext({ dataFilters: {} }); + + await syncMvtSourceData({ + layerId: 'layer1', + prevDataRequest: undefined, + requestMeta: { + ...syncContext.dataFilters, + applyGlobalQuery: true, + applyGlobalTime: true, + applyForceRefresh: true, + fieldNames: [], + sourceMeta: {}, + isForceRefresh: false, + }, + source: mockSource, + syncContext, + }); + // @ts-expect-error + sinon.assert.calledOnce(syncContext.startLoading); + // @ts-expect-error + sinon.assert.calledOnce(syncContext.stopLoading); + + // @ts-expect-error + const call = syncContext.stopLoading.getCall(0); + const sourceData = call.args[2]; + expect(sourceData).toEqual({ + minSourceZoom: 4, + maxSourceZoom: 14, + layerName: 'aggs', + refreshTokenParamName: 'token', + urlTemplate: 'https://example.com/{x}/{y}/{z}.pbf?token=12345', + urlToken: '12345', + }); + }); + + test('Should not re-sync when there are no changes in source state or search state', async () => { + const syncContext = new MockSyncContext({ dataFilters: {} }); + const prevRequestMeta = { + ...syncContext.dataFilters, + applyGlobalQuery: true, + applyGlobalTime: true, + applyForceRefresh: true, + fieldNames: [], + sourceMeta: {}, + isForceRefresh: false, + }; + + await syncMvtSourceData({ + layerId: 'layer1', + prevDataRequest: { + getMeta: () => { + return prevRequestMeta; + }, + getData: () => { + return { + minSourceZoom: 4, + maxSourceZoom: 14, + layerName: 'aggs', + refreshTokenParamName: 'token', + urlTemplate: 'https://example.com/{x}/{y}/{z}.pbf?token=12345', + urlToken: '12345', + }; + }, + } as unknown as DataRequest, + requestMeta: { ...prevRequestMeta }, + source: mockSource, + syncContext, + }); + // @ts-expect-error + sinon.assert.notCalled(syncContext.startLoading); + // @ts-expect-error + sinon.assert.notCalled(syncContext.stopLoading); + }); + + test('Should re-sync when there are changes to search state', async () => { + const syncContext = new MockSyncContext({ dataFilters: {} }); + const prevRequestMeta = { + ...syncContext.dataFilters, + applyGlobalQuery: true, + applyGlobalTime: true, + applyForceRefresh: true, + fieldNames: [], + sourceMeta: {}, + isForceRefresh: false, + }; + + await syncMvtSourceData({ + layerId: 'layer1', + prevDataRequest: { + getMeta: () => { + return prevRequestMeta; + }, + getData: () => { + return { + minSourceZoom: 4, + maxSourceZoom: 14, + layerName: 'aggs', + refreshTokenParamName: 'token', + urlTemplate: 'https://example.com/{x}/{y}/{z}.pbf?token=12345', + urlToken: '12345', + }; + }, + } as unknown as DataRequest, + requestMeta: { + ...prevRequestMeta, + timeFilters: { + from: 'now', + to: '30m', + mode: 'relative', + }, + }, + source: mockSource, + syncContext, + }); + + // @ts-expect-error + sinon.assert.calledOnce(syncContext.startLoading); + // @ts-expect-error + sinon.assert.calledOnce(syncContext.stopLoading); + }); + + test('Should re-sync when layerName source state changes: ', async () => { + const syncContext = new MockSyncContext({ dataFilters: {} }); + const prevRequestMeta = { + ...syncContext.dataFilters, + applyGlobalQuery: true, + applyGlobalTime: true, + applyForceRefresh: true, + fieldNames: [], + sourceMeta: {}, + isForceRefresh: false, + }; + + await syncMvtSourceData({ + layerId: 'layer1', + prevDataRequest: { + getMeta: () => { + return prevRequestMeta; + }, + getData: () => { + return { + minSourceZoom: 4, + maxSourceZoom: 14, + layerName: 'barfoo', // layerName is different then mockSource + refreshTokenParamName: 'token', + urlTemplate: 'https://example.com/{x}/{y}/{z}.pbf?token=12345', + urlToken: '12345', + }; + }, + } as unknown as DataRequest, + requestMeta: { ...prevRequestMeta }, + source: mockSource, + syncContext, + }); + // @ts-expect-error + sinon.assert.calledOnce(syncContext.startLoading); + // @ts-expect-error + sinon.assert.calledOnce(syncContext.stopLoading); + }); + + test('Should re-sync when minZoom source state changes: ', async () => { + const syncContext = new MockSyncContext({ dataFilters: {} }); + const prevRequestMeta = { + ...syncContext.dataFilters, + applyGlobalQuery: true, + applyGlobalTime: true, + applyForceRefresh: true, + fieldNames: [], + sourceMeta: {}, + isForceRefresh: false, + }; + + await syncMvtSourceData({ + layerId: 'layer1', + prevDataRequest: { + getMeta: () => { + return prevRequestMeta; + }, + getData: () => { + return { + minSourceZoom: 2, // minSourceZoom is different then mockSource + maxSourceZoom: 14, + layerName: 'aggs', + refreshTokenParamName: 'token', + urlTemplate: 'https://example.com/{x}/{y}/{z}.pbf?token=12345', + urlToken: '12345', + }; + }, + } as unknown as DataRequest, + requestMeta: { ...prevRequestMeta }, + source: mockSource, + syncContext, + }); + // @ts-expect-error + sinon.assert.calledOnce(syncContext.startLoading); + // @ts-expect-error + sinon.assert.calledOnce(syncContext.stopLoading); + }); + + test('Should re-sync when maxZoom source state changes: ', async () => { + const syncContext = new MockSyncContext({ dataFilters: {} }); + const prevRequestMeta = { + ...syncContext.dataFilters, + applyGlobalQuery: true, + applyGlobalTime: true, + applyForceRefresh: true, + fieldNames: [], + sourceMeta: {}, + isForceRefresh: false, + }; + + await syncMvtSourceData({ + layerId: 'layer1', + prevDataRequest: { + getMeta: () => { + return prevRequestMeta; + }, + getData: () => { + return { + minSourceZoom: 4, + maxSourceZoom: 9, // minSourceZoom is different then mockSource + layerName: 'aggs', + refreshTokenParamName: 'token', + urlTemplate: 'https://example.com/{x}/{y}/{z}.pbf?token=12345', + urlToken: '12345', + }; + }, + } as unknown as DataRequest, + requestMeta: { ...prevRequestMeta }, + source: mockSource, + syncContext, + }); + // @ts-expect-error + sinon.assert.calledOnce(syncContext.startLoading); + // @ts-expect-error + sinon.assert.calledOnce(syncContext.stopLoading); + }); +}); diff --git a/x-pack/plugins/maps/public/classes/layers/vector_layer/mvt_vector_layer/mvt_source_data.ts b/x-pack/plugins/maps/public/classes/layers/vector_layer/mvt_vector_layer/mvt_source_data.ts new file mode 100644 index 0000000000000..f38907db30ee7 --- /dev/null +++ b/x-pack/plugins/maps/public/classes/layers/vector_layer/mvt_vector_layer/mvt_source_data.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import uuid from 'uuid/v4'; +import { parse as parseUrl } from 'url'; +import { SOURCE_DATA_REQUEST_ID } from '../../../../../common/constants'; +import { Timeslice, VectorSourceRequestMeta } from '../../../../../common/descriptor_types'; +import { DataRequest } from '../../../util/data_request'; +import { DataRequestContext } from '../../../../actions'; +import { canSkipSourceUpdate } from '../../../util/can_skip_fetch'; +import { + ITiledSingleLayerMvtParams, + ITiledSingleLayerVectorSource, +} from '../../../sources/tiled_single_layer_vector_source'; + +// shape of sourceDataRequest.getData() +export type MvtSourceData = ITiledSingleLayerMvtParams & { + urlTemplate: string; + urlToken: string; +}; + +export async function syncMvtSourceData({ + layerId, + prevDataRequest, + requestMeta, + source, + syncContext, +}: { + layerId: string; + prevDataRequest: DataRequest | undefined; + requestMeta: VectorSourceRequestMeta; + source: ITiledSingleLayerVectorSource; + syncContext: DataRequestContext; +}): Promise { + const requestToken: symbol = Symbol(`${layerId}-${SOURCE_DATA_REQUEST_ID}`); + + const prevData = prevDataRequest ? (prevDataRequest.getData() as MvtSourceData) : undefined; + + if (prevData) { + const noChangesInSourceState: boolean = + prevData.layerName === source.getLayerName() && + prevData.minSourceZoom === source.getMinZoom() && + prevData.maxSourceZoom === source.getMaxZoom(); + const noChangesInSearchState: boolean = await canSkipSourceUpdate({ + extentAware: false, // spatial extent knowledge is already fully automated by tile-loading based on pan-zooming + source, + prevDataRequest, + nextRequestMeta: requestMeta, + getUpdateDueToTimeslice: (timeslice?: Timeslice) => { + return true; + }, + }); + const canSkip = noChangesInSourceState && noChangesInSearchState; + + if (canSkip) { + return; + } + } + + syncContext.startLoading(SOURCE_DATA_REQUEST_ID, requestToken, requestMeta); + try { + const urlToken = + !prevData || (requestMeta.isForceRefresh && requestMeta.applyForceRefresh) + ? uuid() + : prevData.urlToken; + + const newUrlTemplateAndMeta = await source.getUrlTemplateWithMeta(requestMeta); + + let urlTemplate; + if (newUrlTemplateAndMeta.refreshTokenParamName) { + const parsedUrl = parseUrl(newUrlTemplateAndMeta.urlTemplate, true); + const separator = !parsedUrl.query || Object.keys(parsedUrl.query).length === 0 ? '?' : '&'; + urlTemplate = `${newUrlTemplateAndMeta.urlTemplate}${separator}${newUrlTemplateAndMeta.refreshTokenParamName}=${urlToken}`; + } else { + urlTemplate = newUrlTemplateAndMeta.urlTemplate; + } + + const sourceData = { + ...newUrlTemplateAndMeta, + urlToken, + urlTemplate, + }; + syncContext.stopLoading(SOURCE_DATA_REQUEST_ID, requestToken, sourceData, {}); + } catch (error) { + syncContext.onLoadError(SOURCE_DATA_REQUEST_ID, requestToken, error.message); + } +} diff --git a/x-pack/plugins/maps/public/classes/layers/vector_layer/mvt_vector_layer/mvt_vector_layer.test.tsx b/x-pack/plugins/maps/public/classes/layers/vector_layer/mvt_vector_layer/mvt_vector_layer.test.tsx index b13a2c1c19647..a6c78f786f7e2 100644 --- a/x-pack/plugins/maps/public/classes/layers/vector_layer/mvt_vector_layer/mvt_vector_layer.test.tsx +++ b/x-pack/plugins/maps/public/classes/layers/vector_layer/mvt_vector_layer/mvt_vector_layer.test.tsx @@ -5,10 +5,6 @@ * 2.0. */ -import { MockSyncContext } from '../../__fixtures__/mock_sync_context'; -import sinon from 'sinon'; -import url from 'url'; - jest.mock('../../../../kibana_services', () => { return { getIsDarkMode() { @@ -22,7 +18,6 @@ import { shallow } from 'enzyme'; import { Feature } from 'geojson'; import { MVTSingleLayerVectorSource } from '../../../sources/mvt_single_layer_vector_source'; import { - DataRequestDescriptor, TiledSingleLayerVectorSourceDescriptor, VectorLayerDescriptor, } from '../../../../../common/descriptor_types'; @@ -112,130 +107,3 @@ describe('getFeatureById', () => { expect(feature).toEqual(null); }); }); - -describe('syncData', () => { - it('Should sync with source-params', async () => { - const layer: MvtVectorLayer = createLayer({}, {}); - - const syncContext = new MockSyncContext({ dataFilters: {} }); - - await layer.syncData(syncContext); - // @ts-expect-error - sinon.assert.calledOnce(syncContext.startLoading); - // @ts-expect-error - sinon.assert.calledOnce(syncContext.stopLoading); - - // @ts-expect-error - const call = syncContext.stopLoading.getCall(0); - expect(call.args[2]!.minSourceZoom).toEqual(defaultConfig.minSourceZoom); - expect(call.args[2]!.maxSourceZoom).toEqual(defaultConfig.maxSourceZoom); - expect(call.args[2]!.layerName).toEqual(defaultConfig.layerName); - expect(call.args[2]!.urlTemplate).toEqual(defaultConfig.urlTemplate); - }); - - it('Should not resync when no changes to source params', async () => { - const dataRequestDescriptor: DataRequestDescriptor = { - data: { ...defaultConfig }, - dataId: 'source', - }; - const layer: MvtVectorLayer = createLayer( - { - __dataRequests: [dataRequestDescriptor], - }, - {} - ); - const syncContext = new MockSyncContext({ dataFilters: {} }); - await layer.syncData(syncContext); - // @ts-expect-error - sinon.assert.notCalled(syncContext.startLoading); - // @ts-expect-error - sinon.assert.notCalled(syncContext.stopLoading); - }); - - it('Should resync when changes to syncContext', async () => { - const dataRequestDescriptor: DataRequestDescriptor = { - data: { ...defaultConfig }, - dataId: 'source', - }; - const layer: MvtVectorLayer = createLayer( - { - __dataRequests: [dataRequestDescriptor], - }, - {}, - true - ); - const syncContext = new MockSyncContext({ - dataFilters: { - timeFilters: { - from: 'now', - to: '30m', - mode: 'relative', - }, - }, - }); - await layer.syncData(syncContext); - // @ts-expect-error - sinon.assert.calledOnce(syncContext.startLoading); - // @ts-expect-error - sinon.assert.calledOnce(syncContext.stopLoading); - }); - - describe('Should resync when changes to source params: ', () => { - [{ layerName: 'barfoo' }, { minSourceZoom: 1 }, { maxSourceZoom: 12 }].forEach((changes) => { - it(`change in ${Object.keys(changes).join(',')}`, async () => { - const dataRequestDescriptor: DataRequestDescriptor = { - data: defaultConfig, - dataId: 'source', - }; - const layer: MvtVectorLayer = createLayer( - { - __dataRequests: [dataRequestDescriptor], - }, - changes - ); - const syncContext = new MockSyncContext({ dataFilters: {} }); - await layer.syncData(syncContext); - - // @ts-expect-error - sinon.assert.calledOnce(syncContext.startLoading); - // @ts-expect-error - sinon.assert.calledOnce(syncContext.stopLoading); - - // @ts-expect-error - const call = syncContext.stopLoading.getCall(0); - - const newMeta = { ...defaultConfig, ...changes }; - expect(call.args[2]!.minSourceZoom).toEqual(newMeta.minSourceZoom); - expect(call.args[2]!.maxSourceZoom).toEqual(newMeta.maxSourceZoom); - expect(call.args[2]!.layerName).toEqual(newMeta.layerName); - expect(call.args[2]!.urlTemplate).toEqual(newMeta.urlTemplate); - }); - }); - }); - - describe('refresh token', () => { - const uuidRegex = /\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b/; - - it(`should add token in url`, async () => { - const layer: MvtVectorLayer = createLayer({}, {}, false, true); - - const syncContext = new MockSyncContext({ dataFilters: {} }); - - await layer.syncData(syncContext); - // @ts-expect-error - sinon.assert.calledOnce(syncContext.startLoading); - // @ts-expect-error - sinon.assert.calledOnce(syncContext.stopLoading); - - // @ts-expect-error - const call = syncContext.stopLoading.getCall(0); - expect(call.args[2]!.minSourceZoom).toEqual(defaultConfig.minSourceZoom); - expect(call.args[2]!.maxSourceZoom).toEqual(defaultConfig.maxSourceZoom); - expect(call.args[2]!.layerName).toEqual(defaultConfig.layerName); - expect(call.args[2]!.urlTemplate.startsWith(defaultConfig.urlTemplate)).toBe(true); - - const parsedUrl = url.parse(call.args[2]!.urlTemplate, true); - expect(!!(parsedUrl.query.token! as string).match(uuidRegex)).toBe(true); - }); - }); -}); diff --git a/x-pack/plugins/maps/public/classes/layers/vector_layer/mvt_vector_layer/mvt_vector_layer.tsx b/x-pack/plugins/maps/public/classes/layers/vector_layer/mvt_vector_layer/mvt_vector_layer.tsx index 79cfc8ce00a54..e266c729f26fa 100644 --- a/x-pack/plugins/maps/public/classes/layers/vector_layer/mvt_vector_layer/mvt_vector_layer.tsx +++ b/x-pack/plugins/maps/public/classes/layers/vector_layer/mvt_vector_layer/mvt_vector_layer.tsx @@ -13,10 +13,8 @@ import type { } from '@kbn/mapbox-gl'; import { Feature } from 'geojson'; import { i18n } from '@kbn/i18n'; -import uuid from 'uuid/v4'; -import { parse as parseUrl } from 'url'; -import { IVectorStyle, VectorStyle } from '../../../styles/vector/vector_style'; -import { LAYER_TYPE, SOURCE_DATA_REQUEST_ID, SOURCE_TYPES } from '../../../../../common/constants'; +import { VectorStyle } from '../../../styles/vector/vector_style'; +import { LAYER_TYPE, SOURCE_TYPES } from '../../../../../common/constants'; import { NO_RESULTS_ICON_AND_TOOLTIPCONTENT, AbstractVectorLayer, @@ -27,16 +25,13 @@ import { DataRequestContext } from '../../../../actions'; import { StyleMetaDescriptor, TileMetaFeature, - Timeslice, VectorLayerDescriptor, - VectorSourceRequestMeta, } from '../../../../../common/descriptor_types'; -import { MVTSingleLayerVectorSourceConfig } from '../../../sources/mvt_single_layer_vector_source/types'; import { ESSearchSource } from '../../../sources/es_search_source'; -import { canSkipSourceUpdate } from '../../../util/can_skip_fetch'; import { LayerIcon } from '../../layer'; +import { MvtSourceData, syncMvtSourceData } from './mvt_source_data'; -const ES_MVT_META_LAYER_NAME = 'meta'; +export const ES_MVT_META_LAYER_NAME = 'meta'; const ES_MVT_HITS_TOTAL_RELATION = 'hits.total.relation'; const ES_MVT_HITS_TOTAL_VALUE = 'hits.total.value'; const MAX_RESULT_WINDOW_DATA_REQUEST_ID = 'maxResultWindow'; @@ -74,10 +69,6 @@ export class MvtVectorLayer extends AbstractVectorLayer { : feature.properties?._key; } - _getMetaFromTiles(): TileMetaFeature[] { - return this._descriptor.__metaFromTiles || []; - } - getLayerIcon(isTocIcon: boolean): LayerIcon { if (!this.getSource().isESSource()) { // Only ES-sources can have a special meta-tile, not 3rd party vector tile sources @@ -173,90 +164,29 @@ export class MvtVectorLayer extends AbstractVectorLayer { stopLoading(MAX_RESULT_WINDOW_DATA_REQUEST_ID, requestToken, { maxResultWindow }); } - async _syncMVTUrlTemplate({ - startLoading, - stopLoading, - onLoadError, - dataFilters, - isForceRefresh, - }: DataRequestContext) { - const requestToken: symbol = Symbol(`layer-${this.getId()}-${SOURCE_DATA_REQUEST_ID}`); - const requestMeta: VectorSourceRequestMeta = await this._getVectorSourceRequestMeta( - isForceRefresh, - dataFilters, - this.getSource(), - this._style as IVectorStyle - ); - const prevDataRequest = this.getSourceDataRequest(); - if (prevDataRequest) { - const data: MVTSingleLayerVectorSourceConfig = - prevDataRequest.getData() as MVTSingleLayerVectorSourceConfig; - if (data) { - const noChangesInSourceState: boolean = - data.layerName === this._source.getLayerName() && - data.minSourceZoom === this._source.getMinZoom() && - data.maxSourceZoom === this._source.getMaxZoom(); - const noChangesInSearchState: boolean = await canSkipSourceUpdate({ - extentAware: false, // spatial extent knowledge is already fully automated by tile-loading based on pan-zooming - source: this.getSource(), - prevDataRequest, - nextRequestMeta: requestMeta, - getUpdateDueToTimeslice: (timeslice?: Timeslice) => { - // TODO use meta features to determine if tiles already contain features for timeslice. - return true; - }, - }); - const canSkip = noChangesInSourceState && noChangesInSearchState; - - if (canSkip) { - return null; - } - } - } - - startLoading(SOURCE_DATA_REQUEST_ID, requestToken, requestMeta); - try { - const prevData = prevDataRequest - ? (prevDataRequest.getData() as MVTSingleLayerVectorSourceConfig) - : undefined; - const urlToken = - !prevData || (requestMeta.isForceRefresh && requestMeta.applyForceRefresh) - ? uuid() - : prevData.urlToken; - - const newUrlTemplateAndMeta = await this._source.getUrlTemplateWithMeta(requestMeta); - - let urlTemplate; - if (newUrlTemplateAndMeta.refreshTokenParamName) { - const parsedUrl = parseUrl(newUrlTemplateAndMeta.urlTemplate, true); - const separator = !parsedUrl.query || Object.keys(parsedUrl.query).length === 0 ? '?' : '&'; - urlTemplate = `${newUrlTemplateAndMeta.urlTemplate}${separator}${newUrlTemplateAndMeta.refreshTokenParamName}=${urlToken}`; - } else { - urlTemplate = newUrlTemplateAndMeta.urlTemplate; - } - - const urlTemplateAndMetaWithToken = { - ...newUrlTemplateAndMeta, - urlToken, - urlTemplate, - }; - stopLoading(SOURCE_DATA_REQUEST_ID, requestToken, urlTemplateAndMetaWithToken, {}); - } catch (error) { - onLoadError(SOURCE_DATA_REQUEST_ID, requestToken, error.message); - } - } - async syncData(syncContext: DataRequestContext) { if (this.getSource().getType() === SOURCE_TYPES.ES_SEARCH) { await this._syncMaxResultWindow(syncContext); } - await this._syncSourceStyleMeta(syncContext, this._source, this._style as IVectorStyle); - await this._syncSourceFormatters(syncContext, this._source, this._style as IVectorStyle); - await this._syncMVTUrlTemplate(syncContext); + await this._syncSourceStyleMeta(syncContext, this.getSource(), this.getCurrentStyle()); + await this._syncSourceFormatters(syncContext, this.getSource(), this.getCurrentStyle()); + + await syncMvtSourceData({ + layerId: this.getId(), + prevDataRequest: this.getSourceDataRequest(), + requestMeta: await this._getVectorSourceRequestMeta( + syncContext.isForceRefresh, + syncContext.dataFilters, + this.getSource(), + this.getCurrentStyle() + ), + source: this.getSource() as ITiledSingleLayerVectorSource, + syncContext, + }); } _syncSourceBindingWithMb(mbMap: MbMap) { - const mbSource = mbMap.getSource(this._getMbSourceId()); + const mbSource = mbMap.getSource(this.getMbSourceId()); if (mbSource) { return; } @@ -268,18 +198,17 @@ export class MvtVectorLayer extends AbstractVectorLayer { return; } - const sourceMeta: MVTSingleLayerVectorSourceConfig | null = - sourceDataRequest.getData() as MVTSingleLayerVectorSourceConfig; - if (!sourceMeta) { + const sourceData = sourceDataRequest.getData() as MvtSourceData | undefined; + if (!sourceData) { return; } - const mbSourceId = this._getMbSourceId(); + const mbSourceId = this.getMbSourceId(); mbMap.addSource(mbSourceId, { type: 'vector', - tiles: [sourceMeta.urlTemplate], - minzoom: sourceMeta.minSourceZoom, - maxzoom: sourceMeta.maxSourceZoom, + tiles: [sourceData.urlTemplate], + minzoom: sourceData.minSourceZoom, + maxzoom: sourceData.maxSourceZoom, }); } @@ -288,7 +217,7 @@ export class MvtVectorLayer extends AbstractVectorLayer { } ownsMbSourceId(mbSourceId: string): boolean { - return this._getMbSourceId() === mbSourceId; + return this.getMbSourceId() === mbSourceId; } _getMbTooManyFeaturesLayerId() { @@ -297,7 +226,7 @@ export class MvtVectorLayer extends AbstractVectorLayer { _syncStylePropertiesWithMb(mbMap: MbMap) { // @ts-ignore - const mbSource = mbMap.getSource(this._getMbSourceId()); + const mbSource = mbMap.getSource(this.getMbSourceId()); if (!mbSource) { return; } @@ -306,15 +235,14 @@ export class MvtVectorLayer extends AbstractVectorLayer { if (!sourceDataRequest) { return; } - const sourceMeta: MVTSingleLayerVectorSourceConfig = - sourceDataRequest.getData() as MVTSingleLayerVectorSourceConfig; - if (sourceMeta.layerName === '') { + const sourceData = sourceDataRequest.getData() as MvtSourceData | undefined; + if (!sourceData || sourceData.layerName === '') { return; } - this._setMbLabelProperties(mbMap, sourceMeta.layerName); - this._setMbPointsProperties(mbMap, sourceMeta.layerName); - this._setMbLinePolygonProperties(mbMap, sourceMeta.layerName); + this._setMbLabelProperties(mbMap, sourceData.layerName); + this._setMbPointsProperties(mbMap, sourceData.layerName); + this._setMbLinePolygonProperties(mbMap, sourceData.layerName); this._syncTooManyFeaturesProperties(mbMap); } @@ -359,66 +287,8 @@ export class MvtVectorLayer extends AbstractVectorLayer { mbMap.setLayerZoomRange(tooManyFeaturesLayerId, this.getMinZoom(), this.getMaxZoom()); } - queryTileMetaFeatures(mbMap: MbMap): TileMetaFeature[] | null { - if (!this.getSource().isESSource()) { - return null; - } - - // @ts-ignore - const mbSource = mbMap.getSource(this._getMbSourceId()); - if (!mbSource) { - return null; - } - - const sourceDataRequest = this.getSourceDataRequest(); - if (!sourceDataRequest) { - return null; - } - const sourceMeta: MVTSingleLayerVectorSourceConfig = - sourceDataRequest.getData() as MVTSingleLayerVectorSourceConfig; - if (sourceMeta.layerName === '') { - return null; - } - - // querySourceFeatures can return duplicated features when features cross tile boundaries. - // Tile meta will never have duplicated features since by there nature, tile meta is a feature contained within a single tile - const mbFeatures = mbMap.querySourceFeatures(this._getMbSourceId(), { - sourceLayer: ES_MVT_META_LAYER_NAME, - }); - - const metaFeatures: Array = ( - mbFeatures as unknown as TileMetaFeature[] - ).map((mbFeature: TileMetaFeature | null) => { - const parsedProperties: Record = {}; - for (const key in mbFeature?.properties) { - if (mbFeature?.properties.hasOwnProperty(key)) { - parsedProperties[key] = - typeof mbFeature.properties[key] === 'string' || - typeof mbFeature.properties[key] === 'number' || - typeof mbFeature.properties[key] === 'boolean' - ? mbFeature.properties[key] - : JSON.parse(mbFeature.properties[key]); // mvt properties cannot be nested geojson - } - } - - try { - return { - type: 'Feature', - id: mbFeature?.id, - geometry: mbFeature?.geometry, // this getter might throw with non-conforming geometries - properties: parsedProperties, - } as TileMetaFeature; - } catch (e) { - return null; - } - }); - - const filtered = metaFeatures.filter((f) => f !== null); - return filtered as TileMetaFeature[]; - } - _requiresPrevSourceCleanup(mbMap: MbMap): boolean { - const mbSource = mbMap.getSource(this._getMbSourceId()) as MbVectorSource | MbGeoJSONSource; + const mbSource = mbMap.getSource(this.getMbSourceId()) as MbVectorSource | MbGeoJSONSource; if (!mbSource) { return false; } @@ -428,21 +298,19 @@ export class MvtVectorLayer extends AbstractVectorLayer { } const mbTileSource = mbSource as MbVectorSource; - const dataRequest = this.getSourceDataRequest(); - if (!dataRequest) { + const sourceDataRequest = this.getSourceDataRequest(); + if (!sourceDataRequest) { return false; } - const tiledSourceMeta: MVTSingleLayerVectorSourceConfig | null = - dataRequest.getData() as MVTSingleLayerVectorSourceConfig; - - if (!tiledSourceMeta) { + const sourceData = sourceDataRequest.getData() as MvtSourceData | undefined; + if (!sourceData) { return false; } const isSourceDifferent = - mbTileSource.tiles?.[0] !== tiledSourceMeta.urlTemplate || - mbTileSource.minzoom !== tiledSourceMeta.minSourceZoom || - mbTileSource.maxzoom !== tiledSourceMeta.maxSourceZoom; + mbTileSource.tiles?.[0] !== sourceData.urlTemplate || + mbTileSource.minzoom !== sourceData.minSourceZoom || + mbTileSource.maxzoom !== sourceData.maxSourceZoom; if (isSourceDifferent) { return true; @@ -456,7 +324,7 @@ export class MvtVectorLayer extends AbstractVectorLayer { if ( mbLayer && // @ts-expect-error - mbLayer.sourceLayer !== tiledSourceMeta.layerName && + mbLayer.sourceLayer !== sourceData.layerName && // @ts-expect-error mbLayer.sourceLayer !== ES_MVT_META_LAYER_NAME ) { diff --git a/x-pack/plugins/maps/public/classes/layers/vector_tile_layer/vector_tile_layer.tsx b/x-pack/plugins/maps/public/classes/layers/vector_tile_layer/vector_tile_layer.tsx index dc682590d123b..f6c4e3fd057cf 100644 --- a/x-pack/plugins/maps/public/classes/layers/vector_tile_layer/vector_tile_layer.tsx +++ b/x-pack/plugins/maps/public/classes/layers/vector_tile_layer/vector_tile_layer.tsx @@ -116,7 +116,7 @@ export class VectorTileLayer extends TileLayer { return `${this.getId()}${DELIMITTER}${this.getSource().getTileLayerId()}${DELIMITTER}`; } - _generateMbSourceId(name: string) { + _generateMbSourceId(name: string | undefined) { return `${this._generateMbSourceIdPrefix()}${name}`; } @@ -241,10 +241,11 @@ export class VectorTileLayer extends TileLayer { } const newLayerObject = { ...layer, - source: + source: this._generateMbSourceId( typeof (layer as MbLayer).source === 'string' - ? this._generateMbSourceId((layer as MbLayer).source as string) - : undefined, + ? ((layer as MbLayer).source as string) + : undefined + ), id: mbLayerId, }; diff --git a/x-pack/plugins/maps/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.tsx b/x-pack/plugins/maps/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.tsx index ab94f239b2183..2f075b0e0ccad 100644 --- a/x-pack/plugins/maps/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.tsx +++ b/x-pack/plugins/maps/public/classes/layers/wizards/choropleth_layer_wizard/layer_template.tsx @@ -7,7 +7,7 @@ import React, { Component } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { FileLayer } from '@elastic/ems-client'; import { EuiComboBox, diff --git a/x-pack/plugins/maps/public/classes/sources/ems_file_source/update_source_editor.tsx b/x-pack/plugins/maps/public/classes/sources/ems_file_source/update_source_editor.tsx index 265a0f67f959c..a35d5c0cc6fa2 100644 --- a/x-pack/plugins/maps/public/classes/sources/ems_file_source/update_source_editor.tsx +++ b/x-pack/plugins/maps/public/classes/sources/ems_file_source/update_source_editor.tsx @@ -7,7 +7,7 @@ import React, { Component, Fragment } from 'react'; import { EuiTitle, EuiPanel, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { TooltipSelector } from '../../../components/tooltip_selector'; import { getEmsFileLayers } from '../../../util'; import { IEmsFileSource } from './ems_file_source'; diff --git a/x-pack/plugins/maps/public/classes/sources/ems_tms_source/update_source_editor.tsx b/x-pack/plugins/maps/public/classes/sources/ems_tms_source/update_source_editor.tsx index 6e1d5d9660eea..5f72d5cfa8df9 100644 --- a/x-pack/plugins/maps/public/classes/sources/ems_tms_source/update_source_editor.tsx +++ b/x-pack/plugins/maps/public/classes/sources/ems_tms_source/update_source_editor.tsx @@ -7,7 +7,7 @@ import React, { Fragment } from 'react'; import { EuiTitle, EuiPanel, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EmsTmsSourceConfig, TileServiceSelect } from './tile_service_select'; import { OnSourceChangeArgs } from '../source'; diff --git a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/__snapshots__/resolution_editor.test.tsx.snap b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/__snapshots__/resolution_editor.test.tsx.snap index 6a1dbf9e1590b..75b865a936238 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/__snapshots__/resolution_editor.test.tsx.snap +++ b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/__snapshots__/resolution_editor.test.tsx.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`resolution editor should add super-fine option 1`] = ` +exports[`render 1`] = ` `; - -exports[`resolution editor should omit super-fine option 1`] = ` - - - - - -`; diff --git a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/__snapshots__/update_source_editor.test.tsx.snap b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/__snapshots__/update_source_editor.test.tsx.snap index 0d4467792e636..e6c6303642a6b 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/__snapshots__/update_source_editor.test.tsx.snap +++ b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/__snapshots__/update_source_editor.test.tsx.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`source editor geo_grid_source default vector layer config should allow super-fine option 1`] = ` +exports[`source editor geo_grid_source should not allow editing multiple metrics for heatmap 1`] = ` @@ -44,7 +45,6 @@ exports[`source editor geo_grid_source default vector layer config should allow size="m" /> `; -exports[`source editor geo_grid_source should put limitations based on heatmap-rendering selection should not allow super-fine option for heatmaps and should not allow multiple metrics 1`] = ` +exports[`source editor geo_grid_source should render editor 1`] = ` @@ -106,7 +105,6 @@ exports[`source editor geo_grid_source should put limitations based on heatmap-r size="m" /> { metrics: [], resolution: GRID_RESOLUTION.COARSE, type: SOURCE_TYPES.ES_GEO_GRID, - requestType: RENDER_AS.HEATMAP, + requestType: RENDER_AS.POINT, }, {} ); @@ -316,7 +316,7 @@ describe('ESGeoGridSource', () => { expect(urlTemplateWithMeta.minSourceZoom).toBe(0); expect(urlTemplateWithMeta.maxSourceZoom).toBe(24); expect(urlTemplateWithMeta.urlTemplate).toEqual( - "rootdir/api/maps/mvt/getGridTile/{z}/{x}/{y}.pbf?geometryFieldName=bar&index=undefined&requestBody=(foobar:ES_DSL_PLACEHOLDER,params:('0':('0':index,'1':(fields:())),'1':('0':size,'1':0),'2':('0':filter,'1':!()),'3':('0':query),'4':('0':index,'1':(fields:())),'5':('0':query,'1':(language:KQL,query:'')),'6':('0':aggs,'1':())))&requestType=heatmap" + "rootdir/api/maps/mvt/getGridTile/{z}/{x}/{y}.pbf?geometryFieldName=bar&index=undefined&gridPrecision=8&requestBody=(foobar:ES_DSL_PLACEHOLDER,params:('0':('0':index,'1':(fields:())),'1':('0':size,'1':0),'2':('0':filter,'1':!()),'3':('0':query),'4':('0':index,'1':(fields:())),'5':('0':query,'1':(language:KQL,query:'')),'6':('0':aggs,'1':())))&requestType=point" ); }); }); diff --git a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx index 88ccfafe6f28f..8aa5758ad2572 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx +++ b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.tsx @@ -48,11 +48,11 @@ import { Adapters } from '../../../../../../../src/plugins/inspector/common/adap import { isValidStringConfig } from '../../util/valid_string_config'; import { ITiledSingleLayerMvtParams } from '../tiled_single_layer_vector_source/tiled_single_layer_vector_source'; -type ESGeoGridSourceSyncMeta = Pick; +type ESGeoGridSourceSyncMeta = Pick; const ES_MVT_AGGS_LAYER_NAME = 'aggs'; -export const MAX_GEOTILE_LEVEL = 29; +const MAX_GEOTILE_LEVEL = 29; export const clustersTitle = i18n.translate('xpack.maps.source.esGridClustersTitle', { defaultMessage: 'Clusters and grids', @@ -103,6 +103,7 @@ export class ESGeoGridSource extends AbstractESAggSource implements ITiledSingle getSyncMeta(): ESGeoGridSourceSyncMeta { return { requestType: this._descriptor.requestType, + resolution: this._descriptor.resolution, }; } @@ -134,6 +135,10 @@ export class ESGeoGridSource extends AbstractESAggSource implements ITiledSingle } isMvt() { + // heatmap uses MVT regardless of resolution because heatmap only supports counting metrics + if (this._descriptor.requestType === RENDER_AS.HEATMAP) { + return true; + } return this._descriptor.resolution === GRID_RESOLUTION.SUPER_FINE; } @@ -142,7 +147,7 @@ export class ESGeoGridSource extends AbstractESAggSource implements ITiledSingle } isGeoGridPrecisionAware(): boolean { - if (this._descriptor.resolution === GRID_RESOLUTION.SUPER_FINE) { + if (this.isMvt()) { // MVT gridded data should not bootstrap each time the precision changes // mapbox-gl needs to handle this return false; @@ -183,6 +188,10 @@ export class ESGeoGridSource extends AbstractESAggSource implements ITiledSingle return 4; } + if (this._descriptor.resolution === GRID_RESOLUTION.SUPER_FINE) { + return 8; + } + throw new Error( i18n.translate('xpack.maps.source.esGrid.resolutionParamErrorMessage', { defaultMessage: `Grid resolution param not recognized: {resolution}`, @@ -415,10 +424,12 @@ export class ESGeoGridSource extends AbstractESAggSource implements ITiledSingle } as GeoJsonWithMeta; } + // TODO rename to getMvtSourceLayerName getLayerName(): string { return ES_MVT_AGGS_LAYER_NAME; } + // TODO rename to getMvtUrlTemplateWithMeta async getUrlTemplateWithMeta( searchFilters: VectorSourceRequestMeta ): Promise { @@ -433,11 +444,15 @@ export class ESGeoGridSource extends AbstractESAggSource implements ITiledSingle `/${GIS_API_PATH}/${MVT_GETGRIDTILE_API_PATH}/{z}/{x}/{y}.pbf` ); + const requestType = + this._descriptor.requestType === RENDER_AS.GRID ? RENDER_AS.GRID : RENDER_AS.POINT; + const urlTemplate = `${mvtUrlServicePath}\ ?geometryFieldName=${this._descriptor.geoField}\ &index=${indexPattern.title}\ +&gridPrecision=${this._getGeoGridPrecisionResolutionDelta()}\ &requestBody=${risonDsl}\ -&requestType=${this._descriptor.requestType}`; +&requestType=${requestType}`; return { refreshTokenParamName: MVT_TOKEN_PARAM_NAME, @@ -449,7 +464,7 @@ export class ESGeoGridSource extends AbstractESAggSource implements ITiledSingle } isFilterByMapBounds(): boolean { - if (this._descriptor.resolution === GRID_RESOLUTION.SUPER_FINE) { + if (this.isMvt()) { // MVT gridded data. Should exclude bounds-filter from ES-DSL return false; } else { diff --git a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/resolution_editor.test.tsx b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/resolution_editor.test.tsx index a642bbe41449f..a323e3774fe41 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/resolution_editor.test.tsx +++ b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/resolution_editor.test.tsx @@ -14,17 +14,10 @@ import { GRID_RESOLUTION } from '../../../../common/constants'; const defaultProps = { resolution: GRID_RESOLUTION.COARSE, onChange: () => {}, - includeSuperFine: false, metrics: [], }; -describe('resolution editor', () => { - test('should omit super-fine option', () => { - const component = shallow(); - expect(component).toMatchSnapshot(); - }); - test('should add super-fine option', () => { - const component = shallow(); - expect(component).toMatchSnapshot(); - }); +test('render', () => { + const component = shallow(); + expect(component).toMatchSnapshot(); }); diff --git a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/resolution_editor.tsx b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/resolution_editor.tsx index 55ce46e121273..5e554ae6566e1 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/resolution_editor.tsx +++ b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/resolution_editor.tsx @@ -7,12 +7,12 @@ import React, { ChangeEvent, Component } from 'react'; import { EuiConfirmModal, EuiSelect, EuiFormRow } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { AggDescriptor } from '../../../../common/descriptor_types'; import { AGG_TYPE, GRID_RESOLUTION } from '../../../../common/constants'; -const BASE_OPTIONS = [ +const OPTIONS = [ { value: GRID_RESOLUTION.COARSE, text: i18n.translate('xpack.maps.source.esGrid.coarseDropdownOption', { @@ -31,6 +31,12 @@ const BASE_OPTIONS = [ defaultMessage: 'finest', }), }, + { + value: GRID_RESOLUTION.SUPER_FINE, + text: i18n.translate('xpack.maps.source.esGrid.superFineDropDownOption', { + defaultMessage: 'super fine', + }), + }, ]; function isUnsupportedVectorTileMetric(metric: AggDescriptor) { @@ -38,7 +44,6 @@ function isUnsupportedVectorTileMetric(metric: AggDescriptor) { } interface Props { - includeSuperFine: boolean; resolution: GRID_RESOLUTION; onChange: (resolution: GRID_RESOLUTION, metrics: AggDescriptor[]) => void; metrics: AggDescriptor[]; @@ -49,24 +54,9 @@ interface State { } export class ResolutionEditor extends Component { - private readonly _options = [...BASE_OPTIONS]; - - constructor(props: Props) { - super(props); - - this.state = { - showModal: false, - }; - - if (props.includeSuperFine) { - this._options.push({ - value: GRID_RESOLUTION.SUPER_FINE, - text: i18n.translate('xpack.maps.source.esGrid.superFineDropDownOption', { - defaultMessage: 'super fine', - }), - }); - } - } + state: State = { + showModal: false, + }; _onResolutionChange = (e: ChangeEvent) => { const resolution = e.target.value as GRID_RESOLUTION; @@ -149,7 +139,7 @@ export class ResolutionEditor extends Component { display="columnCompressed" > { - describe('default vector layer config', () => { - test('should allow super-fine option', async () => { - const component = shallow(); - expect(component).toMatchSnapshot(); - }); + test('should render editor', async () => { + const component = shallow(); + expect(component).toMatchSnapshot(); }); - describe('should put limitations based on heatmap-rendering selection', () => { - test('should not allow super-fine option for heatmaps and should not allow multiple metrics', async () => { - const component = shallow( - - ); - expect(component).toMatchSnapshot(); - }); + test('should not allow editing multiple metrics for heatmap', async () => { + const component = shallow( + + ); + expect(component).toMatchSnapshot(); }); }); diff --git a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/update_source_editor.tsx b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/update_source_editor.tsx index 03b5e1fe3c794..60a4c56fdb3b8 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/update_source_editor.tsx +++ b/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/update_source_editor.tsx @@ -8,7 +8,7 @@ import React, { Fragment, Component } from 'react'; import uuid from 'uuid/v4'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiPanel, EuiSpacer, EuiComboBoxOptionOption, EuiTitle } from '@elastic/eui'; import { getDataViewNotFoundMessage } from '../../../../common/i18n_getters'; import { AGG_TYPE, GRID_RESOLUTION, LAYER_TYPE, RENDER_AS } from '../../../../common/constants'; @@ -86,14 +86,6 @@ export class UpdateSourceEditor extends Component { ) { newLayerType = resolution === GRID_RESOLUTION.SUPER_FINE ? LAYER_TYPE.TILED_VECTOR : LAYER_TYPE.VECTOR; - } else if (this.props.currentLayerType === LAYER_TYPE.HEATMAP) { - if (resolution === GRID_RESOLUTION.SUPER_FINE) { - throw new Error('Heatmap does not support SUPER_FINE resolution'); - } else { - newLayerType = LAYER_TYPE.HEATMAP; - } - } else { - throw new Error('Unexpected layer-type'); } await this.props.onChange( @@ -163,7 +155,6 @@ export class UpdateSourceEditor extends Component { ; diff --git a/x-pack/plugins/maps/public/classes/styles/vector/components/data_mapping/ordinal_data_mapping_popover.tsx b/x-pack/plugins/maps/public/classes/styles/vector/components/data_mapping/ordinal_data_mapping_popover.tsx index f9fa5be10a23e..6d6b3535fe911 100644 --- a/x-pack/plugins/maps/public/classes/styles/vector/components/data_mapping/ordinal_data_mapping_popover.tsx +++ b/x-pack/plugins/maps/public/classes/styles/vector/components/data_mapping/ordinal_data_mapping_popover.tsx @@ -19,7 +19,7 @@ import { EuiToolTip, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { DEFAULT_SIGMA } from '../../vector_style_defaults'; import { DataMappingPopover } from './data_mapping_popover'; import { FieldMetaOptions } from '../../../../../../common/descriptor_types'; diff --git a/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts b/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts index 8ee9d30ecbf89..e2d93a6937675 100644 --- a/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts +++ b/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.test.ts @@ -108,6 +108,40 @@ describe('getESFilters', () => { ]); }); + test('Should return phrase filters when field value is an array', async () => { + const esTooltipProperty = new ESTooltipProperty( + new TooltipProperty(featurePropertyField.getName(), await featurePropertyField.getLabel(), [ + 'my value', + 'my other value', + ]), + indexPattern, + featurePropertyField, + APPLY_GLOBAL_QUERY + ); + expect(await esTooltipProperty.getESFilters()).toEqual([ + { + meta: { + index: 'indexPatternId', + }, + query: { + match_phrase: { + ['machine.os']: 'my value', + }, + }, + }, + { + meta: { + index: 'indexPatternId', + }, + query: { + match_phrase: { + ['machine.os']: 'my other value', + }, + }, + }, + ]); + }); + test('Should return NOT exists filter for null values', async () => { const esTooltipProperty = new ESTooltipProperty( new TooltipProperty( diff --git a/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts b/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts index 8b08d3a195a34..1b677b196c997 100644 --- a/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts +++ b/x-pack/plugins/maps/public/classes/tooltips/es_tooltip_property.ts @@ -96,13 +96,16 @@ export class ESTooltipProperty implements ITooltipProperty { return []; } - const value = this.getRawValue(); - if (value == null) { + const rawValue = this.getRawValue(); + if (rawValue == null) { const existsFilter = esFilters.buildExistsFilter(indexPatternField, this._indexPattern); existsFilter.meta.negate = true; return [existsFilter]; } else { - return [esFilters.buildPhraseFilter(indexPatternField, value as string, this._indexPattern)]; + const values = Array.isArray(rawValue) ? (rawValue as string[]) : [rawValue as string]; + return values.map((value) => { + return esFilters.buildPhraseFilter(indexPatternField, value, this._indexPattern); + }); } } } diff --git a/x-pack/plugins/maps/public/components/geo_index_pattern_select.tsx b/x-pack/plugins/maps/public/components/geo_index_pattern_select.tsx index aee879e3b4183..bab407dfd0e8d 100644 --- a/x-pack/plugins/maps/public/components/geo_index_pattern_select.tsx +++ b/x-pack/plugins/maps/public/components/geo_index_pattern_select.tsx @@ -8,7 +8,7 @@ import React, { Component } from 'react'; import { EuiCallOut, EuiFormRow, EuiLink, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { IndexPattern } from 'src/plugins/data/public'; import { getIndexPatternSelectComponent, diff --git a/x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx b/x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx index c3782d9be73d2..a28e4e8df6c3b 100644 --- a/x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx +++ b/x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import { EuiButtonEmpty, EuiComboBoxOptionOption, EuiFieldText, EuiFormRow } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { IndexPatternField } from 'src/plugins/data/public'; import { MetricSelect } from './metric_select'; import { SingleFieldSelect } from '../single_field_select'; diff --git a/x-pack/plugins/maps/public/components/metrics_editor/metrics_editor.tsx b/x-pack/plugins/maps/public/components/metrics_editor/metrics_editor.tsx index 17baa7eb355d6..bcc77eb972183 100644 --- a/x-pack/plugins/maps/public/components/metrics_editor/metrics_editor.tsx +++ b/x-pack/plugins/maps/public/components/metrics_editor/metrics_editor.tsx @@ -6,7 +6,7 @@ */ import React, { Component, Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, EuiComboBoxOptionOption, EuiSpacer, EuiTextAlign } from '@elastic/eui'; import type { IndexPatternField } from 'src/plugins/data/public'; import { MetricEditor } from './metric_editor'; diff --git a/x-pack/plugins/maps/public/components/tooltip_selector/add_tooltip_field_popover.tsx b/x-pack/plugins/maps/public/components/tooltip_selector/add_tooltip_field_popover.tsx index 3c702b1334272..2923fbbb342a9 100644 --- a/x-pack/plugins/maps/public/components/tooltip_selector/add_tooltip_field_popover.tsx +++ b/x-pack/plugins/maps/public/components/tooltip_selector/add_tooltip_field_popover.tsx @@ -19,7 +19,7 @@ import { EuiSpacer, EuiTextAlign, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { FieldIcon } from '@kbn/react-field/field_icon'; diff --git a/x-pack/plugins/maps/public/components/tooltip_selector/tooltip_selector.tsx b/x-pack/plugins/maps/public/components/tooltip_selector/tooltip_selector.tsx index 1a4c8e36b3457..bd178047b2251 100644 --- a/x-pack/plugins/maps/public/components/tooltip_selector/tooltip_selector.tsx +++ b/x-pack/plugins/maps/public/components/tooltip_selector/tooltip_selector.tsx @@ -17,7 +17,7 @@ import { EuiTextColor, EuiSpacer, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { AddTooltipFieldPopover, FieldProps } from './add_tooltip_field_popover'; import { IField } from '../../classes/fields/field'; diff --git a/x-pack/plugins/maps/public/components/validated_range.js b/x-pack/plugins/maps/public/components/validated_range.js index 8a00a8dc71053..a5dfa1e82e798 100644 --- a/x-pack/plugins/maps/public/components/validated_range.js +++ b/x-pack/plugins/maps/public/components/validated_range.js @@ -8,7 +8,7 @@ import React from 'react'; import { EuiRange, EuiFormErrorText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; function isWithinRange(min, max, value) { if (value >= min && value <= max) { diff --git a/x-pack/plugins/maps/public/connected_components/add_layer_panel/flyout_body/flyout_body.tsx b/x-pack/plugins/maps/public/connected_components/add_layer_panel/flyout_body/flyout_body.tsx index 4b3ad3f19ef2e..10f288704056c 100644 --- a/x-pack/plugins/maps/public/connected_components/add_layer_panel/flyout_body/flyout_body.tsx +++ b/x-pack/plugins/maps/public/connected_components/add_layer_panel/flyout_body/flyout_body.tsx @@ -7,7 +7,7 @@ import React, { Fragment } from 'react'; import { EuiButtonEmpty, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { LayerWizardSelect } from './layer_wizard_select'; import { LayerWizard, RenderWizardArguments } from '../../../classes/layers'; diff --git a/x-pack/plugins/maps/public/connected_components/add_layer_panel/flyout_body/layer_wizard_select.tsx b/x-pack/plugins/maps/public/connected_components/add_layer_panel/flyout_body/layer_wizard_select.tsx index d21389f8f6958..b14dd880d23a5 100644 --- a/x-pack/plugins/maps/public/connected_components/add_layer_panel/flyout_body/layer_wizard_select.tsx +++ b/x-pack/plugins/maps/public/connected_components/add_layer_panel/flyout_body/layer_wizard_select.tsx @@ -18,7 +18,7 @@ import { EuiToolTip, EuiSpacer, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { getLayerWizards, LayerWizard, LayerWizardWithMeta } from '../../../classes/layers'; import { LAYER_WIZARD_CATEGORY } from '../../../../common/constants'; diff --git a/x-pack/plugins/maps/public/connected_components/add_layer_panel/view.tsx b/x-pack/plugins/maps/public/connected_components/add_layer_panel/view.tsx index e6f954e75f169..6cb5c94c5cd82 100644 --- a/x-pack/plugins/maps/public/connected_components/add_layer_panel/view.tsx +++ b/x-pack/plugins/maps/public/connected_components/add_layer_panel/view.tsx @@ -16,7 +16,7 @@ import { EuiButtonEmpty, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { FlyoutBody } from './flyout_body'; import { LayerDescriptor } from '../../../common/descriptor_types'; import { LayerWizard } from '../../classes/layers'; diff --git a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/filter_editor/filter_editor.tsx b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/filter_editor/filter_editor.tsx index 548344466cac9..2cb8d9659be6c 100644 --- a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/filter_editor/filter_editor.tsx +++ b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/filter_editor/filter_editor.tsx @@ -21,7 +21,7 @@ import { EuiFlexItem, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import type { IndexPattern, Query } from 'src/plugins/data/public'; import { APP_ID } from '../../../../common/constants'; diff --git a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/flyout_footer/flyout_footer.tsx b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/flyout_footer/flyout_footer.tsx index b55f9488e1f76..b9761f5d48430 100644 --- a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/flyout_footer/flyout_footer.tsx +++ b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/flyout_footer/flyout_footer.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiButtonEmpty } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export interface Props { cancelLayerPanel: () => void; diff --git a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/join_editor.tsx b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/join_editor.tsx index 24cdd9b7dc813..3483b0011b127 100644 --- a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/join_editor.tsx +++ b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/join_editor.tsx @@ -17,7 +17,7 @@ import { EuiCallOut, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { Join } from './resources/join'; import { IVectorLayer } from '../../../classes/layers/vector_layer'; diff --git a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.tsx b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.tsx index 71aa5bf1ad88a..169dceaccc471 100644 --- a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.tsx +++ b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join_expression.tsx @@ -19,7 +19,7 @@ import { import { i18n } from '@kbn/i18n'; import { IndexPatternField } from 'src/plugins/data/public'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { getDataViewSelectPlaceholder } from '../../../../../common/i18n_getters'; import { DEFAULT_MAX_BUCKETS_LIMIT } from '../../../../../common/constants'; import { SingleFieldSelect } from '../../../../components/single_field_select'; diff --git a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.tsx b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.tsx index 4c2e96498ee20..1eaa9a5691fb3 100644 --- a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.tsx +++ b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/metrics_expression.tsx @@ -16,7 +16,7 @@ import { } from '@elastic/eui'; import { IndexPatternField } from 'src/plugins/data/public'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { MetricsEditor } from '../../../../components/metrics_editor'; import { AGG_TYPE } from '../../../../../common/constants'; import { AggDescriptor, FieldedAggDescriptor } from '../../../../../common/descriptor_types'; diff --git a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/where_expression.tsx b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/where_expression.tsx index 16cef0d5bdad6..41acd7286c568 100644 --- a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/where_expression.tsx +++ b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/where_expression.tsx @@ -8,7 +8,7 @@ import React, { Component } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiButton, EuiPopover, EuiExpression, EuiFormHelpText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { IndexPattern, Query } from 'src/plugins/data/public'; import { APP_ID } from '../../../../../common/constants'; import { getData } from '../../../../kibana_services'; diff --git a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/layer_settings/attribution_form_row.tsx b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/layer_settings/attribution_form_row.tsx index 10ad495d59cb7..bdab63e1029e7 100644 --- a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/layer_settings/attribution_form_row.tsx +++ b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/layer_settings/attribution_form_row.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiButtonEmpty, EuiLink, EuiPanel } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Attribution } from '../../../../common/descriptor_types'; import { ILayer } from '../../../classes/layers/layer'; import { AttributionPopover } from './attribution_popover'; diff --git a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/layer_settings/attribution_popover.tsx b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/layer_settings/attribution_popover.tsx index 90b657a50ed7b..0371b68c85a3b 100644 --- a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/layer_settings/attribution_popover.tsx +++ b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/layer_settings/attribution_popover.tsx @@ -18,7 +18,7 @@ import { EuiTextAlign, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Attribution } from '../../../../common/descriptor_types'; interface Props { diff --git a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/layer_settings/layer_settings.tsx b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/layer_settings/layer_settings.tsx index 439390d08f38b..818f4e3dc7f4d 100644 --- a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/layer_settings/layer_settings.tsx +++ b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/layer_settings/layer_settings.tsx @@ -17,7 +17,7 @@ import { EuiToolTip, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Attribution } from '../../../../common/descriptor_types'; import { MAX_ZOOM } from '../../../../common/constants'; import { AlphaSlider } from '../../../components/alpha_slider'; diff --git a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/style_settings/style_settings.tsx b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/style_settings/style_settings.tsx index 06e38079403d1..d4f461e7cb3ec 100644 --- a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/style_settings/style_settings.tsx +++ b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/style_settings/style_settings.tsx @@ -9,7 +9,7 @@ import React, { Fragment } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiTitle, EuiPanel, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { StyleDescriptor } from '../../../../common/descriptor_types'; import { ILayer } from '../../../classes/layers/layer'; diff --git a/x-pack/plugins/maps/public/connected_components/map_settings_panel/display_panel.tsx b/x-pack/plugins/maps/public/connected_components/map_settings_panel/display_panel.tsx index 45bf6e7b45136..23a2e074a3474 100644 --- a/x-pack/plugins/maps/public/connected_components/map_settings_panel/display_panel.tsx +++ b/x-pack/plugins/maps/public/connected_components/map_settings_panel/display_panel.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiFormRow, EuiPanel, EuiSwitch, EuiSwitchEvent, EuiTitle } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { MapSettings } from '../../reducers/map'; import { MbValidatedColorPicker } from '../../classes/styles/vector/components/color/mb_validated_color_picker'; diff --git a/x-pack/plugins/maps/public/connected_components/map_settings_panel/map_settings_panel.tsx b/x-pack/plugins/maps/public/connected_components/map_settings_panel/map_settings_panel.tsx index 29fc79c1bbf1e..baee9c4ff48a0 100644 --- a/x-pack/plugins/maps/public/connected_components/map_settings_panel/map_settings_panel.tsx +++ b/x-pack/plugins/maps/public/connected_components/map_settings_panel/map_settings_panel.tsx @@ -17,7 +17,7 @@ import { EuiTitle, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { MapSettings } from '../../reducers/map'; import { NavigationPanel } from './navigation_panel'; import { SpatialFiltersPanel } from './spatial_filters_panel'; diff --git a/x-pack/plugins/maps/public/connected_components/map_settings_panel/navigation_panel.tsx b/x-pack/plugins/maps/public/connected_components/map_settings_panel/navigation_panel.tsx index 312822e65010a..e0a9e9258237c 100644 --- a/x-pack/plugins/maps/public/connected_components/map_settings_panel/navigation_panel.tsx +++ b/x-pack/plugins/maps/public/connected_components/map_settings_panel/navigation_panel.tsx @@ -20,7 +20,7 @@ import { EuiTitle, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { MapSettings } from '../../reducers/map'; import { ValidatedDualRange, Value } from '../../../../../../src/plugins/kibana_react/public'; import { INITIAL_LOCATION, MAX_ZOOM, MIN_ZOOM } from '../../../common/constants'; diff --git a/x-pack/plugins/maps/public/connected_components/map_settings_panel/spatial_filters_panel.tsx b/x-pack/plugins/maps/public/connected_components/map_settings_panel/spatial_filters_panel.tsx index 6e3e593e71bee..1965c637e69b4 100644 --- a/x-pack/plugins/maps/public/connected_components/map_settings_panel/spatial_filters_panel.tsx +++ b/x-pack/plugins/maps/public/connected_components/map_settings_panel/spatial_filters_panel.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiFormRow, EuiPanel, EuiSpacer, EuiSwitch, EuiSwitchEvent, EuiTitle } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { MapSettings } from '../../reducers/map'; import { AlphaSlider } from '../../components/alpha_slider'; import { MbValidatedColorPicker } from '../../classes/styles/vector/components/color/mb_validated_color_picker'; diff --git a/x-pack/plugins/maps/public/connected_components/mb_map/mb_map.tsx b/x-pack/plugins/maps/public/connected_components/mb_map/mb_map.tsx index 32c87f6320d40..c262eaa9d1527 100644 --- a/x-pack/plugins/maps/public/connected_components/mb_map/mb_map.tsx +++ b/x-pack/plugins/maps/public/connected_components/mb_map/mb_map.tsx @@ -24,6 +24,7 @@ import { clampToLatBounds, clampToLonBounds } from '../../../common/elasticsearc import { getInitialView } from './get_initial_view'; import { getPreserveDrawingBuffer } from '../../kibana_services'; import { ILayer } from '../../classes/layers/layer'; +import { IVectorSource } from '../../classes/sources/vector_source'; import { MapSettings } from '../../reducers/map'; import { Goto, @@ -31,17 +32,13 @@ import { TileMetaFeature, Timeslice, } from '../../../common/descriptor_types'; -import { - DECIMAL_DEGREES_PRECISION, - LAYER_TYPE, - RawValue, - ZOOM_PRECISION, -} from '../../../common/constants'; +import { DECIMAL_DEGREES_PRECISION, RawValue, ZOOM_PRECISION } from '../../../common/constants'; import { getGlyphUrl, isRetina } from '../../util'; import { syncLayerOrder } from './sort_layers'; import { addSpriteSheetToMapFromImageData, + getTileMetaFeatures, loadSpriteSheetImageData, removeOrphanedSourcesAndLayers, } from './utils'; @@ -49,7 +46,6 @@ import { ResizeChecker } from '../../../../../../src/plugins/kibana_utils/public import { RenderToolTipContent } from '../../classes/tooltips/tooltip_property'; import { TileStatusTracker } from './tile_status_tracker'; import { DrawFeatureControl } from './draw_control/draw_feature_control'; -import { MvtVectorLayer } from '../../classes/layers/vector_layer'; import type { MapExtentState } from '../../reducers/map/types'; export interface Props { @@ -125,11 +121,16 @@ export class MbMap extends Component { // This keeps track of the latest update calls, per layerId _queryForMeta = (layer: ILayer) => { - if (this.state.mbMap && layer.isVisible() && layer.getType() === LAYER_TYPE.TILED_VECTOR) { - const mbFeatures = (layer as MvtVectorLayer).queryTileMetaFeatures(this.state.mbMap); - if (mbFeatures !== null) { - this.props.updateMetaFromTiles(layer.getId(), mbFeatures); - } + const source = layer.getSource(); + if ( + this.state.mbMap && + layer.isVisible() && + source.isESSource() && + typeof (source as IVectorSource).isMvt === 'function' && + (source as IVectorSource).isMvt() + ) { + const features = getTileMetaFeatures(this.state.mbMap, layer.getMbSourceId()); + this.props.updateMetaFromTiles(layer.getId(), features); } }; diff --git a/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/features_tooltip/footer.tsx b/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/features_tooltip/footer.tsx index 7eff2f303d3ed..09339dc4e7782 100644 --- a/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/features_tooltip/footer.tsx +++ b/x-pack/plugins/maps/public/connected_components/mb_map/tooltip_control/features_tooltip/footer.tsx @@ -17,7 +17,7 @@ import { EuiFormRow, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { TooltipFeature } from '../../../../../common/descriptor_types'; import { IVectorLayer } from '../../../../classes/layers/vector_layer'; diff --git a/x-pack/plugins/maps/public/connected_components/mb_map/utils.ts b/x-pack/plugins/maps/public/connected_components/mb_map/utils.ts index 022db59263242..17994bf799487 100644 --- a/x-pack/plugins/maps/public/connected_components/mb_map/utils.ts +++ b/x-pack/plugins/maps/public/connected_components/mb_map/utils.ts @@ -6,11 +6,13 @@ */ import type { Map as MbMap } from '@kbn/mapbox-gl'; +import { TileMetaFeature } from '../../../common/descriptor_types'; // @ts-expect-error import { RGBAImage } from './image_utils'; import { isGlDrawLayer } from './sort_layers'; import { ILayer } from '../../classes/layers/layer'; import { EmsSpriteSheet } from '../../classes/layers/vector_tile_layer/vector_tile_layer'; +import { ES_MVT_META_LAYER_NAME } from '../../classes/layers/vector_layer/mvt_vector_layer/mvt_vector_layer'; export function removeOrphanedSourcesAndLayers( mbMap: MbMap, @@ -119,3 +121,26 @@ export function addSpriteSheetToMapFromImageData( mbMap.addImage(imageId, data, { pixelRatio, sdf }); } } + +export function getTileMetaFeatures(mbMap: MbMap, mbSourceId: string): TileMetaFeature[] { + // querySourceFeatures can return duplicated features when features cross tile boundaries. + // Tile meta will never have duplicated features since by there nature, tile meta is a feature contained within a single tile + const mbFeatures = mbMap.querySourceFeatures(mbSourceId, { + sourceLayer: ES_MVT_META_LAYER_NAME, + }); + + return mbFeatures + .map((mbFeature) => { + try { + return { + type: 'Feature', + id: mbFeature?.id, + geometry: mbFeature?.geometry, // this getter might throw with non-conforming geometries + properties: mbFeature?.properties, + } as TileMetaFeature; + } catch (e) { + return null; + } + }) + .filter((mbFeature) => mbFeature !== null) as TileMetaFeature[]; +} diff --git a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_control.tsx b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_control.tsx index ed93f433fcceb..696ccde120d86 100644 --- a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_control.tsx +++ b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_control.tsx @@ -17,7 +17,7 @@ import { EuiToolTip, EuiLoadingSpinner, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { LayerTOC } from './layer_toc'; import { ILayer } from '../../../classes/layers/layer'; diff --git a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry.tsx b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry.tsx index 2a933aab6c098..aeba28cf033bd 100644 --- a/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry.tsx +++ b/x-pack/plugins/maps/public/connected_components/right_side_controls/layer_control/layer_toc/toc_entry/toc_entry.tsx @@ -8,7 +8,7 @@ import React, { Component } from 'react'; import classNames from 'classnames'; import type { DraggableProvidedDragHandleProps } from 'react-beautiful-dnd'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiIcon, EuiButtonIcon, EuiConfirmModal, EuiButtonEmpty } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { TOCEntryActionsPopover } from './toc_entry_actions_popover'; diff --git a/x-pack/plugins/maps/public/connected_components/right_side_controls/mouse_coordinates_control/mouse_coordinates_control.tsx b/x-pack/plugins/maps/public/connected_components/right_side_controls/mouse_coordinates_control/mouse_coordinates_control.tsx index 32c9f2f58ecf2..f666ddde8638e 100644 --- a/x-pack/plugins/maps/public/connected_components/right_side_controls/mouse_coordinates_control/mouse_coordinates_control.tsx +++ b/x-pack/plugins/maps/public/connected_components/right_side_controls/mouse_coordinates_control/mouse_coordinates_control.tsx @@ -8,7 +8,7 @@ import _ from 'lodash'; import React, { Fragment } from 'react'; import { EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { DECIMAL_DEGREES_PRECISION } from '../../../../common/constants'; export interface Props { diff --git a/x-pack/plugins/maps/public/connected_components/toolbar_overlay/set_view_control/set_view_control.tsx b/x-pack/plugins/maps/public/connected_components/toolbar_overlay/set_view_control/set_view_control.tsx index 90df61f7891fc..3aa8e52af73a3 100644 --- a/x-pack/plugins/maps/public/connected_components/toolbar_overlay/set_view_control/set_view_control.tsx +++ b/x-pack/plugins/maps/public/connected_components/toolbar_overlay/set_view_control/set_view_control.tsx @@ -21,7 +21,7 @@ import { import { EuiButtonEmpty } from '@elastic/eui'; import { EuiRadioGroup } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import * as usng from 'usng.js'; import { isNaN, isNull } from 'lodash'; import { MapCenter } from '../../../../common/descriptor_types'; diff --git a/x-pack/plugins/maps/public/connected_components/toolbar_overlay/tools_control/tools_control.tsx b/x-pack/plugins/maps/public/connected_components/toolbar_overlay/tools_control/tools_control.tsx index 88a6637a7c84c..5472a690d45d5 100644 --- a/x-pack/plugins/maps/public/connected_components/toolbar_overlay/tools_control/tools_control.tsx +++ b/x-pack/plugins/maps/public/connected_components/toolbar_overlay/tools_control/tools_control.tsx @@ -16,7 +16,7 @@ import { EuiPanel, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ActionExecutionContext, Action } from 'src/plugins/ui_actions/public'; import { DRAW_SHAPE, ES_GEO_FIELD_TYPE, ES_SPATIAL_RELATIONS } from '../../../../common/constants'; import { GeometryFilterForm } from '../../../components/draw_forms/geometry_filter_form/geometry_filter_form'; diff --git a/x-pack/plugins/maps/public/inspector/map_details.tsx b/x-pack/plugins/maps/public/inspector/map_details.tsx index 6689cb0d6ccb4..ee6e19b923141 100644 --- a/x-pack/plugins/maps/public/inspector/map_details.tsx +++ b/x-pack/plugins/maps/public/inspector/map_details.tsx @@ -16,7 +16,7 @@ import { EuiTableRowCell, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; const DETAILS_TAB_ID = 'details'; const STYLE_TAB_ID = 'mapStyle'; diff --git a/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_editor.tsx b/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_editor.tsx index f8f8e0ce59a4f..c9e422001da3e 100644 --- a/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_editor.tsx +++ b/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_editor.tsx @@ -14,7 +14,7 @@ import { extractLayerDescriptorParams } from './utils'; import { RegionMapVisParams } from './types'; import { title } from './region_map_vis_type'; -export function RegionMapEditor(props: VisEditorOptionsProps) { +function RegionMapEditor(props: VisEditorOptionsProps) { const onClick = (e: React.MouseEvent) => { e.preventDefault(); @@ -32,3 +32,7 @@ export function RegionMapEditor(props: VisEditorOptionsProps) { return ; } + +// default export required for React.Lazy +// eslint-disable-next-line import/no-default-export +export default RegionMapEditor; diff --git a/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_renderer.tsx b/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_renderer.tsx index 1d3531bfed82a..19066a618ee79 100644 --- a/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_renderer.tsx +++ b/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_renderer.tsx @@ -5,13 +5,17 @@ * 2.0. */ -import React from 'react'; +import React, { lazy } from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; import type { ExpressionRenderDefinition } from 'src/plugins/expressions'; -import { RegionMapVisRenderValue } from './region_map_fn'; -import { RegionMapVisualization } from './region_map_visualization'; +import type { RegionMapVisRenderValue } from './region_map_fn'; +import { LazyWrapper } from '../../lazy_wrapper'; import { REGION_MAP_RENDER } from './types'; +const getLazyComponent = () => { + return lazy(() => import('./region_map_visualization')); +}; + export const regionMapRenderer = { name: REGION_MAP_RENDER, reuseDomNode: true, @@ -20,17 +24,16 @@ export const regionMapRenderer = { unmountComponentAtNode(domNode); }); - render( - { - handlers.done(); - }} - filters={filters} - query={query} - timeRange={timeRange} - visConfig={visConfig} - />, - domNode - ); + const props = { + onInitialRenderComplete: () => { + handlers.done(); + }, + filters, + query, + timeRange, + visConfig, + }; + + render(, domNode); }, } as ExpressionRenderDefinition; diff --git a/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_vis_type.ts b/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_vis_type.tsx similarity index 71% rename from x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_vis_type.ts rename to x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_vis_type.tsx index 4c6e4b2150fb1..473f83a270871 100644 --- a/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_vis_type.ts +++ b/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_vis_type.tsx @@ -5,16 +5,25 @@ * 2.0. */ +import React, { lazy } from 'react'; import { i18n } from '@kbn/i18n'; +import type { VisEditorOptionsProps } from 'src/plugins/visualizations/public'; import { VisTypeDefinition } from '../../../../../../src/plugins/visualizations/public'; import { toExpressionAst } from './to_ast'; import { REGION_MAP_VIS_TYPE, RegionMapVisParams } from './types'; -import { RegionMapEditor } from './region_map_editor'; +import { LazyWrapper } from '../../lazy_wrapper'; export const title = i18n.translate('xpack.maps.regionMapMap.vis.title', { defaultMessage: 'Region Map', }); +const LazyRegionMapEditor = function (props: VisEditorOptionsProps) { + const getLazyComponent = () => { + return lazy(() => import('./region_map_editor')); + }; + return ; +}; + export const regionMapVisType = { name: REGION_MAP_VIS_TYPE, title, @@ -27,7 +36,7 @@ export const regionMapVisType = { { name: '', title: '', - editor: RegionMapEditor, + editor: LazyRegionMapEditor, }, ], }, diff --git a/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_visualization.tsx b/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_visualization.tsx index 5bb75d781e79b..50294e69868c4 100644 --- a/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_visualization.tsx +++ b/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_visualization.tsx @@ -19,7 +19,7 @@ interface Props { onInitialRenderComplete: () => void; } -export function RegionMapVisualization(props: Props) { +function RegionMapVisualization(props: Props) { const mapCenter = { lat: props.visConfig.mapCenter[0], lon: props.visConfig.mapCenter[1], @@ -45,3 +45,7 @@ export function RegionMapVisualization(props: Props) { /> ); } + +// default export required for React.Lazy +// eslint-disable-next-line import/no-default-export +export default RegionMapVisualization; diff --git a/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_editor.tsx b/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_editor.tsx index 60efb807795af..81f440eef233e 100644 --- a/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_editor.tsx +++ b/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_editor.tsx @@ -14,7 +14,7 @@ import { extractLayerDescriptorParams } from './utils'; import { TileMapVisParams } from './types'; import { title } from './tile_map_vis_type'; -export function TileMapEditor(props: VisEditorOptionsProps) { +function TileMapEditor(props: VisEditorOptionsProps) { const onClick = (e: React.MouseEvent) => { e.preventDefault(); @@ -32,3 +32,7 @@ export function TileMapEditor(props: VisEditorOptionsProps) { return ; } + +// default export required for React.Lazy +// eslint-disable-next-line import/no-default-export +export default TileMapEditor; diff --git a/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_renderer.tsx b/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_renderer.tsx index 5e61a0e0cd368..75569da5020c7 100644 --- a/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_renderer.tsx +++ b/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_renderer.tsx @@ -5,13 +5,17 @@ * 2.0. */ -import React from 'react'; +import React, { lazy } from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; import type { ExpressionRenderDefinition } from 'src/plugins/expressions'; -import { TileMapVisRenderValue } from './tile_map_fn'; -import { TileMapVisualization } from './tile_map_visualization'; +import type { TileMapVisRenderValue } from './tile_map_fn'; +import { LazyWrapper } from '../../lazy_wrapper'; import { TILE_MAP_RENDER } from './types'; +const getLazyComponent = () => { + return lazy(() => import('./tile_map_visualization')); +}; + export const tileMapRenderer = { name: TILE_MAP_RENDER, reuseDomNode: true, @@ -20,17 +24,16 @@ export const tileMapRenderer = { unmountComponentAtNode(domNode); }); - render( - { - handlers.done(); - }} - filters={filters} - query={query} - timeRange={timeRange} - visConfig={visConfig} - />, - domNode - ); + const props = { + onInitialRenderComplete: () => { + handlers.done(); + }, + filters, + query, + timeRange, + visConfig, + }; + + render(, domNode); }, } as ExpressionRenderDefinition; diff --git a/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_vis_type.ts b/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_vis_type.tsx similarity index 72% rename from x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_vis_type.ts rename to x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_vis_type.tsx index 458adcab8c8d1..3ecf8c24e200a 100644 --- a/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_vis_type.ts +++ b/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_vis_type.tsx @@ -5,16 +5,25 @@ * 2.0. */ +import React, { lazy } from 'react'; import { i18n } from '@kbn/i18n'; +import type { VisEditorOptionsProps } from 'src/plugins/visualizations/public'; import { VisTypeDefinition } from '../../../../../../src/plugins/visualizations/public'; import { toExpressionAst } from './to_ast'; import { MapTypes, TileMapVisParams, TILE_MAP_VIS_TYPE } from './types'; -import { TileMapEditor } from './tile_map_editor'; +import { LazyWrapper } from '../../lazy_wrapper'; export const title = i18n.translate('xpack.maps.tileMap.vis.title', { defaultMessage: 'Coordinate Map', }); +const LazyTileMapEditor = function (props: VisEditorOptionsProps) { + const getLazyComponent = () => { + return lazy(() => import('./tile_map_editor')); + }; + return ; +}; + export const tileMapVisType = { name: TILE_MAP_VIS_TYPE, title, @@ -27,7 +36,7 @@ export const tileMapVisType = { { name: '', title: '', - editor: TileMapEditor, + editor: LazyTileMapEditor, }, ], }, diff --git a/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_visualization.tsx b/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_visualization.tsx index 225b29de5652b..a6f3d7aa843fc 100644 --- a/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_visualization.tsx +++ b/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_visualization.tsx @@ -19,7 +19,7 @@ interface Props { onInitialRenderComplete: () => void; } -export function TileMapVisualization(props: Props) { +function TileMapVisualization(props: Props) { const mapCenter = { lat: props.visConfig.mapCenter[0], lon: props.visConfig.mapCenter[1], @@ -45,3 +45,7 @@ export function TileMapVisualization(props: Props) { /> ); } + +// default export required for React.Lazy +// eslint-disable-next-line import/no-default-export +export default TileMapVisualization; diff --git a/x-pack/plugins/maps/public/legacy_visualizations/view_in_maps.tsx b/x-pack/plugins/maps/public/legacy_visualizations/view_in_maps.tsx index 39d959865a9a0..69734a696ac61 100644 --- a/x-pack/plugins/maps/public/legacy_visualizations/view_in_maps.tsx +++ b/x-pack/plugins/maps/public/legacy_visualizations/view_in_maps.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiButton, EuiCallOut } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; interface Props { diff --git a/x-pack/plugins/maps/public/render_app.tsx b/x-pack/plugins/maps/public/render_app.tsx index 3eefaeb6f7a9b..17c1dfdc98f2e 100644 --- a/x-pack/plugins/maps/public/render_app.tsx +++ b/x-pack/plugins/maps/public/render_app.tsx @@ -77,7 +77,7 @@ export async function renderApp( setAppChrome(); function renderMapApp(routeProps: RouteComponentProps<{ savedMapId?: string }>) { - const { embeddableId, originatingApp, valueInput } = + const { embeddableId, originatingApp, valueInput, originatingPath } = stateTransfer.getIncomingEditorState(APP_ID) || {}; let mapEmbeddableInput; @@ -98,6 +98,7 @@ export async function renderApp( setHeaderActionMenu={setHeaderActionMenu} stateTransfer={stateTransfer} originatingApp={originatingApp} + originatingPath={originatingPath} history={history} key={routeProps.match.params.savedMapId ? routeProps.match.params.savedMapId : 'new'} /> diff --git a/x-pack/plugins/maps/public/routes/map_page/map_page.tsx b/x-pack/plugins/maps/public/routes/map_page/map_page.tsx index 7e927115a5d06..b382be1d506bd 100644 --- a/x-pack/plugins/maps/public/routes/map_page/map_page.tsx +++ b/x-pack/plugins/maps/public/routes/map_page/map_page.tsx @@ -20,6 +20,7 @@ interface Props { setHeaderActionMenu: AppMountParameters['setHeaderActionMenu']; stateTransfer: EmbeddableStateTransfer; originatingApp?: string; + originatingPath?: string; history: AppMountParameters['history']; } @@ -43,6 +44,7 @@ export class MapPage extends Component { mapEmbeddableInput: props.mapEmbeddableInput, embeddableId: props.embeddableId, originatingApp: props.originatingApp, + originatingPath: props.originatingPath, stateTransfer: props.stateTransfer, onSaveCallback: this.updateSaveCounter, }), diff --git a/x-pack/plugins/maps/public/routes/map_page/saved_map/saved_map.ts b/x-pack/plugins/maps/public/routes/map_page/saved_map/saved_map.ts index 3cff8d9713830..a6f1eb8572ef1 100644 --- a/x-pack/plugins/maps/public/routes/map_page/saved_map/saved_map.ts +++ b/x-pack/plugins/maps/public/routes/map_page/saved_map/saved_map.ts @@ -58,6 +58,7 @@ export class SavedMap { private _mapEmbeddableInput?: MapEmbeddableInput; private readonly _onSaveCallback?: () => void; private _originatingApp?: string; + private _originatingPath?: string; private readonly _stateTransfer?: EmbeddableStateTransfer; private readonly _store: MapStore; private _tags: string[] = []; @@ -69,6 +70,7 @@ export class SavedMap { onSaveCallback, originatingApp, stateTransfer, + originatingPath, }: { defaultLayers?: LayerDescriptor[]; mapEmbeddableInput?: MapEmbeddableInput; @@ -76,12 +78,14 @@ export class SavedMap { onSaveCallback?: () => void; originatingApp?: string; stateTransfer?: EmbeddableStateTransfer; + originatingPath?: string; }) { this._defaultLayers = defaultLayers; this._mapEmbeddableInput = mapEmbeddableInput; this._embeddableId = embeddableId; this._onSaveCallback = onSaveCallback; this._originatingApp = originatingApp; + this._originatingPath = originatingPath; this._stateTransfer = stateTransfer; this._store = createMapStore(); } @@ -379,6 +383,7 @@ export class SavedMap { type: MAP_SAVED_OBJECT_TYPE, input: updatedMapEmbeddableInput, }, + path: this._originatingPath, }); return; } else if (dashboardId) { diff --git a/x-pack/plugins/maps/server/mvt/get_grid_tile.ts b/x-pack/plugins/maps/server/mvt/get_grid_tile.ts index 59e3d791fd8a9..4392e1aac0b1c 100644 --- a/x-pack/plugins/maps/server/mvt/get_grid_tile.ts +++ b/x-pack/plugins/maps/server/mvt/get_grid_tile.ts @@ -23,6 +23,7 @@ export async function getEsGridTile({ z, requestBody = {}, requestType = RENDER_AS.POINT, + gridPrecision, abortController, }: { x: number; @@ -34,13 +35,14 @@ export async function getEsGridTile({ logger: Logger; requestBody: any; requestType: RENDER_AS.GRID | RENDER_AS.POINT; + gridPrecision: number; abortController: AbortController; }): Promise { try { const path = `/${encodeURIComponent(index)}/_mvt/${geometryFieldName}/${z}/${x}/${y}`; const body = { size: 0, // no hits - grid_precision: 8, + grid_precision: gridPrecision, exact_bounds: false, extent: 4096, // full resolution, query: requestBody.query, diff --git a/x-pack/plugins/maps/server/mvt/mvt_routes.ts b/x-pack/plugins/maps/server/mvt/mvt_routes.ts index 317f62e50825e..7a3a153c952ed 100644 --- a/x-pack/plugins/maps/server/mvt/mvt_routes.ts +++ b/x-pack/plugins/maps/server/mvt/mvt_routes.ts @@ -90,6 +90,7 @@ export function initMVTRoutes({ index: schema.string(), requestType: schema.string(), token: schema.maybe(schema.string()), + gridPrecision: schema.number(), }), }, }, @@ -117,6 +118,7 @@ export function initMVTRoutes({ index: query.index as string, requestBody: requestBodyDSL as any, requestType: query.requestType as RENDER_AS.POINT | RENDER_AS.GRID, + gridPrecision: parseInt(query.gridPrecision, 10), abortController, }); diff --git a/x-pack/plugins/ml/common/types/alerts.ts b/x-pack/plugins/ml/common/types/alerts.ts index 408c424f327d5..0cb0b4e388e48 100644 --- a/x-pack/plugins/ml/common/types/alerts.ts +++ b/x-pack/plugins/ml/common/types/alerts.ts @@ -55,6 +55,8 @@ export interface RecordAnomalyAlertDoc extends BaseAnomalyAlertDoc { over_field_value?: string | number; partition_field_name?: string; partition_field_value?: string | number; + typical: number[]; + actual: number[]; } export interface BucketAnomalyAlertDoc extends BaseAnomalyAlertDoc { diff --git a/x-pack/plugins/ml/common/types/anomalies.ts b/x-pack/plugins/ml/common/types/anomalies.ts index 2bf717067f712..46ecc7d91278e 100644 --- a/x-pack/plugins/ml/common/types/anomalies.ts +++ b/x-pack/plugins/ml/common/types/anomalies.ts @@ -38,8 +38,20 @@ export interface AnomalyRecordDoc { multi_bucket_impact?: number; over_field_name?: string; over_field_value?: string; - // TODO provide the causes resource interface. - causes?: any[]; + causes?: Array<{ + function: string; + function_description: string; + probability: number; + actual: number[]; + typical: number[]; + field_name?: string; + over_field_name?: string; + over_field_value?: string; + by_field_name?: string; + by_field_value?: string; + partition_field_name?: string; + partition_field_value?: string | number; + }>; } export interface AnomaliesTableRecord { diff --git a/x-pack/plugins/ml/common/types/common.ts b/x-pack/plugins/ml/common/types/common.ts index 6a4bbc303ae58..4559dd168d693 100644 --- a/x-pack/plugins/ml/common/types/common.ts +++ b/x-pack/plugins/ml/common/types/common.ts @@ -50,3 +50,5 @@ export type AppPageState = { type Without = { [P in Exclude]?: never }; export type XOR = T | U extends object ? (Without & U) | (Without & T) : T | U; + +export type AwaitReturnType = T extends PromiseLike ? U : T; diff --git a/x-pack/plugins/ml/kibana.json b/x-pack/plugins/ml/kibana.json index 9ed05bbdc2edf..577e41b8816cd 100644 --- a/x-pack/plugins/ml/kibana.json +++ b/x-pack/plugins/ml/kibana.json @@ -16,7 +16,6 @@ "share", "embeddable", "uiActions", - "kibanaLegacy", "discover", "triggersActionsUi", "fieldFormats" diff --git a/x-pack/plugins/ml/public/__mocks__/ml_start_deps.ts b/x-pack/plugins/ml/public/__mocks__/ml_start_deps.ts index 4bbbe10df7f6c..42cbb4bf3485b 100644 --- a/x-pack/plugins/ml/public/__mocks__/ml_start_deps.ts +++ b/x-pack/plugins/ml/public/__mocks__/ml_start_deps.ts @@ -7,7 +7,6 @@ import { uiActionsPluginMock } from '../../../../../src/plugins/ui_actions/public/mocks'; import { dataPluginMock } from '../../../../../src/plugins/data/public/mocks'; -import { kibanaLegacyPluginMock } from '../../../../../src/plugins/kibana_legacy/public/mocks'; import { sharePluginMock } from '../../../../../src/plugins/share/public/mocks'; import { embeddablePluginMock } from '../../../../../src/plugins/embeddable/public/mocks'; import { triggersActionsUiMock } from '../../../triggers_actions_ui/public/mocks'; @@ -15,7 +14,6 @@ import { triggersActionsUiMock } from '../../../triggers_actions_ui/public/mocks export const createMlStartDepsMock = () => ({ data: dataPluginMock.createStartContract(), share: sharePluginMock.createStartContract(), - kibanaLegacy: kibanaLegacyPluginMock.createStartContract(), uiActions: uiActionsPluginMock.createStartContract(), spaces: jest.fn(), embeddable: embeddablePluginMock.createStartContract(), diff --git a/x-pack/plugins/ml/public/alerting/advanced_settings.tsx b/x-pack/plugins/ml/public/alerting/advanced_settings.tsx index 05ce3c13215b3..093c3d615a510 100644 --- a/x-pack/plugins/ml/public/alerting/advanced_settings.tsx +++ b/x-pack/plugins/ml/public/alerting/advanced_settings.tsx @@ -6,7 +6,7 @@ */ import React, { FC } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiAccordion, EuiDescribedFormGroup, diff --git a/x-pack/plugins/ml/public/alerting/config_validator.tsx b/x-pack/plugins/ml/public/alerting/config_validator.tsx index cdd696430ca5e..0a6df6978e67e 100644 --- a/x-pack/plugins/ml/public/alerting/config_validator.tsx +++ b/x-pack/plugins/ml/public/alerting/config_validator.tsx @@ -7,7 +7,7 @@ import React, { FC } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCallOut, EuiSpacer } from '@elastic/eui'; import { parseInterval } from '../../common/util/parse_interval'; import { CombinedJobWithStats } from '../../common/types/anomaly_detection_jobs'; diff --git a/x-pack/plugins/ml/public/alerting/interim_results_control.tsx b/x-pack/plugins/ml/public/alerting/interim_results_control.tsx index 0b7ad1184f27f..042ad51762394 100644 --- a/x-pack/plugins/ml/public/alerting/interim_results_control.tsx +++ b/x-pack/plugins/ml/public/alerting/interim_results_control.tsx @@ -7,7 +7,7 @@ import React, { FC } from 'react'; import { EuiFormRow, EuiSwitch } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; interface InterimResultsControlProps { value: boolean; diff --git a/x-pack/plugins/ml/public/alerting/job_selector.tsx b/x-pack/plugins/ml/public/alerting/job_selector.tsx index bcedc5a12a500..3ba9a7c1ff838 100644 --- a/x-pack/plugins/ml/public/alerting/job_selector.tsx +++ b/x-pack/plugins/ml/public/alerting/job_selector.tsx @@ -7,7 +7,7 @@ import React, { FC, ReactNode, useCallback, useEffect, useMemo, useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiComboBox, EuiComboBoxOptionOption, EuiComboBoxProps, EuiFormRow } from '@elastic/eui'; import { JobId } from '../../common/types/anomaly_detection_jobs'; import { MlApiServices } from '../application/services/ml_api_service'; diff --git a/x-pack/plugins/ml/public/alerting/jobs_health_rule/anomaly_detection_jobs_health_rule_trigger.tsx b/x-pack/plugins/ml/public/alerting/jobs_health_rule/anomaly_detection_jobs_health_rule_trigger.tsx index 71ed2032225ee..54ee446e7ac57 100644 --- a/x-pack/plugins/ml/public/alerting/jobs_health_rule/anomaly_detection_jobs_health_rule_trigger.tsx +++ b/x-pack/plugins/ml/public/alerting/jobs_health_rule/anomaly_detection_jobs_health_rule_trigger.tsx @@ -8,7 +8,7 @@ import React, { FC, useCallback, useMemo, useState } from 'react'; import { EuiComboBoxOptionOption, EuiForm, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import useDebounce from 'react-use/lib/useDebounce'; import { AlertTypeParamsExpressionProps } from '../../../../triggers_actions_ui/public'; import { MlAnomalyDetectionJobsHealthRuleParams } from '../../../common/types/alerts'; diff --git a/x-pack/plugins/ml/public/alerting/jobs_health_rule/tests_selection_control.tsx b/x-pack/plugins/ml/public/alerting/jobs_health_rule/tests_selection_control.tsx index f53c71313ffd5..c89992d4d2d31 100644 --- a/x-pack/plugins/ml/public/alerting/jobs_health_rule/tests_selection_control.tsx +++ b/x-pack/plugins/ml/public/alerting/jobs_health_rule/tests_selection_control.tsx @@ -16,7 +16,7 @@ import { EuiSwitch, EuiToolTip, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { JobsHealthRuleTestsConfig, JobsHealthTests } from '../../../common/types/alerts'; import { getResultJobsHealthRuleConfig } from '../../../common/util/alerts'; import { HEALTH_CHECK_NAMES } from '../../../common/constants/alerts'; diff --git a/x-pack/plugins/ml/public/alerting/preview_alert_condition.tsx b/x-pack/plugins/ml/public/alerting/preview_alert_condition.tsx index 62b5e30550eee..951ce81fddbd1 100644 --- a/x-pack/plugins/ml/public/alerting/preview_alert_condition.tsx +++ b/x-pack/plugins/ml/public/alerting/preview_alert_condition.tsx @@ -7,7 +7,7 @@ import React, { FC, useCallback, useEffect, useMemo, useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiButtonEmpty, @@ -88,7 +88,18 @@ const AlertInstancePreview: FC = React.memo( {i.function}({i.field_name}) {' '} - {i.by_field_value} {i.over_field_value} {i.partition_field_value} [{i.score}] + {i.by_field_value} {i.over_field_value} {i.partition_field_value} [{i.score}]; + ( + {' '} + {i.typical ?? '-'},{' '} + {' '} + {i.actual ?? '-'}) ))} diff --git a/x-pack/plugins/ml/public/alerting/register_ml_alerts.ts b/x-pack/plugins/ml/public/alerting/register_ml_alerts.ts index b3ceb20e67efa..9dc68211093fc 100644 --- a/x-pack/plugins/ml/public/alerting/register_ml_alerts.ts +++ b/x-pack/plugins/ml/public/alerting/register_ml_alerts.ts @@ -127,7 +127,7 @@ export function registerMlAlerts( \\{\\{#context.topRecords.length\\}\\} Top records: \\{\\{#context.topRecords\\}\\} - \\{\\{function\\}\\}(\\{\\{field_name\\}\\}) \\{\\{by_field_value\\}\\} \\{\\{over_field_value\\}\\} \\{\\{partition_field_value\\}\\} [\\{\\{score\\}\\}] + \\{\\{function\\}\\}(\\{\\{field_name\\}\\}) \\{\\{by_field_value\\}\\}\\{\\{over_field_value\\}\\}\\{\\{partition_field_value\\}\\} [\\{\\{score\\}\\}]. Typical: \\{\\{typical\\}\\}, Actual: \\{\\{actual\\}\\} \\{\\{/context.topRecords\\}\\} \\{\\{/context.topRecords.length\\}\\} diff --git a/x-pack/plugins/ml/public/alerting/result_type_selector.tsx b/x-pack/plugins/ml/public/alerting/result_type_selector.tsx index 470cfa1a9e1b1..892eb8ada73dc 100644 --- a/x-pack/plugins/ml/public/alerting/result_type_selector.tsx +++ b/x-pack/plugins/ml/public/alerting/result_type_selector.tsx @@ -6,7 +6,7 @@ */ import { EuiCard, EuiFlexGroup, EuiFlexItem, EuiFormRow } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { FC, useMemo } from 'react'; import { ANOMALY_RESULT_TYPE } from '../../common/constants/anomalies'; import { AnomalyResultType } from '../../common/types/anomalies'; diff --git a/x-pack/plugins/ml/public/application/access_denied/page.tsx b/x-pack/plugins/ml/public/application/access_denied/page.tsx index bc0d17e96fe71..39f43e1dd1e11 100644 --- a/x-pack/plugins/ml/public/application/access_denied/page.tsx +++ b/x-pack/plugins/ml/public/application/access_denied/page.tsx @@ -7,7 +7,7 @@ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiEmptyPrompt, EuiFlexGroup, EuiFlexItem, EuiPageContent, EuiSpacer } from '@elastic/eui'; import { NavigationMenu } from '../components/navigation_menu'; diff --git a/x-pack/plugins/ml/public/application/app.tsx b/x-pack/plugins/ml/public/application/app.tsx index de212cbe4916e..5334f420698ab 100644 --- a/x-pack/plugins/ml/public/application/app.tsx +++ b/x-pack/plugins/ml/public/application/app.tsx @@ -28,10 +28,7 @@ import { mlApiServicesProvider } from './services/ml_api_service'; import { HttpService } from './services/http_service'; import { ML_APP_LOCATOR, ML_PAGES } from '../../common/constants/locator'; -export type MlDependencies = Omit< - MlSetupDependencies, - 'share' | 'indexPatternManagement' | 'fieldFormats' -> & +export type MlDependencies = Omit & MlStartDependencies; interface AppProps { diff --git a/x-pack/plugins/ml/public/application/components/annotations/annotation_flyout/index.test.tsx b/x-pack/plugins/ml/public/application/components/annotations/annotation_flyout/index.test.tsx index 1996e9e1e714a..9184ac4b10128 100644 --- a/x-pack/plugins/ml/public/application/components/annotations/annotation_flyout/index.test.tsx +++ b/x-pack/plugins/ml/public/application/components/annotations/annotation_flyout/index.test.tsx @@ -9,7 +9,7 @@ import useObservable from 'react-use/lib/useObservable'; import mockAnnotations from '../annotations_table/__mocks__/mock_annotations.json'; import React from 'react'; import { fireEvent, render, screen, waitFor } from '@testing-library/react'; -import { __IntlProvider as IntlProvider } from '@kbn/i18n/react'; +import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; import { Annotation } from '../../../../../common/types/annotations'; import { AnnotationUpdatesService } from '../../../services/annotations_service'; diff --git a/x-pack/plugins/ml/public/application/components/annotations/annotation_flyout/index.tsx b/x-pack/plugins/ml/public/application/components/annotations/annotation_flyout/index.tsx index 812cba95b5d93..d0a0631a42521 100644 --- a/x-pack/plugins/ml/public/application/components/annotations/annotation_flyout/index.tsx +++ b/x-pack/plugins/ml/public/application/components/annotations/annotation_flyout/index.tsx @@ -28,7 +28,7 @@ import { import { CommonProps } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ANNOTATION_MAX_LENGTH_CHARS, ANNOTATION_EVENT_USER, diff --git a/x-pack/plugins/ml/public/application/components/annotations/annotations_table/annotations_table.js b/x-pack/plugins/ml/public/application/components/annotations/annotations_table/annotations_table.js index 98dc5f4204c32..e580aabdf9fc6 100644 --- a/x-pack/plugins/ml/public/application/components/annotations/annotations_table/annotations_table.js +++ b/x-pack/plugins/ml/public/application/components/annotations/annotations_table/annotations_table.js @@ -27,7 +27,7 @@ import { EuiToolTip, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { RIGHT_ALIGNMENT } from '@elastic/eui/lib/services'; diff --git a/x-pack/plugins/ml/public/application/components/annotations/delete_annotation_modal/index.tsx b/x-pack/plugins/ml/public/application/components/annotations/delete_annotation_modal/index.tsx index b594ce774d4eb..757cf71511ffb 100644 --- a/x-pack/plugins/ml/public/application/components/annotations/delete_annotation_modal/index.tsx +++ b/x-pack/plugins/ml/public/application/components/annotations/delete_annotation_modal/index.tsx @@ -10,7 +10,7 @@ import React, { Fragment } from 'react'; import { EUI_MODAL_CONFIRM_BUTTON, EuiConfirmModal } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; interface Props { cancelAction: () => void; diff --git a/x-pack/plugins/ml/public/application/components/anomalies_table/anomalies_table.js b/x-pack/plugins/ml/public/application/components/anomalies_table/anomalies_table.js index 7b8b3bdcceb4b..bc6368a5192f7 100644 --- a/x-pack/plugins/ml/public/application/components/anomalies_table/anomalies_table.js +++ b/x-pack/plugins/ml/public/application/components/anomalies_table/anomalies_table.js @@ -16,7 +16,7 @@ import React, { Component } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiInMemoryTable, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { getColumns } from './anomalies_table_columns'; diff --git a/x-pack/plugins/ml/public/application/components/anomalies_table/anomalies_table_columns.js b/x-pack/plugins/ml/public/application/components/anomalies_table/anomalies_table_columns.js index 1f3979e6efe29..5add76d176da0 100644 --- a/x-pack/plugins/ml/public/application/components/anomalies_table/anomalies_table_columns.js +++ b/x-pack/plugins/ml/public/application/components/anomalies_table/anomalies_table_columns.js @@ -11,7 +11,7 @@ import React from 'react'; import { get } from 'lodash'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { formatHumanReadableDate, diff --git a/x-pack/plugins/ml/public/application/components/anomalies_table/anomaly_details.js b/x-pack/plugins/ml/public/application/components/anomalies_table/anomaly_details.js index 669a81ffd6248..bf3886d25bf52 100644 --- a/x-pack/plugins/ml/public/application/components/anomalies_table/anomaly_details.js +++ b/x-pack/plugins/ml/public/application/components/anomalies_table/anomaly_details.js @@ -14,7 +14,7 @@ import PropTypes from 'prop-types'; import React, { Component, Fragment } from 'react'; import { get, pick } from 'lodash'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescriptionList, diff --git a/x-pack/plugins/ml/public/application/components/anomalies_table/detector_cell.js b/x-pack/plugins/ml/public/application/components/anomalies_table/detector_cell.js index 38b16c68ebd25..1ef9f8724f86e 100644 --- a/x-pack/plugins/ml/public/application/components/anomalies_table/detector_cell.js +++ b/x-pack/plugins/ml/public/application/components/anomalies_table/detector_cell.js @@ -9,7 +9,7 @@ import PropTypes from 'prop-types'; import React from 'react'; import { EuiIcon, EuiToolTip } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; /* * Component for rendering a detector cell in the anomalies table, displaying the diff --git a/x-pack/plugins/ml/public/application/components/anomalies_table/influencers_cell.js b/x-pack/plugins/ml/public/application/components/anomalies_table/influencers_cell.js index 0059bec2929d0..b77fa308bdd8f 100644 --- a/x-pack/plugins/ml/public/application/components/anomalies_table/influencers_cell.js +++ b/x-pack/plugins/ml/public/application/components/anomalies_table/influencers_cell.js @@ -10,7 +10,7 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { EuiLink, EuiButtonIcon, EuiToolTip } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { blurButtonOnClick } from '../../util/component_utils'; diff --git a/x-pack/plugins/ml/public/application/components/anomalies_table/links_menu.js b/x-pack/plugins/ml/public/application/components/anomalies_table/links_menu.js index b0561893eb19f..1b1bdf49b6db9 100644 --- a/x-pack/plugins/ml/public/application/components/anomalies_table/links_menu.js +++ b/x-pack/plugins/ml/public/application/components/anomalies_table/links_menu.js @@ -13,7 +13,7 @@ import React, { Component } from 'react'; import { EuiButtonIcon, EuiContextMenuPanel, EuiContextMenuItem, EuiPopover } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { withKibana } from '../../../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/ml/public/application/components/anomaly_results_view_selector/anomaly_results_view_selector.test.tsx b/x-pack/plugins/ml/public/application/components/anomaly_results_view_selector/anomaly_results_view_selector.test.tsx index 2edf800d87bb7..9224f28071c2f 100644 --- a/x-pack/plugins/ml/public/application/components/anomaly_results_view_selector/anomaly_results_view_selector.test.tsx +++ b/x-pack/plugins/ml/public/application/components/anomaly_results_view_selector/anomaly_results_view_selector.test.tsx @@ -10,7 +10,7 @@ import { Router } from 'react-router-dom'; import { render } from '@testing-library/react'; import { createBrowserHistory } from 'history'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { AnomalyResultsViewSelector } from './index'; diff --git a/x-pack/plugins/ml/public/application/components/callout/callout.tsx b/x-pack/plugins/ml/public/application/components/callout/callout.tsx index c82e5420aec79..1675a75c634d0 100644 --- a/x-pack/plugins/ml/public/application/components/callout/callout.tsx +++ b/x-pack/plugins/ml/public/application/components/callout/callout.tsx @@ -7,7 +7,7 @@ import React, { FC } from 'react'; import { EuiCallOut, EuiLink, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { CalloutMessage, VALIDATION_STATUS } from '../../../../common/constants/validation'; export const defaultIconType = 'questionInCircle'; diff --git a/x-pack/plugins/ml/public/application/components/controls/checkbox_showcharts/checkbox_showcharts.tsx b/x-pack/plugins/ml/public/application/components/controls/checkbox_showcharts/checkbox_showcharts.tsx index 73eb91ffd30a8..e24242c3ca7f4 100644 --- a/x-pack/plugins/ml/public/application/components/controls/checkbox_showcharts/checkbox_showcharts.tsx +++ b/x-pack/plugins/ml/public/application/components/controls/checkbox_showcharts/checkbox_showcharts.tsx @@ -7,7 +7,7 @@ import React, { FC, useCallback, useMemo } from 'react'; import { EuiCheckbox, htmlIdGenerator } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export interface CheckboxShowChartsProps { showCharts: boolean; diff --git a/x-pack/plugins/ml/public/application/components/controls/select_severity/select_severity.tsx b/x-pack/plugins/ml/public/application/components/controls/select_severity/select_severity.tsx index 3fe50a8b46d55..3409642692151 100644 --- a/x-pack/plugins/ml/public/application/components/controls/select_severity/select_severity.tsx +++ b/x-pack/plugins/ml/public/application/components/controls/select_severity/select_severity.tsx @@ -10,7 +10,7 @@ */ import React, { Fragment, FC, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiHealth, EuiSpacer, EuiSuperSelect, EuiText, EuiSuperSelectProps } from '@elastic/eui'; diff --git a/x-pack/plugins/ml/public/application/components/data_grid/data_grid.tsx b/x-pack/plugins/ml/public/application/components/data_grid/data_grid.tsx index 126f24233a803..5240dbb1ec474 100644 --- a/x-pack/plugins/ml/public/application/components/data_grid/data_grid.tsx +++ b/x-pack/plugins/ml/public/application/components/data_grid/data_grid.tsx @@ -8,7 +8,7 @@ import { isEqual } from 'lodash'; import React, { memo, useEffect, useMemo, useRef, FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, diff --git a/x-pack/plugins/ml/public/application/components/delete_job_check_modal/delete_job_check_modal.tsx b/x-pack/plugins/ml/public/application/components/delete_job_check_modal/delete_job_check_modal.tsx index 972ed06ba1385..5507cbfe155b4 100644 --- a/x-pack/plugins/ml/public/application/components/delete_job_check_modal/delete_job_check_modal.tsx +++ b/x-pack/plugins/ml/public/application/components/delete_job_check_modal/delete_job_check_modal.tsx @@ -6,7 +6,7 @@ */ import React, { FC, useState, useEffect } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiButtonEmpty, diff --git a/x-pack/plugins/ml/public/application/components/entity_cell/entity_cell.tsx b/x-pack/plugins/ml/public/application/components/entity_cell/entity_cell.tsx index f4a3b6dbf69c4..92dfe83ee6653 100644 --- a/x-pack/plugins/ml/public/application/components/entity_cell/entity_cell.tsx +++ b/x-pack/plugins/ml/public/application/components/entity_cell/entity_cell.tsx @@ -8,7 +8,7 @@ import React, { FC } from 'react'; import { EuiButtonIcon, EuiFlexGroup, EuiFlexItem, EuiText, EuiToolTip } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EMPTY_FIELD_VALUE_LABEL } from '../../timeseriesexplorer/components/entity_control/entity_control'; import { MLCATEGORY } from '../../../../common/constants/field_types'; diff --git a/x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector.tsx b/x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector.tsx index 846c79468b823..f0af666e07dbc 100644 --- a/x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector.tsx +++ b/x-pack/plugins/ml/public/application/components/full_time_range_selector/full_time_range_selector.tsx @@ -7,7 +7,7 @@ import React, { FC } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { Query } from 'src/plugins/data/public'; import { EuiButton } from '@elastic/eui'; import type { DataView } from '../../../../../../../src/plugins/data_views/public'; diff --git a/x-pack/plugins/ml/public/application/components/import_export_jobs/export_jobs_flyout/export_job_warning_callout.tsx b/x-pack/plugins/ml/public/application/components/import_export_jobs/export_jobs_flyout/export_job_warning_callout.tsx index f69df755d2aaa..131dacef8615c 100644 --- a/x-pack/plugins/ml/public/application/components/import_export_jobs/export_jobs_flyout/export_job_warning_callout.tsx +++ b/x-pack/plugins/ml/public/application/components/import_export_jobs/export_jobs_flyout/export_job_warning_callout.tsx @@ -6,7 +6,7 @@ */ import React, { FC } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiCallOut, EuiText, EuiAccordion, EuiSpacer } from '@elastic/eui'; diff --git a/x-pack/plugins/ml/public/application/components/import_export_jobs/export_jobs_flyout/export_jobs_flyout.tsx b/x-pack/plugins/ml/public/application/components/import_export_jobs/export_jobs_flyout/export_jobs_flyout.tsx index 509c74c359657..43bc861f8f83a 100644 --- a/x-pack/plugins/ml/public/application/components/import_export_jobs/export_jobs_flyout/export_jobs_flyout.tsx +++ b/x-pack/plugins/ml/public/application/components/import_export_jobs/export_jobs_flyout/export_jobs_flyout.tsx @@ -6,7 +6,7 @@ */ import React, { FC, useState, useEffect, useMemo, useCallback } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiFlyout, diff --git a/x-pack/plugins/ml/public/application/components/import_export_jobs/import_jobs_flyout/cannot_import_jobs_callout.tsx b/x-pack/plugins/ml/public/application/components/import_export_jobs/import_jobs_flyout/cannot_import_jobs_callout.tsx index 565ded9c6f6c3..b66ae3d221e00 100644 --- a/x-pack/plugins/ml/public/application/components/import_export_jobs/import_jobs_flyout/cannot_import_jobs_callout.tsx +++ b/x-pack/plugins/ml/public/application/components/import_export_jobs/import_jobs_flyout/cannot_import_jobs_callout.tsx @@ -6,7 +6,7 @@ */ import React, { FC } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiCallOut, EuiText, EuiAccordion, EuiSpacer } from '@elastic/eui'; diff --git a/x-pack/plugins/ml/public/application/components/import_export_jobs/import_jobs_flyout/cannot_read_file_callout.tsx b/x-pack/plugins/ml/public/application/components/import_export_jobs/import_jobs_flyout/cannot_read_file_callout.tsx index 70f94d1e03155..34d9b4b384241 100644 --- a/x-pack/plugins/ml/public/application/components/import_export_jobs/import_jobs_flyout/cannot_read_file_callout.tsx +++ b/x-pack/plugins/ml/public/application/components/import_export_jobs/import_jobs_flyout/cannot_read_file_callout.tsx @@ -6,7 +6,7 @@ */ import React, { FC } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiCallOut, EuiSpacer } from '@elastic/eui'; diff --git a/x-pack/plugins/ml/public/application/components/import_export_jobs/import_jobs_flyout/import_jobs_flyout.tsx b/x-pack/plugins/ml/public/application/components/import_export_jobs/import_jobs_flyout/import_jobs_flyout.tsx index 64b2f63883254..0fe3b29950370 100644 --- a/x-pack/plugins/ml/public/application/components/import_export_jobs/import_jobs_flyout/import_jobs_flyout.tsx +++ b/x-pack/plugins/ml/public/application/components/import_export_jobs/import_jobs_flyout/import_jobs_flyout.tsx @@ -6,7 +6,7 @@ */ import React, { FC, useState, useEffect, useCallback, useMemo } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import useDebounce from 'react-use/lib/useDebounce'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/ml/public/application/components/influencers_list/influencers_list.tsx b/x-pack/plugins/ml/public/application/components/influencers_list/influencers_list.tsx index a4c0aab282d15..c7998ec53c1ad 100644 --- a/x-pack/plugins/ml/public/application/components/influencers_list/influencers_list.tsx +++ b/x-pack/plugins/ml/public/application/components/influencers_list/influencers_list.tsx @@ -12,7 +12,7 @@ import React, { FC } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiTitle, EuiToolTip } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { abbreviateWholeNumber } from '../../formatters/abbreviate_whole_number'; import { getSeverity, getFormattedSeverityScore } from '../../../../common/util/anomaly_utils'; diff --git a/x-pack/plugins/ml/public/application/components/items_grid/items_grid.js b/x-pack/plugins/ml/public/application/components/items_grid/items_grid.js index 2be3e9e57ccf3..af4fa46000bb3 100644 --- a/x-pack/plugins/ml/public/application/components/items_grid/items_grid.js +++ b/x-pack/plugins/ml/public/application/components/items_grid/items_grid.js @@ -16,7 +16,7 @@ import { EuiCheckbox, EuiFlexGrid, EuiFlexGroup, EuiFlexItem, EuiText } from '@e import { ItemsGridPagination } from './items_grid_pagination'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function ItemsGrid({ numberColumns, diff --git a/x-pack/plugins/ml/public/application/components/items_grid/items_grid_pagination.js b/x-pack/plugins/ml/public/application/components/items_grid/items_grid_pagination.js index 23d40ec9f1b23..95079800fc358 100644 --- a/x-pack/plugins/ml/public/application/components/items_grid/items_grid_pagination.js +++ b/x-pack/plugins/ml/public/application/components/items_grid/items_grid_pagination.js @@ -22,7 +22,7 @@ import { EuiPopover, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; function getContextMenuItemIcon(menuItemSetting, itemsPerPage) { return menuItemSetting === itemsPerPage ? 'check' : 'empty'; diff --git a/x-pack/plugins/ml/public/application/components/job_messages/job_messages.tsx b/x-pack/plugins/ml/public/application/components/job_messages/job_messages.tsx index facef2c02d578..4b9f9d86799df 100644 --- a/x-pack/plugins/ml/public/application/components/job_messages/job_messages.tsx +++ b/x-pack/plugins/ml/public/application/components/job_messages/job_messages.tsx @@ -16,7 +16,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { euiLightVars as theme } from '@kbn/ui-shared-deps-src/theme'; import { JobMessage } from '../../../../common/types/audit_message'; diff --git a/x-pack/plugins/ml/public/application/components/job_selector/job_selector_table/job_selector_table.js b/x-pack/plugins/ml/public/application/components/job_selector/job_selector_table/job_selector_table.js index 13bc6214e5799..49cd964c09db3 100644 --- a/x-pack/plugins/ml/public/application/components/job_selector/job_selector_table/job_selector_table.js +++ b/x-pack/plugins/ml/public/application/components/job_selector/job_selector_table/job_selector_table.js @@ -10,7 +10,7 @@ import { PropTypes } from 'prop-types'; import { CustomSelectionTable } from '../../custom_selection_table'; import { JobSelectorBadge } from '../job_selector_badge'; import { TimeRangeBar } from '../timerange_bar'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, diff --git a/x-pack/plugins/ml/public/application/components/job_selector/job_selector_table/job_selector_table.test.js b/x-pack/plugins/ml/public/application/components/job_selector/job_selector_table/job_selector_table.test.js index 272948926ad8c..695fed57da477 100644 --- a/x-pack/plugins/ml/public/application/components/job_selector/job_selector_table/job_selector_table.test.js +++ b/x-pack/plugins/ml/public/application/components/job_selector/job_selector_table/job_selector_table.test.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { fireEvent, render } from '@testing-library/react'; // eslint-disable-line import/no-extraneous-dependencies import { JobSelectorTable } from './job_selector_table'; diff --git a/x-pack/plugins/ml/public/application/components/job_spaces_sync/job_spaces_sync_flyout.tsx b/x-pack/plugins/ml/public/application/components/job_spaces_sync/job_spaces_sync_flyout.tsx index 5047020999b9a..2131219deffdb 100644 --- a/x-pack/plugins/ml/public/application/components/job_spaces_sync/job_spaces_sync_flyout.tsx +++ b/x-pack/plugins/ml/public/application/components/job_spaces_sync/job_spaces_sync_flyout.tsx @@ -7,7 +7,7 @@ import React, { FC, useState, useEffect } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlyout, EuiFlyoutHeader, diff --git a/x-pack/plugins/ml/public/application/components/job_spaces_sync/sync_list.tsx b/x-pack/plugins/ml/public/application/components/job_spaces_sync/sync_list.tsx index b0d074c839027..bdf80db21364d 100644 --- a/x-pack/plugins/ml/public/application/components/job_spaces_sync/sync_list.tsx +++ b/x-pack/plugins/ml/public/application/components/job_spaces_sync/sync_list.tsx @@ -6,7 +6,7 @@ */ import React, { FC } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiText, EuiTitle, EuiAccordion, EuiTextColor, EuiHorizontalRule } from '@elastic/eui'; diff --git a/x-pack/plugins/ml/public/application/components/jobs_awaiting_node_warning/jobs_awaiting_node_warning.tsx b/x-pack/plugins/ml/public/application/components/jobs_awaiting_node_warning/jobs_awaiting_node_warning.tsx index 2f51fd6e32a60..07a10b6a36c81 100644 --- a/x-pack/plugins/ml/public/application/components/jobs_awaiting_node_warning/jobs_awaiting_node_warning.tsx +++ b/x-pack/plugins/ml/public/application/components/jobs_awaiting_node_warning/jobs_awaiting_node_warning.tsx @@ -8,7 +8,7 @@ import React, { FC } from 'react'; import { EuiCallOut, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { lazyMlNodesAvailable } from '../../ml_nodes_check'; interface Props { diff --git a/x-pack/plugins/ml/public/application/components/jobs_awaiting_node_warning/new_job_awaiting_node.tsx b/x-pack/plugins/ml/public/application/components/jobs_awaiting_node_warning/new_job_awaiting_node.tsx index f181497a9efc5..760ebc521d251 100644 --- a/x-pack/plugins/ml/public/application/components/jobs_awaiting_node_warning/new_job_awaiting_node.tsx +++ b/x-pack/plugins/ml/public/application/components/jobs_awaiting_node_warning/new_job_awaiting_node.tsx @@ -8,7 +8,7 @@ import React, { FC } from 'react'; import { EuiCallOut, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { JobType } from '../../../../common/types/saved_objects'; import { lazyMlNodesAvailable } from '../../ml_nodes_check'; diff --git a/x-pack/plugins/ml/public/application/components/jobs_awaiting_node_warning/new_job_awaiting_node_shared/new_job_awaiting_node_shared.tsx b/x-pack/plugins/ml/public/application/components/jobs_awaiting_node_warning/new_job_awaiting_node_shared/new_job_awaiting_node_shared.tsx index d4ce935cc085f..697885304ea18 100644 --- a/x-pack/plugins/ml/public/application/components/jobs_awaiting_node_warning/new_job_awaiting_node_shared/new_job_awaiting_node_shared.tsx +++ b/x-pack/plugins/ml/public/application/components/jobs_awaiting_node_warning/new_job_awaiting_node_shared/new_job_awaiting_node_shared.tsx @@ -9,7 +9,7 @@ import React, { FC, useState, useEffect, useCallback, useMemo } from 'react'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { EuiCallOut, EuiSpacer, EuiLink } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useKibana } from '../../../../../../../../src/plugins/kibana_react/public'; import { JOB_STATE } from '../../../../../common/constants/states'; import { mlApiServicesProvider } from '../../../services/ml_api_service'; diff --git a/x-pack/plugins/ml/public/application/components/model_snapshots/close_job_confirm/close_job_confirm.tsx b/x-pack/plugins/ml/public/application/components/model_snapshots/close_job_confirm/close_job_confirm.tsx index 8fc4a0d636bce..da1bb825768e2 100644 --- a/x-pack/plugins/ml/public/application/components/model_snapshots/close_job_confirm/close_job_confirm.tsx +++ b/x-pack/plugins/ml/public/application/components/model_snapshots/close_job_confirm/close_job_confirm.tsx @@ -8,7 +8,7 @@ import React, { FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiConfirmModal } from '@elastic/eui'; @@ -43,10 +43,10 @@ export const CloseJobConfirm: FC = ({ confirmButtonText={ combinedJobState === COMBINED_JOB_STATE.OPEN_AND_RUNNING ? i18n.translate('xpack.ml.modelSnapshotTable.closeJobConfirm.stopAndClose.button', { - defaultMessage: 'Force stop and close', + defaultMessage: 'Stop and close', }) : i18n.translate('xpack.ml.modelSnapshotTable.closeJobConfirm.close.button', { - defaultMessage: 'Force close', + defaultMessage: 'Close', }) } defaultFocusedButton="confirm" diff --git a/x-pack/plugins/ml/public/application/components/model_snapshots/edit_model_snapshot_flyout/edit_model_snapshot_flyout.tsx b/x-pack/plugins/ml/public/application/components/model_snapshots/edit_model_snapshot_flyout/edit_model_snapshot_flyout.tsx index 20c98255930b4..1b9fb52587bda 100644 --- a/x-pack/plugins/ml/public/application/components/model_snapshots/edit_model_snapshot_flyout/edit_model_snapshot_flyout.tsx +++ b/x-pack/plugins/ml/public/application/components/model_snapshots/edit_model_snapshot_flyout/edit_model_snapshot_flyout.tsx @@ -7,7 +7,7 @@ import React, { FC, useCallback, useState, useEffect } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlyout, EuiFlyoutFooter, diff --git a/x-pack/plugins/ml/public/application/components/model_snapshots/revert_model_snapshot_flyout/create_calendar.tsx b/x-pack/plugins/ml/public/application/components/model_snapshots/revert_model_snapshot_flyout/create_calendar.tsx index 1fae57c7922ce..cd2239c4c8f4f 100644 --- a/x-pack/plugins/ml/public/application/components/model_snapshots/revert_model_snapshot_flyout/create_calendar.tsx +++ b/x-pack/plugins/ml/public/application/components/model_snapshots/revert_model_snapshot_flyout/create_calendar.tsx @@ -7,7 +7,7 @@ import React, { FC, Fragment, useCallback, memo } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import moment from 'moment'; import { XYBrushEvent, BrushEndListener } from '@elastic/charts'; import { diff --git a/x-pack/plugins/ml/public/application/components/model_snapshots/revert_model_snapshot_flyout/revert_model_snapshot_flyout.tsx b/x-pack/plugins/ml/public/application/components/model_snapshots/revert_model_snapshot_flyout/revert_model_snapshot_flyout.tsx index f282b2fde2b3a..b6b03f879bb57 100644 --- a/x-pack/plugins/ml/public/application/components/model_snapshots/revert_model_snapshot_flyout/revert_model_snapshot_flyout.tsx +++ b/x-pack/plugins/ml/public/application/components/model_snapshots/revert_model_snapshot_flyout/revert_model_snapshot_flyout.tsx @@ -7,7 +7,7 @@ import React, { FC, useState, useCallback, useMemo, useEffect } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlyout, EuiFlyoutHeader, diff --git a/x-pack/plugins/ml/public/application/components/multi_select_picker/multi_select_picker.tsx b/x-pack/plugins/ml/public/application/components/multi_select_picker/multi_select_picker.tsx index 03db3127c85c0..60514919e0286 100644 --- a/x-pack/plugins/ml/public/application/components/multi_select_picker/multi_select_picker.tsx +++ b/x-pack/plugins/ml/public/application/components/multi_select_picker/multi_select_picker.tsx @@ -16,7 +16,7 @@ import { EuiSpacer, } from '@elastic/eui'; import React, { FC, ReactNode, useEffect, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export interface Option { name?: string | ReactNode; diff --git a/x-pack/plugins/ml/public/application/components/node_available_warning/node_available_warning.tsx b/x-pack/plugins/ml/public/application/components/node_available_warning/node_available_warning.tsx index e16139f3e573d..3ebe6e15dc2e0 100644 --- a/x-pack/plugins/ml/public/application/components/node_available_warning/node_available_warning.tsx +++ b/x-pack/plugins/ml/public/application/components/node_available_warning/node_available_warning.tsx @@ -8,7 +8,7 @@ import React, { Fragment, FC } from 'react'; import { EuiCallOut, EuiLink, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { mlNodesAvailable, permissionToViewMlNodeCount } from '../../ml_nodes_check'; import { getCloudDeploymentId, isCloud } from '../../services/ml_server_info'; diff --git a/x-pack/plugins/ml/public/application/components/rule_editor/actions_section.js b/x-pack/plugins/ml/public/application/components/rule_editor/actions_section.js index 1c6fa3fc7d05d..63dec27aabd46 100644 --- a/x-pack/plugins/ml/public/application/components/rule_editor/actions_section.js +++ b/x-pack/plugins/ml/public/application/components/rule_editor/actions_section.js @@ -22,7 +22,7 @@ import { } from '@elastic/eui'; import { ACTION } from '../../../../common/constants/detector_rule'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function ActionsSection({ actions, onSkipResultChange, onSkipModelUpdateChange }) { return ( diff --git a/x-pack/plugins/ml/public/application/components/rule_editor/components/detector_description_list/detector_description_list.js b/x-pack/plugins/ml/public/application/components/rule_editor/components/detector_description_list/detector_description_list.js index 69c6c454763f2..6e5cd75124c18 100644 --- a/x-pack/plugins/ml/public/application/components/rule_editor/components/detector_description_list/detector_description_list.js +++ b/x-pack/plugins/ml/public/application/components/rule_editor/components/detector_description_list/detector_description_list.js @@ -17,7 +17,7 @@ import { EuiDescriptionList } from '@elastic/eui'; import { formatValue } from '../../../../formatters/format_value'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function DetectorDescriptionList({ job, detector, anomaly }) { const listItems = [ diff --git a/x-pack/plugins/ml/public/application/components/rule_editor/condition_expression.js b/x-pack/plugins/ml/public/application/components/rule_editor/condition_expression.js index 75b44cc1c21aa..97c8834875196 100644 --- a/x-pack/plugins/ml/public/application/components/rule_editor/condition_expression.js +++ b/x-pack/plugins/ml/public/application/components/rule_editor/condition_expression.js @@ -26,7 +26,7 @@ import { import { APPLIES_TO, OPERATOR } from '../../../../common/constants/detector_rule'; import { appliesToText, operatorToText } from './utils'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; // Raise the popovers above GuidePageSideNav const POPOVER_STYLE = { zIndex: '200' }; diff --git a/x-pack/plugins/ml/public/application/components/rule_editor/conditions_section.js b/x-pack/plugins/ml/public/application/components/rule_editor/conditions_section.js index 586c04878f06c..0a78e6b151232 100644 --- a/x-pack/plugins/ml/public/application/components/rule_editor/conditions_section.js +++ b/x-pack/plugins/ml/public/application/components/rule_editor/conditions_section.js @@ -15,7 +15,7 @@ import React from 'react'; import { EuiButtonEmpty, EuiSpacer } from '@elastic/eui'; import { ConditionExpression } from './condition_expression'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function ConditionsSection({ isEnabled, diff --git a/x-pack/plugins/ml/public/application/components/rule_editor/rule_editor_flyout.js b/x-pack/plugins/ml/public/application/components/rule_editor/rule_editor_flyout.js index 78fdb2a0838c6..5e22b4339a3a9 100644 --- a/x-pack/plugins/ml/public/application/components/rule_editor/rule_editor_flyout.js +++ b/x-pack/plugins/ml/public/application/components/rule_editor/rule_editor_flyout.js @@ -12,7 +12,7 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, diff --git a/x-pack/plugins/ml/public/application/components/rule_editor/scope_expression.js b/x-pack/plugins/ml/public/application/components/rule_editor/scope_expression.js index 90a9b839589e9..80ad92237e8bc 100644 --- a/x-pack/plugins/ml/public/application/components/rule_editor/scope_expression.js +++ b/x-pack/plugins/ml/public/application/components/rule_editor/scope_expression.js @@ -24,7 +24,7 @@ import { import { FILTER_TYPE } from '../../../../common/constants/detector_rule'; import { filterTypeToText } from './utils'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; // Raise the popovers above GuidePageSideNav const POPOVER_STYLE = { zIndex: '200' }; diff --git a/x-pack/plugins/ml/public/application/components/rule_editor/scope_section.js b/x-pack/plugins/ml/public/application/components/rule_editor/scope_section.js index 8cdfa4f6466aa..b2754d729df6f 100644 --- a/x-pack/plugins/ml/public/application/components/rule_editor/scope_section.js +++ b/x-pack/plugins/ml/public/application/components/rule_editor/scope_section.js @@ -17,7 +17,7 @@ import { EuiCallOut, EuiCheckbox, EuiLink, EuiSpacer, EuiTitle } from '@elastic/ import { ScopeExpression } from './scope_expression'; import { checkPermission } from '../../capabilities/check_capabilities'; import { getScopeFieldDefaults } from './utils'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ML_PAGES } from '../../../../common/constants/locator'; import { useMlLocator, useNavigateToPath } from '../../contexts/kibana'; diff --git a/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/add_to_filter_list_link.js b/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/add_to_filter_list_link.js index 1a05186f1221e..ceaaceb2cca6b 100644 --- a/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/add_to_filter_list_link.js +++ b/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/add_to_filter_list_link.js @@ -14,7 +14,7 @@ import PropTypes from 'prop-types'; import React from 'react'; import { EuiLink } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function AddToFilterListLink({ fieldValue, filterId, addItemToFilterList }) { return ( diff --git a/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/delete_rule_modal.js b/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/delete_rule_modal.js index 6caa6592e96c1..1b62ab2907ff7 100644 --- a/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/delete_rule_modal.js +++ b/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/delete_rule_modal.js @@ -13,7 +13,7 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { EuiConfirmModal, EuiLink, EUI_MODAL_CONFIRM_BUTTON } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export class DeleteRuleModal extends Component { constructor(props) { diff --git a/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/edit_condition_link.js b/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/edit_condition_link.js index 47661fb09618c..90978498dfd4f 100644 --- a/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/edit_condition_link.js +++ b/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/edit_condition_link.js @@ -19,7 +19,7 @@ import { APPLIES_TO } from '../../../../../common/constants/detector_rule'; import { formatValue } from '../../../formatters/format_value'; import { getAppliesToValueFromAnomaly } from '../utils'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export class EditConditionLink extends Component { static propTypes = { diff --git a/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/rule_action_panel.js b/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/rule_action_panel.js index a1203086fb737..d260556d487c2 100644 --- a/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/rule_action_panel.js +++ b/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/rule_action_panel.js @@ -21,7 +21,7 @@ import { DeleteRuleModal } from './delete_rule_modal'; import { EditConditionLink } from './edit_condition_link'; import { buildRuleDescription } from '../utils'; import { ml } from '../../../services/ml_api_service'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export class RuleActionPanel extends Component { constructor(props) { diff --git a/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/select_rule_action.js b/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/select_rule_action.js index fb32ed42266c0..7e3944b817778 100644 --- a/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/select_rule_action.js +++ b/x-pack/plugins/ml/public/application/components/rule_editor/select_rule_action/select_rule_action.js @@ -16,7 +16,7 @@ import { EuiLink, EuiSpacer, EuiText } from '@elastic/eui'; import { DetectorDescriptionList } from '../components/detector_description_list'; import { RuleActionPanel } from './rule_action_panel'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function SelectRuleAction({ job, diff --git a/x-pack/plugins/ml/public/application/components/saved_objects_warning/saved_objects_warning.tsx b/x-pack/plugins/ml/public/application/components/saved_objects_warning/saved_objects_warning.tsx index d89d3ee9ea2ff..a63479bf3e76d 100644 --- a/x-pack/plugins/ml/public/application/components/saved_objects_warning/saved_objects_warning.tsx +++ b/x-pack/plugins/ml/public/application/components/saved_objects_warning/saved_objects_warning.tsx @@ -7,7 +7,7 @@ import React, { FC, useEffect, useState, useCallback, useRef, useMemo } from 'react'; import { EuiCallOut, EuiLink, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { JobType } from '../../../../common/types/saved_objects'; import { useMlApiContext } from '../../contexts/kibana'; import { JobSpacesSyncFlyout } from '../../components/job_spaces_sync'; diff --git a/x-pack/plugins/ml/public/application/components/scatterplot_matrix/scatterplot_matrix.test.tsx b/x-pack/plugins/ml/public/application/components/scatterplot_matrix/scatterplot_matrix.test.tsx index 846a8da83acb0..c9851589f4c46 100644 --- a/x-pack/plugins/ml/public/application/components/scatterplot_matrix/scatterplot_matrix.test.tsx +++ b/x-pack/plugins/ml/public/application/components/scatterplot_matrix/scatterplot_matrix.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { render, waitFor, screen } from '@testing-library/react'; -import { __IntlProvider as IntlProvider } from '@kbn/i18n/react'; +import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; import { euiLightVars as euiThemeLight } from '@kbn/ui-shared-deps-src/theme'; diff --git a/x-pack/plugins/ml/public/application/components/upgrade/upgrade_warning.tsx b/x-pack/plugins/ml/public/application/components/upgrade/upgrade_warning.tsx index d51b6d5eee668..6f0c9b4a2d1b8 100644 --- a/x-pack/plugins/ml/public/application/components/upgrade/upgrade_warning.tsx +++ b/x-pack/plugins/ml/public/application/components/upgrade/upgrade_warning.tsx @@ -8,7 +8,7 @@ import React, { FC } from 'react'; import { EuiCallOut, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { isUpgradeInProgress } from '../../services/upgrade_service'; diff --git a/x-pack/plugins/ml/public/application/components/validate_job/validate_job_view.js b/x-pack/plugins/ml/public/application/components/validate_job/validate_job_view.js index 14e242ee69211..f3431f6052069 100644 --- a/x-pack/plugins/ml/public/application/components/validate_job/validate_job_view.js +++ b/x-pack/plugins/ml/public/application/components/validate_job/validate_job_view.js @@ -24,7 +24,7 @@ import { EuiLoadingSpinner, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { getDocLinks } from '../../util/dependency_cache'; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/advanced_step/advanced_step_form.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/advanced_step/advanced_step_form.tsx index bc44ff059626c..379861f133a20 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/advanced_step/advanced_step_form.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/advanced_step/advanced_step_form.tsx @@ -6,7 +6,7 @@ */ import React, { FC, Fragment, useMemo, useEffect, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiAccordion, EuiComboBox, diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/analysis_fields_table.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/analysis_fields_table.tsx index 8b7109d87a866..58f53efa4f4eb 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/analysis_fields_table.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/analysis_fields_table.tsx @@ -11,7 +11,7 @@ import { isEqual } from 'lodash'; // @ts-ignore no declaration import { LEFT_ALIGNMENT, CENTER_ALIGNMENT, SortableProperties } from '@elastic/eui/lib/services'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { FieldSelectionItem } from '../../../../common/analytics'; // @ts-ignore could not find declaration file import { CustomSelectionTable } from '../../../../../components/custom_selection_table'; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/supported_fields_message.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/supported_fields_message.tsx index 95eb180585e5d..1efb442425b69 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/supported_fields_message.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/supported_fields_message.tsx @@ -7,7 +7,7 @@ import React, { FC, Fragment, useState, useEffect } from 'react'; import { EuiSpacer, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { AnalyticsJobType } from '../../../analytics_management/hooks/use_create_analytics_form/state'; import { ANALYSIS_CONFIG_TYPE } from '../../../../common/analytics'; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/runtime_mappings/runtime_mappings.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/runtime_mappings/runtime_mappings.tsx index e24d8e89d464e..13c3e71cd122a 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/runtime_mappings/runtime_mappings.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/runtime_mappings/runtime_mappings.tsx @@ -18,7 +18,7 @@ import { EuiText, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { XJsonMode } from '@kbn/ace'; import { useMlContext } from '../../../../../contexts/ml'; import { CreateAnalyticsFormProps } from '../../../analytics_management/hooks/use_create_analytics_form'; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/page.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/page.tsx index 8b136cfcd3637..839d4f556c8a6 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/page.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/page.tsx @@ -20,7 +20,7 @@ import { EuiTitle, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useMlContext } from '../../../contexts/ml'; import { ml } from '../../../services/ml_api_service'; import { useCreateAnalyticsForm } from '../analytics_management/hooks/use_create_analytics_form'; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/confusion_matrix_help_popover.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/confusion_matrix_help_popover.tsx index 34fad4d8acb45..425c8c6cb3956 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/confusion_matrix_help_popover.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/confusion_matrix_help_popover.tsx @@ -7,7 +7,7 @@ import React, { useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { HelpPopover, HelpPopoverButton, diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/evaluate_panel.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/evaluate_panel.tsx index 00a63bcf2a414..43085877b700a 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/evaluate_panel.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/evaluate_panel.tsx @@ -9,7 +9,7 @@ import './_classification_exploration.scss'; import React, { FC, useState, useEffect } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, EuiDataGrid, diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/evaluation_quality_metrics_table.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/evaluation_quality_metrics_table.tsx index 32820b69b8a8b..90182f27f7177 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/evaluation_quality_metrics_table.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/evaluation_quality_metrics_table.tsx @@ -6,7 +6,7 @@ */ import React, { FC } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiAccordion, EuiInMemoryTable, EuiPanel } from '@elastic/eui'; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/roc_curve_help_popover.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/roc_curve_help_popover.tsx index f828cbabde894..a14096d77be9f 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/roc_curve_help_popover.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/roc_curve_help_popover.tsx @@ -7,7 +7,7 @@ import React, { useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { HelpPopover, HelpPopoverButton, diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_analytics.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_analytics.tsx index 0735f4cb0cee1..702536a3d9cc3 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_analytics.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_analytics.tsx @@ -7,7 +7,7 @@ import React, { useEffect, useState, FC } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiHorizontalRule, EuiLoadingSpinner, EuiSpacer, EuiText } from '@elastic/eui'; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_results.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_results.tsx index 2c2df0cd3d905..1041fcb7af8ab 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_results.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_results.tsx @@ -8,7 +8,7 @@ import React, { FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDataGridColumn, EuiSpacer, EuiText } from '@elastic/eui'; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_splom.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_splom.tsx index 4c041b11f8d4f..04746bafe5327 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_splom.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/expandable_section/expandable_section_splom.tsx @@ -9,7 +9,7 @@ import './expandable_section.scss'; import React, { FC } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiHorizontalRule, EuiSpacer } from '@elastic/eui'; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/feature_importance/decision_path_popover.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/feature_importance/decision_path_popover.tsx index a0456f9b8d7ae..5590d0eb017c5 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/feature_importance/decision_path_popover.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/feature_importance/decision_path_popover.tsx @@ -7,7 +7,7 @@ import React, { FC, useState } from 'react'; import { EuiLink, EuiTab, EuiTabs, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { RegressionDecisionPath } from './decision_path_regression'; import { DecisionPathJSONViewer } from './decision_path_json_viewer'; import { diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/feature_importance/decision_path_regression.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/feature_importance/decision_path_regression.tsx index bb9cdd861788c..d12690658b8bc 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/feature_importance/decision_path_regression.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/feature_importance/decision_path_regression.tsx @@ -7,7 +7,7 @@ import React, { FC, useMemo } from 'react'; import { EuiCallOut } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import d3 from 'd3'; import type { FeatureImportance, diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/feature_importance/missing_decision_path_callout.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/feature_importance/missing_decision_path_callout.tsx index 9254111eb7c1b..77c10b5a3f69c 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/feature_importance/missing_decision_path_callout.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/feature_importance/missing_decision_path_callout.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiCallOut } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const MissingDecisionPathCallout = () => { return ( diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/index_pattern_prompt/index_pattern_prompt.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/index_pattern_prompt/index_pattern_prompt.tsx index 65513a0ad83b1..1f9362d7e56ca 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/index_pattern_prompt/index_pattern_prompt.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/index_pattern_prompt/index_pattern_prompt.tsx @@ -6,7 +6,7 @@ */ import React, { FC, useMemo } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiLink, EuiText } from '@elastic/eui'; import { useMlKibana } from '../../../../../contexts/kibana'; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_panel.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_panel.tsx index 92f9a357e7ca5..6d5417db24607 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_panel.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_panel.tsx @@ -7,7 +7,7 @@ import React, { FC, useEffect, useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, EuiFlexGroup, diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_stat.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_stat.tsx index 004e15391e2e2..d62a22258cc01 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_stat.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_stat.tsx @@ -7,7 +7,7 @@ import React, { FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiStat, EuiIconTip, EuiFlexGroup, EuiFlexItem, EuiLink } from '@elastic/eui'; import { REGRESSION_STATS } from '../../../../common/analytics'; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/total_feature_importance_summary/feature_importance_summary.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/total_feature_importance_summary/feature_importance_summary.tsx index 9157e1fe4b678..534459dd074f0 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/total_feature_importance_summary/feature_importance_summary.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/total_feature_importance_summary/feature_importance_summary.tsx @@ -7,7 +7,7 @@ import React, { FC, useCallback, useMemo } from 'react'; import { EuiButtonEmpty, EuiSpacer, EuiCallOut } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Chart, Settings, diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/delete_action_name.test.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/delete_action_name.test.tsx index ad6a59bf01c0e..804fe77cf9430 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/delete_action_name.test.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_delete/delete_action_name.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { fireEvent, render } from '@testing-library/react'; import * as CheckPrivilige from '../../../../../capabilities/check_capabilities'; import mockAnalyticsListItem from '../analytics_list/__mocks__/analytics_list_item.json'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { coreMock as mockCoreServices, i18nServiceMock, diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_stop/stop_action_modal.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_stop/stop_action_modal.tsx index 8ee7350245be4..6f0ee0afebe42 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_stop/stop_action_modal.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/action_stop/stop_action_modal.tsx @@ -7,7 +7,7 @@ import React, { FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiConfirmModal, EUI_MODAL_CONFIRM_BUTTON } from '@elastic/eui'; import { StopAction } from './use_stop_action'; @@ -31,7 +31,7 @@ export const StopActionModal: FC = ({ closeModal, item, forceStopAnd confirmButtonText={i18n.translate( 'xpack.ml.dataframe.analyticsList.forceStopModalStartButton', { - defaultMessage: 'Force stop', + defaultMessage: 'Stop', } )} defaultFocusedButton={EUI_MODAL_CONFIRM_BUTTON} diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/use_columns.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/use_columns.tsx index d3d2370acd55e..558e2e20e015e 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/use_columns.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/use_columns.tsx @@ -7,7 +7,7 @@ import React, { Fragment } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiBadge, EuiButtonIcon, diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/refresh_analytics_list_button/refresh_analytics_list_button.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/refresh_analytics_list_button/refresh_analytics_list_button.tsx index ba3505deb7aeb..605fb10a8945e 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/refresh_analytics_list_button/refresh_analytics_list_button.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/refresh_analytics_list_button/refresh_analytics_list_button.tsx @@ -8,7 +8,7 @@ import React, { FC, useState } from 'react'; import { EuiButtonEmpty } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useRefreshAnalyticsList } from '../../../../common'; export const RefreshAnalyticsListButton: FC = () => { diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.test.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.test.tsx index c9bf469bd1f40..f62750fc41b84 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.test.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { render, fireEvent, waitFor, screen } from '@testing-library/react'; -import { __IntlProvider as IntlProvider } from '@kbn/i18n/react'; +import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; import { getDataViewAndSavedSearch, DataViewAndSavedSearch } from '../../../../../util/index_utils'; @@ -76,6 +76,11 @@ jest.mock('../../../../../contexts/kibana', () => ({ }, }), useNavigateToPath: () => mockNavigateToPath, + useNotifications: () => { + return { + toasts: { addSuccess: jest.fn(), addDanger: jest.fn(), addError: jest.fn() }, + }; + }, })); jest.mock('../../../../../util/index_utils', () => { diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.tsx index e0922d7e12653..4d06133772163 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.tsx @@ -7,7 +7,7 @@ import React, { useState, FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCallOut, @@ -23,6 +23,8 @@ import type { SimpleSavedObject } from 'src/core/public'; import { SavedObjectFinderUi } from '../../../../../../../../../../src/plugins/saved_objects/public'; import { useMlKibana, useNavigateToPath } from '../../../../../contexts/kibana'; +import { useToastNotificationService } from '../../../../../services/toast_notification_service'; + import { getNestedProperty } from '../../../../../util/object_utils'; import { getDataViewAndSavedSearch, isCcsIndexPattern } from '../../../../../util/index_utils'; @@ -41,6 +43,7 @@ export const SourceSelection: FC = ({ onClose }) => { const [isCcsCallOut, setIsCcsCallOut] = useState(false); const [ccsCallOutBodyText, setCcsCallOutBodyText] = useState(); + const toastNotificationService = useToastNotificationService(); const onSearchSelected = async ( id: string, @@ -57,8 +60,22 @@ export const SourceSelection: FC = ({ onClose }) => { if (type === 'index-pattern') { dataViewName = getNestedProperty(savedObject, 'attributes.title'); } else if (type === 'search') { - const dataViewAndSavedSearch = await getDataViewAndSavedSearch(id); - dataViewName = dataViewAndSavedSearch.dataView?.title ?? ''; + try { + const dataViewAndSavedSearch = await getDataViewAndSavedSearch(id); + dataViewName = dataViewAndSavedSearch.dataView?.title ?? ''; + } catch (error) { + // an unexpected error has occurred. This could be caused by a saved search for which the data view no longer exists. + toastNotificationService.displayErrorToast( + error, + i18n.translate( + 'xpack.ml.dataFrame.analytics.create.searchSelection.errorGettingDataViewTitle', + { + defaultMessage: 'Error loading data view used by the saved search', + } + ) + ); + return; + } } if (isCcsIndexPattern(dataViewName)) { diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/page.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/page.tsx index 1f0e0bf0aad8d..9f889b235b505 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/page.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/page.tsx @@ -7,7 +7,7 @@ import React, { FC, Fragment, useMemo, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/job_map/components/controls.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/job_map/components/controls.tsx index b2879e2ffde54..0680eb243b7d3 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/job_map/components/controls.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/job_map/components/controls.tsx @@ -7,7 +7,7 @@ import React, { FC, useEffect, useState, useContext, useCallback } from 'react'; import cytoscape from 'cytoscape'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import moment from 'moment-timezone'; import { diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/job_map/components/legend.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/job_map/components/legend.tsx index ebd84052d2ebd..3c34b9e974109 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/job_map/components/legend.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/job_map/components/legend.tsx @@ -16,7 +16,7 @@ import { EuiPopover, EuiText, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { JOB_MAP_NODE_TYPES } from '../../../../../../common/constants/data_frame_analytics'; import { EuiThemeType } from '../../../../components/color_range_legend'; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/job_map/job_map.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/job_map/job_map.tsx index a415b18fff4c2..314d5251502cb 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/job_map/job_map.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/job_map/job_map.tsx @@ -7,7 +7,7 @@ import React, { FC, useEffect, useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; import { Cytoscape, Controls, JobMapLegend } from './components'; import { useMlKibana, useMlLocator } from '../../../contexts/kibana'; diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/job_map/job_map_title.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/job_map/job_map_title.tsx index cbc09b636c7b6..e170b73b792ee 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/job_map/job_map_title.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/job_map/job_map_title.tsx @@ -7,7 +7,7 @@ import React, { FC } from 'react'; import { EuiTitle } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const JobMapTitle: FC<{ analyticsId?: string; modelId?: string }> = ({ analyticsId, diff --git a/x-pack/plugins/ml/public/application/datavisualizer/datavisualizer_selector.tsx b/x-pack/plugins/ml/public/application/datavisualizer/datavisualizer_selector.tsx index 608b1ef28a2e0..e515ec088fca8 100644 --- a/x-pack/plugins/ml/public/application/datavisualizer/datavisualizer_selector.tsx +++ b/x-pack/plugins/ml/public/application/datavisualizer/datavisualizer_selector.tsx @@ -21,7 +21,7 @@ import { EuiTitle, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { isFullLicense } from '../license'; import { useTimefilter, useMlKibana, useNavigateToPath } from '../contexts/kibana'; import { NavigationMenu } from '../components/navigation_menu'; diff --git a/x-pack/plugins/ml/public/application/explorer/anomalies_map.tsx b/x-pack/plugins/ml/public/application/explorer/anomalies_map.tsx index 28f346c0148c6..0eb6e356e1397 100644 --- a/x-pack/plugins/ml/public/application/explorer/anomalies_map.tsx +++ b/x-pack/plugins/ml/public/application/explorer/anomalies_map.tsx @@ -6,7 +6,7 @@ */ import React, { FC, useCallback, useEffect, useMemo, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiAccordion, diff --git a/x-pack/plugins/ml/public/application/explorer/anomaly_context_menu.tsx b/x-pack/plugins/ml/public/application/explorer/anomaly_context_menu.tsx index c32745f8bce8c..0cd92bd06bbbe 100644 --- a/x-pack/plugins/ml/public/application/explorer/anomaly_context_menu.tsx +++ b/x-pack/plugins/ml/public/application/explorer/anomaly_context_menu.tsx @@ -13,7 +13,7 @@ import { EuiFlexItem, EuiPopover, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { useMlKibana } from '../contexts/kibana'; import type { AppStateSelectedCells, ExplorerJob } from './explorer_utils'; diff --git a/x-pack/plugins/ml/public/application/explorer/anomaly_timeline.tsx b/x-pack/plugins/ml/public/application/explorer/anomaly_timeline.tsx index c8006292f8e09..ba4be2a91f4dc 100644 --- a/x-pack/plugins/ml/public/application/explorer/anomaly_timeline.tsx +++ b/x-pack/plugins/ml/public/application/explorer/anomaly_timeline.tsx @@ -21,7 +21,7 @@ import { EuiTitle, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import useDebounce from 'react-use/lib/useDebounce'; import { OVERALL_LABEL, SWIMLANE_TYPE, VIEW_BY_JOB_LABEL } from './explorer_constants'; import { AddSwimlaneToDashboardControl } from './dashboard_controls/add_swimlane_to_dashboard_controls'; diff --git a/x-pack/plugins/ml/public/application/explorer/anomaly_timeline_help_popover.tsx b/x-pack/plugins/ml/public/application/explorer/anomaly_timeline_help_popover.tsx index 5894455743ca9..bcdf22a9bbac8 100644 --- a/x-pack/plugins/ml/public/application/explorer/anomaly_timeline_help_popover.tsx +++ b/x-pack/plugins/ml/public/application/explorer/anomaly_timeline_help_popover.tsx @@ -7,7 +7,7 @@ import React, { useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { HelpPopover, HelpPopoverButton } from '../components/help_popover/help_popover'; export const AnomalyTimelineHelpPopover = () => { diff --git a/x-pack/plugins/ml/public/application/explorer/components/explorer_no_influencers_found/explorer_no_influencers_found.tsx b/x-pack/plugins/ml/public/application/explorer/components/explorer_no_influencers_found/explorer_no_influencers_found.tsx index b717a0aeeeae6..cab742779f9d4 100644 --- a/x-pack/plugins/ml/public/application/explorer/components/explorer_no_influencers_found/explorer_no_influencers_found.tsx +++ b/x-pack/plugins/ml/public/application/explorer/components/explorer_no_influencers_found/explorer_no_influencers_found.tsx @@ -7,7 +7,7 @@ import React, { FC } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; /* * React component for rendering EuiEmptyPrompt when no influencers were found. diff --git a/x-pack/plugins/ml/public/application/explorer/components/explorer_no_jobs_found/explorer_no_jobs_found.js b/x-pack/plugins/ml/public/application/explorer/components/explorer_no_jobs_found/explorer_no_jobs_found.js index 854caedd1a25f..34f2cdc688960 100644 --- a/x-pack/plugins/ml/public/application/explorer/components/explorer_no_jobs_found/explorer_no_jobs_found.js +++ b/x-pack/plugins/ml/public/application/explorer/components/explorer_no_jobs_found/explorer_no_jobs_found.js @@ -9,7 +9,7 @@ * React component for rendering EuiEmptyPrompt when no jobs were found. */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiEmptyPrompt, EuiButton } from '@elastic/eui'; import { ML_PAGES } from '../../../../../common/constants/locator'; import { useMlLink } from '../../../contexts/kibana/use_create_url'; diff --git a/x-pack/plugins/ml/public/application/explorer/components/explorer_no_results_found/explorer_no_results_found.js b/x-pack/plugins/ml/public/application/explorer/components/explorer_no_results_found/explorer_no_results_found.js index 799437e1799f0..5eee341af6862 100644 --- a/x-pack/plugins/ml/public/application/explorer/components/explorer_no_results_found/explorer_no_results_found.js +++ b/x-pack/plugins/ml/public/application/explorer/components/explorer_no_results_found/explorer_no_results_found.js @@ -10,7 +10,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiEmptyPrompt } from '@elastic/eui'; diff --git a/x-pack/plugins/ml/public/application/explorer/components/no_overall_data.tsx b/x-pack/plugins/ml/public/application/explorer/components/no_overall_data.tsx index 65935050ee218..b204eb3e978cb 100644 --- a/x-pack/plugins/ml/public/application/explorer/components/no_overall_data.tsx +++ b/x-pack/plugins/ml/public/application/explorer/components/no_overall_data.tsx @@ -6,7 +6,7 @@ */ import React, { FC } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const NoOverallData: FC = () => { return ( diff --git a/x-pack/plugins/ml/public/application/explorer/dashboard_controls/add_anomaly_charts_to_dashboard_controls.tsx b/x-pack/plugins/ml/public/application/explorer/dashboard_controls/add_anomaly_charts_to_dashboard_controls.tsx index 5c3c6edee59c5..dd08abf8e895e 100644 --- a/x-pack/plugins/ml/public/application/explorer/dashboard_controls/add_anomaly_charts_to_dashboard_controls.tsx +++ b/x-pack/plugins/ml/public/application/explorer/dashboard_controls/add_anomaly_charts_to_dashboard_controls.tsx @@ -5,7 +5,7 @@ * 2.0. */ import React, { FC, useCallback, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFieldNumber, EuiFormRow, formatDate } from '@elastic/eui'; import { useDashboardTable } from './use_dashboards_table'; import { AddToDashboardControl } from './add_to_dashboard_controls'; diff --git a/x-pack/plugins/ml/public/application/explorer/dashboard_controls/add_swimlane_to_dashboard_controls.tsx b/x-pack/plugins/ml/public/application/explorer/dashboard_controls/add_swimlane_to_dashboard_controls.tsx index 79089e7e5baf9..d343f88ce7832 100644 --- a/x-pack/plugins/ml/public/application/explorer/dashboard_controls/add_swimlane_to_dashboard_controls.tsx +++ b/x-pack/plugins/ml/public/application/explorer/dashboard_controls/add_swimlane_to_dashboard_controls.tsx @@ -7,7 +7,7 @@ import React, { FC, useCallback, useState } from 'react'; import { EuiFormRow, EuiCheckboxGroup, EuiInMemoryTableProps, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { DashboardSavedObject } from '../../../../../../../src/plugins/dashboard/public'; import { getDefaultSwimlanePanelTitle } from '../../../embeddables/anomaly_swimlane/anomaly_swimlane_embeddable'; diff --git a/x-pack/plugins/ml/public/application/explorer/dashboard_controls/add_to_dashboard_controls.tsx b/x-pack/plugins/ml/public/application/explorer/dashboard_controls/add_to_dashboard_controls.tsx index 7806e531834a1..fa91812381a17 100644 --- a/x-pack/plugins/ml/public/application/explorer/dashboard_controls/add_to_dashboard_controls.tsx +++ b/x-pack/plugins/ml/public/application/explorer/dashboard_controls/add_to_dashboard_controls.tsx @@ -17,7 +17,7 @@ import { EuiModalHeaderTitle, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiTableProps, useDashboardTable } from './use_dashboards_table'; export const columns: EuiTableProps['columns'] = [ @@ -85,7 +85,7 @@ export const AddToDashboardControl: FC = ({ search={search} pagination={true} sorting={true} - data-test-subj="mlDashboardSelectionTable" + data-test-subj={`mlDashboardSelectionTable${isLoading ? ' loading' : ' loaded'}`} /> diff --git a/x-pack/plugins/ml/public/application/explorer/dashboard_controls/use_add_to_dashboard_actions.tsx b/x-pack/plugins/ml/public/application/explorer/dashboard_controls/use_add_to_dashboard_actions.tsx index 82c699865f2e4..450266125e1a9 100644 --- a/x-pack/plugins/ml/public/application/explorer/dashboard_controls/use_add_to_dashboard_actions.tsx +++ b/x-pack/plugins/ml/public/application/explorer/dashboard_controls/use_add_to_dashboard_actions.tsx @@ -6,7 +6,7 @@ */ import React, { useCallback } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { DashboardItem } from './use_dashboards_table'; import { SavedDashboardPanel } from '../../../../../../../src/plugins/dashboard/common/types'; import { useMlKibana } from '../../contexts/kibana'; diff --git a/x-pack/plugins/ml/public/application/explorer/explorer.js b/x-pack/plugins/ml/public/application/explorer/explorer.js index 7d08c0fc1756e..7f5d8d8b39441 100644 --- a/x-pack/plugins/ml/public/application/explorer/explorer.js +++ b/x-pack/plugins/ml/public/application/explorer/explorer.js @@ -12,7 +12,7 @@ import PropTypes from 'prop-types'; import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { htmlIdGenerator, diff --git a/x-pack/plugins/ml/public/application/explorer/explorer_charts/components/explorer_chart_label/entity_filter/entity_filter.tsx b/x-pack/plugins/ml/public/application/explorer/explorer_charts/components/explorer_chart_label/entity_filter/entity_filter.tsx index 66f4052a6952f..15822d74d08d5 100644 --- a/x-pack/plugins/ml/public/application/explorer/explorer_charts/components/explorer_chart_label/entity_filter/entity_filter.tsx +++ b/x-pack/plugins/ml/public/application/explorer/explorer_charts/components/explorer_chart_label/entity_filter/entity_filter.tsx @@ -6,7 +6,7 @@ */ import React, { FC } from 'react'; import { EuiButtonIcon, EuiToolTip } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { ENTITY_FIELD_OPERATIONS, diff --git a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_anomalies_container.tsx b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_anomalies_container.tsx index 44e6d9ed3dd85..dc40ec144ef6c 100644 --- a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_anomalies_container.tsx +++ b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_anomalies_container.tsx @@ -8,7 +8,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiText } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React, { FC } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; // @ts-ignore import { ExplorerChartsContainer } from './explorer_charts_container'; import { diff --git a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container.js b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container.js index ddb46edc7b921..5d3ef7611bd09 100644 --- a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container.js +++ b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container.js @@ -28,7 +28,7 @@ import { ExplorerChartLabel } from './components/explorer_chart_label'; import { CHART_TYPE } from '../explorer_constants'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { MlTooltipComponent } from '../../components/chart_tooltip'; import { withKibana } from '../../../../../../../src/plugins/kibana_react/public'; import { ML_JOB_AGGREGATION } from '../../../../common/constants/aggregation_types'; diff --git a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container.test.js b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container.test.js index 53d06e7253f00..4d3e4c0f3b8a1 100644 --- a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container.test.js +++ b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_container.test.js @@ -8,7 +8,7 @@ import React from 'react'; import { mount, shallow } from 'enzyme'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { chartLimits } from '../../util/chart_utils'; diff --git a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_error_callouts.tsx b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_error_callouts.tsx index 80d584ebe9a4d..ef9b156a9f707 100644 --- a/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_error_callouts.tsx +++ b/x-pack/plugins/ml/public/application/explorer/explorer_charts/explorer_charts_error_callouts.tsx @@ -6,7 +6,7 @@ */ import { EuiCallOut, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { FC } from 'react'; import { ExplorerChartSeriesErrorMessages } from './explorer_charts_container_service'; diff --git a/x-pack/plugins/ml/public/application/explorer/swimlane_pagination.tsx b/x-pack/plugins/ml/public/application/explorer/swimlane_pagination.tsx index 18297d06dd6fe..b84747f138237 100644 --- a/x-pack/plugins/ml/public/application/explorer/swimlane_pagination.tsx +++ b/x-pack/plugins/ml/public/application/explorer/swimlane_pagination.tsx @@ -15,7 +15,7 @@ import { EuiContextMenuItem, EuiButtonEmpty, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; interface SwimLanePaginationProps { diff --git a/x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/editor.tsx b/x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/editor.tsx index b140c950d52ef..cfe82a9f01880 100644 --- a/x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/editor.tsx +++ b/x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/editor.tsx @@ -23,7 +23,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { isValidCustomUrlSettingsTimeRange } from './utils'; import { isValidLabel } from '../../../util/custom_url_utils'; diff --git a/x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/list.tsx b/x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/list.tsx index 96b09aff64f0c..bc6053cce4209 100644 --- a/x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/list.tsx +++ b/x-pack/plugins/ml/public/application/jobs/components/custom_url_editor/list.tsx @@ -18,7 +18,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useMlKibana } from '../../../contexts/kibana'; import { isValidLabel, openCustomUrlWindow } from '../../../util/custom_url_utils'; import { getTestUrl } from './utils'; diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/datafeed_chart_flyout/datafeed_chart_flyout.tsx b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/datafeed_chart_flyout/datafeed_chart_flyout.tsx index 17ff5db2768d6..7c814b4b17baa 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/datafeed_chart_flyout/datafeed_chart_flyout.tsx +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/datafeed_chart_flyout/datafeed_chart_flyout.tsx @@ -6,7 +6,7 @@ */ import React, { FC, useCallback, useEffect, useMemo, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import moment from 'moment'; import { diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/datafeed_chart_flyout/edit_query_delay.tsx b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/datafeed_chart_flyout/edit_query_delay.tsx index 7609f190f4763..08513f20b0bce 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/datafeed_chart_flyout/edit_query_delay.tsx +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/datafeed_chart_flyout/edit_query_delay.tsx @@ -6,7 +6,7 @@ */ import React, { FC, useCallback, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiButtonEmpty, diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/delete_job_modal/delete_job_modal.tsx b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/delete_job_modal/delete_job_modal.tsx index 1701b7a2bd4fb..2f04e8ae86e73 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/delete_job_modal/delete_job_modal.tsx +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/delete_job_modal/delete_job_modal.tsx @@ -6,7 +6,7 @@ */ import React, { FC, useState, useEffect, useCallback } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiSpacer, EuiModal, diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_job_flyout.js b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_job_flyout.js index c57995d14e8f8..c278f8790984f 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_job_flyout.js +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_job_flyout.js @@ -9,7 +9,7 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { cloneDeep, isEqual, pick } from 'lodash'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiButtonEmpty, diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/custom_urls.tsx b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/custom_urls.tsx index 035836373adf6..2c17251e15d8d 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/custom_urls.tsx +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/custom_urls.tsx @@ -20,7 +20,7 @@ import { EuiModalHeaderTitle, EuiModalFooter, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { CustomUrlEditor, CustomUrlList } from '../../../../components/custom_url_editor'; diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/datafeed.js b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/datafeed.js index c0b3eee771fe4..c62907052773c 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/datafeed.js +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/datafeed.js @@ -21,7 +21,7 @@ import { calculateDatafeedFrequencyDefaultSeconds } from '../../../../../../../c import { getNewJobDefaults } from '../../../../../services/ml_server_info'; import { parseInterval } from '../../../../../../../common/util/parse_interval'; import { MLJobEditor, ML_EDITOR_MODE } from '../../ml_job_editor'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; function getDefaults(bucketSpan, jobDefaults) { const bucketSpanSeconds = bucketSpan !== undefined ? parseInterval(bucketSpan).asSeconds() : ''; diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/detectors.js b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/detectors.js index 3fe7eb2bfb732..14df6ccb8d8f4 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/detectors.js +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/detectors.js @@ -7,7 +7,7 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFieldText, EuiForm, EuiFormRow, EuiSpacer, EuiTitle } from '@elastic/eui'; diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/job_details.js b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/job_details.js index d3041feaecbf6..9bfa9caa0c875 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/job_details.js +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/job_details.js @@ -19,7 +19,7 @@ import { import { ml } from '../../../../../services/ml_api_service'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { tabColor } from '../../../../../../../common/util/group_color_utils'; export class JobDetails extends Component { diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_details/datafeed_preview_tab.js b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_details/datafeed_preview_tab.js index c24d8df3909fe..6aa4d538481ee 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_details/datafeed_preview_tab.js +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_details/datafeed_preview_tab.js @@ -14,7 +14,7 @@ import { ml } from '../../../../services/ml_api_service'; import { checkPermission } from '../../../../capabilities/check_capabilities'; import { ML_DATA_PREVIEW_COUNT } from '../../../../../../common/util/job_utils'; import { MLJobEditor } from '../ml_job_editor'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export class DatafeedPreviewPane extends Component { constructor(props) { diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_details/forecasts_table/forecasts_table.js b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_details/forecasts_table/forecasts_table.js index 9dac1a6a0d261..dd26d29fc0a82 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_details/forecasts_table/forecasts_table.js +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_details/forecasts_table/forecasts_table.js @@ -23,7 +23,7 @@ import { FORECAST_REQUEST_STATE } from '../../../../../../../common/constants/st import { addItemToRecentlyAccessed } from '../../../../../util/recently_accessed'; import { mlForecastService } from '../../../../../services/forecast_service'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { getLatestDataOrBucketTimestamp, isTimeSeriesViewJob, diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_details/job_details.js b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_details/job_details.js index 9ec1d6cc6b606..114b1944dfa23 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_details/job_details.js +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_details/job_details.js @@ -7,7 +7,7 @@ import PropTypes from 'prop-types'; import React, { Component, Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiButtonIcon, EuiTabbedContent, EuiLoadingSpinner, EuiToolTip } from '@elastic/eui'; diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_details/job_messages_pane.tsx b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_details/job_messages_pane.tsx index 92662f409d0f3..cd109a0bf9f06 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_details/job_messages_pane.tsx +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_details/job_messages_pane.tsx @@ -8,7 +8,7 @@ import React, { FC, useCallback, useEffect, useState } from 'react'; import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiToolTip } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ml } from '../../../../services/ml_api_service'; import { JobMessages } from '../../../../components/job_messages'; import { JobMessage } from '../../../../../../common/types/audit_message'; diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_filter_bar/job_filter_bar.tsx b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_filter_bar/job_filter_bar.tsx index 8736e27619ee5..ca79ec89703f8 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_filter_bar/job_filter_bar.tsx +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/job_filter_bar/job_filter_bar.tsx @@ -17,7 +17,7 @@ import { Query, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { JobGroup } from '../job_group'; import { useMlKibana } from '../../../../contexts/kibana'; diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/jobs_list/jobs_list.js b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/jobs_list/jobs_list.js index 57e51838be7d4..5fe005c4b34ff 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/jobs_list/jobs_list.js +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/jobs_list/jobs_list.js @@ -26,7 +26,7 @@ import { EuiToolTip, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { AnomalyDetectionJobIdLink } from './job_id_link'; const PAGE_SIZE_OPTIONS = [10, 25, 50]; diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/jobs_list_view/jobs_list_view.js b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/jobs_list_view/jobs_list_view.js index 6f7a9adaecceb..2d6d457333a98 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/jobs_list_view/jobs_list_view.js +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/jobs_list_view/jobs_list_view.js @@ -6,7 +6,7 @@ */ import React, { Component } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/ml_job_editor/ml_job_editor.tsx b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/ml_job_editor/ml_job_editor.tsx index 9ee583ba2d3e7..631b916202505 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/ml_job_editor/ml_job_editor.tsx +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/ml_job_editor/ml_job_editor.tsx @@ -37,7 +37,12 @@ export const MLJobEditor: FC = ({ onChange = () => {}, }) => { if (mode === ML_EDITOR_MODE.XJSON) { - value = expandLiteralStrings(value); + try { + value = expandLiteralStrings(value); + } catch (error) { + // eslint-disable-next-line no-console + console.error(error); + } } return ( diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/multi_job_actions/actions_menu.js b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/multi_job_actions/actions_menu.js index f9ea50da9d7d7..e8b91be794422 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/multi_job_actions/actions_menu.js +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/multi_job_actions/actions_menu.js @@ -21,7 +21,7 @@ import { isResettable, } from '../utils'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; class MultiJobActionsMenuUI extends Component { constructor(props) { diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/multi_job_actions/group_selector/group_selector.js b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/multi_job_actions/group_selector/group_selector.js index 9cb4af7085cbe..be28ad6bf4d23 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/multi_job_actions/group_selector/group_selector.js +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/multi_job_actions/group_selector/group_selector.js @@ -8,7 +8,7 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/multi_job_actions/multi_job_actions.js b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/multi_job_actions/multi_job_actions.js index cdbcb947204b5..148f1a9276c50 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/multi_job_actions/multi_job_actions.js +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/multi_job_actions/multi_job_actions.js @@ -13,7 +13,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiTitle } from '@elastic/eui'; import { ResultLinks } from '../job_actions'; import { MultiJobActionsMenu } from './actions_menu'; import { GroupSelector } from './group_selector'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export class MultiJobActions extends Component { constructor(props) { diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/new_job_button/new_job_button.js b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/new_job_button/new_job_button.js index a6ed115880265..77955a7af050b 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/new_job_button/new_job_button.js +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/new_job_button/new_job_button.js @@ -11,7 +11,7 @@ import { mlNodesAvailable } from '../../../../ml_nodes_check/check_ml_nodes'; import React from 'react'; import { EuiButton } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useCreateAndNavigateToMlLink } from '../../../../contexts/kibana/use_create_url'; import { ML_PAGES } from '../../../../../../common/constants/locator'; diff --git a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/refresh_jobs_list_button/refresh_jobs_list_button.js b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/refresh_jobs_list_button/refresh_jobs_list_button.js index f4f0fd763d5f5..b013600d20016 100644 --- a/x-pack/plugins/ml/public/application/jobs/jobs_list/components/refresh_jobs_list_button/refresh_jobs_list_button.js +++ b/x-pack/plugins/ml/public/application/jobs/jobs_list/components/refresh_jobs_list_button/refresh_jobs_list_button.js @@ -9,7 +9,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { EuiButtonEmpty } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const RefreshJobsListButton = ({ onRefreshClick, isRefreshing }) => ( { diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/frequency/description.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/frequency/description.tsx index 72e48600a3433..6856ab32f4fd2 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/frequency/description.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/frequency/description.tsx @@ -7,7 +7,7 @@ import React, { memo, FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiFormRow } from '@elastic/eui'; import { Validation } from '../../../../../common/job_validator'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/query_delay/description.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/query_delay/description.tsx index 0b102ce0562db..ed5b5a8288988 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/query_delay/description.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/query_delay/description.tsx @@ -7,7 +7,7 @@ import React, { memo, FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiFormRow } from '@elastic/eui'; import { Validation } from '../../../../../common/job_validator'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/reset_query/reset_query.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/reset_query/reset_query.tsx index e42ec414e9641..6cab29ef4350f 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/reset_query/reset_query.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/reset_query/reset_query.tsx @@ -7,7 +7,7 @@ import React, { FC, useContext, useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, EuiConfirmModal, EuiCodeBlock, EuiSpacer } from '@elastic/eui'; import { JobCreatorContext } from '../../../job_creator_context'; import { getDefaultDatafeedQuery } from '../../../../../utils/new_job_utils'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/scroll_size/description.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/scroll_size/description.tsx index e577587b01baf..f7380e37e5312 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/scroll_size/description.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/scroll_size/description.tsx @@ -7,7 +7,7 @@ import React, { memo, FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiFormRow } from '@elastic/eui'; import { Validation } from '../../../../../common/job_validator'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/time_field/description.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/time_field/description.tsx index a9109f41ea078..64d7fb80f16ff 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/time_field/description.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/time_field/description.tsx @@ -7,7 +7,7 @@ import React, { memo, FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiFormRow } from '@elastic/eui'; export const Description: FC = memo(({ children }) => { diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/additional_section/components/calendars/calendars_selection.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/additional_section/components/calendars/calendars_selection.tsx index 2fd87676ecf80..04663b8dfbaea 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/additional_section/components/calendars/calendars_selection.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/additional_section/components/calendars/calendars_selection.tsx @@ -6,7 +6,7 @@ */ import React, { FC, useContext, useEffect, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonIcon, EuiComboBox, diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/additional_section/components/calendars/description.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/additional_section/components/calendars/description.tsx index 53b8b91213404..be1602bc34b6e 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/additional_section/components/calendars/description.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/additional_section/components/calendars/description.tsx @@ -7,7 +7,7 @@ import React, { memo, FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiFormRow, EuiLink } from '@elastic/eui'; import { useMlKibana } from '../../../../../../../../../contexts/kibana'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/additional_section/components/custom_urls/description.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/additional_section/components/custom_urls/description.tsx index 990dbca9f1f8f..cd2156b059f47 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/additional_section/components/custom_urls/description.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/additional_section/components/custom_urls/description.tsx @@ -7,7 +7,7 @@ import React, { memo, FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiFormRow, EuiLink } from '@elastic/eui'; import { useMlKibana } from '../../../../../../../../../contexts/kibana'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/advanced_section/components/annotations/annotations_switch.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/advanced_section/components/annotations/annotations_switch.tsx index ece51890cf8dc..7bed1cc20cc74 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/advanced_section/components/annotations/annotations_switch.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/advanced_section/components/annotations/annotations_switch.tsx @@ -8,7 +8,7 @@ import React, { FC, useState, useContext, useEffect } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiCallOut, EuiSpacer, EuiSwitch } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { JobCreatorContext } from '../../../../../job_creator_context'; import { Description } from './description'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/advanced_section/components/annotations/description.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/advanced_section/components/annotations/description.tsx index 32e401b79a13d..e04b76d9a55c8 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/advanced_section/components/annotations/description.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/advanced_section/components/annotations/description.tsx @@ -7,7 +7,7 @@ import React, { memo, FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiFormRow } from '@elastic/eui'; export const Description: FC = memo(({ children }) => { diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/advanced_section/components/dedicated_index/description.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/advanced_section/components/dedicated_index/description.tsx index 25a8c0be24620..61ca2e8c5f695 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/advanced_section/components/dedicated_index/description.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/advanced_section/components/dedicated_index/description.tsx @@ -7,7 +7,7 @@ import React, { memo, FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiFormRow } from '@elastic/eui'; export const Description: FC = memo(({ children }) => { diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/advanced_section/components/mml_callout.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/advanced_section/components/mml_callout.tsx index f16b5a1cb30e0..75b28412250cd 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/advanced_section/components/mml_callout.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/advanced_section/components/mml_callout.tsx @@ -6,7 +6,7 @@ */ import React, { FC, useContext, useEffect, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCallOut, EuiText } from '@elastic/eui'; import { JobCreatorContext } from '../../../../job_creator_context'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/advanced_section/components/model_plot/description.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/advanced_section/components/model_plot/description.tsx index 527d6ffceb22b..680615b3a8bbd 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/advanced_section/components/model_plot/description.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/advanced_section/components/model_plot/description.tsx @@ -7,7 +7,7 @@ import React, { memo, FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiFormRow } from '@elastic/eui'; export const Description: FC = memo(({ children }) => { diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/groups/description.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/groups/description.tsx index 4b56e34bc7d95..83191156f2dd3 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/groups/description.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/groups/description.tsx @@ -7,7 +7,7 @@ import React, { memo, FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiFormRow } from '@elastic/eui'; import { Validation } from '../../../../../common/job_validator'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/job_description/description.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/job_description/description.tsx index f0f58e4216998..ed61cea4bd1c0 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/job_description/description.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/job_details_step/components/job_description/description.tsx @@ -7,7 +7,7 @@ import React, { memo, FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiFormRow } from '@elastic/eui'; export const Description: FC = memo(({ children }) => { diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/advanced_detector_modal/descriptions.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/advanced_detector_modal/descriptions.tsx index 2bbc922eb8062..9e198e9958c02 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/advanced_detector_modal/descriptions.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/advanced_detector_modal/descriptions.tsx @@ -7,7 +7,7 @@ import React, { memo, FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiFormRow } from '@elastic/eui'; export const AggDescription: FC = memo(({ children }) => { diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/advanced_detector_modal/modal_wrapper.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/advanced_detector_modal/modal_wrapper.tsx index aaed47cc7a02b..12344c651bd11 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/advanced_detector_modal/modal_wrapper.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/advanced_detector_modal/modal_wrapper.tsx @@ -6,7 +6,7 @@ */ import React, { FC } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiModal, diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/advanced_view/detector_list.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/advanced_view/detector_list.tsx index ba0c934f44753..637599f02b8f6 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/advanced_view/detector_list.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/advanced_view/detector_list.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment, FC, useContext, useEffect, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/advanced_view/metric_selector.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/advanced_view/metric_selector.tsx index 4bf3b382869d9..a781cefbb4cc8 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/advanced_view/metric_selector.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/advanced_view/metric_selector.tsx @@ -6,7 +6,7 @@ */ import React, { FC, Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFormRow, EuiFlexGroup, EuiFlexItem, EuiButton } from '@elastic/eui'; import { Aggregation, Field } from '../../../../../../../../../common/types/fields'; import { AdvancedDetectorModal, ModalPayload } from '../advanced_detector_modal'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/bucket_span/description.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/bucket_span/description.tsx index 90ccd9cfc2680..57b1d615fdef6 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/bucket_span/description.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/bucket_span/description.tsx @@ -7,7 +7,7 @@ import React, { memo, FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiFormRow } from '@elastic/eui'; import { Validation } from '../../../../../common/job_validator'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/bucket_span_estimator/bucket_span_estimator.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/bucket_span_estimator/bucket_span_estimator.tsx index 6ed8124c7b1ce..ef1c458f0e112 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/bucket_span_estimator/bucket_span_estimator.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/bucket_span_estimator/bucket_span_estimator.tsx @@ -6,7 +6,7 @@ */ import React, { FC, useState, useEffect, useContext } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton } from '@elastic/eui'; import { isAdvancedJobCreator } from '../../../../../common/job_creator'; import { JobCreatorContext } from '../../../job_creator_context'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_detector/categorization_detector.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_detector/categorization_detector.tsx index 28264b838de53..06e1f772bb17f 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_detector/categorization_detector.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_detector/categorization_detector.tsx @@ -6,7 +6,7 @@ */ import React, { FC, useContext, useEffect, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiSpacer, EuiTitle } from '@elastic/eui'; import { ML_JOB_AGGREGATION } from '../../../../../../../../../common/constants/aggregation_types'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_detector/detector_cards.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_detector/detector_cards.tsx index ebe66e0d502da..925ebaef692b4 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_detector/detector_cards.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_detector/detector_cards.tsx @@ -6,7 +6,7 @@ */ import React, { FC } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiFlexItem, EuiCard } from '@elastic/eui'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_field/description.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_field/description.tsx index 2a91f72909cdd..9fbcb386e37b1 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_field/description.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_field/description.tsx @@ -7,7 +7,7 @@ import React, { memo, FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiFormRow } from '@elastic/eui'; interface Props { diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_partition_field/categorization_per_partition.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_partition_field/categorization_per_partition.tsx index cdbb24b9215c7..082ace02b3a62 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_partition_field/categorization_per_partition.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_partition_field/categorization_per_partition.tsx @@ -7,7 +7,7 @@ import React, { FC, useContext, useEffect, useState } from 'react'; import { EuiFormRow } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { JobCreatorContext } from '../../../job_creator_context'; import { AdvancedJobCreator, diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_partition_field/categorization_per_partition_dropdown.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_partition_field/categorization_per_partition_dropdown.tsx index b404d8238fd5f..606ad8af09ba8 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_partition_field/categorization_per_partition_dropdown.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_partition_field/categorization_per_partition_dropdown.tsx @@ -7,7 +7,7 @@ import React, { Dispatch, SetStateAction, useContext, useEffect, useState, useMemo } from 'react'; import { EuiFormRow } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { JobCreatorContext } from '../../../job_creator_context'; import { CategorizationJobCreator } from '../../../../../common/job_creator'; import { newJobCapsService } from '../../../../../../../services/new_job_capabilities/new_job_capabilities_service'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_partition_field/categorization_per_partition_switch.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_partition_field/categorization_per_partition_switch.tsx index fdce5a66bde98..bd982085a8f28 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_partition_field/categorization_per_partition_switch.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_partition_field/categorization_per_partition_switch.tsx @@ -6,7 +6,7 @@ */ import React, { FC, useContext, useEffect, useCallback, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiSwitch } from '@elastic/eui'; import { JobCreatorContext } from '../../../job_creator_context'; import { AdvancedJobCreator, CategorizationJobCreator } from '../../../../../common/job_creator'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_partition_field/categorization_stop_on_warn_switch.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_partition_field/categorization_stop_on_warn_switch.tsx index 765d1216659eb..d35f8af6399bd 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_partition_field/categorization_stop_on_warn_switch.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_partition_field/categorization_stop_on_warn_switch.tsx @@ -6,7 +6,7 @@ */ import React, { FC, useCallback, useContext, useEffect, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiSwitch } from '@elastic/eui'; import { JobCreatorContext } from '../../../job_creator_context'; import { AdvancedJobCreator, CategorizationJobCreator } from '../../../../../common/job_creator'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_partition_field/description.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_partition_field/description.tsx index 1c21f4b6c09a9..892a05350a641 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_partition_field/description.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_partition_field/description.tsx @@ -7,7 +7,7 @@ import React, { memo, FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup } from '@elastic/eui'; interface Props { diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_view/category_stopped_partitions.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_view/category_stopped_partitions.tsx index 07cb480dbd670..b26667ad86b98 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_view/category_stopped_partitions.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_view/category_stopped_partitions.tsx @@ -7,7 +7,7 @@ import React, { FC, useContext, useEffect, useState, useMemo, useCallback } from 'react'; import { EuiBasicTable, EuiCallOut, EuiSpacer, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { from } from 'rxjs'; import { switchMap, takeWhile, tap } from 'rxjs/operators'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_view/examples_valid_callout.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_view/examples_valid_callout.tsx index c39eef174e3f3..4d22d8c4a5f50 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_view/examples_valid_callout.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_view/examples_valid_callout.tsx @@ -15,7 +15,7 @@ import { EuiListGroupItemProps, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { CategorizationAnalyzer, diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_view/invalid_ccs_version_valid_callout.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_view/invalid_ccs_version_valid_callout.tsx index 3bd41166b96b3..c95668b9f58e5 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_view/invalid_ccs_version_valid_callout.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_view/invalid_ccs_version_valid_callout.tsx @@ -8,7 +8,7 @@ import React, { FC } from 'react'; import { EuiCallOut } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const InvalidCssVersionCallout: FC = () => { return ( diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_view/top_categories.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_view/top_categories.tsx index 26ec8c9dc78bc..bd409f381d50a 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_view/top_categories.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/categorization_view/top_categories.tsx @@ -7,7 +7,7 @@ import React, { FC, useContext, useEffect, useState } from 'react'; import { EuiBasicTable, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { JobCreatorContext } from '../../../job_creator_context'; import { CategorizationJobCreator } from '../../../../../common/job_creator'; import { Results } from '../../../../../common/results_loader'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/influencers/description.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/influencers/description.tsx index 1d8debc898c75..bcbe3a5dd45ea 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/influencers/description.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/influencers/description.tsx @@ -7,7 +7,7 @@ import React, { memo, FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiFormRow } from '@elastic/eui'; export const Description: FC = memo(({ children }) => { diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/population_field/description.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/population_field/description.tsx index 6abbe77fc35aa..6401d549cd390 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/population_field/description.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/population_field/description.tsx @@ -7,7 +7,7 @@ import React, { memo, FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiFormRow } from '@elastic/eui'; export const Description: FC = memo(({ children }) => { diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/population_view/metric_selection_summary.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/population_view/metric_selection_summary.tsx index 4da7e3f5ff22a..8ff8a85759911 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/population_view/metric_selection_summary.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/population_view/metric_selection_summary.tsx @@ -7,7 +7,7 @@ import React, { Fragment, FC, useContext, useEffect, useState } from 'react'; import { EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { JobCreatorContext } from '../../../job_creator_context'; import { PopulationJobCreator } from '../../../../../common/job_creator'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/rare_detector/detector_cards.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/rare_detector/detector_cards.tsx index b78970eca59d1..9351d49942f80 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/rare_detector/detector_cards.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/rare_detector/detector_cards.tsx @@ -6,7 +6,7 @@ */ import React, { FC } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiFlexItem, EuiCard } from '@elastic/eui'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/rare_detector/rare_detector.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/rare_detector/rare_detector.tsx index a7e5b22d2eac0..0587d90026ae4 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/rare_detector/rare_detector.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/rare_detector/rare_detector.tsx @@ -6,7 +6,7 @@ */ import React, { FC, useContext, useEffect, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiSpacer, EuiTitle } from '@elastic/eui'; import { JobCreatorContext } from '../../../job_creator_context'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/rare_field/description.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/rare_field/description.tsx index 4c3b547d580d7..aa3eb17bef07e 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/rare_field/description.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/rare_field/description.tsx @@ -7,7 +7,7 @@ import React, { memo, FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiFormRow } from '@elastic/eui'; export const Description: FC = memo(({ children }) => { diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/single_metric_view/settings.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/single_metric_view/settings.tsx index e19cb987ff1ef..e058af6847763 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/single_metric_view/settings.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/single_metric_view/settings.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment, FC, useContext } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, EuiButtonEmpty } from '@elastic/eui'; import { useNavigateToPath } from '../../../../../../../contexts/kibana'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/sparse_data/description.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/sparse_data/description.tsx index 793d1bfa25a42..e6e6e1065c78e 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/sparse_data/description.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/sparse_data/description.tsx @@ -7,7 +7,7 @@ import React, { memo, FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiFormRow } from '@elastic/eui'; export const Description: FC = memo(({ children }) => { diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/split_cards/split_cards.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/split_cards/split_cards.tsx index 871718d03c92a..67b411ebc628e 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/split_cards/split_cards.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/split_cards/split_cards.tsx @@ -6,7 +6,7 @@ */ import React, { FC, memo, Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, EuiPanel, EuiHorizontalRule, EuiSpacer } from '@elastic/eui'; import { SplitField } from '../../../../../../../../../common/types/fields'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/split_field/description.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/split_field/description.tsx index 0d5cd8bda3d0d..157561d0b9fb9 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/split_field/description.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/split_field/description.tsx @@ -7,7 +7,7 @@ import React, { memo, FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiFormRow } from '@elastic/eui'; export const Description: FC = memo(({ children }) => { diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/summary_count_field/description.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/summary_count_field/description.tsx index a887bd7bfde92..a2b0da360dadd 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/summary_count_field/description.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/pick_fields_step/components/summary_count_field/description.tsx @@ -7,7 +7,7 @@ import React, { memo, FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiFormRow, EuiLink } from '@elastic/eui'; import { Validation } from '../../../../../common/job_validator'; import { useMlKibana } from '../../../../../../../contexts/kibana'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/summary_step/components/common.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/summary_step/components/common.tsx index 15708e75da2d3..cc184f576fefa 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/summary_step/components/common.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/summary_step/components/common.tsx @@ -7,7 +7,7 @@ import React, { FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiTitle } from '@elastic/eui'; export interface ListItems { diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/summary_step/components/job_details/job_details.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/summary_step/components/job_details/job_details.tsx index f6145ef812987..ec2357403a4f4 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/summary_step/components/job_details/job_details.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/summary_step/components/job_details/job_details.tsx @@ -8,7 +8,7 @@ import React, { FC, useContext } from 'react'; import { i18n } from '@kbn/i18n'; import moment from 'moment'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, EuiDescriptionList } from '@elastic/eui'; import { JobCreatorContext } from '../../../job_creator_context'; import { diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/summary_step/components/post_save_options/post_save_options.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/summary_step/components/post_save_options/post_save_options.tsx index 472654c4b3c85..7fb483b54cf5d 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/summary_step/components/post_save_options/post_save_options.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/summary_step/components/post_save_options/post_save_options.tsx @@ -8,7 +8,7 @@ import React, { FC, Fragment, useContext, useState } from 'react'; import { EuiButton, EuiFlexItem } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { JobRunner } from '../../../../../common/job_runner'; import { useMlKibana } from '../../../../../../../contexts/kibana'; import { extractErrorMessage } from '../../../../../../../../../common/util/errors'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/summary_step/summary.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/summary_step/summary.tsx index b6658fd95e573..eca7f03a29ee8 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/summary_step/summary.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/summary_step/summary.tsx @@ -16,7 +16,7 @@ import { EuiFlexItem, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useMlKibana, useNavigateToPath } from '../../../../../contexts/kibana'; import { PreviousButton } from '../wizard_nav'; import { WIZARD_STEPS, StepProps } from '../step_types'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/wizard_nav/wizard_nav.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/wizard_nav/wizard_nav.tsx index 5d8fa1e11d376..d60389fc283b9 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/wizard_nav/wizard_nav.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/components/wizard_nav/wizard_nav.tsx @@ -7,7 +7,7 @@ import React, { FC, Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/page.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/page.tsx index b2611cf1095ac..50e48e2aea5e7 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/page.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/index_or_search/page.tsx @@ -15,7 +15,7 @@ import { EuiPageContent, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { SavedObjectFinderUi } from '../../../../../../../../../src/plugins/saved_objects/public'; import { useMlKibana, useNavigateToPath } from '../../../../contexts/kibana'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx index 5e62158977280..a60b532a3435d 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/job_type/page.tsx @@ -18,7 +18,7 @@ import { EuiFlexItem, EuiLink, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useMlKibana, useNavigateToPath } from '../../../../contexts/kibana'; import { useMlContext } from '../../../../contexts/ml'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/new_job/page.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/new_job/page.tsx index 52e3c55afc15a..67c4e0d19a590 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/new_job/page.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/new_job/page.tsx @@ -16,7 +16,7 @@ import { EuiPageContentBody, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Wizard } from './wizard'; import { WIZARD_STEPS } from '../components/step_types'; import { getJobCreatorTitle } from '../../common/job_creator/util/general'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/pages/new_job/wizard_steps.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/pages/new_job/wizard_steps.tsx index b2e5a4ee1c22f..5b3d920525ee0 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/pages/new_job/wizard_steps.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/pages/new_job/wizard_steps.tsx @@ -8,7 +8,7 @@ import React, { Fragment, FC, useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiSpacer, EuiTitle } from '@elastic/eui'; import { WIZARD_STEPS } from '../components/step_types'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/recognize/components/create_result_callout.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/recognize/components/create_result_callout.tsx index 78620c836cc38..e77acf60ea1fd 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/recognize/components/create_result_callout.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/recognize/components/create_result_callout.tsx @@ -8,7 +8,7 @@ import React, { FC, memo } from 'react'; import { EuiCallOut, EuiButton, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { SAVE_STATE } from '../page'; interface CreateResultCalloutProps { diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/recognize/components/edit_job.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/recognize/components/edit_job.tsx index 408e86512ed6d..8d5e7be5019b9 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/recognize/components/edit_job.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/recognize/components/edit_job.tsx @@ -20,7 +20,7 @@ import { EuiSpacer, EuiTitle, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ModuleJobUI } from '../page'; import { usePartialState } from '../../../../components/custom_hooks'; import { composeValidators, maxLengthValidator } from '../../../../../../common/util/validators'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/recognize/components/job_item.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/recognize/components/job_item.tsx index 53ffa593830e0..fe8cff1b0ed62 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/recognize/components/job_item.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/recognize/components/job_item.tsx @@ -17,7 +17,7 @@ import { EuiToolTip, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ModuleJobUI } from '../page'; import { SETUP_RESULTS_WIDTH } from './module_jobs'; import { tabColor } from '../../../../../../common/util/group_color_utils'; diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/recognize/components/job_settings_form.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/recognize/components/job_settings_form.tsx index c996f50ea5018..3d7f56a710664 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/recognize/components/job_settings_form.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/recognize/components/job_settings_form.tsx @@ -7,7 +7,7 @@ import React, { FC, useEffect, useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiAccordion, EuiButton, diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/recognize/components/kibana_objects.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/recognize/components/kibana_objects.tsx index 610151632c6e5..079e698c3a5c0 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/recognize/components/kibana_objects.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/recognize/components/kibana_objects.tsx @@ -6,7 +6,7 @@ */ import React, { FC, memo } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/recognize/components/module_jobs.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/recognize/components/module_jobs.tsx index c22ea789fe3ca..59565af29e14c 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/recognize/components/module_jobs.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/recognize/components/module_jobs.tsx @@ -6,7 +6,7 @@ */ import React, { FC, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, diff --git a/x-pack/plugins/ml/public/application/jobs/new_job/recognize/page.tsx b/x-pack/plugins/ml/public/application/jobs/new_job/recognize/page.tsx index 7603855d47e5c..3f180e4559e3f 100644 --- a/x-pack/plugins/ml/public/application/jobs/new_job/recognize/page.tsx +++ b/x-pack/plugins/ml/public/application/jobs/new_job/recognize/page.tsx @@ -6,7 +6,7 @@ */ import React, { FC, useState, Fragment, useEffect } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiPage, diff --git a/x-pack/plugins/ml/public/application/management/jobs_list/components/access_denied_page.tsx b/x-pack/plugins/ml/public/application/management/jobs_list/components/access_denied_page.tsx index 4858db1ee55bc..869d5d5b3a0e6 100644 --- a/x-pack/plugins/ml/public/application/management/jobs_list/components/access_denied_page.tsx +++ b/x-pack/plugins/ml/public/application/management/jobs_list/components/access_denied_page.tsx @@ -7,7 +7,7 @@ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiEmptyPrompt, EuiPageContent } from '@elastic/eui'; diff --git a/x-pack/plugins/ml/public/application/management/jobs_list/components/insufficient_license_page.tsx b/x-pack/plugins/ml/public/application/management/jobs_list/components/insufficient_license_page.tsx index 7fcac0ad6992a..fb12ca42a1ec7 100644 --- a/x-pack/plugins/ml/public/application/management/jobs_list/components/insufficient_license_page.tsx +++ b/x-pack/plugins/ml/public/application/management/jobs_list/components/insufficient_license_page.tsx @@ -7,7 +7,7 @@ import React, { FC } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { CoreStart } from 'kibana/public'; import { EuiEmptyPrompt, EuiLink, EuiPageContent } from '@elastic/eui'; diff --git a/x-pack/plugins/ml/public/application/management/jobs_list/components/jobs_list_page/jobs_list_page.tsx b/x-pack/plugins/ml/public/application/management/jobs_list/components/jobs_list_page/jobs_list_page.tsx index 8dccbe973318b..3a969823088f1 100644 --- a/x-pack/plugins/ml/public/application/management/jobs_list/components/jobs_list_page/jobs_list_page.tsx +++ b/x-pack/plugins/ml/public/application/management/jobs_list/components/jobs_list_page/jobs_list_page.tsx @@ -8,7 +8,7 @@ import React, { useEffect, useState, Fragment, FC, useMemo, useCallback } from 'react'; import { Router } from 'react-router-dom'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { CoreStart } from 'kibana/public'; import { diff --git a/x-pack/plugins/ml/public/application/overview/components/sidebar.tsx b/x-pack/plugins/ml/public/application/overview/components/sidebar.tsx index ce262cfa16993..80cda73ccea16 100644 --- a/x-pack/plugins/ml/public/application/overview/components/sidebar.tsx +++ b/x-pack/plugins/ml/public/application/overview/components/sidebar.tsx @@ -7,7 +7,7 @@ import React, { FC } from 'react'; import { EuiFlexItem, EuiLink, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useMlKibana } from '../../contexts/kibana'; const feedbackLink = 'https://www.elastic.co/community/'; diff --git a/x-pack/plugins/ml/public/application/routing/routes/timeseriesexplorer.test.tsx b/x-pack/plugins/ml/public/application/routing/routes/timeseriesexplorer.test.tsx index ba72540db52ea..257cdb17707e4 100644 --- a/x-pack/plugins/ml/public/application/routing/routes/timeseriesexplorer.test.tsx +++ b/x-pack/plugins/ml/public/application/routing/routes/timeseriesexplorer.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { render } from '@testing-library/react'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { TimeSeriesExplorerUrlStateManager } from './timeseriesexplorer'; import { TimeSeriesExplorer } from '../../timeseriesexplorer'; import { TimeSeriesExplorerPage } from '../../timeseriesexplorer/timeseriesexplorer_page'; diff --git a/x-pack/plugins/ml/public/application/services/ml_api_service/trained_models.ts b/x-pack/plugins/ml/public/application/services/ml_api_service/trained_models.ts index 822c5059982e7..381528e1055d6 100644 --- a/x-pack/plugins/ml/public/application/services/ml_api_service/trained_models.ts +++ b/x-pack/plugins/ml/public/application/services/ml_api_service/trained_models.ts @@ -135,10 +135,13 @@ export function trainedModelsApiProvider(httpService: HttpService) { }); }, - stopModelAllocation(modelId: string) { + stopModelAllocation(modelId: string, options: { force: boolean } = { force: false }) { + const force = options?.force; + return httpService.http<{ acknowledge: boolean }>({ path: `${apiBasePath}/trained_models/${modelId}/deployment/_stop`, method: 'POST', + query: { force }, }); }, }; diff --git a/x-pack/plugins/ml/public/application/settings/anomaly_detection_settings.tsx b/x-pack/plugins/ml/public/application/settings/anomaly_detection_settings.tsx index e53d6245df26d..710d1ce3200a0 100644 --- a/x-pack/plugins/ml/public/application/settings/anomaly_detection_settings.tsx +++ b/x-pack/plugins/ml/public/application/settings/anomaly_detection_settings.tsx @@ -21,7 +21,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { AnomalyDetectionSettingsContext } from './anomaly_detection_settings_context'; import { useNotifications } from '../contexts/kibana'; diff --git a/x-pack/plugins/ml/public/application/settings/calendars/edit/calendar_form/calendar_form.js b/x-pack/plugins/ml/public/application/settings/calendars/edit/calendar_form/calendar_form.js index 9687630bba9a2..6077e2047e64c 100644 --- a/x-pack/plugins/ml/public/application/settings/calendars/edit/calendar_form/calendar_form.js +++ b/x-pack/plugins/ml/public/application/settings/calendars/edit/calendar_form/calendar_form.js @@ -25,7 +25,7 @@ import { import { EventsTable } from '../events_table'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ML_PAGES } from '../../../../../../common/constants/locator'; import { useCreateAndNavigateToMlLink } from '../../../../contexts/kibana/use_create_url'; diff --git a/x-pack/plugins/ml/public/application/settings/calendars/edit/events_table/events_table.js b/x-pack/plugins/ml/public/application/settings/calendars/edit/events_table/events_table.js index ad5de1f92dae5..17a1fc0e0193e 100644 --- a/x-pack/plugins/ml/public/application/settings/calendars/edit/events_table/events_table.js +++ b/x-pack/plugins/ml/public/application/settings/calendars/edit/events_table/events_table.js @@ -12,7 +12,7 @@ import moment from 'moment'; import { EuiButton, EuiButtonEmpty, EuiInMemoryTable, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { TIME_FORMAT } from '../../../../../../common/constants/time_format'; function DeleteButton({ onClick, testSubj, disabled }) { diff --git a/x-pack/plugins/ml/public/application/settings/calendars/edit/import_modal/import_modal.js b/x-pack/plugins/ml/public/application/settings/calendars/edit/import_modal/import_modal.js index 5e3497bc753cc..2abec566b43d1 100644 --- a/x-pack/plugins/ml/public/application/settings/calendars/edit/import_modal/import_modal.js +++ b/x-pack/plugins/ml/public/application/settings/calendars/edit/import_modal/import_modal.js @@ -25,7 +25,7 @@ import { ImportedEvents } from '../imported_events'; import { readFile, parseICSFile, filterEvents } from './utils'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; const MAX_FILE_SIZE_MB = 100; diff --git a/x-pack/plugins/ml/public/application/settings/calendars/edit/imported_events/imported_events.js b/x-pack/plugins/ml/public/application/settings/calendars/edit/imported_events/imported_events.js index 804e1d1bba902..f202c316208ec 100644 --- a/x-pack/plugins/ml/public/application/settings/calendars/edit/imported_events/imported_events.js +++ b/x-pack/plugins/ml/public/application/settings/calendars/edit/imported_events/imported_events.js @@ -9,7 +9,7 @@ import React, { Fragment } from 'react'; import { PropTypes } from 'prop-types'; import { EuiCheckbox, EuiFlexItem, EuiText, EuiSpacer } from '@elastic/eui'; import { EventsTable } from '../events_table'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function ImportedEvents({ events, diff --git a/x-pack/plugins/ml/public/application/settings/calendars/edit/new_event_modal/new_event_modal.js b/x-pack/plugins/ml/public/application/settings/calendars/edit/new_event_modal/new_event_modal.js index fa573dcbc5971..ae2815ebb5cd6 100644 --- a/x-pack/plugins/ml/public/application/settings/calendars/edit/new_event_modal/new_event_modal.js +++ b/x-pack/plugins/ml/public/application/settings/calendars/edit/new_event_modal/new_event_modal.js @@ -29,7 +29,7 @@ import { TIME_FORMAT } from '../../../../../../common/constants/time_format'; import { generateTempId } from '../utils'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; const VALID_DATE_STRING_LENGTH = 19; diff --git a/x-pack/plugins/ml/public/application/settings/calendars/list/calendars_list.js b/x-pack/plugins/ml/public/application/settings/calendars/list/calendars_list.js index bba28ab481ea1..36706c9daeee9 100644 --- a/x-pack/plugins/ml/public/application/settings/calendars/list/calendars_list.js +++ b/x-pack/plugins/ml/public/application/settings/calendars/list/calendars_list.js @@ -23,7 +23,7 @@ import { ml } from '../../../services/ml_api_service'; import { mlNodesAvailable } from '../../../ml_nodes_check/check_ml_nodes'; import { deleteCalendars } from './delete_calendars'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { withKibana } from '../../../../../../../../src/plugins/kibana_react/public'; import { getDocLinks } from '../../../util/dependency_cache'; import { HelpMenu } from '../../../components/help_menu'; diff --git a/x-pack/plugins/ml/public/application/settings/calendars/list/header.js b/x-pack/plugins/ml/public/application/settings/calendars/list/header.js index 4fd5a9f0b71d9..e1ed1dfe392e3 100644 --- a/x-pack/plugins/ml/public/application/settings/calendars/list/header.js +++ b/x-pack/plugins/ml/public/application/settings/calendars/list/header.js @@ -11,7 +11,7 @@ import PropTypes from 'prop-types'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiSpacer, diff --git a/x-pack/plugins/ml/public/application/settings/calendars/list/table/table.js b/x-pack/plugins/ml/public/application/settings/calendars/list/table/table.js index 58efe99b24027..374ab80da118f 100644 --- a/x-pack/plugins/ml/public/application/settings/calendars/list/table/table.js +++ b/x-pack/plugins/ml/public/application/settings/calendars/list/table/table.js @@ -11,7 +11,7 @@ import React from 'react'; import { EuiButton, EuiInMemoryTable } from '@elastic/eui'; import { Link } from 'react-router-dom'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { GLOBAL_CALENDAR } from '../../../../../../common/constants/calendars'; import { useCreateAndNavigateToMlLink } from '../../../../contexts/kibana/use_create_url'; diff --git a/x-pack/plugins/ml/public/application/settings/filter_lists/components/add_item_popover/add_item_popover.js b/x-pack/plugins/ml/public/application/settings/filter_lists/components/add_item_popover/add_item_popover.js index d154ae253009c..a50e07b6adbe1 100644 --- a/x-pack/plugins/ml/public/application/settings/filter_lists/components/add_item_popover/add_item_popover.js +++ b/x-pack/plugins/ml/public/application/settings/filter_lists/components/add_item_popover/add_item_popover.js @@ -11,7 +11,7 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, diff --git a/x-pack/plugins/ml/public/application/settings/filter_lists/components/delete_filter_list_modal/delete_filter_list_modal.js b/x-pack/plugins/ml/public/application/settings/filter_lists/components/delete_filter_list_modal/delete_filter_list_modal.js index 20b716586b97d..8f7fc02ffdb24 100644 --- a/x-pack/plugins/ml/public/application/settings/filter_lists/components/delete_filter_list_modal/delete_filter_list_modal.js +++ b/x-pack/plugins/ml/public/application/settings/filter_lists/components/delete_filter_list_modal/delete_filter_list_modal.js @@ -7,7 +7,7 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiConfirmModal, EUI_MODAL_CONFIRM_BUTTON } from '@elastic/eui'; diff --git a/x-pack/plugins/ml/public/application/settings/filter_lists/components/edit_description_popover/edit_description_popover.js b/x-pack/plugins/ml/public/application/settings/filter_lists/components/edit_description_popover/edit_description_popover.js index cf51ecff16ba9..1f8a1892ffa81 100644 --- a/x-pack/plugins/ml/public/application/settings/filter_lists/components/edit_description_popover/edit_description_popover.js +++ b/x-pack/plugins/ml/public/application/settings/filter_lists/components/edit_description_popover/edit_description_popover.js @@ -15,7 +15,7 @@ import React, { Component } from 'react'; import { EuiButtonIcon, EuiPopover, EuiForm, EuiFormRow, EuiFieldText } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export class EditDescriptionPopover extends Component { static displayName = 'EditDescriptionPopover'; diff --git a/x-pack/plugins/ml/public/application/settings/filter_lists/edit/edit_filter_list.js b/x-pack/plugins/ml/public/application/settings/filter_lists/edit/edit_filter_list.js index 00058517fccdc..5ed1251aba11b 100644 --- a/x-pack/plugins/ml/public/application/settings/filter_lists/edit/edit_filter_list.js +++ b/x-pack/plugins/ml/public/application/settings/filter_lists/edit/edit_filter_list.js @@ -26,7 +26,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { withKibana } from '../../../../../../../../src/plugins/kibana_react/public'; import { EditFilterListHeader } from './header'; diff --git a/x-pack/plugins/ml/public/application/settings/filter_lists/edit/header.js b/x-pack/plugins/ml/public/application/settings/filter_lists/edit/header.js index 184f65c1fb287..129b4554190c4 100644 --- a/x-pack/plugins/ml/public/application/settings/filter_lists/edit/header.js +++ b/x-pack/plugins/ml/public/application/settings/filter_lists/edit/header.js @@ -25,7 +25,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EditDescriptionPopover } from '../components/edit_description_popover'; import { FilterListUsagePopover } from '../components/filter_list_usage_popover'; diff --git a/x-pack/plugins/ml/public/application/settings/filter_lists/edit/toolbar.js b/x-pack/plugins/ml/public/application/settings/filter_lists/edit/toolbar.js index aac93a4db68d2..29e89828fd0a6 100644 --- a/x-pack/plugins/ml/public/application/settings/filter_lists/edit/toolbar.js +++ b/x-pack/plugins/ml/public/application/settings/filter_lists/edit/toolbar.js @@ -13,7 +13,7 @@ import PropTypes from 'prop-types'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiSearchBar } from '@elastic/eui'; diff --git a/x-pack/plugins/ml/public/application/settings/filter_lists/list/header.js b/x-pack/plugins/ml/public/application/settings/filter_lists/list/header.js index 6e72814dffe65..f5f387820f29c 100644 --- a/x-pack/plugins/ml/public/application/settings/filter_lists/list/header.js +++ b/x-pack/plugins/ml/public/application/settings/filter_lists/list/header.js @@ -11,7 +11,7 @@ import PropTypes from 'prop-types'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiSpacer, diff --git a/x-pack/plugins/ml/public/application/settings/filter_lists/list/table.js b/x-pack/plugins/ml/public/application/settings/filter_lists/list/table.js index 61af4cc141426..598933757deab 100644 --- a/x-pack/plugins/ml/public/application/settings/filter_lists/list/table.js +++ b/x-pack/plugins/ml/public/application/settings/filter_lists/list/table.js @@ -24,7 +24,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { DeleteFilterListModal } from '../components/delete_filter_list_modal'; import { useCreateAndNavigateToMlLink } from '../../../contexts/kibana/use_create_url'; diff --git a/x-pack/plugins/ml/public/application/settings/settings.tsx b/x-pack/plugins/ml/public/application/settings/settings.tsx index c4f87430ae697..88da3cf899799 100644 --- a/x-pack/plugins/ml/public/application/settings/settings.tsx +++ b/x-pack/plugins/ml/public/application/settings/settings.tsx @@ -9,7 +9,7 @@ import React, { FC, Fragment } from 'react'; import { EuiPage, EuiPageBody, EuiPageHeader, EuiPageHeaderSection, EuiTitle } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { AnomalyDetectionSettings } from './anomaly_detection_settings'; diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/entity_control/entity_config.tsx b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/entity_control/entity_config.tsx index 09ebbfd8615bf..e0df0bac214e3 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/entity_control/entity_config.tsx +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/entity_control/entity_config.tsx @@ -20,7 +20,7 @@ import { EuiToolTip, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Entity } from './entity_control'; import { UiPartitionFieldConfig } from '../series_controls/series_controls'; import { EntityFieldType } from '../../../../../common/types/anomalies'; diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/entity_control/entity_control.tsx b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/entity_control/entity_control.tsx index 9798f48447d97..e688a8a27de66 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/entity_control/entity_control.tsx +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/entity_control/entity_control.tsx @@ -7,7 +7,7 @@ import { isEqual } from 'lodash'; import React, { Component } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/forecasting_modal/forecast_progress.js b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/forecasting_modal/forecast_progress.js index 22a0b65d7b0cc..c44775fdbcf67 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/forecasting_modal/forecast_progress.js +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/forecasting_modal/forecast_progress.js @@ -23,7 +23,7 @@ import { import { ProgressIcon } from './progress_icon'; import { PROGRESS_STATES } from './progress_states'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function ForecastProgress({ forecastProgress, jobOpeningState, jobClosingState }) { return ( diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/forecasting_modal/forecasting_modal.js b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/forecasting_modal/forecasting_modal.js index 8c76133cb8663..f5d39bea56e72 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/forecasting_modal/forecasting_modal.js +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/forecasting_modal/forecasting_modal.js @@ -26,7 +26,7 @@ import { ml } from '../../../services/ml_api_service'; import { mlJobService } from '../../../services/job_service'; import { mlForecastService } from '../../../services/forecast_service'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { withKibana } from '../../../../../../../../src/plugins/kibana_react/public'; export const FORECAST_DURATION_MAX_DAYS = 3650; // Max forecast duration allowed by analytics. diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/forecasting_modal/forecasts_list.js b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/forecasting_modal/forecasts_list.js index 7f9fcc7bc5517..e280640ec2d9f 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/forecasting_modal/forecasts_list.js +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/forecasting_modal/forecasts_list.js @@ -16,7 +16,7 @@ import { EuiButtonIcon, EuiIcon, EuiInMemoryTable, EuiText, EuiToolTip } from '@ import { formatHumanReadableDateTimeSeconds } from '../../../../../common/util/date_utils'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; function getColumns(viewForecast) { return [ diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/forecasting_modal/modal.js b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/forecasting_modal/modal.js index 3261846a5fdd5..9b7adcf2bce32 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/forecasting_modal/modal.js +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/forecasting_modal/modal.js @@ -26,7 +26,7 @@ import { MessageCallOut } from '../../../components/message_call_out'; import { ForecastsList } from './forecasts_list'; import { RunControls } from './run_controls'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function Modal(props) { return ( diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/forecasting_modal/run_controls.js b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/forecasting_modal/run_controls.js index b36acba8b4ba4..2e86b21b41fd2 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/forecasting_modal/run_controls.js +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/forecasting_modal/run_controls.js @@ -33,7 +33,7 @@ import { createPermissionFailureMessage, } from '../../../capabilities/check_capabilities'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; function getRunInputDisabledState(job, isForecastRequested) { // Disable the 'run forecast' text field and button if any of the conditions are met: diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/series_controls/series_controls.tsx b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/series_controls/series_controls.tsx index af657d5653fff..6713a35269cbd 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/series_controls/series_controls.tsx +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/series_controls/series_controls.tsx @@ -6,7 +6,7 @@ */ import React, { FC, useCallback, useEffect, useMemo, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, EuiFormRow, EuiSelect, EuiSelectProps } from '@elastic/eui'; import { debounce } from 'lodash'; import { EntityControl } from '../entity_control'; diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseriesexplorer_no_jobs_found/timeseriesexplorer_no_jobs_found.tsx b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseriesexplorer_no_jobs_found/timeseriesexplorer_no_jobs_found.tsx index df98d3dea2124..594326714fee4 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseriesexplorer_no_jobs_found/timeseriesexplorer_no_jobs_found.tsx +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/timeseriesexplorer_no_jobs_found/timeseriesexplorer_no_jobs_found.tsx @@ -10,7 +10,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiEmptyPrompt, EuiButton } from '@elastic/eui'; import { useMlLocator, useNavigateToPath } from '../../../contexts/kibana'; diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer.js b/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer.js index 7d90d748218e9..d1897a28a6ecf 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer.js +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer.js @@ -18,7 +18,7 @@ import PropTypes from 'prop-types'; import React, { createRef, Fragment } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCallOut, diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer_help_popover.tsx b/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer_help_popover.tsx index 59249791f0078..778c7cc5d58a3 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer_help_popover.tsx +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer_help_popover.tsx @@ -7,7 +7,7 @@ import React, { useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { HelpPopover, HelpPopoverButton } from '../components/help_popover/help_popover'; export const TimeSeriesExplorerHelpPopover = () => { diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer_page.tsx b/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer_page.tsx index 2190eb177c2ab..51b3e989e04d4 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer_page.tsx +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer_page.tsx @@ -7,7 +7,7 @@ import React, { FC } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, diff --git a/x-pack/plugins/ml/public/application/trained_models/models_management/delete_models_modal.tsx b/x-pack/plugins/ml/public/application/trained_models/models_management/delete_models_modal.tsx index 09daafb885720..43c815094b03d 100644 --- a/x-pack/plugins/ml/public/application/trained_models/models_management/delete_models_modal.tsx +++ b/x-pack/plugins/ml/public/application/trained_models/models_management/delete_models_modal.tsx @@ -16,7 +16,7 @@ import { EuiButton, EuiCallOut, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ModelItemFull } from './models_list'; interface DeleteModelsModalProps { diff --git a/x-pack/plugins/ml/public/application/trained_models/models_management/expanded_row.tsx b/x-pack/plugins/ml/public/application/trained_models/models_management/expanded_row.tsx index 469973a378c83..7504bdeaaf28d 100644 --- a/x-pack/plugins/ml/public/application/trained_models/models_management/expanded_row.tsx +++ b/x-pack/plugins/ml/public/application/trained_models/models_management/expanded_row.tsx @@ -20,7 +20,7 @@ import { EuiTitle, } from '@elastic/eui'; import type { EuiDescriptionListProps } from '@elastic/eui/src/components/description_list/description_list'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { ModelItemFull } from './models_list'; import { timeFormatter } from '../../../../common/util/date_utils'; import { isDefined } from '../../../../common/types/guards'; diff --git a/x-pack/plugins/ml/public/application/trained_models/models_management/force_stop_dialog.tsx b/x-pack/plugins/ml/public/application/trained_models/models_management/force_stop_dialog.tsx new file mode 100644 index 0000000000000..86120a4003e23 --- /dev/null +++ b/x-pack/plugins/ml/public/application/trained_models/models_management/force_stop_dialog.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { FC } from 'react'; +import { EuiConfirmModal } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n-react'; +import type { OverlayStart } from 'kibana/public'; +import type { ModelItem } from './models_list'; +import { toMountPoint } from '../../../../../../../src/plugins/kibana_react/public'; + +interface ForceStopModelConfirmDialogProps { + model: ModelItem; + onCancel: () => void; + onConfirm: () => void; +} + +export const ForceStopModelConfirmDialog: FC = ({ + model, + onConfirm, + onCancel, +}) => { + return ( + + } + onCancel={onCancel} + onConfirm={onConfirm} + cancelButtonText={ + + } + confirmButtonText={ + + } + buttonColor="danger" + > + +

    + {Object.keys(model.pipelines!) + .sort() + .map((pipelineName) => { + return
  • {pipelineName}
  • ; + })} +
+ + ); +}; + +export const getUserConfirmationProvider = + (overlays: OverlayStart) => async (forceStopModel: ModelItem) => { + return new Promise(async (resolve, reject) => { + try { + const modalSession = overlays.openModal( + toMountPoint( + { + modalSession.close(); + resolve(false); + }} + onConfirm={() => { + modalSession.close(); + resolve(true); + }} + /> + ) + ); + } catch (e) { + resolve(false); + } + }); + }; diff --git a/x-pack/plugins/ml/public/application/trained_models/models_management/models_list.tsx b/x-pack/plugins/ml/public/application/trained_models/models_management/models_list.tsx index ce0e47df292de..c80ff808aa539 100644 --- a/x-pack/plugins/ml/public/application/trained_models/models_management/models_list.tsx +++ b/x-pack/plugins/ml/public/application/trained_models/models_management/models_list.tsx @@ -20,7 +20,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiBasicTableColumn } from '@elastic/eui/src/components/basic_table/basic_table'; import { EuiTableSelectionType } from '@elastic/eui/src/components/basic_table/table_types'; import { Action } from '@elastic/eui/src/components/basic_table/action_types'; @@ -53,6 +53,7 @@ import { useFieldFormatter } from '../../contexts/kibana/use_field_formatter'; import { FIELD_FORMAT_IDS } from '../../../../../../../src/plugins/field_formats/common'; import { useRefresh } from '../../routing/use_refresh'; import { DEPLOYMENT_STATE } from '../../../../common/constants/trained_models'; +import { getUserConfirmationProvider } from './force_stop_dialog'; type Stats = Omit; @@ -80,6 +81,7 @@ export const ModelsList: FC = () => { const { services: { application: { navigateToUrl, capabilities }, + overlays, }, } = useMlKibana(); const urlLocator = useMlLocator()!; @@ -110,6 +112,8 @@ export const ModelsList: FC = () => { {} ); + const getUserConfirmation = useMemo(() => getUserConfirmationProvider(overlays), []); + const navigateToPath = useNavigateToPath(); const isBuiltInModel = useCallback( @@ -418,13 +422,21 @@ export const ModelsList: FC = () => { available: (item) => item.model_type === 'pytorch', enabled: (item) => !isLoading && - !isPopulatedObject(item.pipelines) && isPopulatedObject(item.stats?.deployment_stats) && item.stats?.deployment_stats?.state !== DEPLOYMENT_STATE.STOPPING, onClick: async (item) => { + const requireForceStop = isPopulatedObject(item.pipelines); + + if (requireForceStop) { + const hasUserApproved = await getUserConfirmation(item); + if (!hasUserApproved) return; + } + try { setIsLoading(true); - await trainedModelsApiService.stopModelAllocation(item.model_id); + await trainedModelsApiService.stopModelAllocation(item.model_id, { + force: requireForceStop, + }); displaySuccessToast( i18n.translate('xpack.ml.trainedModels.modelsList.stopSuccess', { defaultMessage: 'Deployment for "{modelId}" has been stopped successfully.', diff --git a/x-pack/plugins/ml/public/application/trained_models/models_management/pipelines/expanded_row.tsx b/x-pack/plugins/ml/public/application/trained_models/models_management/pipelines/expanded_row.tsx index 7430d50219d3e..272f3e4346a5b 100644 --- a/x-pack/plugins/ml/public/application/trained_models/models_management/pipelines/expanded_row.tsx +++ b/x-pack/plugins/ml/public/application/trained_models/models_management/pipelines/expanded_row.tsx @@ -7,7 +7,7 @@ import React, { FC } from 'react'; import { EuiBadge, EuiInMemoryTable, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiBasicTableColumn } from '@elastic/eui/src/components/basic_table/basic_table'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/ml/public/application/trained_models/models_management/pipelines/pipelines.tsx b/x-pack/plugins/ml/public/application/trained_models/models_management/pipelines/pipelines.tsx index 9b2af52eb03c8..54c9c6b612d64 100644 --- a/x-pack/plugins/ml/public/application/trained_models/models_management/pipelines/pipelines.tsx +++ b/x-pack/plugins/ml/public/application/trained_models/models_management/pipelines/pipelines.tsx @@ -15,7 +15,7 @@ import { EuiPanel, EuiAccordion, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useMlKibana } from '../../../contexts/kibana'; import { ModelItem } from '../models_list'; import { ProcessorsStats } from './expanded_row'; diff --git a/x-pack/plugins/ml/public/application/trained_models/nodes_overview/expanded_row.tsx b/x-pack/plugins/ml/public/application/trained_models/nodes_overview/expanded_row.tsx index ba5cdd9093210..474c241129a8e 100644 --- a/x-pack/plugins/ml/public/application/trained_models/nodes_overview/expanded_row.tsx +++ b/x-pack/plugins/ml/public/application/trained_models/nodes_overview/expanded_row.tsx @@ -14,7 +14,7 @@ import { EuiSpacer, EuiTitle, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { NodeItem } from './nodes_list'; import { formatToListItems } from '../models_management/expanded_row'; import { AllocatedModels } from './allocated_models'; diff --git a/x-pack/plugins/ml/public/application/trained_models/page.tsx b/x-pack/plugins/ml/public/application/trained_models/page.tsx index afbebf58937b3..b25989ef8df58 100644 --- a/x-pack/plugins/ml/public/application/trained_models/page.tsx +++ b/x-pack/plugins/ml/public/application/trained_models/page.tsx @@ -7,7 +7,7 @@ import React, { FC, Fragment, useMemo } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiBetaBadge, diff --git a/x-pack/plugins/ml/public/embeddables/anomaly_charts/anomaly_charts_initializer.test.tsx b/x-pack/plugins/ml/public/embeddables/anomaly_charts/anomaly_charts_initializer.test.tsx index 1473a599c2c4b..9bfce47aa9dc1 100644 --- a/x-pack/plugins/ml/public/embeddables/anomaly_charts/anomaly_charts_initializer.test.tsx +++ b/x-pack/plugins/ml/public/embeddables/anomaly_charts/anomaly_charts_initializer.test.tsx @@ -9,7 +9,7 @@ import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { AnomalyChartsInitializer } from './anomaly_charts_initializer'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import React from 'react'; import { getDefaultExplorerChartsPanelTitle } from './anomaly_charts_embeddable'; const defaultOptions = { wrapper: I18nProvider }; diff --git a/x-pack/plugins/ml/public/embeddables/anomaly_charts/anomaly_charts_initializer.tsx b/x-pack/plugins/ml/public/embeddables/anomaly_charts/anomaly_charts_initializer.tsx index a36d063737704..6e724cf672bb0 100644 --- a/x-pack/plugins/ml/public/embeddables/anomaly_charts/anomaly_charts_initializer.tsx +++ b/x-pack/plugins/ml/public/embeddables/anomaly_charts/anomaly_charts_initializer.tsx @@ -19,7 +19,7 @@ import { EuiFieldText, EuiModal, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { AnomalyChartsEmbeddableInput } from '..'; import { DEFAULT_MAX_SERIES_TO_PLOT } from '../../application/services/anomaly_explorer_charts_service'; diff --git a/x-pack/plugins/ml/public/embeddables/anomaly_charts/embeddable_anomaly_charts_container.test.tsx b/x-pack/plugins/ml/public/embeddables/anomaly_charts/embeddable_anomaly_charts_container.test.tsx index 55e07da9011fb..efa89dd7e7608 100644 --- a/x-pack/plugins/ml/public/embeddables/anomaly_charts/embeddable_anomaly_charts_container.test.tsx +++ b/x-pack/plugins/ml/public/embeddables/anomaly_charts/embeddable_anomaly_charts_container.test.tsx @@ -12,7 +12,7 @@ import { EmbeddableAnomalyChartsContainerProps, } from './embeddable_anomaly_charts_container'; import { BehaviorSubject, Observable, of } from 'rxjs'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { AnomalyChartsEmbeddable } from './anomaly_charts_embeddable'; import { CoreStart } from 'kibana/public'; import { useAnomalyChartsInputResolver } from './use_anomaly_charts_input_resolver'; diff --git a/x-pack/plugins/ml/public/embeddables/anomaly_charts/embeddable_anomaly_charts_container.tsx b/x-pack/plugins/ml/public/embeddables/anomaly_charts/embeddable_anomaly_charts_container.tsx index 698fcfd55583e..729838f83e979 100644 --- a/x-pack/plugins/ml/public/embeddables/anomaly_charts/embeddable_anomaly_charts_container.tsx +++ b/x-pack/plugins/ml/public/embeddables/anomaly_charts/embeddable_anomaly_charts_container.tsx @@ -8,7 +8,7 @@ import React, { FC, useCallback, useState, useMemo, useEffect } from 'react'; import { EuiCallOut, EuiLoadingChart, EuiResizeObserver, EuiText } from '@elastic/eui'; import { Observable } from 'rxjs'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { throttle } from 'lodash'; import { useAnomalyChartsInputResolver } from './use_anomaly_charts_input_resolver'; import type { IAnomalyChartsEmbeddable } from './anomaly_charts_embeddable'; diff --git a/x-pack/plugins/ml/public/embeddables/anomaly_swimlane/anomaly_swimlane_initializer.tsx b/x-pack/plugins/ml/public/embeddables/anomaly_swimlane/anomaly_swimlane_initializer.tsx index 60ff32e59c5a4..4fc43fc640b98 100644 --- a/x-pack/plugins/ml/public/embeddables/anomaly_swimlane/anomaly_swimlane_initializer.tsx +++ b/x-pack/plugins/ml/public/embeddables/anomaly_swimlane/anomaly_swimlane_initializer.tsx @@ -20,7 +20,7 @@ import { EuiFieldText, EuiModal, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { SWIMLANE_TYPE, SwimlaneType } from '../../application/explorer/explorer_constants'; import { AnomalySwimlaneEmbeddableInput } from '..'; diff --git a/x-pack/plugins/ml/public/embeddables/anomaly_swimlane/embeddable_swim_lane_container.test.tsx b/x-pack/plugins/ml/public/embeddables/anomaly_swimlane/embeddable_swim_lane_container.test.tsx index c48113d74a9e0..6b44073ac95bb 100644 --- a/x-pack/plugins/ml/public/embeddables/anomaly_swimlane/embeddable_swim_lane_container.test.tsx +++ b/x-pack/plugins/ml/public/embeddables/anomaly_swimlane/embeddable_swim_lane_container.test.tsx @@ -12,7 +12,7 @@ import { ExplorerSwimlaneContainerProps, } from './embeddable_swim_lane_container'; import { BehaviorSubject, Observable } from 'rxjs'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { AnomalySwimlaneEmbeddable } from './anomaly_swimlane_embeddable'; import { CoreStart } from 'kibana/public'; import { useSwimlaneInputResolver } from './swimlane_input_resolver'; diff --git a/x-pack/plugins/ml/public/embeddables/anomaly_swimlane/embeddable_swim_lane_container.tsx b/x-pack/plugins/ml/public/embeddables/anomaly_swimlane/embeddable_swim_lane_container.tsx index daa2858659cae..6cadbd7eed84c 100644 --- a/x-pack/plugins/ml/public/embeddables/anomaly_swimlane/embeddable_swim_lane_container.tsx +++ b/x-pack/plugins/ml/public/embeddables/anomaly_swimlane/embeddable_swim_lane_container.tsx @@ -10,7 +10,7 @@ import { EuiCallOut } from '@elastic/eui'; import { Observable } from 'rxjs'; import { CoreStart } from 'kibana/public'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { IAnomalySwimlaneEmbeddable } from './anomaly_swimlane_embeddable'; import { useSwimlaneInputResolver } from './swimlane_input_resolver'; import { SwimlaneType } from '../../application/explorer/explorer_constants'; diff --git a/x-pack/plugins/ml/public/plugin.ts b/x-pack/plugins/ml/public/plugin.ts index e5346b6618098..59419303d7a6f 100644 --- a/x-pack/plugins/ml/public/plugin.ts +++ b/x-pack/plugins/ml/public/plugin.ts @@ -25,7 +25,6 @@ import type { SpacesPluginStart } from '../../spaces/public'; import { AppStatus, AppUpdater, DEFAULT_APP_CATEGORIES } from '../../../../src/core/public'; import type { UiActionsSetup, UiActionsStart } from '../../../../src/plugins/ui_actions/public'; -import type { KibanaLegacyStart } from '../../../../src/plugins/kibana_legacy/public'; import type { LicenseManagementUIPluginSetup } from '../../license_management/public'; import type { LicensingPluginSetup } from '../../licensing/public'; @@ -54,7 +53,6 @@ import type { export interface MlStartDependencies { data: DataPublicPluginStart; share: SharePluginStart; - kibanaLegacy: KibanaLegacyStart; uiActions: UiActionsStart; spaces?: SpacesPluginStart; embeddable: EmbeddableStart; @@ -109,7 +107,6 @@ export class MlPlugin implements Plugin { { data: pluginsStart.data, share: pluginsStart.share, - kibanaLegacy: pluginsStart.kibanaLegacy, security: pluginsSetup.security, licensing: pluginsSetup.licensing, management: pluginsSetup.management, diff --git a/x-pack/plugins/ml/server/lib/alerts/alerting_service.ts b/x-pack/plugins/ml/server/lib/alerts/alerting_service.ts index 1d6c635231b6e..85746298d4e51 100644 --- a/x-pack/plugins/ml/server/lib/alerts/alerting_service.ts +++ b/x-pack/plugins/ml/server/lib/alerts/alerting_service.ts @@ -8,6 +8,8 @@ import Boom from '@hapi/boom'; import rison from 'rison-node'; import { Duration } from 'moment/moment'; +import { memoize } from 'lodash'; +import type { MlDatafeed } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { MlClient } from '../ml_client'; import { MlAnomalyDetectionAlertParams, @@ -30,6 +32,15 @@ import { isDefined } from '../../../common/types/guards'; import { getTopNBuckets, resolveLookbackInterval } from '../../../common/util/alerts'; import type { DatafeedsService } from '../../models/job_service/datafeeds'; import { getEntityFieldName, getEntityFieldValue } from '../../../common/util/anomaly_utils'; +import { FieldFormatsRegistryProvider } from '../../../common/types/kibana'; +import { + FIELD_FORMAT_IDS, + IFieldFormat, + SerializedFieldFormat, +} from '../../../../../../src/plugins/field_formats/common'; +import type { AwaitReturnType } from '../../../common/types/common'; +import { getTypicalAndActualValues } from '../../models/results_service/results_service'; +import type { GetDataViewsService } from '../data_views_utils'; type AggResultsResponse = { key?: number } & { [key in PreviewResultsKeys]: { @@ -57,7 +68,56 @@ const resultTypeScoreMapping = { * @param mlClient * @param datafeedsService */ -export function alertingServiceProvider(mlClient: MlClient, datafeedsService: DatafeedsService) { +export function alertingServiceProvider( + mlClient: MlClient, + datafeedsService: DatafeedsService, + getFieldsFormatRegistry: FieldFormatsRegistryProvider, + getDataViewsService: GetDataViewsService +) { + type FieldFormatters = AwaitReturnType>; + + /** + * Provides formatters based on the data view of the datafeed index pattern + * and set of default formatters for fallback. + */ + const getFormatters = memoize(async (datafeed: MlDatafeed) => { + const fieldFormatsRegistry = await getFieldsFormatRegistry(); + const numberFormatter = fieldFormatsRegistry.deserialize({ id: FIELD_FORMAT_IDS.NUMBER }); + + const fieldFormatMap = await getFieldsFormatMap(datafeed.indices[0]); + + const fieldFormatters = fieldFormatMap + ? Object.entries(fieldFormatMap).reduce((acc, [fieldName, config]) => { + const formatter = fieldFormatsRegistry.deserialize(config); + acc[fieldName] = formatter.convert.bind(formatter); + return acc; + }, {} as Record) + : {}; + + return { + numberFormatter: numberFormatter.convert.bind(numberFormatter), + fieldFormatters, + }; + }); + + /** + * Attempts to find a data view based on the index pattern + */ + const getFieldsFormatMap = memoize( + async (indexPattern: string): Promise | undefined> => { + try { + const dataViewsService = await getDataViewsService(); + + const dataView = (await dataViewsService.find(indexPattern, 1))[0]; + if (!dataView) return; + + return dataView.fieldFormatMap; + } catch (e) { + return; + } + } + ); + const getAggResultsLabel = (resultType: AnomalyResultType) => { return { aggGroupLabel: `${resultType}_results` as PreviewResultsKeys, @@ -142,6 +202,7 @@ export function alertingServiceProvider(mlClient: MlClient, datafeedsService: Da 'initial_record_score', 'is_interim', 'function', + 'function_description', 'field_name', 'by_field_name', 'by_field_value', @@ -152,6 +213,9 @@ export function alertingServiceProvider(mlClient: MlClient, datafeedsService: Da 'job_id', 'detector_index', 'bucket_span', + 'typical', + 'actual', + 'causes', ], }, size: 3, @@ -228,7 +292,11 @@ export function alertingServiceProvider(mlClient: MlClient, datafeedsService: Da * to the alert context. * @param resultType */ - const getResultsFormatter = (resultType: AnomalyResultType, useInitialScore: boolean = false) => { + const getResultsFormatter = ( + resultType: AnomalyResultType, + useInitialScore: boolean = false, + formatters: FieldFormatters + ) => { const resultsLabel = getAggResultsLabel(resultType); return (v: AggResultsResponse): AlertExecutionResult | undefined => { const aggTypeResults = v[resultsLabel.aggGroupLabel]; @@ -260,8 +328,15 @@ export function alertingServiceProvider(mlClient: MlClient, datafeedsService: Da end: new Date(timestamp + bucketSpanInSeconds * 1000 * TIME_RANGE_PADDING).toISOString(), }, topRecords: v.record_results.top_record_hits.hits.hits.map((h) => { + const { actual, typical } = getTypicalAndActualValues(h._source); + + const formatter = + formatters.fieldFormatters[h._source.field_name] ?? formatters.numberFormatter; + return { ...h._source, + typical: typical?.map((t) => formatter(t)), + actual: actual?.map((a) => formatter(a)), score: Math.floor( h._source[getScoreFields(ANOMALY_RESULT_TYPE.RECORD, useInitialScore)] ), @@ -328,6 +403,8 @@ export function alertingServiceProvider(mlClient: MlClient, datafeedsService: Da const jobIds = jobsResponse.map((v) => v.job_id); + const datafeeds = await datafeedsService.getDatafeedByJobId(jobIds); + const requestBody = { size: 0, query: { @@ -387,7 +464,13 @@ export function alertingServiceProvider(mlClient: MlClient, datafeedsService: Da const resultsLabel = getAggResultsLabel(params.resultType); - const formatter = getResultsFormatter(params.resultType, !!previewTimeInterval); + const fieldsFormatters = await getFormatters(datafeeds![0]!); + + const formatter = getResultsFormatter( + params.resultType, + !!previewTimeInterval, + fieldsFormatters + ); return ( previewTimeInterval @@ -543,7 +626,9 @@ export function alertingServiceProvider(mlClient: MlClient, datafeedsService: Da prev.max_score.value > current.max_score.value ? prev : current ); - return getResultsFormatter(params.resultType)(topResult); + const formatters = await getFormatters(datafeeds![0]); + + return getResultsFormatter(params.resultType, false, formatters)(topResult); }; /** diff --git a/x-pack/plugins/ml/server/lib/ml_client/ml_client.ts b/x-pack/plugins/ml/server/lib/ml_client/ml_client.ts index c2b98ab1b0c29..c8e31003cb2eb 100644 --- a/x-pack/plugins/ml/server/lib/ml_client/ml_client.ts +++ b/x-pack/plugins/ml/server/lib/ml_client/ml_client.ts @@ -471,7 +471,24 @@ export function getMlClient( }, async updateDatafeed(...p: Parameters) { await datafeedIdsCheck(p); - return mlClient.updateDatafeed(...p); + + // Temporary workaround for the incorrect updateDatafeed function in the esclient + if (p.length === 0 || p[0] === undefined) { + // Temporary generic error message. This should never be triggered + // but is added for type correctness below + throw new Error('Incorrect arguments supplied'); + } + const { datafeed_id: id, body } = p[0]; + + return client.asInternalUser.transport.request({ + method: 'POST', + path: `/_ml/datafeeds/${id}/_update`, + body, + }); + + // this should be reinstated once https://github.com/elastic/elasticsearch-js/issues/1601 + // is fixed + // return mlClient.updateDatafeed(...p); }, async updateFilter(...p: Parameters) { return mlClient.updateFilter(...p); diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/apache_ecs/manifest.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/apache_ecs/manifest.json index e9cd932ce264c..c4c8a2c167a3c 100644 --- a/x-pack/plugins/ml/server/models/data_recognizer/modules/apache_ecs/manifest.json +++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/apache_ecs/manifest.json @@ -12,7 +12,8 @@ { "exists": { "field": "source.address" } }, { "exists": { "field": "url.original" } }, { "exists": { "field": "http.response.status_code" } } - ] + ], + "must_not": { "terms": { "_tier": [ "data_frozen", "data_cold" ] } } } }, "jobs": [ diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/apm_transaction/manifest.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/apm_transaction/manifest.json index 3332fad66b3e2..721d4693e61aa 100644 --- a/x-pack/plugins/ml/server/models/data_recognizer/modules/apm_transaction/manifest.json +++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/apm_transaction/manifest.json @@ -10,7 +10,8 @@ "filter": [ { "term": { "processor.event": "metric" } }, { "term": { "metricset.name": "transaction" } } - ] + ], + "must_not": { "terms": { "_tier": [ "data_frozen", "data_cold" ] } } } }, "jobs": [ diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/auditbeat_process_docker_ecs/manifest.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/auditbeat_process_docker_ecs/manifest.json index 7f407c4f5f713..b106130da8c32 100644 --- a/x-pack/plugins/ml/server/models/data_recognizer/modules/auditbeat_process_docker_ecs/manifest.json +++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/auditbeat_process_docker_ecs/manifest.json @@ -13,7 +13,8 @@ ], "must": { "exists": { "field": "auditd.data.syscall" } - } + }, + "must_not": { "terms": { "_tier": [ "data_frozen", "data_cold" ] } } } }, "jobs": [ diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/auditbeat_process_hosts_ecs/manifest.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/auditbeat_process_hosts_ecs/manifest.json index 3f883e0198817..96d0eb2a43866 100644 --- a/x-pack/plugins/ml/server/models/data_recognizer/modules/auditbeat_process_hosts_ecs/manifest.json +++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/auditbeat_process_hosts_ecs/manifest.json @@ -13,9 +13,10 @@ "must": { "exists": { "field": "auditd.data.syscall" } }, - "must_not": { - "exists": { "field": "container.runtime" } - } + "must_not": [ + { "exists": { "field": "container.runtime" } }, + { "terms": { "_tier": [ "data_frozen", "data_cold" ] } } + ] } }, "jobs": [ diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/metricbeat_system_ecs/manifest.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/metricbeat_system_ecs/manifest.json index 6482fab429ecb..23504b4088d53 100644 --- a/x-pack/plugins/ml/server/models/data_recognizer/modules/metricbeat_system_ecs/manifest.json +++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/metricbeat_system_ecs/manifest.json @@ -14,7 +14,8 @@ "system.filesystem" ] } - } + }, + "must_not": { "terms": { "_tier": [ "data_frozen", "data_cold" ] } } } }, "jobs": [ diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/nginx_ecs/manifest.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/nginx_ecs/manifest.json index e219035178941..80ef655acb1f4 100644 --- a/x-pack/plugins/ml/server/models/data_recognizer/modules/nginx_ecs/manifest.json +++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/nginx_ecs/manifest.json @@ -12,7 +12,8 @@ { "exists": { "field": "source.address" } }, { "exists": { "field": "url.original" } }, { "exists": { "field": "http.response.status_code" } } - ] + ], + "must_not": { "terms": { "_tier": [ "data_frozen", "data_cold" ] } } } }, "jobs": [ diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/manifest.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/manifest.json index 480f49f3f2b19..7bb54bd126e77 100755 --- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/manifest.json +++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_auth/manifest.json @@ -13,7 +13,8 @@ "event.category": "authentication" } } - ] + ], + "must_not": { "terms": { "_tier": [ "data_frozen", "data_cold" ] } } } }, "jobs": [ diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/manifest.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/manifest.json index c627e5a6f6253..281343975500b 100644 --- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/manifest.json +++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_linux/manifest.json @@ -40,7 +40,8 @@ } } } - ] + ], + "must_not": { "terms": { "_tier": [ "data_frozen", "data_cold" ] } } } }, "jobs": [ diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_network/manifest.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_network/manifest.json index 384ea006b5b42..bed522d4e954a 100755 --- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_network/manifest.json +++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_network/manifest.json @@ -13,7 +13,8 @@ "event.category": "network" } } - ] + ], + "must_not": { "terms": { "_tier": [ "data_frozen", "data_cold" ] } } } }, "jobs": [ diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/manifest.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/manifest.json index e1bd6eacc6882..7325fa76b2eb0 100644 --- a/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/manifest.json +++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/security_windows/manifest.json @@ -30,7 +30,8 @@ ] } } - ] + ], + "must_not": { "terms": { "_tier": [ "data_frozen", "data_cold" ] } } } }, "jobs": [ diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/siem_auditbeat/manifest.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/siem_auditbeat/manifest.json index 36d1df6db4c99..efb7947ed34f5 100644 --- a/x-pack/plugins/ml/server/models/data_recognizer/modules/siem_auditbeat/manifest.json +++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/siem_auditbeat/manifest.json @@ -9,7 +9,8 @@ "bool": { "filter": [ {"term": {"agent.type": "auditbeat"}} - ] + ], + "must_not": { "terms": { "_tier": [ "data_frozen", "data_cold" ] } } } }, "jobs": [ diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/siem_auditbeat_auth/manifest.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/siem_auditbeat_auth/manifest.json index f6e878de8169b..2d43544522fef 100644 --- a/x-pack/plugins/ml/server/models/data_recognizer/modules/siem_auditbeat_auth/manifest.json +++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/siem_auditbeat_auth/manifest.json @@ -10,7 +10,8 @@ "filter": [ {"term": {"event.category": "authentication"}}, {"term": {"agent.type": "auditbeat"}} - ] + ], + "must_not": { "terms": { "_tier": [ "data_frozen", "data_cold" ] } } } }, "jobs": [ diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/siem_cloudtrail/manifest.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/siem_cloudtrail/manifest.json index 33940f20db903..1d9f778f17150 100644 --- a/x-pack/plugins/ml/server/models/data_recognizer/modules/siem_cloudtrail/manifest.json +++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/siem_cloudtrail/manifest.json @@ -9,7 +9,8 @@ "bool": { "filter": [ {"term": {"event.dataset": "aws.cloudtrail"}} - ] + ], + "must_not": { "terms": { "_tier": [ "data_frozen", "data_cold" ] } } } }, "jobs": [ diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/siem_packetbeat/manifest.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/siem_packetbeat/manifest.json index e11e1726076d9..61c3ce979154a 100644 --- a/x-pack/plugins/ml/server/models/data_recognizer/modules/siem_packetbeat/manifest.json +++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/siem_packetbeat/manifest.json @@ -9,7 +9,8 @@ "bool": { "filter": [ {"term": {"agent.type": "packetbeat"}} - ] + ], + "must_not": { "terms": { "_tier": [ "data_frozen", "data_cold" ] } } } }, "jobs": [ diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/siem_winlogbeat/manifest.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/siem_winlogbeat/manifest.json index 969873ead6d9c..7e4f20bce6d5a 100644 --- a/x-pack/plugins/ml/server/models/data_recognizer/modules/siem_winlogbeat/manifest.json +++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/siem_winlogbeat/manifest.json @@ -9,7 +9,8 @@ "bool": { "filter": [ {"term": {"agent.type": "winlogbeat"}} - ] + ], + "must_not": { "terms": { "_tier": [ "data_frozen", "data_cold" ] } } } }, "jobs": [ diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/siem_winlogbeat_auth/manifest.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/siem_winlogbeat_auth/manifest.json index f08f4da880118..45a3d25969812 100644 --- a/x-pack/plugins/ml/server/models/data_recognizer/modules/siem_winlogbeat_auth/manifest.json +++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/siem_winlogbeat_auth/manifest.json @@ -10,7 +10,8 @@ "filter": [ {"term": {"agent.type": "winlogbeat"}}, {"term": {"event.category": "authentication"}} - ] + ], + "must_not": { "terms": { "_tier": [ "data_frozen", "data_cold" ] } } } }, "jobs": [ diff --git a/x-pack/plugins/ml/server/models/data_recognizer/modules/uptime_heartbeat/manifest.json b/x-pack/plugins/ml/server/models/data_recognizer/modules/uptime_heartbeat/manifest.json index 52005a2629900..89a08f8a8207a 100644 --- a/x-pack/plugins/ml/server/models/data_recognizer/modules/uptime_heartbeat/manifest.json +++ b/x-pack/plugins/ml/server/models/data_recognizer/modules/uptime_heartbeat/manifest.json @@ -7,7 +7,8 @@ "defaultIndexPattern": "heartbeat-*", "query": { "bool": { - "filter": [{ "term": { "agent.type": "heartbeat" } }] + "filter": [{ "term": { "agent.type": "heartbeat" } }], + "must_not": { "terms": { "_tier": [ "data_frozen", "data_cold" ] } } } }, "jobs": [ diff --git a/x-pack/plugins/ml/server/models/results_service/results_service.ts b/x-pack/plugins/ml/server/models/results_service/results_service.ts index 81ee394b99704..48eb5ad727b3c 100644 --- a/x-pack/plugins/ml/server/models/results_service/results_service.ts +++ b/x-pack/plugins/ml/server/models/results_service/results_service.ts @@ -28,6 +28,7 @@ import { MlJobsResponse } from '../../../common/types/job_service'; import type { MlClient } from '../../lib/ml_client'; import { datafeedsProvider } from '../job_service/datafeeds'; import { annotationServiceProvider } from '../annotation_service'; +import { showActualForFunction, showTypicalForFunction } from '../../../common/util/anomaly_utils'; // Service for carrying out Elasticsearch queries to obtain data for the // ML Results dashboards. @@ -45,6 +46,39 @@ interface Influencer { fieldValue: any; } +/** + * Extracts typical and actual values from the anomaly record. + * @param source + */ +export function getTypicalAndActualValues(source: AnomalyRecordDoc) { + const result: { actual?: number[]; typical?: number[] } = {}; + + const functionDescription = source.function_description || ''; + const causes = source.causes || []; + + if (showActualForFunction(functionDescription)) { + if (source.actual !== undefined) { + result.actual = source.actual; + } else { + if (causes.length === 1) { + result.actual = causes[0].actual; + } + } + } + + if (showTypicalForFunction(functionDescription)) { + if (source.typical !== undefined) { + result.typical = source.typical; + } else { + if (causes.length === 1) { + result.typical = causes[0].typical; + } + } + } + + return result; +} + export function resultsServiceProvider(mlClient: MlClient, client?: IScopedClusterClient) { // Obtains data for the anomalies table, aggregating anomalies by day or hour as requested. // Return an Object with properties 'anomalies' and 'interval' (interval used to aggregate anomalies, diff --git a/x-pack/plugins/ml/server/plugin.ts b/x-pack/plugins/ml/server/plugin.ts index d99beb20883b2..6ce9a8d93be26 100644 --- a/x-pack/plugins/ml/server/plugin.ts +++ b/x-pack/plugins/ml/server/plugin.ts @@ -146,6 +146,39 @@ export class MlServerPlugin () => this.savedObjectsStart ); + const getSpaces = plugins.spaces + ? () => coreSetup.getStartServices().then(([, { spaces }]) => spaces!) + : undefined; + + const getDataViews = () => { + if (this.dataViews === null) { + throw Error('Data views plugin not initialized'); + } + return this.dataViews; + }; + + const resolveMlCapabilities = async (request: KibanaRequest) => { + if (this.capabilities === null) { + return null; + } + const capabilities = await this.capabilities.resolveCapabilities(request); + return capabilities.ml as MlCapabilities; + }; + + const { internalServicesProviders, sharedServicesProviders } = createSharedServices( + this.mlLicense, + getSpaces, + plugins.cloud, + plugins.security?.authz, + resolveMlCapabilities, + () => this.clusterClient, + () => getInternalSavedObjectsClient(), + () => this.uiSettings, + () => this.fieldsFormat, + getDataViews, + () => this.isMlReady + ); + const routeInit: RouteInitialization = { router: coreSetup.http.createRouter(), routeGuard: new RouteGuard( @@ -160,25 +193,6 @@ export class MlServerPlugin mlLicense: this.mlLicense, }; - const resolveMlCapabilities = async (request: KibanaRequest) => { - if (this.capabilities === null) { - return null; - } - const capabilities = await this.capabilities.resolveCapabilities(request); - return capabilities.ml as MlCapabilities; - }; - - const getSpaces = plugins.spaces - ? () => coreSetup.getStartServices().then(([, { spaces }]) => spaces!) - : undefined; - - const getDataViews = () => { - if (this.dataViews === null) { - throw Error('Data views plugin not initialized'); - } - return this.dataViews; - }; - annotationRoutes(routeInit, plugins.security); calendars(routeInit); dataFeedRoutes(routeInit); @@ -203,24 +217,10 @@ export class MlServerPlugin resolveMlCapabilities, }); trainedModelsRoutes(routeInit); - alertingRoutes(routeInit); + alertingRoutes(routeInit, sharedServicesProviders); initMlServerLog({ log: this.log }); - const { internalServicesProviders, sharedServicesProviders } = createSharedServices( - this.mlLicense, - getSpaces, - plugins.cloud, - plugins.security?.authz, - resolveMlCapabilities, - () => this.clusterClient, - () => getInternalSavedObjectsClient(), - () => this.uiSettings, - () => this.fieldsFormat, - getDataViews, - () => this.isMlReady - ); - if (plugins.alerting) { registerMlAlerts({ alerting: plugins.alerting, diff --git a/x-pack/plugins/ml/server/routes/alerting.ts b/x-pack/plugins/ml/server/routes/alerting.ts index 15b7fb6fb4e96..1dd11375cdd3c 100644 --- a/x-pack/plugins/ml/server/routes/alerting.ts +++ b/x-pack/plugins/ml/server/routes/alerting.ts @@ -7,11 +7,13 @@ import { RouteInitialization } from '../types'; import { wrapError } from '../client/error_wrapper'; -import { alertingServiceProvider } from '../lib/alerts/alerting_service'; import { mlAnomalyDetectionAlertPreviewRequest } from './schemas/alerting_schema'; -import { datafeedsProvider } from '../models/job_service/datafeeds'; +import type { SharedServices } from '../shared_services'; -export function alertingRoutes({ router, routeGuard }: RouteInitialization) { +export function alertingRoutes( + { router, routeGuard }: RouteInitialization, + sharedServicesProviders: SharedServices +) { /** * @apiGroup Alerting * @@ -31,11 +33,11 @@ export function alertingRoutes({ router, routeGuard }: RouteInitialization) { tags: ['access:ml:canGetJobs'], }, }, - routeGuard.fullLicenseAPIGuard(async ({ mlClient, request, response, client }) => { + routeGuard.fullLicenseAPIGuard(async ({ mlClient, request, response, client, context }) => { try { - const alertingService = alertingServiceProvider( - mlClient, - datafeedsProvider(client, mlClient) + const alertingService = sharedServicesProviders.alertingServiceProvider( + context.core.savedObjects.client, + request ); const result = await alertingService.preview(request.body); diff --git a/x-pack/plugins/ml/server/routes/trained_models.ts b/x-pack/plugins/ml/server/routes/trained_models.ts index e7696861153ff..e213efc203704 100644 --- a/x-pack/plugins/ml/server/routes/trained_models.ts +++ b/x-pack/plugins/ml/server/routes/trained_models.ts @@ -16,6 +16,7 @@ import { modelsProvider } from '../models/data_frame_analytics'; import { TrainedModelConfigResponse } from '../../common/types/trained_models'; import { memoryOverviewServiceProvider } from '../models/memory_overview'; import { mlLog } from '../lib/log'; +import { forceQuerySchema } from './schemas/anomaly_detectors_schema'; export function trainedModelsRoutes({ router, routeGuard }: RouteInitialization) { /** @@ -266,6 +267,7 @@ export function trainedModelsRoutes({ router, routeGuard }: RouteInitialization) path: '/api/ml/trained_models/{modelId}/deployment/_stop', validate: { params: modelIdSchema, + query: forceQuerySchema, }, options: { tags: ['access:ml:canGetDataFrameAnalytics'], @@ -276,6 +278,7 @@ export function trainedModelsRoutes({ router, routeGuard }: RouteInitialization) const { modelId } = request.params; const { body } = await mlClient.stopTrainedModelDeployment({ model_id: modelId, + force: request.query.force ?? false, }); return response.ok({ body, diff --git a/x-pack/plugins/ml/server/shared_services/providers/alerting_service.ts b/x-pack/plugins/ml/server/shared_services/providers/alerting_service.ts index fa08cdf81fe1c..9d3691a525339 100644 --- a/x-pack/plugins/ml/server/shared_services/providers/alerting_service.ts +++ b/x-pack/plugins/ml/server/shared_services/providers/alerting_service.ts @@ -21,10 +21,13 @@ export function getAlertingServiceProvider(getGuards: GetGuards) { return await getGuards(request, savedObjectsClient) .isFullLicense() .hasMlCapabilities(['canGetJobs']) - .ok(({ mlClient, scopedClient }) => - alertingServiceProvider(mlClient, datafeedsProvider(scopedClient, mlClient)).preview( - ...args - ) + .ok(({ mlClient, scopedClient, getFieldsFormatRegistry, getDataViewsService }) => + alertingServiceProvider( + mlClient, + datafeedsProvider(scopedClient, mlClient), + getFieldsFormatRegistry, + getDataViewsService + ).preview(...args) ); }, execute: async ( @@ -33,10 +36,13 @@ export function getAlertingServiceProvider(getGuards: GetGuards) { return await getGuards(request, savedObjectsClient) .isFullLicense() .hasMlCapabilities(['canGetJobs']) - .ok(({ mlClient, scopedClient }) => - alertingServiceProvider(mlClient, datafeedsProvider(scopedClient, mlClient)).execute( - ...args - ) + .ok(({ mlClient, scopedClient, getFieldsFormatRegistry, getDataViewsService }) => + alertingServiceProvider( + mlClient, + datafeedsProvider(scopedClient, mlClient), + getFieldsFormatRegistry, + getDataViewsService + ).execute(...args) ); }, }; diff --git a/x-pack/plugins/ml/tsconfig.json b/x-pack/plugins/ml/tsconfig.json index 0c108f8b3b8a5..87ba8c50c3a88 100644 --- a/x-pack/plugins/ml/tsconfig.json +++ b/x-pack/plugins/ml/tsconfig.json @@ -20,7 +20,6 @@ "references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/embeddable/tsconfig.json" }, - { "path": "../../../src/plugins/index_pattern_management/tsconfig.json" }, { "path": "../../../src/plugins/data_views/tsconfig.json" }, { "path": "../cloud/tsconfig.json" }, { "path": "../features/tsconfig.json" }, diff --git a/x-pack/plugins/monitoring/kibana.json b/x-pack/plugins/monitoring/kibana.json index bc0cf47181585..d10d8d674fcaf 100644 --- a/x-pack/plugins/monitoring/kibana.json +++ b/x-pack/plugins/monitoring/kibana.json @@ -24,7 +24,6 @@ "kibanaUtils", "home", "alerting", - "kibanaReact", - "kibanaLegacy" + "kibanaReact" ] } diff --git a/x-pack/plugins/monitoring/public/alerts/alert_form.test.tsx b/x-pack/plugins/monitoring/public/alerts/alert_form.test.tsx index 1a44beab260cb..0a13476d625fe 100644 --- a/x-pack/plugins/monitoring/public/alerts/alert_form.test.tsx +++ b/x-pack/plugins/monitoring/public/alerts/alert_form.test.tsx @@ -25,7 +25,7 @@ import { import { AlertForm } from '../../../triggers_actions_ui/public/application/sections/alert_form/alert_form'; import ActionForm from '../../../triggers_actions_ui/public/application/sections/action_connector_form/action_form'; import { Legacy } from '../legacy_shims'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { createKibanaReactContext } from '../../../../../src/plugins/kibana_react/public'; interface AlertAction { diff --git a/x-pack/plugins/monitoring/public/alerts/alerts_dropdown.tsx b/x-pack/plugins/monitoring/public/alerts/alerts_dropdown.tsx index 976569f39de4c..c2f5fa73acf29 100644 --- a/x-pack/plugins/monitoring/public/alerts/alerts_dropdown.tsx +++ b/x-pack/plugins/monitoring/public/alerts/alerts_dropdown.tsx @@ -13,7 +13,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React, { useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useKibana } from '../../../../../src/plugins/kibana_react/public'; import { MonitoringStartPluginDependencies } from '../types'; import { useAlertsModal } from '../application/hooks/use_alerts_modal'; diff --git a/x-pack/plugins/monitoring/public/alerts/configuration.tsx b/x-pack/plugins/monitoring/public/alerts/configuration.tsx index 7825fe8e20617..1efb44a8b36f5 100644 --- a/x-pack/plugins/monitoring/public/alerts/configuration.tsx +++ b/x-pack/plugins/monitoring/public/alerts/configuration.tsx @@ -7,7 +7,7 @@ import React, { Fragment, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiSwitch } from '@elastic/eui'; import { CommonAlert } from '../../common/types/alerts'; import { Legacy } from '../legacy_shims'; diff --git a/x-pack/plugins/monitoring/public/alerts/enable_alerts_modal.tsx b/x-pack/plugins/monitoring/public/alerts/enable_alerts_modal.tsx index 3e45262610f45..ca1af4d464efa 100644 --- a/x-pack/plugins/monitoring/public/alerts/enable_alerts_modal.tsx +++ b/x-pack/plugins/monitoring/public/alerts/enable_alerts_modal.tsx @@ -20,7 +20,7 @@ import { EuiRadioGroup, EuiSpacer, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { Legacy } from '../legacy_shims'; import { useAlertsModal } from '../application/hooks/use_alerts_modal'; diff --git a/x-pack/plugins/monitoring/public/alerts/lib/alerts_toast.tsx b/x-pack/plugins/monitoring/public/alerts/lib/alerts_toast.tsx index 10c8f7155134b..fca7297584614 100644 --- a/x-pack/plugins/monitoring/public/alerts/lib/alerts_toast.tsx +++ b/x-pack/plugins/monitoring/public/alerts/lib/alerts_toast.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiSpacer, EuiLink } from '@elastic/eui'; import { Legacy } from '../../legacy_shims'; import { toMountPoint } from '../../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/monitoring/public/alerts/status.tsx b/x-pack/plugins/monitoring/public/alerts/status.tsx index 28c2ebcce2513..224ffc52e5189 100644 --- a/x-pack/plugins/monitoring/public/alerts/status.tsx +++ b/x-pack/plugins/monitoring/public/alerts/status.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiToolTip, EuiHealth } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { CommonAlertStatus, AlertState } from '../../common/types/alerts'; import { AlertSeverity } from '../../common/enums'; diff --git a/x-pack/plugins/monitoring/public/application/hooks/use_request_error_handler.tsx b/x-pack/plugins/monitoring/public/application/hooks/use_request_error_handler.tsx index b4c2a4e86d374..424dda666945b 100644 --- a/x-pack/plugins/monitoring/public/application/hooks/use_request_error_handler.tsx +++ b/x-pack/plugins/monitoring/public/application/hooks/use_request_error_handler.tsx @@ -8,9 +8,9 @@ import React, { useCallback } from 'react'; import { useHistory } from 'react-router-dom'; import { includes } from 'lodash'; import { IHttpFetchError, ResponseErrorBody } from 'kibana/public'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiSpacer, EuiText } from '@elastic/eui'; -import { formatMsg } from '../../../../../../src/plugins/kibana_legacy/public'; +import { formatMsg } from '../../lib/format_msg'; import { toMountPoint, useKibana } from '../../../../../../src/plugins/kibana_react/public'; import { MonitoringStartPluginDependencies } from '../../types'; diff --git a/x-pack/plugins/monitoring/public/application/pages/access_denied/index.tsx b/x-pack/plugins/monitoring/public/application/pages/access_denied/index.tsx index d578f797946eb..da245ecd80d81 100644 --- a/x-pack/plugins/monitoring/public/application/pages/access_denied/index.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/access_denied/index.tsx @@ -7,7 +7,7 @@ import React, { useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiPanel, EuiCallOut, EuiButton } from '@elastic/eui'; import useInterval from 'react-use/lib/useInterval'; import { Redirect } from 'react-router-dom'; diff --git a/x-pack/plugins/monitoring/public/components/apm/apm_metrics.tsx b/x-pack/plugins/monitoring/public/components/apm/apm_metrics.tsx index 1ec447ee2f84a..c4e5c51856013 100644 --- a/x-pack/plugins/monitoring/public/components/apm/apm_metrics.tsx +++ b/x-pack/plugins/monitoring/public/components/apm/apm_metrics.tsx @@ -18,7 +18,7 @@ import { EuiScreenReaderOnly, EuiTitle, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; // @ts-ignore could not find declaration file import { MonitoringTimeseriesContainer } from '../chart'; @@ -30,8 +30,13 @@ interface TitleType { title?: string; heading?: unknown; } + +interface Stats { + versions: string[]; + [key: string]: unknown; +} interface Props { - stats: { versions: string[]; [key: string]: unknown }; + stats: Stats; metrics: { [key: string]: unknown }; seriesToShow: unknown[]; title: string; @@ -41,6 +46,7 @@ interface Props { container: boolean; }; }; + StatusComponent: React.FC<{ stats: Stats }>; } const createCharts = (series: unknown[], props: Partial) => { @@ -76,7 +82,15 @@ const getHeading = (isFleetTypeMetric: boolean) => { return titles; }; -export const ApmMetrics = ({ stats, metrics, seriesToShow, title, summary, ...props }: Props) => { +export const ApmMetrics = ({ + stats, + metrics, + seriesToShow, + title, + summary, + StatusComponent, + ...props +}: Props) => { if (!metrics) { return null; } @@ -96,7 +110,7 @@ export const ApmMetrics = ({ stats, metrics, seriesToShow, title, summary, ...pr

{titles.heading as FormattedMessage}

- + diff --git a/x-pack/plugins/monitoring/public/components/apm/instance/instance.js b/x-pack/plugins/monitoring/public/components/apm/instance/instance.js index f52ca7cf8ad49..19485c2b8a38c 100644 --- a/x-pack/plugins/monitoring/public/components/apm/instance/instance.js +++ b/x-pack/plugins/monitoring/public/components/apm/instance/instance.js @@ -8,6 +8,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { ApmMetrics } from '../apm_metrics'; +import { Status } from './status'; const title = i18n.translate('xpack.monitoring.apm.instance.panels.title', { defaultMessage: 'APM Server - Metrics', @@ -29,5 +30,5 @@ export function ApmServerInstance(props) { const stats = props.summary; const metricProps = { ...props, title, seriesToShow, stats }; - return ; + return ; } diff --git a/x-pack/plugins/monitoring/public/components/apm/instance/status.js b/x-pack/plugins/monitoring/public/components/apm/instance/status.js index 9a199d6f6f9c0..65289ee6db0b7 100644 --- a/x-pack/plugins/monitoring/public/components/apm/instance/status.js +++ b/x-pack/plugins/monitoring/public/components/apm/instance/status.js @@ -12,7 +12,7 @@ import { ApmStatusIcon } from '../status_icon'; import { formatMetric } from '../../../lib/format_number'; import { formatTimestampToDuration } from '../../../../common'; import { CALCULATE_DURATION_SINCE } from '../../../../common/constants'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; export function Status({ alerts = null, stats }) { diff --git a/x-pack/plugins/monitoring/public/components/apm/instances/instances.js b/x-pack/plugins/monitoring/public/components/apm/instances/instances.js index f58047ad6e253..55bdab522efd4 100644 --- a/x-pack/plugins/monitoring/public/components/apm/instances/instances.js +++ b/x-pack/plugins/monitoring/public/components/apm/instances/instances.js @@ -26,7 +26,7 @@ import { i18n } from '@kbn/i18n'; import { APM_SYSTEM_ID } from '../../../../common/constants'; import { ListingCallOut } from '../../setup_mode/listing_callout'; import { SetupModeBadge } from '../../setup_mode/badge'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { isSetupModeFeatureEnabled } from '../../../lib/setup_mode'; import { SetupModeFeature } from '../../../../common/enums'; diff --git a/x-pack/plugins/monitoring/public/components/apm/instances/status.js b/x-pack/plugins/monitoring/public/components/apm/instances/status.js index 40a0f091889e0..8d94a4b11b8a9 100644 --- a/x-pack/plugins/monitoring/public/components/apm/instances/status.js +++ b/x-pack/plugins/monitoring/public/components/apm/instances/status.js @@ -12,7 +12,7 @@ import { ApmStatusIcon } from '../status_icon'; import { formatMetric } from '../../../lib/format_number'; import { formatTimestampToDuration } from '../../../../common'; import { CALCULATE_DURATION_SINCE } from '../../../../common/constants'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; export function Status({ alerts, stats }) { diff --git a/x-pack/plugins/monitoring/public/components/apm/overview/index.js b/x-pack/plugins/monitoring/public/components/apm/overview/index.js index ec622535444bc..b61a2c432276e 100644 --- a/x-pack/plugins/monitoring/public/components/apm/overview/index.js +++ b/x-pack/plugins/monitoring/public/components/apm/overview/index.js @@ -8,6 +8,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { ApmMetrics } from '../apm_metrics'; +import { Status } from './status'; const title = i18n.translate('xpack.monitoring.apm.overview.panels.title', { defaultMessage: 'APM Server - Metrics', @@ -23,7 +24,6 @@ export function ApmOverview(props) { metrics.apm_requests, metrics.apm_transformations, ]; - const metricProps = { ...props, title, seriesToShow }; - return ; + return ; } diff --git a/x-pack/plugins/monitoring/public/components/apm/overview/status.js b/x-pack/plugins/monitoring/public/components/apm/overview/status.js new file mode 100644 index 0000000000000..455c4e81ea6bb --- /dev/null +++ b/x-pack/plugins/monitoring/public/components/apm/overview/status.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { Status as InstancesStatus } from '../instances/status'; + +export function Status({ stats }) { + return ; +} diff --git a/x-pack/plugins/monitoring/public/components/beats/beat/beat.js b/x-pack/plugins/monitoring/public/components/beats/beat/beat.js index 1b8a4629493cd..76a7ce04d7932 100644 --- a/x-pack/plugins/monitoring/public/components/beats/beat/beat.js +++ b/x-pack/plugins/monitoring/public/components/beats/beat/beat.js @@ -20,7 +20,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { SummaryStatus } from '../../summary_status'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function Beat({ summary, metrics, ...props }) { const metricsToShow = [ diff --git a/x-pack/plugins/monitoring/public/components/beats/listing/listing.js b/x-pack/plugins/monitoring/public/components/beats/listing/listing.js index 31a64890f0b2b..4fdda2372dd0d 100644 --- a/x-pack/plugins/monitoring/public/components/beats/listing/listing.js +++ b/x-pack/plugins/monitoring/public/components/beats/listing/listing.js @@ -24,7 +24,7 @@ import { BEATS_SYSTEM_ID } from '../../../../common/constants'; import { getSafeForExternalLink } from '../../../lib/get_safe_for_external_link'; import { ListingCallOut } from '../../setup_mode/listing_callout'; import { SetupModeBadge } from '../../setup_mode/badge'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { isSetupModeFeatureEnabled } from '../../../lib/setup_mode'; import { SetupModeFeature } from '../../../../common/enums'; diff --git a/x-pack/plugins/monitoring/public/components/beats/overview/overview.js b/x-pack/plugins/monitoring/public/components/beats/overview/overview.js index 861dff682ba45..d9762b150974d 100644 --- a/x-pack/plugins/monitoring/public/components/beats/overview/overview.js +++ b/x-pack/plugins/monitoring/public/components/beats/overview/overview.js @@ -23,7 +23,7 @@ import { EuiPageContent, EuiScreenReaderOnly, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; function renderLatestActive(latestActive, latestTypes, latestVersions) { diff --git a/x-pack/plugins/monitoring/public/components/chart/horizontal_legend.js b/x-pack/plugins/monitoring/public/components/chart/horizontal_legend.js index c5c40af26e72c..7592b58d6beab 100644 --- a/x-pack/plugins/monitoring/public/components/chart/horizontal_legend.js +++ b/x-pack/plugins/monitoring/public/components/chart/horizontal_legend.js @@ -8,7 +8,7 @@ import React from 'react'; import { includes, isFunction } from 'lodash'; import { EuiFlexItem, EuiFlexGroup, EuiIcon } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import './horizontal_legend.scss'; diff --git a/x-pack/plugins/monitoring/public/components/chart/info_tooltip.js b/x-pack/plugins/monitoring/public/components/chart/info_tooltip.js index daed6168fb15d..35d7cdaf9da19 100644 --- a/x-pack/plugins/monitoring/public/components/chart/info_tooltip.js +++ b/x-pack/plugins/monitoring/public/components/chart/info_tooltip.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import './info_tooltip.scss'; export function InfoTooltip({ series, bucketSize }) { diff --git a/x-pack/plugins/monitoring/public/components/chart/monitoring_timeseries_container.js b/x-pack/plugins/monitoring/public/components/chart/monitoring_timeseries_container.js index 97ca1a819169f..fc7ca2975241f 100644 --- a/x-pack/plugins/monitoring/public/components/chart/monitoring_timeseries_container.js +++ b/x-pack/plugins/monitoring/public/components/chart/monitoring_timeseries_container.js @@ -22,7 +22,7 @@ import { EuiTextAlign, EuiButtonEmpty, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { AlertsBadge } from '../../alerts/badge'; diff --git a/x-pack/plugins/monitoring/public/components/cluster/listing/listing.js b/x-pack/plugins/monitoring/public/components/cluster/listing/listing.js index 06a480cd30f18..42a08d65b6118 100644 --- a/x-pack/plugins/monitoring/public/components/cluster/listing/listing.js +++ b/x-pack/plugins/monitoring/public/components/cluster/listing/listing.js @@ -22,7 +22,7 @@ import { EuiToolTip, } from '@elastic/eui'; import { EuiMonitoringTable } from '../../table'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { toMountPoint } from '../../../../../../../src/plugins/kibana_react/public'; import { AlertsStatus } from '../../../alerts/status'; diff --git a/x-pack/plugins/monitoring/public/components/cluster/overview/apm_panel.js b/x-pack/plugins/monitoring/public/components/cluster/overview/apm_panel.js index 5499f842939c4..2a2e6719ab268 100644 --- a/x-pack/plugins/monitoring/public/components/cluster/overview/apm_panel.js +++ b/x-pack/plugins/monitoring/public/components/cluster/overview/apm_panel.js @@ -10,7 +10,7 @@ import moment from 'moment'; import { get } from 'lodash'; import { formatMetric } from '../../../lib/format_number'; import { ClusterItemContainer, BytesUsage, DisabledIfNoDataAndInSetupModeLink } from './helpers'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiFlexGrid, diff --git a/x-pack/plugins/monitoring/public/components/cluster/overview/beats_panel.js b/x-pack/plugins/monitoring/public/components/cluster/overview/beats_panel.js index c882497ea04ea..87d103b43b34a 100644 --- a/x-pack/plugins/monitoring/public/components/cluster/overview/beats_panel.js +++ b/x-pack/plugins/monitoring/public/components/cluster/overview/beats_panel.js @@ -21,7 +21,7 @@ import { EuiFlexGroup, } from '@elastic/eui'; import { ClusterItemContainer, DisabledIfNoDataAndInSetupModeLink } from './helpers'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { SetupModeTooltip } from '../../setup_mode/tooltip'; import { BEATS_SYSTEM_ID } from '../../../../common/constants'; diff --git a/x-pack/plugins/monitoring/public/components/cluster/overview/elasticsearch_panel.js b/x-pack/plugins/monitoring/public/components/cluster/overview/elasticsearch_panel.js index 85211008ff7d8..d889f5ff4c5d7 100644 --- a/x-pack/plugins/monitoring/public/components/cluster/overview/elasticsearch_panel.js +++ b/x-pack/plugins/monitoring/public/components/cluster/overview/elasticsearch_panel.js @@ -32,7 +32,7 @@ import { EuiText, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Reason } from '../../logs/reason'; import { SetupModeTooltip } from '../../setup_mode/tooltip'; import { getSafeForExternalLink } from '../../../lib/get_safe_for_external_link'; diff --git a/x-pack/plugins/monitoring/public/components/cluster/overview/index.js b/x-pack/plugins/monitoring/public/components/cluster/overview/index.js index 9dea004e17b50..aa6181ffb9c54 100644 --- a/x-pack/plugins/monitoring/public/components/cluster/overview/index.js +++ b/x-pack/plugins/monitoring/public/components/cluster/overview/index.js @@ -12,7 +12,7 @@ import { LogstashPanel } from './logstash_panel'; import { BeatsPanel } from './beats_panel'; import { EuiPage, EuiPageBody, EuiScreenReaderOnly } from '@elastic/eui'; import { ApmPanel } from './apm_panel'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { STANDALONE_CLUSTER_CLUSTER_UUID } from '../../../../common/constants'; export function Overview(props) { diff --git a/x-pack/plugins/monitoring/public/components/cluster/overview/kibana_panel.js b/x-pack/plugins/monitoring/public/components/cluster/overview/kibana_panel.js index 654ef6590a064..ca2eefe440a0a 100644 --- a/x-pack/plugins/monitoring/public/components/cluster/overview/kibana_panel.js +++ b/x-pack/plugins/monitoring/public/components/cluster/overview/kibana_panel.js @@ -26,7 +26,7 @@ import { EuiDescriptionListDescription, EuiHorizontalRule, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { SetupModeTooltip } from '../../setup_mode/tooltip'; import { KIBANA_SYSTEM_ID, RULE_KIBANA_VERSION_MISMATCH } from '../../../../common/constants'; diff --git a/x-pack/plugins/monitoring/public/components/cluster/overview/logstash_panel.js b/x-pack/plugins/monitoring/public/components/cluster/overview/logstash_panel.js index 217bd1d24ff0e..48b127774aca7 100644 --- a/x-pack/plugins/monitoring/public/components/cluster/overview/logstash_panel.js +++ b/x-pack/plugins/monitoring/public/components/cluster/overview/logstash_panel.js @@ -31,7 +31,7 @@ import { EuiHorizontalRule, EuiIconTip, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { get } from 'lodash'; import { SetupModeTooltip } from '../../setup_mode/tooltip'; diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/ccr/ccr.js b/x-pack/plugins/monitoring/public/components/elasticsearch/ccr/ccr.js index 3626393a8e4a3..b398eb5904efc 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/ccr/ccr.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/ccr/ccr.js @@ -18,7 +18,7 @@ import { EuiTextColor, EuiScreenReaderOnly, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { getSafeForExternalLink } from '../../../lib/get_safe_for_external_link'; import { AlertsStatus } from '../../../alerts/status'; diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/ccr_shard/ccr_shard.js b/x-pack/plugins/monitoring/public/components/elasticsearch/ccr_shard/ccr_shard.js index 9765d83e31f41..41663bc0e4e72 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/ccr_shard/ccr_shard.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/ccr_shard/ccr_shard.js @@ -24,7 +24,7 @@ import { import { MonitoringTimeseriesContainer } from '../../chart'; import { Status } from './status'; import { formatDateTimeLocal } from '../../../../common/formatting'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { AlertsCallout } from '../../../alerts/callout'; diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/index/advanced.js b/x-pack/plugins/monitoring/public/components/elasticsearch/index/advanced.js index ed86a4bb58048..50734a5ff0fad 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/index/advanced.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/index/advanced.js @@ -18,7 +18,7 @@ import { } from '@elastic/eui'; import { IndexDetailStatus } from '../index_detail_status'; import { MonitoringTimeseriesContainer } from '../../chart'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { AlertsCallout } from '../../../alerts/callout'; export const AdvancedIndex = ({ indexSummary, metrics, alerts, ...props }) => { diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/index_detail_status/index.js b/x-pack/plugins/monitoring/public/components/elasticsearch/index_detail_status/index.js index 68ebcf2477ab3..923ae1b690dd5 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/index_detail_status/index.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/index_detail_status/index.js @@ -9,7 +9,7 @@ import React, { Fragment } from 'react'; import { SummaryStatus } from '../../summary_status'; import { ElasticsearchStatusIcon } from '../status_icon'; import { formatMetric } from '../../../lib/format_number'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { AlertsStatus } from '../../../alerts/status'; diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/indices/indices.js b/x-pack/plugins/monitoring/public/components/elasticsearch/indices/indices.js index a5d284c17bd24..f22d273daf7b3 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/indices/indices.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/indices/indices.js @@ -24,7 +24,7 @@ import { EuiScreenReaderOnly, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { AlertsStatus } from '../../../alerts/status'; import './indices.scss'; diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/ml_jobs/ml_jobs.tsx b/x-pack/plugins/monitoring/public/components/elasticsearch/ml_jobs/ml_jobs.tsx index dba9c40fabb2b..cd40688ab327c 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/ml_jobs/ml_jobs.tsx +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/ml_jobs/ml_jobs.tsx @@ -19,7 +19,7 @@ import { EuiTableSortingType, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { LARGE_ABBREVIATED, LARGE_BYTES } from '../../../../common/formatting'; import { getSafeForExternalLink } from '../../../lib/get_safe_for_external_link'; diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/node/advanced.js b/x-pack/plugins/monitoring/public/components/elasticsearch/node/advanced.js index 30ddcf09ede26..cda725d0945cd 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/node/advanced.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/node/advanced.js @@ -18,7 +18,7 @@ import { } from '@elastic/eui'; import { NodeDetailStatus } from '../node_detail_status'; import { MonitoringTimeseriesContainer } from '../../chart'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { AlertsCallout } from '../../../alerts/callout'; export const AdvancedNode = ({ nodeSummary, metrics, alerts, ...props }) => { diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/node/node.js b/x-pack/plugins/monitoring/public/components/elasticsearch/node/node.js index 0f545de7960d5..9905c9ba8a9a3 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/node/node.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/node/node.js @@ -16,7 +16,7 @@ import { EuiPanel, EuiScreenReaderOnly, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { NodeDetailStatus } from '../node_detail_status'; import { Logs } from '../../logs'; import { MonitoringTimeseriesContainer } from '../../chart'; diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js b/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js index 987422c2e8bb3..9eced6d699907 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/nodes/nodes.js @@ -30,7 +30,7 @@ import { import { i18n } from '@kbn/i18n'; import { get } from 'lodash'; import { ELASTICSEARCH_SYSTEM_ID } from '../../../../common/constants'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ListingCallOut } from '../../setup_mode/listing_callout'; import { AlertsStatus } from '../../../alerts/status'; import { isSetupModeFeatureEnabled } from '../../../lib/setup_mode'; diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/progress.js b/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/progress.js index b6ed306dd35ff..2d28963483da1 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/progress.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/progress.js @@ -6,7 +6,7 @@ */ import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const FilesProgress = ({ filesPercent, filesDone, filesTotal }) => { return ( diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/recovery_index.js b/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/recovery_index.js index d3f25ca15783b..6e7dd581103f4 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/recovery_index.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/recovery_index.js @@ -8,7 +8,7 @@ import React from 'react'; import { EuiLink } from '@elastic/eui'; import { Snapshot } from './snapshot'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { getSafeForExternalLink } from '../../../lib/get_safe_for_external_link'; export const RecoveryIndex = (props) => { diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/shard_activity.js b/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/shard_activity.js index e55cb793574a9..b749e31226994 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/shard_activity.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/shard_activity.js @@ -14,7 +14,7 @@ import { SourceDestination } from './source_destination'; import { FilesProgress, BytesProgress, TranslogProgress } from './progress'; import { parseProps } from './parse_props'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; const columns = [ diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/snapshot.js b/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/snapshot.js index 9601857e4f9be..ac060bb5addd1 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/snapshot.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/snapshot.js @@ -6,7 +6,7 @@ */ import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const Snapshot = ({ isSnapshot, repo, snapshot }) => { return isSnapshot ? ( diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/source_tooltip.js b/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/source_tooltip.js index b1119cb103829..23f4d05aae1f8 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/source_tooltip.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/source_tooltip.js @@ -7,7 +7,7 @@ import React, { Fragment } from 'react'; import { EuiLink, EuiToolTip } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const SourceTooltip = ({ isCopiedFromPrimary, sourceTransportAddress, children }) => { if (!sourceTransportAddress) { diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/total_time.js b/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/total_time.js index d9032eaef25a8..bf6fc67e414f2 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/total_time.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/shard_activity/total_time.js @@ -7,7 +7,7 @@ import React from 'react'; import { EuiLink, EuiToolTip } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const TotalTime = ({ startTime, totalTime }) => { return ( diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/shard_allocation/components/table_body.js b/x-pack/plugins/monitoring/public/components/elasticsearch/shard_allocation/components/table_body.js index 2f214198c17c2..707aeb6f79f89 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/shard_allocation/components/table_body.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/shard_allocation/components/table_body.js @@ -8,7 +8,7 @@ import React from 'react'; import { Unassigned } from './unassigned'; import { Assigned } from './assigned'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; const ShardRow = (props) => { diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/shard_allocation/components/table_head.js b/x-pack/plugins/monitoring/public/components/elasticsearch/shard_allocation/components/table_head.js index b5316bb624a80..29934ec6c55c2 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/shard_allocation/components/table_head.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/shard_allocation/components/table_head.js @@ -8,7 +8,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { EuiFlexGroup, EuiFlexItem, EuiSwitch } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; class IndexLabel extends React.Component { constructor(props) { diff --git a/x-pack/plugins/monitoring/public/components/elasticsearch/shard_allocation/shard_allocation.js b/x-pack/plugins/monitoring/public/components/elasticsearch/shard_allocation/shard_allocation.js index 1c9021aeedf74..1ac8a66fba75c 100644 --- a/x-pack/plugins/monitoring/public/components/elasticsearch/shard_allocation/shard_allocation.js +++ b/x-pack/plugins/monitoring/public/components/elasticsearch/shard_allocation/shard_allocation.js @@ -7,7 +7,7 @@ import React from 'react'; import { EuiTitle, EuiBadge, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import './shard_allocation.scss'; import { ClusterView } from './components/cluster_view'; diff --git a/x-pack/plugins/monitoring/public/components/kibana/instances/instances.tsx b/x-pack/plugins/monitoring/public/components/kibana/instances/instances.tsx index 3766a09f91b80..e0290bbdb13f8 100644 --- a/x-pack/plugins/monitoring/public/components/kibana/instances/instances.tsx +++ b/x-pack/plugins/monitoring/public/components/kibana/instances/instances.tsx @@ -19,7 +19,7 @@ import { EuiHealth, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { capitalize, get } from 'lodash'; // @ts-ignore import { ClusterStatus } from '../cluster_status'; diff --git a/x-pack/plugins/monitoring/public/components/license/index.tsx b/x-pack/plugins/monitoring/public/components/license/index.tsx index 766f0af3bccc8..9b45cc4b23a14 100644 --- a/x-pack/plugins/monitoring/public/components/license/index.tsx +++ b/x-pack/plugins/monitoring/public/components/license/index.tsx @@ -24,7 +24,7 @@ import { EuiTextAlign, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Legacy } from '../../legacy_shims'; interface AddLicenseProps { diff --git a/x-pack/plugins/monitoring/public/components/logs/logs.js b/x-pack/plugins/monitoring/public/components/logs/logs.js index 52c1c1373caf5..680e82f6b6e16 100644 --- a/x-pack/plugins/monitoring/public/components/logs/logs.js +++ b/x-pack/plugins/monitoring/public/components/logs/logs.js @@ -12,7 +12,7 @@ import { EuiBasicTable, EuiTitle, EuiSpacer, EuiText, EuiCallOut, EuiLink } from import { INFRA_SOURCE_ID } from '../../../common/constants'; import { formatDateTimeLocal } from '../../../common/formatting'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Reason } from './reason'; const getFormattedDateTimeLocal = (timestamp) => { diff --git a/x-pack/plugins/monitoring/public/components/logs/reason.js b/x-pack/plugins/monitoring/public/components/logs/reason.js index 512b44c8165b1..4444c818d5cce 100644 --- a/x-pack/plugins/monitoring/public/components/logs/reason.js +++ b/x-pack/plugins/monitoring/public/components/logs/reason.js @@ -8,7 +8,7 @@ import React from 'react'; import { EuiCallOut, EuiLink } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Legacy } from '../../legacy_shims'; import { Monospace } from '../metricbeat_migration/instruction_steps/components/monospace/monospace'; diff --git a/x-pack/plugins/monitoring/public/components/logstash/listing/listing.js b/x-pack/plugins/monitoring/public/components/logstash/listing/listing.js index ddf6a7d7382a2..e7ebb4d495f02 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/listing/listing.js +++ b/x-pack/plugins/monitoring/public/components/logstash/listing/listing.js @@ -19,7 +19,7 @@ import { import { formatPercentageUsage, formatNumber } from '../../../lib/format_number'; import { ClusterStatus } from '../cluster_status'; import { EuiMonitoringTable } from '../../table'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { LOGSTASH_SYSTEM_ID } from '../../../../common/constants'; import { SetupModeBadge } from '../../setup_mode/badge'; diff --git a/x-pack/plugins/monitoring/public/components/logstash/overview/overview.js b/x-pack/plugins/monitoring/public/components/logstash/overview/overview.js index 4590be3114708..142152ad47c7f 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/overview/overview.js +++ b/x-pack/plugins/monitoring/public/components/logstash/overview/overview.js @@ -18,7 +18,7 @@ import { } from '@elastic/eui'; import { ClusterStatus } from '../cluster_status'; import { MonitoringTimeseriesContainer } from '../../chart'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export class Overview extends PureComponent { render() { diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_listing/pipeline_listing.js b/x-pack/plugins/monitoring/public/components/logstash/pipeline_listing/pipeline_listing.js index 067f2b56937f8..4bf4990553837 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_listing/pipeline_listing.js +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_listing/pipeline_listing.js @@ -24,7 +24,7 @@ import { ClusterStatus } from '../cluster_status'; import { Sparkline } from '../../../components/sparkline'; import { EuiMonitoringSSPTable } from '../../table'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { getSafeForExternalLink } from '../../../lib/get_safe_for_external_link'; export class PipelineListing extends Component { diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/detail_drawer.js b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/detail_drawer.js index 9da03fbb7bba0..3141c633424f4 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/detail_drawer.js +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/detail_drawer.js @@ -26,7 +26,7 @@ import { } from '@elastic/eui'; import { Sparkline } from '../../../sparkline'; import { formatMetric } from '../../../../lib/format_number'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import './detail_drawer.scss'; function renderIcon(vertex) { diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/pipeline_viewer.js b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/pipeline_viewer.js index 0fb1c8bf51b1a..4bd9cb275a853 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/pipeline_viewer.js +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/pipeline_viewer.js @@ -12,7 +12,7 @@ import { Queue } from './queue'; import { StatementSection } from './statement_section'; import { i18n } from '@kbn/i18n'; import { EuiSpacer, EuiPage, EuiPageContent, EuiPageBody, EuiScreenReaderOnly } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export class PipelineViewer extends React.Component { constructor() { diff --git a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/queue.js b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/queue.js index 61bf3e854b9ac..8b138da7dd012 100644 --- a/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/queue.js +++ b/x-pack/plugins/monitoring/public/components/logstash/pipeline_viewer/views/queue.js @@ -8,7 +8,7 @@ import React from 'react'; import { StatementListHeading } from './statement_list_heading'; import { EuiSpacer, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import './queue.scss'; export function Queue() { diff --git a/x-pack/plugins/monitoring/public/components/metricbeat_migration/flyout/flyout.js b/x-pack/plugins/monitoring/public/components/metricbeat_migration/flyout/flyout.js index eaa4c0c4288b1..0c99bf6f3e2f0 100644 --- a/x-pack/plugins/monitoring/public/components/metricbeat_migration/flyout/flyout.js +++ b/x-pack/plugins/monitoring/public/components/metricbeat_migration/flyout/flyout.js @@ -34,7 +34,7 @@ import { KIBANA_SYSTEM_ID, } from '../../../../common/constants'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { INSTRUCTION_STEP_SET_MONITORING_URL, INSTRUCTION_STEP_ENABLE_METRICBEAT, diff --git a/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/disable_internal_collection_instructions.js b/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/disable_internal_collection_instructions.js index 4264afcbf1dfb..298aacf2cdd49 100644 --- a/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/disable_internal_collection_instructions.js +++ b/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/disable_internal_collection_instructions.js @@ -9,7 +9,7 @@ import { i18n } from '@kbn/i18n'; import React, { Fragment } from 'react'; import { EuiSpacer, EuiCodeBlock, EuiText } from '@elastic/eui'; import { Monospace } from '../components/monospace'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { getDisableStatusStep } from '../common_instructions'; export function getApmInstructionsForDisablingInternalCollection(product, meta) { diff --git a/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/enable_metricbeat_instructions.js b/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/enable_metricbeat_instructions.js index a0b5468cb9c77..55afaf131af04 100644 --- a/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/enable_metricbeat_instructions.js +++ b/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/apm/enable_metricbeat_instructions.js @@ -9,7 +9,7 @@ import { i18n } from '@kbn/i18n'; import React, { Fragment } from 'react'; import { EuiSpacer, EuiCodeBlock, EuiLink, EuiText } from '@elastic/eui'; import { Monospace } from '../components/monospace'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Legacy } from '../../../../legacy_shims'; import { getMigrationStatusStep, getSecurityStep } from '../common_instructions'; diff --git a/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/disable_internal_collection_instructions.js b/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/disable_internal_collection_instructions.js index c94aad2ea4157..139a3c9f3a83d 100644 --- a/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/disable_internal_collection_instructions.js +++ b/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/disable_internal_collection_instructions.js @@ -9,7 +9,7 @@ import { i18n } from '@kbn/i18n'; import React, { Fragment } from 'react'; import { EuiSpacer, EuiCodeBlock, EuiText } from '@elastic/eui'; import { Monospace } from '../components/monospace'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { UNDETECTED_BEAT_TYPE } from './common_beats_instructions'; import { getDisableStatusStep } from '../common_instructions'; diff --git a/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/enable_metricbeat_instructions.js b/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/enable_metricbeat_instructions.js index c2fad15cd7c75..cbb5c35b81af0 100644 --- a/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/enable_metricbeat_instructions.js +++ b/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/beats/enable_metricbeat_instructions.js @@ -9,7 +9,7 @@ import { i18n } from '@kbn/i18n'; import React, { Fragment } from 'react'; import { EuiSpacer, EuiCodeBlock, EuiLink, EuiCallOut, EuiText } from '@elastic/eui'; import { Monospace } from '../components/monospace'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { UNDETECTED_BEAT_TYPE } from './common_beats_instructions'; import { Legacy } from '../../../../legacy_shims'; import { getMigrationStatusStep, getSecurityStep } from '../common_instructions'; diff --git a/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/common_instructions.js b/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/common_instructions.js index dad956f0f81c2..36f6a85d8458e 100644 --- a/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/common_instructions.js +++ b/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/common_instructions.js @@ -7,7 +7,7 @@ import React, { Fragment } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCallOut, EuiSpacer, EuiText, EuiLink } from '@elastic/eui'; import { CALCULATE_DURATION_SINCE } from '../../../../common/constants'; import { formatTimestampToDuration } from '../../../../common'; diff --git a/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/elasticsearch/disable_internal_collection_instructions.js b/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/elasticsearch/disable_internal_collection_instructions.js index 362a6554f8161..65bf5c31c49a8 100644 --- a/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/elasticsearch/disable_internal_collection_instructions.js +++ b/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/elasticsearch/disable_internal_collection_instructions.js @@ -9,7 +9,7 @@ import { i18n } from '@kbn/i18n'; import React, { Fragment } from 'react'; import { EuiSpacer, EuiCodeBlock, EuiText } from '@elastic/eui'; import { Monospace } from '../components/monospace'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { getDisableStatusStep } from '../common_instructions'; export function getElasticsearchInstructionsForDisablingInternalCollection(product, meta) { diff --git a/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/elasticsearch/enable_metricbeat_instructions.js b/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/elasticsearch/enable_metricbeat_instructions.js index efd81cb7a4ae2..17b2c5f22b6b4 100644 --- a/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/elasticsearch/enable_metricbeat_instructions.js +++ b/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/elasticsearch/enable_metricbeat_instructions.js @@ -9,7 +9,7 @@ import { i18n } from '@kbn/i18n'; import React, { Fragment } from 'react'; import { EuiSpacer, EuiCodeBlock, EuiLink, EuiText } from '@elastic/eui'; import { Monospace } from '../components/monospace'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Legacy } from '../../../../legacy_shims'; import { getSecurityStep, getMigrationStatusStep } from '../common_instructions'; diff --git a/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/disable_internal_collection_instructions.js b/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/disable_internal_collection_instructions.js index 4f2ca69f303a1..b67d2ec490b85 100644 --- a/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/disable_internal_collection_instructions.js +++ b/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/disable_internal_collection_instructions.js @@ -9,7 +9,7 @@ import { i18n } from '@kbn/i18n'; import React, { Fragment } from 'react'; import { EuiSpacer, EuiCodeBlock, EuiCallOut, EuiText } from '@elastic/eui'; import { Monospace } from '../components/monospace'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { getDisableStatusStep } from '../common_instructions'; export function getKibanaInstructionsForDisablingInternalCollection(product, meta) { diff --git a/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/enable_metricbeat_instructions.js b/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/enable_metricbeat_instructions.js index 438dc4be27343..3197ef4aea91e 100644 --- a/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/enable_metricbeat_instructions.js +++ b/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/kibana/enable_metricbeat_instructions.js @@ -9,7 +9,7 @@ import { i18n } from '@kbn/i18n'; import React, { Fragment } from 'react'; import { EuiSpacer, EuiCodeBlock, EuiLink, EuiText } from '@elastic/eui'; import { Monospace } from '../components/monospace'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Legacy } from '../../../../legacy_shims'; import { getMigrationStatusStep, getSecurityStep } from '../common_instructions'; diff --git a/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/disable_internal_collection_instructions.js b/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/disable_internal_collection_instructions.js index e80039929ab74..7ccac01f9bf94 100644 --- a/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/disable_internal_collection_instructions.js +++ b/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/disable_internal_collection_instructions.js @@ -9,7 +9,7 @@ import { i18n } from '@kbn/i18n'; import React, { Fragment } from 'react'; import { EuiSpacer, EuiCodeBlock, EuiText } from '@elastic/eui'; import { Monospace } from '../components/monospace'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { getDisableStatusStep } from '../common_instructions'; export function getLogstashInstructionsForDisablingInternalCollection(product, meta) { diff --git a/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/enable_metricbeat_instructions.js b/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/enable_metricbeat_instructions.js index 1b49f328b2009..a684252076a7f 100644 --- a/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/enable_metricbeat_instructions.js +++ b/x-pack/plugins/monitoring/public/components/metricbeat_migration/instruction_steps/logstash/enable_metricbeat_instructions.js @@ -9,7 +9,7 @@ import { i18n } from '@kbn/i18n'; import React, { Fragment } from 'react'; import { EuiSpacer, EuiCodeBlock, EuiLink, EuiText } from '@elastic/eui'; import { Monospace } from '../components/monospace'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Legacy } from '../../../../legacy_shims'; import { getMigrationStatusStep, getSecurityStep } from '../common_instructions'; diff --git a/x-pack/plugins/monitoring/public/components/no_data/blurbs/changes_needed.js b/x-pack/plugins/monitoring/public/components/no_data/blurbs/changes_needed.js index 7f3922f39840d..a62387f457220 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/blurbs/changes_needed.js +++ b/x-pack/plugins/monitoring/public/components/no_data/blurbs/changes_needed.js @@ -7,7 +7,7 @@ import React, { Fragment } from 'react'; import { EuiTitle, EuiText, EuiTextColor } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const ChangesNeeded = () => { return ( diff --git a/x-pack/plugins/monitoring/public/components/no_data/blurbs/cloud_deployment.js b/x-pack/plugins/monitoring/public/components/no_data/blurbs/cloud_deployment.js index 2fe0fd0d86069..5593b76ab97a9 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/blurbs/cloud_deployment.js +++ b/x-pack/plugins/monitoring/public/components/no_data/blurbs/cloud_deployment.js @@ -7,7 +7,7 @@ import React from 'react'; import { EuiText, EuiTextColor, EuiLink } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Legacy } from '../../../legacy_shims'; export const CloudDeployment = () => { diff --git a/x-pack/plugins/monitoring/public/components/no_data/blurbs/looking_for.js b/x-pack/plugins/monitoring/public/components/no_data/blurbs/looking_for.js index 73ac130d081d2..58c814fb206f4 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/blurbs/looking_for.js +++ b/x-pack/plugins/monitoring/public/components/no_data/blurbs/looking_for.js @@ -7,7 +7,7 @@ import React, { Fragment } from 'react'; import { EuiTitle, EuiText, EuiTextColor } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const LookingFor = () => { return ( diff --git a/x-pack/plugins/monitoring/public/components/no_data/blurbs/what_is.js b/x-pack/plugins/monitoring/public/components/no_data/blurbs/what_is.js index 658fbda064fa5..2dd80cfc1f296 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/blurbs/what_is.js +++ b/x-pack/plugins/monitoring/public/components/no_data/blurbs/what_is.js @@ -7,7 +7,7 @@ import React, { Fragment } from 'react'; import { EuiTitle, EuiText, EuiTextColor } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const WhatIs = () => { return ( diff --git a/x-pack/plugins/monitoring/public/components/no_data/checker_errors.js b/x-pack/plugins/monitoring/public/components/no_data/checker_errors.js index 3bb86a7bab5c5..9869f174635e7 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/checker_errors.js +++ b/x-pack/plugins/monitoring/public/components/no_data/checker_errors.js @@ -14,7 +14,7 @@ import { EuiDescriptionListDescription, EuiSpacer, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; const ErrorList = ({ errors }) => { const errorsMap = {}; diff --git a/x-pack/plugins/monitoring/public/components/no_data/checking_settings.js b/x-pack/plugins/monitoring/public/components/no_data/checking_settings.js index d55f2587950af..c755a2ea19f0c 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/checking_settings.js +++ b/x-pack/plugins/monitoring/public/components/no_data/checking_settings.js @@ -9,7 +9,7 @@ import React, { Fragment } from 'react'; import PropTypes from 'prop-types'; import { EuiHorizontalRule, EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner } from '@elastic/eui'; import { LookingFor } from './blurbs'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function CheckingSettings({ checkMessage }) { const message = checkMessage || ( diff --git a/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_enabled/collection_enabled.js b/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_enabled/collection_enabled.js index 857a1abe87e86..6d7c6c28f9e97 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_enabled/collection_enabled.js +++ b/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_enabled/collection_enabled.js @@ -19,7 +19,7 @@ import { EuiTitle, } from '@elastic/eui'; import { WhatIs } from '../../blurbs'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export class ExplainCollectionEnabled extends React.Component { constructor(props) { diff --git a/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/collection_interval.js b/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/collection_interval.js index be2641622847f..371cdacb12c67 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/collection_interval.js +++ b/x-pack/plugins/monitoring/public/components/no_data/explanations/collection_interval/collection_interval.js @@ -19,7 +19,7 @@ import { EuiTitle, } from '@elastic/eui'; import { WhatIs } from '../../blurbs'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export class ExplainCollectionInterval extends React.Component { constructor(props) { diff --git a/x-pack/plugins/monitoring/public/components/no_data/explanations/exporters/exporters.js b/x-pack/plugins/monitoring/public/components/no_data/explanations/exporters/exporters.js index e51b8ac7b29e4..193bb60e4e63d 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/explanations/exporters/exporters.js +++ b/x-pack/plugins/monitoring/public/components/no_data/explanations/exporters/exporters.js @@ -9,7 +9,7 @@ import React, { Fragment } from 'react'; import PropTypes from 'prop-types'; import { EuiCode, EuiText, EuiHorizontalRule } from '@elastic/eui'; import { ChangesNeeded, CloudDeployment } from '../../blurbs'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function ExplainExporters({ reason }) { const { context, property, data } = reason; diff --git a/x-pack/plugins/monitoring/public/components/no_data/explanations/plugin_enabled/plugin_enabled.js b/x-pack/plugins/monitoring/public/components/no_data/explanations/plugin_enabled/plugin_enabled.js index f36da67225fe5..4a45e2513fd38 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/explanations/plugin_enabled/plugin_enabled.js +++ b/x-pack/plugins/monitoring/public/components/no_data/explanations/plugin_enabled/plugin_enabled.js @@ -9,7 +9,7 @@ import React, { Fragment } from 'react'; import PropTypes from 'prop-types'; import { EuiCode, EuiText, EuiHorizontalRule } from '@elastic/eui'; import { ChangesNeeded } from '../../blurbs'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function ExplainPluginEnabled({ reason }) { const { context, property, data } = reason; diff --git a/x-pack/plugins/monitoring/public/components/no_data/no_data.js b/x-pack/plugins/monitoring/public/components/no_data/no_data.js index 2effc4187233d..e3f39ac7e66fd 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/no_data.js +++ b/x-pack/plugins/monitoring/public/components/no_data/no_data.js @@ -23,7 +23,7 @@ import { EuiButtonEmpty, EuiScreenReaderOnly, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { toggleSetupMode } from '../../lib/setup_mode'; import { CheckingSettings } from './checking_settings'; import { ReasonFound, WeTried } from './reasons'; diff --git a/x-pack/plugins/monitoring/public/components/no_data/reasons/reason_found.js b/x-pack/plugins/monitoring/public/components/no_data/reasons/reason_found.js index a1aec5af3139a..578cfe9ae0674 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/reasons/reason_found.js +++ b/x-pack/plugins/monitoring/public/components/no_data/reasons/reason_found.js @@ -15,7 +15,7 @@ import { ExplainExportersCloud, ExplainPluginEnabled, } from '../explanations'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; const ExplainWhyNoData = (props) => { const { reason } = props; diff --git a/x-pack/plugins/monitoring/public/components/no_data/reasons/we_tried.js b/x-pack/plugins/monitoring/public/components/no_data/reasons/we_tried.js index 37504f5842a74..abfd2fc4433e7 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/reasons/we_tried.js +++ b/x-pack/plugins/monitoring/public/components/no_data/reasons/we_tried.js @@ -7,7 +7,7 @@ import React from 'react'; import { EuiText, EuiHorizontalRule, EuiTitle } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function WeTried() { return ( diff --git a/x-pack/plugins/monitoring/public/components/page_loading/index.tsx b/x-pack/plugins/monitoring/public/components/page_loading/index.tsx index e7535fc3dc859..383266c62c5f6 100644 --- a/x-pack/plugins/monitoring/public/components/page_loading/index.tsx +++ b/x-pack/plugins/monitoring/public/components/page_loading/index.tsx @@ -14,7 +14,7 @@ import { EuiFlexItem, EuiLoadingSpinner, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import './page_loading.scss'; import { useTrackPageview } from '../../../../observability/public'; diff --git a/x-pack/plugins/monitoring/public/components/renderers/setup_mode.js b/x-pack/plugins/monitoring/public/components/renderers/setup_mode.js index cfa57559d2bc9..2080d3003b9cb 100644 --- a/x-pack/plugins/monitoring/public/components/renderers/setup_mode.js +++ b/x-pack/plugins/monitoring/public/components/renderers/setup_mode.js @@ -26,7 +26,7 @@ import { } from '@elastic/eui'; import { findNewUuid } from './lib/find_new_uuid'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { GlobalStateContext } from '../../application/contexts/global_state_context'; import { withKibana } from '../../../../../../src/plugins/kibana_react/public'; import { useRequestErrorHandler } from '../../application/hooks/use_request_error_handler'; diff --git a/x-pack/plugins/monitoring/public/components/summary_status/summary_status.js b/x-pack/plugins/monitoring/public/components/summary_status/summary_status.js index db4ac9098532b..951031b25da8b 100644 --- a/x-pack/plugins/monitoring/public/components/summary_status/summary_status.js +++ b/x-pack/plugins/monitoring/public/components/summary_status/summary_status.js @@ -12,7 +12,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiStat } from '@elastic/eui'; import { StatusIcon } from '../status_icon'; import { AlertsStatus } from '../../alerts/status'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import './summary_status.scss'; const wrapChild = ({ label, value, ...props }, index) => ( diff --git a/x-pack/plugins/monitoring/public/lib/ajax_error_handler.tsx b/x-pack/plugins/monitoring/public/lib/ajax_error_handler.tsx index 33bf10d59fb42..1fc7bb8cfc462 100644 --- a/x-pack/plugins/monitoring/public/lib/ajax_error_handler.tsx +++ b/x-pack/plugins/monitoring/public/lib/ajax_error_handler.tsx @@ -8,9 +8,9 @@ import React from 'react'; import { includes } from 'lodash'; import { EuiButton, EuiSpacer, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Legacy } from '../legacy_shims'; -import { formatMsg } from '../../../../../src/plugins/kibana_legacy/public'; +import { formatMsg } from './format_msg'; import { toMountPoint } from '../../../../../src/plugins/kibana_react/public'; export function formatMonitoringError(err: any) { diff --git a/x-pack/plugins/monitoring/public/lib/format_msg.test.ts b/x-pack/plugins/monitoring/public/lib/format_msg.test.ts new file mode 100644 index 0000000000000..0643e2a6f2b95 --- /dev/null +++ b/x-pack/plugins/monitoring/public/lib/format_msg.test.ts @@ -0,0 +1,122 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import expect from '@kbn/expect'; +import { formatMsg, formatESMsg } from './format_msg'; + +describe('formatMsg', () => { + test('should prepend the second argument to result', () => { + const actual = formatMsg('error message', 'unit_test'); + + expect(actual).to.equal('unit_test: error message'); + }); + + test('should handle a simple string', () => { + const actual = formatMsg('error message'); + + expect(actual).to.equal('error message'); + }); + + test('should handle a simple Error object', () => { + const err = new Error('error message'); + const actual = formatMsg(err); + + expect(actual).to.equal('error message'); + }); + + test('should handle a simple Angular $http error object', () => { + const err = { + data: { + statusCode: 403, + error: 'Forbidden', + message: + '[security_exception] action [indices:data/read/msearch] is unauthorized for user [user]', + }, + status: 403, + config: {}, + statusText: 'Forbidden', + }; + const actual = formatMsg(err); + + expect(actual).to.equal( + 'Error 403 Forbidden: [security_exception] action [indices:data/read/msearch] is unauthorized for user [user]' + ); + }); + + test('should handle an extended elasticsearch error', () => { + const err = { + resp: { + error: { + root_cause: [ + { + reason: 'I am the detailed message', + }, + ], + }, + }, + }; + + const actual = formatMsg(err); + + expect(actual).to.equal('I am the detailed message'); + }); + + describe('formatESMsg', () => { + test('should return undefined if passed a basic error', () => { + const err = new Error('This is a normal error'); + + const actual = formatESMsg(err); + + expect(actual).to.be(undefined); + }); + + test('should return undefined if passed a string', () => { + const err = 'This is a error string'; + + const actual = formatESMsg(err); + + expect(actual).to.be(undefined); + }); + + test('should return the root_cause if passed an extended elasticsearch', () => { + const err: Record = new Error('This is an elasticsearch error'); + err.resp = { + error: { + root_cause: [ + { + reason: 'I am the detailed message', + }, + ], + }, + }; + + const actual = formatESMsg(err); + + expect(actual).to.equal('I am the detailed message'); + }); + + test('should combine the reason messages if more than one is returned.', () => { + const err: Record = new Error('This is an elasticsearch error'); + err.resp = { + error: { + root_cause: [ + { + reason: 'I am the detailed message 1', + }, + { + reason: 'I am the detailed message 2', + }, + ], + }, + }; + + const actual = formatESMsg(err); + + expect(actual).to.equal('I am the detailed message 1\nI am the detailed message 2'); + }); + }); +}); diff --git a/x-pack/plugins/monitoring/public/lib/format_msg.ts b/x-pack/plugins/monitoring/public/lib/format_msg.ts new file mode 100644 index 0000000000000..97ba63546a9e4 --- /dev/null +++ b/x-pack/plugins/monitoring/public/lib/format_msg.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import _ from 'lodash'; +import { i18n } from '@kbn/i18n'; +const has = _.has; + +const getRootCause = (err: Record | string) => _.get(err, 'resp.error.root_cause'); + +/** + * Utilize the extended error information returned from elasticsearch + * @param {Error|String} err + * @returns {string} + */ +export const formatESMsg = (err: Record | string) => { + const rootCause = getRootCause(err); + + if (!Array.isArray(rootCause)) { + return; + } + + return rootCause.map((cause: Record) => cause.reason).join('\n'); +}; + +/** + * Formats the error message from an error object, extended elasticsearch + * object or simple string; prepends optional second parameter to the message + * @param {Error|String} err + * @param {String} source - Prefix for message indicating source (optional) + * @returns {string} + */ +export function formatMsg(err: Record | string, source: string = '') { + let message = ''; + if (source) { + message += source + ': '; + } + + const esMsg = formatESMsg(err); + + if (typeof err === 'string') { + message += err; + } else if (esMsg) { + message += esMsg; + } else if (err instanceof Error) { + message += formatMsg.describeError(err); + } else if (has(err, 'status') && has(err, 'data')) { + // is an Angular $http "error object" + if (err.status === -1) { + // status = -1 indicates that the request was failed to reach the server + message += i18n.translate( + 'xpack.monitoring.formatMsg.toaster.unavailableServerErrorMessage', + { + defaultMessage: + 'An HTTP request has failed to connect. ' + + 'Please check if the Kibana server is running and that your browser has a working connection, ' + + 'or contact your system administrator.', + } + ); + } else { + message += i18n.translate('xpack.monitoring.formatMsg.toaster.errorStatusMessage', { + defaultMessage: 'Error {errStatus} {errStatusText}: {errMessage}', + values: { + errStatus: err.status, + errStatusText: err.statusText, + errMessage: err.data.message, + }, + }); + } + } + + return message; +} + +formatMsg.describeError = function (err: Record) { + if (!err) return undefined; + if (err.shortMessage) return err.shortMessage; + if (err.body && err.body.message) return err.body.message; + if (err.message) return err.message; + return '' + err; +}; diff --git a/x-pack/plugins/monitoring/server/alerts/base_rule.ts b/x-pack/plugins/monitoring/server/alerts/base_rule.ts index 4a7e78f535253..51b779083bf4b 100644 --- a/x-pack/plugins/monitoring/server/alerts/base_rule.ts +++ b/x-pack/plugins/monitoring/server/alerts/base_rule.ts @@ -27,13 +27,12 @@ import { CommonAlertFilter, CommonAlertParams, } from '../../common/types/alerts'; -import { fetchAvailableCcs } from '../lib/alerts/fetch_available_ccs'; import { fetchClusters } from '../lib/alerts/fetch_clusters'; import { getCcsIndexPattern } from '../lib/alerts/get_ccs_index_pattern'; import { INDEX_PATTERN_ELASTICSEARCH } from '../../common/constants'; import { AlertSeverity } from '../../common/enums'; import { appendMetricbeatIndex } from '../lib/alerts/append_mb_index'; -import { parseDuration } from '../../../alerting/common/parse_duration'; +import { parseDuration } from '../../../alerting/common'; import { Globals } from '../static_globals'; type ExecutedState = @@ -125,8 +124,7 @@ export class BaseRule { }); if (existingRuleData.total > 0) { - const existingRule = existingRuleData.data[0] as Alert; - return existingRule; + return existingRuleData.data[0] as Alert; } const ruleActions = []; @@ -228,7 +226,7 @@ export class BaseRule { ); const esClient = services.scopedClusterClient.asCurrentUser; - const availableCcs = Globals.app.config.ui.ccs.enabled ? await fetchAvailableCcs(esClient) : []; + const availableCcs = Globals.app.config.ui.ccs.enabled; const clusters = await this.fetchClusters(esClient, params as CommonAlertParams, availableCcs); const data = await this.fetchData(params, esClient, clusters, availableCcs); return await this.processData(data, clusters, services, state); @@ -237,10 +235,10 @@ export class BaseRule { protected async fetchClusters( esClient: ElasticsearchClient, params: CommonAlertParams, - ccs?: string[] + ccs?: boolean ) { let esIndexPattern = appendMetricbeatIndex(Globals.app.config, INDEX_PATTERN_ELASTICSEARCH); - if (ccs?.length) { + if (ccs) { esIndexPattern = getCcsIndexPattern(esIndexPattern, ccs); } if (!params.limit) { @@ -262,7 +260,7 @@ export class BaseRule { params: CommonAlertParams | unknown, esClient: ElasticsearchClient, clusters: AlertCluster[], - availableCcs: string[] + availableCcs: boolean ): Promise> { throw new Error('Child classes must implement `fetchData`'); } diff --git a/x-pack/plugins/monitoring/server/alerts/ccr_read_exceptions_rule.ts b/x-pack/plugins/monitoring/server/alerts/ccr_read_exceptions_rule.ts index e3a3537ea2eaf..9b2f9b9fb3ed7 100644 --- a/x-pack/plugins/monitoring/server/alerts/ccr_read_exceptions_rule.ts +++ b/x-pack/plugins/monitoring/server/alerts/ccr_read_exceptions_rule.ts @@ -73,7 +73,7 @@ export class CCRReadExceptionsRule extends BaseRule { params: CommonAlertParams, esClient: ElasticsearchClient, clusters: AlertCluster[], - availableCcs: string[] + availableCcs: boolean ): Promise { let esIndexPattern = appendMetricbeatIndex(Globals.app.config, INDEX_PATTERN_ELASTICSEARCH); if (availableCcs) { diff --git a/x-pack/plugins/monitoring/server/alerts/cluster_health_rule.ts b/x-pack/plugins/monitoring/server/alerts/cluster_health_rule.ts index b9b9b90845eea..e85fb33cd76bd 100644 --- a/x-pack/plugins/monitoring/server/alerts/cluster_health_rule.ts +++ b/x-pack/plugins/monitoring/server/alerts/cluster_health_rule.ts @@ -67,7 +67,7 @@ export class ClusterHealthRule extends BaseRule { params: CommonAlertParams, esClient: ElasticsearchClient, clusters: AlertCluster[], - availableCcs: string[] + availableCcs: boolean ): Promise { let esIndexPattern = appendMetricbeatIndex(Globals.app.config, INDEX_PATTERN_ELASTICSEARCH); if (availableCcs) { diff --git a/x-pack/plugins/monitoring/server/alerts/cpu_usage_rule.ts b/x-pack/plugins/monitoring/server/alerts/cpu_usage_rule.ts index 7e38efcb819ea..b41783d449c02 100644 --- a/x-pack/plugins/monitoring/server/alerts/cpu_usage_rule.ts +++ b/x-pack/plugins/monitoring/server/alerts/cpu_usage_rule.ts @@ -61,7 +61,7 @@ export class CpuUsageRule extends BaseRule { params: CommonAlertParams, esClient: ElasticsearchClient, clusters: AlertCluster[], - availableCcs: string[] + availableCcs: boolean ): Promise { let esIndexPattern = appendMetricbeatIndex(Globals.app.config, INDEX_PATTERN_ELASTICSEARCH); if (availableCcs) { diff --git a/x-pack/plugins/monitoring/server/alerts/disk_usage_rule.ts b/x-pack/plugins/monitoring/server/alerts/disk_usage_rule.ts index bac70baebb4e2..17dff8ea6a9dd 100644 --- a/x-pack/plugins/monitoring/server/alerts/disk_usage_rule.ts +++ b/x-pack/plugins/monitoring/server/alerts/disk_usage_rule.ts @@ -60,7 +60,7 @@ export class DiskUsageRule extends BaseRule { params: CommonAlertParams, esClient: ElasticsearchClient, clusters: AlertCluster[], - availableCcs: string[] + availableCcs: boolean ): Promise { let esIndexPattern = appendMetricbeatIndex(Globals.app.config, INDEX_PATTERN_ELASTICSEARCH); if (availableCcs) { diff --git a/x-pack/plugins/monitoring/server/alerts/elasticsearch_version_mismatch_rule.ts b/x-pack/plugins/monitoring/server/alerts/elasticsearch_version_mismatch_rule.ts index 352cac531f8e8..b873a20c874b5 100644 --- a/x-pack/plugins/monitoring/server/alerts/elasticsearch_version_mismatch_rule.ts +++ b/x-pack/plugins/monitoring/server/alerts/elasticsearch_version_mismatch_rule.ts @@ -56,7 +56,7 @@ export class ElasticsearchVersionMismatchRule extends BaseRule { params: CommonAlertParams, esClient: ElasticsearchClient, clusters: AlertCluster[], - availableCcs: string[] + availableCcs: boolean ): Promise { let esIndexPattern = appendMetricbeatIndex(Globals.app.config, INDEX_PATTERN_ELASTICSEARCH); if (availableCcs) { diff --git a/x-pack/plugins/monitoring/server/alerts/kibana_version_mismatch_rule.ts b/x-pack/plugins/monitoring/server/alerts/kibana_version_mismatch_rule.ts index 6d9410ed0e5a0..79f449f8e7ef7 100644 --- a/x-pack/plugins/monitoring/server/alerts/kibana_version_mismatch_rule.ts +++ b/x-pack/plugins/monitoring/server/alerts/kibana_version_mismatch_rule.ts @@ -69,7 +69,7 @@ export class KibanaVersionMismatchRule extends BaseRule { params: CommonAlertParams, esClient: ElasticsearchClient, clusters: AlertCluster[], - availableCcs: string[] + availableCcs: boolean ): Promise { let kibanaIndexPattern = appendMetricbeatIndex(Globals.app.config, INDEX_PATTERN_KIBANA); if (availableCcs) { diff --git a/x-pack/plugins/monitoring/server/alerts/large_shard_size_rule.ts b/x-pack/plugins/monitoring/server/alerts/large_shard_size_rule.ts index b0370a23159d7..3009995e2f292 100644 --- a/x-pack/plugins/monitoring/server/alerts/large_shard_size_rule.ts +++ b/x-pack/plugins/monitoring/server/alerts/large_shard_size_rule.ts @@ -61,7 +61,7 @@ export class LargeShardSizeRule extends BaseRule { params: CommonAlertParams & { indexPattern: string }, esClient: ElasticsearchClient, clusters: AlertCluster[], - availableCcs: string[] + availableCcs: boolean ): Promise { let esIndexPattern = appendMetricbeatIndex(Globals.app.config, INDEX_PATTERN_ELASTICSEARCH); if (availableCcs) { diff --git a/x-pack/plugins/monitoring/server/alerts/license_expiration_rule.ts b/x-pack/plugins/monitoring/server/alerts/license_expiration_rule.ts index c26929b05ab26..fc050bd678012 100644 --- a/x-pack/plugins/monitoring/server/alerts/license_expiration_rule.ts +++ b/x-pack/plugins/monitoring/server/alerts/license_expiration_rule.ts @@ -81,7 +81,7 @@ export class LicenseExpirationRule extends BaseRule { params: CommonAlertParams, esClient: ElasticsearchClient, clusters: AlertCluster[], - availableCcs: string[] + availableCcs: boolean ): Promise { let esIndexPattern = appendMetricbeatIndex(Globals.app.config, INDEX_PATTERN_ELASTICSEARCH); if (availableCcs) { diff --git a/x-pack/plugins/monitoring/server/alerts/logstash_version_mismatch_rule.ts b/x-pack/plugins/monitoring/server/alerts/logstash_version_mismatch_rule.ts index e59ed9efbefb2..6d7c06c1c1e07 100644 --- a/x-pack/plugins/monitoring/server/alerts/logstash_version_mismatch_rule.ts +++ b/x-pack/plugins/monitoring/server/alerts/logstash_version_mismatch_rule.ts @@ -56,7 +56,7 @@ export class LogstashVersionMismatchRule extends BaseRule { params: CommonAlertParams, esClient: ElasticsearchClient, clusters: AlertCluster[], - availableCcs: string[] + availableCcs: boolean ): Promise { let logstashIndexPattern = appendMetricbeatIndex(Globals.app.config, INDEX_PATTERN_LOGSTASH); if (availableCcs) { diff --git a/x-pack/plugins/monitoring/server/alerts/memory_usage_rule.ts b/x-pack/plugins/monitoring/server/alerts/memory_usage_rule.ts index d94e1234ce813..25b12379f8d3a 100644 --- a/x-pack/plugins/monitoring/server/alerts/memory_usage_rule.ts +++ b/x-pack/plugins/monitoring/server/alerts/memory_usage_rule.ts @@ -65,7 +65,7 @@ export class MemoryUsageRule extends BaseRule { params: CommonAlertParams, esClient: ElasticsearchClient, clusters: AlertCluster[], - availableCcs: string[] + availableCcs: boolean ): Promise { let esIndexPattern = appendMetricbeatIndex(Globals.app.config, INDEX_PATTERN_ELASTICSEARCH); if (availableCcs) { diff --git a/x-pack/plugins/monitoring/server/alerts/missing_monitoring_data_rule.ts b/x-pack/plugins/monitoring/server/alerts/missing_monitoring_data_rule.ts index 1b45b19fe89f8..50ba9fa9e3586 100644 --- a/x-pack/plugins/monitoring/server/alerts/missing_monitoring_data_rule.ts +++ b/x-pack/plugins/monitoring/server/alerts/missing_monitoring_data_rule.ts @@ -60,7 +60,7 @@ export class MissingMonitoringDataRule extends BaseRule { params: CommonAlertParams, esClient: ElasticsearchClient, clusters: AlertCluster[], - availableCcs: string[] + availableCcs: boolean ): Promise { let indexPattern = appendMetricbeatIndex(Globals.app.config, INDEX_PATTERN); if (availableCcs) { diff --git a/x-pack/plugins/monitoring/server/alerts/nodes_changed_rule.ts b/x-pack/plugins/monitoring/server/alerts/nodes_changed_rule.ts index 6645466f30c73..545d6331d225e 100644 --- a/x-pack/plugins/monitoring/server/alerts/nodes_changed_rule.ts +++ b/x-pack/plugins/monitoring/server/alerts/nodes_changed_rule.ts @@ -105,7 +105,7 @@ export class NodesChangedRule extends BaseRule { params: CommonAlertParams, esClient: ElasticsearchClient, clusters: AlertCluster[], - availableCcs: string[] + availableCcs: boolean ): Promise { let esIndexPattern = appendMetricbeatIndex(Globals.app.config, INDEX_PATTERN_ELASTICSEARCH); if (availableCcs) { diff --git a/x-pack/plugins/monitoring/server/alerts/thread_pool_rejections_rule_base.ts b/x-pack/plugins/monitoring/server/alerts/thread_pool_rejections_rule_base.ts index 678f8b429167f..e6c2002eaff87 100644 --- a/x-pack/plugins/monitoring/server/alerts/thread_pool_rejections_rule_base.ts +++ b/x-pack/plugins/monitoring/server/alerts/thread_pool_rejections_rule_base.ts @@ -71,7 +71,7 @@ export class ThreadPoolRejectionsRuleBase extends BaseRule { params: ThreadPoolRejectionsAlertParams, esClient: ElasticsearchClient, clusters: AlertCluster[], - availableCcs: string[] + availableCcs: boolean ): Promise { let esIndexPattern = appendMetricbeatIndex(Globals.app.config, INDEX_PATTERN_ELASTICSEARCH); if (availableCcs) { diff --git a/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/get_usage_collector.ts b/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/get_usage_collector.ts index 558a79e03dcb7..4c454637bf8bb 100644 --- a/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/get_usage_collector.ts +++ b/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/get_usage_collector.ts @@ -8,7 +8,6 @@ import { UsageCollectionSetup } from 'src/plugins/usage_collection/server'; import { IClusterClient } from 'src/core/server'; import { MonitoringConfig } from '../../config'; -import { fetchAvailableCcs } from '../../lib/alerts/fetch_available_ccs'; import { getStackProductsUsage } from './lib/get_stack_products_usage'; import { fetchLicenseType } from './lib/fetch_license_type'; import { MonitoringUsage, StackProductUsage, MonitoringClusterStackProductUsage } from './types'; @@ -106,7 +105,7 @@ export function getMonitoringUsageCollector( ? getClient().asScoped(kibanaRequest).asCurrentUser : getClient().asInternalUser; const usageClusters: MonitoringClusterStackProductUsage[] = []; - const availableCcs = config.ui.ccs.enabled ? await fetchAvailableCcs(callCluster) : []; + const availableCcs = config.ui.ccs.enabled; const elasticsearchIndex = getCcsIndexPattern(INDEX_PATTERN_ELASTICSEARCH, availableCcs); const clusters = await fetchClusters(callCluster, elasticsearchIndex); for (const cluster of clusters) { @@ -127,12 +126,10 @@ export function getMonitoringUsageCollector( }); } - const usage = { + return { hasMonitoringData: usageClusters.length > 0, clusters: usageClusters, }; - - return usage; }, }); } diff --git a/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/lib/fetch_license_type.test.ts b/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/lib/fetch_license_type.test.ts index 89050963c9201..93e21072d0e34 100644 --- a/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/lib/fetch_license_type.test.ts +++ b/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/lib/fetch_license_type.test.ts @@ -10,7 +10,7 @@ import { fetchLicenseType } from './fetch_license_type'; describe('fetchLicenseType', () => { const clusterUuid = '1abcde2'; - const availableCcs: string[] = []; + const availableCcs = false; const callCluster = { search: jest.fn().mockImplementation(() => ({ body: { diff --git a/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/lib/fetch_license_type.ts b/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/lib/fetch_license_type.ts index 0f0d75546d28d..5a0c714c8f1d3 100644 --- a/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/lib/fetch_license_type.ts +++ b/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/lib/fetch_license_type.ts @@ -13,7 +13,7 @@ import { getCcsIndexPattern } from '../../../lib/alerts/get_ccs_index_pattern'; export async function fetchLicenseType( client: ElasticsearchClient, - availableCcs: string[], + availableCcs: boolean, clusterUuid: string ) { let index = INDEX_PATTERN_ELASTICSEARCH; diff --git a/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/lib/get_stack_products_usage.test.ts b/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/lib/get_stack_products_usage.test.ts index 78e1e98def5a2..a9d7fa05883c5 100644 --- a/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/lib/get_stack_products_usage.test.ts +++ b/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/lib/get_stack_products_usage.test.ts @@ -15,7 +15,7 @@ describe('getStackProductsUsage', () => { }, }; const clusterUuid = '1abcde2'; - const availableCcs: string[] = []; + const availableCcs = false; const callCluster = { search: jest.fn().mockImplementation(() => ({ body: { diff --git a/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/lib/get_stack_products_usage.ts b/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/lib/get_stack_products_usage.ts index 25a1892a9f38d..abe69a9b637c0 100644 --- a/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/lib/get_stack_products_usage.ts +++ b/x-pack/plugins/monitoring/server/kibana_monitoring/collectors/lib/get_stack_products_usage.ts @@ -25,7 +25,7 @@ import { getCcsIndexPattern } from '../../../lib/alerts/get_ccs_index_pattern'; export const getStackProductsUsage = async ( config: MonitoringConfig, callCluster: ElasticsearchClient, - availableCcs: string[], + availableCcs: boolean, clusterUuid: string ): Promise< Pick< diff --git a/x-pack/plugins/monitoring/server/lib/alerts/get_ccs_index_pattern.test.ts b/x-pack/plugins/monitoring/server/lib/alerts/get_ccs_index_pattern.test.ts index 7377f00c43d5b..a2b47440c2a97 100644 --- a/x-pack/plugins/monitoring/server/lib/alerts/get_ccs_index_pattern.test.ts +++ b/x-pack/plugins/monitoring/server/lib/alerts/get_ccs_index_pattern.test.ts @@ -8,19 +8,12 @@ import { getCcsIndexPattern } from './get_ccs_index_pattern'; describe('getCcsIndexPattern', () => { - it('should return an index pattern including remotes', () => { - const remotes = ['Remote1', 'Remote2']; - const index = '.monitoring-es-*'; - const result = getCcsIndexPattern(index, remotes); - expect(result).toBe('.monitoring-es-*,Remote1:.monitoring-es-*,Remote2:.monitoring-es-*'); - }); - - it('should return an index pattern from multiple index patterns including remotes', () => { - const remotes = ['Remote1', 'Remote2']; + it('should return an index pattern from multiple index patterns including CCS globs', () => { + const availableCcs = true; const index = '.monitoring-es-*,.monitoring-kibana-*'; - const result = getCcsIndexPattern(index, remotes); + const result = getCcsIndexPattern(index, availableCcs); expect(result).toBe( - '.monitoring-es-*,.monitoring-kibana-*,Remote1:.monitoring-es-*,Remote2:.monitoring-es-*,Remote1:.monitoring-kibana-*,Remote2:.monitoring-kibana-*' + '.monitoring-es-*,.monitoring-kibana-*,*:.monitoring-es-*,*:.monitoring-kibana-*' ); }); }); diff --git a/x-pack/plugins/monitoring/server/lib/alerts/get_ccs_index_pattern.ts b/x-pack/plugins/monitoring/server/lib/alerts/get_ccs_index_pattern.ts index df863e0f683fc..84dbb306d5ee0 100644 --- a/x-pack/plugins/monitoring/server/lib/alerts/get_ccs_index_pattern.ts +++ b/x-pack/plugins/monitoring/server/lib/alerts/get_ccs_index_pattern.ts @@ -5,15 +5,13 @@ * 2.0. */ -export function getCcsIndexPattern(indexPattern: string, remotes: string[]): string { - if (remotes.length === 0) { +export function getCcsIndexPattern(indexPattern: string, availableCcs: boolean): string { + if (!availableCcs) { return indexPattern; } const patternsToAdd = []; for (const index of indexPattern.split(',')) { - for (const remote of remotes) { - patternsToAdd.push(`${remote}:${index}`); - } + patternsToAdd.push(`*:${index}`); } return [...indexPattern.split(','), ...patternsToAdd].join(','); } diff --git a/x-pack/plugins/monitoring/tsconfig.json b/x-pack/plugins/monitoring/tsconfig.json index 756b8528865ce..79fcff4d840ff 100644 --- a/x-pack/plugins/monitoring/tsconfig.json +++ b/x-pack/plugins/monitoring/tsconfig.json @@ -15,7 +15,6 @@ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/data/tsconfig.json" }, { "path": "../../../src/plugins/home/tsconfig.json" }, - { "path": "../../../src/plugins/kibana_legacy/tsconfig.json" }, { "path": "../../../src/plugins/navigation/tsconfig.json" }, { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, { "path": "../../../src/plugins/kibana_utils/tsconfig.json" }, diff --git a/x-pack/plugins/observability/public/components/app/empty_sections/index.tsx b/x-pack/plugins/observability/public/components/app/empty_sections/index.tsx index 21aaba99ac5dc..fdb6752ad8e7e 100644 --- a/x-pack/plugins/observability/public/components/app/empty_sections/index.tsx +++ b/x-pack/plugins/observability/public/components/app/empty_sections/index.tsx @@ -8,7 +8,6 @@ import { EuiFlexGrid, EuiFlexItem, EuiSpacer } from '@elastic/eui'; import React, { useContext } from 'react'; import { ThemeContext } from 'styled-components'; -import { Alert } from '../../../../../alerting/common'; import { FETCH_STATUS } from '../../../hooks/use_fetcher'; import { useHasData } from '../../../hooks/use_has_data'; import { usePluginContext } from '../../../hooks/use_plugin_context'; @@ -21,17 +20,9 @@ export function EmptySections() { const { hasDataMap } = useHasData(); const appEmptySections = getEmptySections({ core }).filter(({ id }) => { - if (id === 'alert') { - const { status, hasData: alerts } = hasDataMap.alert || {}; - return ( - status === FETCH_STATUS.FAILURE || - (status === FETCH_STATUS.SUCCESS && (alerts as Alert[]).length === 0) - ); - } else { - const app = hasDataMap[id]; - if (app) { - return app.status === FETCH_STATUS.FAILURE || !app.hasData; - } + const app = hasDataMap[id]; + if (app) { + return app.status === FETCH_STATUS.FAILURE || !app.hasData; } return false; }); diff --git a/x-pack/plugins/observability/public/components/app/section/alerts/index.tsx b/x-pack/plugins/observability/public/components/app/section/alerts/index.tsx index cf3ac2b6c7be5..328de71ac7874 100644 --- a/x-pack/plugins/observability/public/components/app/section/alerts/index.tsx +++ b/x-pack/plugins/observability/public/components/app/section/alerts/index.tsx @@ -16,14 +16,18 @@ import { EuiSpacer, EuiTitle, EuiButton, + EuiLoadingSpinner, + EuiCallOut, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; import moment from 'moment'; -import React, { useState } from 'react'; +import React, { useState, useMemo } from 'react'; import { EuiSelect } from '@elastic/eui'; import { uniqBy } from 'lodash'; -import { Alert } from '../../../../../../alerting/common'; import { usePluginContext } from '../../../../hooks/use_plugin_context'; +import { FETCH_STATUS, useFetcher } from '../../../../hooks/use_fetcher'; +import { getObservabilityAlerts } from '../../../../services/get_observability_alerts'; import { paths } from '../../../../config'; const ALL_TYPES = 'ALL_TYPES'; @@ -34,20 +38,64 @@ const allTypes = { }), }; -interface Props { - alerts: Alert[]; -} - -export function AlertsSection({ alerts }: Props) { +export function AlertsSection() { const { config, core } = usePluginContext(); const [filter, setFilter] = useState(ALL_TYPES); const manageLink = config.unsafe.alertingExperience.enabled ? core.http.basePath.prepend(paths.observability.alerts) : core.http.basePath.prepend(paths.management.rules); - const filterOptions = uniqBy(alerts, (alert) => alert.consumer).map(({ consumer }) => ({ - value: consumer, - text: consumer, - })); + + const { data, status } = useFetcher(() => { + return getObservabilityAlerts({ core }); + }, [core]); + + const alerts = useMemo(() => data ?? [], [data]); + + const filterOptions = useMemo(() => { + if (!alerts) { + return []; + } + return uniqBy(alerts, (alert) => alert.consumer).map(({ consumer }) => ({ + value: consumer, + text: consumer, + })); + }, [alerts]); + + const isError = status === FETCH_STATUS.FAILURE; + const isLoading = status !== FETCH_STATUS.SUCCESS && !isError; + + if (isLoading) { + return ( + + + + + + ); + } + + if (isError) { + return ( + + + +

+ +

+
+
+
+ ); + } return (
diff --git a/x-pack/plugins/observability/public/components/shared/add_data_buttons/synthetics_add_data.tsx b/x-pack/plugins/observability/public/components/shared/add_data_buttons/synthetics_add_data.tsx index d852d6fdb9a31..af91624769e6b 100644 --- a/x-pack/plugins/observability/public/components/shared/add_data_buttons/synthetics_add_data.tsx +++ b/x-pack/plugins/observability/public/components/shared/add_data_buttons/synthetics_add_data.tsx @@ -16,9 +16,9 @@ export function SyntheticsAddData() { return ( diff --git a/x-pack/plugins/observability/public/components/shared/core_web_vitals/__stories__/core_vitals.stories.tsx b/x-pack/plugins/observability/public/components/shared/core_web_vitals/__stories__/core_vitals.stories.tsx index dd2e8aa03e928..1858a047087fb 100644 --- a/x-pack/plugins/observability/public/components/shared/core_web_vitals/__stories__/core_vitals.stories.tsx +++ b/x-pack/plugins/observability/public/components/shared/core_web_vitals/__stories__/core_vitals.stories.tsx @@ -6,7 +6,7 @@ */ import React, { ComponentType } from 'react'; -import { __IntlProvider as IntlProvider } from '@kbn/i18n/react'; +import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; import { Observable } from 'rxjs'; import { CoreStart } from 'src/core/public'; import { createKibanaReactContext } from '../../../../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/observability/public/components/shared/core_web_vitals/palette_legends.tsx b/x-pack/plugins/observability/public/components/shared/core_web_vitals/palette_legends.tsx index 70ae61b5e0d74..b9686cc2eccc1 100644 --- a/x-pack/plugins/observability/public/components/shared/core_web_vitals/palette_legends.tsx +++ b/x-pack/plugins/observability/public/components/shared/core_web_vitals/palette_legends.tsx @@ -15,7 +15,7 @@ import { EuiToolTip, } from '@elastic/eui'; import styled from 'styled-components'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { euiLightVars, euiDarkVars } from '@kbn/ui-shared-deps-src/theme'; import { getCoreVitalTooltipMessage, Thresholds } from './core_vital_item'; import { useUiSetting$ } from '../../../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/observability/public/components/shared/core_web_vitals/web_core_vitals_title.tsx b/x-pack/plugins/observability/public/components/shared/core_web_vitals/web_core_vitals_title.tsx index 2502b8a4dfe97..3d855f419ce33 100644 --- a/x-pack/plugins/observability/public/components/shared/core_web_vitals/web_core_vitals_title.tsx +++ b/x-pack/plugins/observability/public/components/shared/core_web_vitals/web_core_vitals_title.tsx @@ -16,7 +16,7 @@ import { EuiText, EuiTitle, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; const CORE_WEB_VITALS = i18n.translate('xpack.observability.ux.coreWebVitals', { diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/components/action_menu/index.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/components/action_menu/index.tsx index 23500b63e900a..b5ccda3700318 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/components/action_menu/index.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/components/action_menu/index.tsx @@ -8,18 +8,18 @@ import React from 'react'; import { ExpViewActionMenuContent } from './action_menu'; import HeaderMenuPortal from '../../../header_menu_portal'; -import { usePluginContext } from '../../../../../hooks/use_plugin_context'; import { TypedLensByValueInput } from '../../../../../../../lens/public'; +import { useExploratoryView } from '../../contexts/exploatory_view_config'; interface Props { timeRange?: { from: string; to: string }; lensAttributes: TypedLensByValueInput['attributes'] | null; } export function ExpViewActionMenu(props: Props) { - const { appMountParameters } = usePluginContext(); + const { setHeaderActionMenu } = useExploratoryView(); return ( - + ); diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts index 3f6551986527c..413d41acef5da 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/default_configs.ts @@ -5,48 +5,32 @@ * 2.0. */ -import { AppDataType, ReportViewType } from '../types'; -import { getRumDistributionConfig } from './rum/data_distribution_config'; -import { getSyntheticsDistributionConfig } from './synthetics/data_distribution_config'; -import { getSyntheticsKPIConfig } from './synthetics/kpi_over_time_config'; -import { getKPITrendsLensConfig } from './rum/kpi_over_time_config'; +import { AppDataType, ReportViewType, SeriesConfig } from '../types'; import { IndexPattern } from '../../../../../../../../src/plugins/data/common'; -import { getCoreWebVitalsConfig } from './rum/core_web_vitals_config'; -import { getMobileKPIConfig } from './mobile/kpi_over_time_config'; -import { getMobileKPIDistributionConfig } from './mobile/distribution_config'; -import { getMobileDeviceDistributionConfig } from './mobile/device_distribution_config'; -import { DataTypes, ReportTypes } from './constants'; +import { ReportConfigMap } from '../contexts/exploatory_view_config'; interface Props { reportType: ReportViewType; indexPattern: IndexPattern; dataType: AppDataType; + reportConfigMap: ReportConfigMap; } -export const getDefaultConfigs = ({ reportType, dataType, indexPattern }: Props) => { - switch (dataType) { - case DataTypes.UX: - if (reportType === ReportTypes.DISTRIBUTION) { - return getRumDistributionConfig({ indexPattern }); - } - if (reportType === ReportTypes.CORE_WEB_VITAL) { - return getCoreWebVitalsConfig({ indexPattern }); - } - return getKPITrendsLensConfig({ indexPattern }); - case DataTypes.SYNTHETICS: - if (reportType === ReportTypes.DISTRIBUTION) { - return getSyntheticsDistributionConfig({ indexPattern }); - } - return getSyntheticsKPIConfig({ indexPattern }); - case DataTypes.MOBILE: - if (reportType === ReportTypes.DISTRIBUTION) { - return getMobileKPIDistributionConfig({ indexPattern }); - } - if (reportType === ReportTypes.DEVICE_DISTRIBUTION) { - return getMobileDeviceDistributionConfig({ indexPattern }); - } - return getMobileKPIConfig({ indexPattern }); - default: - return getKPITrendsLensConfig({ indexPattern }); - } +export const getDefaultConfigs = ({ + reportType, + dataType, + indexPattern, + reportConfigMap, +}: Props): SeriesConfig => { + let configResult: SeriesConfig; + + reportConfigMap[dataType].some((fn) => { + const config = fn({ indexPattern }); + if (config.reportType === reportType) { + configResult = config; + } + return config.reportType === reportType; + }); + + return configResult!; }; diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.test.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.test.ts index 135cf3c59a1ce..9dc27b84bef0e 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.test.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/lens_attributes.test.ts @@ -18,6 +18,7 @@ import { import { buildExistsFilter, buildPhrasesFilter } from './utils'; import { sampleAttributeKpi } from './test_data/sample_attribute_kpi'; import { RECORDS_FIELD, REPORT_METRIC_FIELD, PERCENTILE_RANKS, ReportTypes } from './constants'; +import { obsvReportConfigMap } from '../obsv_exploratory_view'; describe('Lens Attribute', () => { mockAppIndexPattern(); @@ -26,6 +27,7 @@ describe('Lens Attribute', () => { reportType: 'data-distribution', dataType: 'ux', indexPattern: mockIndexPattern, + reportConfigMap: obsvReportConfigMap, }); reportViewConfig.baseFilters?.push(...buildExistsFilter('transaction.type', mockIndexPattern)); @@ -57,6 +59,7 @@ describe('Lens Attribute', () => { reportType: ReportTypes.KPI, dataType: 'ux', indexPattern: mockIndexPattern, + reportConfigMap: obsvReportConfigMap, }); const lnsAttrKpi = new LensAttributes([ @@ -81,6 +84,7 @@ describe('Lens Attribute', () => { reportType: ReportTypes.KPI, dataType: 'ux', indexPattern: mockIndexPattern, + reportConfigMap: obsvReportConfigMap, }); const lnsAttrKpi = new LensAttributes([ diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/rum/core_web_vitals_config.test.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/rum/core_web_vitals_config.test.ts index 35e094996f6f2..0602e37f61a20 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/rum/core_web_vitals_config.test.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations/rum/core_web_vitals_config.test.ts @@ -10,6 +10,7 @@ import { getDefaultConfigs } from '../default_configs'; import { LayerConfig, LensAttributes } from '../lens_attributes'; import { sampleAttributeCoreWebVital } from '../test_data/sample_attribute_cwv'; import { LCP_FIELD, SERVICE_NAME, USER_AGENT_OS } from '../constants/elasticsearch_fieldnames'; +import { obsvReportConfigMap } from '../../obsv_exploratory_view'; describe('Core web vital config test', function () { mockAppIndexPattern(); @@ -18,6 +19,7 @@ describe('Core web vital config test', function () { reportType: 'core-web-vitals', dataType: 'ux', indexPattern: mockIndexPattern, + reportConfigMap: obsvReportConfigMap, }); let lnsAttr: LensAttributes; diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/contexts/exploatory_view_config.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/contexts/exploatory_view_config.tsx new file mode 100644 index 0000000000000..fe7ea3884880a --- /dev/null +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/contexts/exploatory_view_config.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { createContext, useContext } from 'react'; +import { AppMountParameters } from 'kibana/public'; +import { i18n } from '@kbn/i18n'; +import type { AppDataType, ConfigProps, ReportViewType, SeriesConfig } from '../types'; + +export type ReportConfigMap = Record SeriesConfig>>; + +interface ExploratoryViewContextValue { + dataTypes: Array<{ id: AppDataType; label: string }>; + reportTypes: Array<{ + reportType: ReportViewType | typeof SELECT_REPORT_TYPE; + label: string; + }>; + indexPatterns: Record; + reportConfigMap: ReportConfigMap; + setHeaderActionMenu: AppMountParameters['setHeaderActionMenu']; +} + +export const ExploratoryViewContext = createContext({ + indexPatterns: {}, +} as ExploratoryViewContextValue); + +export function ExploratoryViewContextProvider({ + children, + reportTypes, + dataTypes, + indexPatterns, + reportConfigMap, + setHeaderActionMenu, +}: { children: JSX.Element } & ExploratoryViewContextValue) { + const value = { + reportTypes, + dataTypes, + indexPatterns, + reportConfigMap, + setHeaderActionMenu, + }; + + return ( + {children} + ); +} + +export function useExploratoryView() { + const context = useContext(ExploratoryViewContext); + + if (context === undefined) { + throw new Error('useExploratoryView must be used within a ExploratoryViewContextProvider'); + } + return context; +} + +export const SELECT_REPORT_TYPE = i18n.translate( + 'xpack.observability.expView.seriesBuilder.selectReportType', + { + defaultMessage: 'No report type selected', + } +); diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx index 497435ec69a50..ba03640669330 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/embeddable/embeddable.tsx @@ -15,6 +15,8 @@ import { getLayerConfigs } from '../hooks/use_lens_attributes'; import { LensPublicStart, XYState } from '../../../../../../lens/public'; import { OperationTypeComponent } from '../series_editor/columns/operation_type_select'; import { IndexPatternState } from '../hooks/use_app_index_pattern'; +import { ReportConfigMap } from '../contexts/exploatory_view_config'; +import { obsvReportConfigMap } from '../obsv_exploratory_view'; export interface ExploratoryEmbeddableProps { reportType: ReportViewType; @@ -25,6 +27,7 @@ export interface ExploratoryEmbeddableProps { axisTitlesVisibility?: XYState['axisTitlesVisibilitySettings']; legendIsVisible?: boolean; dataTypesIndexPatterns?: Record; + reportConfigMap?: ReportConfigMap; } export interface ExploratoryEmbeddableComponentProps extends ExploratoryEmbeddableProps { @@ -42,6 +45,7 @@ export default function Embeddable({ lens, axisTitlesVisibility, legendIsVisible, + reportConfigMap = {}, showCalculationMethod = false, }: ExploratoryEmbeddableComponentProps) { const LensComponent = lens?.EmbeddableComponent; @@ -51,7 +55,13 @@ export default function Embeddable({ const [operationType, setOperationType] = useState(series?.operationType); const theme = useTheme(); - const layerConfigs: LayerConfig[] = getLayerConfigs(attributes, reportType, theme, indexPatterns); + const layerConfigs: LayerConfig[] = getLayerConfigs( + attributes, + reportType, + theme, + indexPatterns, + { ...reportConfigMap, ...obsvReportConfigMap } + ); if (layerConfigs.length < 1) { return null; diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/header/chart_creation_info.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/header/chart_creation_info.tsx index 4814bc8d8630a..2cd2edbe8f2fd 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/header/chart_creation_info.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/header/chart_creation_info.tsx @@ -7,7 +7,7 @@ import React from 'react'; import moment from 'moment'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, EuiText, EuiSpacer } from '@elastic/eui'; import type { ChartTimeRange } from './last_updated'; diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/header/header.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/header/header.tsx index 22245f111293c..8ef3f228a5854 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/header/header.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/header/header.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { EuiBetaBadge, EuiButton, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; +import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; import { TypedLensByValueInput } from '../../../../../../lens/public'; import { useSeriesStorage } from '../hooks/use_series_storage'; import { ExpViewActionMenu } from '../components/action_menu'; @@ -34,15 +34,7 @@ export function ExploratoryViewHeader({ lensAttributes, chartTimeRange }: Props)

{i18n.translate('xpack.observability.expView.heading.label', { defaultMessage: 'Explore data', - })}{' '} - + })}

diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/header/last_updated.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/header/last_updated.tsx index bc82c48214a01..73ea331214b95 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/header/last_updated.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/header/last_updated.tsx @@ -9,7 +9,7 @@ import React, { useEffect, useState } from 'react'; import moment from 'moment'; import styled from 'styled-components'; import { EuiIcon, EuiText, EuiToolTip } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ChartCreationInfo } from './chart_creation_info'; export interface ChartTimeRange { diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_app_index_pattern.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_app_index_pattern.tsx index 9bd611c05e956..674a2b04d3520 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_app_index_pattern.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_app_index_pattern.tsx @@ -13,6 +13,7 @@ import { useKibana } from '../../../../../../../../src/plugins/kibana_react/publ import { ObservabilityPublicPluginsStart } from '../../../../plugin'; import { ObservabilityIndexPatterns } from '../utils/observability_index_patterns'; import { getDataHandler } from '../../../../data_handler'; +import { useExploratoryView } from '../contexts/exploatory_view_config'; export interface IndexPatternContext { loading: boolean; @@ -28,7 +29,7 @@ interface ProviderProps { children: JSX.Element; } -type HasAppDataState = Record; +type HasAppDataState = Record; export type IndexPatternState = Record; export type IndexPatternErrors = Record; type LoadingState = Record; @@ -39,27 +40,26 @@ export function IndexPatternContextProvider({ children }: ProviderProps) { const [indexPatternErrors, setIndexPatternErrors] = useState( {} as IndexPatternErrors ); - const [hasAppData, setHasAppData] = useState({ - infra_metrics: null, - infra_logs: null, - synthetics: null, - ux: null, - apm: null, - mobile: null, - } as HasAppDataState); + const [hasAppData, setHasAppData] = useState({} as HasAppDataState); const { services: { data }, } = useKibana(); + const { indexPatterns: indexPatternsList } = useExploratoryView(); + const loadIndexPattern: IndexPatternContext['loadIndexPattern'] = useCallback( async ({ dataType }) => { - if (hasAppData[dataType] === null && !loading[dataType]) { + if (typeof hasAppData[dataType] === 'undefined' && !loading[dataType]) { setLoading((prevState) => ({ ...prevState, [dataType]: true })); try { let hasDataT = false; let indices: string | undefined = ''; + if (indexPatternsList[dataType]) { + indices = indexPatternsList[dataType]; + hasDataT = true; + } switch (dataType) { case 'ux': case 'synthetics': @@ -91,7 +91,7 @@ export function IndexPatternContextProvider({ children }: ProviderProps) { } } }, - [data, hasAppData, loading] + [data, hasAppData, indexPatternsList, loading] ); return ( diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_lens_attributes.test.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_lens_attributes.test.tsx index 3334b69e5becc..654421dfdf60a 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_lens_attributes.test.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_lens_attributes.test.tsx @@ -17,6 +17,8 @@ import { TRANSACTION_DURATION } from '../configurations/constants/elasticsearch_ import * as lensAttributes from '../configurations/lens_attributes'; import * as indexPattern from './use_app_index_pattern'; import * as theme from '../../../../hooks/use_theme'; +import { dataTypes, obsvReportConfigMap, reportTypesList } from '../obsv_exploratory_view'; +import { ExploratoryViewContextProvider } from '../contexts/exploatory_view_config'; const mockSingleSeries = [ { @@ -51,7 +53,17 @@ describe('useExpViewTimeRange', function () { const lensAttributesSpy = jest.spyOn(lensAttributes, 'LensAttributes'); function Wrapper({ children }: { children: JSX.Element }) { - return {children}; + return ( + + {children} + + ); } it('updates lens attributes with report type from storage', async function () { diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_lens_attributes.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_lens_attributes.ts index f81494e8f9ac7..b2b7a3b6ba537 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_lens_attributes.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/hooks/use_lens_attributes.ts @@ -24,6 +24,7 @@ import { ALL_VALUES_SELECTED } from '../../field_value_suggestions/field_value_c import { useTheme } from '../../../../hooks/use_theme'; import { EuiTheme } from '../../../../../../../../src/plugins/kibana_react/common'; import { LABEL_FIELDS_BREAKDOWN } from '../configurations/constants'; +import { ReportConfigMap, useExploratoryView } from '../contexts/exploatory_view_config'; export const getFiltersFromDefs = (reportDefinitions: SeriesUrl['reportDefinitions']) => { return Object.entries(reportDefinitions ?? {}) @@ -40,7 +41,8 @@ export function getLayerConfigs( allSeries: AllSeries, reportType: ReportViewType, theme: EuiTheme, - indexPatterns: IndexPatternState + indexPatterns: IndexPatternState, + reportConfigMap: ReportConfigMap ) { const layerConfigs: LayerConfig[] = []; @@ -57,6 +59,7 @@ export function getLayerConfigs( reportType, indexPattern, dataType: series.dataType, + reportConfigMap, }); const filters: UrlFilter[] = (series.filters ?? []).concat( @@ -89,6 +92,8 @@ export const useLensAttributes = (): TypedLensByValueInput['attributes'] | null const { indexPatterns } = useAppIndexPatternContext(); + const { reportConfigMap } = useExploratoryView(); + const theme = useTheme(); return useMemo(() => { @@ -99,7 +104,13 @@ export const useLensAttributes = (): TypedLensByValueInput['attributes'] | null if (isEmpty(indexPatterns) || isEmpty(allSeriesT) || !reportTypeT) { return null; } - const layerConfigs = getLayerConfigs(allSeriesT, reportTypeT, theme, indexPatterns); + const layerConfigs = getLayerConfigs( + allSeriesT, + reportTypeT, + theme, + indexPatterns, + reportConfigMap + ); if (layerConfigs.length < 1) { return null; diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/index.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/index.tsx index 1fc38ab79de7f..5dbe0c2a6c078 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/index.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/index.tsx @@ -23,23 +23,34 @@ import { UrlStorageContextProvider } from './hooks/use_series_storage'; import { useTrackPageview } from '../../..'; import { TypedLensByValueInput } from '../../../../../lens/public'; +export interface ExploratoryViewPageProps { + useSessionStorage?: boolean; + saveAttributes?: (attr: TypedLensByValueInput['attributes'] | null) => void; + app?: { id: string; label: string }; +} + export function ExploratoryViewPage({ + app, saveAttributes, useSessionStorage = false, -}: { - useSessionStorage?: boolean; - saveAttributes?: (attr: TypedLensByValueInput['attributes'] | null) => void; -}) { +}: ExploratoryViewPageProps) { useTrackPageview({ app: 'observability-overview', path: 'exploratory-view' }); - useTrackPageview({ app: 'observability-overview', path: 'exploratory-view', delay: 15000 }); + useTrackPageview({ + app: 'observability-overview', + path: 'exploratory-view', + delay: 15000, + }); - useBreadcrumbs([ - { - text: i18n.translate('xpack.observability.overview.exploratoryView', { - defaultMessage: 'Explore data', - }), - }, - ]); + useBreadcrumbs( + [ + { + text: i18n.translate('xpack.observability.overview.exploratoryView', { + defaultMessage: 'Explore data', + }), + }, + ], + app + ); const { services: { uiSettings, notifications }, @@ -69,3 +80,6 @@ export function ExploratoryViewPage({ const Wrapper = euiStyled.div` padding: ${(props) => props.theme.eui.paddingSizes.l}; `; + +// eslint-disable-next-line import/no-default-export +export default ExploratoryViewPage; diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/obsv_exploratory_view.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/obsv_exploratory_view.tsx new file mode 100644 index 0000000000000..04e291b1b6629 --- /dev/null +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/obsv_exploratory_view.tsx @@ -0,0 +1,99 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import * as React from 'react'; +import { i18n } from '@kbn/i18n'; +import { ExploratoryViewPage } from './index'; +import { ExploratoryViewContextProvider } from './contexts/exploatory_view_config'; +import { AppDataType, ReportViewType } from './types'; + +import { + CORE_WEB_VITALS_LABEL, + DEVICE_DISTRIBUTION_LABEL, + KPI_OVER_TIME_LABEL, + PERF_DIST_LABEL, +} from './configurations/constants/labels'; +import { SELECT_REPORT_TYPE } from './series_editor/series_editor'; +import { DataTypes } from './configurations/constants'; +import { getRumDistributionConfig } from './configurations/rum/data_distribution_config'; +import { getKPITrendsLensConfig } from './configurations/rum/kpi_over_time_config'; +import { getCoreWebVitalsConfig } from './configurations/rum/core_web_vitals_config'; +import { getSyntheticsKPIConfig } from './configurations/synthetics/kpi_over_time_config'; +import { getSyntheticsDistributionConfig } from './configurations/synthetics/data_distribution_config'; +import { getMobileKPIDistributionConfig } from './configurations/mobile/distribution_config'; +import { getMobileKPIConfig } from './configurations/mobile/kpi_over_time_config'; +import { getMobileDeviceDistributionConfig } from './configurations/mobile/device_distribution_config'; +import { usePluginContext } from '../../../hooks/use_plugin_context'; + +export const DataTypesLabels = { + [DataTypes.UX]: i18n.translate('xpack.observability.overview.exploratoryView.uxLabel', { + defaultMessage: 'User experience (RUM)', + }), + + [DataTypes.SYNTHETICS]: i18n.translate( + 'xpack.observability.overview.exploratoryView.syntheticsLabel', + { + defaultMessage: 'Synthetics monitoring', + } + ), + + [DataTypes.MOBILE]: i18n.translate( + 'xpack.observability.overview.exploratoryView.mobileExperienceLabel', + { + defaultMessage: 'Mobile experience', + } + ), +}; +export const dataTypes: Array<{ id: AppDataType; label: string }> = [ + { + id: DataTypes.SYNTHETICS, + label: DataTypesLabels[DataTypes.SYNTHETICS], + }, + { + id: DataTypes.UX, + label: DataTypesLabels[DataTypes.UX], + }, + { + id: DataTypes.MOBILE, + label: DataTypesLabels[DataTypes.MOBILE], + }, +]; + +export const reportTypesList: Array<{ + reportType: ReportViewType | typeof SELECT_REPORT_TYPE; + label: string; +}> = [ + { reportType: 'kpi-over-time', label: KPI_OVER_TIME_LABEL }, + { reportType: 'data-distribution', label: PERF_DIST_LABEL }, + { reportType: 'core-web-vitals', label: CORE_WEB_VITALS_LABEL }, + { reportType: 'device-data-distribution', label: DEVICE_DISTRIBUTION_LABEL }, +]; + +export const obsvReportConfigMap = { + [DataTypes.UX]: [getKPITrendsLensConfig, getRumDistributionConfig, getCoreWebVitalsConfig], + [DataTypes.SYNTHETICS]: [getSyntheticsKPIConfig, getSyntheticsDistributionConfig], + [DataTypes.MOBILE]: [ + getMobileKPIConfig, + getMobileKPIDistributionConfig, + getMobileDeviceDistributionConfig, + ], +}; + +export function ObservabilityExploratoryView() { + const { appMountParameters } = usePluginContext(); + return ( + + + + ); +} diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/rtl_helpers.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/rtl_helpers.tsx index 04d74844beb83..d2523d5fb96f7 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/rtl_helpers.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/rtl_helpers.tsx @@ -13,7 +13,7 @@ import { render as reactTestLibRender, RenderOptions } from '@testing-library/re import { Route, Router } from 'react-router-dom'; import { createMemoryHistory, History } from 'history'; import { CoreStart } from 'kibana/public'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { coreMock } from 'src/core/public/mocks'; import { KibanaContextProvider, @@ -24,7 +24,12 @@ import { EuiThemeProvider } from '../../../../../../../src/plugins/kibana_react/ import { lensPluginMock } from '../../../../../lens/public/mocks'; import * as useAppIndexPatternHook from './hooks/use_app_index_pattern'; import { IndexPatternContext, IndexPatternContextProvider } from './hooks/use_app_index_pattern'; -import { AllSeries, SeriesContextValue, UrlStorageContext } from './hooks/use_series_storage'; +import { + AllSeries, + reportTypeKey, + SeriesContextValue, + UrlStorageContext, +} from './hooks/use_series_storage'; import * as fetcherHook from '../../../hooks/use_fetcher'; import * as useSeriesFilterHook from './hooks/use_series_filters'; @@ -42,6 +47,8 @@ import { dataPluginMock } from '../../../../../../../src/plugins/data/public/moc import { ListItem } from '../../../hooks/use_values_list'; import { TRANSACTION_DURATION } from './configurations/constants/elasticsearch_fieldnames'; import { casesPluginMock } from '../../../../../cases/public/mocks'; +import { dataTypes, obsvReportConfigMap, reportTypesList } from './obsv_exploratory_view'; +import { ExploratoryViewContextProvider } from './contexts/exploatory_view_config'; interface KibanaProps { services?: KibanaServices; @@ -194,9 +201,17 @@ export function render( return { ...reactTestLibRender( - - {ui} - + + + {ui} + + , renderOptions ), @@ -301,7 +316,13 @@ function mockSeriesStorageContext({ firstSeries: mockDataSeries[0], allSeries: mockDataSeries, setReportType: jest.fn(), - storage: { get: jest.fn().mockReturnValue(mockDataSeries) } as any, + storage: { + get: jest + .fn() + .mockImplementation((key: string) => + key === reportTypeKey ? 'data-distribution' : mockDataSeries + ), + } as any, } as SeriesContextValue; } diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/breakdown/breakdowns.test.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/breakdown/breakdowns.test.tsx index 8ed279ace28f6..e213a41238123 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/breakdown/breakdowns.test.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/breakdown/breakdowns.test.tsx @@ -12,12 +12,14 @@ import { mockIndexPattern, mockUxSeries, render } from '../../rtl_helpers'; import { getDefaultConfigs } from '../../configurations/default_configs'; import { RECORDS_FIELD } from '../../configurations/constants'; import { USER_AGENT_OS } from '../../configurations/constants/elasticsearch_fieldnames'; +import { obsvReportConfigMap } from '../../obsv_exploratory_view'; describe('Breakdowns', function () { const dataViewSeries = getDefaultConfigs({ reportType: 'data-distribution', indexPattern: mockIndexPattern, dataType: 'ux', + reportConfigMap: obsvReportConfigMap, }); it('should render properly', async function () { @@ -62,6 +64,7 @@ describe('Breakdowns', function () { reportType: 'kpi-over-time', indexPattern: mockIndexPattern, dataType: 'ux', + reportConfigMap: obsvReportConfigMap, }); render( diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/data_type_select.test.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/data_type_select.test.tsx index fc96ad0741ec5..1afe1f979b272 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/data_type_select.test.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/data_type_select.test.tsx @@ -8,8 +8,9 @@ import React from 'react'; import { fireEvent, screen } from '@testing-library/react'; import { mockAppIndexPattern, mockUxSeries, render } from '../../rtl_helpers'; -import { DataTypesLabels, DataTypesSelect } from './data_type_select'; +import { DataTypesSelect } from './data_type_select'; import { DataTypes } from '../../configurations/constants'; +import { DataTypesLabels } from '../../obsv_exploratory_view'; describe('DataTypeSelect', function () { const seriesId = 0; diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/data_type_select.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/data_type_select.tsx index 71fd147e8e264..4efee7615a8ac 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/data_type_select.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/data_type_select.tsx @@ -18,6 +18,7 @@ import { i18n } from '@kbn/i18n'; import { useSeriesStorage } from '../../hooks/use_series_storage'; import { AppDataType, SeriesUrl } from '../../types'; import { DataTypes, ReportTypes } from '../../configurations/constants'; +import { useExploratoryView } from '../../contexts/exploatory_view_config'; interface Props { seriesId: number; @@ -26,41 +27,6 @@ interface Props { }; } -export const DataTypesLabels = { - [DataTypes.UX]: i18n.translate('xpack.observability.overview.exploratoryView.uxLabel', { - defaultMessage: 'User experience (RUM)', - }), - - [DataTypes.SYNTHETICS]: i18n.translate( - 'xpack.observability.overview.exploratoryView.syntheticsLabel', - { - defaultMessage: 'Synthetics monitoring', - } - ), - - [DataTypes.MOBILE]: i18n.translate( - 'xpack.observability.overview.exploratoryView.mobileExperienceLabel', - { - defaultMessage: 'Mobile experience', - } - ), -}; - -export const dataTypes: Array<{ id: AppDataType; label: string }> = [ - { - id: DataTypes.SYNTHETICS, - label: DataTypesLabels[DataTypes.SYNTHETICS], - }, - { - id: DataTypes.UX, - label: DataTypesLabels[DataTypes.UX], - }, - { - id: DataTypes.MOBILE, - label: DataTypesLabels[DataTypes.MOBILE], - }, -]; - const SELECT_DATA_TYPE = 'SELECT_DATA_TYPE'; export function DataTypesSelect({ seriesId, series }: Props) { @@ -77,6 +43,8 @@ export function DataTypesSelect({ seriesId, series }: Props) { } }; + const { dataTypes } = useExploratoryView(); + const options = dataTypes .filter(({ id }) => { if (reportType === ReportTypes.DEVICE_DISTRIBUTION) { @@ -92,6 +60,8 @@ export function DataTypesSelect({ seriesId, series }: Props) { inputDisplay: label, })); + const currDataType = dataTypes.find((dt) => dt.id === series.dataType); + return ( <> {!series.dataType && ( @@ -122,7 +92,7 @@ export function DataTypesSelect({ seriesId, series }: Props) { )} {series.dataType && ( - {DataTypesLabels[series.dataType as DataTypes]} + {currDataType?.label} )} diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/report_definition_col.test.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/report_definition_col.test.tsx index 544a294e021e2..3ec2af4a8c9d2 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/report_definition_col.test.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/report_definition_col.test.tsx @@ -16,6 +16,7 @@ import { render, } from '../../rtl_helpers'; import { ReportDefinitionCol } from './report_definition_col'; +import { obsvReportConfigMap } from '../../obsv_exploratory_view'; describe('Series Builder ReportDefinitionCol', function () { mockAppIndexPattern(); @@ -25,6 +26,7 @@ describe('Series Builder ReportDefinitionCol', function () { reportType: 'data-distribution', indexPattern: mockIndexPattern, dataType: 'ux', + reportConfigMap: obsvReportConfigMap, }); mockUseValuesList([{ label: 'elastic-co', count: 10 }]); diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/report_type_select.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/report_type_select.tsx index ddabdf83323cf..8ca4241891d5a 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/report_type_select.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/report_type_select.tsx @@ -10,43 +10,32 @@ import { EuiSuperSelect } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { useSeriesStorage } from '../../hooks/use_series_storage'; import { ReportViewType } from '../../types'; -import { - CORE_WEB_VITALS_LABEL, - DEVICE_DISTRIBUTION_LABEL, - KPI_OVER_TIME_LABEL, - PERF_DIST_LABEL, -} from '../../configurations/constants/labels'; -const SELECT_REPORT_TYPE = 'SELECT_REPORT_TYPE'; +import { useExploratoryView } from '../../contexts/exploatory_view_config'; -export const reportTypesList: Array<{ - reportType: ReportViewType | typeof SELECT_REPORT_TYPE; - label: string; -}> = [ - { - reportType: SELECT_REPORT_TYPE, - label: i18n.translate('xpack.observability.expView.reportType.selectLabel', { - defaultMessage: 'Select report type', - }), - }, - { reportType: 'kpi-over-time', label: KPI_OVER_TIME_LABEL }, - { reportType: 'data-distribution', label: PERF_DIST_LABEL }, - { reportType: 'core-web-vitals', label: CORE_WEB_VITALS_LABEL }, - { reportType: 'device-data-distribution', label: DEVICE_DISTRIBUTION_LABEL }, -]; +const SELECT_REPORT_TYPE = 'SELECT_REPORT_TYPE'; interface Props { prepend: string; } +const SELECT_REPORT = { + reportType: SELECT_REPORT_TYPE, + label: i18n.translate('xpack.observability.expView.reportType.selectLabel', { + defaultMessage: 'Select report type', + }), +}; + export function ReportTypesSelect({ prepend }: Props) { const { setReportType, reportType: selectedReportType, allSeries } = useSeriesStorage(); + const { reportTypes } = useExploratoryView(); + const onReportTypeChange = (reportType: ReportViewType) => { setReportType(reportType); }; - const options = reportTypesList + const options = [SELECT_REPORT, ...reportTypes] .filter(({ reportType }) => (selectedReportType ? reportType !== SELECT_REPORT_TYPE : true)) .map(({ reportType, label }) => ({ value: reportType, diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/selected_filters.test.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/selected_filters.test.tsx index 64291f84f7662..9fcf4b14353b9 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/selected_filters.test.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/columns/selected_filters.test.tsx @@ -11,6 +11,7 @@ import { mockAppIndexPattern, mockIndexPattern, mockUxSeries, render } from '../ import { SelectedFilters } from './selected_filters'; import { getDefaultConfigs } from '../../configurations/default_configs'; import { USER_AGENT_NAME } from '../../configurations/constants/elasticsearch_fieldnames'; +import { obsvReportConfigMap } from '../../obsv_exploratory_view'; describe('SelectedFilters', function () { mockAppIndexPattern(); @@ -19,6 +20,7 @@ describe('SelectedFilters', function () { reportType: 'data-distribution', indexPattern: mockIndexPattern, dataType: 'ux', + reportConfigMap: obsvReportConfigMap, }); it('should render properly', async function () { diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/expanded_series_row.test.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/expanded_series_row.test.tsx index 83958840f63d9..afb1043e9caab 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/expanded_series_row.test.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/expanded_series_row.test.tsx @@ -11,9 +11,11 @@ import { ExpandedSeriesRow } from './expanded_series_row'; import { mockIndexPattern, mockUxSeries, render } from '../rtl_helpers'; import { getDefaultConfigs } from '../configurations/default_configs'; import { PERCENTILE } from '../configurations/constants'; +import { obsvReportConfigMap } from '../obsv_exploratory_view'; describe('ExpandedSeriesRow', function () { const dataViewSeries = getDefaultConfigs({ + reportConfigMap: obsvReportConfigMap, reportType: 'kpi-over-time', indexPattern: mockIndexPattern, dataType: 'ux', diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/report_metric_options.test.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/report_metric_options.test.tsx index 767b765ba1f19..829727d739b9c 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/report_metric_options.test.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/report_metric_options.test.tsx @@ -11,12 +11,14 @@ import { mockAppIndexPattern, mockIndexPattern, mockUxSeries, render } from '../ import { getDefaultConfigs } from '../configurations/default_configs'; import { PERCENTILE } from '../configurations/constants'; import { ReportMetricOptions } from './report_metric_options'; +import { obsvReportConfigMap } from '../obsv_exploratory_view'; describe('ReportMetricOptions', function () { const dataViewSeries = getDefaultConfigs({ + dataType: 'ux', reportType: 'kpi-over-time', indexPattern: mockIndexPattern, - dataType: 'ux', + reportConfigMap: obsvReportConfigMap, }); it('should render properly', async function () { diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/report_metric_options.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/report_metric_options.tsx index bc7c2328dcbba..c6049fdfa95b9 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/report_metric_options.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/report_metric_options.tsx @@ -17,7 +17,7 @@ import { EuiLoadingSpinner, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useSeriesStorage } from '../hooks/use_series_storage'; import { SeriesConfig, SeriesUrl } from '../types'; import { useAppIndexPatternContext } from '../hooks/use_app_index_pattern'; diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/series_editor.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/series_editor.tsx index 15040592686e0..155eedf0af74c 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/series_editor.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/series_editor.tsx @@ -17,6 +17,7 @@ import { getDefaultConfigs } from '../configurations/default_configs'; import { ReportTypesSelect } from './columns/report_type_select'; import { ViewActions } from '../views/view_actions'; import { Series } from './series'; +import { ReportConfigMap, useExploratoryView } from '../contexts/exploatory_view_config'; export interface ReportTypeItem { id: string; @@ -30,23 +31,26 @@ export const getSeriesToEdit = ({ indexPatterns, allSeries, reportType, + reportConfigMap, }: { allSeries: SeriesContextValue['allSeries']; indexPatterns: IndexPatternState; reportType: ReportViewType; + reportConfigMap: ReportConfigMap; }): BuilderItem[] => { const getDataViewSeries = (dataType: AppDataType) => { if (indexPatterns?.[dataType]) { return getDefaultConfigs({ dataType, reportType, + reportConfigMap, indexPattern: indexPatterns[dataType], }); } }; return allSeries.map((series, seriesIndex) => { - const seriesConfig = getDataViewSeries(series.dataType)!; + const seriesConfig = getDataViewSeries(series.dataType); return { id: seriesIndex, series, seriesConfig }; }); @@ -59,6 +63,8 @@ export const SeriesEditor = React.memo(function () { const { loading, indexPatterns } = useAppIndexPatternContext(); + const { reportConfigMap } = useExploratoryView(); + const [itemIdToExpandedRowMap, setItemIdToExpandedRowMap] = useState>({}); const [{ prevCount, curCount }, setSeriesCount] = useState<{ @@ -83,6 +89,7 @@ export const SeriesEditor = React.memo(function () { reportType, allSeries, indexPatterns, + reportConfigMap, }); newEditorItems.forEach(({ series, id }) => { @@ -101,7 +108,7 @@ export const SeriesEditor = React.memo(function () { setItemIdToExpandedRowMap((prevState) => { return { ...prevState, ...newExpandRows }; }); - }, [allSeries, getSeries, indexPatterns, loading, reportType]); + }, [allSeries, getSeries, indexPatterns, loading, reportConfigMap, reportType]); const toggleDetails = (item: BuilderItem) => { const itemIdToExpandedRowMapValues = { ...itemIdToExpandedRowMap }; diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.ts b/x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.ts index 1c14ffe3d13c9..b37f0a05e26cc 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.ts +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/utils/observability_index_patterns.ts @@ -50,14 +50,14 @@ const appToPatternMap: Record = { }; const getAppIndicesWithPattern = (app: AppDataType, indices: string) => { - return `${appToPatternMap[app]},${indices}`; + return `${appToPatternMap?.[app] ?? app},${indices}`; }; const getAppIndexPatternId = (app: AppDataType, indices: string) => { // Replace characters / ? , " < > | * with _ const postfix = indices.replace(/[^A-Z0-9]+/gi, '_').toLowerCase(); - return `${indexPatternList[app]}_${postfix}`; + return `${indexPatternList?.[app] ?? app}_${postfix}`; }; export function isParamsSame(param1: IFieldFormat['_params'], param2: FieldFormatParams) { diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/views/add_series_button.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/views/add_series_button.tsx index 71b16c9c0e682..06a5b8609b0e4 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/views/add_series_button.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/views/add_series_button.tsx @@ -14,6 +14,7 @@ import { getSeriesToEdit } from '../series_editor/series_editor'; import { NEW_SERIES_KEY, useSeriesStorage } from '../hooks/use_series_storage'; import { useAppIndexPatternContext } from '../hooks/use_app_index_pattern'; import { DEFAULT_TIME, ReportTypes } from '../configurations/constants'; +import { useExploratoryView } from '../contexts/exploatory_view_config'; export function AddSeriesButton() { const [editorItems, setEditorItems] = useState([]); @@ -21,9 +22,11 @@ export function AddSeriesButton() { const { loading, indexPatterns } = useAppIndexPatternContext(); + const { reportConfigMap } = useExploratoryView(); + useEffect(() => { - setEditorItems(getSeriesToEdit({ allSeries, indexPatterns, reportType })); - }, [allSeries, getSeries, indexPatterns, loading, reportType]); + setEditorItems(getSeriesToEdit({ allSeries, indexPatterns, reportType, reportConfigMap })); + }, [allSeries, getSeries, indexPatterns, loading, reportConfigMap, reportType]); const addSeries = () => { const prevSeries = allSeries?.[0]; diff --git a/x-pack/plugins/observability/public/components/shared/field_value_suggestions/__stories__/field_value_selection.stories.tsx b/x-pack/plugins/observability/public/components/shared/field_value_suggestions/__stories__/field_value_selection.stories.tsx index 921b5c63293d9..e15e5709bc341 100644 --- a/x-pack/plugins/observability/public/components/shared/field_value_suggestions/__stories__/field_value_selection.stories.tsx +++ b/x-pack/plugins/observability/public/components/shared/field_value_suggestions/__stories__/field_value_selection.stories.tsx @@ -6,7 +6,7 @@ */ import React, { ComponentType, useEffect, useState } from 'react'; -import { __IntlProvider as IntlProvider } from '@kbn/i18n/react'; +import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; import { Observable } from 'rxjs'; import { CoreStart } from 'src/core/public'; import { text } from '@storybook/addon-knobs'; diff --git a/x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx b/x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx index 9e8480107c17d..445dab0406f8a 100644 --- a/x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx +++ b/x-pack/plugins/observability/public/components/shared/filter_value_label/filter_value_label.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { injectI18n } from '@kbn/i18n/react'; +import { injectI18n } from '@kbn/i18n-react'; import { esFilters, Filter, IndexPattern } from '../../../../../../../src/plugins/data/public'; import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/observability/public/components/shared/index.tsx b/x-pack/plugins/observability/public/components/shared/index.tsx index e73cab3e4fae5..03eac23062273 100644 --- a/x-pack/plugins/observability/public/components/shared/index.tsx +++ b/x-pack/plugins/observability/public/components/shared/index.tsx @@ -11,7 +11,7 @@ import type { CoreVitalProps, HeaderMenuPortalProps } from './types'; import type { FieldValueSuggestionsProps } from './field_value_suggestions/types'; import type { FilterValueLabelProps } from './filter_value_label/filter_value_label'; import type { SelectableUrlListProps } from './exploratory_view/components/url_search/selectable_url_list'; - +import type { ExploratoryViewPageProps } from './exploratory_view/index'; export { createLazyObservabilityPageTemplate } from './page_template'; export type { LazyObservabilityPageTemplateProps } from './page_template'; @@ -66,3 +66,13 @@ export function SelectableUrlList(props: SelectableUrlListProps) { ); } + +const ExploratoryViewLazy = lazy(() => import('./exploratory_view/index')); + +export function ExploratoryView(props: ExploratoryViewPageProps) { + return ( + + + + ); +} diff --git a/x-pack/plugins/observability/public/components/shared/page_template/page_template.test.tsx b/x-pack/plugins/observability/public/components/shared/page_template/page_template.test.tsx index 42d520786afcf..7495b981c6b5e 100644 --- a/x-pack/plugins/observability/public/components/shared/page_template/page_template.test.tsx +++ b/x-pack/plugins/observability/public/components/shared/page_template/page_template.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { render } from '@testing-library/react'; import { shallow } from 'enzyme'; import React from 'react'; diff --git a/x-pack/plugins/observability/public/context/has_data_context.test.tsx b/x-pack/plugins/observability/public/context/has_data_context.test.tsx index 1eb4108b12181..f5eb80fdf0342 100644 --- a/x-pack/plugins/observability/public/context/has_data_context.test.tsx +++ b/x-pack/plugins/observability/public/context/has_data_context.test.tsx @@ -96,7 +96,7 @@ describe('HasDataContextProvider', () => { infra_logs: { hasData: undefined, status: 'success' }, infra_metrics: { hasData: undefined, status: 'success' }, ux: { hasData: undefined, status: 'success' }, - alert: { hasData: [], status: 'success' }, + alert: { hasData: false, status: 'success' }, }, hasAnyData: false, isAllRequestsComplete: true, @@ -152,7 +152,7 @@ describe('HasDataContextProvider', () => { hasData: false, status: 'success', }, - alert: { hasData: [], status: 'success' }, + alert: { hasData: false, status: 'success' }, }, hasAnyData: false, isAllRequestsComplete: true, @@ -210,7 +210,7 @@ describe('HasDataContextProvider', () => { indices: 'apm-*', status: 'success', }, - alert: { hasData: [], status: 'success' }, + alert: { hasData: false, status: 'success' }, }, hasAnyData: true, isAllRequestsComplete: true, @@ -272,7 +272,7 @@ describe('HasDataContextProvider', () => { indices: 'apm-*', status: 'success', }, - alert: { hasData: [], status: 'success' }, + alert: { hasData: false, status: 'success' }, }, hasAnyData: true, isAllRequestsComplete: true, @@ -315,7 +315,7 @@ describe('HasDataContextProvider', () => { infra_logs: { hasData: undefined, status: 'success' }, infra_metrics: { hasData: undefined, status: 'success' }, ux: { hasData: undefined, status: 'success' }, - alert: { hasData: [], status: 'success' }, + alert: { hasData: false, status: 'success' }, }, hasAnyData: true, isAllRequestsComplete: true, @@ -364,7 +364,7 @@ describe('HasDataContextProvider', () => { infra_logs: { hasData: undefined, status: 'success' }, infra_metrics: { hasData: undefined, status: 'success' }, ux: { hasData: undefined, status: 'success' }, - alert: { hasData: [], status: 'success' }, + alert: { hasData: false, status: 'success' }, }, hasAnyData: false, isAllRequestsComplete: true, @@ -429,7 +429,7 @@ describe('HasDataContextProvider', () => { indices: 'apm-*', status: 'success', }, - alert: { hasData: [], status: 'success' }, + alert: { hasData: false, status: 'success' }, }, hasAnyData: true, isAllRequestsComplete: true, @@ -498,7 +498,7 @@ describe('HasDataContextProvider', () => { infra_logs: { hasData: undefined, status: 'failure' }, infra_metrics: { hasData: undefined, status: 'failure' }, ux: { hasData: undefined, status: 'failure' }, - alert: { hasData: [], status: 'success' }, + alert: { hasData: false, status: 'success' }, }, hasAnyData: false, isAllRequestsComplete: true, @@ -527,7 +527,7 @@ describe('HasDataContextProvider', () => { } as PluginContextValue); }); - it('returns all alerts available', async () => { + it('returns if alerts are available', async () => { const { result, waitForNextUpdate } = renderHook(() => useHasData(), { wrapper }); expect(result.current).toEqual({ hasDataMap: {}, @@ -549,10 +549,7 @@ describe('HasDataContextProvider', () => { infra_metrics: { hasData: undefined, status: 'success' }, ux: { hasData: undefined, status: 'success' }, alert: { - hasData: [ - { id: 2, consumer: 'apm' }, - { id: 3, consumer: 'uptime' }, - ], + hasData: true, status: 'success', }, }, diff --git a/x-pack/plugins/observability/public/context/has_data_context.tsx b/x-pack/plugins/observability/public/context/has_data_context.tsx index b6a45784a53b4..891c21a5b1eca 100644 --- a/x-pack/plugins/observability/public/context/has_data_context.tsx +++ b/x-pack/plugins/observability/public/context/has_data_context.tsx @@ -9,7 +9,6 @@ import { isEmpty, uniqueId } from 'lodash'; import React, { createContext, useEffect, useState } from 'react'; import { useRouteMatch } from 'react-router-dom'; import { asyncForEach } from '@kbn/std'; -import { Alert } from '../../../alerting/common'; import { getDataHandler } from '../data_handler'; import { FETCH_STATUS } from '../hooks/use_fetcher'; import { usePluginContext } from '../hooks/use_plugin_context'; @@ -24,7 +23,7 @@ export type HasDataMap = Record< DataContextApps, { status: FETCH_STATUS; - hasData?: boolean | Alert[]; + hasData?: boolean; indices?: string | ApmIndicesConfig; serviceName?: string; } @@ -123,7 +122,7 @@ export function HasDataContextProvider({ children }: { children: React.ReactNode setHasDataMap((prevState) => ({ ...prevState, alert: { - hasData: alerts, + hasData: alerts.length > 0, status: FETCH_STATUS.SUCCESS, }, })); @@ -148,9 +147,7 @@ export function HasDataContextProvider({ children }: { children: React.ReactNode const hasAnyData = (Object.keys(hasDataMap) as ObservabilityFetchDataPlugins[]).some((app) => { const appHasData = hasDataMap[app]?.hasData; - return ( - appHasData === true || (Array.isArray(appHasData) && (appHasData as Alert[])?.length > 0) - ); + return appHasData === true; }); return ( diff --git a/x-pack/plugins/observability/public/hooks/use_breadcrumbs.ts b/x-pack/plugins/observability/public/hooks/use_breadcrumbs.ts index 241a978d36948..899308e6d73bf 100644 --- a/x-pack/plugins/observability/public/hooks/use_breadcrumbs.ts +++ b/x-pack/plugins/observability/public/hooks/use_breadcrumbs.ts @@ -34,7 +34,10 @@ function getTitleFromBreadCrumbs(breadcrumbs: ChromeBreadcrumb[]) { return breadcrumbs.map(({ text }) => text?.toString() ?? '').reverse(); } -export const useBreadcrumbs = (extraCrumbs: ChromeBreadcrumb[]) => { +export const useBreadcrumbs = ( + extraCrumbs: ChromeBreadcrumb[], + app?: { id: string; label: string } +) => { const params = useQueryParams(); const { @@ -44,14 +47,16 @@ export const useBreadcrumbs = (extraCrumbs: ChromeBreadcrumb[]) => { }, } = useKibana(); const setTitle = docTitle.change; - const appPath = getUrlForApp('observability-overview') ?? ''; + const appPath = getUrlForApp(app?.id ?? 'observability-overview') ?? ''; useEffect(() => { const breadcrumbs = [ { - text: i18n.translate('xpack.observability.breadcrumbs.observabilityLinkText', { - defaultMessage: 'Observability', - }), + text: + app?.label ?? + i18n.translate('xpack.observability.breadcrumbs.observabilityLinkText', { + defaultMessage: 'Observability', + }), href: appPath + '/overview', }, ...extraCrumbs, @@ -62,5 +67,5 @@ export const useBreadcrumbs = (extraCrumbs: ChromeBreadcrumb[]) => { if (setTitle) { setTitle(getTitleFromBreadCrumbs(breadcrumbs)); } - }, [appPath, extraCrumbs, navigateToUrl, params, setBreadcrumbs, setTitle]); + }, [app?.label, appPath, extraCrumbs, navigateToUrl, params, setBreadcrumbs, setTitle]); }; diff --git a/x-pack/plugins/observability/public/index.ts b/x-pack/plugins/observability/public/index.ts index a4ce62ddde0c7..0dab3e5135717 100644 --- a/x-pack/plugins/observability/public/index.ts +++ b/x-pack/plugins/observability/public/index.ts @@ -47,6 +47,7 @@ export { FieldValueSuggestions, FilterValueLabel, SelectableUrlList, + ExploratoryView, } from './components/shared/'; export type { LazyObservabilityPageTemplateProps } from './components/shared'; @@ -87,3 +88,9 @@ export { InspectorContextProvider } from './context/inspector/inspector_context' export { useInspectorContext } from './context/inspector/use_inspector_context'; export { enableComparisonByDefault } from '../common/ui_settings_keys'; +export type { SeriesConfig, ConfigProps } from './components/shared/exploratory_view/types'; +export { + ReportTypes, + REPORT_METRIC_FIELD, +} from './components/shared/exploratory_view/configurations/constants'; +export { ExploratoryViewContextProvider } from './components/shared/exploratory_view/contexts/exploatory_view_config'; diff --git a/x-pack/plugins/observability/public/pages/alerts/alerts_disclaimer.tsx b/x-pack/plugins/observability/public/pages/alerts/alerts_disclaimer.tsx index 1d1aaf12cf785..4b465a1091965 100644 --- a/x-pack/plugins/observability/public/pages/alerts/alerts_disclaimer.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/alerts_disclaimer.tsx @@ -8,7 +8,7 @@ import React, { useState } from 'react'; import { EuiLink, EuiCallOut, EuiButton, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; const LOCAL_STORAGE_KEY_MSG_ACK = 'xpack.observability.alert.ack.experimental.message'; diff --git a/x-pack/plugins/observability/public/pages/alerts/alerts_table_t_grid.tsx b/x-pack/plugins/observability/public/pages/alerts/alerts_table_t_grid.tsx index b862924fbcd25..69a6672db6e98 100644 --- a/x-pack/plugins/observability/public/pages/alerts/alerts_table_t_grid.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/alerts_table_t_grid.tsx @@ -34,12 +34,18 @@ import { import styled from 'styled-components'; import React, { Suspense, useMemo, useState, useCallback, useEffect } from 'react'; import usePrevious from 'react-use/lib/usePrevious'; -import { get } from 'lodash'; +import { get, pick } from 'lodash'; import { getAlertsPermissions, useGetUserAlertsPermissions, } from '../../hooks/use_alert_permission'; -import type { TimelinesUIStart, TGridType, SortDirection } from '../../../../timelines/public'; +import type { + TimelinesUIStart, + TGridType, + TGridState, + TGridModel, + SortDirection, +} from '../../../../timelines/public'; import { useStatusBulkActionItems } from '../../../../timelines/public'; import type { TopAlert } from './'; import { useKibana } from '../../../../../../src/plugins/kibana_react/public'; @@ -60,6 +66,8 @@ import { parseAlert } from './parse_alert'; import { CoreStart } from '../../../../../../src/core/public'; import { translations, paths } from '../../config'; +const ALERT_TABLE_STATE_STORAGE_KEY = 'xpack.observability.alert.tableState'; + interface AlertsTableTGridProps { indexNames: string[]; rangeFrom: string; @@ -330,6 +338,9 @@ export function AlertsTableTGrid(props: AlertsTableTGridProps) { } = useKibana().services; const [flyoutAlert, setFlyoutAlert] = useState(undefined); + const [tGridState, setTGridState] = useState | null>( + JSON.parse(localStorage.getItem(ALERT_TABLE_STATE_STORAGE_KEY) ?? 'null') + ); const casePermissions = useGetUserCasesPermissions(); @@ -351,6 +362,20 @@ export function AlertsTableTGrid(props: AlertsTableTGridProps) { } }, [workflowStatus, prevWorkflowStatus]); + useEffect(() => { + if (tGridState) { + const newState = JSON.stringify({ + ...tGridState, + columns: tGridState.columns?.map((c) => + pick(c, ['columnHeaderType', 'displayAsText', 'id', 'initialWidth', 'linkField']) + ), + }); + if (newState !== localStorage.getItem(ALERT_TABLE_STATE_STORAGE_KEY)) { + localStorage.setItem(ALERT_TABLE_STATE_STORAGE_KEY, newState); + } + } + }, [tGridState]); + const setEventsDeleted = useCallback((action) => { if (action.isDeleted) { setDeletedEventIds((ids) => [...ids, ...action.eventIds]); @@ -379,6 +404,20 @@ export function AlertsTableTGrid(props: AlertsTableTGridProps) { ]; }, [workflowStatus, setEventsDeleted]); + const onStateChange = useCallback( + (state: TGridState) => { + const pickedState = pick(state.timelineById['standalone-t-grid'], [ + 'columns', + 'sort', + 'selectedEventIds', + ]); + if (JSON.stringify(pickedState) !== JSON.stringify(tGridState)) { + setTGridState(pickedState); + } + }, + [tGridState] + ); + const tGridProps = useMemo(() => { const type: TGridType = 'standalone'; const sortDirection: SortDirection = 'desc'; @@ -387,7 +426,7 @@ export function AlertsTableTGrid(props: AlertsTableTGridProps) { casesOwner: observabilityFeatureId, casePermissions, type, - columns, + columns: tGridState?.columns ?? columns, deletedEventIds, defaultCellActions: getDefaultCellActions({ addToQuery }), disabledCellActions: FIELDS_WITHOUT_CELL_ACTIONS, @@ -398,6 +437,7 @@ export function AlertsTableTGrid(props: AlertsTableTGridProps) { itemsPerPageOptions: [10, 25, 50], loadingText: translations.alertsTable.loadingTextLabel, footerText: translations.alertsTable.footerTextLabel, + onStateChange, query: { query: `${ALERT_WORKFLOW_STATUS}: ${workflowStatus}${kuery !== '' ? ` and ${kuery}` : ''}`, language: 'kuery', @@ -408,7 +448,7 @@ export function AlertsTableTGrid(props: AlertsTableTGridProps) { runtimeMappings: {}, start: rangeFrom, setRefetch, - sort: [ + sort: tGridState?.sort ?? [ { columnId: '@timestamp', columnType: 'date', @@ -432,6 +472,8 @@ export function AlertsTableTGrid(props: AlertsTableTGridProps) { setRefetch, leadingControlColumns, deletedEventIds, + onStateChange, + tGridState, ]); const handleFlyoutClose = () => setFlyoutAlert(undefined); diff --git a/x-pack/plugins/observability/public/pages/overview/empty_section.ts b/x-pack/plugins/observability/public/pages/overview/empty_section.ts index f249a820a60a4..2747b2ecdebc9 100644 --- a/x-pack/plugins/observability/public/pages/overview/empty_section.ts +++ b/x-pack/plugins/observability/public/pages/overview/empty_section.ts @@ -69,7 +69,7 @@ export const getEmptySections = ({ core }: { core: CoreStart }): ISection[] => { linkTitle: i18n.translate('xpack.observability.emptySection.apps.uptime.link', { defaultMessage: 'Install Heartbeat', }), - href: core.http.basePath.prepend('/app/integrations/detail/synthetics/overview'), + href: core.http.basePath.prepend('/app/home#/tutorial/uptimeMonitors'), }, { id: 'ux', diff --git a/x-pack/plugins/observability/public/pages/overview/index.tsx b/x-pack/plugins/observability/public/pages/overview/index.tsx index b817a83d59e0d..7100a0552876d 100644 --- a/x-pack/plugins/observability/public/pages/overview/index.tsx +++ b/x-pack/plugins/observability/public/pages/overview/index.tsx @@ -9,7 +9,6 @@ import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiPanel } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; import { useTrackPageview } from '../..'; -import { Alert } from '../../../../alerting/common'; import { EmptySections } from '../../components/app/empty_sections'; import { ObservabilityHeaderMenu } from '../../components/app/header'; import { NewsFeed } from '../../components/app/news_feed'; @@ -72,8 +71,6 @@ export function OverviewPage({ routeParams }: Props) { docsLink: core.docLinks.links.observability.guide, }); - const alerts = (hasDataMap.alert?.hasData as Alert[]) || []; - const { refreshInterval = 10000, refreshPaused = true } = routeParams.query; const bucketSize = calculateBucketSize({ @@ -118,10 +115,10 @@ export function OverviewPage({ routeParams }: Props) { {!!newsFeed?.items?.length && } - {!!alerts.length && ( + {hasDataMap?.alert?.hasData && ( - + )} diff --git a/x-pack/plugins/observability/public/routes/index.tsx b/x-pack/plugins/observability/public/routes/index.tsx index a684feec535fc..169f4b5254c04 100644 --- a/x-pack/plugins/observability/public/routes/index.tsx +++ b/x-pack/plugins/observability/public/routes/index.tsx @@ -8,13 +8,13 @@ import * as t from 'io-ts'; import React from 'react'; import { casesPath } from '../../common'; -import { ExploratoryViewPage } from '../components/shared/exploratory_view'; import { AlertsPage } from '../pages/alerts'; import { CasesPage } from '../pages/cases'; import { HomePage } from '../pages/home'; import { LandingPage } from '../pages/landing'; import { OverviewPage } from '../pages/overview'; import { jsonRt } from './json_rt'; +import { ObservabilityExploratoryView } from '../components/shared/exploratory_view/obsv_exploratory_view'; export type RouteParams = DecodeParams; @@ -74,7 +74,7 @@ export const routes = { }, '/exploratory-view/': { handler: () => { - return ; + return ; }, params: { query: t.partial({ diff --git a/x-pack/plugins/observability/public/utils/test_helper.tsx b/x-pack/plugins/observability/public/utils/test_helper.tsx index eb7efbd90c6ba..544f3feecb2bb 100644 --- a/x-pack/plugins/observability/public/utils/test_helper.tsx +++ b/x-pack/plugins/observability/public/utils/test_helper.tsx @@ -8,7 +8,7 @@ import { render as testLibRender } from '@testing-library/react'; import { AppMountParameters, CoreStart } from 'kibana/public'; import React from 'react'; -import { __IntlProvider as IntlProvider } from '@kbn/i18n/react'; +import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; import { of } from 'rxjs'; import { KibanaContextProvider, diff --git a/x-pack/plugins/osquery/public/action_results/action_agents_status.tsx b/x-pack/plugins/osquery/public/action_results/action_agents_status.tsx index ecc0f361b76a0..f5b952af8acd4 100644 --- a/x-pack/plugins/osquery/public/action_results/action_agents_status.tsx +++ b/x-pack/plugins/osquery/public/action_results/action_agents_status.tsx @@ -6,7 +6,7 @@ */ import { EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useEffect, useMemo, useState } from 'react'; import { Direction } from '../../common/search_strategy'; diff --git a/x-pack/plugins/osquery/public/application.tsx b/x-pack/plugins/osquery/public/application.tsx index 3e046a138cd4b..20d5132f5c452 100644 --- a/x-pack/plugins/osquery/public/application.tsx +++ b/x-pack/plugins/osquery/public/application.tsx @@ -10,7 +10,7 @@ import { euiLightVars, euiDarkVars } from '@kbn/ui-shared-deps-src/theme'; import React, { useMemo } from 'react'; import ReactDOM from 'react-dom'; import { Router } from 'react-router-dom'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { ThemeProvider } from 'styled-components'; import { QueryClientProvider } from 'react-query'; import { ReactQueryDevtools } from 'react-query/devtools'; diff --git a/x-pack/plugins/osquery/public/components/app.tsx b/x-pack/plugins/osquery/public/components/app.tsx index ef249d5b8c7aa..fe6d2de676d8b 100644 --- a/x-pack/plugins/osquery/public/components/app.tsx +++ b/x-pack/plugins/osquery/public/components/app.tsx @@ -8,7 +8,7 @@ /* eslint-disable react-hooks/rules-of-hooks */ import React, { useMemo } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, EuiFlexGroup, diff --git a/x-pack/plugins/osquery/public/components/empty_state.tsx b/x-pack/plugins/osquery/public/components/empty_state.tsx index 5be37337c4ba2..1ca16dae28deb 100644 --- a/x-pack/plugins/osquery/public/components/empty_state.tsx +++ b/x-pack/plugins/osquery/public/components/empty_state.tsx @@ -6,7 +6,7 @@ */ import React, { useCallback, useMemo } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton } from '@elastic/eui'; import { KibanaPageTemplate } from '../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/osquery/public/components/manage_integration_link.tsx b/x-pack/plugins/osquery/public/components/manage_integration_link.tsx index 208d8e3f28172..4eedf58466383 100644 --- a/x-pack/plugins/osquery/public/components/manage_integration_link.tsx +++ b/x-pack/plugins/osquery/public/components/manage_integration_link.tsx @@ -6,7 +6,7 @@ */ import React, { useCallback, useMemo } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, EuiFlexItem } from '@elastic/eui'; import { INTEGRATIONS_PLUGIN_ID } from '../../../fleet/common'; diff --git a/x-pack/plugins/osquery/public/components/osquery_schema_link.tsx b/x-pack/plugins/osquery/public/components/osquery_schema_link.tsx index 77af34b405876..53e1cfe220567 100644 --- a/x-pack/plugins/osquery/public/components/osquery_schema_link.tsx +++ b/x-pack/plugins/osquery/public/components/osquery_schema_link.tsx @@ -6,7 +6,7 @@ */ import { EuiText, EuiLink } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; export const OsquerySchemaLink = React.memo(() => ( diff --git a/x-pack/plugins/osquery/public/fleet_integration/config_uploader.tsx b/x-pack/plugins/osquery/public/fleet_integration/config_uploader.tsx index 95ccc0e5cccf5..5f07a3a5740cd 100644 --- a/x-pack/plugins/osquery/public/fleet_integration/config_uploader.tsx +++ b/x-pack/plugins/osquery/public/fleet_integration/config_uploader.tsx @@ -8,7 +8,7 @@ import { EuiLink, EuiFormRow, EuiFilePicker, EuiSpacer } from '@elastic/eui'; import React, { useCallback, useState, useRef } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; const SUPPORTED_CONFIG_EXTENSIONS = ['application/json', 'text/plain']; diff --git a/x-pack/plugins/osquery/public/live_queries/form/index.tsx b/x-pack/plugins/osquery/public/live_queries/form/index.tsx index b8a9de25ac7f8..195b92c02a225 100644 --- a/x-pack/plugins/osquery/public/live_queries/form/index.tsx +++ b/x-pack/plugins/osquery/public/live_queries/form/index.tsx @@ -17,7 +17,7 @@ import { } from '@elastic/eui'; import { EuiContainedStepProps } from '@elastic/eui/src/components/steps/steps'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useCallback, useEffect, useMemo, useState, useRef } from 'react'; import { useMutation } from 'react-query'; import deepMerge from 'deepmerge'; diff --git a/x-pack/plugins/osquery/public/live_queries/index.tsx b/x-pack/plugins/osquery/public/live_queries/index.tsx index 81d3a6592a3c9..2336a1de1d4a0 100644 --- a/x-pack/plugins/osquery/public/live_queries/index.tsx +++ b/x-pack/plugins/osquery/public/live_queries/index.tsx @@ -8,7 +8,7 @@ import { castArray } from 'lodash'; import { EuiCode, EuiLoadingContent, EuiEmptyPrompt } from '@elastic/eui'; import React, { useMemo } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { LiveQueryForm } from './form'; import { useActionResultsPrivileges } from '../action_results/use_action_privileges'; diff --git a/x-pack/plugins/osquery/public/packs/form/confirmation_modal.tsx b/x-pack/plugins/osquery/public/packs/form/confirmation_modal.tsx index bd0d083098473..2055825c314cb 100644 --- a/x-pack/plugins/osquery/public/packs/form/confirmation_modal.tsx +++ b/x-pack/plugins/osquery/public/packs/form/confirmation_modal.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiCallOut, EuiConfirmModal, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; interface ConfirmDeployAgentPolicyModalProps { diff --git a/x-pack/plugins/osquery/public/packs/form/index.tsx b/x-pack/plugins/osquery/public/packs/form/index.tsx index b0bf9b55e3fba..b68336e6705be 100644 --- a/x-pack/plugins/osquery/public/packs/form/index.tsx +++ b/x-pack/plugins/osquery/public/packs/form/index.tsx @@ -17,7 +17,7 @@ import { } from '@elastic/eui'; import React, { useCallback, useMemo, useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { OsqueryManagerPackagePolicy } from '../../../common/types'; import { diff --git a/x-pack/plugins/osquery/public/packs/form/pack_uploader.tsx b/x-pack/plugins/osquery/public/packs/form/pack_uploader.tsx index 6c3d90473c809..9a8156987a783 100644 --- a/x-pack/plugins/osquery/public/packs/form/pack_uploader.tsx +++ b/x-pack/plugins/osquery/public/packs/form/pack_uploader.tsx @@ -9,7 +9,7 @@ import { kebabCase } from 'lodash'; import { EuiLink, EuiFormRow, EuiFilePicker, EuiSpacer } from '@elastic/eui'; import React, { useCallback, useState, useRef } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; const SUPPORTED_PACK_EXTENSIONS = ['application/json', 'text/plain']; diff --git a/x-pack/plugins/osquery/public/packs/form/policy_id_combobox_field.tsx b/x-pack/plugins/osquery/public/packs/form/policy_id_combobox_field.tsx index 10149e8655d35..fa579b43b3159 100644 --- a/x-pack/plugins/osquery/public/packs/form/policy_id_combobox_field.tsx +++ b/x-pack/plugins/osquery/public/packs/form/policy_id_combobox_field.tsx @@ -6,7 +6,7 @@ */ import { reduce } from 'lodash'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, EuiTextColor, EuiComboBoxOptionOption } from '@elastic/eui'; import React, { useCallback, useMemo } from 'react'; import styled from 'styled-components'; diff --git a/x-pack/plugins/osquery/public/packs/form/queries_field.tsx b/x-pack/plugins/osquery/public/packs/form/queries_field.tsx index b4b67fc8929db..2ae946a0f2e8f 100644 --- a/x-pack/plugins/osquery/public/packs/form/queries_field.tsx +++ b/x-pack/plugins/osquery/public/packs/form/queries_field.tsx @@ -9,7 +9,7 @@ import { isEmpty, findIndex, forEach, pullAt, pullAllBy, pickBy } from 'lodash'; import { EuiFlexGroup, EuiFlexItem, EuiButton, EuiSpacer } from '@elastic/eui'; import { produce } from 'immer'; import React, { useCallback, useMemo, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { OsqueryManagerPackagePolicyInputStream } from '../../../common/types'; import { FieldHook } from '../../shared_imports'; diff --git a/x-pack/plugins/osquery/public/packs/pack_queries_status_table.tsx b/x-pack/plugins/osquery/public/packs/pack_queries_status_table.tsx index 5567d4562b1d8..9eb5cf3fee07d 100644 --- a/x-pack/plugins/osquery/public/packs/pack_queries_status_table.tsx +++ b/x-pack/plugins/osquery/public/packs/pack_queries_status_table.tsx @@ -21,7 +21,7 @@ import { EuiPanel, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage, FormattedDate, FormattedTime, FormattedRelative } from '@kbn/i18n/react'; +import { FormattedMessage, FormattedDate, FormattedTime, FormattedRelative } from '@kbn/i18n-react'; import moment from 'moment-timezone'; import { diff --git a/x-pack/plugins/osquery/public/packs/queries/ecs_mapping_editor_field.tsx b/x-pack/plugins/osquery/public/packs/queries/ecs_mapping_editor_field.tsx index 76805c452bf98..27b83a25bd756 100644 --- a/x-pack/plugins/osquery/public/packs/queries/ecs_mapping_editor_field.tsx +++ b/x-pack/plugins/osquery/public/packs/queries/ecs_mapping_editor_field.tsx @@ -44,7 +44,7 @@ import { EuiSuperSelect, } from '@elastic/eui'; import sqlParser from 'js-sql-parser'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import styled from 'styled-components'; import deepEqual from 'fast-deep-equal'; diff --git a/x-pack/plugins/osquery/public/packs/queries/platform_checkbox_group_field.tsx b/x-pack/plugins/osquery/public/packs/queries/platform_checkbox_group_field.tsx index 35f866ac6cffe..843fa41cfb0f6 100644 --- a/x-pack/plugins/osquery/public/packs/queries/platform_checkbox_group_field.tsx +++ b/x-pack/plugins/osquery/public/packs/queries/platform_checkbox_group_field.tsx @@ -14,7 +14,7 @@ import { EuiCheckboxGroup, EuiCheckboxGroupOption, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { FieldHook, getFieldValidityAndErrorMessage } from '../../shared_imports'; import { PlatformIcon } from './platforms/platform_icon'; diff --git a/x-pack/plugins/osquery/public/packs/queries/query_flyout.tsx b/x-pack/plugins/osquery/public/packs/queries/query_flyout.tsx index 0c08e781c9f2c..ab895c74b2a3e 100644 --- a/x-pack/plugins/osquery/public/packs/queries/query_flyout.tsx +++ b/x-pack/plugins/osquery/public/packs/queries/query_flyout.tsx @@ -21,7 +21,7 @@ import { } from '@elastic/eui'; import React, { useCallback, useMemo, useState, useRef } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { CodeEditorField } from '../../saved_queries/form/code_editor_field'; import { Form, getUseField, Field, useFormData } from '../../shared_imports'; diff --git a/x-pack/plugins/osquery/public/packs/queries/schema.tsx b/x-pack/plugins/osquery/public/packs/queries/schema.tsx index 596b65a518b0a..a92830cd57fe9 100644 --- a/x-pack/plugins/osquery/public/packs/queries/schema.tsx +++ b/x-pack/plugins/osquery/public/packs/queries/schema.tsx @@ -8,7 +8,7 @@ import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { FIELD_TYPES } from '../../shared_imports'; diff --git a/x-pack/plugins/osquery/public/results/results_table.tsx b/x-pack/plugins/osquery/public/results/results_table.tsx index 164d4fbdc878b..fe4f22563ab27 100644 --- a/x-pack/plugins/osquery/public/results/results_table.tsx +++ b/x-pack/plugins/osquery/public/results/results_table.tsx @@ -20,7 +20,7 @@ import { EuiIconTip, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { createContext, useEffect, useState, useCallback, useContext, useMemo } from 'react'; import { pagePathGetters } from '../../../fleet/public'; diff --git a/x-pack/plugins/osquery/public/routes/components/missing_privileges.tsx b/x-pack/plugins/osquery/public/routes/components/missing_privileges.tsx index 6adabff599124..b16b1c75dac59 100644 --- a/x-pack/plugins/osquery/public/routes/components/missing_privileges.tsx +++ b/x-pack/plugins/osquery/public/routes/components/missing_privileges.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiEmptyPrompt, EuiPanel, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import styled from 'styled-components'; const Panel = styled(EuiPanel)` diff --git a/x-pack/plugins/osquery/public/routes/live_queries/details/index.tsx b/x-pack/plugins/osquery/public/routes/live_queries/details/index.tsx index 116430d026a79..3a65ad18d21a0 100644 --- a/x-pack/plugins/osquery/public/routes/live_queries/details/index.tsx +++ b/x-pack/plugins/osquery/public/routes/live_queries/details/index.tsx @@ -14,7 +14,7 @@ import { EuiSpacer, EuiText, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useMemo } from 'react'; import { useParams } from 'react-router-dom'; diff --git a/x-pack/plugins/osquery/public/routes/live_queries/list/index.tsx b/x-pack/plugins/osquery/public/routes/live_queries/list/index.tsx index ccf9b655a96d7..6872f2ac38b02 100644 --- a/x-pack/plugins/osquery/public/routes/live_queries/list/index.tsx +++ b/x-pack/plugins/osquery/public/routes/live_queries/list/index.tsx @@ -6,7 +6,7 @@ */ import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useMemo } from 'react'; import { useKibana, useRouterNavigate } from '../../../common/lib/kibana'; diff --git a/x-pack/plugins/osquery/public/routes/live_queries/new/index.tsx b/x-pack/plugins/osquery/public/routes/live_queries/new/index.tsx index 2d2f6bac55144..be8831860c9ec 100644 --- a/x-pack/plugins/osquery/public/routes/live_queries/new/index.tsx +++ b/x-pack/plugins/osquery/public/routes/live_queries/new/index.tsx @@ -6,7 +6,7 @@ */ import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useEffect, useMemo, useState } from 'react'; import { useHistory, useLocation } from 'react-router-dom'; import qs from 'query-string'; diff --git a/x-pack/plugins/osquery/public/routes/packs/add/index.tsx b/x-pack/plugins/osquery/public/routes/packs/add/index.tsx index bd9abd7ff2625..82f97f38c0756 100644 --- a/x-pack/plugins/osquery/public/routes/packs/add/index.tsx +++ b/x-pack/plugins/osquery/public/routes/packs/add/index.tsx @@ -6,7 +6,7 @@ */ import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useMemo } from 'react'; import { WithHeaderLayout } from '../../../components/layouts'; diff --git a/x-pack/plugins/osquery/public/routes/packs/details/index.tsx b/x-pack/plugins/osquery/public/routes/packs/details/index.tsx index f81150468d018..cf114005258f3 100644 --- a/x-pack/plugins/osquery/public/routes/packs/details/index.tsx +++ b/x-pack/plugins/osquery/public/routes/packs/details/index.tsx @@ -16,7 +16,7 @@ import { EuiSpacer, EuiText, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useMemo } from 'react'; import { useParams } from 'react-router-dom'; import styled from 'styled-components'; diff --git a/x-pack/plugins/osquery/public/routes/packs/edit/index.tsx b/x-pack/plugins/osquery/public/routes/packs/edit/index.tsx index a5935243d763e..2409a9524a8c2 100644 --- a/x-pack/plugins/osquery/public/routes/packs/edit/index.tsx +++ b/x-pack/plugins/osquery/public/routes/packs/edit/index.tsx @@ -14,7 +14,7 @@ import { EuiLoadingContent, EuiText, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useCallback, useMemo, useState } from 'react'; import { useParams } from 'react-router-dom'; diff --git a/x-pack/plugins/osquery/public/routes/packs/list/index.tsx b/x-pack/plugins/osquery/public/routes/packs/list/index.tsx index 6f084e9e6bf25..c4b9f94b32287 100644 --- a/x-pack/plugins/osquery/public/routes/packs/list/index.tsx +++ b/x-pack/plugins/osquery/public/routes/packs/list/index.tsx @@ -6,7 +6,7 @@ */ import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useMemo } from 'react'; import { useKibana, useRouterNavigate } from '../../../common/lib/kibana'; diff --git a/x-pack/plugins/osquery/public/routes/saved_queries/edit/form.tsx b/x-pack/plugins/osquery/public/routes/saved_queries/edit/form.tsx index c26bdb4270412..432a108c8ece3 100644 --- a/x-pack/plugins/osquery/public/routes/saved_queries/edit/form.tsx +++ b/x-pack/plugins/osquery/public/routes/saved_queries/edit/form.tsx @@ -14,7 +14,7 @@ import { EuiSpacer, } from '@elastic/eui'; import React, { useRef } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useRouterNavigate } from '../../../common/lib/kibana'; import { Form } from '../../../shared_imports'; diff --git a/x-pack/plugins/osquery/public/routes/saved_queries/edit/index.tsx b/x-pack/plugins/osquery/public/routes/saved_queries/edit/index.tsx index df9576c0070a8..555a9ce973407 100644 --- a/x-pack/plugins/osquery/public/routes/saved_queries/edit/index.tsx +++ b/x-pack/plugins/osquery/public/routes/saved_queries/edit/index.tsx @@ -15,7 +15,7 @@ import { } from '@elastic/eui'; import { isEmpty } from 'lodash/fp'; import React, { useCallback, useMemo, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useParams } from 'react-router-dom'; import { useKibana, useRouterNavigate } from '../../../common/lib/kibana'; diff --git a/x-pack/plugins/osquery/public/routes/saved_queries/list/index.tsx b/x-pack/plugins/osquery/public/routes/saved_queries/list/index.tsx index f59a07763f0fa..0bb162173adc1 100644 --- a/x-pack/plugins/osquery/public/routes/saved_queries/list/index.tsx +++ b/x-pack/plugins/osquery/public/routes/saved_queries/list/index.tsx @@ -16,7 +16,7 @@ import { } from '@elastic/eui'; import React, { useCallback, useMemo, useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useHistory } from 'react-router-dom'; import { SavedObject } from 'kibana/public'; diff --git a/x-pack/plugins/osquery/public/routes/saved_queries/new/form.tsx b/x-pack/plugins/osquery/public/routes/saved_queries/new/form.tsx index 61492d24e5a09..80899c476f2a3 100644 --- a/x-pack/plugins/osquery/public/routes/saved_queries/new/form.tsx +++ b/x-pack/plugins/osquery/public/routes/saved_queries/new/form.tsx @@ -14,7 +14,7 @@ import { EuiSpacer, } from '@elastic/eui'; import React, { useRef } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useRouterNavigate } from '../../../common/lib/kibana'; import { Form } from '../../../shared_imports'; diff --git a/x-pack/plugins/osquery/public/routes/saved_queries/new/index.tsx b/x-pack/plugins/osquery/public/routes/saved_queries/new/index.tsx index 2a09a4c4ee556..8bee69aba74cf 100644 --- a/x-pack/plugins/osquery/public/routes/saved_queries/new/index.tsx +++ b/x-pack/plugins/osquery/public/routes/saved_queries/new/index.tsx @@ -7,7 +7,7 @@ import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; import React, { useMemo } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useRouterNavigate } from '../../../common/lib/kibana'; import { WithHeaderLayout } from '../../../components/layouts'; diff --git a/x-pack/plugins/osquery/public/saved_queries/form/index.tsx b/x-pack/plugins/osquery/public/saved_queries/form/index.tsx index 314c5e07b0b2a..33bb7672618e4 100644 --- a/x-pack/plugins/osquery/public/saved_queries/form/index.tsx +++ b/x-pack/plugins/osquery/public/saved_queries/form/index.tsx @@ -22,7 +22,7 @@ import React, { useState, } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ALL_OSQUERY_VERSIONS_OPTIONS } from '../../packs/queries/constants'; import { PlatformCheckBoxGroupField } from '../../packs/queries/platform_checkbox_group_field'; diff --git a/x-pack/plugins/osquery/public/saved_queries/form/playground_flyout.tsx b/x-pack/plugins/osquery/public/saved_queries/form/playground_flyout.tsx index 5e8bb725dd5a2..f0b9fc1e935cb 100644 --- a/x-pack/plugins/osquery/public/saved_queries/form/playground_flyout.tsx +++ b/x-pack/plugins/osquery/public/saved_queries/form/playground_flyout.tsx @@ -8,7 +8,7 @@ import { EuiFlyout, EuiFlyoutHeader, EuiTitle, EuiFlyoutBody } from '@elastic/eui'; import React from 'react'; import styled from 'styled-components'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { LiveQuery } from '../../live_queries'; import { useFormData } from '../../shared_imports'; diff --git a/x-pack/plugins/osquery/public/saved_queries/saved_queries_dropdown.tsx b/x-pack/plugins/osquery/public/saved_queries/saved_queries_dropdown.tsx index 7a652720e9cb1..32812b9331811 100644 --- a/x-pack/plugins/osquery/public/saved_queries/saved_queries_dropdown.tsx +++ b/x-pack/plugins/osquery/public/saved_queries/saved_queries_dropdown.tsx @@ -10,7 +10,7 @@ import { EuiCodeBlock, EuiFormRow, EuiComboBox, EuiTextColor } from '@elastic/eu import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { SimpleSavedObject } from 'kibana/public'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import styled from 'styled-components'; import deepEqual from 'fast-deep-equal'; diff --git a/x-pack/plugins/osquery/public/saved_queries/saved_query_flyout.tsx b/x-pack/plugins/osquery/public/saved_queries/saved_query_flyout.tsx index 2c1d00ac1031d..7339ff20093fc 100644 --- a/x-pack/plugins/osquery/public/saved_queries/saved_query_flyout.tsx +++ b/x-pack/plugins/osquery/public/saved_queries/saved_query_flyout.tsx @@ -18,7 +18,7 @@ import { EuiButton, } from '@elastic/eui'; import React, { useCallback, useRef } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Form } from '../shared_imports'; import { useSavedQueryForm } from './form/use_saved_query_form'; diff --git a/x-pack/plugins/painless_lab/public/application/components/output_pane/context_tab.tsx b/x-pack/plugins/painless_lab/public/application/components/output_pane/context_tab.tsx index 386565008b8ec..cc726f29e3a76 100644 --- a/x-pack/plugins/painless_lab/public/application/components/output_pane/context_tab.tsx +++ b/x-pack/plugins/painless_lab/public/application/components/output_pane/context_tab.tsx @@ -16,7 +16,7 @@ import { EuiText, EuiSuperSelect, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { PainlessContext } from '@kbn/monaco'; diff --git a/x-pack/plugins/painless_lab/public/application/components/output_pane/parameters_tab.tsx b/x-pack/plugins/painless_lab/public/application/components/output_pane/parameters_tab.tsx index 370d542665977..c0233947ff064 100644 --- a/x-pack/plugins/painless_lab/public/application/components/output_pane/parameters_tab.tsx +++ b/x-pack/plugins/painless_lab/public/application/components/output_pane/parameters_tab.tsx @@ -7,7 +7,7 @@ import React, { FunctionComponent } from 'react'; import { EuiFormRow, EuiSpacer, EuiIcon, EuiToolTip, EuiLink, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { monaco } from '@kbn/monaco'; import { i18n } from '@kbn/i18n'; import { CodeEditor } from '../../../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/remote_clusters/public/application/sections/components/configured_by_node_warning/configured_by_node_warning.js b/x-pack/plugins/remote_clusters/public/application/sections/components/configured_by_node_warning/configured_by_node_warning.js index 79022b99d903a..a13c455bc9298 100644 --- a/x-pack/plugins/remote_clusters/public/application/sections/components/configured_by_node_warning/configured_by_node_warning.js +++ b/x-pack/plugins/remote_clusters/public/application/sections/components/configured_by_node_warning/configured_by_node_warning.js @@ -9,7 +9,7 @@ import React from 'react'; import { EuiCallOut } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function ConfiguredByNodeWarning() { return ( diff --git a/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/components/cloud_url_help.tsx b/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/components/cloud_url_help.tsx index 1d4862ff094ce..504d77514e654 100644 --- a/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/components/cloud_url_help.tsx +++ b/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/components/cloud_url_help.tsx @@ -6,7 +6,7 @@ */ import React, { FunctionComponent, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiLink, EuiPopover, EuiPopoverTitle, EuiText } from '@elastic/eui'; import { useAppContext } from '../../../../app_context'; diff --git a/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/components/connection_mode.tsx b/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/components/connection_mode.tsx index d06b4f111ec92..1808a519ccac6 100644 --- a/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/components/connection_mode.tsx +++ b/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/components/connection_mode.tsx @@ -6,7 +6,7 @@ */ import React, { FunctionComponent } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiTitle, EuiFormRow, EuiSwitch, EuiSpacer } from '@elastic/eui'; diff --git a/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/components/proxy_connection.tsx b/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/components/proxy_connection.tsx index 04e8533a0d2af..2158b497016da 100644 --- a/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/components/proxy_connection.tsx +++ b/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/components/proxy_connection.tsx @@ -6,7 +6,7 @@ */ import React, { FunctionComponent } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiFieldNumber, EuiFieldText, EuiFormRow, EuiLink } from '@elastic/eui'; import { useAppContext } from '../../../../app_context'; diff --git a/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/components/sniff_connection.tsx b/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/components/sniff_connection.tsx index 063aeb3490aef..8d853c8b6765d 100644 --- a/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/components/sniff_connection.tsx +++ b/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/components/sniff_connection.tsx @@ -6,7 +6,7 @@ */ import React, { FunctionComponent, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiComboBox, diff --git a/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/remote_cluster_form.tsx b/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/remote_cluster_form.tsx index fdcbf220331d7..77d2db417f904 100644 --- a/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/remote_cluster_form.tsx +++ b/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/remote_cluster_form.tsx @@ -8,7 +8,7 @@ import React, { Component, Fragment } from 'react'; import { merge } from 'lodash'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiButtonEmpty, diff --git a/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/request_flyout.tsx b/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/request_flyout.tsx index 55bd2bec71633..75f45b9a56566 100644 --- a/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/request_flyout.tsx +++ b/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/request_flyout.tsx @@ -6,7 +6,7 @@ */ import React, { PureComponent } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, diff --git a/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/validators/validate_cloud_url.tsx b/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/validators/validate_cloud_url.tsx index 1f4862f0113e7..deb0148f36edf 100644 --- a/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/validators/validate_cloud_url.tsx +++ b/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/validators/validate_cloud_url.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Cluster } from '../../../../../../common/lib'; import { isAddressValid } from './validate_address'; diff --git a/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/validators/validate_name.tsx b/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/validators/validate_name.tsx index 6a3521b1a9adc..f128b3a94b63e 100644 --- a/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/validators/validate_name.tsx +++ b/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/validators/validate_name.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function validateName(name?: string | null): null | JSX.Element { if (!name || !name.trim()) { diff --git a/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/validators/validate_proxy.tsx b/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/validators/validate_proxy.tsx index 2adbe154ad327..fd539839ba6f7 100644 --- a/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/validators/validate_proxy.tsx +++ b/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/validators/validate_proxy.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { isAddressValid, isPortValid } from './validate_address'; diff --git a/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/validators/validate_seed.tsx b/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/validators/validate_seed.tsx index 4863dff5ec337..cdc92f8e89d2b 100644 --- a/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/validators/validate_seed.tsx +++ b/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/validators/validate_seed.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { isAddressValid, isPortValid } from './validate_address'; export function validateSeed(seed?: string): JSX.Element[] { diff --git a/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/validators/validate_seeds.tsx b/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/validators/validate_seeds.tsx index 1fc7058ed6b81..1b45fd03190e7 100644 --- a/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/validators/validate_seeds.tsx +++ b/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/validators/validate_seeds.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function validateSeeds(seeds: string[], seedInput?: string) { const seedsHaveBeenCreated = seeds.some((seed) => Boolean(seed.trim())); diff --git a/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/validators/validate_server_name.tsx b/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/validators/validate_server_name.tsx index 608109eee13d5..eb110f75e9e15 100644 --- a/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/validators/validate_server_name.tsx +++ b/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_form/validators/validate_server_name.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function validateServerName(serverName?: string) { if (!serverName || !serverName.trim()) { diff --git a/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_page_title/remote_cluster_page_title.js b/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_page_title/remote_cluster_page_title.js index 2b2e7338fb6b0..94f0e1277b7c6 100644 --- a/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_page_title/remote_cluster_page_title.js +++ b/x-pack/plugins/remote_clusters/public/application/sections/components/remote_cluster_page_title/remote_cluster_page_title.js @@ -7,7 +7,7 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { remoteClustersUrl } from '../../../services/documentation'; import { EuiPageHeader, EuiButtonEmpty, EuiSpacer } from '@elastic/eui'; diff --git a/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_add/remote_cluster_add.js b/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_add/remote_cluster_add.js index f62550ca5aa10..7d56902ab10fd 100644 --- a/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_add/remote_cluster_add.js +++ b/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_add/remote_cluster_add.js @@ -7,7 +7,7 @@ import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { extractQueryParams } from '../../../shared_imports'; import { getRouter, redirect } from '../../services'; diff --git a/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_edit/remote_cluster_edit.js b/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_edit/remote_cluster_edit.js index 1f3388d06e54c..60a837dce53fe 100644 --- a/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_edit/remote_cluster_edit.js +++ b/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_edit/remote_cluster_edit.js @@ -7,7 +7,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiCallOut, EuiEmptyPrompt, EuiPageContent, EuiSpacer } from '@elastic/eui'; diff --git a/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/components/remove_cluster_button_provider/remove_cluster_button_provider.js b/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/components/remove_cluster_button_provider/remove_cluster_button_provider.js index 4db5d1b333b7c..1a6fb16f73568 100644 --- a/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/components/remove_cluster_button_provider/remove_cluster_button_provider.js +++ b/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/components/remove_cluster_button_provider/remove_cluster_button_provider.js @@ -8,7 +8,7 @@ import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiConfirmModal } from '@elastic/eui'; diff --git a/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/detail_panel/detail_panel.js b/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/detail_panel/detail_panel.js index 5c8ef874ec7ed..85cbf119c5302 100644 --- a/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/detail_panel/detail_panel.js +++ b/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/detail_panel/detail_panel.js @@ -7,7 +7,7 @@ import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { diff --git a/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/remote_cluster_list.js b/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/remote_cluster_list.js index b6881aa02e0b9..b4af79416c49e 100644 --- a/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/remote_cluster_list.js +++ b/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/remote_cluster_list.js @@ -7,7 +7,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, diff --git a/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/remote_cluster_table/remote_cluster_table.js b/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/remote_cluster_table/remote_cluster_table.js index 1404e51d98a6d..0b3a272f5bdc4 100644 --- a/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/remote_cluster_table/remote_cluster_table.js +++ b/x-pack/plugins/remote_clusters/public/application/sections/remote_cluster_list/remote_cluster_table/remote_cluster_table.js @@ -8,7 +8,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, diff --git a/x-pack/plugins/reporting/common/test/fixtures.ts b/x-pack/plugins/reporting/common/test/fixtures.ts new file mode 100644 index 0000000000000..c7489d54e9504 --- /dev/null +++ b/x-pack/plugins/reporting/common/test/fixtures.ts @@ -0,0 +1,175 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { ReportApiJSON } from '../types'; +import type { ReportMock } from './types'; + +const buildMockReport = (baseObj: ReportMock) => ({ + index: '.reporting-2020.04.12', + migration_version: '7.15.0', + browser_type: 'chromium', + max_attempts: 1, + timeout: 300000, + created_by: 'elastic', + kibana_id: '5b2de169-2785-441b-ae8c-186a1936b17d', + kibana_name: 'spicy.local', + ...baseObj, + payload: { + browserTimezone: 'America/Phoenix', + layout: { dimensions: { height: 720, width: 1080 }, id: 'preserve_layout' }, + version: '7.14.0', + isDeprecated: baseObj.payload.isDeprecated === true, + ...baseObj.payload, + }, +}); + +export const mockJobs: ReportApiJSON[] = [ + buildMockReport({ + id: 'k90e51pk1ieucbae0c3t8wo2', + attempts: 0, + created_at: '2020-04-14T21:01:13.064Z', + jobtype: 'printable_pdf_v2', + meta: { layout: 'preserve_layout', objectType: 'canvas workpad' }, + payload: { + spaceId: 'my-space', + objectType: 'canvas workpad', + title: 'My Canvas Workpad', + locatorParams: [ + { + id: 'MY_APP', + }, + ], + } as any, + status: 'pending', + }), + buildMockReport({ + id: 'k90e51pk1ieucbae0c3t8wo1', + attempts: 1, + created_at: '2020-04-14T21:01:13.064Z', + jobtype: 'printable_pdf', + meta: { layout: 'preserve_layout', objectType: 'canvas workpad' }, + payload: { + objectType: 'canvas workpad', + title: 'My Canvas Workpad', + }, + started_at: '2020-04-14T21:01:14.526Z', + status: 'processing', + }), + buildMockReport({ + id: 'k90cmthd1gv8cbae0c2le8bo', + attempts: 1, + completed_at: '2020-04-14T20:19:14.748Z', + created_at: '2020-04-14T20:19:02.977Z', + jobtype: 'printable_pdf', + meta: { layout: 'preserve_layout', objectType: 'canvas workpad' }, + output: { content_type: 'application/pdf', size: 80262 }, + payload: { + objectType: 'canvas workpad', + title: 'My Canvas Workpad', + }, + started_at: '2020-04-14T20:19:04.073Z', + status: 'completed', + }), + buildMockReport({ + id: 'k906958e1d4wcbae0c9hip1a', + attempts: 1, + completed_at: '2020-04-14T17:21:08.223Z', + created_at: '2020-04-14T17:20:27.326Z', + jobtype: 'printable_pdf', + meta: { layout: 'preserve_layout', objectType: 'canvas workpad' }, + output: { + content_type: 'application/pdf', + size: 49468, + warnings: [ + 'An error occurred when trying to read the page for visualization panel info. You may need to increase \'xpack.reporting.capture.timeouts.waitForElements\'. TimeoutError: waiting for selector "[data-shared-item],[data-shared-items-count]" failed: timeout 30000ms exceeded', + ], + }, + payload: { + objectType: 'canvas workpad', + title: 'My Canvas Workpad', + }, + started_at: '2020-04-14T17:20:29.444Z', + status: 'completed_with_warnings', + }), + buildMockReport({ + id: 'k9067y2a1d4wcbae0cad38n0', + attempts: 1, + completed_at: '2020-04-14T17:19:53.244Z', + created_at: '2020-04-14T17:19:31.379Z', + jobtype: 'printable_pdf', + meta: { layout: 'preserve_layout', objectType: 'canvas workpad' }, + output: { content_type: 'application/pdf', size: 80262 }, + payload: { + objectType: 'canvas workpad', + title: 'My Canvas Workpad', + }, + started_at: '2020-04-14T17:19:39.883Z', + status: 'completed', + }), + buildMockReport({ + id: 'k9067s1m1d4wcbae0cdnvcms', + attempts: 1, + completed_at: '2020-04-14T17:19:36.822Z', + created_at: '2020-04-14T17:19:23.578Z', + jobtype: 'printable_pdf', + meta: { layout: 'preserve_layout', objectType: 'canvas workpad' }, + output: { content_type: 'application/pdf', size: 80262 }, + payload: { + objectType: 'canvas workpad', + title: 'My Canvas Workpad', + }, + started_at: '2020-04-14T17:19:25.247Z', + status: 'completed', + }), + buildMockReport({ + id: 'k9065q3s1d4wcbae0c00fxlh', + attempts: 1, + completed_at: '2020-04-14T17:18:03.910Z', + created_at: '2020-04-14T17:17:47.752Z', + jobtype: 'printable_pdf', + meta: { layout: 'preserve_layout', objectType: 'canvas workpad' }, + output: { content_type: 'application/pdf', size: 80262 }, + payload: { + objectType: 'canvas workpad', + title: 'My Canvas Workpad', + }, + started_at: '2020-04-14T17:17:50.379Z', + status: 'completed', + }), + buildMockReport({ + id: 'k905zdw11d34cbae0c3y6tzh', + attempts: 1, + completed_at: '2020-04-14T17:13:03.719Z', + created_at: '2020-04-14T17:12:51.985Z', + jobtype: 'printable_pdf', + meta: { layout: 'preserve_layout', objectType: 'canvas workpad' }, + output: { content_type: 'application/pdf', size: 80262 }, + payload: { + objectType: 'canvas workpad', + title: 'My Canvas Workpad', + isDeprecated: true, + }, + started_at: '2020-04-14T17:12:52.431Z', + status: 'completed', + }), + buildMockReport({ + id: 'k8t4ylcb07mi9d006214ifyg', + attempts: 1, + completed_at: '2020-04-09T19:10:10.049Z', + created_at: '2020-04-09T19:09:52.139Z', + jobtype: 'PNG', + meta: { layout: 'png', objectType: 'visualization' }, + output: { content_type: 'image/png', size: 123456789 }, + payload: { + objectType: 'visualization', + title: 'count', + isDeprecated: true, + }, + started_at: '2020-04-09T19:09:54.570Z', + status: 'completed', + }), +]; diff --git a/x-pack/plugins/reporting/common/test/index.ts b/x-pack/plugins/reporting/common/test/index.ts new file mode 100644 index 0000000000000..d9d62a7a877a7 --- /dev/null +++ b/x-pack/plugins/reporting/common/test/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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export type { PayloadMock, ReportMock } from './types'; + +export { mockJobs } from './fixtures'; diff --git a/x-pack/plugins/reporting/common/test/types.ts b/x-pack/plugins/reporting/common/test/types.ts new file mode 100644 index 0000000000000..83ebc1e3358cb --- /dev/null +++ b/x-pack/plugins/reporting/common/test/types.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { ReportApiJSON } from '../types'; + +/** @internal */ +export interface PayloadMock { + payload: Omit; +} + +/** @internal */ +export type ReportMock = Omit< + ReportApiJSON, + | 'index' + | 'migration_version' + | 'browser_type' + | 'max_attempts' + | 'timeout' + | 'created_by' + | 'payload' +> & + PayloadMock; diff --git a/x-pack/plugins/reporting/public/lib/job.tsx b/x-pack/plugins/reporting/public/lib/job.tsx index d5d77ac18aa5c..8e2db6a9d998e 100644 --- a/x-pack/plugins/reporting/public/lib/job.tsx +++ b/x-pack/plugins/reporting/public/lib/job.tsx @@ -7,7 +7,7 @@ import { EuiText, EuiTextColor } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import moment from 'moment'; import React from 'react'; import { JOB_STATUSES } from '../../common/constants'; diff --git a/x-pack/plugins/reporting/public/management/__test__/index.ts b/x-pack/plugins/reporting/public/management/__test__/index.ts new file mode 100644 index 0000000000000..b1dc1b53ec280 --- /dev/null +++ b/x-pack/plugins/reporting/public/management/__test__/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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { mockJobs } from '../../../common/test'; + +export { setup } from './report_listing.test.helpers'; + +export type { TestBed, TestDependencies } from './report_listing.test.helpers'; diff --git a/x-pack/plugins/reporting/public/management/__test__/report_listing.test.helpers.tsx b/x-pack/plugins/reporting/public/management/__test__/report_listing.test.helpers.tsx new file mode 100644 index 0000000000000..c7c1b48a04bc8 --- /dev/null +++ b/x-pack/plugins/reporting/public/management/__test__/report_listing.test.helpers.tsx @@ -0,0 +1,148 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { registerTestBed } from '@kbn/test/jest'; +import { act } from 'react-dom/test-utils'; +import { Observable } from 'rxjs'; +import { UnwrapPromise, SerializableRecord } from '@kbn/utility-types'; + +import type { NotificationsSetup } from '../../../../../../src/core/public'; +import { + applicationServiceMock, + httpServiceMock, + notificationServiceMock, + coreMock, +} from '../../../../../../src/core/public/mocks'; +import type { LocatorPublic, SharePluginSetup } from '../../../../../../src/plugins/share/public'; + +import type { ILicense } from '../../../../licensing/public'; + +import { mockJobs } from '../../../common/test'; + +import { KibanaContextProvider } from '../../shared_imports'; + +import { IlmPolicyStatusContextProvider } from '../../lib/ilm_policy_status_context'; +import { InternalApiClientProvider, ReportingAPIClient } from '../../lib/reporting_api_client'; +import { Job } from '../../lib/job'; + +import { ListingProps as Props, ReportListing } from '../'; + +export interface TestDependencies { + http: ReturnType; + application: ReturnType; + reportingAPIClient: ReportingAPIClient; + license$: Observable; + urlService: SharePluginSetup['url']; + toasts: NotificationsSetup['toasts']; + ilmLocator: LocatorPublic; +} + +const mockPollConfig = { + jobCompletionNotifier: { + interval: 5000, + intervalErrorMultiplier: 3, + }, + jobsRefresh: { + interval: 5000, + intervalErrorMultiplier: 3, + }, +}; + +const validCheck = { + check: () => ({ + state: 'VALID', + message: '', + }), +}; + +const license$ = { + subscribe: (handler: unknown) => { + return (handler as Function)(validCheck); + }, +} as Observable; + +const createTestBed = registerTestBed( + ({ + http, + application, + reportingAPIClient, + license$: l$, + urlService, + toasts, + ...rest + }: Partial & TestDependencies) => ( + + + + + + + + ), + { memoryRouter: { wrapComponent: false } } +); + +export type TestBed = UnwrapPromise>; + +export const setup = async (props?: Partial) => { + const uiSettingsClient = coreMock.createSetup().uiSettings; + const httpService = httpServiceMock.createSetupContract(); + const reportingAPIClient = new ReportingAPIClient(httpService, uiSettingsClient, 'x.x.x'); + + jest + .spyOn(reportingAPIClient, 'list') + .mockImplementation(() => Promise.resolve(mockJobs.map((j) => new Job(j)))); + jest.spyOn(reportingAPIClient, 'total').mockImplementation(() => Promise.resolve(18)); + jest.spyOn(reportingAPIClient, 'migrateReportingIndicesIlmPolicy').mockImplementation(jest.fn()); + + const ilmLocator: LocatorPublic = { + getUrl: jest.fn(), + } as unknown as LocatorPublic; + + const testDependencies: TestDependencies = { + http: httpService, + application: applicationServiceMock.createStartContract(), + toasts: notificationServiceMock.createSetupContract().toasts, + license$, + reportingAPIClient, + ilmLocator, + urlService: { + locators: { + get: () => ilmLocator, + }, + } as unknown as SharePluginSetup['url'], + }; + + const testBed = createTestBed({ ...testDependencies, ...props }); + + const { find, exists, component } = testBed; + + return { + ...testBed, + testDependencies, + actions: { + findListTable: () => find('reportJobListing'), + hasIlmMigrationBanner: () => exists('migrateReportingIndicesPolicyCallOut'), + hasIlmPolicyLink: () => exists('ilmPolicyLink'), + migrateIndices: async () => { + await act(async () => { + find('migrateReportingIndicesButton').simulate('click'); + }); + component.update(); + }, + }, + }; +}; diff --git a/x-pack/plugins/reporting/public/management/components/migrate_ilm_policy_callout/ilm_policy_migration_needed_callout.tsx b/x-pack/plugins/reporting/public/management/components/migrate_ilm_policy_callout/ilm_policy_migration_needed_callout.tsx index 7eb54049a15a9..9e41a47de8b58 100644 --- a/x-pack/plugins/reporting/public/management/components/migrate_ilm_policy_callout/ilm_policy_migration_needed_callout.tsx +++ b/x-pack/plugins/reporting/public/management/components/migrate_ilm_policy_callout/ilm_policy_migration_needed_callout.tsx @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { FunctionComponent } from 'react'; import React, { useState } from 'react'; import useMountedState from 'react-use/lib/useMountedState'; diff --git a/x-pack/plugins/reporting/public/management/components/report_diagnostic.tsx b/x-pack/plugins/reporting/public/management/components/report_diagnostic.tsx index 124ce9af891a3..22236f77ffdae 100644 --- a/x-pack/plugins/reporting/public/management/components/report_diagnostic.tsx +++ b/x-pack/plugins/reporting/public/management/components/report_diagnostic.tsx @@ -7,7 +7,7 @@ import { i18n } from '@kbn/i18n'; import React, { useState, Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiButtonEmpty, diff --git a/x-pack/plugins/reporting/public/management/mount_management_section.tsx b/x-pack/plugins/reporting/public/management/mount_management_section.tsx index 56ede79086a04..eea04d00242fc 100644 --- a/x-pack/plugins/reporting/public/management/mount_management_section.tsx +++ b/x-pack/plugins/reporting/public/management/mount_management_section.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import * as React from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; import { Observable } from 'rxjs'; diff --git a/x-pack/plugins/reporting/public/management/report_listing.test.ts b/x-pack/plugins/reporting/public/management/report_listing.test.ts new file mode 100644 index 0000000000000..b6096bfa97a97 --- /dev/null +++ b/x-pack/plugins/reporting/public/management/report_listing.test.ts @@ -0,0 +1,216 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { Observable } from 'rxjs'; +import { act } from 'react-dom/test-utils'; + +import type { ILicense } from '../../../licensing/public'; +import type { IlmPolicyMigrationStatus } from '../../common/types'; + +import { ListingProps as Props } from '.'; + +import { setup, TestBed, TestDependencies, mockJobs } from './__test__'; + +describe('ReportListing', () => { + let testBed: TestBed; + + let applicationService: TestDependencies['application']; + + const runSetup = async (props?: Partial) => { + await act(async () => { + testBed = await setup(props); + }); + testBed.component.update(); + }; + + beforeEach(async () => { + await runSetup(); + // Collect all of the injected services so we can mutate for the tests + applicationService = testBed.testDependencies.application; + }); + + afterEach(() => { + jest.clearAllMocks(); + }); + + it('renders a listing with some items', () => { + const { find } = testBed; + expect(find('reportDownloadLink').length).toBe(mockJobs.length); + }); + + it('subscribes to license changes, and unsubscribes on dismount', async () => { + const unsubscribeMock = jest.fn(); + const subMock = { + subscribe: jest.fn().mockReturnValue({ + unsubscribe: unsubscribeMock, + }), + } as unknown as Observable; + + await runSetup({ license$: subMock }); + + expect(subMock.subscribe).toHaveBeenCalled(); + expect(unsubscribeMock).not.toHaveBeenCalled(); + testBed.component.unmount(); + expect(unsubscribeMock).toHaveBeenCalled(); + }); + + it('navigates to a Kibana App in a new tab and is spaces aware', () => { + const { find } = testBed; + + jest.spyOn(window, 'open').mockImplementation(jest.fn()); + jest.spyOn(window, 'focus').mockImplementation(jest.fn()); + + find('euiCollapsedItemActionsButton').first().simulate('click'); + find('reportOpenInKibanaApp').first().simulate('click'); + + expect(window.open).toHaveBeenCalledWith( + '/s/my-space/app/reportingRedirect?jobId=k90e51pk1ieucbae0c3t8wo2', + '_blank' + ); + }); + + describe('ILM policy', () => { + let httpService: TestDependencies['http']; + let urlService: TestDependencies['urlService']; + let toasts: TestDependencies['toasts']; + let reportingAPIClient: TestDependencies['reportingAPIClient']; + + /** + * Simulate a fresh page load, useful for network requests and other effects + * that happen only at first load. + */ + const remountComponent = async () => { + const { component } = testBed; + act(() => { + component.unmount(); + }); + await act(async () => { + component.mount(); + }); + // Flush promises + await new Promise((r) => setImmediate(r)); + component.update(); + }; + + beforeEach(async () => { + await runSetup(); + // Collect all of the injected services so we can mutate for the tests + applicationService = testBed.testDependencies.application; + applicationService.capabilities = { + catalogue: {}, + navLinks: {}, + management: { data: { index_lifecycle_management: true } }, + }; + httpService = testBed.testDependencies.http; + urlService = testBed.testDependencies.urlService; + toasts = testBed.testDependencies.toasts; + reportingAPIClient = testBed.testDependencies.reportingAPIClient; + }); + + afterEach(() => { + jest.restoreAllMocks(); + }); + + it('shows the migrate banner when migration status is not "OK"', async () => { + const { actions } = testBed; + const status: IlmPolicyMigrationStatus = 'indices-not-managed-by-policy'; + httpService.get.mockResolvedValue({ status }); + await remountComponent(); + expect(actions.hasIlmMigrationBanner()).toBe(true); + }); + + it('does not show the migrate banner when migration status is "OK"', async () => { + const { actions } = testBed; + const status: IlmPolicyMigrationStatus = 'ok'; + httpService.get.mockResolvedValue({ status }); + await remountComponent(); + expect(actions.hasIlmMigrationBanner()).toBe(false); + }); + + it('hides the ILM policy link if there is no ILM policy', async () => { + const { actions } = testBed; + const status: IlmPolicyMigrationStatus = 'policy-not-found'; + httpService.get.mockResolvedValue({ status }); + await remountComponent(); + expect(actions.hasIlmPolicyLink()).toBe(false); + }); + + it('hides the ILM policy link if there is no ILM policy locator', async () => { + const { actions } = testBed; + jest.spyOn(urlService.locators, 'get').mockReturnValue(undefined); + const status: IlmPolicyMigrationStatus = 'ok'; // should never happen, but need to test that when the locator is missing we don't render the link + httpService.get.mockResolvedValue({ status }); + await remountComponent(); + expect(actions.hasIlmPolicyLink()).toBe(false); + }); + + it('always shows the ILM policy link if there is an ILM policy', async () => { + const { actions } = testBed; + const status: IlmPolicyMigrationStatus = 'ok'; + httpService.get.mockResolvedValue({ status }); + await remountComponent(); + expect(actions.hasIlmPolicyLink()).toBe(true); + + const status2: IlmPolicyMigrationStatus = 'indices-not-managed-by-policy'; + httpService.get.mockResolvedValue({ status: status2 }); + await remountComponent(); + expect(actions.hasIlmPolicyLink()).toBe(true); + }); + + it('hides the banner after migrating indices', async () => { + const { actions } = testBed; + const status: IlmPolicyMigrationStatus = 'indices-not-managed-by-policy'; + const status2: IlmPolicyMigrationStatus = 'ok'; + httpService.get.mockResolvedValueOnce({ status }); + httpService.get.mockResolvedValueOnce({ status: status2 }); + await remountComponent(); + + expect(actions.hasIlmMigrationBanner()).toBe(true); + await actions.migrateIndices(); + expect(actions.hasIlmMigrationBanner()).toBe(false); + expect(actions.hasIlmPolicyLink()).toBe(true); + expect(toasts.addSuccess).toHaveBeenCalledTimes(1); + }); + + it('informs users when migrations failed', async () => { + const { actions } = testBed; + const status: IlmPolicyMigrationStatus = 'indices-not-managed-by-policy'; + httpService.get.mockResolvedValueOnce({ status }); + (reportingAPIClient.migrateReportingIndicesIlmPolicy as jest.Mock).mockRejectedValueOnce( + new Error('oops!') + ); + await remountComponent(); + + expect(actions.hasIlmMigrationBanner()).toBe(true); + await actions.migrateIndices(); + expect(toasts.addError).toHaveBeenCalledTimes(1); + expect(actions.hasIlmMigrationBanner()).toBe(true); + expect(actions.hasIlmPolicyLink()).toBe(true); + }); + + it('only shows the link to the ILM policy if UI capabilities allow it', async () => { + applicationService.capabilities = { + catalogue: {}, + navLinks: {}, + management: { data: { index_lifecycle_management: false } }, + }; + await remountComponent(); + + expect(testBed.actions.hasIlmPolicyLink()).toBe(false); + + applicationService.capabilities = { + catalogue: {}, + navLinks: {}, + management: { data: { index_lifecycle_management: true } }, + }; + + await remountComponent(); + + expect(testBed.actions.hasIlmPolicyLink()).toBe(true); + }); + }); +}); diff --git a/x-pack/plugins/reporting/public/management/report_listing.test.tsx b/x-pack/plugins/reporting/public/management/report_listing.test.tsx deleted file mode 100644 index 577d64be38a54..0000000000000 --- a/x-pack/plugins/reporting/public/management/report_listing.test.tsx +++ /dev/null @@ -1,479 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { registerTestBed } from '@kbn/test/jest'; -import type { SerializableRecord, UnwrapPromise } from '@kbn/utility-types'; -import React from 'react'; -import { act } from 'react-dom/test-utils'; -import type { Observable } from 'rxjs'; -import type { IUiSettingsClient } from 'src/core/public'; -import { ListingProps as Props, ReportListing } from '.'; -import type { NotificationsSetup } from '../../../../../src/core/public'; -import { - applicationServiceMock, - httpServiceMock, - notificationServiceMock, - coreMock, -} from '../../../../../src/core/public/mocks'; -import type { LocatorPublic, SharePluginSetup } from '../../../../../src/plugins/share/public'; -import type { ILicense } from '../../../licensing/public'; -import type { IlmPolicyMigrationStatus, ReportApiJSON } from '../../common/types'; -import { IlmPolicyStatusContextProvider } from '../lib/ilm_policy_status_context'; -import { Job } from '../lib/job'; -import { InternalApiClientProvider, ReportingAPIClient } from '../lib/reporting_api_client'; -import { KibanaContextProvider } from '../shared_imports'; - -interface PayloadMock { - payload: Omit; -} -type ReportMock = Omit< - ReportApiJSON, - | 'index' - | 'migration_version' - | 'browser_type' - | 'max_attempts' - | 'timeout' - | 'created_by' - | 'payload' -> & - PayloadMock; - -const buildMockReport = (baseObj: ReportMock) => ({ - index: '.reporting-2020.04.12', - migration_version: '7.15.0', - browser_type: 'chromium', - max_attempts: 1, - timeout: 300000, - created_by: 'elastic', - kibana_id: '5b2de169-2785-441b-ae8c-186a1936b17d', - kibana_name: 'spicy.local', - ...baseObj, - payload: { - browserTimezone: 'America/Phoenix', - layout: { dimensions: { height: 720, width: 1080 }, id: 'preserve_layout' }, - version: '7.14.0', - isDeprecated: baseObj.payload.isDeprecated === true, - ...baseObj.payload, - }, -}); - -const mockJobs: ReportApiJSON[] = [ - buildMockReport({ - id: 'k90e51pk1ieucbae0c3t8wo2', - attempts: 0, - created_at: '2020-04-14T21:01:13.064Z', - jobtype: 'printable_pdf_v2', - meta: { layout: 'preserve_layout', objectType: 'canvas workpad' }, - payload: { - spaceId: 'my-space', - objectType: 'canvas workpad', - title: 'My Canvas Workpad', - locatorParams: [ - { - id: 'MY_APP', - }, - ], - } as any, - status: 'pending', - }), - buildMockReport({ - id: 'k90e51pk1ieucbae0c3t8wo1', - attempts: 1, - created_at: '2020-04-14T21:01:13.064Z', - jobtype: 'printable_pdf', - meta: { layout: 'preserve_layout', objectType: 'canvas workpad' }, - payload: { - objectType: 'canvas workpad', - title: 'My Canvas Workpad', - }, - started_at: '2020-04-14T21:01:14.526Z', - status: 'processing', - }), - buildMockReport({ - id: 'k90cmthd1gv8cbae0c2le8bo', - attempts: 1, - completed_at: '2020-04-14T20:19:14.748Z', - created_at: '2020-04-14T20:19:02.977Z', - jobtype: 'printable_pdf', - meta: { layout: 'preserve_layout', objectType: 'canvas workpad' }, - output: { content_type: 'application/pdf', size: 80262 }, - payload: { - objectType: 'canvas workpad', - title: 'My Canvas Workpad', - }, - started_at: '2020-04-14T20:19:04.073Z', - status: 'completed', - }), - buildMockReport({ - id: 'k906958e1d4wcbae0c9hip1a', - attempts: 1, - completed_at: '2020-04-14T17:21:08.223Z', - created_at: '2020-04-14T17:20:27.326Z', - jobtype: 'printable_pdf', - meta: { layout: 'preserve_layout', objectType: 'canvas workpad' }, - output: { - content_type: 'application/pdf', - size: 49468, - warnings: [ - 'An error occurred when trying to read the page for visualization panel info. You may need to increase \'xpack.reporting.capture.timeouts.waitForElements\'. TimeoutError: waiting for selector "[data-shared-item],[data-shared-items-count]" failed: timeout 30000ms exceeded', - ], - }, - payload: { - objectType: 'canvas workpad', - title: 'My Canvas Workpad', - }, - started_at: '2020-04-14T17:20:29.444Z', - status: 'completed_with_warnings', - }), - buildMockReport({ - id: 'k9067y2a1d4wcbae0cad38n0', - attempts: 1, - completed_at: '2020-04-14T17:19:53.244Z', - created_at: '2020-04-14T17:19:31.379Z', - jobtype: 'printable_pdf', - meta: { layout: 'preserve_layout', objectType: 'canvas workpad' }, - output: { content_type: 'application/pdf', size: 80262 }, - payload: { - objectType: 'canvas workpad', - title: 'My Canvas Workpad', - }, - started_at: '2020-04-14T17:19:39.883Z', - status: 'completed', - }), - buildMockReport({ - id: 'k9067s1m1d4wcbae0cdnvcms', - attempts: 1, - completed_at: '2020-04-14T17:19:36.822Z', - created_at: '2020-04-14T17:19:23.578Z', - jobtype: 'printable_pdf', - meta: { layout: 'preserve_layout', objectType: 'canvas workpad' }, - output: { content_type: 'application/pdf', size: 80262 }, - payload: { - objectType: 'canvas workpad', - title: 'My Canvas Workpad', - }, - started_at: '2020-04-14T17:19:25.247Z', - status: 'completed', - }), - buildMockReport({ - id: 'k9065q3s1d4wcbae0c00fxlh', - attempts: 1, - completed_at: '2020-04-14T17:18:03.910Z', - created_at: '2020-04-14T17:17:47.752Z', - jobtype: 'printable_pdf', - meta: { layout: 'preserve_layout', objectType: 'canvas workpad' }, - output: { content_type: 'application/pdf', size: 80262 }, - payload: { - objectType: 'canvas workpad', - title: 'My Canvas Workpad', - }, - started_at: '2020-04-14T17:17:50.379Z', - status: 'completed', - }), - buildMockReport({ - id: 'k905zdw11d34cbae0c3y6tzh', - attempts: 1, - completed_at: '2020-04-14T17:13:03.719Z', - created_at: '2020-04-14T17:12:51.985Z', - jobtype: 'printable_pdf', - meta: { layout: 'preserve_layout', objectType: 'canvas workpad' }, - output: { content_type: 'application/pdf', size: 80262 }, - payload: { - objectType: 'canvas workpad', - title: 'My Canvas Workpad', - isDeprecated: true, - }, - started_at: '2020-04-14T17:12:52.431Z', - status: 'completed', - }), - buildMockReport({ - id: 'k8t4ylcb07mi9d006214ifyg', - attempts: 1, - completed_at: '2020-04-09T19:10:10.049Z', - created_at: '2020-04-09T19:09:52.139Z', - jobtype: 'PNG', - meta: { layout: 'png', objectType: 'visualization' }, - output: { content_type: 'image/png', size: 123456789 }, - payload: { - objectType: 'visualization', - title: 'count', - isDeprecated: true, - }, - started_at: '2020-04-09T19:09:54.570Z', - status: 'completed', - }), -]; - -const validCheck = { - check: () => ({ - state: 'VALID', - message: '', - }), -}; - -const license$ = { - subscribe: (handler: unknown) => { - return (handler as Function)(validCheck); - }, -} as Observable; - -const mockPollConfig = { - jobCompletionNotifier: { - interval: 5000, - intervalErrorMultiplier: 3, - }, - jobsRefresh: { - interval: 5000, - intervalErrorMultiplier: 3, - }, -}; - -describe('ReportListing', () => { - let httpService: ReturnType; - let uiSettingsClient: IUiSettingsClient; - let applicationService: ReturnType; - let ilmLocator: undefined | LocatorPublic; - let urlService: SharePluginSetup['url']; - let testBed: UnwrapPromise>; - let toasts: NotificationsSetup['toasts']; - let reportingAPIClient: ReportingAPIClient; - - const createTestBed = registerTestBed( - (props?: Partial) => ( - - - - - - - - ), - { memoryRouter: { wrapComponent: false } } - ); - - const setup = async (props?: Partial) => { - const tb = await createTestBed(props); - const { find, exists, component } = tb; - - return { - ...tb, - actions: { - findListTable: () => find('reportJobListing'), - hasIlmMigrationBanner: () => exists('migrateReportingIndicesPolicyCallOut'), - hasIlmPolicyLink: () => exists('ilmPolicyLink'), - migrateIndices: async () => { - await act(async () => { - find('migrateReportingIndicesButton').simulate('click'); - }); - component.update(); - }, - }, - }; - }; - - const runSetup = async (props?: Partial) => { - await act(async () => { - testBed = await setup(props); - }); - testBed.component.update(); - }; - - beforeEach(async () => { - toasts = notificationServiceMock.createSetupContract().toasts; - httpService = httpServiceMock.createSetupContract(); - uiSettingsClient = coreMock.createSetup().uiSettings; - applicationService = applicationServiceMock.createStartContract(); - applicationService.capabilities = { - catalogue: {}, - navLinks: {}, - management: { data: { index_lifecycle_management: true } }, - }; - ilmLocator = { - getUrl: jest.fn(), - } as unknown as LocatorPublic; - - reportingAPIClient = new ReportingAPIClient(httpService, uiSettingsClient, 'x.x.x'); - - jest - .spyOn(reportingAPIClient, 'list') - .mockImplementation(() => Promise.resolve(mockJobs.map((j) => new Job(j)))); - jest.spyOn(reportingAPIClient, 'total').mockImplementation(() => Promise.resolve(18)); - jest - .spyOn(reportingAPIClient, 'migrateReportingIndicesIlmPolicy') - .mockImplementation(jest.fn()); - - urlService = { - locators: { - get: () => ilmLocator, - }, - } as unknown as SharePluginSetup['url']; - await runSetup(); - }); - - afterEach(() => { - jest.clearAllMocks(); - }); - - it('renders a listing with some items', () => { - const { find } = testBed; - expect(find('reportDownloadLink').length).toBe(mockJobs.length); - }); - - it('subscribes to license changes, and unsubscribes on dismount', async () => { - const unsubscribeMock = jest.fn(); - const subMock = { - subscribe: jest.fn().mockReturnValue({ - unsubscribe: unsubscribeMock, - }), - } as unknown as Observable; - - await runSetup({ license$: subMock }); - - expect(subMock.subscribe).toHaveBeenCalled(); - expect(unsubscribeMock).not.toHaveBeenCalled(); - testBed.component.unmount(); - expect(unsubscribeMock).toHaveBeenCalled(); - }); - - it('navigates to a Kibana App in a new tab and is spaces aware', () => { - const { find } = testBed; - - jest.spyOn(window, 'open').mockImplementation(jest.fn()); - jest.spyOn(window, 'focus').mockImplementation(jest.fn()); - - find('euiCollapsedItemActionsButton').first().simulate('click'); - find('reportOpenInKibanaApp').first().simulate('click'); - - expect(window.open).toHaveBeenCalledWith( - '/s/my-space/app/reportingRedirect?jobId=k90e51pk1ieucbae0c3t8wo2', - '_blank' - ); - }); - - describe('ILM policy', () => { - beforeEach(async () => { - httpService = httpServiceMock.createSetupContract(); - ilmLocator = { - getUrl: jest.fn(), - } as unknown as LocatorPublic; - - urlService = { - locators: { - get: () => ilmLocator, - }, - } as unknown as SharePluginSetup['url']; - - await runSetup(); - }); - - it('shows the migrate banner when migration status is not "OK"', async () => { - const status: IlmPolicyMigrationStatus = 'indices-not-managed-by-policy'; - httpService.get.mockResolvedValue({ status }); - await runSetup(); - const { actions } = testBed; - expect(actions.hasIlmMigrationBanner()).toBe(true); - }); - - it('does not show the migrate banner when migration status is "OK"', async () => { - const status: IlmPolicyMigrationStatus = 'ok'; - httpService.get.mockResolvedValue({ status }); - await runSetup(); - const { actions } = testBed; - expect(actions.hasIlmMigrationBanner()).toBe(false); - }); - - it('hides the ILM policy link if there is no ILM policy', async () => { - const status: IlmPolicyMigrationStatus = 'policy-not-found'; - httpService.get.mockResolvedValue({ status }); - await runSetup(); - const { actions } = testBed; - expect(actions.hasIlmPolicyLink()).toBe(false); - }); - - it('hides the ILM policy link if there is no ILM policy locator', async () => { - ilmLocator = undefined; - const status: IlmPolicyMigrationStatus = 'ok'; // should never happen, but need to test that when the locator is missing we don't render the link - httpService.get.mockResolvedValue({ status }); - await runSetup(); - const { actions } = testBed; - expect(actions.hasIlmPolicyLink()).toBe(false); - }); - - it('always shows the ILM policy link if there is an ILM policy', async () => { - const status: IlmPolicyMigrationStatus = 'ok'; - httpService.get.mockResolvedValue({ status }); - await runSetup(); - const { actions } = testBed; - expect(actions.hasIlmPolicyLink()).toBe(true); - - const status2: IlmPolicyMigrationStatus = 'indices-not-managed-by-policy'; - httpService.get.mockResolvedValue({ status: status2 }); - await runSetup(); - expect(actions.hasIlmPolicyLink()).toBe(true); - }); - - it('hides the banner after migrating indices', async () => { - const status: IlmPolicyMigrationStatus = 'indices-not-managed-by-policy'; - const status2: IlmPolicyMigrationStatus = 'ok'; - httpService.get.mockResolvedValueOnce({ status }); - httpService.get.mockResolvedValueOnce({ status: status2 }); - await runSetup(); - const { actions } = testBed; - - expect(actions.hasIlmMigrationBanner()).toBe(true); - await actions.migrateIndices(); - expect(actions.hasIlmMigrationBanner()).toBe(false); - expect(actions.hasIlmPolicyLink()).toBe(true); - expect(toasts.addSuccess).toHaveBeenCalledTimes(1); - }); - - it('informs users when migrations failed', async () => { - const status: IlmPolicyMigrationStatus = 'indices-not-managed-by-policy'; - httpService.get.mockResolvedValueOnce({ status }); - (reportingAPIClient.migrateReportingIndicesIlmPolicy as jest.Mock).mockRejectedValueOnce( - new Error('oops!') - ); - await runSetup(); - const { actions } = testBed; - - expect(actions.hasIlmMigrationBanner()).toBe(true); - await actions.migrateIndices(); - expect(toasts.addError).toHaveBeenCalledTimes(1); - expect(actions.hasIlmMigrationBanner()).toBe(true); - expect(actions.hasIlmPolicyLink()).toBe(true); - }); - - it('only shows the link to the ILM policy if UI capabilities allow it', async () => { - applicationService.capabilities = { - catalogue: {}, - navLinks: {}, - management: { data: { index_lifecycle_management: false } }, - }; - await runSetup(); - - expect(testBed.actions.hasIlmPolicyLink()).toBe(false); - - applicationService.capabilities = { - catalogue: {}, - navLinks: {}, - management: { data: { index_lifecycle_management: true } }, - }; - - await runSetup(); - - expect(testBed.actions.hasIlmPolicyLink()).toBe(true); - }); - }); -}); diff --git a/x-pack/plugins/reporting/public/management/report_listing.tsx b/x-pack/plugins/reporting/public/management/report_listing.tsx index 46c375cd8880f..2fb4f1cbc2028 100644 --- a/x-pack/plugins/reporting/public/management/report_listing.tsx +++ b/x-pack/plugins/reporting/public/management/report_listing.tsx @@ -17,7 +17,7 @@ import { EuiLink, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Component, default as React, Fragment } from 'react'; import { Subscription } from 'rxjs'; import { ILicense } from '../../../licensing/public'; diff --git a/x-pack/plugins/reporting/public/notifier/general_error.tsx b/x-pack/plugins/reporting/public/notifier/general_error.tsx index 9a4a189413991..141b7b49444b0 100644 --- a/x-pack/plugins/reporting/public/notifier/general_error.tsx +++ b/x-pack/plugins/reporting/public/notifier/general_error.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCallOut, EuiSpacer } from '@elastic/eui'; import { ToastInput } from 'src/core/public'; import { toMountPoint } from '../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/reporting/public/notifier/job_download_button.tsx b/x-pack/plugins/reporting/public/notifier/job_download_button.tsx index 2de22b1dda0e1..05f92a4ed3610 100644 --- a/x-pack/plugins/reporting/public/notifier/job_download_button.tsx +++ b/x-pack/plugins/reporting/public/notifier/job_download_button.tsx @@ -6,7 +6,7 @@ */ import { EuiButton } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { JobId, JobSummary } from '../../common/types'; diff --git a/x-pack/plugins/reporting/public/notifier/job_failure.tsx b/x-pack/plugins/reporting/public/notifier/job_failure.tsx index 7775afc4d9f82..a9e7b78c7e12f 100644 --- a/x-pack/plugins/reporting/public/notifier/job_failure.tsx +++ b/x-pack/plugins/reporting/public/notifier/job_failure.tsx @@ -7,7 +7,7 @@ import { EuiCallOut, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { Fragment } from 'react'; import { ToastInput } from 'src/core/public'; import { toMountPoint } from '../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/reporting/public/notifier/job_success.tsx b/x-pack/plugins/reporting/public/notifier/job_success.tsx index 4d83f371a5487..c1de9a7625858 100644 --- a/x-pack/plugins/reporting/public/notifier/job_success.tsx +++ b/x-pack/plugins/reporting/public/notifier/job_success.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { Fragment } from 'react'; import { ToastInput } from 'src/core/public'; import { toMountPoint } from '../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/reporting/public/notifier/job_warning_formulas.tsx b/x-pack/plugins/reporting/public/notifier/job_warning_formulas.tsx index 4ef54dac3dd4c..c835203813b86 100644 --- a/x-pack/plugins/reporting/public/notifier/job_warning_formulas.tsx +++ b/x-pack/plugins/reporting/public/notifier/job_warning_formulas.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { Fragment } from 'react'; import { ToastInput } from 'src/core/public'; import { toMountPoint } from '../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/reporting/public/notifier/job_warning_max_size.tsx b/x-pack/plugins/reporting/public/notifier/job_warning_max_size.tsx index 6d6c076c64fbf..f7cc8e2219df9 100644 --- a/x-pack/plugins/reporting/public/notifier/job_warning_max_size.tsx +++ b/x-pack/plugins/reporting/public/notifier/job_warning_max_size.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { Fragment } from 'react'; import { ToastInput } from 'src/core/public'; import { toMountPoint } from '../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/reporting/public/notifier/report_link.tsx b/x-pack/plugins/reporting/public/notifier/report_link.tsx index 99053010ef4ae..e202cab8b3c90 100644 --- a/x-pack/plugins/reporting/public/notifier/report_link.tsx +++ b/x-pack/plugins/reporting/public/notifier/report_link.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; interface Props { getUrl: () => string; diff --git a/x-pack/plugins/reporting/public/share_context_menu/reporting_panel_content/components/error_unsaved_work_panel.tsx b/x-pack/plugins/reporting/public/share_context_menu/reporting_panel_content/components/error_unsaved_work_panel.tsx index 348c6d42cddb8..6fc8b408ca17d 100644 --- a/x-pack/plugins/reporting/public/share_context_menu/reporting_panel_content/components/error_unsaved_work_panel.tsx +++ b/x-pack/plugins/reporting/public/share_context_menu/reporting_panel_content/components/error_unsaved_work_panel.tsx @@ -7,7 +7,7 @@ import { i18n } from '@kbn/i18n'; import type { FunctionComponent } from 'react'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCallOut, EuiText, EuiSpacer } from '@elastic/eui'; const i18nTexts = { diff --git a/x-pack/plugins/reporting/public/share_context_menu/reporting_panel_content/components/error_url_too_long_panel.tsx b/x-pack/plugins/reporting/public/share_context_menu/reporting_panel_content/components/error_url_too_long_panel.tsx index 9c925fe03fee2..a1a75581d5450 100644 --- a/x-pack/plugins/reporting/public/share_context_menu/reporting_panel_content/components/error_url_too_long_panel.tsx +++ b/x-pack/plugins/reporting/public/share_context_menu/reporting_panel_content/components/error_url_too_long_panel.tsx @@ -8,7 +8,7 @@ import type { FunctionComponent } from 'react'; import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCallOut, EuiText } from '@elastic/eui'; interface Props { diff --git a/x-pack/plugins/reporting/public/share_context_menu/reporting_panel_content/reporting_panel_content.tsx b/x-pack/plugins/reporting/public/share_context_menu/reporting_panel_content/reporting_panel_content.tsx index 4e05dc5637bfb..73ccbc2b13d75 100644 --- a/x-pack/plugins/reporting/public/share_context_menu/reporting_panel_content/reporting_panel_content.tsx +++ b/x-pack/plugins/reporting/public/share_context_menu/reporting_panel_content/reporting_panel_content.tsx @@ -16,7 +16,7 @@ import { EuiText, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n/react'; +import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n-react'; import React, { Component, ReactElement } from 'react'; import { IUiSettingsClient, ToastsSetup } from 'src/core/public'; import url from 'url'; diff --git a/x-pack/plugins/reporting/public/share_context_menu/screen_capture_panel_content.test.tsx b/x-pack/plugins/reporting/public/share_context_menu/screen_capture_panel_content.test.tsx index 0366c1c6d052c..7a2fa52d010e3 100644 --- a/x-pack/plugins/reporting/public/share_context_menu/screen_capture_panel_content.test.tsx +++ b/x-pack/plugins/reporting/public/share_context_menu/screen_capture_panel_content.test.tsx @@ -7,7 +7,7 @@ import { mount } from 'enzyme'; import React from 'react'; -import { __IntlProvider as IntlProvider } from '@kbn/i18n/react'; +import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; import { coreMock } from 'src/core/public/mocks'; import { ReportingAPIClient } from '../lib/reporting_api_client'; import { ScreenCapturePanelContent } from './screen_capture_panel_content'; diff --git a/x-pack/plugins/reporting/public/share_context_menu/screen_capture_panel_content.tsx b/x-pack/plugins/reporting/public/share_context_menu/screen_capture_panel_content.tsx index c11227edc17e5..de3cc89b31fd0 100644 --- a/x-pack/plugins/reporting/public/share_context_menu/screen_capture_panel_content.tsx +++ b/x-pack/plugins/reporting/public/share_context_menu/screen_capture_panel_content.tsx @@ -6,7 +6,7 @@ */ import { EuiFormRow, EuiSwitch, EuiSwitchEvent } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { Component } from 'react'; import { LayoutParams } from '../../common/types'; import { ReportingPanelContent, ReportingPanelProps } from './reporting_panel_content'; diff --git a/x-pack/plugins/reporting/server/deprecations/migrage_existing_indices_ilm_policy.test.ts b/x-pack/plugins/reporting/server/deprecations/migrate_existing_indices_ilm_policy.test.ts similarity index 100% rename from x-pack/plugins/reporting/server/deprecations/migrage_existing_indices_ilm_policy.test.ts rename to x-pack/plugins/reporting/server/deprecations/migrate_existing_indices_ilm_policy.test.ts diff --git a/x-pack/plugins/rollup/public/crud_app/sections/components/job_action_menu/confirm_delete_modal/confirm_delete_modal.js b/x-pack/plugins/rollup/public/crud_app/sections/components/job_action_menu/confirm_delete_modal/confirm_delete_modal.js index ec7473c69dec1..9583c9d679781 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/components/job_action_menu/confirm_delete_modal/confirm_delete_modal.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/components/job_action_menu/confirm_delete_modal/confirm_delete_modal.js @@ -8,7 +8,7 @@ import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiConfirmModal } from '@elastic/eui'; diff --git a/x-pack/plugins/rollup/public/crud_app/sections/components/job_action_menu/job_action_menu.js b/x-pack/plugins/rollup/public/crud_app/sections/components/job_action_menu/job_action_menu.js index 95749f50afdfe..3b2588b6d0200 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/components/job_action_menu/job_action_menu.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/components/job_action_menu/job_action_menu.js @@ -7,7 +7,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { diff --git a/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/job_details.js b/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/job_details.js index 300f4d114ae4a..6b89df4bdb5e9 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/job_details.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/job_details.js @@ -7,7 +7,7 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { TabSummary, TabTerms, TabMetrics, TabJson, TabHistogram, TabRequest } from './tabs'; diff --git a/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_histogram.js b/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_histogram.js index 38ca9cdb54ada..abfd14a73b557 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_histogram.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_histogram.js @@ -6,7 +6,7 @@ */ import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { diff --git a/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_request.js b/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_request.js index ace4cbbc48063..6ebd00132d3c2 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_request.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_request.js @@ -6,7 +6,7 @@ */ import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCodeBlock, EuiSpacer, EuiText } from '@elastic/eui'; diff --git a/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_summary.js b/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_summary.js index 92263338823ff..418040de24316 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_summary.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_summary.js @@ -7,7 +7,7 @@ import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescriptionList, diff --git a/x-pack/plugins/rollup/public/crud_app/sections/components/job_status/job_status.js b/x-pack/plugins/rollup/public/crud_app/sections/components/job_status/job_status.js index c02c99b023851..6842ad8f7bc92 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/components/job_status/job_status.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/components/job_status/job_status.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiHealth } from '@elastic/eui'; diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_create/job_create.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/job_create.js index 22d6f74c0aee5..9f2e44e64ca33 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/job_create/job_create.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_create/job_create.js @@ -10,7 +10,7 @@ import PropTypes from 'prop-types'; import { cloneDeep, debounce, first, mapValues } from 'lodash'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { withKibana } from '../../../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_create/navigation/navigation.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/navigation/navigation.js index e9c324cd5f87e..89362823f6b9e 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/job_create/navigation/navigation.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_create/navigation/navigation.js @@ -7,7 +7,7 @@ import React, { Fragment } from 'react'; import PropTypes from 'prop-types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/components/step_error.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/components/step_error.js index 1513075cdabcd..d6fed8b226a84 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/components/step_error.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/components/step_error.js @@ -7,7 +7,7 @@ import React, { Fragment } from 'react'; import PropTypes from 'prop-types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCallOut, EuiSpacer } from '@elastic/eui'; diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_date_histogram.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_date_histogram.js index f36f8aa65b9f3..eea02c941261a 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_date_histogram.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_date_histogram.js @@ -7,7 +7,7 @@ import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import moment from 'moment-timezone'; import { diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_histogram.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_histogram.js index e295443d3b857..0f64d6560db12 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_histogram.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_histogram.js @@ -7,7 +7,7 @@ import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_logistics.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_logistics.js index 624412756cdf0..2e54176a71e88 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_logistics.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_logistics.js @@ -7,7 +7,7 @@ import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_metrics.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_metrics.js index d1291c54dcb55..6fe3a22ea5cf8 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_metrics.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_metrics.js @@ -7,7 +7,7 @@ import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { get } from 'lodash'; diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_review.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_review.js index 3e37ab394ada4..82206038f5bb5 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_review.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_review.js @@ -7,7 +7,7 @@ import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiErrorBoundary, EuiSpacer, EuiTab, EuiTabs, EuiTitle } from '@elastic/eui'; diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_terms.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_terms.js index b8df760e1c6e3..cbabbaf57031d 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_terms.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_terms.js @@ -7,7 +7,7 @@ import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_date_histogram_field.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_date_histogram_field.js index ac54c0114e892..fa511cffecedc 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_date_histogram_field.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_date_histogram_field.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function validateDateHistogramField(dateHistogramField) { if (!dateHistogramField || !dateHistogramField.trim()) { diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_date_histogram_interval.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_date_histogram_interval.js index 756c758370301..e79416b2ef277 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_date_histogram_interval.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_date_histogram_interval.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { search } from '../../../../../../../../src/plugins/data/public'; const { InvalidEsIntervalFormatError, InvalidEsCalendarIntervalError, parseEsInterval } = search.aggs; diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_histogram_interval.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_histogram_interval.js index 75c92e5f727cc..10c8de89b27d9 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_histogram_interval.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_histogram_interval.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function validateHistogramInterval(histogram, histogramInterval) { // If there are no selected histogram fields then we don't need to validate the interval. diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_id.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_id.js index fb710beca26c2..72a8d6205350f 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_id.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_id.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function validateId(id, clonedId) { if (clonedId && id === clonedId) { diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_index_pattern.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_index_pattern.js index 5335dbea776e2..6ccda42b9007f 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_index_pattern.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_index_pattern.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { indexPatterns } from '../../../../../../../../src/plugins/data/public'; export function validateIndexPattern(indexPattern, rollupIndex) { diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_metrics.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_metrics.js index 0214b266b28f7..f523ad28970e7 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_metrics.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_metrics.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function validateMetrics(metrics) { const missingTypes = metrics.reduce((accumMissingTypes, { name, types }) => { diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_cron.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_cron.js index d3f3fe2da97c0..12f678e23f1b9 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_cron.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_cron.js @@ -7,7 +7,7 @@ import React from 'react'; import cronstrue from 'cronstrue'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function validateRollupCron(rollupCron) { if (!rollupCron || !rollupCron.trim()) { diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_delay.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_delay.js index d29814c05cf2e..454e0a25c9fee 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_delay.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_delay.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { search } from '../../../../../../../../src/plugins/data/public'; const { InvalidEsIntervalFormatError, InvalidEsCalendarIntervalError, parseEsInterval } = search.aggs; diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_index.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_index.js index c8285531549cd..9c5df48108a80 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_index.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_index.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { indices } from '../../../../shared_imports'; export function validateRollupIndex(rollupIndex, indexPattern) { diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_page_size.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_page_size.js index 2b85dd81bee1b..0d41749e1ebae 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_page_size.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_page_size.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function validateRollupPageSize(rollupPageSize) { if (!rollupPageSize || !rollupPageSize.toString().trim()) { diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_list/detail_panel/detail_panel.js b/x-pack/plugins/rollup/public/crud_app/sections/job_list/detail_panel/detail_panel.js index 5e97ff5e2980d..7c910e2976c77 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/job_list/detail_panel/detail_panel.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_list/detail_panel/detail_panel.js @@ -8,7 +8,7 @@ import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiErrorBoundary, diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_list.js b/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_list.js index b2448eb610774..81df23b853008 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_list.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_list.js @@ -7,7 +7,7 @@ import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_table/job_table.js b/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_table/job_table.js index 83135cf219f35..5a30f9e6ec5f3 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_table/job_table.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_table/job_table.js @@ -8,7 +8,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCheckbox, diff --git a/x-pack/plugins/rule_registry/server/utils/get_common_alert_fields.ts b/x-pack/plugins/rule_registry/server/utils/get_common_alert_fields.ts index 67db667188eaf..eb09d8e2dc2b1 100644 --- a/x-pack/plugins/rule_registry/server/utils/get_common_alert_fields.ts +++ b/x-pack/plugins/rule_registry/server/utils/get_common_alert_fields.ts @@ -6,8 +6,6 @@ */ import { Values } from '@kbn/utility-types'; -import { AlertExecutorOptions } from '../../../alerting/server'; -import { ParsedTechnicalFields } from '../../common/parse_technical_fields'; import { ALERT_INSTANCE_ID, ALERT_UUID, @@ -20,7 +18,10 @@ import { SPACE_IDS, TAGS, TIMESTAMP, -} from '../../common/technical_rule_data_field_names'; +} from '@kbn/rule-data-utils/technical_field_names'; + +import { AlertExecutorOptions } from '../../../alerting/server'; +import { ParsedTechnicalFields } from '../../common/parse_technical_fields'; const commonAlertFieldNames = [ ALERT_RULE_CATEGORY, diff --git a/x-pack/plugins/runtime_fields/public/components/runtime_field_form/runtime_field_form.tsx b/x-pack/plugins/runtime_fields/public/components/runtime_field_form/runtime_field_form.tsx index d3376d872e4c5..ac74cd07df225 100644 --- a/x-pack/plugins/runtime_fields/public/components/runtime_field_form/runtime_field_form.tsx +++ b/x-pack/plugins/runtime_fields/public/components/runtime_field_form/runtime_field_form.tsx @@ -7,7 +7,7 @@ import React, { useEffect, useState, useCallback } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { PainlessLang, PainlessContext } from '@kbn/monaco'; import { EuiFlexGroup, diff --git a/x-pack/plugins/runtime_fields/tsconfig.json b/x-pack/plugins/runtime_fields/tsconfig.json index 5dc704ec57693..321854e2d7bbe 100644 --- a/x-pack/plugins/runtime_fields/tsconfig.json +++ b/x-pack/plugins/runtime_fields/tsconfig.json @@ -13,6 +13,5 @@ "references": [ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/es_ui_shared/tsconfig.json" }, - { "path": "../../../src/plugins/kibana_legacy/tsconfig.json"} ] } diff --git a/x-pack/plugins/saved_objects_tagging/public/components/assign_flyout/components/action_bar.tsx b/x-pack/plugins/saved_objects_tagging/public/components/assign_flyout/components/action_bar.tsx index a6837355b0209..2cb0beaa7f612 100644 --- a/x-pack/plugins/saved_objects_tagging/public/components/assign_flyout/components/action_bar.tsx +++ b/x-pack/plugins/saved_objects_tagging/public/components/assign_flyout/components/action_bar.tsx @@ -7,7 +7,7 @@ import React, { FC } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiLink, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export interface AssignFlyoutActionBarProps { resultCount: number; diff --git a/x-pack/plugins/saved_objects_tagging/public/components/assign_flyout/components/footer.tsx b/x-pack/plugins/saved_objects_tagging/public/components/assign_flyout/components/footer.tsx index abf8b631b2b76..172b66115d1f8 100644 --- a/x-pack/plugins/saved_objects_tagging/public/components/assign_flyout/components/footer.tsx +++ b/x-pack/plugins/saved_objects_tagging/public/components/assign_flyout/components/footer.tsx @@ -7,7 +7,7 @@ import React, { FC } from 'react'; import { EuiButton, EuiButtonEmpty, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export interface AssignFlyoutFooterProps { isSaving: boolean; diff --git a/x-pack/plugins/saved_objects_tagging/public/components/assign_flyout/components/header.tsx b/x-pack/plugins/saved_objects_tagging/public/components/assign_flyout/components/header.tsx index ff6c610c17d30..39a56fbe2d199 100644 --- a/x-pack/plugins/saved_objects_tagging/public/components/assign_flyout/components/header.tsx +++ b/x-pack/plugins/saved_objects_tagging/public/components/assign_flyout/components/header.tsx @@ -7,7 +7,7 @@ import React, { FC, useMemo } from 'react'; import { EuiTitle, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ITagsCache } from '../../../services/tags'; import { TagList } from '../../base'; diff --git a/x-pack/plugins/saved_objects_tagging/public/components/assign_flyout/components/result_list.tsx b/x-pack/plugins/saved_objects_tagging/public/components/assign_flyout/components/result_list.tsx index 434a2e3dd8b30..1c9ed16263e87 100644 --- a/x-pack/plugins/saved_objects_tagging/public/components/assign_flyout/components/result_list.tsx +++ b/x-pack/plugins/saved_objects_tagging/public/components/assign_flyout/components/result_list.tsx @@ -7,7 +7,7 @@ import React, { FC } from 'react'; import { EuiIcon, EuiSelectable, EuiSelectableOption, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { AssignableObject } from '../../../../common/assignments'; import { AssignmentAction, AssignmentOverrideMap, AssignmentStatusMap } from '../types'; import { getKey, getOverriddenStatus, getAssignmentAction } from '../utils'; diff --git a/x-pack/plugins/saved_objects_tagging/public/components/base/tag_selector.tsx b/x-pack/plugins/saved_objects_tagging/public/components/base/tag_selector.tsx index 76003391aafe4..7ce3f3aec714c 100644 --- a/x-pack/plugins/saved_objects_tagging/public/components/base/tag_selector.tsx +++ b/x-pack/plugins/saved_objects_tagging/public/components/base/tag_selector.tsx @@ -15,7 +15,7 @@ import { EuiFlexGroup, EuiFlexItem, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Tag } from '../../../common'; import { testSubjFriendly } from '../../utils'; import { CreateModalOpener } from '../edition_modal'; diff --git a/x-pack/plugins/saved_objects_tagging/public/components/connected/saved_object_save_modal_tag_selector.tsx b/x-pack/plugins/saved_objects_tagging/public/components/connected/saved_object_save_modal_tag_selector.tsx index 3e24164ea29a9..3eb31100a2a01 100644 --- a/x-pack/plugins/saved_objects_tagging/public/components/connected/saved_object_save_modal_tag_selector.tsx +++ b/x-pack/plugins/saved_objects_tagging/public/components/connected/saved_object_save_modal_tag_selector.tsx @@ -8,7 +8,7 @@ import React, { FC, useCallback, useState } from 'react'; import useObservable from 'react-use/lib/useObservable'; import { EuiFormRow } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { SavedObjectSaveModalTagSelectorComponentProps } from '../../../../../../src/plugins/saved_objects_tagging_oss/public'; import { TagsCapabilities } from '../../../common'; import { TagSelector } from '../base'; diff --git a/x-pack/plugins/saved_objects_tagging/public/components/edition_modal/create_or_edit_modal.tsx b/x-pack/plugins/saved_objects_tagging/public/components/edition_modal/create_or_edit_modal.tsx index d5d1365a9d1fe..8dc9f6d04d5de 100644 --- a/x-pack/plugins/saved_objects_tagging/public/components/edition_modal/create_or_edit_modal.tsx +++ b/x-pack/plugins/saved_objects_tagging/public/components/edition_modal/create_or_edit_modal.tsx @@ -26,7 +26,7 @@ import { htmlIdGenerator, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { TagAttributes, TagValidation, diff --git a/x-pack/plugins/saved_objects_tagging/public/management/components/action_bar.tsx b/x-pack/plugins/saved_objects_tagging/public/management/components/action_bar.tsx index dd4ad544e96e6..cb2d2f59235dd 100644 --- a/x-pack/plugins/saved_objects_tagging/public/management/components/action_bar.tsx +++ b/x-pack/plugins/saved_objects_tagging/public/management/components/action_bar.tsx @@ -16,7 +16,7 @@ import { EuiLink, EuiIcon, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { TagBulkAction } from '../types'; import './_action_bar.scss'; diff --git a/x-pack/plugins/saved_objects_tagging/public/management/components/header.tsx b/x-pack/plugins/saved_objects_tagging/public/management/components/header.tsx index d7eb737636759..55b4a31961184 100644 --- a/x-pack/plugins/saved_objects_tagging/public/management/components/header.tsx +++ b/x-pack/plugins/saved_objects_tagging/public/management/components/header.tsx @@ -7,7 +7,7 @@ import React, { FC } from 'react'; import { EuiButton, EuiPageHeader } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; interface HeaderProps { canCreate: boolean; diff --git a/x-pack/plugins/saved_objects_tagging/public/management/components/table.tsx b/x-pack/plugins/saved_objects_tagging/public/management/components/table.tsx index f7490f972bb7c..8f35b0366b79c 100644 --- a/x-pack/plugins/saved_objects_tagging/public/management/components/table.tsx +++ b/x-pack/plugins/saved_objects_tagging/public/management/components/table.tsx @@ -8,7 +8,7 @@ import React, { useRef, useEffect, FC, ReactNode } from 'react'; import { EuiInMemoryTable, EuiBasicTableColumn, EuiLink, Query } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { TagsCapabilities, TagWithRelations } from '../../../common'; import { TagBadge } from '../../components'; import { TagAction } from '../actions'; diff --git a/x-pack/plugins/saved_objects_tagging/public/management/mount_section.tsx b/x-pack/plugins/saved_objects_tagging/public/management/mount_section.tsx index 2cd412593f492..9c36f991e8c8e 100644 --- a/x-pack/plugins/saved_objects_tagging/public/management/mount_section.tsx +++ b/x-pack/plugins/saved_objects_tagging/public/management/mount_section.tsx @@ -7,7 +7,7 @@ import React, { FC } from 'react'; import ReactDOM from 'react-dom'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { CoreSetup, ApplicationStart } from 'src/core/public'; import { ManagementAppMountParams } from '../../../../../src/plugins/management/public'; import { getTagsCapabilities } from '../../common'; diff --git a/x-pack/plugins/searchprofiler/public/application/components/license_warning_notice/license_warning_notice.tsx b/x-pack/plugins/searchprofiler/public/application/components/license_warning_notice/license_warning_notice.tsx index e8fd1d10d56d5..c74b899f81e06 100644 --- a/x-pack/plugins/searchprofiler/public/application/components/license_warning_notice/license_warning_notice.tsx +++ b/x-pack/plugins/searchprofiler/public/application/components/license_warning_notice/license_warning_notice.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiCallOut, EuiText, EuiLink, EuiCode } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const LicenseWarningNotice = () => { const registerLicenseLinkLabel = i18n.translate('xpack.searchProfiler.registerLicenseLinkLabel', { diff --git a/x-pack/plugins/security/public/account_management/account_management_app.test.ts b/x-pack/plugins/security/public/account_management/account_management_app.test.ts index d3a4c36ba6b93..11b188a1d1370 100644 --- a/x-pack/plugins/security/public/account_management/account_management_app.test.ts +++ b/x-pack/plugins/security/public/account_management/account_management_app.test.ts @@ -43,7 +43,6 @@ describe('accountManagementApp', () => { coreSetupMock.getStartServices.mockResolvedValue([coreStartMock, {}, {}]); const authcMock = securityMock.createSetup().authc; - const containerMock = document.createElement('div'); accountManagementApp.create({ application: coreSetupMock.application, @@ -52,14 +51,15 @@ describe('accountManagementApp', () => { }); const [[{ mount }]] = coreSetupMock.application.register.mock.calls; - await (mount as AppMount)({ - element: containerMock, + const appMountParams = { + element: document.createElement('div'), appBasePath: '', onAppLeave: jest.fn(), setHeaderActionMenu: jest.fn(), history: scopedHistoryMock.create(), theme$: themeServiceMock.createTheme$(), - }); + }; + await (mount as AppMount)(appMountParams); expect(coreStartMock.chrome.setBreadcrumbs).toHaveBeenCalledTimes(1); expect(coreStartMock.chrome.setBreadcrumbs).toHaveBeenCalledWith([ @@ -68,10 +68,14 @@ describe('accountManagementApp', () => { const mockRenderApp = jest.requireMock('./account_management_page').renderAccountManagementPage; expect(mockRenderApp).toHaveBeenCalledTimes(1); - expect(mockRenderApp).toHaveBeenCalledWith(coreStartMock.i18n, containerMock, { - userAPIClient: expect.any(UserAPIClient), - authc: authcMock, - notifications: coreStartMock.notifications, - }); + expect(mockRenderApp).toHaveBeenCalledWith( + coreStartMock.i18n, + { element: appMountParams.element, theme$: appMountParams.theme$ }, + { + userAPIClient: expect.any(UserAPIClient), + authc: authcMock, + notifications: coreStartMock.notifications, + } + ); }); }); diff --git a/x-pack/plugins/security/public/account_management/account_management_app.ts b/x-pack/plugins/security/public/account_management/account_management_app.ts index 69a5155fa51a7..d95b86194f54f 100644 --- a/x-pack/plugins/security/public/account_management/account_management_app.ts +++ b/x-pack/plugins/security/public/account_management/account_management_app.ts @@ -28,18 +28,22 @@ export const accountManagementApp = Object.freeze({ title, navLinkStatus: AppNavLinkStatus.hidden, appRoute: '/security/account', - async mount({ element }: AppMountParameters) { + async mount({ element, theme$ }: AppMountParameters) { const [[coreStart], { renderAccountManagementPage }, { UserAPIClient }] = await Promise.all( [getStartServices(), import('./account_management_page'), import('../management')] ); coreStart.chrome.setBreadcrumbs([{ text: title }]); - return renderAccountManagementPage(coreStart.i18n, element, { - authc, - notifications: coreStart.notifications, - userAPIClient: new UserAPIClient(coreStart.http), - }); + return renderAccountManagementPage( + coreStart.i18n, + { element, theme$ }, + { + authc, + notifications: coreStart.notifications, + userAPIClient: new UserAPIClient(coreStart.http), + } + ); }, }); }, diff --git a/x-pack/plugins/security/public/account_management/account_management_page.tsx b/x-pack/plugins/security/public/account_management/account_management_page.tsx index 60f48c01a6ff7..bc5229ba6bc9f 100644 --- a/x-pack/plugins/security/public/account_management/account_management_page.tsx +++ b/x-pack/plugins/security/public/account_management/account_management_page.tsx @@ -9,10 +9,11 @@ import { EuiPage, EuiPageBody, EuiPanel, EuiSpacer, EuiText } from '@elastic/eui import React, { useEffect, useState } from 'react'; import ReactDOM from 'react-dom'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { PublicMethodsOf } from '@kbn/utility-types'; -import type { CoreStart, NotificationsStart } from 'src/core/public'; +import type { AppMountParameters, CoreStart, NotificationsStart } from 'src/core/public'; +import { KibanaThemeProvider } from '../../../../../src/plugins/kibana_react/public'; import type { AuthenticatedUser } from '../../common/model'; import { getUserDisplayName } from '../../common/model'; import type { AuthenticationServiceSetup } from '../authentication'; @@ -67,12 +68,14 @@ export const AccountManagementPage = ({ userAPIClient, authc, notifications }: P export function renderAccountManagementPage( i18nStart: CoreStart['i18n'], - element: Element, + { element, theme$ }: Pick, props: Props ) { ReactDOM.render( - + + + , element ); diff --git a/x-pack/plugins/security/public/account_management/change_password/change_password.tsx b/x-pack/plugins/security/public/account_management/change_password/change_password.tsx index ac0e284c8b9ad..8c85b47675c54 100644 --- a/x-pack/plugins/security/public/account_management/change_password/change_password.tsx +++ b/x-pack/plugins/security/public/account_management/change_password/change_password.tsx @@ -8,7 +8,7 @@ import { EuiDescribedFormGroup } from '@elastic/eui'; import React, { Component } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { PublicMethodsOf } from '@kbn/utility-types'; import type { NotificationsSetup } from 'src/core/public'; diff --git a/x-pack/plugins/security/public/account_management/personal_info/personal_info.tsx b/x-pack/plugins/security/public/account_management/personal_info/personal_info.tsx index 20b21fc0c30ce..e0d9bb78cf595 100644 --- a/x-pack/plugins/security/public/account_management/personal_info/personal_info.tsx +++ b/x-pack/plugins/security/public/account_management/personal_info/personal_info.tsx @@ -8,7 +8,7 @@ import { EuiDescribedFormGroup, EuiFormRow, EuiText } from '@elastic/eui'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { AuthenticatedUser } from '../../../common/model'; diff --git a/x-pack/plugins/security/public/authentication/access_agreement/access_agreement_app.test.ts b/x-pack/plugins/security/public/authentication/access_agreement/access_agreement_app.test.ts index f192f298009f7..e76a4ca20b59c 100644 --- a/x-pack/plugins/security/public/authentication/access_agreement/access_agreement_app.test.ts +++ b/x-pack/plugins/security/public/authentication/access_agreement/access_agreement_app.test.ts @@ -37,7 +37,6 @@ describe('accessAgreementApp', () => { const coreSetupMock = coreMock.createSetup(); const coreStartMock = coreMock.createStart(); coreSetupMock.getStartServices.mockResolvedValue([coreStartMock, {}, {}]); - const containerMock = document.createElement('div'); accessAgreementApp.create({ application: coreSetupMock.application, @@ -45,21 +44,26 @@ describe('accessAgreementApp', () => { }); const [[{ mount }]] = coreSetupMock.application.register.mock.calls; - await (mount as AppMount)({ - element: containerMock, + const appMountParams = { + element: document.createElement('div'), appBasePath: '', onAppLeave: jest.fn(), setHeaderActionMenu: jest.fn(), history: scopedHistoryMock.create(), theme$: themeServiceMock.createTheme$(), - }); + }; + await (mount as AppMount)(appMountParams); const mockRenderApp = jest.requireMock('./access_agreement_page').renderAccessAgreementPage; expect(mockRenderApp).toHaveBeenCalledTimes(1); - expect(mockRenderApp).toHaveBeenCalledWith(coreStartMock.i18n, containerMock, { - http: coreStartMock.http, - notifications: coreStartMock.notifications, - fatalErrors: coreStartMock.fatalErrors, - }); + expect(mockRenderApp).toHaveBeenCalledWith( + coreStartMock.i18n, + { element: appMountParams.element, theme$: appMountParams.theme$ }, + { + http: coreStartMock.http, + notifications: coreStartMock.notifications, + fatalErrors: coreStartMock.fatalErrors, + } + ); }); }); diff --git a/x-pack/plugins/security/public/authentication/access_agreement/access_agreement_app.ts b/x-pack/plugins/security/public/authentication/access_agreement/access_agreement_app.ts index 27da278b8fa89..44fd5048cc60b 100644 --- a/x-pack/plugins/security/public/authentication/access_agreement/access_agreement_app.ts +++ b/x-pack/plugins/security/public/authentication/access_agreement/access_agreement_app.ts @@ -23,16 +23,20 @@ export const accessAgreementApp = Object.freeze({ }), chromeless: true, appRoute: '/security/access_agreement', - async mount({ element }: AppMountParameters) { + async mount({ element, theme$ }: AppMountParameters) { const [[coreStart], { renderAccessAgreementPage }] = await Promise.all([ getStartServices(), import('./access_agreement_page'), ]); - return renderAccessAgreementPage(coreStart.i18n, element, { - http: coreStart.http, - notifications: coreStart.notifications, - fatalErrors: coreStart.fatalErrors, - }); + return renderAccessAgreementPage( + coreStart.i18n, + { element, theme$ }, + { + http: coreStart.http, + notifications: coreStart.notifications, + fatalErrors: coreStart.fatalErrors, + } + ); }, }); }, diff --git a/x-pack/plugins/security/public/authentication/access_agreement/access_agreement_page.tsx b/x-pack/plugins/security/public/authentication/access_agreement/access_agreement_page.tsx index 78f36bb460f47..978880d797189 100644 --- a/x-pack/plugins/security/public/authentication/access_agreement/access_agreement_page.tsx +++ b/x-pack/plugins/security/public/authentication/access_agreement/access_agreement_page.tsx @@ -22,9 +22,16 @@ import ReactDOM from 'react-dom'; import ReactMarkdown from 'react-markdown'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; -import type { CoreStart, FatalErrorsStart, HttpStart, NotificationsStart } from 'src/core/public'; +import { FormattedMessage } from '@kbn/i18n-react'; +import type { + AppMountParameters, + CoreStart, + FatalErrorsStart, + HttpStart, + NotificationsStart, +} from 'src/core/public'; +import { KibanaThemeProvider } from '../../../../../../src/plugins/kibana_react/public'; import { parseNext } from '../../../common/parse_next'; import { AuthenticationStatePage } from '../components'; @@ -122,12 +129,14 @@ export function AccessAgreementPage({ http, fatalErrors, notifications }: Props) export function renderAccessAgreementPage( i18nStart: CoreStart['i18n'], - element: Element, + { element, theme$ }: Pick, props: Props ) { ReactDOM.render( - + + + , element ); diff --git a/x-pack/plugins/security/public/authentication/logged_out/logged_out_app.test.ts b/x-pack/plugins/security/public/authentication/logged_out/logged_out_app.test.ts index a88195c6fe8a6..fff6c9e69c5c0 100644 --- a/x-pack/plugins/security/public/authentication/logged_out/logged_out_app.test.ts +++ b/x-pack/plugins/security/public/authentication/logged_out/logged_out_app.test.ts @@ -38,24 +38,25 @@ describe('loggedOutApp', () => { const coreStartMock = coreMock.createStart(); coreSetupMock.getStartServices.mockResolvedValue([coreStartMock, {}, {}]); - const containerMock = document.createElement('div'); - loggedOutApp.create(coreSetupMock); const [[{ mount }]] = coreSetupMock.application.register.mock.calls; - await (mount as AppMount)({ - element: containerMock, + const appMountParams = { + element: document.createElement('div'), appBasePath: '', onAppLeave: jest.fn(), setHeaderActionMenu: jest.fn(), history: scopedHistoryMock.create(), theme$: themeServiceMock.createTheme$(), - }); + }; + await (mount as AppMount)(appMountParams); const mockRenderApp = jest.requireMock('./logged_out_page').renderLoggedOutPage; expect(mockRenderApp).toHaveBeenCalledTimes(1); - expect(mockRenderApp).toHaveBeenCalledWith(coreStartMock.i18n, containerMock, { - basePath: coreStartMock.http.basePath, - }); + expect(mockRenderApp).toHaveBeenCalledWith( + coreStartMock.i18n, + { element: appMountParams.element, theme$: appMountParams.theme$ }, + { basePath: coreStartMock.http.basePath } + ); }); }); diff --git a/x-pack/plugins/security/public/authentication/logged_out/logged_out_app.ts b/x-pack/plugins/security/public/authentication/logged_out/logged_out_app.ts index 962524de6d1f0..b84bf9b21f2fc 100644 --- a/x-pack/plugins/security/public/authentication/logged_out/logged_out_app.ts +++ b/x-pack/plugins/security/public/authentication/logged_out/logged_out_app.ts @@ -28,12 +28,16 @@ export const loggedOutApp = Object.freeze({ title: i18n.translate('xpack.security.loggedOutAppTitle', { defaultMessage: 'Logged out' }), chromeless: true, appRoute: '/security/logged_out', - async mount({ element }: AppMountParameters) { + async mount({ element, theme$ }: AppMountParameters) { const [[coreStart], { renderLoggedOutPage }] = await Promise.all([ getStartServices(), import('./logged_out_page'), ]); - return renderLoggedOutPage(coreStart.i18n, element, { basePath: coreStart.http.basePath }); + return renderLoggedOutPage( + coreStart.i18n, + { element, theme$ }, + { basePath: coreStart.http.basePath } + ); }, }); }, diff --git a/x-pack/plugins/security/public/authentication/logged_out/logged_out_page.tsx b/x-pack/plugins/security/public/authentication/logged_out/logged_out_page.tsx index 477a41e248858..93ab443693e73 100644 --- a/x-pack/plugins/security/public/authentication/logged_out/logged_out_page.tsx +++ b/x-pack/plugins/security/public/authentication/logged_out/logged_out_page.tsx @@ -9,9 +9,10 @@ import { EuiButton } from '@elastic/eui'; import React from 'react'; import ReactDOM from 'react-dom'; -import { FormattedMessage } from '@kbn/i18n/react'; -import type { CoreStart, IBasePath } from 'src/core/public'; +import { FormattedMessage } from '@kbn/i18n-react'; +import type { AppMountParameters, CoreStart, IBasePath } from 'src/core/public'; +import { KibanaThemeProvider } from '../../../../../../src/plugins/kibana_react/public'; import { parseNext } from '../../../common/parse_next'; import { AuthenticationStatePage } from '../components'; @@ -36,10 +37,16 @@ export function LoggedOutPage({ basePath }: Props) { ); } -export function renderLoggedOutPage(i18nStart: CoreStart['i18n'], element: Element, props: Props) { +export function renderLoggedOutPage( + i18nStart: CoreStart['i18n'], + { element, theme$ }: Pick, + props: Props +) { ReactDOM.render( - + + + , element ); diff --git a/x-pack/plugins/security/public/authentication/login/components/login_form/login_form.tsx b/x-pack/plugins/security/public/authentication/login/components/login_form/login_form.tsx index b8808415fc60b..e1c51e612ff11 100644 --- a/x-pack/plugins/security/public/authentication/login/components/login_form/login_form.tsx +++ b/x-pack/plugins/security/public/authentication/login/components/login_form/login_form.tsx @@ -30,7 +30,7 @@ import React, { Component, Fragment } from 'react'; import ReactMarkdown from 'react-markdown'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { HttpStart, IHttpFetchError, NotificationsStart } from 'src/core/public'; import type { LoginSelector, LoginSelectorProvider } from '../../../../../common/login_state'; diff --git a/x-pack/plugins/security/public/authentication/login/login_app.test.ts b/x-pack/plugins/security/public/authentication/login/login_app.test.ts index 5406494067d0e..bf121c02f4c96 100644 --- a/x-pack/plugins/security/public/authentication/login/login_app.test.ts +++ b/x-pack/plugins/security/public/authentication/login/login_app.test.ts @@ -40,7 +40,6 @@ describe('loginApp', () => { const coreSetupMock = coreMock.createSetup(); const coreStartMock = coreMock.createStart(); coreSetupMock.getStartServices.mockResolvedValue([coreStartMock, {}, {}]); - const containerMock = document.createElement('div'); loginApp.create({ ...coreSetupMock, @@ -48,22 +47,27 @@ describe('loginApp', () => { }); const [[{ mount }]] = coreSetupMock.application.register.mock.calls; - await (mount as AppMount)({ - element: containerMock, + const appMountParams = { + element: document.createElement('div'), appBasePath: '', onAppLeave: jest.fn(), setHeaderActionMenu: jest.fn(), history: scopedHistoryMock.create(), theme$: themeServiceMock.createTheme$(), - }); + }; + await (mount as AppMount)(appMountParams); const mockRenderApp = jest.requireMock('./login_page').renderLoginPage; expect(mockRenderApp).toHaveBeenCalledTimes(1); - expect(mockRenderApp).toHaveBeenCalledWith(coreStartMock.i18n, containerMock, { - http: coreStartMock.http, - notifications: coreStartMock.notifications, - fatalErrors: coreStartMock.fatalErrors, - loginAssistanceMessage: 'some-message', - }); + expect(mockRenderApp).toHaveBeenCalledWith( + coreStartMock.i18n, + { element: appMountParams.element, theme$: appMountParams.theme$ }, + { + http: coreStartMock.http, + notifications: coreStartMock.notifications, + fatalErrors: coreStartMock.fatalErrors, + loginAssistanceMessage: 'some-message', + } + ); }); }); diff --git a/x-pack/plugins/security/public/authentication/login/login_app.ts b/x-pack/plugins/security/public/authentication/login/login_app.ts index 21937e937ccf1..62007e9c56e5e 100644 --- a/x-pack/plugins/security/public/authentication/login/login_app.ts +++ b/x-pack/plugins/security/public/authentication/login/login_app.ts @@ -31,17 +31,21 @@ export const loginApp = Object.freeze({ title: i18n.translate('xpack.security.loginAppTitle', { defaultMessage: 'Login' }), chromeless: true, appRoute: '/login', - async mount({ element }: AppMountParameters) { + async mount({ element, theme$ }: AppMountParameters) { const [[coreStart], { renderLoginPage }] = await Promise.all([ getStartServices(), import('./login_page'), ]); - return renderLoginPage(coreStart.i18n, element, { - http: coreStart.http, - notifications: coreStart.notifications, - fatalErrors: coreStart.fatalErrors, - loginAssistanceMessage: config.loginAssistanceMessage, - }); + return renderLoginPage( + coreStart.i18n, + { element, theme$ }, + { + http: coreStart.http, + notifications: coreStart.notifications, + fatalErrors: coreStart.fatalErrors, + loginAssistanceMessage: config.loginAssistanceMessage, + } + ); }, }); }, diff --git a/x-pack/plugins/security/public/authentication/login/login_page.tsx b/x-pack/plugins/security/public/authentication/login/login_page.tsx index e22c38b956e8d..555c1eafc42a3 100644 --- a/x-pack/plugins/security/public/authentication/login/login_page.tsx +++ b/x-pack/plugins/security/public/authentication/login/login_page.tsx @@ -14,9 +14,16 @@ import ReactDOM from 'react-dom'; import { BehaviorSubject } from 'rxjs'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; -import type { CoreStart, FatalErrorsStart, HttpStart, NotificationsStart } from 'src/core/public'; +import { FormattedMessage } from '@kbn/i18n-react'; +import type { + AppMountParameters, + CoreStart, + FatalErrorsStart, + HttpStart, + NotificationsStart, +} from 'src/core/public'; +import { KibanaThemeProvider } from '../../../../../../src/plugins/kibana_react/public'; import { AUTH_PROVIDER_HINT_QUERY_STRING_PARAMETER, LOGOUT_REASON_QUERY_STRING_PARAMETER, @@ -251,10 +258,16 @@ export class LoginPage extends Component { }; } -export function renderLoginPage(i18nStart: CoreStart['i18n'], element: Element, props: Props) { +export function renderLoginPage( + i18nStart: CoreStart['i18n'], + { element, theme$ }: Pick, + props: Props +) { ReactDOM.render( - + + + , element ); diff --git a/x-pack/plugins/security/public/authentication/overwritten_session/overwritten_session_app.test.ts b/x-pack/plugins/security/public/authentication/overwritten_session/overwritten_session_app.test.ts index 95497bdc1fb54..6fb40181e1b77 100644 --- a/x-pack/plugins/security/public/authentication/overwritten_session/overwritten_session_app.test.ts +++ b/x-pack/plugins/security/public/authentication/overwritten_session/overwritten_session_app.test.ts @@ -41,8 +41,6 @@ describe('overwrittenSessionApp', () => { coreSetupMock.getStartServices.mockResolvedValue([coreStartMock, {}, {}]); const authcMock = securityMock.createSetup().authc; - const containerMock = document.createElement('div'); - overwrittenSessionApp.create({ application: coreSetupMock.application, getStartServices: coreSetupMock.getStartServices, @@ -50,22 +48,24 @@ describe('overwrittenSessionApp', () => { }); const [[{ mount }]] = coreSetupMock.application.register.mock.calls; - await (mount as AppMount)({ - element: containerMock, + const appMountParams = { + element: document.createElement('div'), appBasePath: '', onAppLeave: jest.fn(), setHeaderActionMenu: jest.fn(), history: scopedHistoryMock.create(), theme$: themeServiceMock.createTheme$(), - }); + }; + await (mount as AppMount)(appMountParams); const mockRenderApp = jest.requireMock( './overwritten_session_page' ).renderOverwrittenSessionPage; expect(mockRenderApp).toHaveBeenCalledTimes(1); - expect(mockRenderApp).toHaveBeenCalledWith(coreStartMock.i18n, containerMock, { - authc: authcMock, - basePath: coreStartMock.http.basePath, - }); + expect(mockRenderApp).toHaveBeenCalledWith( + coreStartMock.i18n, + { element: appMountParams.element, theme$: appMountParams.theme$ }, + { authc: authcMock, basePath: coreStartMock.http.basePath } + ); }); }); diff --git a/x-pack/plugins/security/public/authentication/overwritten_session/overwritten_session_app.ts b/x-pack/plugins/security/public/authentication/overwritten_session/overwritten_session_app.ts index 715d732cd47e7..d03f300f67608 100644 --- a/x-pack/plugins/security/public/authentication/overwritten_session/overwritten_session_app.ts +++ b/x-pack/plugins/security/public/authentication/overwritten_session/overwritten_session_app.ts @@ -26,15 +26,19 @@ export const overwrittenSessionApp = Object.freeze({ }), chromeless: true, appRoute: '/security/overwritten_session', - async mount({ element }: AppMountParameters) { + async mount({ element, theme$ }: AppMountParameters) { const [[coreStart], { renderOverwrittenSessionPage }] = await Promise.all([ getStartServices(), import('./overwritten_session_page'), ]); - return renderOverwrittenSessionPage(coreStart.i18n, element, { - authc, - basePath: coreStart.http.basePath, - }); + return renderOverwrittenSessionPage( + coreStart.i18n, + { element, theme$ }, + { + authc, + basePath: coreStart.http.basePath, + } + ); }, }); }, diff --git a/x-pack/plugins/security/public/authentication/overwritten_session/overwritten_session_page.tsx b/x-pack/plugins/security/public/authentication/overwritten_session/overwritten_session_page.tsx index 4d9d62bb7c65f..810d094490dca 100644 --- a/x-pack/plugins/security/public/authentication/overwritten_session/overwritten_session_page.tsx +++ b/x-pack/plugins/security/public/authentication/overwritten_session/overwritten_session_page.tsx @@ -9,9 +9,10 @@ import { EuiButton } from '@elastic/eui'; import React, { useEffect, useState } from 'react'; import ReactDOM from 'react-dom'; -import { FormattedMessage } from '@kbn/i18n/react'; -import type { CoreStart, IBasePath } from 'src/core/public'; +import { FormattedMessage } from '@kbn/i18n-react'; +import type { AppMountParameters, CoreStart, IBasePath } from 'src/core/public'; +import { KibanaThemeProvider } from '../../../../../../src/plugins/kibana_react/public'; import { parseNext } from '../../../common/parse_next'; import type { AuthenticationServiceSetup } from '../authentication_service'; import { AuthenticationStatePage } from '../components'; @@ -53,12 +54,14 @@ export function OverwrittenSessionPage({ authc, basePath }: Props) { export function renderOverwrittenSessionPage( i18nStart: CoreStart['i18n'], - element: Element, + { element, theme$ }: Pick, props: Props ) { ReactDOM.render( - + + + , element ); diff --git a/x-pack/plugins/security/public/components/form_flyout.tsx b/x-pack/plugins/security/public/components/form_flyout.tsx index 2af210b339320..020e5d7f31bf5 100644 --- a/x-pack/plugins/security/public/components/form_flyout.tsx +++ b/x-pack/plugins/security/public/components/form_flyout.tsx @@ -21,7 +21,7 @@ import { import type { FunctionComponent, RefObject } from 'react'; import React, { useEffect } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useHtmlId } from './use_html_id'; diff --git a/x-pack/plugins/security/public/management/api_keys/api_keys_grid/api_keys_empty_prompt.tsx b/x-pack/plugins/security/public/management/api_keys/api_keys_grid/api_keys_empty_prompt.tsx index eaded9a5c83ee..eb7cf8e92c838 100644 --- a/x-pack/plugins/security/public/management/api_keys/api_keys_grid/api_keys_empty_prompt.tsx +++ b/x-pack/plugins/security/public/management/api_keys/api_keys_grid/api_keys_empty_prompt.tsx @@ -9,7 +9,7 @@ import { EuiAccordion, EuiEmptyPrompt, EuiErrorBoundary, EuiSpacer, EuiText } fr import type { FunctionComponent } from 'react'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { DocLink } from '../../../components/doc_link'; import { useHtmlId } from '../../../components/use_html_id'; diff --git a/x-pack/plugins/security/public/management/api_keys/api_keys_grid/api_keys_grid_page.test.tsx b/x-pack/plugins/security/public/management/api_keys/api_keys_grid/api_keys_grid_page.test.tsx index 6e3de061fd191..1e944e1f31353 100644 --- a/x-pack/plugins/security/public/management/api_keys/api_keys_grid/api_keys_grid_page.test.tsx +++ b/x-pack/plugins/security/public/management/api_keys/api_keys_grid/api_keys_grid_page.test.tsx @@ -9,7 +9,7 @@ import { render } from '@testing-library/react'; import { createMemoryHistory } from 'history'; import React from 'react'; -import { coreMock } from '../../../../../../../src/core/public/mocks'; +import { coreMock, themeServiceMock } from '../../../../../../../src/core/public/mocks'; import { mockAuthenticatedUser } from '../../../../common/model/authenticated_user.mock'; import { securityMock } from '../../../mocks'; import { Providers } from '../api_keys_management_app'; @@ -33,6 +33,7 @@ describe('APIKeysGridPage', () => { const consoleWarnMock = jest.spyOn(console, 'error').mockImplementation(); const coreStart = coreMock.createStart(); + const theme$ = themeServiceMock.createTheme$(); const apiClientMock = apiKeysAPIClientMock.create(); const { authc } = securityMock.createSetup(); @@ -85,7 +86,7 @@ describe('APIKeysGridPage', () => { const history = createMemoryHistory({ initialEntries: ['/'] }); const { findByText } = render( - + { }); const { findByText } = render( - + { }); const { findByText } = render( - + { const history = createMemoryHistory({ initialEntries: ['/'] }); const { findByText } = render( - + ( diff --git a/x-pack/plugins/security/public/management/api_keys/api_keys_management_app.tsx b/x-pack/plugins/security/public/management/api_keys/api_keys_management_app.tsx index 68e06d38db4c8..2532c72d34e83 100644 --- a/x-pack/plugins/security/public/management/api_keys/api_keys_management_app.tsx +++ b/x-pack/plugins/security/public/management/api_keys/api_keys_management_app.tsx @@ -10,12 +10,20 @@ import type { FunctionComponent } from 'react'; import React from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; import { Router } from 'react-router-dom'; +import type { Observable } from 'rxjs'; import { i18n } from '@kbn/i18n'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; -import type { CoreStart, StartServicesAccessor } from '../../../../../../src/core/public'; -import { KibanaContextProvider } from '../../../../../../src/plugins/kibana_react/public'; +import type { + CoreStart, + CoreTheme, + StartServicesAccessor, +} from '../../../../../../src/core/public'; +import { + KibanaContextProvider, + KibanaThemeProvider, +} from '../../../../../../src/plugins/kibana_react/public'; import type { RegisterManagementAppArgs } from '../../../../../../src/plugins/management/public'; import type { AuthenticationServiceSetup } from '../../authentication'; import type { BreadcrumbsChangeHandler } from '../../components/breadcrumb'; @@ -41,7 +49,7 @@ export const apiKeysManagementApp = Object.freeze({ title: i18n.translate('xpack.security.management.apiKeysTitle', { defaultMessage: 'API keys', }), - async mount({ element, setBreadcrumbs, history }) { + async mount({ element, theme$, setBreadcrumbs, history }) { const [[coreStart], { APIKeysGridPage }, { APIKeysAPIClient }] = await Promise.all([ getStartServices(), import('./api_keys_grid'), @@ -51,6 +59,7 @@ export const apiKeysManagementApp = Object.freeze({ render( ; history: History; authc: AuthenticationServiceSetup; onChange?: BreadcrumbsChangeHandler; @@ -88,6 +98,7 @@ export interface ProvidersProps { export const Providers: FunctionComponent = ({ services, + theme$, history, authc, onChange, @@ -96,9 +107,11 @@ export const Providers: FunctionComponent = ({ - - {children} - + + + {children} + + diff --git a/x-pack/plugins/security/public/management/badges/deprecated_badge.tsx b/x-pack/plugins/security/public/management/badges/deprecated_badge.tsx index 471f4f1f9b31b..f55fa2c1927da 100644 --- a/x-pack/plugins/security/public/management/badges/deprecated_badge.tsx +++ b/x-pack/plugins/security/public/management/badges/deprecated_badge.tsx @@ -9,7 +9,7 @@ import type { EuiToolTipProps } from '@elastic/eui'; import { EuiBadge } from '@elastic/eui'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { OptionalToolTip } from './optional_tooltip'; diff --git a/x-pack/plugins/security/public/management/badges/disabled_badge.tsx b/x-pack/plugins/security/public/management/badges/disabled_badge.tsx index 133baa3a6b2f1..1023fe25b3cd6 100644 --- a/x-pack/plugins/security/public/management/badges/disabled_badge.tsx +++ b/x-pack/plugins/security/public/management/badges/disabled_badge.tsx @@ -9,7 +9,7 @@ import type { EuiToolTipProps } from '@elastic/eui'; import { EuiBadge } from '@elastic/eui'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { OptionalToolTip } from './optional_tooltip'; diff --git a/x-pack/plugins/security/public/management/badges/enabled_badge.tsx b/x-pack/plugins/security/public/management/badges/enabled_badge.tsx index a03a5ab3060e3..52b244fd3d206 100644 --- a/x-pack/plugins/security/public/management/badges/enabled_badge.tsx +++ b/x-pack/plugins/security/public/management/badges/enabled_badge.tsx @@ -9,7 +9,7 @@ import type { EuiToolTipProps } from '@elastic/eui'; import { EuiBadge } from '@elastic/eui'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { OptionalToolTip } from './optional_tooltip'; diff --git a/x-pack/plugins/security/public/management/badges/reserved_badge.tsx b/x-pack/plugins/security/public/management/badges/reserved_badge.tsx index 9ad0c718a5612..9bb9608db4bcb 100644 --- a/x-pack/plugins/security/public/management/badges/reserved_badge.tsx +++ b/x-pack/plugins/security/public/management/badges/reserved_badge.tsx @@ -9,7 +9,7 @@ import type { EuiToolTipProps } from '@elastic/eui'; import { EuiBadge } from '@elastic/eui'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { OptionalToolTip } from './optional_tooltip'; diff --git a/x-pack/plugins/security/public/management/role_combo_box/role_combo_box.tsx b/x-pack/plugins/security/public/management/role_combo_box/role_combo_box.tsx index f894d59ce30c0..3eabf885d877d 100644 --- a/x-pack/plugins/security/public/management/role_combo_box/role_combo_box.tsx +++ b/x-pack/plugins/security/public/management/role_combo_box/role_combo_box.tsx @@ -10,7 +10,7 @@ import { EuiBadge, EuiComboBox, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { Role } from '../../../common/model'; import { isRoleAdmin, isRoleDeprecated, isRoleReserved, isRoleSystem } from '../../../common/model'; diff --git a/x-pack/plugins/security/public/management/role_mappings/components/no_compatible_realms/no_compatible_realms.tsx b/x-pack/plugins/security/public/management/role_mappings/components/no_compatible_realms/no_compatible_realms.tsx index dbc0c6e5d1f5a..ed264a2adb53d 100644 --- a/x-pack/plugins/security/public/management/role_mappings/components/no_compatible_realms/no_compatible_realms.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/components/no_compatible_realms/no_compatible_realms.tsx @@ -8,7 +8,7 @@ import { EuiCallOut, EuiLink } from '@elastic/eui'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useKibana } from '../../../../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/security/public/management/role_mappings/components/permission_denied/permission_denied.tsx b/x-pack/plugins/security/public/management/role_mappings/components/permission_denied/permission_denied.tsx index b6e7eff4099e2..8dc1d75fb55ba 100644 --- a/x-pack/plugins/security/public/management/role_mappings/components/permission_denied/permission_denied.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/components/permission_denied/permission_denied.tsx @@ -8,7 +8,7 @@ import { EuiEmptyPrompt, EuiPageContent } from '@elastic/eui'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const PermissionDenied = () => ( diff --git a/x-pack/plugins/security/public/management/role_mappings/components/section_loading/section_loading.tsx b/x-pack/plugins/security/public/management/role_mappings/components/section_loading/section_loading.tsx index 3624f098ea65d..f9ab47040a05b 100644 --- a/x-pack/plugins/security/public/management/role_mappings/components/section_loading/section_loading.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/components/section_loading/section_loading.tsx @@ -8,7 +8,7 @@ import { EuiEmptyPrompt, EuiLoadingSpinner, EuiText } from '@elastic/eui'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; interface Props { children?: React.ReactChild; diff --git a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/edit_role_mapping_page.tsx b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/edit_role_mapping_page.tsx index 123b0de6007f7..89fb13c05f729 100644 --- a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/edit_role_mapping_page.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/edit_role_mapping_page.tsx @@ -19,7 +19,7 @@ import { import React, { Component } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { PublicMethodsOf } from '@kbn/utility-types'; import type { DocLinksStart, NotificationsStart, ScopedHistory } from 'src/core/public'; diff --git a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/mapping_info_panel/mapping_info_panel.tsx b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/mapping_info_panel/mapping_info_panel.tsx index 2c239709f145d..88dc0155c939e 100644 --- a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/mapping_info_panel/mapping_info_panel.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/mapping_info_panel/mapping_info_panel.tsx @@ -21,7 +21,7 @@ import type { ChangeEvent } from 'react'; import React, { Component, Fragment } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { PublicMethodsOf } from '@kbn/utility-types'; import type { DocLinksStart } from 'src/core/public'; diff --git a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/role_selector/add_role_template_button.tsx b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/role_selector/add_role_template_button.tsx index c1649d437007f..5c4cd9f446e6b 100644 --- a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/role_selector/add_role_template_button.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/role_selector/add_role_template_button.tsx @@ -8,7 +8,7 @@ import { EuiButtonEmpty, EuiCallOut } from '@elastic/eui'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; interface Props { canUseStoredScripts: boolean; diff --git a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/role_selector/role_selector.tsx b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/role_selector/role_selector.tsx index e40edd880af09..0d5280f3b83b2 100644 --- a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/role_selector/role_selector.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/role_selector/role_selector.tsx @@ -9,7 +9,7 @@ import { EuiFormRow, EuiHorizontalRule } from '@elastic/eui'; import React, { Fragment } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { PublicMethodsOf } from '@kbn/utility-types'; import type { Role, RoleMapping } from '../../../../../common/model'; diff --git a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/role_selector/role_template_editor.tsx b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/role_selector/role_template_editor.tsx index 3ae3a2c3132f0..258136997950f 100644 --- a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/role_selector/role_template_editor.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/role_selector/role_template_editor.tsx @@ -19,7 +19,7 @@ import { import React, { Fragment } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { RoleTemplate } from '../../../../../common/model'; import { diff --git a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/add_rule_button.tsx b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/add_rule_button.tsx index dae00d4416a1d..e9cb41890c355 100644 --- a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/add_rule_button.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/add_rule_button.tsx @@ -8,7 +8,7 @@ import { EuiButtonEmpty, EuiContextMenuItem, EuiContextMenuPanel, EuiPopover } from '@elastic/eui'; import React, { useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { Rule } from '../../model'; import { AllRule, FieldRule } from '../../model'; diff --git a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/json_rule_editor.tsx b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/json_rule_editor.tsx index 176d66049eade..23901e8cd3696 100644 --- a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/json_rule_editor.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/json_rule_editor.tsx @@ -13,7 +13,7 @@ import { EuiButton, EuiFormRow, EuiLink, EuiSpacer, EuiText } from '@elastic/eui import React, { Fragment, useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { XJsonLang } from '@kbn/monaco'; import { diff --git a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/rule_editor_panel.tsx b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/rule_editor_panel.tsx index e6672d4954abb..89eb8118733fa 100644 --- a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/rule_editor_panel.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/rule_editor_panel.tsx @@ -22,7 +22,7 @@ import { import React, { Component, Fragment } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { DocLinksStart } from 'src/core/public'; import type { RoleMapping } from '../../../../../common/model'; diff --git a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/rule_group_editor.tsx b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/rule_group_editor.tsx index 7953fef509475..e2aad3c2322d3 100644 --- a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/rule_group_editor.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/rule_group_editor.tsx @@ -16,7 +16,7 @@ import { } from '@elastic/eui'; import React, { Component, Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { FieldRule, Rule, RuleGroup } from '../../model'; import { isRuleGroup } from '../services/is_rule_group'; diff --git a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/rule_group_title.tsx b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/rule_group_title.tsx index 8285797c39e9a..01d69d00e7c63 100644 --- a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/rule_group_title.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/rule_group_title.tsx @@ -15,7 +15,7 @@ import { } from '@elastic/eui'; import React, { useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { RuleGroup } from '../../model'; import { AllRule, AnyRule, ExceptAllRule, ExceptAnyRule, FieldRule } from '../../model'; diff --git a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/visual_rule_editor.tsx b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/visual_rule_editor.tsx index ca418ac3749e5..bbfc7ece18924 100644 --- a/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/visual_rule_editor.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/edit_role_mapping/rule_editor_panel/visual_rule_editor.tsx @@ -8,7 +8,7 @@ import { EuiButton, EuiCallOut, EuiEmptyPrompt, EuiSpacer } from '@elastic/eui'; import React, { Component, Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { Rule, RuleGroup } from '../../model'; import { AllRule, FieldRule } from '../../model'; diff --git a/x-pack/plugins/security/public/management/role_mappings/role_mappings_grid/create_role_mapping_button/create_role_mapping_button.tsx b/x-pack/plugins/security/public/management/role_mappings/role_mappings_grid/create_role_mapping_button/create_role_mapping_button.tsx index b7f3261e18914..7e04b45e7fd8e 100644 --- a/x-pack/plugins/security/public/management/role_mappings/role_mappings_grid/create_role_mapping_button/create_role_mapping_button.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/role_mappings_grid/create_role_mapping_button/create_role_mapping_button.tsx @@ -8,7 +8,7 @@ import { EuiButton } from '@elastic/eui'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { ScopedHistory } from 'src/core/public'; import { reactRouterNavigate } from '../../../../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/security/public/management/role_mappings/role_mappings_grid/empty_prompt/empty_prompt.tsx b/x-pack/plugins/security/public/management/role_mappings/role_mappings_grid/empty_prompt/empty_prompt.tsx index cc0b41592e1f8..9a65792bcb943 100644 --- a/x-pack/plugins/security/public/management/role_mappings/role_mappings_grid/empty_prompt/empty_prompt.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/role_mappings_grid/empty_prompt/empty_prompt.tsx @@ -8,7 +8,7 @@ import { EuiEmptyPrompt } from '@elastic/eui'; import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { ScopedHistory } from 'src/core/public'; import { CreateRoleMappingButton } from '../create_role_mapping_button'; diff --git a/x-pack/plugins/security/public/management/role_mappings/role_mappings_grid/role_mappings_grid_page.tsx b/x-pack/plugins/security/public/management/role_mappings/role_mappings_grid/role_mappings_grid_page.tsx index c983f2c704f4a..0a25b69dad4be 100644 --- a/x-pack/plugins/security/public/management/role_mappings/role_mappings_grid/role_mappings_grid_page.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/role_mappings_grid/role_mappings_grid_page.tsx @@ -20,7 +20,7 @@ import { import React, { Component } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { PublicMethodsOf } from '@kbn/utility-types'; import type { ApplicationStart, diff --git a/x-pack/plugins/security/public/management/role_mappings/role_mappings_management_app.tsx b/x-pack/plugins/security/public/management/role_mappings/role_mappings_management_app.tsx index 41e6a9562612d..9367e7cd447f2 100644 --- a/x-pack/plugins/security/public/management/role_mappings/role_mappings_management_app.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/role_mappings_management_app.tsx @@ -13,7 +13,10 @@ import { i18n } from '@kbn/i18n'; import type { StartServicesAccessor } from 'src/core/public'; import type { RegisterManagementAppArgs } from 'src/plugins/management/public'; -import { KibanaContextProvider } from '../../../../../../src/plugins/kibana_react/public'; +import { + KibanaContextProvider, + KibanaThemeProvider, +} from '../../../../../../src/plugins/kibana_react/public'; import { Breadcrumb, BreadcrumbsProvider, @@ -37,7 +40,7 @@ export const roleMappingsManagementApp = Object.freeze({ id: this.id, order: 40, title, - async mount({ element, setBreadcrumbs, history }) { + async mount({ element, theme$, setBreadcrumbs, history }) { const [ [core], { RoleMappingsGridPage }, @@ -90,30 +93,32 @@ export const roleMappingsManagementApp = Object.freeze({ render( - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + , element diff --git a/x-pack/plugins/security/public/management/roles/edit_role/collapsible_panel/collapsible_panel.tsx b/x-pack/plugins/security/public/management/roles/edit_role/collapsible_panel/collapsible_panel.tsx index 1f0525c1e0dba..18901968b7cc2 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/collapsible_panel/collapsible_panel.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/collapsible_panel/collapsible_panel.tsx @@ -20,7 +20,7 @@ import { import type { ReactNode } from 'react'; import React, { Component, Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; interface Props { iconType?: IconType; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/delete_role_button.tsx b/x-pack/plugins/security/public/management/roles/edit_role/delete_role_button.tsx index 0029e91cce780..5ffe04f6e4a58 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/delete_role_button.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/delete_role_button.tsx @@ -8,7 +8,7 @@ import { EuiButtonEmpty, EuiConfirmModal } from '@elastic/eui'; import React, { Component, Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; interface Props { canDelete: boolean; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.tsx b/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.tsx index 10e1729dbd34b..2bfc23b446966 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/edit_role_page.tsx @@ -23,7 +23,7 @@ import type { ChangeEvent, FunctionComponent, HTMLProps } from 'react'; import React, { Fragment, useCallback, useEffect, useRef, useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { PublicMethodsOf } from '@kbn/utility-types'; import type { Capabilities, diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/elasticsearch_privileges.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/elasticsearch_privileges.tsx index 3795f0130fdd9..cc62824ecd9b2 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/elasticsearch_privileges.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/elasticsearch_privileges.tsx @@ -19,7 +19,7 @@ import { import React, { Component, Fragment } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { PublicMethodsOf } from '@kbn/utility-types'; import type { DocLinksStart } from 'src/core/public'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privilege_form.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privilege_form.tsx index 01592636154d6..024dba981b23b 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privilege_form.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/es/index_privilege_form.tsx @@ -20,7 +20,7 @@ import _ from 'lodash'; import React, { Component, Fragment } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { monaco } from '@kbn/monaco'; import type { PublicMethodsOf } from '@kbn/utility-types'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/change_all_privileges.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/change_all_privileges.tsx index 154fcda6fd4c7..00494c48b9efb 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/change_all_privileges.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/change_all_privileges.tsx @@ -18,7 +18,7 @@ import { import _ from 'lodash'; import React, { Component } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { KibanaPrivilege } from '../../../../model'; import { NO_PRIVILEGE_VALUE } from '../constants'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.tsx index 02e497fda1516..2abc07b4e3b21 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table.tsx @@ -25,7 +25,7 @@ import type { ReactElement } from 'react'; import React, { Component } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { AppCategory } from 'src/core/public'; import type { Role } from '../../../../../../../common/model'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table_expanded_row.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table_expanded_row.tsx index e528a0fc4b850..50f2b8c504ee7 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table_expanded_row.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/feature_table/feature_table_expanded_row.tsx @@ -9,7 +9,7 @@ import type { EuiSwitchEvent } from '@elastic/eui'; import { EuiFlexGroup, EuiFlexItem, EuiSwitch } from '@elastic/eui'; import React, { useEffect, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { SecuredFeature } from '../../../../model'; import type { PrivilegeFormCalculator } from '../privilege_form_calculator'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/privilege_summary.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/privilege_summary.tsx index 27bf246c0596f..aafa431bee2b3 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/privilege_summary.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/privilege_summary.tsx @@ -16,7 +16,7 @@ import { } from '@elastic/eui'; import React, { Fragment, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { Space, SpacesApiUi } from '../../../../../../../../spaces/public'; import type { Role } from '../../../../../../../common/model'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/privilege_summary_table.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/privilege_summary_table.tsx index 56c841f68f504..b5eb274f5bbf4 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/privilege_summary_table.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/privilege_summary_table.tsx @@ -19,7 +19,7 @@ import { } from '@elastic/eui'; import React, { Fragment, useMemo, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { Space, SpacesApiUi } from '../../../../../../../../spaces/public'; import type { Role, RoleKibanaPrivilege } from '../../../../../../../common/model'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/space_column_header.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/space_column_header.tsx index 38c122ba10086..2460c5e9f5f32 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/space_column_header.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/privilege_summary/space_column_header.tsx @@ -8,7 +8,7 @@ import React, { Fragment, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { Space, SpacesApiUi } from '../../../../../../../../spaces/public'; import type { RoleKibanaPrivilege } from '../../../../../../../common/model'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/privilege_space_form.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/privilege_space_form.tsx index 8f62acd463e6a..c92b981c67c7c 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/privilege_space_form.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/privilege_space_form.tsx @@ -27,7 +27,7 @@ import { import React, { Component, Fragment } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { Space } from '../../../../../../../../spaces/public'; import type { Role } from '../../../../../../../common/model'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/privilege_space_table.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/privilege_space_table.tsx index f6f26141383f4..1c256846a6c91 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/privilege_space_table.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/privilege_space_table.tsx @@ -21,7 +21,7 @@ import { import React, { Component } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { Space } from '../../../../../../../../spaces/public'; import { getSpaceColor } from '../../../../../../../../spaces/public'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/space_aware_privilege_section.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/space_aware_privilege_section.tsx index 6492ca6e01af0..d6032e9149364 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/space_aware_privilege_section.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/space_aware_privilege_section/space_aware_privilege_section.tsx @@ -18,7 +18,7 @@ import _ from 'lodash'; import React, { Component, Fragment } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { Capabilities } from 'src/core/public'; import type { Space, SpacesApiUi } from '../../../../../../../../spaces/public'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/transform_error_section/transform_error_section.tsx b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/transform_error_section/transform_error_section.tsx index 962fee3ffdc4d..599b3e651cbbf 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/transform_error_section/transform_error_section.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/privileges/kibana/transform_error_section/transform_error_section.tsx @@ -8,7 +8,7 @@ import { EuiEmptyPrompt } from '@elastic/eui'; import React, { PureComponent } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export class TransformErrorSection extends PureComponent<{}, {}> { public render() { diff --git a/x-pack/plugins/security/public/management/roles/edit_role/reserved_role_badge.tsx b/x-pack/plugins/security/public/management/roles/edit_role/reserved_role_badge.tsx index 8445fa4e7569a..2eec303c8dc53 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/reserved_role_badge.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/reserved_role_badge.tsx @@ -8,7 +8,7 @@ import { EuiIcon, EuiToolTip } from '@elastic/eui'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { Role } from '../../../../common/model'; import { isRoleReserved } from '../../../../common/model'; diff --git a/x-pack/plugins/security/public/management/roles/edit_role/spaces_popover_list/spaces_popover_list.tsx b/x-pack/plugins/security/public/management/roles/edit_role/spaces_popover_list/spaces_popover_list.tsx index e715cb217ae67..457d74edf79ff 100644 --- a/x-pack/plugins/security/public/management/roles/edit_role/spaces_popover_list/spaces_popover_list.tsx +++ b/x-pack/plugins/security/public/management/roles/edit_role/spaces_popover_list/spaces_popover_list.tsx @@ -18,7 +18,7 @@ import { import React, { Component, memo } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { SPACE_SEARCH_COUNT_THRESHOLD } from '../../../../../../spaces/common'; import type { Space, SpacesApiUi } from '../../../../../../spaces/public'; diff --git a/x-pack/plugins/security/public/management/roles/roles_grid/confirm_delete/confirm_delete.tsx b/x-pack/plugins/security/public/management/roles/roles_grid/confirm_delete/confirm_delete.tsx index e5ec22507925e..55b7a17f3e26f 100644 --- a/x-pack/plugins/security/public/management/roles/roles_grid/confirm_delete/confirm_delete.tsx +++ b/x-pack/plugins/security/public/management/roles/roles_grid/confirm_delete/confirm_delete.tsx @@ -18,7 +18,7 @@ import { import React, { Component, Fragment } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { PublicMethodsOf } from '@kbn/utility-types'; import type { NotificationsStart } from 'src/core/public'; diff --git a/x-pack/plugins/security/public/management/roles/roles_grid/permission_denied/permission_denied.tsx b/x-pack/plugins/security/public/management/roles/roles_grid/permission_denied/permission_denied.tsx index 7b93ce48b6d3c..2e5993aadffd8 100644 --- a/x-pack/plugins/security/public/management/roles/roles_grid/permission_denied/permission_denied.tsx +++ b/x-pack/plugins/security/public/management/roles/roles_grid/permission_denied/permission_denied.tsx @@ -8,7 +8,7 @@ import { EuiEmptyPrompt, EuiPageContent } from '@elastic/eui'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const PermissionDenied = () => ( diff --git a/x-pack/plugins/security/public/management/roles/roles_grid/roles_grid_page.tsx b/x-pack/plugins/security/public/management/roles/roles_grid/roles_grid_page.tsx index d34a8bfea27bf..76bc17f9115e4 100644 --- a/x-pack/plugins/security/public/management/roles/roles_grid/roles_grid_page.tsx +++ b/x-pack/plugins/security/public/management/roles/roles_grid/roles_grid_page.tsx @@ -23,7 +23,7 @@ import _ from 'lodash'; import React, { Component } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { PublicMethodsOf } from '@kbn/utility-types'; import type { NotificationsStart, ScopedHistory } from 'src/core/public'; diff --git a/x-pack/plugins/security/public/management/roles/roles_management_app.tsx b/x-pack/plugins/security/public/management/roles/roles_management_app.tsx index fcd037a861ed0..fb68fa7857668 100644 --- a/x-pack/plugins/security/public/management/roles/roles_management_app.tsx +++ b/x-pack/plugins/security/public/management/roles/roles_management_app.tsx @@ -13,7 +13,10 @@ import { i18n } from '@kbn/i18n'; import type { FatalErrorsSetup, StartServicesAccessor } from 'src/core/public'; import type { RegisterManagementAppArgs } from 'src/plugins/management/public'; -import { KibanaContextProvider } from '../../../../../../src/plugins/kibana_react/public'; +import { + KibanaContextProvider, + KibanaThemeProvider, +} from '../../../../../../src/plugins/kibana_react/public'; import type { SecurityLicense } from '../../../common/licensing'; import { Breadcrumb, @@ -39,7 +42,7 @@ export const rolesManagementApp = Object.freeze({ id: this.id, order: 20, title, - async mount({ element, setBreadcrumbs, history }) { + async mount({ element, theme$, setBreadcrumbs, history }) { const [ [startServices, { data, features, spaces }], { RolesGridPage }, @@ -116,27 +119,29 @@ export const rolesManagementApp = Object.freeze({ render( - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + , element diff --git a/x-pack/plugins/security/public/management/users/components/change_password_form/change_password_form.tsx b/x-pack/plugins/security/public/management/users/components/change_password_form/change_password_form.tsx index b412ef5350974..787aa9627b5a8 100644 --- a/x-pack/plugins/security/public/management/users/components/change_password_form/change_password_form.tsx +++ b/x-pack/plugins/security/public/management/users/components/change_password_form/change_password_form.tsx @@ -19,7 +19,7 @@ import type { ChangeEvent } from 'react'; import React, { Component } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { PublicMethodsOf } from '@kbn/utility-types'; import type { NotificationsStart } from 'src/core/public'; diff --git a/x-pack/plugins/security/public/management/users/components/confirm_delete_users/confirm_delete_users.tsx b/x-pack/plugins/security/public/management/users/components/confirm_delete_users/confirm_delete_users.tsx index 39db911710a16..dad1b6de72291 100644 --- a/x-pack/plugins/security/public/management/users/components/confirm_delete_users/confirm_delete_users.tsx +++ b/x-pack/plugins/security/public/management/users/components/confirm_delete_users/confirm_delete_users.tsx @@ -9,7 +9,7 @@ import { EuiConfirmModal } from '@elastic/eui'; import React, { Component, Fragment } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { asyncForEach } from '@kbn/std'; import type { PublicMethodsOf } from '@kbn/utility-types'; import type { NotificationsStart } from 'src/core/public'; diff --git a/x-pack/plugins/security/public/management/users/edit_user/change_password_flyout.tsx b/x-pack/plugins/security/public/management/users/edit_user/change_password_flyout.tsx index 29282696ffdf1..2ad27a77c07b8 100644 --- a/x-pack/plugins/security/public/management/users/edit_user/change_password_flyout.tsx +++ b/x-pack/plugins/security/public/management/users/edit_user/change_password_flyout.tsx @@ -21,7 +21,7 @@ import type { FunctionComponent } from 'react'; import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; import { FormFlyout } from '../../../components/form_flyout'; diff --git a/x-pack/plugins/security/public/management/users/edit_user/confirm_delete_users.tsx b/x-pack/plugins/security/public/management/users/edit_user/confirm_delete_users.tsx index 46861c773a60c..560898229d0d2 100644 --- a/x-pack/plugins/security/public/management/users/edit_user/confirm_delete_users.tsx +++ b/x-pack/plugins/security/public/management/users/edit_user/confirm_delete_users.tsx @@ -11,7 +11,7 @@ import React from 'react'; import useAsyncFn from 'react-use/lib/useAsyncFn'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { UserAPIClient } from '..'; import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/security/public/management/users/edit_user/confirm_disable_users.tsx b/x-pack/plugins/security/public/management/users/edit_user/confirm_disable_users.tsx index e8779a3bb59b9..fb90d7cf9eec9 100644 --- a/x-pack/plugins/security/public/management/users/edit_user/confirm_disable_users.tsx +++ b/x-pack/plugins/security/public/management/users/edit_user/confirm_disable_users.tsx @@ -11,7 +11,7 @@ import React from 'react'; import useAsyncFn from 'react-use/lib/useAsyncFn'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { UserAPIClient } from '..'; import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/security/public/management/users/edit_user/confirm_enable_users.tsx b/x-pack/plugins/security/public/management/users/edit_user/confirm_enable_users.tsx index 68c9a645eaa9a..88b8e4e5065e4 100644 --- a/x-pack/plugins/security/public/management/users/edit_user/confirm_enable_users.tsx +++ b/x-pack/plugins/security/public/management/users/edit_user/confirm_enable_users.tsx @@ -11,7 +11,7 @@ import React from 'react'; import useAsyncFn from 'react-use/lib/useAsyncFn'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { UserAPIClient } from '..'; import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/security/public/management/users/edit_user/create_user_page.test.tsx b/x-pack/plugins/security/public/management/users/edit_user/create_user_page.test.tsx index c3b9304be37f7..5ae0a3c85cd0a 100644 --- a/x-pack/plugins/security/public/management/users/edit_user/create_user_page.test.tsx +++ b/x-pack/plugins/security/public/management/users/edit_user/create_user_page.test.tsx @@ -9,7 +9,7 @@ import { fireEvent, render, waitFor, within } from '@testing-library/react'; import { createMemoryHistory } from 'history'; import React from 'react'; -import { coreMock } from 'src/core/public/mocks'; +import { coreMock, themeServiceMock } from 'src/core/public/mocks'; import { securityMock } from '../../../mocks'; import { Providers } from '../users_management_app'; @@ -22,6 +22,8 @@ jest.mock('@elastic/eui/lib/services/accessibility/html_id_generator', () => ({ describe('CreateUserPage', () => { jest.setTimeout(15_000); + const theme$ = themeServiceMock.createTheme$(); + it('creates user when submitting form and redirects back', async () => { const coreStart = coreMock.createStart(); const history = createMemoryHistory({ initialEntries: ['/create'] }); @@ -29,7 +31,7 @@ describe('CreateUserPage', () => { coreStart.http.post.mockResolvedValue({}); const { findByRole, findByLabelText } = render( - + ); @@ -72,7 +74,7 @@ describe('CreateUserPage', () => { ]); const { findAllByText, findByRole, findByLabelText } = render( - + ); diff --git a/x-pack/plugins/security/public/management/users/edit_user/create_user_page.tsx b/x-pack/plugins/security/public/management/users/edit_user/create_user_page.tsx index c82ea52b07478..52b2988ca5f83 100644 --- a/x-pack/plugins/security/public/management/users/edit_user/create_user_page.tsx +++ b/x-pack/plugins/security/public/management/users/edit_user/create_user_page.tsx @@ -10,7 +10,7 @@ import type { FunctionComponent } from 'react'; import React from 'react'; import { useHistory } from 'react-router-dom'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { UserForm } from './user_form'; diff --git a/x-pack/plugins/security/public/management/users/edit_user/edit_user_page.test.tsx b/x-pack/plugins/security/public/management/users/edit_user/edit_user_page.test.tsx index 66a73d9c6aa87..3e0970b66563b 100644 --- a/x-pack/plugins/security/public/management/users/edit_user/edit_user_page.test.tsx +++ b/x-pack/plugins/security/public/management/users/edit_user/edit_user_page.test.tsx @@ -9,7 +9,7 @@ import { fireEvent, render } from '@testing-library/react'; import { createMemoryHistory } from 'history'; import React from 'react'; -import { coreMock } from 'src/core/public/mocks'; +import { coreMock, themeServiceMock } from 'src/core/public/mocks'; import { securityMock } from '../../../mocks'; import { Providers } from '../users_management_app'; @@ -25,6 +25,7 @@ const userMock = { describe('EditUserPage', () => { const coreStart = coreMock.createStart(); + const theme$ = themeServiceMock.createTheme$(); let history = createMemoryHistory({ initialEntries: ['/edit/jdoe'] }); const authc = securityMock.createSetup().authc; @@ -46,7 +47,7 @@ describe('EditUserPage', () => { coreStart.http.get.mockResolvedValueOnce([]); const { findByText } = render( - + ); @@ -66,7 +67,7 @@ describe('EditUserPage', () => { coreStart.http.get.mockResolvedValueOnce([]); const { findByRole, findByText } = render( - + ); @@ -87,7 +88,7 @@ describe('EditUserPage', () => { coreStart.http.get.mockResolvedValueOnce([]); const { findByRole, findByText } = render( - + ); @@ -117,7 +118,7 @@ describe('EditUserPage', () => { ]); const { findByText } = render( - + ); diff --git a/x-pack/plugins/security/public/management/users/edit_user/edit_user_page.tsx b/x-pack/plugins/security/public/management/users/edit_user/edit_user_page.tsx index 8887ec93ff58d..19a2f964a357c 100644 --- a/x-pack/plugins/security/public/management/users/edit_user/edit_user_page.tsx +++ b/x-pack/plugins/security/public/management/users/edit_user/edit_user_page.tsx @@ -26,7 +26,7 @@ import React, { useEffect, useState } from 'react'; import { useHistory } from 'react-router-dom'; import useAsyncFn from 'react-use/lib/useAsyncFn'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; import { getUserDisplayName } from '../../../../common/model'; diff --git a/x-pack/plugins/security/public/management/users/edit_user/user_form.tsx b/x-pack/plugins/security/public/management/users/edit_user/user_form.tsx index d30072ff8c19f..b7c52361a33a1 100644 --- a/x-pack/plugins/security/public/management/users/edit_user/user_form.tsx +++ b/x-pack/plugins/security/public/management/users/edit_user/user_form.tsx @@ -24,7 +24,7 @@ import React, { useCallback, useEffect } from 'react'; import useAsyncFn from 'react-use/lib/useAsyncFn'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; import { MAX_NAME_LENGTH, NAME_REGEX } from '../../../../common/constants'; diff --git a/x-pack/plugins/security/public/management/users/users_grid/users_grid_page.tsx b/x-pack/plugins/security/public/management/users/users_grid/users_grid_page.tsx index 974ca2be219c4..1c3bd98d834aa 100644 --- a/x-pack/plugins/security/public/management/users/users_grid/users_grid_page.tsx +++ b/x-pack/plugins/security/public/management/users/users_grid/users_grid_page.tsx @@ -21,7 +21,7 @@ import { import React, { Component } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { PublicMethodsOf } from '@kbn/utility-types'; import type { ApplicationStart, NotificationsStart, ScopedHistory } from 'src/core/public'; diff --git a/x-pack/plugins/security/public/management/users/users_management_app.tsx b/x-pack/plugins/security/public/management/users/users_management_app.tsx index 7957599da7f57..88fad7b1a3a3f 100644 --- a/x-pack/plugins/security/public/management/users/users_management_app.tsx +++ b/x-pack/plugins/security/public/management/users/users_management_app.tsx @@ -11,13 +11,17 @@ import React from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; import type { RouteComponentProps } from 'react-router-dom'; import { Redirect, Route, Router, Switch } from 'react-router-dom'; +import type { Observable } from 'rxjs'; import { i18n } from '@kbn/i18n'; -import { I18nProvider } from '@kbn/i18n/react'; -import type { CoreStart, StartServicesAccessor } from 'src/core/public'; +import { I18nProvider } from '@kbn/i18n-react'; +import type { CoreStart, CoreTheme, StartServicesAccessor } from 'src/core/public'; import type { RegisterManagementAppArgs } from 'src/plugins/management/public'; -import { KibanaContextProvider } from '../../../../../../src/plugins/kibana_react/public'; +import { + KibanaContextProvider, + KibanaThemeProvider, +} from '../../../../../../src/plugins/kibana_react/public'; import type { AuthenticationServiceSetup } from '../../authentication'; import type { BreadcrumbsChangeHandler } from '../../components/breadcrumb'; import { @@ -48,7 +52,7 @@ export const usersManagementApp = Object.freeze({ id: this.id, order: 10, title, - async mount({ element, setBreadcrumbs, history }) { + async mount({ element, theme$, setBreadcrumbs, history }) { const [ [coreStart], { UsersGridPage }, @@ -66,6 +70,7 @@ export const usersManagementApp = Object.freeze({ render( ; history: History; authc: AuthenticationServiceSetup; onChange?: BreadcrumbsChangeHandler; @@ -135,6 +141,7 @@ export interface ProvidersProps { export const Providers: FunctionComponent = ({ services, + theme$, history, authc, onChange, @@ -143,9 +150,11 @@ export const Providers: FunctionComponent = ({ - - {children} - + + + {children} + + diff --git a/x-pack/plugins/security/public/nav_control/nav_control_component.tsx b/x-pack/plugins/security/public/nav_control/nav_control_component.tsx index 3b45b5164c6cf..541d0c161a87e 100644 --- a/x-pack/plugins/security/public/nav_control/nav_control_component.tsx +++ b/x-pack/plugins/security/public/nav_control/nav_control_component.tsx @@ -20,7 +20,7 @@ import React, { Component } from 'react'; import type { Observable, Subscription } from 'rxjs'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { AuthenticatedUser } from '../../common/model'; diff --git a/x-pack/plugins/security/public/nav_control/nav_control_service.tsx b/x-pack/plugins/security/public/nav_control/nav_control_service.tsx index c1be6999c6472..0db60c83f55d7 100644 --- a/x-pack/plugins/security/public/nav_control/nav_control_service.tsx +++ b/x-pack/plugins/security/public/nav_control/nav_control_service.tsx @@ -14,6 +14,7 @@ import { map, takeUntil } from 'rxjs/operators'; import type { CoreStart } from 'src/core/public'; +import { KibanaThemeProvider } from '../../../../../src/plugins/kibana_react/public'; import type { SecurityLicense } from '../../common/licensing'; import type { AuthenticationServiceSetup } from '../authentication'; import type { UserMenuLink } from './nav_control_component'; @@ -110,8 +111,9 @@ export class SecurityNavControlService { } private registerSecurityNavControl( - core: Pick + core: Pick ) { + const { theme$ } = core.theme; const currentUserPromise = this.authc.getCurrentUser(); core.chrome.navControls.registerRight({ order: 2000, @@ -126,7 +128,9 @@ export class SecurityNavControlService { }; ReactDOM.render( - + + + , el ); diff --git a/x-pack/plugins/security/public/security_checkup/components/insecure_cluster_alert.tsx b/x-pack/plugins/security/public/security_checkup/components/insecure_cluster_alert.tsx index 86ab93574211c..4279b9f31f7b7 100644 --- a/x-pack/plugins/security/public/security_checkup/components/insecure_cluster_alert.tsx +++ b/x-pack/plugins/security/public/security_checkup/components/insecure_cluster_alert.tsx @@ -17,7 +17,7 @@ import React, { useState } from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage, I18nProvider } from '@kbn/i18n/react'; +import { FormattedMessage, I18nProvider } from '@kbn/i18n-react'; import type { DocLinksStart, MountPoint } from 'src/core/public'; export const insecureClusterAlertTitle = i18n.translate( diff --git a/x-pack/plugins/security/public/session/session_expiration_toast.test.tsx b/x-pack/plugins/security/public/session/session_expiration_toast.test.tsx index a78bed34b2088..0cec3b1848008 100644 --- a/x-pack/plugins/security/public/session/session_expiration_toast.test.tsx +++ b/x-pack/plugins/security/public/session/session_expiration_toast.test.tsx @@ -8,7 +8,7 @@ import { fireEvent, render } from '@testing-library/react'; import React from 'react'; import { of } from 'rxjs'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { createSessionExpirationToast, SessionExpirationToast } from './session_expiration_toast'; import type { SessionState } from './session_timeout'; diff --git a/x-pack/plugins/security/public/session/session_expiration_toast.tsx b/x-pack/plugins/security/public/session/session_expiration_toast.tsx index ad7aa67b64b3f..5dd0bcc4fd6f5 100644 --- a/x-pack/plugins/security/public/session/session_expiration_toast.tsx +++ b/x-pack/plugins/security/public/session/session_expiration_toast.tsx @@ -13,7 +13,7 @@ import useObservable from 'react-use/lib/useObservable'; import type { Observable } from 'rxjs'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage, FormattedRelative } from '@kbn/i18n/react'; +import { FormattedMessage, FormattedRelative } from '@kbn/i18n-react'; import type { ToastInput } from 'src/core/public'; import { toMountPoint } from '../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/security/server/authentication/unauthenticated_page.tsx b/x-pack/plugins/security/server/authentication/unauthenticated_page.tsx index 48d61a72e085d..79aab20d5f33b 100644 --- a/x-pack/plugins/security/server/authentication/unauthenticated_page.tsx +++ b/x-pack/plugins/security/server/authentication/unauthenticated_page.tsx @@ -11,7 +11,7 @@ import React from 'react'; import { renderToStaticMarkup } from 'react-dom/server'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { IBasePath } from 'src/core/server'; import { PromptPage } from '../prompt_page'; diff --git a/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts b/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts index b15793527b7e5..9581db9410832 100644 --- a/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts +++ b/x-pack/plugins/security/server/authorization/privileges/privileges.test.ts @@ -276,6 +276,7 @@ describe('features', () => { actions.version, ...(expectDecryptedTelemetry ? [actions.api.get('decryptedTelemetry')] : []), ...(expectGetFeatures ? [actions.api.get('features')] : []), + ...(expectGetFeatures ? [actions.api.get('taskManager')] : []), ...(expectManageSpaces ? [ actions.space.manage, @@ -492,6 +493,7 @@ describe('features', () => { actions.version, ...(expectDecryptedTelemetry ? [actions.api.get('decryptedTelemetry')] : []), ...(expectGetFeatures ? [actions.api.get('features')] : []), + ...(expectGetFeatures ? [actions.api.get('taskManager')] : []), ...(expectManageSpaces ? [ actions.space.manage, @@ -558,6 +560,7 @@ describe('features', () => { actions.version, ...(expectDecryptedTelemetry ? [actions.api.get('decryptedTelemetry')] : []), ...(expectGetFeatures ? [actions.api.get('features')] : []), + ...(expectGetFeatures ? [actions.api.get('taskManager')] : []), ...(expectManageSpaces ? [ actions.space.manage, @@ -625,6 +628,7 @@ describe('features', () => { actions.version, ...(expectDecryptedTelemetry ? [actions.api.get('decryptedTelemetry')] : []), ...(expectGetFeatures ? [actions.api.get('features')] : []), + ...(expectGetFeatures ? [actions.api.get('taskManager')] : []), ...(expectManageSpaces ? [ actions.space.manage, @@ -893,6 +897,7 @@ describe('subFeatures', () => { actions.version, actions.api.get('decryptedTelemetry'), actions.api.get('features'), + actions.api.get('taskManager'), actions.space.manage, actions.ui.get('spaces', 'manage'), actions.ui.get('management', 'kibana', 'spaces'), @@ -1059,6 +1064,7 @@ describe('subFeatures', () => { actions.version, actions.api.get('decryptedTelemetry'), actions.api.get('features'), + actions.api.get('taskManager'), actions.space.manage, actions.ui.get('spaces', 'manage'), actions.ui.get('management', 'kibana', 'spaces'), @@ -1292,6 +1298,7 @@ describe('subFeatures', () => { actions.version, actions.api.get('decryptedTelemetry'), actions.api.get('features'), + actions.api.get('taskManager'), actions.space.manage, actions.ui.get('spaces', 'manage'), actions.ui.get('management', 'kibana', 'spaces'), @@ -1431,6 +1438,7 @@ describe('subFeatures', () => { actions.version, actions.api.get('decryptedTelemetry'), actions.api.get('features'), + actions.api.get('taskManager'), actions.space.manage, actions.ui.get('spaces', 'manage'), actions.ui.get('management', 'kibana', 'spaces'), @@ -1613,6 +1621,7 @@ describe('subFeatures', () => { actions.version, actions.api.get('decryptedTelemetry'), actions.api.get('features'), + actions.api.get('taskManager'), actions.space.manage, actions.ui.get('spaces', 'manage'), actions.ui.get('management', 'kibana', 'spaces'), @@ -1749,6 +1758,7 @@ describe('subFeatures', () => { actions.version, actions.api.get('decryptedTelemetry'), actions.api.get('features'), + actions.api.get('taskManager'), actions.space.manage, actions.ui.get('spaces', 'manage'), actions.ui.get('management', 'kibana', 'spaces'), @@ -1980,6 +1990,7 @@ describe('subFeatures', () => { actions.version, actions.api.get('decryptedTelemetry'), actions.api.get('features'), + actions.api.get('taskManager'), actions.space.manage, actions.ui.get('spaces', 'manage'), actions.ui.get('management', 'kibana', 'spaces'), @@ -2245,6 +2256,7 @@ describe('subFeatures', () => { actions.version, actions.api.get('decryptedTelemetry'), actions.api.get('features'), + actions.api.get('taskManager'), actions.space.manage, actions.ui.get('spaces', 'manage'), actions.ui.get('management', 'kibana', 'spaces'), diff --git a/x-pack/plugins/security/server/authorization/privileges/privileges.ts b/x-pack/plugins/security/server/authorization/privileges/privileges.ts index 0b2ab93c966c0..16a53411d9c3d 100644 --- a/x-pack/plugins/security/server/authorization/privileges/privileges.ts +++ b/x-pack/plugins/security/server/authorization/privileges/privileges.ts @@ -106,6 +106,7 @@ export function privilegesFactory( actions.version, actions.api.get('decryptedTelemetry'), actions.api.get('features'), + actions.api.get('taskManager'), actions.space.manage, actions.ui.get('spaces', 'manage'), actions.ui.get('management', 'kibana', 'spaces'), diff --git a/x-pack/plugins/security/server/authorization/reset_session_page.tsx b/x-pack/plugins/security/server/authorization/reset_session_page.tsx index 4e2e6f4631287..49555da9cd320 100644 --- a/x-pack/plugins/security/server/authorization/reset_session_page.tsx +++ b/x-pack/plugins/security/server/authorization/reset_session_page.tsx @@ -10,7 +10,7 @@ import { EuiButton, EuiButtonEmpty } from '@elastic/eui/lib/components/button'; import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { IBasePath } from 'src/core/server'; import { PromptPage } from '../prompt_page'; diff --git a/x-pack/plugins/security/server/prompt_page.tsx b/x-pack/plugins/security/server/prompt_page.tsx index 853ef723ddb98..bcb2dcf810f30 100644 --- a/x-pack/plugins/security/server/prompt_page.tsx +++ b/x-pack/plugins/security/server/prompt_page.tsx @@ -17,7 +17,7 @@ import type { ReactNode } from 'react'; import React from 'react'; import { i18n } from '@kbn/i18n'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import UiSharedDepsNpm from '@kbn/ui-shared-deps-npm'; import UiSharedDepsSrc from '@kbn/ui-shared-deps-src'; import type { IBasePath } from 'src/core/server'; diff --git a/x-pack/plugins/security_solution/common/detection_engine/utils.ts b/x-pack/plugins/security_solution/common/detection_engine/utils.ts index 7d4badcd3507c..8c6c3fdd961a8 100644 --- a/x-pack/plugins/security_solution/common/detection_engine/utils.ts +++ b/x-pack/plugins/security_solution/common/detection_engine/utils.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { isEmpty } from 'lodash'; +import { isEmpty, capitalize } from 'lodash'; import type { EntriesArray, @@ -73,3 +73,11 @@ export const getRuleStatusText = ( : value != null ? value : null; + +export const getCapitalizedRuleStatusText = ( + value: RuleExecutionStatus | null | undefined +): string | null => { + const status = getRuleStatusText(value); + + return status != null ? capitalize(status) : null; +}; diff --git a/x-pack/plugins/security_solution/common/endpoint/constants.ts b/x-pack/plugins/security_solution/common/endpoint/constants.ts index fc418df95602b..a7fe91345dd14 100644 --- a/x-pack/plugins/security_solution/common/endpoint/constants.ts +++ b/x-pack/plugins/security_solution/common/endpoint/constants.ts @@ -65,3 +65,6 @@ export const ENDPOINT_ACTION_LOG_ROUTE = `/api/endpoint/action_log/{agent_id}`; export const ACTION_STATUS_ROUTE = `/api/endpoint/action_status`; export const failedFleetActionErrorCode = '424'; + +export const ENDPOINT_DEFAULT_PAGE = 0; +export const ENDPOINT_DEFAULT_PAGE_SIZE = 10; diff --git a/x-pack/plugins/security_solution/common/endpoint/data_generators/exceptions_list_item_generator.ts b/x-pack/plugins/security_solution/common/endpoint/data_generators/exceptions_list_item_generator.ts new file mode 100644 index 0000000000000..fe14e51490471 --- /dev/null +++ b/x-pack/plugins/security_solution/common/endpoint/data_generators/exceptions_list_item_generator.ts @@ -0,0 +1,50 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; +import { BaseDataGenerator } from './base_data_generator'; +import { POLICY_REFERENCE_PREFIX } from '../service/trusted_apps/mapping'; +import { ConditionEntryField } from '../types'; + +export class ExceptionsListItemGenerator extends BaseDataGenerator { + generate(overrides: Partial = {}): ExceptionListItemSchema { + return { + _version: this.randomString(5), + comments: [], + created_at: this.randomPastDate(), + created_by: this.randomUser(), + description: 'created by ExceptionListItemGenerator', + entries: [ + { + field: ConditionEntryField.HASH, + operator: 'included', + type: 'match', + value: '1234234659af249ddf3e40864e9fb241', + }, + { + field: ConditionEntryField.PATH, + operator: 'included', + type: 'match', + value: '/one/two/three', + }, + ], + id: this.seededUUIDv4(), + item_id: this.seededUUIDv4(), + list_id: 'endpoint_list_id', + meta: {}, + name: `Generated Exception (${this.randomString(5)})`, + namespace_type: 'agnostic', + os_types: [this.randomOSFamily()] as ExceptionListItemSchema['os_types'], + tags: [`${POLICY_REFERENCE_PREFIX}all`], + tie_breaker_id: this.seededUUIDv4(), + type: 'simple', + updated_at: '2020-04-20T15:25:31.830Z', + updated_by: this.randomUser(), + ...(overrides || {}), + }; + } +} diff --git a/x-pack/plugins/security_solution/common/endpoint/data_generators/fleet_agent_policy_generator.ts b/x-pack/plugins/security_solution/common/endpoint/data_generators/fleet_agent_policy_generator.ts new file mode 100644 index 0000000000000..e19a814ab07e4 --- /dev/null +++ b/x-pack/plugins/security_solution/common/endpoint/data_generators/fleet_agent_policy_generator.ts @@ -0,0 +1,29 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { BaseDataGenerator } from './base_data_generator'; +import { agentPolicyStatuses, GetAgentPoliciesResponseItem } from '../../../../fleet/common'; + +export class FleetAgentPolicyGenerator extends BaseDataGenerator { + generate(overrides: Partial = {}): GetAgentPoliciesResponseItem { + return { + id: this.seededUUIDv4(), + name: `Agent Policy ${this.randomString(4)}`, + status: agentPolicyStatuses.Active, + description: 'Created by FleetAgentPolicyGenerator', + namespace: 'default', + is_managed: false, + monitoring_enabled: ['logs', 'metrics'], + revision: 2, + updated_at: '2020-07-22T16:36:49.196Z', + updated_by: this.randomUser(), + package_policies: ['852491f0-cc39-11ea-bac2-cdbf95b4b41a'], + agents: 0, + ...overrides, + }; + } +} diff --git a/x-pack/plugins/security_solution/common/endpoint/data_generators/fleet_package_policy_generator.ts b/x-pack/plugins/security_solution/common/endpoint/data_generators/fleet_package_policy_generator.ts new file mode 100644 index 0000000000000..e9d609585841a --- /dev/null +++ b/x-pack/plugins/security_solution/common/endpoint/data_generators/fleet_package_policy_generator.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { BaseDataGenerator } from './base_data_generator'; +import { PackagePolicy } from '../../../../fleet/common'; +import { policyFactory } from '../models/policy_config'; +import { PolicyData } from '../types'; + +type PartialPackagePolicy = Partial> & { + inputs?: PackagePolicy['inputs']; +}; + +type PartialEndpointPolicyData = Partial> & { + inputs?: PolicyData['inputs']; +}; + +export class FleetPackagePolicyGenerator extends BaseDataGenerator { + generate(overrides: PartialPackagePolicy = {}): PackagePolicy { + return { + id: this.seededUUIDv4(), + name: `Package Policy {${this.randomString(4)})`, + description: 'Policy to protect the worlds data', + created_at: this.randomPastDate(), + created_by: this.randomUser(), + updated_at: new Date().toISOString(), + updated_by: this.randomUser(), + policy_id: this.seededUUIDv4(), // agent policy id + enabled: true, + output_id: '', + inputs: [], + namespace: 'default', + package: { + name: 'endpoint', + title: 'Elastic Endpoint', + version: '1.0.0', + }, + revision: 1, + ...overrides, + }; + } + + generateEndpointPackagePolicy(overrides: PartialEndpointPolicyData = {}): PolicyData { + return { + ...this.generate({ + name: `Endpoint Policy {${this.randomString(4)})`, + }), + inputs: [ + { + type: 'endpoint', + enabled: true, + streams: [], + config: { + artifact_manifest: { + value: { + manifest_version: '1.0.0', + schema_version: 'v1', + artifacts: {}, + }, + }, + policy: { + value: policyFactory(), + }, + }, + }, + ], + ...overrides, + }; + } +} diff --git a/x-pack/plugins/security_solution/common/endpoint/errors.ts b/x-pack/plugins/security_solution/common/endpoint/errors.ts new file mode 100644 index 0000000000000..495afaa126e2b --- /dev/null +++ b/x-pack/plugins/security_solution/common/endpoint/errors.ts @@ -0,0 +1,18 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +/** + * Endpoint base error class that supports an optional second argument for providing additional data + * for the error. + */ +export class EndpointError extends Error { + constructor(message: string, public readonly meta?: MetaType) { + super(message); + // For debugging - capture name of subclasses + this.name = this.constructor.name; + } +} diff --git a/x-pack/plugins/security_solution/common/endpoint/generate_data.ts b/x-pack/plugins/security_solution/common/endpoint/generate_data.ts index 3e94dfaebc7fe..9cbe1e19530ca 100644 --- a/x-pack/plugins/security_solution/common/endpoint/generate_data.ts +++ b/x-pack/plugins/security_solution/common/endpoint/generate_data.ts @@ -1535,6 +1535,7 @@ export class EndpointDocGenerator extends BaseDataGenerator { */ public generatePolicyPackagePolicy(): PolicyData { const created = new Date(Date.now() - 8.64e7).toISOString(); // 24h ago + // FIXME: remove and use new FleetPackagePolicyGenerator (#2262) return { id: this.seededUUIDv4(), name: 'Endpoint Policy', @@ -1579,6 +1580,7 @@ export class EndpointDocGenerator extends BaseDataGenerator { * Generate an Agent Policy (ingest) */ public generateAgentPolicy(): GetAgentPoliciesResponseItem { + // FIXME: remove and use new FleetPackagePolicyGenerator (#2262) return { id: this.seededUUIDv4(), name: 'Agent Policy', diff --git a/x-pack/plugins/security_solution/common/endpoint/schema/metadata.test.ts b/x-pack/plugins/security_solution/common/endpoint/schema/metadata.test.ts new file mode 100644 index 0000000000000..b9693fde1d659 --- /dev/null +++ b/x-pack/plugins/security_solution/common/endpoint/schema/metadata.test.ts @@ -0,0 +1,74 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { ENDPOINT_DEFAULT_PAGE, ENDPOINT_DEFAULT_PAGE_SIZE } from '../constants'; +import { HostStatus } from '../types'; +import { GetMetadataListRequestSchemaV2 } from './metadata'; + +describe('endpoint metadata schema', () => { + describe('GetMetadataListRequestSchemaV2', () => { + const query = GetMetadataListRequestSchemaV2.query; + + it('should return correct query params when valid', () => { + const queryParams = { + page: 1, + pageSize: 20, + kuery: 'some kuery', + hostStatuses: [HostStatus.HEALTHY.toString()], + }; + expect(query.validate(queryParams)).toEqual(queryParams); + }); + + it('should correctly use default values', () => { + const expected = { page: ENDPOINT_DEFAULT_PAGE, pageSize: ENDPOINT_DEFAULT_PAGE_SIZE }; + expect(query.validate(undefined)).toEqual(expected); + expect(query.validate({ page: undefined })).toEqual(expected); + expect(query.validate({ pageSize: undefined })).toEqual(expected); + expect(query.validate({ page: undefined, pageSize: undefined })).toEqual(expected); + }); + + it('should throw if page param is not a number', () => { + expect(() => query.validate({ page: 'notanumber' })).toThrowError(); + }); + + it('should throw if page param is less than 0', () => { + expect(() => query.validate({ page: -1 })).toThrowError(); + }); + + it('should throw if pageSize param is not a number', () => { + expect(() => query.validate({ pageSize: 'notanumber' })).toThrowError(); + }); + + it('should throw if pageSize param is less than 1', () => { + expect(() => query.validate({ pageSize: 0 })).toThrowError(); + }); + + it('should throw if pageSize param is greater than 10000', () => { + expect(() => query.validate({ pageSize: 10001 })).toThrowError(); + }); + + it('should throw if kuery is not string', () => { + expect(() => query.validate({ kuery: 123 })).toThrowError(); + }); + + it('should work with valid hostStatus', () => { + const queryParams = { hostStatuses: [HostStatus.HEALTHY, HostStatus.UPDATING] }; + const expected = { + page: ENDPOINT_DEFAULT_PAGE, + pageSize: ENDPOINT_DEFAULT_PAGE_SIZE, + ...queryParams, + }; + expect(query.validate(queryParams)).toEqual(expected); + }); + + it('should throw if invalid hostStatus', () => { + expect(() => + query.validate({ hostStatuses: [HostStatus.UNHEALTHY, 'invalidstatus'] }) + ).toThrowError(); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/common/endpoint/schema/metadata.ts b/x-pack/plugins/security_solution/common/endpoint/schema/metadata.ts new file mode 100644 index 0000000000000..eb123590af20c --- /dev/null +++ b/x-pack/plugins/security_solution/common/endpoint/schema/metadata.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { schema, TypeOf } from '@kbn/config-schema'; +import { ENDPOINT_DEFAULT_PAGE, ENDPOINT_DEFAULT_PAGE_SIZE } from '../constants'; +import { HostStatus } from '../types'; + +export const GetMetadataListRequestSchemaV2 = { + query: schema.object( + { + page: schema.number({ defaultValue: ENDPOINT_DEFAULT_PAGE, min: 0 }), + pageSize: schema.number({ defaultValue: ENDPOINT_DEFAULT_PAGE_SIZE, min: 1, max: 10000 }), + kuery: schema.maybe(schema.string()), + hostStatuses: schema.maybe( + schema.arrayOf( + schema.oneOf([ + schema.literal(HostStatus.HEALTHY.toString()), + schema.literal(HostStatus.OFFLINE.toString()), + schema.literal(HostStatus.UPDATING.toString()), + schema.literal(HostStatus.UNHEALTHY.toString()), + schema.literal(HostStatus.INACTIVE.toString()), + ]) + ) + ), + }, + { defaultValue: { page: ENDPOINT_DEFAULT_PAGE, pageSize: ENDPOINT_DEFAULT_PAGE_SIZE } } + ), +}; + +export type GetMetadataListRequestQuery = TypeOf; diff --git a/x-pack/plugins/security_solution/common/endpoint/types/index.ts b/x-pack/plugins/security_solution/common/endpoint/types/index.ts index 2dc4f49919ef7..c869c9c780bd9 100644 --- a/x-pack/plugins/security_solution/common/endpoint/types/index.ts +++ b/x-pack/plugins/security_solution/common/endpoint/types/index.ts @@ -1235,18 +1235,14 @@ export interface ListPageRouteState { /** * REST API standard base response for list types */ -export interface BaseListResponse { - data: unknown[]; +interface BaseListResponse { + data: D[]; page: number; pageSize: number; total: number; - sort?: string; - sortOrder?: 'asc' | 'desc'; } /** * Returned by the server via GET /api/endpoint/metadata */ -export interface MetadataListResponse extends BaseListResponse { - data: HostInfo[]; -} +export type MetadataListResponse = BaseListResponse; diff --git a/x-pack/plugins/security_solution/cypress/cypress.json b/x-pack/plugins/security_solution/cypress/cypress.json index 8c27309becf08..7cc12a7be66c9 100644 --- a/x-pack/plugins/security_solution/cypress/cypress.json +++ b/x-pack/plugins/security_solution/cypress/cypress.json @@ -1,6 +1,6 @@ { "baseUrl": "http://localhost:5601", - "defaultCommandTimeout": 60000, + "defaultCommandTimeout": 120000, "execTimeout": 120000, "pageLoadTimeout": 120000, "nodeVersion": "system", diff --git a/x-pack/plugins/security_solution/cypress/fixtures/7_16_case.ndjson b/x-pack/plugins/security_solution/cypress/fixtures/7_16_case.ndjson new file mode 100644 index 0000000000000..bd7b082020279 --- /dev/null +++ b/x-pack/plugins/security_solution/cypress/fixtures/7_16_case.ndjson @@ -0,0 +1,15 @@ +{"attributes":{"actionTypeId":".jira","config":{"apiUrl":"https://siem-kibana.atlassian.net/","projectKey":"CASES"},"isMissingSecrets":true,"name":"Jira test"},"coreMigrationVersion":"7.16.0","id":"018d0110-46d1-11ec-a89e-8339c89698d8","migrationVersion":{"action":"7.16.0"},"references":[],"type":"action","updated_at":"2021-11-16T11:33:22.994Z","version":"WzIwNjYsMV0="} +{"attributes":{"closed_at":null,"closed_by":null,"connector":{"fields":[{"key":"issueType","value":"10001"},{"key":"parent","value":null},{"key":"priority","value":null}],"name":"Jira test","type":".jira"},"created_at":"2021-11-16T11:21:19.242Z","created_by":{"email":null,"full_name":"glo@test.co","username":"glo"},"description":"This is the description of the 7.16 case that I'm going to import in future versions.","external_service":null,"owner":"securitySolution","settings":{"syncAlerts":false},"status":"in-progress","tags":["export case"],"title":"7.16 case to export","type":"individual","updated_at":"2021-11-16T11:33:44.787Z","updated_by":{"email":"","full_name":"","username":"test"}},"coreMigrationVersion":"7.16.0","id":"5228e870-46cf-11ec-a89e-8339c89698d8","migrationVersion":{"cases":"7.15.0"},"references":[{"id":"018d0110-46d1-11ec-a89e-8339c89698d8","name":"connectorId","type":"action"}],"type":"cases","updated_at":"2021-11-16T11:33:44.788Z","version":"WzIwNzMsMV0="} +{"attributes":{"action":"update","action_at":"2021-11-16T11:33:44.787Z","action_by":{"email":"","full_name":"","username":"test"},"action_field":["connector"],"new_value":"{\"name\":\"Jira test\",\"type\":\".jira\",\"fields\":{\"issueType\":\"10001\",\"parent\":null,\"priority\":null}}","old_value":"{\"name\":\"none\",\"type\":\".none\",\"fields\":null}","owner":"securitySolution"},"coreMigrationVersion":"7.16.0","id":"0ef96fa0-46d1-11ec-a89e-8339c89698d8","migrationVersion":{"cases-user-actions":"7.16.0"},"references":[{"id":"5228e870-46cf-11ec-a89e-8339c89698d8","name":"associated-cases","type":"cases"},{"id":"018d0110-46d1-11ec-a89e-8339c89698d8","name":"connectorId","type":"action"}],"score":null,"sort":[1637062424787,4305],"type":"cases-user-actions","updated_at":"2021-11-16T11:33:45.498Z","version":"WzIwNzQsMV0="} +{"attributes":{"action":"create","action_at":"2021-11-16T11:21:19.242Z","action_by":{"email":null,"full_name":"glo@test.co","username":"glo"},"action_field":["description","status","tags","title","connector","settings","owner"],"new_value":"{\"type\":\"individual\",\"title\":\"7.16 case to export\",\"tags\":[\"export case\"],\"description\":\"This is the description of the 7.16 case that I'm going to import in future versions.\",\"connector\":{\"name\":\"none\",\"type\":\".none\",\"fields\":null},\"settings\":{\"syncAlerts\":false},\"owner\":\"securitySolution\"}","old_value":null,"owner":"securitySolution"},"coreMigrationVersion":"7.16.0","id":"52b87e40-46cf-11ec-a89e-8339c89698d8","migrationVersion":{"cases-user-actions":"7.16.0"},"references":[{"id":"5228e870-46cf-11ec-a89e-8339c89698d8","name":"associated-cases","type":"cases"}],"score":null,"sort":[1637061679242,4228],"type":"cases-user-actions","updated_at":"2021-11-16T11:21:20.164Z","version":"WzE5MjMsMV0="} +{"attributes":{"action":"update","action_at":"2021-11-16T11:21:53.174Z","action_by":{"email":null,"full_name":"glo@test.co","username":"glo"},"action_field":["status"],"new_value":"in-progress","old_value":"open","owner":"securitySolution"},"coreMigrationVersion":"7.16.0","id":"66c03590-46cf-11ec-a89e-8339c89698d8","migrationVersion":{"cases-user-actions":"7.16.0"},"references":[{"id":"5228e870-46cf-11ec-a89e-8339c89698d8","name":"associated-cases","type":"cases"}],"score":null,"sort":[1637061713174,4245],"type":"cases-user-actions","updated_at":"2021-11-16T11:21:53.769Z","version":"WzE5MzAsMV0="} +{"attributes":{"associationType":"case","comment":"[This is just a timeline](https://bc4-0bc5a5.kb.europe-west1.gcp.cloud.es.io:9243/app/security/timelines?timeline=(id:%27091f65f0-46cf-11ec-a89e-8339c89698d8%27,isOpen:!t))","created_at":"2021-11-16T11:22:18.502Z","created_by":{"email":null,"full_name":"glo@test.co","username":"glo"},"owner":"securitySolution","pushed_at":null,"pushed_by":null,"type":"user","updated_at":null,"updated_by":null},"coreMigrationVersion":"7.16.0","id":"757ccad0-46cf-11ec-a89e-8339c89698d8","migrationVersion":{"cases-comments":"7.16.0"},"references":[{"id":"5228e870-46cf-11ec-a89e-8339c89698d8","name":"associated-cases","type":"cases"}],"score":null,"sort":[1637061738502,6040],"type":"cases-comments","updated_at":"2021-11-16T11:22:18.514Z","version":"WzE5MzIsMV0="} +{"attributes":{"action":"create","action_at":"2021-11-16T11:22:18.502Z","action_by":{"email":null,"full_name":"glo@test.co","username":"glo"},"action_field":["comment"],"new_value":"{\"comment\":\"[This is just a timeline](https://bc4-0bc5a5.kb.europe-west1.gcp.cloud.es.io:9243/app/security/timelines?timeline=(id:%27091f65f0-46cf-11ec-a89e-8339c89698d8%27,isOpen:!t))\",\"type\":\"user\",\"owner\":\"securitySolution\"}","old_value":null,"owner":"securitySolution"},"coreMigrationVersion":"7.16.0","id":"75ee9f70-46cf-11ec-a89e-8339c89698d8","migrationVersion":{"cases-user-actions":"7.16.0"},"references":[{"id":"5228e870-46cf-11ec-a89e-8339c89698d8","name":"associated-cases","type":"cases"},{"id":"757ccad0-46cf-11ec-a89e-8339c89698d8","name":"associated-cases-comments","type":"cases-comments"}],"score":null,"sort":[1637061738502,4243],"type":"cases-user-actions","updated_at":"2021-11-16T11:22:19.239Z","version":"WzE5MzMsMV0="} +{"attributes":{"alertId":"f339b9b0e9763b98bcdb7c4a65a10701aaa97a99e232cfd2dab2d8680f7c6c3a","associationType":"case","created_at":"2021-11-16T11:29:47.344Z","created_by":{"email":null,"full_name":"glo@test.co","username":"glo"},"index":".siem-signals-default-000001","owner":"securitySolution","pushed_at":null,"pushed_by":null,"rule":{"id":"f45fd050-46ce-11ec-a89e-8339c89698d8","name":"This is a test"},"type":"alert","updated_at":null,"updated_by":null},"coreMigrationVersion":"7.16.0","id":"8104cc80-46d0-11ec-a89e-8339c89698d8","migrationVersion":{"cases-comments":"7.16.0"},"references":[{"id":"5228e870-46cf-11ec-a89e-8339c89698d8","name":"associated-cases","type":"cases"}],"score":null,"sort":[1637062187344,6155],"type":"cases-comments","updated_at":"2021-11-16T11:29:47.352Z","version":"WzIwMzQsMV0="} +{"attributes":{"action":"create","action_at":"2021-11-16T11:29:47.344Z","action_by":{"email":null,"full_name":"glo@test.co","username":"glo"},"action_field":["comment"],"new_value":"{\"type\":\"alert\",\"alertId\":\"f339b9b0e9763b98bcdb7c4a65a10701aaa97a99e232cfd2dab2d8680f7c6c3a\",\"index\":\".siem-signals-default-000001\",\"rule\":{\"id\":\"f45fd050-46ce-11ec-a89e-8339c89698d8\",\"name\":\"This is a test\"},\"owner\":\"securitySolution\"}","old_value":null,"owner":"securitySolution"},"coreMigrationVersion":"7.16.0","id":"81803e10-46d0-11ec-a89e-8339c89698d8","migrationVersion":{"cases-user-actions":"7.16.0"},"references":[{"id":"5228e870-46cf-11ec-a89e-8339c89698d8","name":"associated-cases","type":"cases"},{"id":"8104cc80-46d0-11ec-a89e-8339c89698d8","name":"associated-cases-comments","type":"cases-comments"}],"score":null,"sort":[1637062187344,4282],"type":"cases-user-actions","updated_at":"2021-11-16T11:29:48.145Z","version":"WzIwMzYsMV0="} +{"attributes":{"fieldAttrs":"{}","fields":"[]","runtimeFieldMap":"{}","timeFieldName":"@timestamp","title":"auditbeat-*","typeMeta":"{}"},"coreMigrationVersion":"7.16.0","id":"92888d80-46cf-11ec-a89e-8339c89698d8","migrationVersion":{"index-pattern":"7.11.0"},"references":[],"type":"index-pattern","updated_at":"2021-11-16T11:23:07.231Z","version":"WzE5NDcsMV0="} +{"attributes":{"associationType":"case","comment":"!{lens{\"timeRange\":{\"from\":\"now-7d\",\"to\":\"now\",\"mode\":\"relative\"},\"attributes\":{\"title\":\"\",\"description\":\"Events acknowledged by the output (includes events dropped by the output). (From beat.stats.libbeat.output.events.acked)\",\"visualizationType\":\"lnsXY\",\"type\":\"lens\",\"references\":[{\"type\":\"index-pattern\",\"id\":\"92888d80-46cf-11ec-a89e-8339c89698d8\",\"name\":\"indexpattern-datasource-current-indexpattern\"},{\"type\":\"index-pattern\",\"id\":\"92888d80-46cf-11ec-a89e-8339c89698d8\",\"name\":\"indexpattern-datasource-layer-03c31209-08e8-4917-b7d5-9d77ecf40dd1\"}],\"state\":{\"visualization\":{\"legend\":{\"isVisible\":true,\"position\":\"right\"},\"valueLabels\":\"hide\",\"fittingFunction\":\"None\",\"yLeftExtent\":{\"mode\":\"full\"},\"yRightExtent\":{\"mode\":\"full\"},\"axisTitlesVisibilitySettings\":{\"x\":true,\"yRight\":true,\"yLeft\":true},\"tickLabelsVisibilitySettings\":{\"x\":true,\"yRight\":true,\"yLeft\":true},\"labelsOrientation\":{\"x\":0,\"yRight\":0,\"yLeft\":0},\"gridlinesVisibilitySettings\":{\"x\":true,\"yRight\":true,\"yLeft\":true},\"preferredSeriesType\":\"line\",\"layers\":[{\"layerId\":\"03c31209-08e8-4917-b7d5-9d77ecf40dd1\",\"seriesType\":\"line\",\"xAccessor\":\"bd01502a-3d64-470e-8277-928d6a9399e2\",\"accessors\":[\"97dfd130-3c4d-477a-8e24-adc95b5a5e86\"],\"layerType\":\"data\"}]},\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filters\":[],\"datasourceStates\":{\"indexpattern\":{\"layers\":{\"03c31209-08e8-4917-b7d5-9d77ecf40dd1\":{\"columns\":{\"bd01502a-3d64-470e-8277-928d6a9399e2\":{\"label\":\"@timestamp\",\"dataType\":\"date\",\"operationType\":\"date_histogram\",\"sourceField\":\"@timestamp\",\"isBucketed\":true,\"scale\":\"interval\",\"params\":{\"interval\":\"auto\"}},\"97dfd130-3c4d-477a-8e24-adc95b5a5e86\":{\"label\":\"Count of records\",\"dataType\":\"number\",\"operationType\":\"count\",\"isBucketed\":false,\"scale\":\"ratio\",\"sourceField\":\"Records\"}},\"columnOrder\":[\"bd01502a-3d64-470e-8277-928d6a9399e2\",\"97dfd130-3c4d-477a-8e24-adc95b5a5e86\"],\"incompleteColumns\":{}}}}}}}}}","created_at":"2021-11-16T11:24:09.128Z","created_by":{"email":null,"full_name":"glo@test.co","username":"glo"},"owner":"securitySolution","pushed_at":null,"pushed_by":null,"type":"user","updated_at":null,"updated_by":null},"coreMigrationVersion":"7.16.0","id":"b76d4910-46cf-11ec-a89e-8339c89698d8","migrationVersion":{"cases-comments":"7.16.0"},"references":[{"id":"5228e870-46cf-11ec-a89e-8339c89698d8","name":"associated-cases","type":"cases"},{"id":"92888d80-46cf-11ec-a89e-8339c89698d8","name":"indexpattern-datasource-current-indexpattern","type":"index-pattern"},{"id":"92888d80-46cf-11ec-a89e-8339c89698d8","name":"indexpattern-datasource-layer-03c31209-08e8-4917-b7d5-9d77ecf40dd1","type":"index-pattern"}],"score":null,"sort":[1637061849128,6105],"type":"cases-comments","updated_at":"2021-11-16T11:24:09.135Z","version":"WzE5ODYsMV0="} +{"attributes":{"action":"create","action_at":"2021-11-16T11:24:09.128Z","action_by":{"email":null,"full_name":"glo@test.co","username":"glo"},"action_field":["comment"],"new_value":"{\"comment\":\"!{lens{\\\"timeRange\\\":{\\\"from\\\":\\\"now-7d\\\",\\\"to\\\":\\\"now\\\",\\\"mode\\\":\\\"relative\\\"},\\\"attributes\\\":{\\\"title\\\":\\\"\\\",\\\"description\\\":\\\"Events acknowledged by the output (includes events dropped by the output). (From beat.stats.libbeat.output.events.acked)\\\",\\\"visualizationType\\\":\\\"lnsXY\\\",\\\"type\\\":\\\"lens\\\",\\\"references\\\":[{\\\"type\\\":\\\"index-pattern\\\",\\\"id\\\":\\\"92888d80-46cf-11ec-a89e-8339c89698d8\\\",\\\"name\\\":\\\"indexpattern-datasource-current-indexpattern\\\"},{\\\"type\\\":\\\"index-pattern\\\",\\\"id\\\":\\\"92888d80-46cf-11ec-a89e-8339c89698d8\\\",\\\"name\\\":\\\"indexpattern-datasource-layer-03c31209-08e8-4917-b7d5-9d77ecf40dd1\\\"}],\\\"state\\\":{\\\"visualization\\\":{\\\"legend\\\":{\\\"isVisible\\\":true,\\\"position\\\":\\\"right\\\"},\\\"valueLabels\\\":\\\"hide\\\",\\\"fittingFunction\\\":\\\"None\\\",\\\"yLeftExtent\\\":{\\\"mode\\\":\\\"full\\\"},\\\"yRightExtent\\\":{\\\"mode\\\":\\\"full\\\"},\\\"axisTitlesVisibilitySettings\\\":{\\\"x\\\":true,\\\"yRight\\\":true,\\\"yLeft\\\":true},\\\"tickLabelsVisibilitySettings\\\":{\\\"x\\\":true,\\\"yRight\\\":true,\\\"yLeft\\\":true},\\\"labelsOrientation\\\":{\\\"x\\\":0,\\\"yRight\\\":0,\\\"yLeft\\\":0},\\\"gridlinesVisibilitySettings\\\":{\\\"x\\\":true,\\\"yRight\\\":true,\\\"yLeft\\\":true},\\\"preferredSeriesType\\\":\\\"line\\\",\\\"layers\\\":[{\\\"layerId\\\":\\\"03c31209-08e8-4917-b7d5-9d77ecf40dd1\\\",\\\"seriesType\\\":\\\"line\\\",\\\"xAccessor\\\":\\\"bd01502a-3d64-470e-8277-928d6a9399e2\\\",\\\"accessors\\\":[\\\"97dfd130-3c4d-477a-8e24-adc95b5a5e86\\\"],\\\"layerType\\\":\\\"data\\\"}]},\\\"query\\\":{\\\"query\\\":\\\"\\\",\\\"language\\\":\\\"kuery\\\"},\\\"filters\\\":[],\\\"datasourceStates\\\":{\\\"indexpattern\\\":{\\\"layers\\\":{\\\"03c31209-08e8-4917-b7d5-9d77ecf40dd1\\\":{\\\"columns\\\":{\\\"bd01502a-3d64-470e-8277-928d6a9399e2\\\":{\\\"label\\\":\\\"@timestamp\\\",\\\"dataType\\\":\\\"date\\\",\\\"operationType\\\":\\\"date_histogram\\\",\\\"sourceField\\\":\\\"@timestamp\\\",\\\"isBucketed\\\":true,\\\"scale\\\":\\\"interval\\\",\\\"params\\\":{\\\"interval\\\":\\\"auto\\\"}},\\\"97dfd130-3c4d-477a-8e24-adc95b5a5e86\\\":{\\\"label\\\":\\\"Count of records\\\",\\\"dataType\\\":\\\"number\\\",\\\"operationType\\\":\\\"count\\\",\\\"isBucketed\\\":false,\\\"scale\\\":\\\"ratio\\\",\\\"sourceField\\\":\\\"Records\\\"}},\\\"columnOrder\\\":[\\\"bd01502a-3d64-470e-8277-928d6a9399e2\\\",\\\"97dfd130-3c4d-477a-8e24-adc95b5a5e86\\\"],\\\"incompleteColumns\\\":{}}}}}}}}}\",\"type\":\"user\",\"owner\":\"securitySolution\"}","old_value":null,"owner":"securitySolution"},"coreMigrationVersion":"7.16.0","id":"b8076630-46cf-11ec-a89e-8339c89698d8","migrationVersion":{"cases-user-actions":"7.16.0"},"references":[{"id":"5228e870-46cf-11ec-a89e-8339c89698d8","name":"associated-cases","type":"cases"},{"id":"b76d4910-46cf-11ec-a89e-8339c89698d8","name":"associated-cases-comments","type":"cases-comments"}],"score":null,"sort":[1637061849128,4260],"type":"cases-user-actions","updated_at":"2021-11-16T11:24:10.131Z","version":"WzE5ODcsMV0="} +{"attributes":{"alertId":"f339b9b0e9763b98bcdb7c4a65a10701aaa97a99e232cfd2dab2d8680f7c6c3a","associationType":"case","created_at":"2021-11-16T11:24:42.043Z","created_by":{"email":null,"full_name":"glo@test.co","username":"glo"},"index":".siem-signals-default-000001","owner":"securitySolution","pushed_at":null,"pushed_by":null,"rule":{"id":"f45fd050-46ce-11ec-a89e-8339c89698d8","name":"This is a test"},"type":"alert","updated_at":null,"updated_by":null},"coreMigrationVersion":"7.16.0","id":"cb0acce0-46cf-11ec-a89e-8339c89698d8","migrationVersion":{"cases-comments":"7.16.0"},"references":[{"id":"5228e870-46cf-11ec-a89e-8339c89698d8","name":"associated-cases","type":"cases"}],"score":null,"sort":[1637061882043,6107],"type":"cases-comments","updated_at":"2021-11-16T11:24:42.048Z","version":"WzE5OTYsMV0="} +{"attributes":{"action":"create","action_at":"2021-11-16T11:24:42.043Z","action_by":{"email":null,"full_name":"glo@test.co","username":"glo"},"action_field":["comment"],"new_value":"{\"type\":\"alert\",\"alertId\":\"f339b9b0e9763b98bcdb7c4a65a10701aaa97a99e232cfd2dab2d8680f7c6c3a\",\"index\":\".siem-signals-default-000001\",\"rule\":{\"id\":\"f45fd050-46ce-11ec-a89e-8339c89698d8\",\"name\":\"This is a test\"},\"owner\":\"securitySolution\"}","old_value":null,"owner":"securitySolution"},"coreMigrationVersion":"7.16.0","id":"cb634d20-46cf-11ec-a89e-8339c89698d8","migrationVersion":{"cases-user-actions":"7.16.0"},"references":[{"id":"5228e870-46cf-11ec-a89e-8339c89698d8","name":"associated-cases","type":"cases"},{"id":"cb0acce0-46cf-11ec-a89e-8339c89698d8","name":"associated-cases-comments","type":"cases-comments"}],"score":null,"sort":[1637061882043,4263],"type":"cases-user-actions","updated_at":"2021-11-16T11:24:42.610Z","version":"WzE5OTgsMV0="} +{"excludedObjects":[],"excludedObjectsCount":0,"exportedCount":14,"missingRefCount":0,"missingReferences":[]} \ No newline at end of file diff --git a/x-pack/plugins/security_solution/cypress/integration/cases/creation.spec.ts b/x-pack/plugins/security_solution/cypress/integration/cases/creation.spec.ts index 028439ce6c3a4..90ab1d098aef5 100644 --- a/x-pack/plugins/security_solution/cypress/integration/cases/creation.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/cases/creation.spec.ts @@ -76,9 +76,9 @@ describe('Cases', () => { filterStatusOpen(); cy.get(ALL_CASES_PAGE_TITLE).should('have.text', 'Cases'); - cy.get(ALL_CASES_OPEN_CASES_STATS).should('have.text', 'Open cases1'); - cy.get(ALL_CASES_CLOSED_CASES_STATS).should('have.text', 'Closed cases0'); - cy.get(ALL_CASES_IN_PROGRESS_CASES_STATS).should('have.text', 'In progress cases0'); + cy.get(ALL_CASES_OPEN_CASES_STATS).should('have.text', '1'); + cy.get(ALL_CASES_CLOSED_CASES_STATS).should('have.text', '0'); + cy.get(ALL_CASES_IN_PROGRESS_CASES_STATS).should('have.text', '0'); cy.get(ALL_CASES_OPEN_CASES_COUNT).should('have.text', 'Open (1)'); cy.get(ALL_CASES_REPORTERS_COUNT).should('have.text', 'Reporter1'); cy.get(ALL_CASES_TAGS_COUNT).should('have.text', 'Tags2'); diff --git a/x-pack/plugins/security_solution/cypress/integration/detection_rules/custom_query_rule.spec.ts b/x-pack/plugins/security_solution/cypress/integration/detection_rules/custom_query_rule.spec.ts index 4a8072ebaf1b6..643ce05ec47bd 100644 --- a/x-pack/plugins/security_solution/cypress/integration/detection_rules/custom_query_rule.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/detection_rules/custom_query_rule.spec.ts @@ -133,7 +133,7 @@ describe('Custom detection rules creation', () => { }); }); - it.skip('Creates and activates a new rule', function () { + it('Creates and activates a new rule', function () { loginAndWaitForPageWithoutDateRange(ALERTS_URL); waitForAlertsPanelToBeLoaded(); waitForAlertsIndexToBeCreated(); @@ -215,9 +215,7 @@ describe('Custom detection rules creation', () => { waitForAlertsToPopulate(); cy.get(NUMBER_OF_ALERTS).should(($count) => expect(+$count.text().split(' ')[0]).to.be.gte(1)); - cy.get(ALERT_GRID_CELL).eq(3).contains(this.rule.name); - cy.get(ALERT_GRID_CELL).eq(4).contains(this.rule.severity.toLowerCase()); - cy.get(ALERT_GRID_CELL).eq(5).contains(this.rule.riskScore); + cy.get(ALERT_GRID_CELL).contains(this.rule.name); }); }); diff --git a/x-pack/plugins/security_solution/cypress/integration/detection_rules/event_correlation_rule.spec.ts b/x-pack/plugins/security_solution/cypress/integration/detection_rules/event_correlation_rule.spec.ts index 171d224cc32d3..e1208c7c54a3b 100644 --- a/x-pack/plugins/security_solution/cypress/integration/detection_rules/event_correlation_rule.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/detection_rules/event_correlation_rule.spec.ts @@ -186,7 +186,7 @@ describe('Detection rules, sequence EQL', () => { }); }); - it.skip('Creates and activates a new EQL rule with a sequence', function () { + it('Creates and activates a new EQL rule with a sequence', function () { loginAndWaitForPageWithoutDateRange(ALERTS_URL); waitForAlertsPanelToBeLoaded(); waitForAlertsIndexToBeCreated(); @@ -219,7 +219,6 @@ describe('Detection rules, sequence EQL', () => { cy.log('ALERT_DATA_GRID', text); expect(text).contains(this.rule.name); expect(text).contains(this.rule.severity.toLowerCase()); - expect(text).contains(this.rule.riskScore); }); }); }); diff --git a/x-pack/plugins/security_solution/cypress/integration/detection_rules/indicator_match_rule.spec.ts b/x-pack/plugins/security_solution/cypress/integration/detection_rules/indicator_match_rule.spec.ts index ef6db14dba896..92e501e5a2bd3 100644 --- a/x-pack/plugins/security_solution/cypress/integration/detection_rules/indicator_match_rule.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/detection_rules/indicator_match_rule.spec.ts @@ -411,8 +411,7 @@ describe('indicator match', () => { loginAndWaitForPageWithoutDateRange(ALERTS_URL); }); - // Skipping until we fix dupe mitigation - it.skip('Creates and activates a new Indicator Match rule', () => { + it('Creates and activates a new Indicator Match rule', () => { waitForAlertsPanelToBeLoaded(); waitForAlertsIndexToBeCreated(); goToManageAlertsDetectionRules(); diff --git a/x-pack/plugins/security_solution/cypress/integration/detection_rules/override.spec.ts b/x-pack/plugins/security_solution/cypress/integration/detection_rules/override.spec.ts index c1c1579a49ae9..92c6216f44847 100644 --- a/x-pack/plugins/security_solution/cypress/integration/detection_rules/override.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/detection_rules/override.spec.ts @@ -99,7 +99,7 @@ describe('Detection rules, override', () => { }); }); - it.skip('Creates and activates a new custom rule with override option', function () { + it('Creates and activates a new custom rule with override option', function () { loginAndWaitForPageWithoutDateRange(ALERTS_URL); waitForAlertsPanelToBeLoaded(); waitForAlertsIndexToBeCreated(); @@ -139,7 +139,7 @@ describe('Detection rules, override', () => { getDetails(RISK_SCORE_DETAILS).should('have.text', this.rule.riskScore); getDetails(RISK_SCORE_OVERRIDE_DETAILS).should( 'have.text', - `${this.rule.riskOverride}signal.rule.risk_score` + `${this.rule.riskOverride}kibana.alert.rule.risk_score` ); getDetails(RULE_NAME_OVERRIDE_DETAILS).should('have.text', this.rule.nameOverride); getDetails(REFERENCE_URLS_DETAILS).should((details) => { @@ -187,12 +187,8 @@ describe('Detection rules, override', () => { waitForAlertsToPopulate(); cy.get(NUMBER_OF_ALERTS).should(($count) => expect(+$count.text().split(' ')[0]).to.be.gte(1)); - cy.get(ALERT_GRID_CELL).eq(3).contains('auditbeat'); - cy.get(ALERT_GRID_CELL).eq(4).contains('critical'); - - // TODO: Is this necessary? - // sortRiskScore(); - - cy.get(ALERT_GRID_CELL).eq(5).contains('80'); + cy.get(ALERT_GRID_CELL).contains('auditbeat'); + cy.get(ALERT_GRID_CELL).contains('critical'); + cy.get(ALERT_GRID_CELL).contains('80'); }); }); diff --git a/x-pack/plugins/security_solution/cypress/integration/exceptions/from_alert.spec.ts b/x-pack/plugins/security_solution/cypress/integration/exceptions/from_alert.spec.ts index cea290eeef17b..84ad93fa08943 100644 --- a/x-pack/plugins/security_solution/cypress/integration/exceptions/from_alert.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/exceptions/from_alert.spec.ts @@ -35,7 +35,7 @@ import { import { ALERTS_URL } from '../../urls/navigation'; import { cleanKibana } from '../../tasks/common'; -describe.skip('From alert', () => { +describe('From alert', () => { const NUMBER_OF_AUDITBEAT_EXCEPTIONS_ALERTS = '1 alert'; beforeEach(() => { diff --git a/x-pack/plugins/security_solution/cypress/integration/exceptions/from_rule.spec.ts b/x-pack/plugins/security_solution/cypress/integration/exceptions/from_rule.spec.ts index 4af6467e5d33c..ea6b6cf0186b4 100644 --- a/x-pack/plugins/security_solution/cypress/integration/exceptions/from_rule.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/exceptions/from_rule.spec.ts @@ -35,7 +35,7 @@ import { refreshPage } from '../../tasks/security_header'; import { ALERTS_URL } from '../../urls/navigation'; import { cleanKibana } from '../../tasks/common'; -describe.skip('From rule', () => { +describe('From rule', () => { const NUMBER_OF_AUDITBEAT_EXCEPTIONS_ALERTS = '1'; beforeEach(() => { cleanKibana(); diff --git a/x-pack/plugins/security_solution/cypress/screens/all_cases.ts b/x-pack/plugins/security_solution/cypress/screens/all_cases.ts index 9d653fb384a1a..58b496a651f3b 100644 --- a/x-pack/plugins/security_solution/cypress/screens/all_cases.ts +++ b/x-pack/plugins/security_solution/cypress/screens/all_cases.ts @@ -5,7 +5,8 @@ * 2.0. */ -export const ALL_CASES_CLOSED_CASES_STATS = '[data-test-subj="closedStatsHeader"]'; +export const ALL_CASES_CLOSED_CASES_STATS = + '[data-test-subj="closedStatsHeader"] .euiDescriptionList__description'; export const ALL_CASES_COMMENTS_COUNT = '[data-test-subj="case-table-column-commentCount"]'; @@ -13,15 +14,21 @@ export const ALL_CASES_CREATE_NEW_CASE_BTN = '[data-test-subj="createNewCaseBtn" export const ALL_CASES_CREATE_NEW_CASE_TABLE_BTN = '[data-test-subj="cases-table-add-case"]'; -export const ALL_CASES_IN_PROGRESS_CASES_STATS = '[data-test-subj="inProgressStatsHeader"]'; +export const ALL_CASES_IN_PROGRESS_CASES_STATS = + '[data-test-subj="inProgressStatsHeader"] .euiDescriptionList__description'; export const ALL_CASES_NAME = '[data-test-subj="case-details-link"]'; +export const ALL_CASES_NOT_PUSHED = '[data-test-subj="case-table-column-external-notPushed"]'; + +export const ALL_CASES_NUMBER_OF_ALERTS = '[data-test-subj="case-table-column-alertsCount"]'; + export const ALL_CASES_OPEN_CASES_COUNT = '[data-test-subj="case-status-filter"]'; export const ALL_CASES_OPEN_FILTER = '[data-test-subj="case-status-filter-open"]'; -export const ALL_CASES_OPEN_CASES_STATS = '[data-test-subj="openStatsHeader"]'; +export const ALL_CASES_OPEN_CASES_STATS = + '[data-test-subj="openStatsHeader"] .euiDescriptionList__description'; export const ALL_CASES_OPENED_ON = '[data-test-subj="case-table-column-createdAt"]'; @@ -35,6 +42,8 @@ export const ALL_CASES_REPORTERS_COUNT = export const ALL_CASES_SERVICE_NOW_INCIDENT = '[data-test-subj="case-table-column-external-notPushed"]'; +export const ALL_CASES_IN_PROGRESS_STATUS = '[data-test-subj="status-badge-in-progress"]'; + export const ALL_CASES_TAGS = (index: number) => { return `[data-test-subj="case-table-column-tags-${index}"]`; }; diff --git a/x-pack/plugins/security_solution/cypress/screens/case_details.ts b/x-pack/plugins/security_solution/cypress/screens/case_details.ts index 8ec9a3fdacffc..f4cc5780259bd 100644 --- a/x-pack/plugins/security_solution/cypress/screens/case_details.ts +++ b/x-pack/plugins/security_solution/cypress/screens/case_details.ts @@ -5,6 +5,12 @@ * 2.0. */ +export const CASE_ACTIONS = '[data-test-subj="property-actions-ellipses"]'; + +export const CASE_CONNECTOR = '[data-test-subj="connector-fields"] .euiCard__title'; + +export const CASE_DELETE = '[data-test-subj="property-actions-trash"]'; + export const CASE_DETAILS_DESCRIPTION = '[data-test-subj="description-action"] [data-test-subj="user-action-markdown"]'; @@ -25,10 +31,24 @@ export const CASE_DETAILS_USER_ACTION_DESCRIPTION_USERNAME = export const CASE_DETAILS_USERNAMES = '[data-test-subj="case-view-username"]'; +export const CASE_EVENT_UPDATE = '.euiCommentEvent--update'; + +export const CASE_IN_PROGRESS_STATUS = '[data-test-subj="status-badge-in-progress"]'; + +export const CASE_SWITCH = '[data-test-subj="sync-alerts-switch"]'; + +export const CASES_TAGS = (tagName: string) => { + return `[data-test-subj="tag-${tagName}"]`; +}; + +export const CASE_USER_ACTION = '[data-test-subj="user-action-markdown"]'; + export const CONNECTOR_CARD_DETAILS = '[data-test-subj="connector-card"]'; export const CONNECTOR_TITLE = '[data-test-subj="connector-card"] span.euiTitle'; +export const DELETE_CASE_CONFIRM_BUTTON = '[data-test-subj="confirmModalConfirmButton"]'; + export const PARTICIPANTS = 1; export const REPORTER = 0; diff --git a/x-pack/plugins/security_solution/cypress/screens/saved_objects.ts b/x-pack/plugins/security_solution/cypress/screens/saved_objects.ts new file mode 100644 index 0000000000000..5789dc89f2bae --- /dev/null +++ b/x-pack/plugins/security_solution/cypress/screens/saved_objects.ts @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export const IMPORT_OBJECTS = '[data-test-subj="importObjects"]'; +export const INPUT = '.euiFilePicker__input'; +export const IMPORT_BTN = '[data-test-subj="importSavedObjectsImportBtn"]'; diff --git a/x-pack/plugins/security_solution/cypress/tasks/alerts.ts b/x-pack/plugins/security_solution/cypress/tasks/alerts.ts index f4b84b83284db..56f3e6821f5f5 100644 --- a/x-pack/plugins/security_solution/cypress/tasks/alerts.ts +++ b/x-pack/plugins/security_solution/cypress/tasks/alerts.ts @@ -23,7 +23,7 @@ import { TAKE_ACTION_POPOVER_BTN, TIMELINE_CONTEXT_MENU_BTN, } from '../screens/alerts'; -import { LOADING_INDICATOR, REFRESH_BUTTON } from '../screens/security_header'; +import { REFRESH_BUTTON } from '../screens/security_header'; import { TIMELINE_COLUMN_SPINNER } from '../screens/timeline'; import { UPDATE_ENRICHMENT_RANGE_BUTTON, @@ -98,8 +98,6 @@ export const goToOpenedAlerts = () => { cy.get(OPENED_ALERTS_FILTER_BTN).click({ force: true }); cy.get(REFRESH_BUTTON).should('not.have.text', 'Updating'); cy.get(REFRESH_BUTTON).should('have.text', 'Refresh'); - cy.get(LOADING_INDICATOR).should('exist'); - cy.get(LOADING_INDICATOR).should('not.exist'); }; export const refreshAlerts = () => { diff --git a/x-pack/plugins/security_solution/cypress/tasks/case_details.ts b/x-pack/plugins/security_solution/cypress/tasks/case_details.ts index 57f6f24ee890a..0609c784064a7 100644 --- a/x-pack/plugins/security_solution/cypress/tasks/case_details.ts +++ b/x-pack/plugins/security_solution/cypress/tasks/case_details.ts @@ -6,7 +6,18 @@ */ import { TIMELINE_TITLE } from '../screens/timeline'; -import { CASE_DETAILS_TIMELINE_LINK_MARKDOWN } from '../screens/case_details'; +import { + CASE_ACTIONS, + CASE_DELETE, + CASE_DETAILS_TIMELINE_LINK_MARKDOWN, + DELETE_CASE_CONFIRM_BUTTON, +} from '../screens/case_details'; + +export const deleteCase = () => { + cy.get(CASE_ACTIONS).first().click({ force: true }); + cy.get(CASE_DELETE).click({ force: true }); + cy.get(DELETE_CASE_CONFIRM_BUTTON).click({ force: true }); +}; export const openCaseTimeline = () => { cy.get(CASE_DETAILS_TIMELINE_LINK_MARKDOWN).click(); diff --git a/x-pack/plugins/security_solution/cypress/tasks/create_new_rule.ts b/x-pack/plugins/security_solution/cypress/tasks/create_new_rule.ts index b9323fee44d5c..68449363b8643 100644 --- a/x-pack/plugins/security_solution/cypress/tasks/create_new_rule.ts +++ b/x-pack/plugins/security_solution/cypress/tasks/create_new_rule.ts @@ -93,7 +93,6 @@ import { EMAIL_CONNECTOR_PASSWORD_INPUT, EMAIL_CONNECTOR_SERVICE_SELECTOR, } from '../screens/create_new_rule'; -import { LOADING_INDICATOR } from '../screens/security_header'; import { TOAST_ERROR } from '../screens/shared'; import { SERVER_SIDE_EVENT_COUNT } from '../screens/timeline'; import { TIMELINE } from '../screens/timelines'; @@ -533,7 +532,6 @@ export const waitForAlertsToPopulate = async (alertCountThreshold = 1) => { cy.waitUntil( () => { refreshPage(); - cy.get(LOADING_INDICATOR).should('not.exist'); return cy .get(SERVER_SIDE_EVENT_COUNT) .invoke('text') diff --git a/x-pack/plugins/security_solution/cypress/tasks/saved_objects.ts b/x-pack/plugins/security_solution/cypress/tasks/saved_objects.ts new file mode 100644 index 0000000000000..f3c007e59c1b4 --- /dev/null +++ b/x-pack/plugins/security_solution/cypress/tasks/saved_objects.ts @@ -0,0 +1,15 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { IMPORT_BTN, IMPORT_OBJECTS, INPUT } from '../screens/saved_objects'; + +export const importCase = (casePath: string) => { + cy.get(IMPORT_OBJECTS).click(); + cy.get(INPUT).trigger('click', { force: true }).attachFile(casePath).trigger('change'); + cy.get(IMPORT_BTN).click({ force: true }); + cy.get(IMPORT_BTN).should('not.exist'); +}; diff --git a/x-pack/plugins/security_solution/cypress/upgrade_integration/import_case.spec.ts b/x-pack/plugins/security_solution/cypress/upgrade_integration/import_case.spec.ts new file mode 100644 index 0000000000000..eb72dea9be7e8 --- /dev/null +++ b/x-pack/plugins/security_solution/cypress/upgrade_integration/import_case.spec.ts @@ -0,0 +1,152 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { + ALL_CASES_CLOSED_CASES_STATS, + ALL_CASES_COMMENTS_COUNT, + ALL_CASES_IN_PROGRESS_CASES_STATS, + ALL_CASES_NAME, + ALL_CASES_NOT_PUSHED, + ALL_CASES_NUMBER_OF_ALERTS, + ALL_CASES_OPEN_CASES_STATS, + ALL_CASES_REPORTER, + ALL_CASES_IN_PROGRESS_STATUS, +} from '../screens/all_cases'; +import { + CASES_TAGS, + CASE_CONNECTOR, + CASE_DETAILS_PAGE_TITLE, + CASE_DETAILS_USERNAMES, + CASE_EVENT_UPDATE, + CASE_IN_PROGRESS_STATUS, + CASE_SWITCH, + CASE_USER_ACTION, +} from '../screens/case_details'; +import { CASES_PAGE } from '../screens/kibana_navigation'; + +import { goToCaseDetails } from '../tasks/all_cases'; +import { deleteCase } from '../tasks/case_details'; +import { navigateFromKibanaCollapsibleTo, openKibanaNavigation } from '../tasks/kibana_navigation'; +import { loginAndWaitForPageWithoutDateRange } from '../tasks/login'; +import { importCase } from '../tasks/saved_objects'; + +import { KIBANA_SAVED_OBJECTS } from '../urls/navigation'; + +const CASE_NDJSON = '7_16_case.ndjson'; +const importedCase = { + title: '7.16 case to export', + user: 'glo', + reporter: 'glo@test.co', + tags: 'export case', + numberOfAlerts: '2', + numberOfComments: '4', + description: + "This is the description of the 7.16 case that I'm going to import in future versions.", + timeline: 'This is just a timeline', + status: 'In progress', + ruleName: 'This is a test', + participants: ['test', 'elastic'], + connector: 'Jira test', +}; +const updateStatusRegex = new RegExp( + `\\S${importedCase.user}marked case as${importedCase.status}\\S*\\s?(\\S*)?\\s?(\\S*)?` +); +const alertUpdateRegex = new RegExp( + `\\S${importedCase.user}added an alert from ${importedCase.ruleName}\\S*\\s?(\\S*)?\\s?(\\S*)?` +); +const incidentManagementSystemRegex = new RegExp( + `\\S${importedCase.participants[0]}selected ${importedCase.connector} as incident management system\\S*\\s?(\\S*)?\\s?(\\S*)?` +); +const DESCRIPTION = 0; +const TIMELINE = 1; +const LENS = 2; +const STATUS_UPDATE = 0; +const FIRST_ALERT_UPDATE = 1; +const SECOND_ALERT_UPDATE = 2; +const INCIDENT_MANAGEMENT_SYSTEM_UPDATE = 3; +const EXPECTED_NUMBER_OF_UPDATES = 4; +const EXPECTED_NUMBER_OF_PARTICIPANTS = 4; +const REPORTER = 0; +const FIRST_PARTICIPANT = 1; +const SECOND_PARTICIPANT = 2; +const THIRD_PARTICIPANT = 3; + +describe('Import case after upgrade', () => { + before(() => { + loginAndWaitForPageWithoutDateRange(KIBANA_SAVED_OBJECTS); + importCase(CASE_NDJSON); + openKibanaNavigation(); + navigateFromKibanaCollapsibleTo(CASES_PAGE); + }); + + after(() => { + deleteCase(); + }); + + it('Displays the correct number of opened cases on the cases page', () => { + const EXPECTED_NUMBER_OF_OPENED_CASES = '0'; + cy.get(ALL_CASES_OPEN_CASES_STATS).should('have.text', EXPECTED_NUMBER_OF_OPENED_CASES); + }); + + it('Displays the correct number of in progress cases on the cases page', () => { + const EXPECTED_NUMBER_OF_IN_PROGRESS_CASES = '1'; + cy.get(ALL_CASES_IN_PROGRESS_CASES_STATS).should( + 'have.text', + EXPECTED_NUMBER_OF_IN_PROGRESS_CASES + ); + }); + + it('Displays the correct number of closed cases on the cases page', () => { + const EXPECTED_NUMBER_OF_CLOSED_CASES = '0'; + cy.get(ALL_CASES_CLOSED_CASES_STATS).should('have.text', EXPECTED_NUMBER_OF_CLOSED_CASES); + }); + + it('Displays the correct case details on the cases page', () => { + cy.get(ALL_CASES_NAME).should('have.text', importedCase.title); + cy.get(ALL_CASES_REPORTER).should('have.text', importedCase.reporter); + cy.get(ALL_CASES_NUMBER_OF_ALERTS).should('have.text', importedCase.numberOfAlerts); + cy.get(ALL_CASES_COMMENTS_COUNT).should('have.text', importedCase.numberOfComments); + cy.get(ALL_CASES_NOT_PUSHED).should('be.visible'); + cy.get(ALL_CASES_IN_PROGRESS_STATUS).should('be.visible'); + }); + + it('Displays the correct case details on the case details page', () => { + goToCaseDetails(); + + cy.get(CASE_DETAILS_PAGE_TITLE).should('have.text', importedCase.title); + cy.get(CASE_IN_PROGRESS_STATUS).should('exist'); + cy.get(CASE_SWITCH).should('have.attr', 'aria-checked', 'false'); + cy.get(CASE_USER_ACTION).eq(DESCRIPTION).should('have.text', importedCase.description); + cy.get(CASE_USER_ACTION).eq(TIMELINE).should('have.text', importedCase.timeline); + cy.get(CASE_USER_ACTION).eq(LENS).should('have.text', ''); + cy.get(CASE_EVENT_UPDATE).should('have.length', EXPECTED_NUMBER_OF_UPDATES); + cy.get(CASE_EVENT_UPDATE).eq(STATUS_UPDATE).invoke('text').should('match', updateStatusRegex); + cy.get(CASE_EVENT_UPDATE) + .eq(FIRST_ALERT_UPDATE) + .invoke('text') + .should('match', alertUpdateRegex); + cy.get(CASE_EVENT_UPDATE) + .eq(SECOND_ALERT_UPDATE) + .invoke('text') + .should('match', alertUpdateRegex); + cy.get(CASE_EVENT_UPDATE) + .eq(INCIDENT_MANAGEMENT_SYSTEM_UPDATE) + .invoke('text') + .should('match', incidentManagementSystemRegex); + cy.get(CASE_DETAILS_USERNAMES).should('have.length', EXPECTED_NUMBER_OF_PARTICIPANTS); + cy.get(CASE_DETAILS_USERNAMES).eq(REPORTER).should('have.text', importedCase.user); + cy.get(CASE_DETAILS_USERNAMES).eq(FIRST_PARTICIPANT).should('have.text', importedCase.user); + cy.get(CASE_DETAILS_USERNAMES) + .eq(SECOND_PARTICIPANT) + .should('have.text', importedCase.participants[0]); + cy.get(CASE_DETAILS_USERNAMES) + .eq(THIRD_PARTICIPANT) + .should('have.text', importedCase.participants[1]); + cy.get(CASES_TAGS(importedCase.tags)).should('exist'); + cy.get(CASE_CONNECTOR).should('have.text', importedCase.connector); + }); +}); diff --git a/x-pack/plugins/security_solution/cypress/urls/navigation.ts b/x-pack/plugins/security_solution/cypress/urls/navigation.ts index 901c06193d73c..2f203e066677a 100644 --- a/x-pack/plugins/security_solution/cypress/urls/navigation.ts +++ b/x-pack/plugins/security_solution/cypress/urls/navigation.ts @@ -33,6 +33,7 @@ export const HOSTS_PAGE_TAB_URLS = { uncommonProcesses: '/app/security/hosts/uncommonProcesses', }; export const KIBANA_HOME = '/app/home#/'; +export const KIBANA_SAVED_OBJECTS = '/app/management/kibana/objects'; export const ENDPOINTS_URL = '/app/security/administration/endpoints'; export const TRUSTED_APPS_URL = '/app/security/administration/trusted_apps'; export const EVENT_FILTERS_URL = '/app/security/administration/event_filters'; diff --git a/x-pack/plugins/security_solution/kibana.json b/x-pack/plugins/security_solution/kibana.json index c2dfc7c923303..9f22f229b33c1 100644 --- a/x-pack/plugins/security_solution/kibana.json +++ b/x-pack/plugins/security_solution/kibana.json @@ -39,7 +39,7 @@ "lists", "home", "telemetry", - "indexPatternFieldEditor" + "dataViewFieldEditor" ], "server": true, "ui": true, diff --git a/x-pack/plugins/security_solution/public/app/404.tsx b/x-pack/plugins/security_solution/public/app/404.tsx index 72cae59867081..e9cc57f4d5943 100644 --- a/x-pack/plugins/security_solution/public/app/404.tsx +++ b/x-pack/plugins/security_solution/public/app/404.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiEmptyPrompt, EuiPageTemplate } from '@elastic/eui'; import { SecuritySolutionPageWrapper } from '../common/components/page_wrapper'; diff --git a/x-pack/plugins/security_solution/public/common/components/charts/barchart.tsx b/x-pack/plugins/security_solution/public/common/components/charts/barchart.tsx index 20ab5cca89a76..b60382481e9d6 100644 --- a/x-pack/plugins/security_solution/public/common/components/charts/barchart.tsx +++ b/x-pack/plugins/security_solution/public/common/components/charts/barchart.tsx @@ -8,7 +8,7 @@ import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import React, { useMemo } from 'react'; import { Chart, BarSeries, Axis, Position, ScaleType, Settings } from '@elastic/charts'; -import { getOr, get, isNumber } from 'lodash/fp'; +import { getOr, get, isNumber, isEmpty } from 'lodash/fp'; import deepmerge from 'deepmerge'; import uuid from 'uuid'; import styled from 'styled-components'; @@ -18,6 +18,7 @@ import { escapeDataProviderId } from '../drag_and_drop/helpers'; import { useTimeZone } from '../../lib/kibana'; import { defaultLegendColors } from '../matrix_histogram/utils'; import { useThrottledResizeObserver } from '../utils'; +import { EMPTY_VALUE_LABEL } from '../charts/translation'; import { ChartPlaceHolder } from './chart_place_holder'; import { @@ -32,6 +33,7 @@ import { } from './common'; import { DraggableLegend } from './draggable_legend'; import { LegendItem } from './draggable_legend_item'; +import type { ChartData } from './common'; const LegendFlexItem = styled(EuiFlexItem)` overview: hidden; @@ -50,7 +52,9 @@ const checkIfAnyValidSeriesExist = ( data.some(checkIfAllTheDataInTheSeriesAreValid); const yAccessors = ['y']; -const splitSeriesAccessors = ['g']; +const splitSeriesAccessors = [ + (datum: ChartData) => (isEmpty(datum.g) ? EMPTY_VALUE_LABEL : datum.g), +]; // Bar chart rotation: https://ela.st/chart-rotations export const BarChartBaseComponent = ({ diff --git a/x-pack/plugins/security_solution/public/common/components/charts/draggable_legend_item.test.tsx b/x-pack/plugins/security_solution/public/common/components/charts/draggable_legend_item.test.tsx index 17b70a9903590..9d1dde39d8cc0 100644 --- a/x-pack/plugins/security_solution/public/common/components/charts/draggable_legend_item.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/charts/draggable_legend_item.test.tsx @@ -59,4 +59,13 @@ describe('DraggableLegendItem', () => { wrapper.find(`[data-test-subj="legend-item-${legendItem.dataProviderId}"]`).prop('hideTopN') ).toEqual(true); }); + + it('renders the empty value label when the value is empty', () => { + wrapper = mount( + + + + ); + expect(wrapper.find('[data-test-subj="value-wrapper-empty"]').first().exists()).toBeTruthy(); + }); }); diff --git a/x-pack/plugins/security_solution/public/common/components/charts/draggable_legend_item.tsx b/x-pack/plugins/security_solution/public/common/components/charts/draggable_legend_item.tsx index 0cf580db67237..3182189a52e2a 100644 --- a/x-pack/plugins/security_solution/public/common/components/charts/draggable_legend_item.tsx +++ b/x-pack/plugins/security_solution/public/common/components/charts/draggable_legend_item.tsx @@ -7,8 +7,10 @@ import { EuiFlexGroup, EuiFlexItem, EuiHealth, EuiText } from '@elastic/eui'; import React from 'react'; +import { isEmpty } from 'lodash/fp'; import { DefaultDraggable } from '../draggables'; +import { EMPTY_VALUE_LABEL } from './translation'; export interface LegendItem { color?: string; @@ -18,6 +20,15 @@ export interface LegendItem { value: string; } +/** + * Renders the value or a placeholder in case the value is empty + */ +const ValueWrapper = React.memo<{ value?: string | null }>(({ value }) => + isEmpty(value) ? {EMPTY_VALUE_LABEL} : <>{value} +); + +ValueWrapper.displayName = 'ValueWrapper'; + const DraggableLegendItemComponent: React.FC<{ legendItem: LegendItem; }> = ({ legendItem }) => { @@ -41,7 +52,9 @@ const DraggableLegendItemComponent: React.FC<{ isDraggable={false} timelineId={timelineId} value={value} - /> + > + + diff --git a/x-pack/plugins/security_solution/public/common/components/charts/translation.ts b/x-pack/plugins/security_solution/public/common/components/charts/translation.ts index a527a85f62c71..15dbb05f7c7b9 100644 --- a/x-pack/plugins/security_solution/public/common/components/charts/translation.ts +++ b/x-pack/plugins/security_solution/public/common/components/charts/translation.ts @@ -20,3 +20,7 @@ export const DATA_NOT_AVAILABLE_TITLE = i18n.translate( defaultMessage: 'Chart Data Not Available', } ); + +export const EMPTY_VALUE_LABEL = i18n.translate('xpack.securitySolution.chart.emptyValueLabel', { + defaultMessage: 'empty value', +}); diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/agent_status.tsx b/x-pack/plugins/security_solution/public/common/components/endpoint/agent_status.tsx index d709105901215..64206feeac3c4 100644 --- a/x-pack/plugins/security_solution/public/common/components/endpoint/agent_status.tsx +++ b/x-pack/plugins/security_solution/public/common/components/endpoint/agent_status.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiBadge } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { HostStatus } from '../../../../common/endpoint/types'; import { HOST_STATUS_TO_BADGE_COLOR } from '../../../management/pages/endpoint_hosts/view/host_constants'; diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/formatted_date_time.tsx b/x-pack/plugins/security_solution/public/common/components/endpoint/formatted_date_time.tsx index 8b8c37f4b8f63..57b1d6530a515 100644 --- a/x-pack/plugins/security_solution/public/common/components/endpoint/formatted_date_time.tsx +++ b/x-pack/plugins/security_solution/public/common/components/endpoint/formatted_date_time.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedDate, FormattedTime, FormattedRelative } from '@kbn/i18n/react'; +import { FormattedDate, FormattedTime, FormattedRelative } from '@kbn/i18n-react'; /** * @deprecated consider using `FormattedDate` from `x-pack/plugins/security_solution/public/common/components/formatted_date/index.tsx:95` diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/endpoint_host_isolation_status.tsx b/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/endpoint_host_isolation_status.tsx index ad86b0f362234..6f8d399024285 100644 --- a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/endpoint_host_isolation_status.tsx +++ b/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/endpoint_host_isolation_status.tsx @@ -7,7 +7,7 @@ import React, { memo, useMemo, useRef, useEffect } from 'react'; import { EuiBadge, EuiFlexGroup, EuiFlexItem, EuiTextColor, EuiToolTip } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useTestIdGenerator } from '../../../../management/components/hooks/use_test_id_generator'; import { useIsExperimentalFeatureEnabled } from '../../../hooks/use_experimental_features'; diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/isolate_form.tsx b/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/isolate_form.tsx index 2998b96fcf6ee..258c981cf6057 100644 --- a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/isolate_form.tsx +++ b/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/isolate_form.tsx @@ -16,7 +16,7 @@ import { EuiText, EuiTextArea, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { CANCEL, COMMENT, COMMENT_PLACEHOLDER, CONFIRM } from './translations'; export interface EndpointIsolatedFormProps { diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/isolate_success.tsx b/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/isolate_success.tsx index 7f05e8eafac87..466107f75abfc 100644 --- a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/isolate_success.tsx +++ b/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/isolate_success.tsx @@ -7,7 +7,7 @@ import React, { memo, ReactNode, useMemo } from 'react'; import { EuiCallOut, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { GET_ISOLATION_SUCCESS_MESSAGE, GET_UNISOLATION_SUCCESS_MESSAGE } from './translations'; import { useCasesFromAlerts } from '../../../../detections/containers/detection_engine/alerts/use_cases_from_alerts'; import { CaseDetailsLink } from '../../../../common/components/links'; diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/unisolate_form.tsx b/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/unisolate_form.tsx index ac650edca43e4..a0913d58a6bdb 100644 --- a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/unisolate_form.tsx +++ b/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/unisolate_form.tsx @@ -16,7 +16,7 @@ import { EuiText, EuiTextArea, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { CANCEL, COMMENT, COMMENT_PLACEHOLDER, CONFIRM, UNISOLATE, ISOLATED } from './translations'; import { EndpointIsolatedFormProps } from './isolate_form'; diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/cti_details/host_risk_summary.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/cti_details/host_risk_summary.tsx index 425bba4f19f23..dd7d10014022f 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/cti_details/host_risk_summary.tsx +++ b/x-pack/plugins/security_solution/public/common/components/event_details/cti_details/host_risk_summary.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiLoadingSpinner, EuiPanel, EuiSpacer, EuiLink, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import * as i18n from './translations'; import { RISKY_HOSTS_DOC_LINK } from '../../../../overview/components/overview_risky_host_links/risky_hosts_disabled_module'; import { HostRisk } from '../../../../overview/containers/overview_risky_host_links/use_hosts_risk_score'; diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/investigation_guide_view.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/investigation_guide_view.tsx index 313766caad196..f845e8ecba6b6 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/investigation_guide_view.tsx +++ b/x-pack/plugins/security_solution/public/common/components/event_details/investigation_guide_view.tsx @@ -6,6 +6,7 @@ */ import { EuiSpacer, EuiHorizontalRule, EuiTitle, EuiText } from '@elastic/eui'; +import { ALERT_RULE_UUID } from '@kbn/rule-data-utils'; import React, { useMemo } from 'react'; import styled from 'styled-components'; @@ -25,7 +26,7 @@ const InvestigationGuideViewComponent: React.FC<{ data: TimelineEventsDetailsItem[]; }> = ({ data }) => { const ruleId = useMemo(() => { - const item = data.find((d) => d.field === 'signal.rule.id'); + const item = data.find((d) => d.field === 'signal.rule.id' || d.field === ALERT_RULE_UUID); return Array.isArray(item?.originalValue) ? item?.originalValue[0] : item?.originalValue ?? null; diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/reason.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/reason.tsx index 88672e5e2f5dc..cf69e4ba02c3e 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/reason.tsx +++ b/x-pack/plugins/security_solution/public/common/components/event_details/reason.tsx @@ -6,6 +6,8 @@ */ import { EuiTextColor, EuiFlexItem, EuiSpacer, EuiHorizontalRule, EuiTitle } from '@elastic/eui'; +import { ALERT_REASON, ALERT_RULE_UUID } from '@kbn/rule-data-utils'; + import React, { useMemo } from 'react'; import styled from 'styled-components'; @@ -33,15 +35,20 @@ export const ReasonComponent: React.FC = ({ eventId, data }) => { const { navigateToApp } = useKibana().services.application; const { formatUrl } = useFormatUrl(SecurityPageName.rules); - const reason = useMemo( - () => getFieldValue({ category: 'signal', field: 'signal.reason' }, data), - [data] - ); + const reason = useMemo(() => { + const siemSignalsReason = getFieldValue( + { category: 'signal', field: 'signal.alert.reason' }, + data + ); + const aadReason = getFieldValue({ category: 'kibana', field: ALERT_REASON }, data); + return aadReason.length > 0 ? aadReason : siemSignalsReason; + }, [data]); - const ruleId = useMemo( - () => getFieldValue({ category: 'signal', field: 'signal.rule.id' }, data), - [data] - ); + const ruleId = useMemo(() => { + const siemSignalsRuleId = getFieldValue({ category: 'signal', field: 'signal.rule.id' }, data); + const aadRuleId = getFieldValue({ category: 'kibana', field: ALERT_RULE_UUID }, data); + return aadRuleId.length > 0 ? aadRuleId : siemSignalsRuleId; + }, [data]); if (!eventId) { return {EVENT_DETAILS_PLACEHOLDER}; diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx index 3ef80794275dc..8303428894737 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx @@ -35,6 +35,7 @@ import { OsTypeArray, ExceptionListItemSchema, } from '@kbn/securitysolution-io-ts-list-types'; +import { DataViewBase } from '@kbn/es-query'; import { getExceptionListItemSchemaMock } from '../../../../../lists/common/schemas/response/exception_list_item_schema.mock'; import { getEntryMatchMock } from '../../../../../lists/common/schemas/types/entry_match.mock'; @@ -42,7 +43,10 @@ import { getCommentsArrayMock } from '../../../../../lists/common/schemas/types/ import { fields } from '../../../../../../../src/plugins/data/common/mocks'; import { ENTRIES, OLD_DATE_RELATIVE_TO_DATE_NOW } from '../../../../../lists/common/constants.mock'; import { CodeSignature } from '../../../../common/ecs/file'; -import type { DataViewBase } from '@kbn/es-query'; +import { + ALERT_ORIGINAL_EVENT_KIND, + ALERT_ORIGINAL_EVENT_MODULE, +} from '../../../../common/field_maps/field_names'; jest.mock('uuid', () => ({ v4: jest.fn().mockReturnValue('123'), @@ -432,7 +436,7 @@ describe('Exception helpers', () => { entries: [ { ...getEntryMatchMock(), - field: 'signal.original_event.kind', + field: ALERT_ORIGINAL_EVENT_KIND, }, getEntryMatchMock(), ], @@ -442,7 +446,7 @@ describe('Exception helpers', () => { entries: [ { ...getEntryMatchMock(), - field: 'signal.original_event.module', + field: ALERT_ORIGINAL_EVENT_MODULE, }, ], }, diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.tsx index 4030c1f90d102..b6ae9ca9b0132 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/helpers.tsx @@ -44,6 +44,7 @@ import exceptionableLinuxFields from './exceptionable_linux_fields.json'; import exceptionableWindowsMacFields from './exceptionable_windows_mac_fields.json'; import exceptionableEndpointFields from './exceptionable_endpoint_fields.json'; import exceptionableEndpointEventFields from './exceptionable_endpoint_event_fields.json'; +import { ALERT_ORIGINAL_EVENT } from '../../../../common/field_maps/field_names'; export const filterIndexPatterns = ( patterns: DataViewBase, @@ -145,7 +146,7 @@ export const prepareExceptionItemsForBulkClose = ( return { ...itemEntry, field: itemEntry.field.startsWith('event.') - ? itemEntry.field.replace(/^event./, 'signal.original_event.') + ? itemEntry.field.replace(/^event./, `${ALERT_ORIGINAL_EVENT}.`) : itemEntry.field, }; }); diff --git a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_utility.tsx b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_utility.tsx index 970ff7e2a17d7..ce9f5231ab177 100644 --- a/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_utility.tsx +++ b/x-pack/plugins/security_solution/public/common/components/exceptions/viewer/exceptions_utility.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiText, EuiLink, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import styled from 'styled-components'; import * as i18n from '../translations'; diff --git a/x-pack/plugins/security_solution/public/common/components/formatted_date/index.tsx b/x-pack/plugins/security_solution/public/common/components/formatted_date/index.tsx index 41615c3f092bc..a31448d181ea7 100644 --- a/x-pack/plugins/security_solution/public/common/components/formatted_date/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/formatted_date/index.tsx @@ -7,7 +7,7 @@ import moment from 'moment-timezone'; import React from 'react'; -import { FormattedRelative } from '@kbn/i18n/react'; +import { FormattedRelative } from '@kbn/i18n-react'; import { useDateFormat, useTimeZone, useUiSetting$ } from '../../lib/kibana'; import { getOrEmptyTagFromValue } from '../empty_value'; diff --git a/x-pack/plugins/security_solution/public/common/components/health_truncate_text/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/health_truncate_text/index.test.tsx new file mode 100644 index 0000000000000..71a18ee2cfef9 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/health_truncate_text/index.test.tsx @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { render, screen } from '@testing-library/react'; + +import { HealthTruncateText } from '.'; + +describe('Component HealthTruncateText', () => { + it('should render component without errors', () => { + render({'Test'}); + + expect(screen.getByTestId('testItem')).toHaveTextContent('Test'); + }); +}); diff --git a/x-pack/plugins/security_solution/public/common/components/health_truncate_text/index.tsx b/x-pack/plugins/security_solution/public/common/components/health_truncate_text/index.tsx new file mode 100644 index 0000000000000..0344104889832 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/health_truncate_text/index.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { EuiHealth, EuiToolTip, EuiHealthProps } from '@elastic/eui'; +import styled from 'styled-components'; + +const StatusTextWrapper = styled.div` + width: 100%; + display: inline-grid; +`; + +interface HealthTruncateTextProps { + healthColor?: EuiHealthProps['color']; + tooltipContent?: React.ReactNode; + dataTestSubj?: string; +} + +/** + * Allows text in EuiHealth to be properly truncated with tooltip + * @param healthColor - color for EuiHealth component + * @param tooltipContent - tooltip content + */ +export const HealthTruncateText: React.FC = ({ + tooltipContent, + children, + healthColor, + dataTestSubj, +}) => ( + + + + {children} + + + +); + +HealthTruncateText.displayName = 'HealthTruncateText'; diff --git a/x-pack/plugins/security_solution/public/common/components/last_event_time/index.tsx b/x-pack/plugins/security_solution/public/common/components/last_event_time/index.tsx index aa40337518b05..1b9750b0d5a39 100644 --- a/x-pack/plugins/security_solution/public/common/components/last_event_time/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/last_event_time/index.tsx @@ -6,7 +6,7 @@ */ import { EuiIcon, EuiLoadingSpinner, EuiToolTip } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { memo } from 'react'; import { DocValueFields, LastEventIndexKey } from '../../../../common/search_strategy'; diff --git a/x-pack/plugins/security_solution/public/common/components/localized_date_tooltip/index.tsx b/x-pack/plugins/security_solution/public/common/components/localized_date_tooltip/index.tsx index 3b140caeeda30..34825dfa5ae9d 100644 --- a/x-pack/plugins/security_solution/public/common/components/localized_date_tooltip/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/localized_date_tooltip/index.tsx @@ -6,7 +6,7 @@ */ import { EuiFlexGroup, EuiFlexItem, EuiToolTip } from '@elastic/eui'; -import { FormattedRelative } from '@kbn/i18n/react'; +import { FormattedRelative } from '@kbn/i18n-react'; import moment from 'moment'; import React from 'react'; diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/showing_count.tsx b/x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/showing_count.tsx index 556e33cd0c780..abc38de7aa4e4 100644 --- a/x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/showing_count.tsx +++ b/x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/showing_count.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import styled from 'styled-components'; diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/ml_popover.tsx b/x-pack/plugins/security_solution/public/common/components/ml_popover/ml_popover.tsx index cf5e8a5bad80a..f24b1e5e6c010 100644 --- a/x-pack/plugins/security_solution/public/common/components/ml_popover/ml_popover.tsx +++ b/x-pack/plugins/security_solution/public/common/components/ml_popover/ml_popover.tsx @@ -12,7 +12,7 @@ import { EuiPopoverTitle, EuiSpacer, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import moment from 'moment'; import React, { Dispatch, useCallback, useReducer, useState, useMemo } from 'react'; import styled from 'styled-components'; diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/popover_description.tsx b/x-pack/plugins/security_solution/public/common/components/ml_popover/popover_description.tsx index 8a9aaea995a81..9c4ecf207e67f 100644 --- a/x-pack/plugins/security_solution/public/common/components/ml_popover/popover_description.tsx +++ b/x-pack/plugins/security_solution/public/common/components/ml_popover/popover_description.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { EuiLink, EuiText } from '@elastic/eui'; diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/upgrade_contents.tsx b/x-pack/plugins/security_solution/public/common/components/ml_popover/upgrade_contents.tsx index 3f647b99898d9..9a109b802e7ea 100644 --- a/x-pack/plugins/security_solution/public/common/components/ml_popover/upgrade_contents.tsx +++ b/x-pack/plugins/security_solution/public/common/components/ml_popover/upgrade_contents.tsx @@ -17,7 +17,7 @@ import { EuiFlexGroup, EuiFlexItem, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useBasePath } from '../../lib/kibana'; import * as i18n from './translations'; diff --git a/x-pack/plugins/security_solution/public/common/components/popover_items/index.test.tsx b/x-pack/plugins/security_solution/public/common/components/popover_items/index.test.tsx new file mode 100644 index 0000000000000..5ffbbfc0ac08c --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/popover_items/index.test.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; + +import { PopoverItems, PopoverItemsProps } from '.'; +import { TestProviders } from '../../mock'; +import { render, screen } from '@testing-library/react'; +import { within } from '@testing-library/dom'; + +const mockTags = ['Elastic', 'Endpoint', 'Data Protection', 'ML', 'Continuous Monitoring']; + +const renderHelper = (props: Partial> = {}) => + render( + + {item}} + {...props} + /> + + ); + +const getButton = () => screen.getByRole('button', { name: 'show mocks' }); +const withinPopover = () => within(screen.getByTestId('tagsDisplayPopoverWrapper')); + +describe('Component PopoverItems', () => { + it('shoud render only 2 first items in display and rest in popup', async () => { + renderHelper({ numberOfItemsToDisplay: 2 }); + mockTags.slice(0, 2).forEach((tag) => { + expect(screen.getByText(tag)).toBeInTheDocument(); + }); + + // items not rendered yet + mockTags.slice(2).forEach((tag) => { + expect(screen.queryByText(tag)).toBeNull(); + }); + + getButton().click(); + expect(await screen.findByTestId('tagsDisplayPopoverWrapper')).toBeInTheDocument(); + + // items rendered in popup + mockTags.slice(2).forEach((tag) => { + expect(withinPopover().getByText(tag)).toBeInTheDocument(); + }); + }); + + it('shoud render popover button and items in popover without popover title', () => { + renderHelper(); + mockTags.forEach((tag) => { + expect(screen.queryByText(tag)).toBeNull(); + }); + getButton().click(); + + mockTags.forEach((tag) => { + expect(withinPopover().queryByText(tag)).toBeInTheDocument(); + }); + + expect(screen.queryByTestId('tagsDisplayPopoverTitle')).toBeNull(); + }); + + it('shoud render popover title', async () => { + renderHelper({ popoverTitle: 'Tags popover title' }); + + getButton().click(); + + expect(await screen.findByTestId('tagsDisplayPopoverWrapper')).toBeInTheDocument(); + expect(screen.getByTestId('tagsDisplayPopoverTitle')).toHaveTextContent('Tags popover title'); + }); +}); diff --git a/x-pack/plugins/security_solution/public/common/components/popover_items/index.tsx b/x-pack/plugins/security_solution/public/common/components/popover_items/index.tsx new file mode 100644 index 0000000000000..d0c806e7cae98 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/components/popover_items/index.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useState } from 'react'; +import { + EuiPopover, + EuiBadgeGroup, + EuiBadge, + EuiPopoverTitle, + EuiFlexGroup, + EuiFlexItem, +} from '@elastic/eui'; +import styled from 'styled-components'; + +export interface PopoverItemsProps { + renderItem: (item: T, index: number, items: T[]) => React.ReactNode; + items: T[]; + popoverButtonTitle: string; + popoverButtonIcon?: string; + popoverTitle?: string; + numberOfItemsToDisplay?: number; + dataTestPrefix?: string; +} + +interface OverflowListProps { + readonly items: T[]; +} + +const PopoverItemsWrapper = styled(EuiFlexGroup)` + width: 100%; +`; + +const PopoverWrapper = styled(EuiBadgeGroup)` + max-height: 200px; + max-width: 600px; + overflow: auto; + line-height: ${({ theme }) => theme.eui.euiLineHeight}; +`; + +/** + * Component to render list of items in popover, wicth configurabe number of display items by default + * @param items - array of items to render + * @param renderItem - render function that render item, arguments: item, index, items[] + * @param popoverTitle - title of popover + * @param popoverButtonTitle - title of popover button that triggers popover + * @param popoverButtonIcon - icon of popover button that triggers popover + * @param numberOfItemsToDisplay - number of items to render that are no in popover, defaults to 0 + * @param dataTestPrefix - data-test-subj prefix to apply to elements + */ +const PopoverItemsComponent = ({ + items, + renderItem, + popoverTitle, + popoverButtonTitle, + popoverButtonIcon, + numberOfItemsToDisplay = 0, + dataTestPrefix = 'items', +}: PopoverItemsProps) => { + const [isExceptionOverflowPopoverOpen, setIsExceptionOverflowPopoverOpen] = useState(false); + + const OverflowList = ({ items: itemsToRender }: OverflowListProps) => ( + <>{itemsToRender.map(renderItem)} + ); + + if (items.length <= numberOfItemsToDisplay) { + return ( + + + + ); + } + + return ( + + + + + setIsExceptionOverflowPopoverOpen(!isExceptionOverflowPopoverOpen)} + onClickAriaLabel={popoverButtonTitle} + > + {popoverButtonTitle} + + } + isOpen={isExceptionOverflowPopoverOpen} + closePopover={() => setIsExceptionOverflowPopoverOpen(!isExceptionOverflowPopoverOpen)} + repositionOnScroll + > + {popoverTitle ? ( + + {popoverTitle} + + ) : null} + + + + + + ); +}; + +const MemoizedPopoverItems = React.memo(PopoverItemsComponent); +MemoizedPopoverItems.displayName = 'PopoverItems'; + +export const PopoverItems = MemoizedPopoverItems as typeof PopoverItemsComponent; diff --git a/x-pack/plugins/security_solution/public/common/components/tables/helpers.tsx b/x-pack/plugins/security_solution/public/common/components/tables/helpers.tsx index 74e9d8ce4bffd..ccb56ae8a8cd6 100644 --- a/x-pack/plugins/security_solution/public/common/components/tables/helpers.tsx +++ b/x-pack/plugins/security_solution/public/common/components/tables/helpers.tsx @@ -6,7 +6,7 @@ */ import { EuiLink, EuiPopover, EuiToolTip, EuiText, EuiTextColor } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useState } from 'react'; import styled from 'styled-components'; diff --git a/x-pack/plugins/security_solution/public/common/lib/cell_actions/constants.ts b/x-pack/plugins/security_solution/public/common/lib/cell_actions/constants.ts index eb0d3a08a7423..ec636fc013758 100644 --- a/x-pack/plugins/security_solution/public/common/lib/cell_actions/constants.ts +++ b/x-pack/plugins/security_solution/public/common/lib/cell_actions/constants.ts @@ -6,4 +6,9 @@ */ /** actions are disabled for these fields in tables and popovers */ -export const FIELDS_WITHOUT_CELL_ACTIONS = ['signal.rule.risk_score', 'signal.reason']; +export const FIELDS_WITHOUT_CELL_ACTIONS = [ + 'signal.rule.risk_score', + 'signal.reason', + 'kibana.alert.rule.risk_score', + 'kibana.alert.reason', +]; diff --git a/x-pack/plugins/security_solution/public/common/mock/endpoint/app_root_provider.tsx b/x-pack/plugins/security_solution/public/common/mock/endpoint/app_root_provider.tsx index 86df9ac486fe8..63b11d3d07543 100644 --- a/x-pack/plugins/security_solution/public/common/mock/endpoint/app_root_provider.tsx +++ b/x-pack/plugins/security_solution/public/common/mock/endpoint/app_root_provider.tsx @@ -7,7 +7,7 @@ import React, { memo, ReactNode, useMemo } from 'react'; import { Provider } from 'react-redux'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { Router } from 'react-router-dom'; import { History } from 'history'; import useObservable from 'react-use/lib/useObservable'; diff --git a/x-pack/plugins/security_solution/public/common/mock/formatted_relative.ts b/x-pack/plugins/security_solution/public/common/mock/formatted_relative.ts index 107acb83dd26a..eb4c4ca443c94 100644 --- a/x-pack/plugins/security_solution/public/common/mock/formatted_relative.ts +++ b/x-pack/plugins/security_solution/public/common/mock/formatted_relative.ts @@ -5,8 +5,8 @@ * 2.0. */ -jest.mock('@kbn/i18n/react', () => { - const originalModule = jest.requireActual('@kbn/i18n/react'); +jest.mock('@kbn/i18n-react', () => { + const originalModule = jest.requireActual('@kbn/i18n-react'); const FormattedRelative = jest.fn().mockImplementation(() => '20 hours ago'); return { diff --git a/x-pack/plugins/security_solution/public/common/mock/test_providers.tsx b/x-pack/plugins/security_solution/public/common/mock/test_providers.tsx index f180dd2baf5f4..528592051ccce 100644 --- a/x-pack/plugins/security_solution/public/common/mock/test_providers.tsx +++ b/x-pack/plugins/security_solution/public/common/mock/test_providers.tsx @@ -6,7 +6,7 @@ */ import { euiDarkVars } from '@kbn/ui-shared-deps-src/theme'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import React from 'react'; import { DragDropContext, DropResult, ResponderProvided } from 'react-beautiful-dnd'; diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_info/index.tsx b/x-pack/plugins/security_solution/public/detections/components/alerts_info/index.tsx index a965910c1e49d..c4f50325a3421 100644 --- a/x-pack/plugins/security_solution/public/detections/components/alerts_info/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/alerts_info/index.tsx @@ -6,7 +6,7 @@ */ import { EuiLoadingSpinner } from '@elastic/eui'; -import { FormattedRelative } from '@kbn/i18n/react'; +import { FormattedRelative } from '@kbn/i18n-react'; import React, { useState, useEffect } from 'react'; import { useQueryAlerts } from '../../containers/detection_engine/alerts/use_query'; diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_info/query.dsl.ts b/x-pack/plugins/security_solution/public/detections/components/alerts_info/query.dsl.ts index b0c3c66b3a437..e12ad779ebc96 100644 --- a/x-pack/plugins/security_solution/public/detections/components/alerts_info/query.dsl.ts +++ b/x-pack/plugins/security_solution/public/detections/components/alerts_info/query.dsl.ts @@ -5,11 +5,13 @@ * 2.0. */ +import { ALERT_WORKFLOW_STATUS, ALERT_RULE_UUID } from '@kbn/rule-data-utils'; + export const buildLastAlertsQuery = (ruleId: string | undefined | null) => { const queryFilter = [ { bool: { - should: [{ match: { 'kibana.alert.workflow_status': 'open' } }], + should: [{ match: { [ALERT_WORKFLOW_STATUS]: 'open' } }], minimum_should_match: 1, }, }, @@ -27,7 +29,10 @@ export const buildLastAlertsQuery = (ruleId: string | undefined | null) => { ...queryFilter, { bool: { - should: [{ match: { 'signal.rule.id': ruleId } }], + should: [ + { match: { 'signal.rule.id': ruleId } }, + { match: { [ALERT_RULE_UUID]: ruleId } }, + ], minimum_should_match: 1, }, }, diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/alerts_histogram.tsx b/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/alerts_histogram.tsx index 2d3e6dcdca4c5..d74248b44cbb1 100644 --- a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/alerts_histogram.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/alerts_histogram.tsx @@ -16,11 +16,13 @@ import { } from '@elastic/charts'; import { EuiFlexGroup, EuiFlexItem, EuiProgress } from '@elastic/eui'; import React, { useMemo } from 'react'; +import { isEmpty } from 'lodash/fp'; -import { useTheme, UpdateDateRange } from '../../../../common/components/charts/common'; +import { useTheme, UpdateDateRange, ChartData } from '../../../../common/components/charts/common'; import { histogramDateTimeFormatter } from '../../../../common/components/utils'; import { DraggableLegend } from '../../../../common/components/charts/draggable_legend'; import { LegendItem } from '../../../../common/components/charts/draggable_legend_item'; +import { EMPTY_VALUE_LABEL } from '../../../../common/components/charts/translation'; import type { HistogramData } from './types'; @@ -56,7 +58,10 @@ export const AlertsHistogram = React.memo( const yAxisId = 'alertsHistogramAxisY'; const id = 'alertsHistogram'; const yAccessors = useMemo(() => ['y'], []); - const splitSeriesAccessors = useMemo(() => ['g'], []); + const splitSeriesAccessors = useMemo( + () => [(datum: ChartData) => (isEmpty(datum.g) ? EMPTY_VALUE_LABEL : datum.g)], + [] + ); const tickFormat = useMemo(() => histogramDateTimeFormatter([from, to]), [from, to]); return ( diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/helpers.tsx b/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/helpers.tsx index e5534900a3784..5c3808843aae7 100644 --- a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/helpers.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/helpers.tsx @@ -5,9 +5,9 @@ * 2.0. */ +import { isEmpty } from 'lodash/fp'; import moment from 'moment'; -import { isEmpty } from 'lodash/fp'; import type { HistogramData, AlertsAggregation, AlertsBucket, AlertsGroupBucket } from './types'; import type { AlertSearchResponse } from '../../../containers/detection_engine/alerts/types'; import type { AlertsStackByField } from '../common/types'; diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/actions.tsx b/x-pack/plugins/security_solution/public/detections/components/alerts_table/actions.tsx index bb095d0b7faed..27d6d813d537b 100644 --- a/x-pack/plugins/security_solution/public/detections/components/alerts_table/actions.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/alerts_table/actions.tsx @@ -288,7 +288,7 @@ export const buildAlertsKqlFilter = ( negate: false, disabled: false, type: 'phrases', - key: key.replace('signal.', 'kibana.alert.'), + key, value: alertIds.join(), params: alertIds, }, diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx b/x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx index 3d64d2d45fbf3..a5947e45ed0f0 100644 --- a/x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx @@ -7,7 +7,6 @@ import { ALERT_DURATION, - ALERT_INSTANCE_ID, ALERT_RULE_PRODUCER, ALERT_START, ALERT_WORKFLOW_STATUS, @@ -15,6 +14,8 @@ import { ALERT_RULE_UUID, ALERT_RULE_NAME, ALERT_RULE_CATEGORY, + ALERT_RULE_SEVERITY, + ALERT_RULE_RISK_SCORE, } from '@kbn/rule-data-utils/technical_field_names'; import type { Filter } from '@kbn/es-query'; @@ -271,10 +272,11 @@ export const buildShowBuildingBlockFilterRuleRegistry = ( export const requiredFieldMappingsForActionsRuleRegistry = { '@timestamp': '@timestamp', - 'alert.instance.id': ALERT_INSTANCE_ID, 'event.kind': 'event.kind', - 'alert.start': ALERT_START, + 'rule.severity': ALERT_RULE_SEVERITY, + 'rule.risk_score': ALERT_RULE_RISK_SCORE, 'alert.uuid': ALERT_UUID, + 'alert.start': ALERT_START, 'event.action': 'event.action', 'alert.workflow_status': ALERT_WORKFLOW_STATUS, 'alert.duration.us': ALERT_DURATION, diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_event_filter_action.tsx b/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_event_filter_action.tsx index 0a3d6fac70953..1a56c575057f0 100644 --- a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_event_filter_action.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_event_filter_action.tsx @@ -11,8 +11,10 @@ import { ACTION_ADD_EVENT_FILTER } from '../translations'; export const useEventFilterAction = ({ onAddEventFilterClick, + disabled = false, }: { onAddEventFilterClick: () => void; + disabled?: boolean; }) => { const eventFilterActionItems = useMemo( () => [ @@ -20,11 +22,12 @@ export const useEventFilterAction = ({ key="add-event-filter-menu-item" data-test-subj="add-event-filter-menu-item" onClick={onAddEventFilterClick} + disabled={disabled} > {ACTION_ADD_EVENT_FILTER} , ], - [onAddEventFilterClick] + [onAddEventFilterClick, disabled] ); return { eventFilterActionItems }; }; diff --git a/x-pack/plugins/security_solution/public/detections/components/callouts/missing_privileges_callout/translations.tsx b/x-pack/plugins/security_solution/public/detections/components/callouts/missing_privileges_callout/translations.tsx index 1468f4c00d506..a4857f03e35c8 100644 --- a/x-pack/plugins/security_solution/public/detections/components/callouts/missing_privileges_callout/translations.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/callouts/missing_privileges_callout/translations.tsx @@ -7,7 +7,7 @@ import { EuiCode } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { DEFAULT_ITEMS_INDEX, diff --git a/x-pack/plugins/security_solution/public/detections/components/callouts/ml_job_compatibility_callout/translations.tsx b/x-pack/plugins/security_solution/public/detections/components/callouts/ml_job_compatibility_callout/translations.tsx index 35ffdb6f7abf8..dcc52c4656bd6 100644 --- a/x-pack/plugins/security_solution/public/detections/components/callouts/ml_job_compatibility_callout/translations.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/callouts/ml_job_compatibility_callout/translations.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { MlJobCompatibilityLink } from '../../../../common/components/links_to_docs'; export const ML_JOB_COMPATIBILITY_CALLOUT_TITLE = i18n.translate( diff --git a/x-pack/plugins/security_solution/public/detections/components/callouts/need_admin_for_update_callout/translations.tsx b/x-pack/plugins/security_solution/public/detections/components/callouts/need_admin_for_update_callout/translations.tsx index 791093788b8e1..4ed4e7a12890f 100644 --- a/x-pack/plugins/security_solution/public/detections/components/callouts/need_admin_for_update_callout/translations.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/callouts/need_admin_for_update_callout/translations.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { SecuritySolutionRequirementsLink, DetectionsRequirementsLink, diff --git a/x-pack/plugins/security_solution/public/detections/components/host_isolation/helpers.ts b/x-pack/plugins/security_solution/public/detections/components/host_isolation/helpers.ts index 453cd5c7006c2..d0951172c21a9 100644 --- a/x-pack/plugins/security_solution/public/detections/components/host_isolation/helpers.ts +++ b/x-pack/plugins/security_solution/public/detections/components/host_isolation/helpers.ts @@ -18,7 +18,18 @@ export const getFieldValues = ( }, data: TimelineEventsDetailsItem[] | null ) => { - return find({ category, field }, data)?.values; + const categoryCompat = + category === 'signal' ? 'kibana' : category === 'kibana' ? 'signal' : category; + const fieldCompat = + category === 'signal' + ? field.replace('signal', 'kibana.alert').replace('rule.id', 'rule.uuid') + : category === 'kibana' + ? field.replace('kibana.alert', 'signal').replace('rule.uuid', 'rule.id') + : field; + return ( + find({ category, field }, data)?.values ?? + find({ category: categoryCompat, field: fieldCompat }, data)?.values + ); }; export const getFieldValue = ( diff --git a/x-pack/plugins/security_solution/public/detections/components/host_isolation/isolate.tsx b/x-pack/plugins/security_solution/public/detections/components/host_isolation/isolate.tsx index ac49984891443..5ecf8134f260c 100644 --- a/x-pack/plugins/security_solution/public/detections/components/host_isolation/isolate.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/host_isolation/isolate.tsx @@ -7,7 +7,7 @@ import React, { useMemo, useState, useCallback } from 'react'; import { EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useHostIsolation } from '../../containers/detection_engine/alerts/use_host_isolation'; import { CASES_ASSOCIATED_WITH_ALERT, RETURN_TO_ALERT_DETAILS } from './translations'; import { diff --git a/x-pack/plugins/security_solution/public/detections/components/host_isolation/unisolate.tsx b/x-pack/plugins/security_solution/public/detections/components/host_isolation/unisolate.tsx index 5cc862694bef8..cb2660acf3a65 100644 --- a/x-pack/plugins/security_solution/public/detections/components/host_isolation/unisolate.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/host_isolation/unisolate.tsx @@ -7,7 +7,7 @@ import React, { useMemo, useState, useCallback } from 'react'; import { EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { CASES_ASSOCIATED_WITH_ALERT, RETURN_TO_ALERT_DETAILS } from './translations'; import { EndpointIsolatedFormProps, diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/description_step/helpers.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/description_step/helpers.tsx index b72c11fc35687..871822077f718 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/description_step/helpers.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/description_step/helpers.tsx @@ -17,6 +17,7 @@ import { EuiIcon, EuiToolTip, } from '@elastic/eui'; +import { ALERT_RULE_RISK_SCORE } from '@kbn/rule-data-utils'; import { isEmpty } from 'lodash/fp'; import React from 'react'; @@ -353,7 +354,7 @@ export const buildRiskScoreDescription = (riskScore: AboutStepRiskScore): ListIt - {'signal.rule.risk_score'} + {ALERT_RULE_RISK_SCORE} ), }; diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/ml_job_select/help_text.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/ml_job_select/help_text.tsx index 5195679c13d2a..0a4c5ce76c785 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/ml_job_select/help_text.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/ml_job_select/help_text.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { EuiIcon, EuiLink, EuiText } from '@elastic/eui'; import styled from 'styled-components'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; const HelpTextWarningContainer = styled.div` margin-top: 10px; diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/risk_score_mapping/translations.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/risk_score_mapping/translations.tsx index 5e88b44b9e192..6d8ea92861df9 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/risk_score_mapping/translations.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/risk_score_mapping/translations.tsx @@ -24,7 +24,7 @@ export const DEFAULT_RISK_SCORE = i18n.translate( export const RISK_SCORE_FIELD = i18n.translate( 'xpack.securitySolution.alerts.riskScoreMapping.riskScoreFieldTitle', { - defaultMessage: 'signal.rule.risk_score', + defaultMessage: 'kibana.alert.rule.risk_score', } ); diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_execution_status_badge/index.test.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/rule_execution_status_badge/index.test.tsx new file mode 100644 index 0000000000000..d57bfcb329a77 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/components/rules/rule_execution_status_badge/index.test.tsx @@ -0,0 +1,21 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { render, screen } from '@testing-library/react'; + +import { RuleExecutionStatusBadge } from '.'; + +import { RuleExecutionStatus } from '../../../../../common/detection_engine/schemas/common/schemas'; + +describe('Component RuleExecutionStatus', () => { + it('should render component correctly with capitalized status text', () => { + render(); + + expect(screen.getByText('Succeeded')).toBeInTheDocument(); + }); +}); diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_execution_status_badge/index.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/rule_execution_status_badge/index.tsx new file mode 100644 index 0000000000000..9203480716e48 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detections/components/rules/rule_execution_status_badge/index.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; + +import { getEmptyTagValue } from '../../../../common/components/empty_value'; +import { HealthTruncateText } from '../../../../common/components/health_truncate_text'; +import { getStatusColor } from '../rule_status/helpers'; + +import { getCapitalizedRuleStatusText } from '../../../../../common/detection_engine/utils'; +import type { RuleExecutionStatus } from '../../../../../common/detection_engine/schemas/common/schemas'; + +interface RuleExecutionStatusBadgeProps { + status: RuleExecutionStatus | null | undefined; +} + +/** + * Shows rule execution status + * @param status - rule execution status + */ +const RuleExecutionStatusBadgeComponent = ({ status }: RuleExecutionStatusBadgeProps) => { + const displayStatus = getCapitalizedRuleStatusText(status); + return ( + + {displayStatus ?? getEmptyTagValue()} + + ); +}; + +export const RuleExecutionStatusBadge = React.memo(RuleExecutionStatusBadgeComponent); + +RuleExecutionStatusBadge.displayName = 'RuleExecutionStatusBadge'; diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/select_rule_type/ml_card_description.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/select_rule_type/ml_card_description.tsx index 85de997ce0279..51ad3e1d83e96 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/select_rule_type/ml_card_description.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/select_rule_type/ml_card_description.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiLink } from '@elastic/eui'; import styled from 'styled-components'; import React from 'react'; diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/severity_badge/index.test.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/severity_badge/index.test.tsx index 611ea3e443124..cff7b50a5ea28 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/severity_badge/index.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/severity_badge/index.test.tsx @@ -14,6 +14,6 @@ describe('SeverityBadge', () => { it('renders correctly', () => { const wrapper = shallow(); - expect(wrapper.find('EuiHealth')).toHaveLength(1); + expect(wrapper.find('HealthTruncateText')).toHaveLength(1); }); }); diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/severity_badge/index.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/severity_badge/index.tsx index 728e0ec871e93..1e1a5f1c35bc4 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/severity_badge/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/severity_badge/index.tsx @@ -7,28 +7,28 @@ import { upperFirst } from 'lodash/fp'; import React from 'react'; -import { EuiHealth } from '@elastic/eui'; -import { euiLightVars } from '@kbn/ui-shared-deps-src/theme'; +import { euiLightVars } from '@kbn/ui-shared-deps-src/theme'; +import { HealthTruncateText } from '../../../../common/components/health_truncate_text'; interface Props { value: string; } -const SeverityBadgeComponent: React.FC = ({ value }) => ( - - {upperFirst(value)} - -); +const SeverityBadgeComponent: React.FC = ({ value }) => { + const displayValue = upperFirst(value); + const color = 'low' + ? euiLightVars.euiColorVis0 + : value === 'medium' + ? euiLightVars.euiColorVis5 + : value === 'high' + ? euiLightVars.euiColorVis7 + : euiLightVars.euiColorVis9; + + return ( + + {displayValue} + + ); +}; export const SeverityBadge = React.memo(SeverityBadgeComponent); diff --git a/x-pack/plugins/security_solution/public/detections/components/take_action_dropdown/index.test.tsx b/x-pack/plugins/security_solution/public/detections/components/take_action_dropdown/index.test.tsx index d98b168f209da..a2f2ba331d959 100644 --- a/x-pack/plugins/security_solution/public/detections/components/take_action_dropdown/index.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/take_action_dropdown/index.test.tsx @@ -181,4 +181,68 @@ describe('take action dropdown', () => { }); }); }); + + describe('should correctly enable/disable the "Add Endpoint event filter" button', () => { + let wrapper: ReactWrapper; + + const getEcsDataWithAgentType = (agentType: string) => ({ + ...mockEcsDataWithAlert, + agent: { + type: [agentType], + }, + }); + + const modifiedMockDetailsData = mockAlertDetailsData + .map((obj) => { + if (obj.field === 'kibana.alert.rule.uuid') { + return null; + } + if (obj.field === 'event.kind') { + return { + category: 'event', + field: 'event.kind', + values: ['event'], + originalValue: 'event', + }; + } + return obj; + }) + .filter((obj) => obj) as TimelineEventsDetailsItem[]; + + test('should enable the "Add Endpoint event filter" button if provided endpoint event', async () => { + wrapper = mount( + + + + ); + wrapper.find('button[data-test-subj="take-action-dropdown-btn"]').simulate('click'); + await waitFor(() => { + expect( + wrapper.find('[data-test-subj="add-event-filter-menu-item"]').first().getDOMNode() + ).toBeEnabled(); + }); + }); + + test('should disable the "Add Endpoint event filter" button if provided non-event or non-endpoint', async () => { + wrapper = mount( + + + + ); + wrapper.find('button[data-test-subj="take-action-dropdown-btn"]').simulate('click'); + await waitFor(() => { + expect( + wrapper.find('[data-test-subj="add-event-filter-menu-item"]').first().getDOMNode() + ).toBeDisabled(); + }); + }); + }); }); diff --git a/x-pack/plugins/security_solution/public/detections/components/take_action_dropdown/index.tsx b/x-pack/plugins/security_solution/public/detections/components/take_action_dropdown/index.tsx index 4ebec3aa43b0c..84cca38014fde 100644 --- a/x-pack/plugins/security_solution/public/detections/components/take_action_dropdown/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/take_action_dropdown/index.tsx @@ -87,6 +87,12 @@ export const TakeActionDropdown = React.memo( ); const isEvent = actionsData.eventKind === 'event'; + const isAgentEndpoint = useMemo(() => ecsData?.agent?.type?.includes('endpoint'), [ecsData]); + + const isEndpointEvent = useMemo(() => isEvent && isAgentEndpoint, [isEvent, isAgentEndpoint]); + + const disableEventFilterAction = useMemo(() => !isEndpointEvent, [isEndpointEvent]); + const togglePopoverHandler = useCallback(() => { setIsPopoverOpen(!isPopoverOpen); }, [isPopoverOpen]); @@ -135,6 +141,7 @@ export const TakeActionDropdown = React.memo( const { eventFilterActionItems } = useEventFilterAction({ onAddEventFilterClick: handleOnAddEventFilterClick, + disabled: disableEventFilterAction, }); const afterCaseSelection = useCallback(() => { diff --git a/x-pack/plugins/security_solution/public/detections/configurations/examples/observablity_alerts/columns.ts b/x-pack/plugins/security_solution/public/detections/configurations/examples/observablity_alerts/columns.ts index c9d317bb250e9..37199840ae3fb 100644 --- a/x-pack/plugins/security_solution/public/detections/configurations/examples/observablity_alerts/columns.ts +++ b/x-pack/plugins/security_solution/public/detections/configurations/examples/observablity_alerts/columns.ts @@ -6,7 +6,11 @@ */ import { EuiDataGridColumn } from '@elastic/eui'; -import { ALERT_DURATION, ALERT_STATUS } from '@kbn/rule-data-utils/technical_field_names'; +import { + ALERT_DURATION, + ALERT_REASON, + ALERT_STATUS, +} from '@kbn/rule-data-utils/technical_field_names'; import { ColumnHeaderOptions } from '../../../../../common'; import { defaultColumnHeaderType } from '../../../../timelines/components/timeline/body/column_headers/default_headers'; @@ -48,6 +52,6 @@ export const columns: Array< { columnHeaderType: defaultColumnHeaderType, displayAsText: i18n.ALERTS_HEADERS_REASON, - id: 'signal.reason', + id: ALERT_REASON, }, ]; diff --git a/x-pack/plugins/security_solution/public/detections/configurations/examples/observablity_alerts/render_cell_value.tsx b/x-pack/plugins/security_solution/public/detections/configurations/examples/observablity_alerts/render_cell_value.tsx index 1b8c6fdf6487c..c718d0e642c65 100644 --- a/x-pack/plugins/security_solution/public/detections/configurations/examples/observablity_alerts/render_cell_value.tsx +++ b/x-pack/plugins/security_solution/public/detections/configurations/examples/observablity_alerts/render_cell_value.tsx @@ -9,7 +9,12 @@ import moment from 'moment'; import React from 'react'; import { EuiDataGridCellValueElementProps, EuiLink } from '@elastic/eui'; -import { ALERT_DURATION, ALERT_STATUS } from '@kbn/rule-data-utils/technical_field_names'; +import { + ALERT_DURATION, + ALERT_REASON, + ALERT_RULE_SEVERITY, + ALERT_STATUS, +} from '@kbn/rule-data-utils/technical_field_names'; import { TruncatableText } from '../../../../common/components/truncatable_text'; import { Severity } from '../../../components/severity'; @@ -53,9 +58,12 @@ export const RenderCellValue: React.FC ); case ALERT_DURATION: + case 'signal.duration.us': return {moment().fromNow(true)}; + case ALERT_RULE_SEVERITY: case 'signal.rule.severity': return ; + case ALERT_REASON: case 'signal.reason': return ( diff --git a/x-pack/plugins/security_solution/public/detections/configurations/examples/security_solution_rac/render_cell_value.tsx b/x-pack/plugins/security_solution/public/detections/configurations/examples/security_solution_rac/render_cell_value.tsx index 6475ef5bef970..61a5225cdae8c 100644 --- a/x-pack/plugins/security_solution/public/detections/configurations/examples/security_solution_rac/render_cell_value.tsx +++ b/x-pack/plugins/security_solution/public/detections/configurations/examples/security_solution_rac/render_cell_value.tsx @@ -6,6 +6,7 @@ */ import { EuiDataGridCellValueElementProps } from '@elastic/eui'; +import { ALERT_RULE_SEVERITY, ALERT_REASON } from '@kbn/rule-data-utils'; import React from 'react'; import { DefaultDraggable } from '../../../../common/components/draggables'; @@ -46,6 +47,7 @@ export const RenderCellValue: React.FC ); case 'signal.reason': + case ALERT_REASON: return {reason}; default: return ( diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_rule_with_fallback.tsx b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_rule_with_fallback.tsx index 7f1c70576d870..8c8736b03b229 100644 --- a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_rule_with_fallback.tsx +++ b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_rule_with_fallback.tsx @@ -6,8 +6,10 @@ */ import { useCallback, useEffect, useMemo } from 'react'; -import { isNotFoundError } from '@kbn/securitysolution-t-grid'; +import { ALERT_RULE_UUID } from '@kbn/rule-data-utils'; import { useAsync, withOptionalSignal } from '@kbn/securitysolution-hook-utils'; +import { isNotFoundError } from '@kbn/securitysolution-t-grid'; + import { useAppToasts } from '../../../../common/hooks/use_app_toasts'; import { useQueryAlerts } from '../alerts/use_query'; import { fetchRuleById } from './api'; @@ -46,7 +48,17 @@ const useFetchRule = () => useAsync(fetchWithOptionslSignal); const buildLastAlertQuery = (ruleId: string) => ({ query: { bool: { - filter: [{ match: { 'signal.rule.id': ruleId } }], + filter: [ + { + bool: { + should: [ + { match: { 'signal.rule.id': ruleId } }, + { match: { [ALERT_RULE_UUID]: ruleId } }, + ], + minimum_should_match: 1, + }, + }, + ], }, }, size: 1, diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/columns.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/columns.tsx index c00a96b414778..0c500ee805a8f 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/columns.tsx +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/columns.tsx @@ -9,12 +9,12 @@ import { EuiBasicTableColumn, EuiTableActionsColumnType, EuiText, - EuiHealth, EuiToolTip, EuiIcon, EuiLink, + EuiBadge, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import * as H from 'history'; import { sum } from 'lodash'; import React, { Dispatch } from 'react'; @@ -25,9 +25,10 @@ import { getEmptyTagValue } from '../../../../../common/components/empty_value'; import { FormattedRelativePreferenceDate } from '../../../../../common/components/formatted_date'; import { getRuleDetailsUrl } from '../../../../../common/components/link_to/redirect_to_detection_engine'; import { ActionToaster } from '../../../../../common/components/toasters'; -import { getStatusColor } from '../../../../components/rules/rule_status/helpers'; +import { PopoverItems } from '../../../../../common/components/popover_items'; import { RuleSwitch } from '../../../../components/rules/rule_switch'; import { SeverityBadge } from '../../../../components/rules/severity_badge'; +import { RuleExecutionStatusBadge } from '../../../../components/rules/rule_execution_status_badge'; import * as i18n from '../translations'; import { deleteRulesAction, @@ -39,8 +40,7 @@ import { RulesTableAction } from '../../../../containers/detection_engine/rules/ import { LinkAnchor } from '../../../../../common/components/links'; import { getToolTipContent, canEditRuleWithActions } from '../../../../../common/utils/privileges'; import { PopoverTooltip } from './popover_tooltip'; -import { TagsDisplay } from './tag_display'; -import { getRuleStatusText } from '../../../../../../common/detection_engine/utils'; + import { APP_UI_ID, SecurityPageName, @@ -163,22 +163,53 @@ export const getColumns = ({ field: 'name', name: i18n.COLUMN_RULE, render: (value: Rule['name'], item: Rule) => ( - void }) => { - ev.preventDefault(); - navigateToApp(APP_UI_ID, { - deepLinkId: SecurityPageName.rules, - path: getRuleDetailsUrl(item.id), - }); - }} - href={formatUrl(getRuleDetailsUrl(item.id))} - > - {value} - + + void }) => { + ev.preventDefault(); + navigateToApp(APP_UI_ID, { + deepLinkId: SecurityPageName.rules, + path: getRuleDetailsUrl(item.id), + }); + }} + href={formatUrl(getRuleDetailsUrl(item.id))} + > + {value} + + ), - width: '20%', + width: '38%', sortable: true, + truncateText: true, + }, + { + field: 'tags', + name: null, + align: 'center', + render: (tags: Rule['tags']) => { + if (tags.length === 0) { + return getEmptyTagValue(); + } + + const renderItem = (tag: string, i: number) => ( + + {tag} + + ); + return ( + + ); + }, + width: '65px', + truncateText: true, }, { field: 'risk_score', @@ -188,13 +219,15 @@ export const getColumns = ({ {value} ), - width: '10%', + width: '85px', + truncateText: true, }, { field: 'severity', name: i18n.COLUMN_SEVERITY, render: (value: Rule['severity']) => , width: '12%', + truncateText: true, }, { field: 'status_date', @@ -211,21 +244,15 @@ export const getColumns = ({ /> ); }, - width: '14%', + width: '16%', + truncateText: true, }, { field: 'status', name: i18n.COLUMN_LAST_RESPONSE, - render: (value: Rule['status']) => { - return ( - <> - - {getRuleStatusText(value) ?? getEmptyTagValue()} - - - ); - }, - width: '12%', + render: (value: Rule['status']) => , + width: '16%', + truncateText: true, }, { field: 'updated_at', @@ -243,7 +270,8 @@ export const getColumns = ({ ); }, sortable: true, - width: '14%', + width: '18%', + truncateText: true, }, { field: 'version', @@ -257,18 +285,8 @@ export const getColumns = ({ ); }, - width: '8%', - }, - { - field: 'tags', - name: i18n.COLUMN_TAGS, - render: (value: Rule['tags']) => { - if (value.length > 0) { - return ; - } - return getEmptyTagValue(); - }, - width: '20%', + width: '65px', + truncateText: true, }, { align: 'center', @@ -295,6 +313,7 @@ export const getColumns = ({ ), sortable: true, width: '95px', + truncateText: true, }, ]; const actions: RulesColumns[] = [ @@ -326,34 +345,33 @@ export const getMonitoringColumns = ( name: i18n.COLUMN_RULE, render: (value: RuleStatus['current_status']['status'], item: RuleStatusRowItemType) => { return ( - void }) => { - ev.preventDefault(); - navigateToApp(APP_UI_ID, { - deepLinkId: SecurityPageName.rules, - path: getRuleDetailsUrl(item.id), - }); - }} - href={formatUrl(getRuleDetailsUrl(item.id))} - > - {/* Temporary fix if on upgrade a rule has a status of 'partial failure' we want to display that text as 'warning' */} - {/* On the next subsequent rule run, that 'partial failure' status will be re-written as a 'warning' status */} - {/* and this code will no longer be necessary */} - {/* TODO: remove this code in 8.0.0 */} - {value === 'partial failure' ? 'warning' : value} - + + void }) => { + ev.preventDefault(); + navigateToApp(APP_UI_ID, { + deepLinkId: SecurityPageName.rules, + path: getRuleDetailsUrl(item.id), + }); + }} + href={formatUrl(getRuleDetailsUrl(item.id))} + > + {value} + + ); }, - width: '24%', + width: '28%', + truncateText: true, }, { field: 'current_status.bulk_create_time_durations', name: ( <> - {i18n.COLUMN_INDEXING_TIMES}{' '} + {i18n.COLUMN_INDEXING_TIMES} - + ), @@ -363,14 +381,15 @@ export const getMonitoringColumns = ( ), width: '14%', + truncateText: true, }, { field: 'current_status.search_after_time_durations', name: ( <> - {i18n.COLUMN_QUERY_TIMES}{' '} + {i18n.COLUMN_QUERY_TIMES} - + ), @@ -380,6 +399,7 @@ export const getMonitoringColumns = ( ), width: '14%', + truncateText: true, }, { field: 'current_status.gap', @@ -411,6 +431,16 @@ export const getMonitoringColumns = ( ), width: '14%', + truncateText: true, + }, + { + field: 'current_status.status', + name: i18n.COLUMN_LAST_RESPONSE, + render: (value: RuleStatus['current_status']['status']) => ( + + ), + width: '12%', + truncateText: true, }, { field: 'current_status.status_date', @@ -427,21 +457,8 @@ export const getMonitoringColumns = ( /> ); }, - width: '20%', - }, - { - field: 'current_status.status', - name: i18n.COLUMN_LAST_RESPONSE, - render: (value: RuleStatus['current_status']['status']) => { - return ( - <> - - {getRuleStatusText(value) ?? getEmptyTagValue()} - - - ); - }, - width: '16%', + width: '18%', + truncateText: true, }, { field: 'activate', diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/exceptions/columns.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/exceptions/columns.tsx index 3ba5db820544f..17eafecbae34f 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/exceptions/columns.tsx +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/exceptions/columns.tsx @@ -11,15 +11,18 @@ import { EuiButtonIcon, EuiBasicTableColumn, EuiToolTip } from '@elastic/eui'; import type { NamespaceType } from '@kbn/securitysolution-io-ts-list-types'; import { DEFAULT_RELATIVE_DATE_THRESHOLD } from '../../../../../../../common/constants'; import { FormatUrl } from '../../../../../../common/components/link_to'; +import { PopoverItems } from '../../../../../../common/components/popover_items'; import { FormattedRelativePreferenceDate } from '../../../../../../common/components/formatted_date'; - +import { getRuleDetailsUrl } from '../../../../../../common/components/link_to/redirect_to_detection_engine'; +import { LinkAnchor } from '../../../../../../common/components/links'; import * as i18n from './translations'; import { ExceptionListInfo } from './use_all_exception_lists'; -import { ExceptionOverflowDisplay } from './exceptions_overflow_display'; import { ExceptionsTableItem } from './types'; export type AllExceptionListsColumns = EuiBasicTableColumn; +const RULES_TO_DISPLAY = 1; + export const getAllExceptionListsColumns = ( onExport: (arg: { id: string; listId: string; namespaceType: NamespaceType }) => () => void, onDelete: (arg: { id: string; listId: string; namespaceType: NamespaceType }) => () => void, @@ -32,10 +35,10 @@ export const getAllExceptionListsColumns = ( name: i18n.EXCEPTION_LIST_ID_TITLE, truncateText: true, dataType: 'string', - width: '15%', + width: '20%', render: (value: ExceptionListInfo['list_id']) => ( - -

{value}

+ + {value} ), }, @@ -45,37 +48,57 @@ export const getAllExceptionListsColumns = ( name: i18n.EXCEPTION_LIST_NAME, truncateText: true, dataType: 'string', - width: '10%', + width: '20%', render: (value: ExceptionListInfo['name']) => ( - -

{value}

+ + {value} ), }, { - align: 'center', - field: 'rules', - name: i18n.NUMBER_RULES_ASSIGNED_TO_TITLE, - truncateText: true, - dataType: 'number', - width: '10%', - render: (value: ExceptionListInfo['rules']) => { - return

{value.length}

; - }, - }, - { - align: 'left', field: 'rules', name: i18n.RULES_ASSIGNED_TO_TITLE, - truncateText: true, dataType: 'string', - width: '20%', - render: (value: ExceptionListInfo['rules']) => { + width: '30%', + render: (rules: ExceptionListInfo['rules']) => { + const renderItem = ( + { id, name }: T, + index: number, + items: T[] + ) => { + const ruleHref = formatUrl(getRuleDetailsUrl(id)); + const isSeparator = index !== items.length - 1; + return ( + <> + + <> + void }) => { + ev.preventDefault(); + navigateToUrl(ruleHref); + }} + href={ruleHref} + > + {name} + {isSeparator && ','} + + + + {isSeparator && ' '} + + ); + }; + return ( - ); }, @@ -86,7 +109,7 @@ export const getAllExceptionListsColumns = ( name: i18n.LIST_DATE_CREATED_TITLE, truncateText: true, dataType: 'date', - width: '14%', + width: '15%', render: (value: ExceptionListInfo['created_at']) => ( ( ( - - ), - }, - { - align: 'center', - width: '25px', - isExpander: false, - render: ({ id, list_id: listId, namespace_type: namespaceType }: ExceptionListInfo) => ( - - ), + align: 'left', + width: '76px', + name: i18n.EXCEPTION_LIST_ACTIONS, + actions: [ + { + render: ({ id, list_id: listId, namespace_type: namespaceType }: ExceptionListInfo) => ( + + ), + }, + { + render: ({ id, list_id: listId, namespace_type: namespaceType }: ExceptionListInfo) => ( + + ), + }, + ], }, ]; diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/exceptions/exceptions_overflow_display.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/exceptions/exceptions_overflow_display.tsx deleted file mode 100644 index d3219cc86d0e7..0000000000000 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/exceptions/exceptions_overflow_display.tsx +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React, { useState } from 'react'; -import { EuiPopover, EuiBadgeGroup, EuiButton } from '@elastic/eui'; -import styled from 'styled-components'; -import * as i18n from '../../translations'; -import { Spacer } from '../../../../../../common/components/page'; -import { LinkAnchor } from '../../../../../../common/components/links'; -import { getRuleDetailsUrl } from '../../../../../../common/components/link_to/redirect_to_detection_engine'; -import { Rule } from '../../../../../containers/detection_engine/rules'; -import { FormatUrl } from '../../../../../../common/components/link_to'; - -interface ExceptionOverflowDisplayProps { - rules: Rule[]; - navigateToUrl: (url: string) => Promise; - formatUrl: FormatUrl; -} - -interface OverflowListComponentProps { - rule: Rule; - index: number; -} - -const ExceptionOverflowWrapper = styled(EuiBadgeGroup)` - .euiBadgeGroup__item { - display: block; - width: 100%; - } -`; - -const ExceptionOverflowPopoverWrapper = styled(EuiBadgeGroup)` - max-height: 200px; - max-width: 600px; - overflow: auto; -`; - -const ExceptionOverflowPopoverButton = styled(EuiButton)` - font-size: ${({ theme }) => theme.eui.euiFontSizeXS} - font-weight: 500; - height: 20px; -`; - -/** - * @param rules to display for filtering - */ -const ExceptionOverflowDisplayComponent = ({ - rules, - navigateToUrl, - formatUrl, -}: ExceptionOverflowDisplayProps) => { - const [isExceptionOverflowPopoverOpen, setIsExceptionOverflowPopoverOpen] = useState(false); - - const OverflowListComponent = ({ rule: { id, name }, index }: OverflowListComponentProps) => { - return ( - - void }) => { - ev.preventDefault(); - navigateToUrl(formatUrl(getRuleDetailsUrl(id))); - }} - href={formatUrl(getRuleDetailsUrl(id))} - > - {name} - - {index !== rules.length - 1 ? ', ' : ''} - - ); - }; - - return ( - <> - {rules.length <= 2 ? ( - - {rules.map((rule, index: number) => ( - - ))} - - ) : ( - - {rules.slice(0, 2).map((rule, index: number) => ( - - ))} - - setIsExceptionOverflowPopoverOpen(!isExceptionOverflowPopoverOpen)} - > - {i18n.COLUMN_SEE_ALL_POPOVER} - - } - isOpen={isExceptionOverflowPopoverOpen} - closePopover={() => setIsExceptionOverflowPopoverOpen(!isExceptionOverflowPopoverOpen)} - repositionOnScroll - > - - {rules.map((rule, index: number) => ( - - ))} - - - - )} - - ); -}; - -export const ExceptionOverflowDisplay = React.memo(ExceptionOverflowDisplayComponent); - -ExceptionOverflowDisplay.displayName = 'ExceptionOverflowDisplay'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/exceptions/exceptions_table.test.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/exceptions/exceptions_table.test.tsx index a3f1c8406b055..71ffc1076a227 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/exceptions/exceptions_table.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/exceptions/exceptions_table.test.tsx @@ -27,8 +27,8 @@ jest.mock('react-router-dom', () => { useHistory: jest.fn(), }; }); -jest.mock('@kbn/i18n/react', () => { - const originalModule = jest.requireActual('@kbn/i18n/react'); +jest.mock('@kbn/i18n-react', () => { + const originalModule = jest.requireActual('@kbn/i18n-react'); const FormattedRelative = jest.fn().mockImplementation(() => '20 hours ago'); return { diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/exceptions/translations.ts b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/exceptions/translations.ts index 912f5bec4de35..df110d1d6ec3d 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/exceptions/translations.ts +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/exceptions/translations.ts @@ -21,6 +21,13 @@ export const EXCEPTION_LIST_NAME = i18n.translate( } ); +export const EXCEPTION_LIST_ACTIONS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.all.exceptions.actionsTitle', + { + defaultMessage: 'Actions', + } +); + export const NUMBER_RULES_ASSIGNED_TO_TITLE = i18n.translate( 'xpack.securitySolution.detectionEngine.rules.all.exceptions.numberRulesAssignedTitle', { @@ -35,6 +42,12 @@ export const RULES_ASSIGNED_TO_TITLE = i18n.translate( } ); +export const showMoreRules = (rulesCount: number) => + i18n.translate('xpack.securitySolution.detectionEngine.rules.all.exceptions.rulesPopoverButton', { + defaultMessage: '+{rulesCount} {rulesCount, plural, =1 {Rule} other {Rules}}', + values: { rulesCount }, + }); + export const LIST_DATE_CREATED_TITLE = i18n.translate( 'xpack.securitySolution.detectionEngine.rules.all.exceptions.dateCreatedTitle', { diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/tag_display.test.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/tag_display.test.tsx deleted file mode 100644 index a920491d97b38..0000000000000 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/tag_display.test.tsx +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; -import { mount, ReactWrapper } from 'enzyme'; - -import { TagsDisplay } from './tag_display'; -import { TestProviders } from '../../../../../common/mock'; -import { waitFor } from '@testing-library/react'; - -const mockTags = ['Elastic', 'Endpoint', 'Data Protection', 'ML', 'Continuous Monitoring']; - -describe('When tag display loads', () => { - let wrapper: ReactWrapper; - beforeEach(() => { - wrapper = mount( - - - - ); - }); - it('visibly renders 3 initial tags', () => { - for (let i = 0; i < 3; i++) { - expect(wrapper.exists(`[data-test-subj="rules-table-column-tags-${i}"]`)).toBeTruthy(); - } - }); - describe("when the 'see all' button is clicked", () => { - beforeEach(() => { - const seeAllButton = wrapper.find('[data-test-subj="tags-display-popover-button"] button'); - seeAllButton.simulate('click'); - }); - it('renders all the tags in the popover', async () => { - await waitFor(() => { - wrapper.update(); - expect(wrapper.exists('[data-test-subj="tags-display-popover"]')).toBeTruthy(); - for (let i = 0; i < mockTags.length; i++) { - expect( - wrapper.exists(`[data-test-subj="rules-table-column-popover-tags-${i}"]`) - ).toBeTruthy(); - } - }); - }); - }); -}); diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/tag_display.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/tag_display.tsx deleted file mode 100644 index 922fd547ed53c..0000000000000 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/tag_display.tsx +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React, { useMemo, useState } from 'react'; -import { EuiPopover, EuiBadgeGroup, EuiBadge, EuiButtonEmpty } from '@elastic/eui'; -import styled from 'styled-components'; -import * as i18n from '../translations'; -import { caseInsensitiveSort } from './helpers'; - -interface TagsDisplayProps { - tags: string[]; -} - -const TagWrapper = styled(EuiBadgeGroup)` - width: 100%; -`; - -const TagPopoverWrapper = styled(EuiBadgeGroup)` - max-height: 200px; - max-width: 600px; - overflow: auto; -`; - -const TagPopoverButton = styled(EuiButtonEmpty)` - font-size: ${({ theme }) => theme.eui.euiFontSizeXS} - font-weight: 500; - height: 20px; -`; - -/** - * @param tags to display for filtering - */ -const TagsDisplayComponent = ({ tags }: TagsDisplayProps) => { - const [isTagPopoverOpen, setIsTagPopoverOpen] = useState(false); - const sortedTags = useMemo(() => caseInsensitiveSort(tags), [tags]); - - return ( - <> - {sortedTags.length <= 3 ? ( - - {sortedTags.map((tag: string, i: number) => ( - - {tag} - - ))} - - ) : ( - - {sortedTags.slice(0, 3).map((tag: string, i: number) => ( - - {tag} - - ))} - - setIsTagPopoverOpen(!isTagPopoverOpen)} - > - {i18n.COLUMN_SEE_ALL_POPOVER} - - } - isOpen={isTagPopoverOpen} - closePopover={() => setIsTagPopoverOpen(!isTagPopoverOpen)} - repositionOnScroll - > - - {sortedTags.map((tag: string, i: number) => ( - - {tag} - - ))} - - - - )} - - ); -}; - -export const TagsDisplay = React.memo(TagsDisplayComponent); - -TagsDisplay.displayName = 'TagsDisplay'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/details/index.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/details/index.tsx index 9f56467043dd2..98ed33c647b2e 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/details/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/details/index.tsx @@ -21,7 +21,7 @@ import { } from '@elastic/eui'; import { i18n as i18nTranslate } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { noop } from 'lodash/fp'; import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { useParams } from 'react-router-dom'; diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/edit/index.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/edit/index.tsx index 784290ad80d47..89f1cd7b26144 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/edit/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/edit/index.tsx @@ -14,7 +14,7 @@ import { EuiTabbedContent, EuiTabbedContentTab, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { FC, memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { useParams } from 'react-router-dom'; diff --git a/x-pack/plugins/security_solution/public/hosts/pages/navigation/events_query_tab_body.tsx b/x-pack/plugins/security_solution/public/hosts/pages/navigation/events_query_tab_body.tsx index b96ffcbefc652..a4889183cdf3d 100644 --- a/x-pack/plugins/security_solution/public/hosts/pages/navigation/events_query_tab_body.tsx +++ b/x-pack/plugins/security_solution/public/hosts/pages/navigation/events_query_tab_body.tsx @@ -70,7 +70,7 @@ const EventsQueryTabBodyComponent: React.FC = ({ }) => { const dispatch = useDispatch(); const { globalFullScreen } = useGlobalFullScreen(); - const ACTION_BUTTON_COUNT = 3; + const ACTION_BUTTON_COUNT = 4; const tGridEnabled = useIsExperimentalFeatureEnabled('tGridEnabled'); useEffect(() => { diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_card_grid/components/grid_header.tsx b/x-pack/plugins/security_solution/public/management/components/artifact_card_grid/components/grid_header.tsx index fb198e86fc386..6146df8fd05b6 100644 --- a/x-pack/plugins/security_solution/public/management/components/artifact_card_grid/components/grid_header.tsx +++ b/x-pack/plugins/security_solution/public/management/components/artifact_card_grid/components/grid_header.tsx @@ -7,7 +7,7 @@ import React, { memo, useMemo } from 'react'; import { CommonProps, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import styled from 'styled-components'; import { CardCompressedHeaderLayout, CardSectionPanel } from '../../artifact_entry_card'; import { useTestIdGenerator } from '../../hooks/use_test_id_generator'; diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/effect_scope.tsx b/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/effect_scope.tsx index 802548f20507f..f0e82dcfdf309 100644 --- a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/effect_scope.tsx +++ b/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/effect_scope.tsx @@ -8,7 +8,7 @@ import React, { memo, PropsWithChildren, useMemo } from 'react'; import { CommonProps, EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiIcon } from '@elastic/eui'; import styled from 'styled-components'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { GLOBAL_EFFECT_SCOPE, POLICY_EFFECT_SCOPE, diff --git a/x-pack/plugins/security_solution/public/management/components/back_to_external_app_button/back_to_external_app_button.tsx b/x-pack/plugins/security_solution/public/management/components/back_to_external_app_button/back_to_external_app_button.tsx index 47242ed7d1edc..34bd3634890c3 100644 --- a/x-pack/plugins/security_solution/public/management/components/back_to_external_app_button/back_to_external_app_button.tsx +++ b/x-pack/plugins/security_solution/public/management/components/back_to_external_app_button/back_to_external_app_button.tsx @@ -6,7 +6,7 @@ */ import React, { memo } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { CommonProps, EuiButtonEmpty } from '@elastic/eui'; import styled from 'styled-components'; diff --git a/x-pack/plugins/security_solution/public/management/components/effected_policy_select/effected_policy_select.tsx b/x-pack/plugins/security_solution/public/management/components/effected_policy_select/effected_policy_select.tsx index 2249fc89430d2..0fa77511ea9fe 100644 --- a/x-pack/plugins/security_solution/public/management/components/effected_policy_select/effected_policy_select.tsx +++ b/x-pack/plugins/security_solution/public/management/components/effected_policy_select/effected_policy_select.tsx @@ -21,7 +21,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { EuiSelectableOption } from '@elastic/eui/src/components/selectable/selectable_option'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import styled from 'styled-components'; import { PolicyData } from '../../../../common/endpoint/types'; import { LinkToApp } from '../../../common/components/endpoint/link_to_app'; diff --git a/x-pack/plugins/security_solution/public/management/components/management_empty_state.tsx b/x-pack/plugins/security_solution/public/management/components/management_empty_state.tsx index 33e2980dcc112..a2dc37dff625b 100644 --- a/x-pack/plugins/security_solution/public/management/components/management_empty_state.tsx +++ b/x-pack/plugins/security_solution/public/management/components/management_empty_state.tsx @@ -22,7 +22,7 @@ import { EuiLink, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import onboardingLogo from '../images/security_administration_onboarding.svg'; import { useKibana } from '../../common/lib/kibana'; diff --git a/x-pack/plugins/security_solution/public/management/components/paginated_content/paginated_content.tsx b/x-pack/plugins/security_solution/public/management/components/paginated_content/paginated_content.tsx index b01dc15a06443..c29eee5221043 100644 --- a/x-pack/plugins/security_solution/public/management/components/paginated_content/paginated_content.tsx +++ b/x-pack/plugins/security_solution/public/management/components/paginated_content/paginated_content.tsx @@ -30,7 +30,7 @@ import { Pagination, } from '@elastic/eui'; import styled from 'styled-components'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { v4 as generateUUI } from 'uuid'; import { useTestIdGenerator } from '../hooks/use_test_id_generator'; import { MaybeImmutable } from '../../../../common/endpoint/types'; diff --git a/x-pack/plugins/security_solution/public/management/components/policies_selector/policies_selector.test.tsx b/x-pack/plugins/security_solution/public/management/components/policies_selector/policies_selector.test.tsx index 12a0e461863e8..ceaf591ead993 100644 --- a/x-pack/plugins/security_solution/public/management/components/policies_selector/policies_selector.test.tsx +++ b/x-pack/plugins/security_solution/public/management/components/policies_selector/policies_selector.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { render, RenderResult } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; diff --git a/x-pack/plugins/security_solution/public/management/components/policies_selector/policies_selector.tsx b/x-pack/plugins/security_solution/public/management/components/policies_selector/policies_selector.tsx index 556be843d050f..02357f63b4f9a 100644 --- a/x-pack/plugins/security_solution/public/management/components/policies_selector/policies_selector.tsx +++ b/x-pack/plugins/security_solution/public/management/components/policies_selector/policies_selector.tsx @@ -20,7 +20,7 @@ import { FilterChecked, EuiText, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ImmutableArray, PolicyData } from '../../../../common/endpoint/types'; import { useIsExperimentalFeatureEnabled } from '../../../common/hooks/use_experimental_features'; diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/mocks.ts b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/mocks.ts index c724773593f53..781c332430c0f 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/mocks.ts +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/mocks.ts @@ -14,8 +14,8 @@ import { ActivityLog, HostInfo, HostPolicyResponse, - HostResultList, HostStatus, + MetadataListResponse, } from '../../../../common/endpoint/types'; import { EndpointDocGenerator } from '../../../../common/endpoint/generate_data'; import { FleetActionGenerator } from '../../../../common/endpoint/data_generators/fleet_action_generator'; @@ -43,7 +43,7 @@ import { } from '../mocks'; type EndpointMetadataHttpMocksInterface = ResponseProvidersInterface<{ - metadataList: () => HostResultList; + metadataList: () => MetadataListResponse; metadataDetails: () => HostInfo; }>; export const endpointMetadataHttpMocks = httpHandlerMockFactory( @@ -72,6 +72,30 @@ export const endpointMetadataHttpMocks = httpHandlerMockFactory { + const generator = new EndpointDocGenerator('seed'); + + return { + data: Array.from({ length: 10 }, () => { + const endpoint = { + metadata: generator.generateHostMetadata(), + host_status: HostStatus.UNHEALTHY, + }; + + generator.updateCommonInfo(); + + return endpoint; + }), + total: 10, + page: 0, + pageSize: 10, + }; + }, + }, { id: 'metadataDetails', path: HOST_METADATA_GET_ROUTE, diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts index c838f0bee7c69..078507989505f 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts @@ -9,11 +9,11 @@ import { Action } from 'redux'; import { EuiSuperDatePickerRecentRange } from '@elastic/eui'; import type { DataViewBase } from '@kbn/es-query'; import { - HostResultList, HostInfo, GetHostPolicyResponse, HostIsolationRequestBody, ISOLATION_ACTIONS, + MetadataListResponse, } from '../../../../../common/endpoint/types'; import { ServerApiError } from '../../../../common/types'; import { GetPolicyListResponse } from '../../policy/types'; @@ -21,7 +21,7 @@ import { EndpointState } from '../types'; export interface ServerReturnedEndpointList { type: 'serverReturnedEndpointList'; - payload: HostResultList; + payload: MetadataListResponse; } export interface ServerFailedToReturnEndpointList { diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/endpoint_pagination.test.ts b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/endpoint_pagination.test.ts index dcfd5c86d11d8..214fc220e04fb 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/endpoint_pagination.test.ts +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/endpoint_pagination.test.ts @@ -11,7 +11,7 @@ import { applyMiddleware, Store, createStore } from 'redux'; import { coreMock } from '../../../../../../../../src/core/public/mocks'; -import { HostResultList, AppLocation } from '../../../../../common/endpoint/types'; +import { AppLocation, MetadataListResponse } from '../../../../../common/endpoint/types'; import { DepsStartMock, depsStartMock } from '../../../../common/mock/endpoint'; import { endpointMiddlewareFactory } from './middleware'; @@ -19,13 +19,17 @@ import { endpointMiddlewareFactory } from './middleware'; import { endpointListReducer } from './reducer'; import { uiQueryParams } from './selectors'; -import { mockEndpointResultList } from './mock_endpoint_result_list'; +import { + mockEndpointResultList, + setEndpointListApiMockImplementation, +} from './mock_endpoint_result_list'; import { EndpointState, EndpointIndexUIQueryParams } from '../types'; import { MiddlewareActionSpyHelper, createSpyMiddleware, } from '../../../../common/store/test_utils'; import { getEndpointListPath } from '../../../common/routing'; +import { HOST_METADATA_LIST_ROUTE } from '../../../../../common/endpoint/constants'; jest.mock('../../policy/store/services/ingest', () => ({ sendGetAgentPolicyList: () => Promise.resolve({ items: [] }), @@ -40,8 +44,8 @@ describe('endpoint list pagination: ', () => { let queryParams: () => EndpointIndexUIQueryParams; let waitForAction: MiddlewareActionSpyHelper['waitForAction']; let actionSpyMiddleware; - const getEndpointListApiResponse = (): HostResultList => { - return mockEndpointResultList({ request_page_size: 1, request_page_index: 1, total: 10 }); + const getEndpointListApiResponse = (): MetadataListResponse => { + return mockEndpointResultList({ pageSize: 1, page: 0, total: 10 }); }; let historyPush: (params: EndpointIndexUIQueryParams) => void; @@ -63,13 +67,15 @@ describe('endpoint list pagination: ', () => { historyPush = (nextQueryParams: EndpointIndexUIQueryParams): void => { return history.push(getEndpointListPath({ name: 'endpointList', ...nextQueryParams })); }; + + setEndpointListApiMockImplementation(fakeHttpServices); }); describe('when the user enteres the endpoint list for the first time', () => { it('the api is called with page_index and page_size defaulting to 0 and 10 respectively', async () => { const apiResponse = getEndpointListApiResponse(); - fakeHttpServices.post.mockResolvedValue(apiResponse); - expect(fakeHttpServices.post).not.toHaveBeenCalled(); + fakeHttpServices.get.mockResolvedValue(apiResponse); + expect(fakeHttpServices.get).not.toHaveBeenCalled(); store.dispatch({ type: 'userChangedUrl', @@ -79,11 +85,12 @@ describe('endpoint list pagination: ', () => { }, }); await waitForAction('serverReturnedEndpointList'); - expect(fakeHttpServices.post).toHaveBeenCalledWith('/api/endpoint/metadata', { - body: JSON.stringify({ - paging_properties: [{ page_index: '0' }, { page_size: '10' }], - filters: { kql: '' }, - }), + expect(fakeHttpServices.get).toHaveBeenCalledWith(HOST_METADATA_LIST_ROUTE, { + query: { + page: '0', + pageSize: '10', + kuery: '', + }, }); }); }); diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/index.test.ts b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/index.test.ts index 49ba88fd47717..4edbdef4d2894 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/index.test.ts +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/index.test.ts @@ -25,7 +25,7 @@ describe('EndpointList store concerns', () => { const loadDataToStore = () => { dispatch({ type: 'serverReturnedEndpointList', - payload: mockEndpointResultList({ request_page_size: 1, request_page_index: 1, total: 10 }), + payload: mockEndpointResultList({ pageSize: 1, page: 0, total: 10 }), }); }; @@ -101,8 +101,8 @@ describe('EndpointList store concerns', () => { test('it handles `serverReturnedEndpointList', () => { const payload = mockEndpointResultList({ - request_page_size: 1, - request_page_index: 1, + page: 0, + pageSize: 1, total: 10, }); dispatch({ @@ -111,9 +111,9 @@ describe('EndpointList store concerns', () => { }); const currentState = store.getState(); - expect(currentState.hosts).toEqual(payload.hosts); - expect(currentState.pageSize).toEqual(payload.request_page_size); - expect(currentState.pageIndex).toEqual(payload.request_page_index); + expect(currentState.hosts).toEqual(payload.data); + expect(currentState.pageSize).toEqual(payload.pageSize); + expect(currentState.pageIndex).toEqual(payload.page); expect(currentState.total).toEqual(payload.total); }); }); diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.test.ts b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.test.ts index 8405320198615..7fc80bffd7c04 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.test.ts +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.test.ts @@ -16,10 +16,10 @@ import { } from '../../../../common/store/test_utils'; import { Immutable, - HostResultList, HostIsolationResponse, ISOLATION_ACTIONS, ActivityLog, + MetadataListResponse, } from '../../../../../common/endpoint/types'; import { AppAction } from '../../../../common/store/actions'; import { mockEndpointResultList } from './mock_endpoint_result_list'; @@ -72,8 +72,8 @@ describe('endpoint list middleware', () => { let actionSpyMiddleware; let history: History; - const getEndpointListApiResponse = (): HostResultList => { - return mockEndpointResultList({ request_page_size: 1, request_page_index: 1, total: 10 }); + const getEndpointListApiResponse = (): MetadataListResponse => { + return mockEndpointResultList({ pageSize: 1, page: 0, total: 10 }); }; const dispatchUserChangedUrlToEndpointList = (locationOverrides: Partial = {}) => { @@ -105,25 +105,26 @@ describe('endpoint list middleware', () => { it('handles `userChangedUrl`', async () => { endpointPageHttpMock(fakeHttpServices); const apiResponse = getEndpointListApiResponse(); - fakeHttpServices.post.mockResolvedValue(apiResponse); - expect(fakeHttpServices.post).not.toHaveBeenCalled(); + fakeHttpServices.get.mockResolvedValue(apiResponse); + expect(fakeHttpServices.get).not.toHaveBeenCalled(); dispatchUserChangedUrlToEndpointList(); await waitForAction('serverReturnedEndpointList'); - expect(fakeHttpServices.post).toHaveBeenCalledWith('/api/endpoint/metadata', { - body: JSON.stringify({ - paging_properties: [{ page_index: '0' }, { page_size: '10' }], - filters: { kql: '' }, - }), + expect(fakeHttpServices.get).toHaveBeenNthCalledWith(1, HOST_METADATA_LIST_ROUTE, { + query: { + page: '0', + pageSize: '10', + kuery: '', + }, }); - expect(listData(getState())).toEqual(apiResponse.hosts); + expect(listData(getState())).toEqual(apiResponse.data); }); it('handles `appRequestedEndpointList`', async () => { endpointPageHttpMock(fakeHttpServices); const apiResponse = getEndpointListApiResponse(); - fakeHttpServices.post.mockResolvedValue(apiResponse); - expect(fakeHttpServices.post).not.toHaveBeenCalled(); + fakeHttpServices.get.mockResolvedValue(apiResponse); + expect(fakeHttpServices.get).not.toHaveBeenCalled(); // First change the URL dispatchUserChangedUrlToEndpointList(); @@ -144,13 +145,14 @@ describe('endpoint list middleware', () => { waitForAction('serverReturnedAgenstWithEndpointsTotal'), ]); - expect(fakeHttpServices.post).toHaveBeenCalledWith(HOST_METADATA_LIST_ROUTE, { - body: JSON.stringify({ - paging_properties: [{ page_index: '0' }, { page_size: '10' }], - filters: { kql: '' }, - }), + expect(fakeHttpServices.get).toHaveBeenNthCalledWith(1, HOST_METADATA_LIST_ROUTE, { + query: { + page: '0', + pageSize: '10', + kuery: '', + }, }); - expect(listData(getState())).toEqual(apiResponse.hosts); + expect(listData(getState())).toEqual(apiResponse.data); }); describe('handling of IsolateEndpointHost action', () => { @@ -242,7 +244,7 @@ describe('endpoint list middleware', () => { }); const endpointList = getEndpointListApiResponse(); - const agentId = endpointList.hosts[0].metadata.agent.id; + const agentId = endpointList.data[0].metadata.agent.id; const search = getEndpointDetailsPath({ name: 'endpointActivityLog', selected_endpoint: agentId, @@ -514,7 +516,7 @@ describe('endpoint list middleware', () => { }); const endpointList = getEndpointListApiResponse(); - const agentId = endpointList.hosts[0].metadata.agent.id; + const agentId = endpointList.data[0].metadata.agent.id; const search = getEndpointDetailsPath({ name: 'endpointDetails', selected_endpoint: agentId, diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts index 3f4afe8e4b108..d82518c303c6e 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts @@ -19,6 +19,7 @@ import { HostResultList, Immutable, ImmutableObject, + MetadataListResponse, } from '../../../../../common/endpoint/types'; import { GetPolicyListResponse } from '../../policy/types'; import { ImmutableMiddlewareAPI, ImmutableMiddlewareFactory } from '../../../../common/store'; @@ -246,10 +247,11 @@ const getAgentAndPoliciesForEndpointsList = async ( const endpointsTotal = async (http: HttpStart): Promise => { try { return ( - await http.post(HOST_METADATA_LIST_ROUTE, { - body: JSON.stringify({ - paging_properties: [{ page_index: 0 }, { page_size: 1 }], - }), + await http.get(HOST_METADATA_LIST_ROUTE, { + query: { + page: 0, + pageSize: 1, + }, }) ).total; } catch (error) { @@ -401,18 +403,18 @@ async function endpointDetailsListMiddleware({ const { getState, dispatch } = store; const { page_index: pageIndex, page_size: pageSize } = uiQueryParams(getState()); - let endpointResponse; + let endpointResponse: MetadataListResponse | undefined; try { const decodedQuery: Query = searchBarQuery(getState()); - endpointResponse = await coreStart.http.post(HOST_METADATA_LIST_ROUTE, { - body: JSON.stringify({ - paging_properties: [{ page_index: pageIndex }, { page_size: pageSize }], - filters: { kql: decodedQuery.query }, - }), + endpointResponse = await coreStart.http.get(HOST_METADATA_LIST_ROUTE, { + query: { + page: pageIndex, + pageSize, + kuery: decodedQuery.query as string, + }, }); - endpointResponse.request_page_index = Number(pageIndex); dispatch({ type: 'serverReturnedEndpointList', @@ -447,7 +449,7 @@ async function endpointDetailsListMiddleware({ }); } - dispatchIngestPolicies({ http: coreStart.http, hosts: endpointResponse.hosts, store }); + dispatchIngestPolicies({ http: coreStart.http, hosts: endpointResponse.data, store }); } catch (error) { dispatch({ type: 'serverFailedToReturnEndpointList', @@ -474,7 +476,7 @@ async function endpointDetailsListMiddleware({ } // No endpoints, so we should check to see if there are policies for onboarding - if (endpointResponse && endpointResponse.hosts.length === 0) { + if (endpointResponse && endpointResponse.data.length === 0) { const http = coreStart.http; // The original query to the list could have had an invalid param (ex. invalid page_size), @@ -611,18 +613,19 @@ async function endpointDetailsMiddleware({ if (listData(getState()).length === 0) { const { page_index: pageIndex, page_size: pageSize } = uiQueryParams(getState()); try { - const response = await coreStart.http.post(HOST_METADATA_LIST_ROUTE, { - body: JSON.stringify({ - paging_properties: [{ page_index: pageIndex }, { page_size: pageSize }], - }), + const response = await coreStart.http.get(HOST_METADATA_LIST_ROUTE, { + query: { + page: pageIndex, + pageSize, + }, }); - response.request_page_index = Number(pageIndex); + dispatch({ type: 'serverReturnedEndpointList', payload: response, }); - dispatchIngestPolicies({ http: coreStart.http, hosts: response.hosts, store }); + dispatchIngestPolicies({ http: coreStart.http, hosts: response.data, store }); } catch (error) { dispatch({ type: 'serverFailedToReturnEndpointList', diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/mock_endpoint_result_list.ts b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/mock_endpoint_result_list.ts index 2e3de427e6960..61eb5ad3c541d 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/mock_endpoint_result_list.ts +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/mock_endpoint_result_list.ts @@ -10,8 +10,8 @@ import { GetHostPolicyResponse, HostInfo, HostPolicyResponse, - HostResultList, HostStatus, + MetadataListResponse, PendingActionsResponse, } from '../../../../../common/endpoint/types'; import { EndpointDocGenerator } from '../../../../../common/endpoint/generate_data'; @@ -29,7 +29,10 @@ import { } from '../../../../../../fleet/common/types/rest_spec'; import { GetPolicyListResponse } from '../../policy/types'; import { pendingActionsResponseMock } from '../../../../common/lib/endpoint_pending_actions/mocks'; -import { ACTION_STATUS_ROUTE } from '../../../../../common/endpoint/constants'; +import { + ACTION_STATUS_ROUTE, + HOST_METADATA_LIST_ROUTE, +} from '../../../../../common/endpoint/constants'; import { METADATA_TRANSFORM_STATS_URL } from '../../../../../common/constants'; import { TransformStats, TransformStatsResponse } from '../types'; @@ -37,20 +40,16 @@ const generator = new EndpointDocGenerator('seed'); export const mockEndpointResultList: (options?: { total?: number; - request_page_size?: number; - request_page_index?: number; -}) => HostResultList = (options = {}) => { - const { - total = 1, - request_page_size: requestPageSize = 10, - request_page_index: requestPageIndex = 0, - } = options; + page?: number; + pageSize?: number; +}) => MetadataListResponse = (options = {}) => { + const { total = 1, page = 0, pageSize = 10 } = options; // Skip any that are before the page we're on - const numberToSkip = requestPageSize * requestPageIndex; + const numberToSkip = pageSize * page; // total - numberToSkip is the count of non-skipped ones, but return no more than a pageSize, and no less than 0 - const actualCountToReturn = Math.max(Math.min(total - numberToSkip, requestPageSize), 0); + const actualCountToReturn = Math.max(Math.min(total - numberToSkip, pageSize), 0); const hosts: HostInfo[] = []; for (let index = 0; index < actualCountToReturn; index++) { @@ -59,11 +58,11 @@ export const mockEndpointResultList: (options?: { host_status: HostStatus.UNHEALTHY, }); } - const mock: HostResultList = { - hosts, + const mock: MetadataListResponse = { + data: hosts, total, - request_page_size: requestPageSize, - request_page_index: requestPageIndex, + page, + pageSize, }; return mock; }; @@ -83,7 +82,7 @@ export const mockEndpointDetailsApiResult = (): HostInfo => { * API handlers for Host details based on a list of Host results. */ const endpointListApiPathHandlerMocks = ({ - endpointsResults = mockEndpointResultList({ total: 3 }).hosts, + endpointsResults = mockEndpointResultList({ total: 3 }).data, epmPackages = [generator.generateEpmPackage()], endpointPackagePolicies = [], policyResponse = generator.generatePolicyResponse(), @@ -92,7 +91,7 @@ const endpointListApiPathHandlerMocks = ({ transforms = [], }: { /** route handlers will be setup for each individual host in this array */ - endpointsResults?: HostResultList['hosts']; + endpointsResults?: MetadataListResponse['data']; epmPackages?: GetPackagesResponse['response']; endpointPackagePolicies?: GetPolicyListResponse['items']; policyResponse?: HostPolicyResponse; @@ -109,12 +108,12 @@ const endpointListApiPathHandlerMocks = ({ }, // endpoint list - '/api/endpoint/metadata': (): HostResultList => { + [HOST_METADATA_LIST_ROUTE]: (): MetadataListResponse => { return { - hosts: endpointsResults, - request_page_size: 10, - request_page_index: 0, + data: endpointsResults, total: endpointsResults?.length || 0, + page: 0, + pageSize: 10, }; }, @@ -173,7 +172,7 @@ const endpointListApiPathHandlerMocks = ({ if (endpointsResults) { endpointsResults.forEach((host) => { // @ts-expect-error - apiHandlers[`/api/endpoint/metadata/${host.metadata.agent.id}`] = () => host; + apiHandlers[`${HOST_METADATA_LIST_ROUTE}/${host.metadata.agent.id}`] = () => host; }); } @@ -192,34 +191,13 @@ export const setEndpointListApiMockImplementation: ( apiResponses?: Parameters[0] ) => void = ( mockedHttpService, - { endpointsResults = mockEndpointResultList({ total: 3 }).hosts, ...pathHandlersOptions } = {} + { endpointsResults = mockEndpointResultList({ total: 3 }).data, ...pathHandlersOptions } = {} ) => { const apiHandlers = endpointListApiPathHandlerMocks({ ...pathHandlersOptions, endpointsResults, }); - mockedHttpService.post - .mockImplementation(async (...args) => { - throw new Error(`un-expected call to http.post: ${args}`); - }) - // First time called, return list of endpoints - .mockImplementationOnce(async () => { - return apiHandlers['/api/endpoint/metadata'](); - }) - // Metadata is called a second time to get the full total of Endpoints regardless of filters. - .mockImplementationOnce(async () => { - return apiHandlers['/api/endpoint/metadata'](); - }); - - // If the endpoints list results is zero, then mock the third call to `/metadata` to return - // empty list - indicating there are no endpoints currently present on the system - if (!endpointsResults.length) { - mockedHttpService.post.mockImplementationOnce(async () => { - return apiHandlers['/api/endpoint/metadata'](); - }); - } - // Setup handling of GET requests mockedHttpService.get.mockImplementation(async (...args) => { const [path] = args; diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/reducer.ts b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/reducer.ts index d9407e310639e..60a93e10e4f7f 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/reducer.ts +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/reducer.ts @@ -95,20 +95,13 @@ const handleMetadataTransformStatsChanged: CaseReducer { if (action.type === 'serverReturnedEndpointList') { - const { - hosts, - total, - request_page_size: pageSize, - request_page_index: pageIndex, - policy_info: policyVersionInfo, - } = action.payload; + const { data, total, page, pageSize } = action.payload; return { ...state, - hosts, + hosts: data, total, + pageIndex: page, pageSize, - pageIndex, - policyVersionInfo, loading: false, error: undefined, }; diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/endpoint_agent_status.test.tsx b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/endpoint_agent_status.test.tsx index 164b69b3f8bb6..6b2bfc25d5c8a 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/endpoint_agent_status.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/endpoint_agent_status.test.tsx @@ -34,7 +34,7 @@ describe('When using the EndpointAgentStatus component', () => { (KibanaServices.get as jest.Mock).mockReturnValue(mockedContext.startServices); httpMocks = endpointPageHttpMock(mockedContext.coreStart.http); waitForAction = mockedContext.middlewareSpy.waitForAction; - endpointMeta = httpMocks.responseProvider.metadataList().hosts[0].metadata; + endpointMeta = httpMocks.responseProvider.metadataList().data[0].metadata; render = async (props: EndpointAgentStatusProps) => { renderResult = mockedContext.render(); return renderResult; diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/out_of_date.tsx b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/out_of_date.tsx index d65cfc0cd397b..4762fde0ec088 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/out_of_date.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/out_of_date.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiText, EuiIcon } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const OutOfDate = React.memo<{ style?: React.CSSProperties }>(({ style, ...otherProps }) => { return ( diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/actions_menu.tsx b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/actions_menu.tsx index 71060577e3a34..118a1a262b43e 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/actions_menu.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/actions_menu.tsx @@ -7,7 +7,7 @@ import React, { useState, useCallback, useMemo } from 'react'; import { EuiContextMenuPanel, EuiButton, EuiPopover } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useEndpointActionItems, useEndpointSelector } from '../../hooks'; import { detailsData } from '../../../store/selectors'; import { ContextMenuItemNavByRouter } from '../../../../../components/context_menu_with_router_support/context_menu_item_nav_by_router'; diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/endpoint_details.tsx b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/endpoint_details.tsx index 635a6ba6cf193..eafc76479b4f8 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/endpoint_details.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/endpoint_details.tsx @@ -13,7 +13,7 @@ import { EuiText, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { memo, useCallback, useEffect, useMemo } from 'react'; import { HostMetadata } from '../../../../../../common/endpoint/types'; import { PreferenceFormattedDateFromPrimitive } from '../../../../../common/components/formatted_date'; diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/endpoint_details_content.tsx b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/endpoint_details_content.tsx index 0d43c47b8cef9..d9fbbcb5ec252 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/endpoint_details_content.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/endpoint_details_content.tsx @@ -16,7 +16,7 @@ import { EuiHealth, } from '@elastic/eui'; import React, { memo, useMemo } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { isPolicyOutOfDate } from '../../utils'; import { HostInfo, HostMetadata, HostStatus } from '../../../../../../common/endpoint/types'; import { useEndpointSelector } from '../hooks'; diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/use_endpoint_action_items.tsx b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/use_endpoint_action_items.tsx index a766b9a23082a..7370cabd8e080 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/use_endpoint_action_items.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/use_endpoint_action_items.tsx @@ -6,7 +6,7 @@ */ import React, { useMemo } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { APP_UI_ID } from '../../../../../../common/constants'; import { pagePathGetters } from '../../../../../../../fleet/public'; import { getEndpointDetailsPath } from '../../../../common/routing'; diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.test.tsx b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.test.tsx index a71acd66650dc..d3e6605e59779 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.test.tsx @@ -52,14 +52,15 @@ import { } from '../../../../../common/constants'; import { TransformStats } from '../types'; import { + HOST_METADATA_LIST_ROUTE, metadataTransformPrefix, METADATA_UNITED_TRANSFORM, } from '../../../../../common/endpoint/constants'; // not sure why this can't be imported from '../../../../common/mock/formatted_relative'; // but sure enough it needs to be inline in this one file -jest.mock('@kbn/i18n/react', () => { - const originalModule = jest.requireActual('@kbn/i18n/react'); +jest.mock('@kbn/i18n-react', () => { + const originalModule = jest.requireActual('@kbn/i18n-react'); const FormattedRelative = jest.fn().mockImplementation(() => '20 hours ago'); return { @@ -170,6 +171,10 @@ describe('when on the endpoint list page', () => { }); it('should NOT display timeline', async () => { + setEndpointListApiMockImplementation(coreStart.http, { + endpointsResults: [], + }); + const renderResult = render(); const timelineFlyout = renderResult.queryByTestId('flyoutOverlay'); expect(timelineFlyout).toBeNull(); @@ -243,7 +248,7 @@ describe('when on the endpoint list page', () => { total: 4, }); setEndpointListApiMockImplementation(coreStart.http, { - endpointsResults: mockedEndpointListData.hosts, + endpointsResults: mockedEndpointListData.data, totalAgentsUsingEndpoint: 5, }); }); @@ -260,7 +265,7 @@ describe('when on the endpoint list page', () => { total: 5, }); setEndpointListApiMockImplementation(coreStart.http, { - endpointsResults: mockedEndpointListData.hosts, + endpointsResults: mockedEndpointListData.data, totalAgentsUsingEndpoint: 5, }); }); @@ -277,7 +282,7 @@ describe('when on the endpoint list page', () => { total: 6, }); setEndpointListApiMockImplementation(coreStart.http, { - endpointsResults: mockedEndpointListData.hosts, + endpointsResults: mockedEndpointListData.data, totalAgentsUsingEndpoint: 5, }); }); @@ -291,6 +296,10 @@ describe('when on the endpoint list page', () => { describe('when there is no selected host in the url', () => { it('should not show the flyout', () => { + setEndpointListApiMockImplementation(coreStart.http, { + endpointsResults: [], + }); + const renderResult = render(); expect.assertions(1); return renderResult.findByTestId('endpointDetailsFlyout').catch((e) => { @@ -307,7 +316,7 @@ describe('when on the endpoint list page', () => { beforeEach(() => { reactTestingLibrary.act(() => { const mockedEndpointData = mockEndpointResultList({ total: 5 }); - const hostListData = mockedEndpointData.hosts; + const hostListData = mockedEndpointData.data; firstPolicyID = hostListData[0].metadata.Endpoint.policy.applied.id; firstPolicyRev = hostListData[0].metadata.Endpoint.policy.applied.endpoint_policy_version; @@ -518,7 +527,7 @@ describe('when on the endpoint list page', () => { describe.skip('when polling on Endpoint List', () => { beforeEach(() => { reactTestingLibrary.act(() => { - const hostListData = mockEndpointResultList({ total: 4 }).hosts; + const hostListData = mockEndpointResultList({ total: 4 }).data; setEndpointListApiMockImplementation(coreStart.http, { endpointsResults: hostListData, @@ -546,7 +555,7 @@ describe('when on the endpoint list page', () => { expect(total[0].textContent).toEqual('4 Hosts'); setEndpointListApiMockImplementation(coreStart.http, { - endpointsResults: mockEndpointResultList({ total: 1 }).hosts, + endpointsResults: mockEndpointResultList({ total: 1 }).data, }); await reactTestingLibrary.act(async () => { @@ -1090,7 +1099,7 @@ describe('when on the endpoint list page', () => { let renderResult: ReturnType; beforeEach(async () => { coreStart.http.post.mockImplementation(async (requestOptions) => { - if (requestOptions.path === '/api/endpoint/metadata') { + if (requestOptions.path === HOST_METADATA_LIST_ROUTE) { return mockEndpointResultList({ total: 0 }); } throw new Error(`POST to '${requestOptions.path}' does not have a mock response!`); @@ -1377,7 +1386,7 @@ describe('when on the endpoint list page', () => { let renderResult: ReturnType; const mockEndpointListApi = () => { - const { hosts } = mockEndpointResultList(); + const { data: hosts } = mockEndpointResultList(); hostInfo = { host_status: hosts[0].host_status, metadata: { diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx index 7332510736534..62728645bcf06 100644 --- a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx @@ -24,7 +24,7 @@ import { } from '@elastic/eui'; import { useHistory } from 'react-router-dom'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { createStructuredSelector } from 'reselect'; import { useDispatch } from 'react-redux'; import { EndpointDetailsFlyout } from './details'; diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/empty/index.tsx b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/empty/index.tsx index df718b9311641..11cc9eef7caf1 100644 --- a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/empty/index.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/empty/index.tsx @@ -8,7 +8,7 @@ import React, { memo } from 'react'; import styled, { css } from 'styled-components'; import { EuiButton, EuiEmptyPrompt } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ManagementEmptyStateWraper } from '../../../../../components/management_empty_state_wraper'; const EmptyPrompt = styled(EuiEmptyPrompt)` diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/event_filter_delete_modal.tsx b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/event_filter_delete_modal.tsx index 653469d304978..0ae9bebf61121 100644 --- a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/event_filter_delete_modal.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/event_filter_delete_modal.tsx @@ -16,7 +16,7 @@ import { EuiModalHeaderTitle, EuiText, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useDispatch } from 'react-redux'; import { Dispatch } from 'redux'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/flyout/index.tsx b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/flyout/index.tsx index b5220e4748ef5..0e71fa47b9e9a 100644 --- a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/flyout/index.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/flyout/index.tsx @@ -9,7 +9,7 @@ import React, { memo, useMemo, useEffect, useCallback, useState } from 'react'; import { useDispatch } from 'react-redux'; import { Dispatch } from 'redux'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlyout, EuiFlyoutHeader, diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form/index.test.tsx b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form/index.test.tsx index f8dd9ac632cd0..0850ed700f62d 100644 --- a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form/index.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form/index.test.tsx @@ -76,6 +76,14 @@ describe('Event filter form', () => { expect(component.getByTestId('exceptionsBuilderWrapper')).not.toBeNull(); }); + it('should display sections', async () => { + component = await renderWithData(); + + expect(component.queryByText('Details')).not.toBeNull(); + expect(component.queryByText('Conditions')).not.toBeNull(); + expect(component.queryByText('Comments')).not.toBeNull(); + }); + it('should display name error only when on blur and empty name', async () => { component = await renderWithData(); expect(component.queryByText(NAME_ERROR)).toBeNull(); diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form/index.tsx b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form/index.tsx index ced0abcea0258..8f0737067ec6a 100644 --- a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form/index.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form/index.tsx @@ -16,7 +16,9 @@ import { EuiSuperSelect, EuiSuperSelectOption, EuiText, + EuiHorizontalRule, } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; import { EVENT_FILTERS_OPERATORS } from '@kbn/securitysolution-list-utils'; @@ -205,25 +207,95 @@ export const EventFiltersForm: React.FC = memo( [exception, handleOnChangeComment, newComment] ); + const detailsSection = useMemo( + () => ( + <> + +

+ +

+
+ + +

{ABOUT_EVENT_FILTERS}

+
+ + {nameInputMemo} + + ), + [nameInputMemo] + ); + + const criteriaSection = useMemo( + () => ( + <> + +

+ +

+
+ + +

+ +

+
+ + {allowSelectOs ? ( + <> + {osInputMemo} + + + ) : null} + {exceptionBuilderComponentMemo} + + ), + [allowSelectOs, exceptionBuilderComponentMemo, osInputMemo] + ); + + const commentsSection = useMemo( + () => ( + <> + +

+ +

+
+ + +

+ +

+
+ + {commentsInputMemo} + + ), + [commentsInputMemo] + ); + return !isIndexPatternLoading && exception ? ( - {!exception || !exception.item_id ? ( - - {ABOUT_EVENT_FILTERS} - - - ) : null} - {nameInputMemo} - - {allowSelectOs ? ( - <> - {osInputMemo} - - - ) : null} - {exceptionBuilderComponentMemo} - - {commentsInputMemo} + {detailsSection} + + {criteriaSection} + + {commentsSection} ) : ( diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/event_filters_list_page.tsx b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/event_filters_list_page.tsx index cebd70d2b69a3..32a0c5ce03950 100644 --- a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/event_filters_list_page.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/event_filters_list_page.tsx @@ -10,7 +10,7 @@ import { useDispatch } from 'react-redux'; import { Dispatch } from 'redux'; import { useHistory, useLocation } from 'react-router-dom'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiSpacer, EuiText } from '@elastic/eui'; import styled from 'styled-components'; diff --git a/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/delete_modal.tsx b/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/delete_modal.tsx index 0b9319580a443..97889662d8bdf 100644 --- a/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/delete_modal.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/delete_modal.tsx @@ -16,7 +16,7 @@ import { EuiModalHeaderTitle, EuiText, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; import { useMutation } from 'react-query'; diff --git a/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/empty.tsx b/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/empty.tsx index 37922dd776b15..082ec3c6fa765 100644 --- a/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/empty.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/empty.tsx @@ -8,7 +8,7 @@ import React, { memo } from 'react'; import styled, { css } from 'styled-components'; import { EuiButton, EuiEmptyPrompt } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ManagementEmptyStateWraper } from '../../../../components/management_empty_state_wraper'; const EmptyPrompt = styled(EuiEmptyPrompt)` diff --git a/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/form.tsx b/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/form.tsx index 4e853f0e6fa6f..38f75dd5fb07a 100644 --- a/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/form.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/form.tsx @@ -15,7 +15,7 @@ import { EuiTextArea, EuiTitle, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { CreateExceptionListItemSchema, UpdateExceptionListItemSchema, diff --git a/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/form_flyout.tsx b/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/form_flyout.tsx index 35d834afa1756..64ead8a94f037 100644 --- a/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/form_flyout.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/form_flyout.tsx @@ -16,7 +16,7 @@ import { EuiFlyoutHeader, EuiTitle, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { CreateExceptionListItemSchema, UpdateExceptionListItemSchema, diff --git a/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/host_isolation_exceptions_list.tsx b/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/host_isolation_exceptions_list.tsx index 103bee41d3ac5..a9da5c6d135a3 100644 --- a/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/host_isolation_exceptions_list.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/host_isolation_exceptions_list.tsx @@ -9,7 +9,7 @@ import { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types' import { i18n } from '@kbn/i18n'; import React, { useCallback, useEffect, useState } from 'react'; import { EuiButton, EuiText, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useHistory } from 'react-router-dom'; import { ExceptionItem } from '../../../../common/components/exceptions/viewer/exception_item'; import { getCurrentLocation } from '../store/selector'; diff --git a/x-pack/plugins/security_solution/public/management/pages/index.test.tsx b/x-pack/plugins/security_solution/public/management/pages/index.test.tsx index 821e14edfda45..5abdb5020110e 100644 --- a/x-pack/plugins/security_solution/public/management/pages/index.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/index.test.tsx @@ -11,6 +11,7 @@ import { ManagementContainer } from './index'; import '../../common/mock/match_media.ts'; import { AppContextTestRender, createAppRootMockRenderer } from '../../common/mock/endpoint'; import { useUserPrivileges } from '../../common/components/user_privileges'; +import { endpointPageHttpMock } from './endpoint_hosts/mocks'; jest.mock('../../common/components/user_privileges'); @@ -19,6 +20,7 @@ describe('when in the Administration tab', () => { beforeEach(() => { const mockedContext = createAppRootMockRenderer(); + endpointPageHttpMock(mockedContext.coreStart.http); render = () => mockedContext.render(); mockedContext.history.push('/administration/endpoints'); }); diff --git a/x-pack/plugins/security_solution/public/management/pages/index.tsx b/x-pack/plugins/security_solution/public/management/pages/index.tsx index 51eb56d23d541..b027060850149 100644 --- a/x-pack/plugins/security_solution/public/management/pages/index.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/index.tsx @@ -8,7 +8,7 @@ import React, { memo } from 'react'; import { Route, Switch, Redirect } from 'react-router-dom'; import { EuiEmptyPrompt, EuiLoadingSpinner, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { MANAGEMENT_ROUTING_ENDPOINTS_PATH, MANAGEMENT_ROUTING_EVENT_FILTERS_PATH, diff --git a/x-pack/plugins/security_solution/public/management/pages/mocks/fleet_mocks.ts b/x-pack/plugins/security_solution/public/management/pages/mocks/fleet_mocks.ts index 8f1530c3632dc..f771a44e57639 100644 --- a/x-pack/plugins/security_solution/public/management/pages/mocks/fleet_mocks.ts +++ b/x-pack/plugins/security_solution/public/management/pages/mocks/fleet_mocks.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { fromKueryExpression } from '@kbn/es-query'; import { httpHandlerMockFactory, ResponseProvidersInterface, @@ -12,6 +13,7 @@ import { import { AGENT_API_ROUTES, AGENT_POLICY_API_ROUTES, + AGENT_POLICY_SAVED_OBJECT_TYPE, appRoutesService, CheckPermissionsResponse, EPM_API_ROUTES, @@ -22,6 +24,97 @@ import { } from '../../../../../fleet/common'; import { EndpointDocGenerator } from '../../../../common/endpoint/generate_data'; import { GetPolicyListResponse, GetPolicyResponse } from '../policy/types'; +import { FleetAgentPolicyGenerator } from '../../../../common/endpoint/data_generators/fleet_agent_policy_generator'; + +interface KqlArgumentType { + type: string; + value?: string | boolean; + function?: string; + arguments?: KqlArgumentType[]; +} + +const getPackagePoliciesFromKueryString = (kueryString: string): string[] => { + if (!kueryString) { + return []; + } + + const kueryAst: ReturnType & { + arguments?: KqlArgumentType[]; + } = fromKueryExpression(kueryString); + + /** + * # ABOUT THE STRUCTURE RETURNED BY THE KQL PARSER: + * + * The kuery AST has a structure similar to to this: + * given string: + * + * ingest-agent-policies.package_policies: (ddf6570b-9175-4a6d-b288-61a09771c647 or b8e616ae-44fc-4be7-846c-ce8fa5c082dd or 2d95bec3-b48f-4db7-9622-a2b061cc031d) + * + * output would be: + * { + * "type": "function", + * "function": "or", // this would not be here if no `OR` was found in the string + * "arguments": [ + * { + * "type": "function", + * "function": "is", + * "arguments": [ + * { + * "type": "literal", + * "value": "ingest-agent-policies.package_policies" + * }, + * { + * "type": "literal", + * "value": "ddf6570b-9175-4a6d-b288-61a09771c647" + * }, + * { + * "type": "literal", + * "value": false + * } + * ] + * }, + * // .... other kquery arguments here + * ] + * } + */ + + // Because there could be be many combinations of OR/AND, we just look for any defined literal that + // looks ot have a value for package_policies. + if (kueryAst.arguments) { + const packagePolicyIds: string[] = []; + const kqlArgumentQueue = [...kueryAst.arguments]; + + while (kqlArgumentQueue.length > 0) { + const kqlArgument = kqlArgumentQueue.shift(); + + if (kqlArgument) { + if (kqlArgument.arguments) { + kqlArgumentQueue.push(...kqlArgument.arguments); + } + + if ( + kqlArgument.type === 'literal' && + kqlArgument.value === `${AGENT_POLICY_SAVED_OBJECT_TYPE}.package_policies` + ) { + // If the next argument looks to be a value, then user it + const nextArgument = kqlArgumentQueue[0]; + if ( + nextArgument && + nextArgument.type === 'literal' && + 'string' === typeof nextArgument.value + ) { + packagePolicyIds.push(nextArgument.value); + kqlArgumentQueue.shift(); + } + } + } + } + + return packagePolicyIds; + } + + return []; +}; export type FleetGetPackageListHttpMockInterface = ResponseProvidersInterface<{ packageList: () => GetPackagesResponse; @@ -70,6 +163,7 @@ export const fleetGetEndpointPackagePolicyListHttpMock = path: PACKAGE_POLICY_API_ROUTES.LIST_PATTERN, method: 'get', handler: () => { + // FIXME: use new FleetPackagePolicyGenerator (#2262) const generator = new EndpointDocGenerator('seed'); const items = Array.from({ length: 5 }, (_, index) => { @@ -97,23 +191,37 @@ export const fleetGetAgentPolicyListHttpMock = id: 'agentPolicy', path: AGENT_POLICY_API_ROUTES.LIST_PATTERN, method: 'get', - handler: () => { + handler: ({ query }) => { const generator = new EndpointDocGenerator('seed'); + const agentPolicyGenerator = new FleetAgentPolicyGenerator('seed'); const endpointMetadata = generator.generateHostMetadata(); - const agentPolicy = generator.generateAgentPolicy(); + const requiredPolicyIds: string[] = [ + // Make sure that the Agent policy returned from the API has the Integration Policy ID that + // the first endpoint metadata generated is using. This is needed especially when testing the + // Endpoint Details flyout where certain actions might be disabled if we know the endpoint integration policy no + // longer exists. + endpointMetadata.Endpoint.policy.applied.id, - // Make sure that the Agent policy returned from the API has the Integration Policy ID that - // the endpoint metadata is using. This is needed especially when testing the Endpoint Details - // flyout where certain actions might be disabled if we know the endpoint integration policy no - // longer exists. - (agentPolicy.package_policies as string[]).push( - endpointMetadata.Endpoint.policy.applied.id - ); + // In addition, some of our UI logic looks for the existence of certain Endpoint Integration policies + // using the Agents Policy API (normally when checking IDs since query by ids is not supported via API) + // so also add the first two package policy IDs that the `fleetGetEndpointPackagePolicyListHttpMock()` + // method above creates (which Trusted Apps HTTP mocks also use) + // FIXME: remove hard-coded IDs below and get them from the new FleetPackagePolicyGenerator (#2262) + 'ddf6570b-9175-4a6d-b288-61a09771c647', + 'b8e616ae-44fc-4be7-846c-ce8fa5c082dd', + + // And finally, include any kql filters for package policies ids + ...getPackagePoliciesFromKueryString((query as { kuery?: string }).kuery ?? ''), + ]; return { - items: [agentPolicy], - perPage: 10, - total: 1, + items: requiredPolicyIds.map((packagePolicyId) => { + return agentPolicyGenerator.generate({ + package_policies: [packagePolicyId], + }); + }), + perPage: Math.max(requiredPolicyIds.length, 10), + total: requiredPolicyIds.length, page: 1, }; }, diff --git a/x-pack/plugins/security_solution/public/management/pages/mocks/trusted_apps_http_mocks.ts b/x-pack/plugins/security_solution/public/management/pages/mocks/trusted_apps_http_mocks.ts index 0a440afcb2c30..a175d516e9e9a 100644 --- a/x-pack/plugins/security_solution/public/management/pages/mocks/trusted_apps_http_mocks.ts +++ b/x-pack/plugins/security_solution/public/management/pages/mocks/trusted_apps_http_mocks.ts @@ -7,48 +7,69 @@ import { HttpFetchOptionsWithPath } from 'kibana/public'; import { + ENDPOINT_TRUSTED_APPS_LIST_ID, + EXCEPTION_LIST_ITEM_URL, + EXCEPTION_LIST_URL, +} from '@kbn/securitysolution-list-constants'; +import { + ExceptionListItemSchema, + FoundExceptionListItemSchema, + FindExceptionListItemSchema, + UpdateExceptionListItemSchema, + ReadExceptionListItemSchema, + CreateExceptionListItemSchema, + ExceptionListSchema, +} from '@kbn/securitysolution-io-ts-list-types'; +import { + composeHttpHandlerMocks, httpHandlerMockFactory, ResponseProvidersInterface, } from '../../../common/mock/endpoint/http_handler_mock_factory'; +import { ExceptionsListItemGenerator } from '../../../../common/endpoint/data_generators/exceptions_list_item_generator'; +import { POLICY_REFERENCE_PREFIX } from '../../../../common/endpoint/service/trusted_apps/mapping'; +import { getTrustedAppsListSchemaMock } from '../../../../../lists/common/schemas/response/exception_list_schema.mock'; import { - GetTrustedAppsListRequest, - GetTrustedAppsListResponse, - PutTrustedAppUpdateRequest, - PutTrustedAppUpdateResponse, -} from '../../../../common/endpoint/types'; -import { - TRUSTED_APPS_LIST_API, - TRUSTED_APPS_UPDATE_API, -} from '../../../../common/endpoint/constants'; -import { TrustedAppGenerator } from '../../../../common/endpoint/data_generators/trusted_app_generator'; + fleetGetAgentPolicyListHttpMock, + FleetGetAgentPolicyListHttpMockInterface, + fleetGetEndpointPackagePolicyListHttpMock, + FleetGetEndpointPackagePolicyListHttpMockInterface, +} from './fleet_mocks'; -export type PolicyDetailsGetTrustedAppsListHttpMocksInterface = ResponseProvidersInterface<{ - trustedAppsList: (options: HttpFetchOptionsWithPath) => GetTrustedAppsListResponse; +interface FindExceptionListItemSchemaQueryParams + extends Omit { + page?: number; + per_page?: number; +} + +export type TrustedAppsGetListHttpMocksInterface = ResponseProvidersInterface<{ + trustedAppsList: (options: HttpFetchOptionsWithPath) => FoundExceptionListItemSchema; }>; /** * HTTP mock for retrieving list of Trusted Apps */ export const trustedAppsGetListHttpMocks = - httpHandlerMockFactory([ + httpHandlerMockFactory([ { id: 'trustedAppsList', - path: TRUSTED_APPS_LIST_API, + path: `${EXCEPTION_LIST_ITEM_URL}/_find`, method: 'get', - handler: ({ query }): GetTrustedAppsListResponse => { - const apiQueryParams = query as GetTrustedAppsListRequest; - const generator = new TrustedAppGenerator('seed'); + handler: ({ query }): FoundExceptionListItemSchema => { + const apiQueryParams = query as unknown as FindExceptionListItemSchemaQueryParams; + const generator = new ExceptionsListItemGenerator('seed'); const perPage = apiQueryParams.per_page ?? 10; - const data = Array.from({ length: Math.min(perPage, 50) }, () => generator.generate()); + const data = Array.from({ length: Math.min(perPage, 50) }, () => + generator.generate({ list_id: ENDPOINT_TRUSTED_APPS_LIST_ID }) + ); + + // FIXME: remove hard-coded IDs below adn get them from the new FleetPackagePolicyGenerator (#2262) // Change the 3rd entry (index 2) to be policy specific - data[2].effectScope = { - type: 'policy', - policies: [ - // IDs below are those generated by the `fleetGetEndpointPackagePolicyListHttpMock()` mock - 'ddf6570b-9175-4a6d-b288-61a09771c647', - 'b8e616ae-44fc-4be7-846c-ce8fa5c082dd', - ], - }; + data[2].tags = [ + // IDs below are those generated by the `fleetGetEndpointPackagePolicyListHttpMock()` mock, + // so if using in combination with that API mock, these should just "work" + `${POLICY_REFERENCE_PREFIX}ddf6570b-9175-4a6d-b288-61a09771c647`, + `${POLICY_REFERENCE_PREFIX}b8e616ae-44fc-4be7-846c-ce8fa5c082dd`, + ]; return { page: apiQueryParams.page ?? 1, @@ -61,7 +82,7 @@ export const trustedAppsGetListHttpMocks = ]); export type TrustedAppPutHttpMocksInterface = ResponseProvidersInterface<{ - trustedAppUpdate: (options: HttpFetchOptionsWithPath) => PutTrustedAppUpdateResponse; + trustedAppUpdate: (options: HttpFetchOptionsWithPath) => ExceptionListItemSchema; }>; /** * HTTP mocks that support updating a single Trusted Apps @@ -69,23 +90,113 @@ export type TrustedAppPutHttpMocksInterface = ResponseProvidersInterface<{ export const trustedAppPutHttpMocks = httpHandlerMockFactory([ { id: 'trustedAppUpdate', - path: TRUSTED_APPS_UPDATE_API, + path: EXCEPTION_LIST_ITEM_URL, method: 'put', - handler: ({ body, path }): PutTrustedAppUpdateResponse => { - const response: PutTrustedAppUpdateResponse = { - data: { - ...(body as unknown as PutTrustedAppUpdateRequest), - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - id: path.split('/').pop()!, - created_at: '2021-10-12T16:02:55.856Z', - created_by: 'elastic', - updated_at: '2021-10-13T16:02:55.856Z', - updated_by: 'elastic', - version: 'abc', - }, + handler: ({ body, path }): ExceptionListItemSchema => { + const updatedExceptionItem = JSON.parse( + body as string + ) as Required; + const response: ExceptionListItemSchema = { + ...updatedExceptionItem, + id: path.split('/').pop() ?? 'unknown-id', + comments: [], + created_at: '2021-10-12T16:02:55.856Z', + created_by: 'elastic', + updated_at: '2021-10-13T16:02:55.856Z', + updated_by: 'elastic', + list_id: ENDPOINT_TRUSTED_APPS_LIST_ID, + _version: 'abc', + tie_breaker_id: '1111', }; return response; }, }, ]); + +export type TrustedAppsGetOneHttpMocksInterface = ResponseProvidersInterface<{ + trustedApp: (options: HttpFetchOptionsWithPath) => ExceptionListItemSchema; +}>; +/** + * HTTP mock for retrieving list of Trusted Apps + */ +export const trustedAppsGetOneHttpMocks = + httpHandlerMockFactory([ + { + id: 'trustedApp', + path: EXCEPTION_LIST_ITEM_URL, + method: 'get', + handler: ({ query }): ExceptionListItemSchema => { + const apiQueryParams = query as ReadExceptionListItemSchema; + const exceptionItem = new ExceptionsListItemGenerator('seed').generate(); + + exceptionItem.item_id = apiQueryParams.item_id ?? exceptionItem.item_id; + exceptionItem.namespace_type = + apiQueryParams.namespace_type ?? exceptionItem.namespace_type; + + return exceptionItem; + }, + }, + ]); + +export type TrustedAppPostHttpMocksInterface = ResponseProvidersInterface<{ + trustedAppCreate: (options: HttpFetchOptionsWithPath) => ExceptionListItemSchema; +}>; +/** + * HTTP mocks that support updating a single Trusted Apps + */ +export const trustedAppPostHttpMocks = httpHandlerMockFactory([ + { + id: 'trustedAppCreate', + path: EXCEPTION_LIST_ITEM_URL, + method: 'post', + handler: ({ body, path }): ExceptionListItemSchema => { + const { comments, ...updatedExceptionItem } = JSON.parse( + body as string + ) as CreateExceptionListItemSchema; + const response: ExceptionListItemSchema = { + ...new ExceptionsListItemGenerator('seed').generate(), + ...updatedExceptionItem, + }; + response.id = path.split('/').pop() ?? response.id; + + return response; + }, + }, +]); + +export type TrustedAppsPostCreateListHttpMockInterface = ResponseProvidersInterface<{ + trustedAppCreateList: (options: HttpFetchOptionsWithPath) => ExceptionListSchema; +}>; +/** + * HTTP mocks that support updating a single Trusted Apps + */ +export const trustedAppsPostCreateListHttpMock = + httpHandlerMockFactory([ + { + id: 'trustedAppCreateList', + path: EXCEPTION_LIST_URL, + method: 'post', + handler: (): ExceptionListSchema => { + return getTrustedAppsListSchemaMock(); + }, + }, + ]); + +export type TrustedAppsAllHttpMocksInterface = FleetGetEndpointPackagePolicyListHttpMockInterface & + FleetGetAgentPolicyListHttpMockInterface & + TrustedAppsGetListHttpMocksInterface & + TrustedAppsGetOneHttpMocksInterface & + TrustedAppPutHttpMocksInterface & + TrustedAppPostHttpMocksInterface & + TrustedAppsPostCreateListHttpMockInterface; +/** Use this HTTP mock when wanting to mock the API calls done by the Trusted Apps Http service */ +export const trustedAppsAllHttpMocks = composeHttpHandlerMocks([ + trustedAppsGetListHttpMocks, + trustedAppsGetOneHttpMocks, + trustedAppPutHttpMocks, + trustedAppPostHttpMocks, + trustedAppsPostCreateListHttpMock, + fleetGetEndpointPackagePolicyListHttpMock, + fleetGetAgentPolicyListHttpMock, +]); diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware/index.ts b/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware/index.ts index acc94f3383a84..a5752ed1658d3 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware/index.ts +++ b/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware/index.ts @@ -14,15 +14,16 @@ import { TrustedAppsHttpService } from '../../../../trusted_apps/service'; export const policyDetailsMiddlewareFactory: ImmutableMiddlewareFactory = ( coreStart ) => { + // Initialize services needed by Policy middleware + const trustedAppsService = new TrustedAppsHttpService(coreStart.http); + const middlewareContext: MiddlewareRunnerContext = { + coreStart, + trustedAppsService, + }; + return (store) => (next) => async (action) => { next(action); - const trustedAppsService = new TrustedAppsHttpService(coreStart.http); - const middlewareContext: MiddlewareRunnerContext = { - coreStart, - trustedAppsService, - }; - policySettingsMiddlewareRunner(middlewareContext, store, action); policyTrustedAppsMiddlewareRunner(middlewareContext, store, action); }; diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/test_utils/mocks.ts b/x-pack/plugins/security_solution/public/management/pages/policy/test_utils/mocks.ts index 707f75913c7ed..3b9f6a45250ac 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/test_utils/mocks.ts +++ b/x-pack/plugins/security_solution/public/management/pages/policy/test_utils/mocks.ts @@ -23,9 +23,15 @@ import { fleetGetEndpointPackagePolicyListHttpMock, FleetGetEndpointPackagePolicyListHttpMockInterface, trustedAppsGetListHttpMocks, - PolicyDetailsGetTrustedAppsListHttpMocksInterface, + TrustedAppsGetListHttpMocksInterface, trustedAppPutHttpMocks, TrustedAppPutHttpMocksInterface, + trustedAppsGetOneHttpMocks, + TrustedAppsGetOneHttpMocksInterface, + fleetGetAgentPolicyListHttpMock, + FleetGetAgentPolicyListHttpMockInterface, + trustedAppsPostCreateListHttpMock, + TrustedAppsPostCreateListHttpMockInterface, } from '../../mocks'; export const getMockListResponse: () => GetTrustedAppsListResponse = () => ({ @@ -71,13 +77,19 @@ export type PolicyDetailsPageAllApiHttpMocksInterface = FleetGetEndpointPackagePolicyHttpMockInterface & FleetGetAgentStatusHttpMockInterface & FleetGetEndpointPackagePolicyListHttpMockInterface & - PolicyDetailsGetTrustedAppsListHttpMocksInterface & - TrustedAppPutHttpMocksInterface; + FleetGetAgentPolicyListHttpMockInterface & + TrustedAppsGetListHttpMocksInterface & + TrustedAppPutHttpMocksInterface & + TrustedAppsGetOneHttpMocksInterface & + TrustedAppsPostCreateListHttpMockInterface; export const policyDetailsPageAllApiHttpMocks = composeHttpHandlerMocks([ fleetGetEndpointPackagePolicyHttpMock, fleetGetAgentStatusHttpMock, fleetGetEndpointPackagePolicyListHttpMock, + fleetGetAgentPolicyListHttpMock, trustedAppsGetListHttpMocks, trustedAppPutHttpMocks, + trustedAppsGetOneHttpMocks, + trustedAppsPostCreateListHttpMock, ]); diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/components/config_form/index.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/components/config_form/index.tsx index f589ec628befb..9d753749dabed 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/components/config_form/index.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/components/config_form/index.tsx @@ -7,7 +7,7 @@ import React, { FC, ReactNode, memo, useContext } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/exception_items_summary.test.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/exception_items_summary.test.tsx index b348a99d223b8..bc672a3bd00d6 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/exception_items_summary.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/exception_items_summary.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { ThemeProvider } from 'styled-components'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { ExceptionItemsSummary } from './exception_items_summary'; import * as reactTestingLibrary from '@testing-library/react'; import { getMockTheme } from '../../../../../../../../public/common/lib/kibana/kibana_react.mock'; diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_event_filters_card.test.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_event_filters_card.test.tsx index 0981c775e961b..5d19cd1559f2e 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_event_filters_card.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_event_filters_card.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { ThemeProvider } from 'styled-components'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { FleetEventFiltersCard } from './fleet_event_filters_card'; import * as reactTestingLibrary from '@testing-library/react'; import { EventFiltersHttpService } from '../../../../../event_filters/service'; diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_event_filters_card.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_event_filters_card.tsx index 7db76fee4efc5..d93ebc47adc6d 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_event_filters_card.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_event_filters_card.tsx @@ -8,7 +8,7 @@ import React, { memo, useMemo, useState, useEffect, useRef } from 'react'; import { EuiPanel, EuiText } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { PackageCustomExtensionComponentProps, pagePathGetters, diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_host_isolation_exceptions_card.test.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_host_isolation_exceptions_card.test.tsx index ea1937c5a98d5..a60c6aac602e0 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_host_isolation_exceptions_card.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_host_isolation_exceptions_card.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import * as reactTestingLibrary from '@testing-library/react'; import React from 'react'; import { ThemeProvider } from 'styled-components'; diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_host_isolation_exceptions_card.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_host_isolation_exceptions_card.tsx index 535c0be4736cc..711df5b82079a 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_host_isolation_exceptions_card.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_host_isolation_exceptions_card.tsx @@ -7,7 +7,7 @@ import { EuiPanel, EuiText } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { memo, useEffect, useMemo, useRef, useState } from 'react'; import { INTEGRATIONS_PLUGIN_ID } from '../../../../../../../../../fleet/common'; import { diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_trusted_apps_card.test.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_trusted_apps_card.test.tsx index 1da2c41324f56..2eb87a97b5e87 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_trusted_apps_card.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_trusted_apps_card.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { ThemeProvider } from 'styled-components'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { FleetTrustedAppsCardWrapper } from './fleet_trusted_apps_card_wrapper'; import * as reactTestingLibrary from '@testing-library/react'; import { TrustedAppsHttpService } from '../../../../../trusted_apps/service'; diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_trusted_apps_card.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_trusted_apps_card.tsx index 680023cc6fd07..9de98dfcd385f 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_trusted_apps_card.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_trusted_apps_card.tsx @@ -8,7 +8,7 @@ import React, { memo, useMemo, useState, useEffect, useRef } from 'react'; import { EuiPanel, EuiText, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { GetExceptionSummaryResponse } from '../../../../../../../../common/endpoint/types'; import { useKibana, useToasts } from '../../../../../../../common/lib/kibana'; diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_trusted_apps_card_wrapper.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_trusted_apps_card_wrapper.tsx index 848a0916b1d2e..41a516e99a24a 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_trusted_apps_card_wrapper.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_trusted_apps_card_wrapper.tsx @@ -7,7 +7,7 @@ import React, { memo, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { PackageCustomExtensionComponentProps, pagePathGetters, diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension.tsx index db223274ad638..7fe0bd80f91d2 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension.tsx @@ -7,7 +7,7 @@ import React, { memo, useEffect } from 'react'; import { EuiCallOut, EuiSpacer, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { PackagePolicyCreateExtensionComponentProps } from '../../../../../../../fleet/public'; /** diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_edit_extension.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_edit_extension.tsx index 0717ca5193bee..b0d4c2abdd964 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_edit_extension.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_edit_extension.tsx @@ -8,7 +8,7 @@ import React, { memo, useEffect, useState, useMemo } from 'react'; import { EuiCallOut, EuiLoadingSpinner, EuiSpacer, EuiText } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useDispatch } from 'react-redux'; import { PackagePolicyEditExtensionComponentProps, diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_advanced.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_advanced.tsx index 6034ed875c02b..7da01f80fd047 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_advanced.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_advanced.tsx @@ -19,7 +19,7 @@ import { EuiText, } from '@elastic/eui'; import { cloneDeep } from 'lodash'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { policyConfig } from '../store/policy_details/selectors'; import { usePolicyDetailsSelector } from './policy_hooks'; diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_details_form.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_details_form.tsx index ed6a33166ff59..747bde112d89a 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_details_form.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_details_form.tsx @@ -7,7 +7,7 @@ import { EuiButtonEmpty, EuiSpacer, EuiText } from '@elastic/eui'; import React, { memo, useCallback, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { MalwareProtections } from './policy_forms/protections/malware'; import { MemoryProtection } from './policy_forms/protections/memory'; diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/policy_form_confirm_update.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/policy_form_confirm_update.tsx index d3bc78732aae6..d2e06a4b2116b 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/policy_form_confirm_update.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/policy_form_confirm_update.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiSpacer, EuiConfirmModal, EuiCallOut } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; export const ConfirmUpdate = React.memo<{ diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/policy_form_layout.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/policy_form_layout.tsx index 2345deabb5101..ce0aaf41cd836 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/policy_form_layout.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/policy_form_layout.tsx @@ -15,7 +15,7 @@ import { EuiBottomBar, EuiSpacer, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { useDispatch } from 'react-redux'; import { useLocation } from 'react-router-dom'; diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/radio_buttons.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/radio_buttons.tsx index acdbb7e979092..a649d8f896957 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/radio_buttons.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/radio_buttons.tsx @@ -7,7 +7,7 @@ import React, { useMemo } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import styled from 'styled-components'; import { EuiSpacer, EuiFlexItem, EuiFlexGroup } from '@elastic/eui'; import { diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/supported_version.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/supported_version.tsx index 0d90819b9cd15..b3cf322f70fac 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/supported_version.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/supported_version.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiText } from '@elastic/eui'; import { popupVersionsMap } from '../protections/popup_options_to_versions'; diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/user_notification.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/user_notification.tsx index 1bf0a3193f291..90e3cd6658d0c 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/user_notification.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/user_notification.tsx @@ -8,7 +8,7 @@ import React, { useCallback } from 'react'; import { useDispatch } from 'react-redux'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { cloneDeep } from 'lodash'; import { EuiSpacer, diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/locked_card.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/locked_card.tsx index cd13e2f933526..d1a10af88b394 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/locked_card.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/locked_card.tsx @@ -15,7 +15,7 @@ import { EuiFlexItem, EuiText, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import styled from 'styled-components'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/behavior.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/behavior.tsx index ccb19da4a4ada..8aa8b11de1db0 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/behavior.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/behavior.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { EuiCallOut, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Immutable, OperatingSystem } from '../../../../../../../common/endpoint/types'; import { BehaviorProtectionOSes, OS } from '../../../types'; import { ConfigForm } from '../../components/config_form'; diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/malware.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/malware.tsx index b401db2dccc93..73c9b9cd0a984 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/malware.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/malware.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCallOut, EuiSpacer } from '@elastic/eui'; import { APP_UI_ID } from '../../../../../../../common/constants'; import { SecurityPageName } from '../../../../../../app/types'; diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/memory.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/memory.tsx index 7cc93994298aa..ca81bd9732708 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/memory.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/memory.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCallOut, EuiSpacer } from '@elastic/eui'; import { APP_UI_ID } from '../../../../../../../common/constants'; import { SecurityPageName } from '../../../../../../app/types'; diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/ransomware.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/ransomware.tsx index 7525a27bd52ab..7857530763b2f 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/ransomware.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/ransomware.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCallOut, EuiSpacer } from '@elastic/eui'; import { APP_UI_ID } from '../../../../../../../common/constants'; import { SecurityPageName } from '../../../../../../app/types'; diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/empty/policy_trusted_apps_empty_unassigned.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/empty/policy_trusted_apps_empty_unassigned.tsx index c12bec03ada04..3252c5a27d85d 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/empty/policy_trusted_apps_empty_unassigned.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/empty/policy_trusted_apps_empty_unassigned.tsx @@ -7,7 +7,7 @@ import React, { memo, useCallback } from 'react'; import { EuiEmptyPrompt, EuiButton, EuiPageTemplate, EuiLink } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { usePolicyDetailsNavigateCallback } from '../../policy_hooks'; import { useGetLinkTo } from './use_policy_trusted_apps_empty_hooks'; import { useEndpointPrivileges } from '../../../../../../common/components/user_privileges/endpoint/use_endpoint_privileges'; diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/empty/policy_trusted_apps_empty_unexisting.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/empty/policy_trusted_apps_empty_unexisting.tsx index 24bb9d8b6a150..1c96398b8347e 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/empty/policy_trusted_apps_empty_unexisting.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/empty/policy_trusted_apps_empty_unexisting.tsx @@ -7,7 +7,7 @@ import React, { memo } from 'react'; import { EuiEmptyPrompt, EuiButton, EuiPageTemplate } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useGetLinkTo } from './use_policy_trusted_apps_empty_hooks'; interface CommonProps { diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/flyout/policy_trusted_apps_flyout.test.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/flyout/policy_trusted_apps_flyout.test.tsx index 8e412d2020b72..86086deeb58dc 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/flyout/policy_trusted_apps_flyout.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/flyout/policy_trusted_apps_flyout.test.tsx @@ -14,39 +14,26 @@ import { } from '../../../../../../common/mock/endpoint'; import { MiddlewareActionSpyHelper } from '../../../../../../common/store/test_utils'; -import { TrustedAppsHttpService } from '../../../../trusted_apps/service'; import { PolicyDetailsState } from '../../../types'; -import { getMockCreateResponse, getMockListResponse } from '../../../test_utils'; import { createLoadedResourceState, isLoadedResourceState } from '../../../../../state'; import { getPolicyDetailsArtifactsListPath } from '../../../../../common/routing'; +import { trustedAppsAllHttpMocks } from '../../../../mocks'; +import { HttpFetchOptionsWithPath } from 'kibana/public'; -jest.mock('../../../../trusted_apps/service'); jest.mock('../../../../../../common/components/user_privileges/endpoint/use_endpoint_privileges'); let mockedContext: AppContextTestRender; let waitForAction: MiddlewareActionSpyHelper['waitForAction']; let render: () => ReturnType; +let mockedApis: ReturnType; const act = reactTestingLibrary.act; -const TrustedAppsHttpServiceMock = TrustedAppsHttpService as jest.Mock; let getState: () => PolicyDetailsState; describe('Policy trusted apps flyout', () => { beforeEach(() => { - TrustedAppsHttpServiceMock.mockImplementation(() => { - return { - getTrustedAppsList: () => getMockListResponse(), - updateTrustedApp: () => ({ - data: getMockCreateResponse(), - }), - assignPolicyToTrustedApps: () => [ - { - data: getMockCreateResponse(), - }, - ], - }; - }); mockedContext = createAppRootMockRenderer(); waitForAction = mockedContext.middlewareSpy.waitForAction; + mockedApis = trustedAppsAllHttpMocks(mockedContext.coreStart.http); getState = () => mockedContext.store.getState().management.policyDetails; render = () => mockedContext.render(); }); @@ -58,11 +45,13 @@ describe('Policy trusted apps flyout', () => { validate: (action) => isLoadedResourceState(action.payload), }); - TrustedAppsHttpServiceMock.mockImplementation(() => { - return { - getTrustedAppsList: () => ({ data: [] }), - }; + mockedApis.responseProvider.trustedAppsList.mockReturnValue({ + data: [], + total: 0, + per_page: 10, + page: 1, }); + const component = render(); mockedContext.history.push(getPolicyDetailsArtifactsListPath('1234', { show: 'list' })); @@ -77,10 +66,11 @@ describe('Policy trusted apps flyout', () => { }); it('should renders flyout open correctly without data', async () => { - TrustedAppsHttpServiceMock.mockImplementation(() => { - return { - getTrustedAppsList: () => ({ data: [] }), - }; + mockedApis.responseProvider.trustedAppsList.mockReturnValue({ + data: [], + total: 0, + per_page: 10, + page: 1, }); const component = render(); @@ -107,36 +97,37 @@ describe('Policy trusted apps flyout', () => { }); expect(component.getByTestId('confirmPolicyTrustedAppsFlyout')).not.toBeNull(); - expect(component.getByTestId(`${getMockListResponse().data[0].name}_checkbox`)).not.toBeNull(); + expect(component.getByTestId('Generated Exception (u6kh2)_checkbox')).not.toBeNull(); }); it('should confirm flyout action', async () => { - const waitForUpdate = waitForAction('policyArtifactsUpdateTrustedAppsChanged', { - validate: (action) => isLoadedResourceState(action.payload), - }); - const waitChangeUrl = waitForAction('userChangedUrl'); const component = render(); - mockedContext.history.push(getPolicyDetailsArtifactsListPath('1234', { show: 'list' })); + mockedContext.history.push( + getPolicyDetailsArtifactsListPath('2d95bec3-b48f-4db7-9622-a2b061cc031d', { show: 'list' }) + ); await waitForAction('policyArtifactsAssignableListPageDataChanged', { validate: (action) => isLoadedResourceState(action.payload), }); - const tACardCheckbox = component.getByTestId(`${getMockListResponse().data[0].name}_checkbox`); + // TA name below in the selector matches the 3rd generated trusted app which is policy specific + const tACardCheckbox = component.getByTestId('Generated Exception (3xnng)_checkbox'); - await act(async () => { + act(() => { fireEvent.click(tACardCheckbox); }); + const waitChangeUrl = waitForAction('userChangedUrl'); const confirmButton = component.getByTestId('confirmPolicyTrustedAppsFlyout'); - await act(async () => { + act(() => { fireEvent.click(confirmButton); }); - await waitForUpdate; await waitChangeUrl; + const currentLocation = getState().artifacts.location; + expect(currentLocation.show).toBeUndefined(); }); @@ -161,11 +152,13 @@ describe('Policy trusted apps flyout', () => { }); it('should display warning message when too much results', async () => { - TrustedAppsHttpServiceMock.mockImplementation(() => { - return { - getTrustedAppsList: () => ({ ...getMockListResponse(), total: 101 }), - }; - }); + const listResponse = { + ...mockedApis.responseProvider.trustedAppsList.getMockImplementation()!({ + query: {}, + } as HttpFetchOptionsWithPath), + total: 101, + }; + mockedApis.responseProvider.trustedAppsList.mockReturnValue(listResponse); const component = render(); diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/flyout/policy_trusted_apps_flyout.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/flyout/policy_trusted_apps_flyout.tsx index e2297d20b4cd2..c8aa18cf2086a 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/flyout/policy_trusted_apps_flyout.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/flyout/policy_trusted_apps_flyout.tsx @@ -8,7 +8,7 @@ import React, { useMemo, useState, useCallback, useEffect } from 'react'; import { useDispatch } from 'react-redux'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { isEmpty, without } from 'lodash/fp'; import { diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/layout/policy_trusted_apps_layout.test.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/layout/policy_trusted_apps_layout.test.tsx index 318b98712a7c0..a0c8a04092237 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/layout/policy_trusted_apps_layout.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/layout/policy_trusted_apps_layout.test.tsx @@ -13,8 +13,6 @@ import { } from '../../../../../../common/mock/endpoint'; import { MiddlewareActionSpyHelper } from '../../../../../../common/store/test_utils'; -import { TrustedAppsHttpService } from '../../../../trusted_apps/service'; -import { getMockListResponse } from '../../../test_utils'; import { createLoadedResourceState, isLoadedResourceState } from '../../../../../state'; import { getPolicyDetailsArtifactsListPath } from '../../../../../common/routing'; import { EndpointDocGenerator } from '../../../../../../../common/endpoint/generate_data'; @@ -22,24 +20,26 @@ import { policyListApiPathHandlers } from '../../../store/test_mock_utils'; import { useEndpointPrivileges } from '../../../../../../common/components/user_privileges/endpoint/use_endpoint_privileges'; import { getEndpointPrivilegesInitialStateMock } from '../../../../../../common/components/user_privileges/endpoint/mocks'; import { PACKAGE_POLICY_API_ROOT, AGENT_API_ROUTES } from '../../../../../../../../fleet/common'; +import { trustedAppsAllHttpMocks } from '../../../../mocks'; -jest.mock('../../../../trusted_apps/service'); jest.mock('../../../../../../common/components/user_privileges/endpoint/use_endpoint_privileges'); const mockUseEndpointPrivileges = useEndpointPrivileges as jest.Mock; let mockedContext: AppContextTestRender; let waitForAction: MiddlewareActionSpyHelper['waitForAction']; let render: () => ReturnType; -const TrustedAppsHttpServiceMock = TrustedAppsHttpService as jest.Mock; let coreStart: AppContextTestRender['coreStart']; let http: typeof coreStart.http; +let mockedApis: ReturnType; const generator = new EndpointDocGenerator(); describe('Policy trusted apps layout', () => { beforeEach(() => { mockedContext = createAppRootMockRenderer(); http = mockedContext.coreStart.http; + const policyListApiHandlers = policyListApiPathHandlers(); + http.get.mockImplementation((...args) => { const [path] = args; if (typeof path === 'string') { @@ -68,12 +68,8 @@ describe('Policy trusted apps layout', () => { return Promise.reject(new Error(`unknown API call (not MOCKED): ${path}`)); }); - TrustedAppsHttpServiceMock.mockImplementation(() => { - return { - getTrustedAppsList: () => ({ data: [] }), - }; - }); + mockedApis = trustedAppsAllHttpMocks(http); waitForAction = mockedContext.middlewareSpy.waitForAction; render = () => mockedContext.render(); }); @@ -85,9 +81,14 @@ describe('Policy trusted apps layout', () => { afterEach(() => reactTestingLibrary.cleanup()); it('should renders layout with no existing TA data', async () => { - const component = render(); - + mockedApis.responseProvider.trustedAppsList.mockImplementation(() => ({ + data: [], + page: 1, + per_page: 10, + total: 0, + })); mockedContext.history.push(getPolicyDetailsArtifactsListPath('1234')); + const component = render(); await waitForAction('policyArtifactsDeosAnyTrustedAppExists', { validate: (action) => isLoadedResourceState(action.payload), @@ -97,8 +98,14 @@ describe('Policy trusted apps layout', () => { }); it('should renders layout with no assigned TA data', async () => { - const component = render(); + mockedApis.responseProvider.trustedAppsList.mockImplementation(() => ({ + data: [], + page: 1, + per_page: 10, + total: 0, + })); mockedContext.history.push(getPolicyDetailsArtifactsListPath('1234')); + const component = render(); await waitForAction('assignedTrustedAppsListStateChanged'); @@ -111,13 +118,8 @@ describe('Policy trusted apps layout', () => { }); it('should renders layout with data', async () => { - TrustedAppsHttpServiceMock.mockImplementation(() => { - return { - getTrustedAppsList: () => getMockListResponse(), - }; - }); - const component = render(); mockedContext.history.push(getPolicyDetailsArtifactsListPath('1234')); + const component = render(); await waitForAction('assignedTrustedAppsListStateChanged'); @@ -148,11 +150,6 @@ describe('Policy trusted apps layout', () => { isPlatinumPlus: false, }) ); - TrustedAppsHttpServiceMock.mockImplementation(() => { - return { - getTrustedAppsList: () => getMockListResponse(), - }; - }); const component = render(); mockedContext.history.push(getPolicyDetailsArtifactsListPath('1234')); diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/layout/policy_trusted_apps_layout.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/layout/policy_trusted_apps_layout.tsx index 49f76ad2e02c6..1d00c09393d55 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/layout/policy_trusted_apps_layout.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/layout/policy_trusted_apps_layout.tsx @@ -7,7 +7,7 @@ import React, { useMemo } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiTitle, @@ -32,7 +32,7 @@ import { PolicyTrustedAppsFlyout } from '../flyout'; import { PolicyTrustedAppsList } from '../list/policy_trusted_apps_list'; import { useEndpointPrivileges } from '../../../../../../common/components/user_privileges/endpoint/use_endpoint_privileges'; import { useAppUrl } from '../../../../../../common/lib/kibana'; -import { APP_ID } from '../../../../../../../common/constants'; +import { APP_UI_ID } from '../../../../../../../common/constants'; import { getTrustedAppsListPath } from '../../../../../common/routing'; export const PolicyTrustedAppsLayout = React.memo(() => { @@ -92,7 +92,10 @@ export const PolicyTrustedAppsLayout = React.memo(() => { const aboutInfo = useMemo(() => { const link = ( - + { expect(appTestContext.coreStart.application.navigateToApp).toHaveBeenCalledWith( APP_UI_ID, expect.objectContaining({ - path: '/administration/trusted_apps?filter=89f72d8a-05b5-4350-8cad-0dc3661d6e67', + path: '/administration/trusted_apps?filter=6f12b025-fcb0-4db4-99e5-4927e3502bb8', }) ); }); @@ -324,12 +324,12 @@ describe('when rendering the PolicyTrustedAppsList', () => { }); it('does not show remove option in actions menu if license is downgraded to gold or below', async () => { - await render(); mockUseEndpointPrivileges.mockReturnValue( loadedUserEndpointPrivilegesState({ isPlatinumPlus: false, }) ); + await render(); await toggleCardActionMenu(POLICY_SPECIFIC_CARD_INDEX); expect(renderResult.queryByTestId('policyTrustedAppsGrid-removeAction')).toBeNull(); diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/list/remove_trusted_app_from_policy_modal.test.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/list/remove_trusted_app_from_policy_modal.test.tsx index 50564c39935fa..172b5218188c6 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/list/remove_trusted_app_from_policy_modal.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/list/remove_trusted_app_from_policy_modal.test.tsx @@ -24,6 +24,7 @@ import { } from '../../../store/policy_details/action/policy_trusted_apps_action'; import { Immutable } from '../../../../../../../common/endpoint/types'; import { HttpFetchOptionsWithPath } from 'kibana/public'; +import { exceptionListItemToTrustedApp } from '../../../../trusted_apps/service/mappers'; describe('When using the RemoveTrustedAppFromPolicyModal component', () => { let appTestContext: AppContextTestRender; @@ -41,8 +42,10 @@ describe('When using the RemoveTrustedAppFromPolicyModal component', () => { mockedApis = policyDetailsPageAllApiHttpMocks(appTestContext.coreStart.http); trustedApps = [ // The 3rd trusted app generated by the HTTP mock is a Policy Specific one - mockedApis.responseProvider.trustedAppsList({ query: {} } as HttpFetchOptionsWithPath) - .data[2], + exceptionListItemToTrustedApp( + mockedApis.responseProvider.trustedAppsList({ query: {} } as HttpFetchOptionsWithPath) + .data[2] + ), ]; // Delay the Update Trusted App API response so that we can test UI states while the update is underway. @@ -211,7 +214,7 @@ describe('When using the RemoveTrustedAppFromPolicyModal component', () => { await clickConfirmButton(true, true); expect(appTestContext.coreStart.notifications.toasts.addSuccess).toHaveBeenCalledWith({ - text: '"Avast Business Antivirus" has been removed from Endpoint Policy policy', + text: '"Generated Exception (3xnng)" has been removed from Endpoint Policy policy', title: 'Successfully removed', }); }); diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/list/remove_trusted_app_from_policy_modal.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/list/remove_trusted_app_from_policy_modal.tsx index fec9ae4d7a09b..28ae58c7f11f6 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/list/remove_trusted_app_from_policy_modal.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/trusted_apps/list/remove_trusted_app_from_policy_modal.tsx @@ -8,7 +8,7 @@ import React, { memo, useCallback, useEffect, useMemo } from 'react'; import { EuiCallOut, EuiConfirmModal, EuiSpacer, EuiText } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useDispatch } from 'react-redux'; import { Dispatch } from 'redux'; import { Immutable, TrustedApp } from '../../../../../../../common/endpoint/types'; diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/constants.ts b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/constants.ts index beefb8587d787..c13539426cff9 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/constants.ts +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/constants.ts @@ -5,6 +5,16 @@ * 2.0. */ +import { + CreateExceptionListSchema, + ExceptionListTypeEnum, +} from '@kbn/securitysolution-io-ts-list-types'; +import { + ENDPOINT_TRUSTED_APPS_LIST_DESCRIPTION, + ENDPOINT_TRUSTED_APPS_LIST_ID, + ENDPOINT_TRUSTED_APPS_LIST_NAME, +} from '@kbn/securitysolution-list-constants'; + export const SEARCHABLE_FIELDS: Readonly = [ `name`, `description`, @@ -12,3 +22,11 @@ export const SEARCHABLE_FIELDS: Readonly = [ `entries.value`, `entries.entries.value`, ]; + +export const TRUSTED_APPS_EXCEPTION_LIST_DEFINITION: CreateExceptionListSchema = { + name: ENDPOINT_TRUSTED_APPS_LIST_NAME, + namespace_type: 'agnostic', + description: ENDPOINT_TRUSTED_APPS_LIST_DESCRIPTION, + list_id: ENDPOINT_TRUSTED_APPS_LIST_ID, + type: ExceptionListTypeEnum.ENDPOINT_TRUSTED_APPS, +}; diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/service/errors.ts b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/service/errors.ts new file mode 100644 index 0000000000000..bcfff3f4bf360 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/service/errors.ts @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EndpointError } from '../../../../../common/endpoint/errors'; + +export class HttpRequestValidationError extends EndpointError { + public readonly body: { message: string }; + constructor(validationFailures: string[]) { + super('Invalid trusted application', validationFailures); + // Attempts to mirror an HTTP API error body + this.body = { + message: validationFailures.join(', ') ?? 'unknown', + }; + } +} diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/service/index.ts b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/service/index.ts index 2549dd5a2a4dc..3c0d58043dd02 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/service/index.ts +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/service/index.ts @@ -5,186 +5,4 @@ * 2.0. */ -import { HttpStart } from 'kibana/public'; - -import pMap from 'p-map'; -import { - TRUSTED_APPS_CREATE_API, - TRUSTED_APPS_DELETE_API, - TRUSTED_APPS_GET_API, - TRUSTED_APPS_LIST_API, - TRUSTED_APPS_UPDATE_API, - TRUSTED_APPS_SUMMARY_API, -} from '../../../../../common/endpoint/constants'; - -import { - DeleteTrustedAppsRequestParams, - GetTrustedAppsListResponse, - GetTrustedAppsListRequest, - PostTrustedAppCreateRequest, - PostTrustedAppCreateResponse, - GetTrustedAppsSummaryResponse, - PutTrustedAppUpdateRequest, - PutTrustedAppUpdateResponse, - PutTrustedAppsRequestParams, - GetOneTrustedAppRequestParams, - GetOneTrustedAppResponse, - GetTrustedAppsSummaryRequest, - TrustedApp, - MaybeImmutable, -} from '../../../../../common/endpoint/types'; -import { resolvePathVariables } from '../../../../common/utils/resolve_path_variables'; - -import { toUpdateTrustedApp } from '../../../../../common/endpoint/service/trusted_apps/to_update_trusted_app'; -import { isGlobalEffectScope } from '../state/type_guards'; -import { sendGetEndpointSpecificPackagePolicies } from '../../../services/policies'; - -export interface TrustedAppsService { - getTrustedApp(params: GetOneTrustedAppRequestParams): Promise; - getTrustedAppsList(request: GetTrustedAppsListRequest): Promise; - deleteTrustedApp(request: DeleteTrustedAppsRequestParams): Promise; - createTrustedApp(request: PostTrustedAppCreateRequest): Promise; - updateTrustedApp( - params: PutTrustedAppsRequestParams, - request: PutTrustedAppUpdateRequest - ): Promise; - getPolicyList( - options?: Parameters[1] - ): ReturnType; - assignPolicyToTrustedApps( - policyId: string, - trustedApps: MaybeImmutable - ): Promise; - removePolicyFromTrustedApps( - policyId: string, - trustedApps: MaybeImmutable - ): Promise; -} - -const P_MAP_OPTIONS = Object.freeze({ - concurrency: 5, - /** When set to false, instead of stopping when a promise rejects, it will wait for all the promises to settle - * and then reject with an aggregated error containing all the errors from the rejected promises. */ - stopOnError: false, -}); - -export class TrustedAppsHttpService implements TrustedAppsService { - constructor(private http: HttpStart) {} - - async getTrustedApp(params: GetOneTrustedAppRequestParams) { - return this.http.get( - resolvePathVariables(TRUSTED_APPS_GET_API, params) - ); - } - - async getTrustedAppsList(request: GetTrustedAppsListRequest) { - return this.http.get(TRUSTED_APPS_LIST_API, { - query: request, - }); - } - - async deleteTrustedApp(request: DeleteTrustedAppsRequestParams): Promise { - return this.http.delete(resolvePathVariables(TRUSTED_APPS_DELETE_API, request)); - } - - async createTrustedApp(request: PostTrustedAppCreateRequest) { - return this.http.post(TRUSTED_APPS_CREATE_API, { - body: JSON.stringify(request), - }); - } - - async updateTrustedApp( - params: PutTrustedAppsRequestParams, - updatedTrustedApp: PutTrustedAppUpdateRequest - ) { - return this.http.put( - resolvePathVariables(TRUSTED_APPS_UPDATE_API, params), - { body: JSON.stringify(updatedTrustedApp) } - ); - } - - async getTrustedAppsSummary(request: GetTrustedAppsSummaryRequest) { - return this.http.get(TRUSTED_APPS_SUMMARY_API, { - query: request, - }); - } - - getPolicyList(options?: Parameters[1]) { - return sendGetEndpointSpecificPackagePolicies(this.http, options); - } - - /** - * Assign a policy to trusted apps. Note that Trusted Apps MUST NOT be global - * - * @param policyId - * @param trustedApps[] - */ - assignPolicyToTrustedApps( - policyId: string, - trustedApps: MaybeImmutable - ): Promise { - return this._handleAssignOrRemovePolicyId('assign', policyId, trustedApps); - } - - /** - * Remove a policy from trusted apps. Note that Trusted Apps MUST NOT be global - * - * @param policyId - * @param trustedApps[] - */ - removePolicyFromTrustedApps( - policyId: string, - trustedApps: MaybeImmutable - ): Promise { - return this._handleAssignOrRemovePolicyId('remove', policyId, trustedApps); - } - - private _handleAssignOrRemovePolicyId( - action: 'assign' | 'remove', - policyId: string, - trustedApps: MaybeImmutable - ): Promise { - if (policyId.trim() === '') { - throw new Error('policy ID is required'); - } - - if (trustedApps.length === 0) { - throw new Error('at least one trusted app is required'); - } - - return pMap( - trustedApps, - async (trustedApp) => { - if (isGlobalEffectScope(trustedApp.effectScope)) { - throw new Error( - `Unable to update trusted app [${trustedApp.id}] policy assignment. It's effectScope is 'global'` - ); - } - - const policies: string[] = !isGlobalEffectScope(trustedApp.effectScope) - ? [...trustedApp.effectScope.policies] - : []; - - const indexOfPolicyId = policies.indexOf(policyId); - - if (action === 'assign' && indexOfPolicyId === -1) { - policies.push(policyId); - } else if (action === 'remove' && indexOfPolicyId !== -1) { - policies.splice(indexOfPolicyId, 1); - } - - return this.updateTrustedApp( - { id: trustedApp.id }, - { - ...toUpdateTrustedApp(trustedApp), - effectScope: { - type: 'policy', - policies, - }, - } - ); - }, - P_MAP_OPTIONS - ); - } -} +export * from './trusted_apps_http_service'; diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/service/mappers.ts b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/service/mappers.ts new file mode 100644 index 0000000000000..cab162fe30250 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/service/mappers.ts @@ -0,0 +1,266 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { + CreateExceptionListItemSchema, + EntriesArray, + EntryMatch, + EntryMatchWildcard, + EntryNested, + ExceptionListItemSchema, + NestedEntriesArray, + OsType, + UpdateExceptionListItemSchema, +} from '@kbn/securitysolution-io-ts-list-types'; +import { ENDPOINT_TRUSTED_APPS_LIST_ID } from '@kbn/securitysolution-list-constants'; +import { + ConditionEntry, + ConditionEntryField, + EffectScope, + NewTrustedApp, + OperatingSystem, + TrustedApp, + TrustedAppEntryTypes, + UpdateTrustedApp, +} from '../../../../../common/endpoint/types'; +import { + POLICY_REFERENCE_PREFIX, + tagsToEffectScope, +} from '../../../../../common/endpoint/service/trusted_apps/mapping'; + +type ConditionEntriesMap = { [K in ConditionEntryField]?: ConditionEntry }; +type Mapping = { [K in T]: U }; + +const OS_TYPE_TO_OPERATING_SYSTEM: Mapping = { + linux: OperatingSystem.LINUX, + macos: OperatingSystem.MAC, + windows: OperatingSystem.WINDOWS, +}; + +const OPERATING_SYSTEM_TO_OS_TYPE: Mapping = { + [OperatingSystem.LINUX]: 'linux', + [OperatingSystem.MAC]: 'macos', + [OperatingSystem.WINDOWS]: 'windows', +}; + +const OPERATOR_VALUE = 'included'; + +const filterUndefined = (list: Array): T[] => { + return list.filter((item: T | undefined): item is T => item !== undefined); +}; + +const createConditionEntry = ( + field: T, + type: TrustedAppEntryTypes, + value: string +): ConditionEntry => { + return { field, value, type, operator: OPERATOR_VALUE }; +}; + +const entriesToConditionEntriesMap = (entries: EntriesArray): ConditionEntriesMap => { + return entries.reduce((result, entry) => { + if (entry.field.startsWith('process.hash') && entry.type === 'match') { + return { + ...result, + [ConditionEntryField.HASH]: createConditionEntry( + ConditionEntryField.HASH, + entry.type, + entry.value + ), + }; + } else if ( + entry.field === 'process.executable.caseless' && + (entry.type === 'match' || entry.type === 'wildcard') + ) { + return { + ...result, + [ConditionEntryField.PATH]: createConditionEntry( + ConditionEntryField.PATH, + entry.type, + entry.value + ), + }; + } else if (entry.field === 'process.Ext.code_signature' && entry.type === 'nested') { + const subjectNameCondition = entry.entries.find((subEntry): subEntry is EntryMatch => { + return subEntry.field === 'subject_name' && subEntry.type === 'match'; + }); + + if (subjectNameCondition) { + return { + ...result, + [ConditionEntryField.SIGNER]: createConditionEntry( + ConditionEntryField.SIGNER, + subjectNameCondition.type, + subjectNameCondition.value + ), + }; + } + } + + return result; + }, {} as ConditionEntriesMap); +}; + +/** + * Map an ExceptionListItem to a TrustedApp item + * @param exceptionListItem + */ +export const exceptionListItemToTrustedApp = ( + exceptionListItem: ExceptionListItemSchema +): TrustedApp => { + if (exceptionListItem.os_types[0]) { + const os = osFromExceptionItem(exceptionListItem); + const grouped = entriesToConditionEntriesMap(exceptionListItem.entries); + + return { + id: exceptionListItem.item_id, + version: exceptionListItem._version || '', + name: exceptionListItem.name, + description: exceptionListItem.description, + effectScope: tagsToEffectScope(exceptionListItem.tags), + created_at: exceptionListItem.created_at, + created_by: exceptionListItem.created_by, + updated_at: exceptionListItem.updated_at, + updated_by: exceptionListItem.updated_by, + ...(os === OperatingSystem.LINUX || os === OperatingSystem.MAC + ? { + os, + entries: filterUndefined([ + grouped[ConditionEntryField.HASH], + grouped[ConditionEntryField.PATH], + ]), + } + : { + os, + entries: filterUndefined([ + grouped[ConditionEntryField.HASH], + grouped[ConditionEntryField.PATH], + grouped[ConditionEntryField.SIGNER], + ]), + }), + }; + } else { + throw new Error('Unknown Operating System assigned to trusted application.'); + } +}; + +const osFromExceptionItem = (exceptionListItem: ExceptionListItemSchema): TrustedApp['os'] => { + return OS_TYPE_TO_OPERATING_SYSTEM[exceptionListItem.os_types[0]]; +}; + +const hashType = (hash: string): 'md5' | 'sha256' | 'sha1' | undefined => { + switch (hash.length) { + case 32: + return 'md5'; + case 40: + return 'sha1'; + case 64: + return 'sha256'; + } +}; + +const createEntryMatch = (field: string, value: string): EntryMatch => { + return { field, value, type: 'match', operator: OPERATOR_VALUE }; +}; + +const createEntryMatchWildcard = (field: string, value: string): EntryMatchWildcard => { + return { field, value, type: 'wildcard', operator: OPERATOR_VALUE }; +}; + +const createEntryNested = (field: string, entries: NestedEntriesArray): EntryNested => { + return { field, entries, type: 'nested' }; +}; + +const effectScopeToTags = (effectScope: EffectScope) => { + if (effectScope.type === 'policy') { + return effectScope.policies.map((policy) => `${POLICY_REFERENCE_PREFIX}${policy}`); + } else { + return [`${POLICY_REFERENCE_PREFIX}all`]; + } +}; + +const conditionEntriesToEntries = (conditionEntries: ConditionEntry[]): EntriesArray => { + return conditionEntries.map((conditionEntry) => { + if (conditionEntry.field === ConditionEntryField.HASH) { + return createEntryMatch( + `process.hash.${hashType(conditionEntry.value)}`, + conditionEntry.value.toLowerCase() + ); + } else if (conditionEntry.field === ConditionEntryField.SIGNER) { + return createEntryNested(`process.Ext.code_signature`, [ + createEntryMatch('trusted', 'true'), + createEntryMatch('subject_name', conditionEntry.value), + ]); + } else if ( + conditionEntry.field === ConditionEntryField.PATH && + conditionEntry.type === 'wildcard' + ) { + return createEntryMatchWildcard(`process.executable.caseless`, conditionEntry.value); + } else { + return createEntryMatch(`process.executable.caseless`, conditionEntry.value); + } + }); +}; + +/** + * Map NewTrustedApp to CreateExceptionListItemOptions. + */ +export const newTrustedAppToCreateExceptionListItem = ({ + os, + entries, + name, + description = '', + effectScope, +}: NewTrustedApp): CreateExceptionListItemSchema => { + return { + comments: [], + description, + entries: conditionEntriesToEntries(entries), + list_id: ENDPOINT_TRUSTED_APPS_LIST_ID, + meta: undefined, + name, + namespace_type: 'agnostic', + os_types: [OPERATING_SYSTEM_TO_OS_TYPE[os]], + tags: effectScopeToTags(effectScope), + type: 'simple', + }; +}; + +/** + * Map UpdateTrustedApp to UpdateExceptionListItemOptions + * + * @param {ExceptionListItemSchema} currentTrustedAppExceptionItem + * @param {UpdateTrustedApp} updatedTrustedApp + */ +export const updatedTrustedAppToUpdateExceptionListItem = ( + { + id, + item_id: itemId, + namespace_type: namespaceType, + type, + comments, + meta, + }: ExceptionListItemSchema, + { os, entries, name, description = '', effectScope, version }: UpdateTrustedApp +): UpdateExceptionListItemSchema => { + return { + _version: version, + name, + description, + entries: conditionEntriesToEntries(entries), + os_types: [OPERATING_SYSTEM_TO_OS_TYPE[os]], + tags: effectScopeToTags(effectScope), + + // Copied from current trusted app exception item + id, + comments, + item_id: itemId, + meta, + namespace_type: namespaceType, + type, + }; +}; diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/service/trusted_apps_http_service.ts b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/service/trusted_apps_http_service.ts new file mode 100644 index 0000000000000..b12d5e9c65cd1 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/service/trusted_apps_http_service.ts @@ -0,0 +1,288 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import pMap from 'p-map'; +import { HttpStart } from 'kibana/public'; +import { + ENDPOINT_TRUSTED_APPS_LIST_ID, + EXCEPTION_LIST_ITEM_URL, + EXCEPTION_LIST_URL, +} from '@kbn/securitysolution-list-constants'; +import { + ExceptionListItemSchema, + ExceptionListSchema, + ExceptionListSummarySchema, + FoundExceptionListItemSchema, +} from '@kbn/securitysolution-io-ts-list-types'; +import { + DeleteTrustedAppsRequestParams, + GetOneTrustedAppRequestParams, + GetOneTrustedAppResponse, + GetTrustedAppsListRequest, + GetTrustedAppsListResponse, + GetTrustedAppsSummaryRequest, + MaybeImmutable, + PostTrustedAppCreateRequest, + PostTrustedAppCreateResponse, + PutTrustedAppsRequestParams, + PutTrustedAppUpdateRequest, + PutTrustedAppUpdateResponse, + TrustedApp, +} from '../../../../../common/endpoint/types'; +import { sendGetEndpointSpecificPackagePolicies } from '../../../services/policies'; +import { isGlobalEffectScope } from '../state/type_guards'; +import { toUpdateTrustedApp } from '../../../../../common/endpoint/service/trusted_apps/to_update_trusted_app'; +import { validateTrustedAppHttpRequestBody } from './validate_trusted_app_http_request_body'; +import { + exceptionListItemToTrustedApp, + newTrustedAppToCreateExceptionListItem, + updatedTrustedAppToUpdateExceptionListItem, +} from './mappers'; +import { TRUSTED_APPS_EXCEPTION_LIST_DEFINITION } from '../constants'; + +export interface TrustedAppsService { + getTrustedApp(params: GetOneTrustedAppRequestParams): Promise; + + getTrustedAppsList(request: GetTrustedAppsListRequest): Promise; + + deleteTrustedApp(request: DeleteTrustedAppsRequestParams): Promise; + + createTrustedApp(request: PostTrustedAppCreateRequest): Promise; + + updateTrustedApp( + params: PutTrustedAppsRequestParams, + request: PutTrustedAppUpdateRequest + ): Promise; + + getPolicyList( + options?: Parameters[1] + ): ReturnType; + + assignPolicyToTrustedApps( + policyId: string, + trustedApps: MaybeImmutable + ): Promise; + + removePolicyFromTrustedApps( + policyId: string, + trustedApps: MaybeImmutable + ): Promise; +} + +const P_MAP_OPTIONS = Object.freeze({ + concurrency: 5, + /** When set to false, instead of stopping when a promise rejects, it will wait for all the promises to settle + * and then reject with an aggregated error containing all the errors from the rejected promises. */ + stopOnError: false, +}); + +export class TrustedAppsHttpService implements TrustedAppsService { + private readonly getHttpService: () => Promise; + + constructor(http: HttpStart) { + let ensureListExists: Promise; + + this.getHttpService = async () => { + if (!ensureListExists) { + ensureListExists = http + .post(EXCEPTION_LIST_URL, { + body: JSON.stringify(TRUSTED_APPS_EXCEPTION_LIST_DEFINITION), + }) + .then(() => {}) + .catch((err) => { + if (err.response.status !== 409) { + return Promise.reject(err); + } + }); + } + + await ensureListExists; + return http; + }; + } + + private async getExceptionListItem(itemId: string): Promise { + return (await this.getHttpService()).get(EXCEPTION_LIST_ITEM_URL, { + query: { + item_id: itemId, + namespace_type: 'agnostic', + }, + }); + } + + async getTrustedApp(params: GetOneTrustedAppRequestParams) { + const exceptionItem = await this.getExceptionListItem(params.id); + + return { + data: exceptionListItemToTrustedApp(exceptionItem), + }; + } + + async getTrustedAppsList({ + page = 1, + per_page: perPage = 10, + kuery, + }: GetTrustedAppsListRequest): Promise { + const itemListResults = await ( + await this.getHttpService() + ).get(`${EXCEPTION_LIST_ITEM_URL}/_find`, { + query: { + page, + per_page: perPage, + filter: kuery, + sort_field: 'name', + sort_order: 'asc', + list_id: [ENDPOINT_TRUSTED_APPS_LIST_ID], + namespace_type: ['agnostic'], + }, + }); + + return { + ...itemListResults, + data: itemListResults.data.map(exceptionListItemToTrustedApp), + }; + } + + async deleteTrustedApp(request: DeleteTrustedAppsRequestParams): Promise { + await ( + await this.getHttpService() + ).delete(EXCEPTION_LIST_ITEM_URL, { + query: { + item_id: request.id, + namespace_type: 'agnostic', + }, + }); + } + + async createTrustedApp(request: PostTrustedAppCreateRequest) { + await validateTrustedAppHttpRequestBody(await this.getHttpService(), request); + + const newTrustedAppException = newTrustedAppToCreateExceptionListItem(request); + const createdExceptionItem = await ( + await this.getHttpService() + ).post(EXCEPTION_LIST_ITEM_URL, { + body: JSON.stringify(newTrustedAppException), + }); + + return { + data: exceptionListItemToTrustedApp(createdExceptionItem), + }; + } + + async updateTrustedApp( + params: PutTrustedAppsRequestParams, + updatedTrustedApp: PutTrustedAppUpdateRequest + ) { + const [currentExceptionListItem] = await Promise.all([ + await this.getExceptionListItem(params.id), + await validateTrustedAppHttpRequestBody(await this.getHttpService(), updatedTrustedApp), + ]); + + const updatedExceptionListItem = await ( + await this.getHttpService() + ).put(EXCEPTION_LIST_ITEM_URL, { + body: JSON.stringify( + updatedTrustedAppToUpdateExceptionListItem(currentExceptionListItem, updatedTrustedApp) + ), + }); + + return { + data: exceptionListItemToTrustedApp(updatedExceptionListItem), + }; + } + + async getTrustedAppsSummary(_: GetTrustedAppsSummaryRequest) { + return (await this.getHttpService()).get( + `${EXCEPTION_LIST_URL}/summary`, + { + query: { + list_id: ENDPOINT_TRUSTED_APPS_LIST_ID, + namespace_type: 'agnostic', + }, + } + ); + } + + async getPolicyList(options?: Parameters[1]) { + return sendGetEndpointSpecificPackagePolicies(await this.getHttpService(), options); + } + + /** + * Assign a policy to trusted apps. Note that Trusted Apps MUST NOT be global + * + * @param policyId + * @param trustedApps[] + */ + assignPolicyToTrustedApps( + policyId: string, + trustedApps: MaybeImmutable + ): Promise { + return this._handleAssignOrRemovePolicyId('assign', policyId, trustedApps); + } + + /** + * Remove a policy from trusted apps. Note that Trusted Apps MUST NOT be global + * + * @param policyId + * @param trustedApps[] + */ + removePolicyFromTrustedApps( + policyId: string, + trustedApps: MaybeImmutable + ): Promise { + return this._handleAssignOrRemovePolicyId('remove', policyId, trustedApps); + } + + private _handleAssignOrRemovePolicyId( + action: 'assign' | 'remove', + policyId: string, + trustedApps: MaybeImmutable + ): Promise { + if (policyId.trim() === '') { + throw new Error('policy ID is required'); + } + + if (trustedApps.length === 0) { + throw new Error('at least one trusted app is required'); + } + + return pMap( + trustedApps, + async (trustedApp) => { + if (isGlobalEffectScope(trustedApp.effectScope)) { + throw new Error( + `Unable to update trusted app [${trustedApp.id}] policy assignment. It's effectScope is 'global'` + ); + } + + const policies: string[] = !isGlobalEffectScope(trustedApp.effectScope) + ? [...trustedApp.effectScope.policies] + : []; + + const indexOfPolicyId = policies.indexOf(policyId); + + if (action === 'assign' && indexOfPolicyId === -1) { + policies.push(policyId); + } else if (action === 'remove' && indexOfPolicyId !== -1) { + policies.splice(indexOfPolicyId, 1); + } + + return this.updateTrustedApp( + { id: trustedApp.id }, + { + ...toUpdateTrustedApp(trustedApp), + effectScope: { + type: 'policy', + policies, + }, + } + ); + }, + P_MAP_OPTIONS + ); + } +} diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/service/validate_trusted_app_http_request_body.ts b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/service/validate_trusted_app_http_request_body.ts new file mode 100644 index 0000000000000..e0a5adac67494 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/service/validate_trusted_app_http_request_body.ts @@ -0,0 +1,60 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { HttpStart } from 'kibana/public'; +import { + PostTrustedAppCreateRequest, + PutTrustedAppUpdateRequest, +} from '../../../../../common/endpoint/types'; +import { HttpRequestValidationError } from './errors'; +import { sendGetAgentPolicyList } from '../../policy/store/services/ingest'; +import { AGENT_POLICY_SAVED_OBJECT_TYPE } from '../../../../../../fleet/common'; + +/** + * Validates that the Trusted App is valid for sending to the API (`POST` + 'PUT') + * + * @throws + */ +export const validateTrustedAppHttpRequestBody = async ( + http: HttpStart, + trustedApp: PostTrustedAppCreateRequest | PutTrustedAppUpdateRequest +): Promise => { + const failedValidations: string[] = []; + + // Validate that the Policy IDs are still valid + if (trustedApp.effectScope.type === 'policy' && trustedApp.effectScope.policies.length) { + const policyIds = trustedApp.effectScope.policies; + + // We can't search against the Package Policy API by ID because there is no way to do that. + // So, as a work-around, we use the Agent Policy API and check for those Agent Policies that + // have these package policies in it. For endpoint, these are 1-to-1. + const agentPoliciesFound = await sendGetAgentPolicyList(http, { + query: { + kuery: `${AGENT_POLICY_SAVED_OBJECT_TYPE}.package_policies: (${policyIds.join(' or ')})`, + }, + }); + + if (!agentPoliciesFound.items.length) { + failedValidations.push(`Invalid Policy Id(s) [${policyIds.join(', ')}]`); + } else { + const missingPolicies = policyIds.filter( + (policyId) => + !agentPoliciesFound.items.find(({ package_policies: packagePolicies }) => + (packagePolicies as string[]).includes(policyId) + ) + ); + + if (missingPolicies.length) { + failedValidations.push(`Invalid Policy Id(s) [${missingPolicies.join(', ')}]`); + } + } + } + + if (failedValidations.length) { + throw new HttpRequestValidationError(failedValidations); + } +}; diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/condition_group/index.tsx b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/condition_group/index.tsx index f514501afc2f0..fb7135b1173e0 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/condition_group/index.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/condition_group/index.tsx @@ -8,7 +8,7 @@ import React, { memo } from 'react'; import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiHideFor, EuiSpacer } from '@elastic/eui'; import styled from 'styled-components'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ConditionEntry, OperatingSystem } from '../../../../../../../common/endpoint/types'; import { AndOrBadge } from '../../../../../../common/components/and_or_badge'; import { ConditionEntryInput, ConditionEntryInputProps } from '../condition_entry_input'; diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/create_trusted_app_flyout.tsx b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/create_trusted_app_flyout.tsx index f72d54aa9e3c9..7b2c644d25b4a 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/create_trusted_app_flyout.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/create_trusted_app_flyout.tsx @@ -22,7 +22,7 @@ import { } from '@elastic/eui'; import React, { memo, useCallback, useEffect, useState, useMemo } from 'react'; import { EuiFlyoutProps } from '@elastic/eui/src/components/flyout/flyout'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useDispatch } from 'react-redux'; import { useHistory } from 'react-router-dom'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/empty_state.tsx b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/empty_state.tsx index 3e35ed3254e47..078b3d76db572 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/empty_state.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/empty_state.tsx @@ -7,7 +7,7 @@ import React, { memo } from 'react'; import { EuiButton, EuiEmptyPrompt } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ManagementEmptyStateWraper } from '../../../../components/management_empty_state_wraper'; export const EmptyState = memo<{ diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/logical_condition/logical_condition_builder.tsx b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/logical_condition/logical_condition_builder.tsx index d0a31bff2b638..3027454d33dde 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/logical_condition/logical_condition_builder.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/logical_condition/logical_condition_builder.tsx @@ -7,7 +7,7 @@ import React, { memo } from 'react'; import { CommonProps, EuiText, EuiPanel } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ConditionGroup, ConditionGroupProps } from '../condition_group'; import { useTestIdGenerator } from '../../../../../components/hooks/use_test_id_generator'; diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_app_deletion_dialog.test.tsx b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_app_deletion_dialog.test.tsx index 4950734bd2734..6abce21d7ccf5 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_app_deletion_dialog.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_app_deletion_dialog.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { Provider } from 'react-redux'; import { render } from '@testing-library/react'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { createGlobalNoMiddlewareStore, diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_app_deletion_dialog.tsx b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_app_deletion_dialog.tsx index 87c7439c236cc..1f7dd62d163da 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_app_deletion_dialog.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_app_deletion_dialog.tsx @@ -8,7 +8,7 @@ import React, { FC, memo, useCallback, useEffect, useMemo, useRef } from 'react'; import { useDispatch } from 'react-redux'; import { Dispatch } from 'redux'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiButtonEmpty, diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_apps_page.test.tsx b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_apps_page.test.tsx index 5d78de741e459..6144679787554 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_apps_page.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_apps_page.test.tsx @@ -13,28 +13,18 @@ import { fireEvent } from '@testing-library/dom'; import { MiddlewareActionSpyHelper } from '../../../../common/store/test_utils'; import { ConditionEntryField, - GetTrustedAppsListResponse, - NewTrustedApp, OperatingSystem, - PostTrustedAppCreateResponse, TrustedApp, } from '../../../../../common/endpoint/types'; -import { HttpFetchOptions } from 'kibana/public'; -import { - TRUSTED_APPS_GET_API, - TRUSTED_APPS_LIST_API, -} from '../../../../../common/endpoint/constants'; -import { - GetPackagePoliciesResponse, - PACKAGE_POLICY_API_ROUTES, -} from '../../../../../../fleet/common'; -import { EndpointDocGenerator } from '../../../../../common/endpoint/generate_data'; +import { HttpFetchOptions, HttpFetchOptionsWithPath } from 'kibana/public'; import { isFailedResourceState, isLoadedResourceState } from '../state'; +import { forceHTMLElementOffsetWidth } from '../../../components/effected_policy_select/test_utils'; import { toUpdateTrustedApp } from '../../../../../common/endpoint/service/trusted_apps/to_update_trusted_app'; import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; -import { resolvePathVariables } from '../../../../common/utils/resolve_path_variables'; import { licenseService } from '../../../../common/hooks/use_license'; -import { forceHTMLElementOffsetWidth } from '../../../components/effected_policy_select/test_utils'; +import { FoundExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; +import { EXCEPTION_LIST_ITEM_URL } from '@kbn/securitysolution-list-constants'; +import { trustedAppsAllHttpMocks } from '../../mocks'; // TODO: remove this mock when feature flag is removed jest.mock('../../../../common/hooks/use_experimental_features'); @@ -59,66 +49,17 @@ describe('When on the Trusted Apps Page', () => { 'Add a trusted application to improve performance or alleviate conflicts with other ' + 'applications running on your hosts.'; - const generator = new EndpointDocGenerator('policy-list'); - let mockedContext: AppContextTestRender; let history: AppContextTestRender['history']; let coreStart: AppContextTestRender['coreStart']; let waitForAction: MiddlewareActionSpyHelper['waitForAction']; let render: () => ReturnType; + let mockedApis: ReturnType; + const originalScrollTo = window.scrollTo; const act = reactTestingLibrary.act; - const getFakeTrustedApp = jest.fn(); - const createListApiResponse = ( - page: number = 1, - // eslint-disable-next-line @typescript-eslint/naming-convention - per_page: number = 20 - ): GetTrustedAppsListResponse => { - return { - data: [getFakeTrustedApp()], - total: 50, // << Should be a value large enough to fulfill two pages - page, - per_page, - }; - }; - - const mockListApis = (http: AppContextTestRender['coreStart']['http']) => { - const currentGetHandler = http.get.getMockImplementation(); - - http.get.mockImplementation(async (...args) => { - const path = args[0] as unknown as string; - // @ts-expect-error TS2352 - const httpOptions = args[1] as HttpFetchOptions; - - if (path === TRUSTED_APPS_LIST_API) { - return createListApiResponse( - Number(httpOptions?.query?.page ?? 1), - Number(httpOptions?.query?.per_page ?? 20) - ); - } - - if (path === PACKAGE_POLICY_API_ROUTES.LIST_PATTERN) { - const policy = generator.generatePolicyPackagePolicy(); - policy.name = 'test policy A'; - policy.id = 'abc123'; - - const response: GetPackagePoliciesResponse = { - items: [policy], - page: 1, - perPage: 1000, - total: 1, - }; - return response; - } - - if (currentGetHandler) { - return currentGetHandler(...args); - } - }); - }; - beforeAll(() => { window.scrollTo = () => {}; }); @@ -131,15 +72,15 @@ describe('When on the Trusted Apps Page', () => { mockedContext = createAppRootMockRenderer(); getFakeTrustedApp.mockImplementation( (): TrustedApp => ({ - id: '1111-2222-3333-4444', + id: '2d95bec3-b48f-4db7-9622-a2b061cc031d', version: 'abc123', - name: 'one app', + name: 'Generated Exception (3xnng)', os: OperatingSystem.WINDOWS, created_at: '2021-01-04T13:55:00.561Z', created_by: 'me', updated_at: '2021-01-04T13:55:00.561Z', updated_by: 'me', - description: 'a good one', + description: 'created by ExceptionListItemGenerator', effectScope: { type: 'global' }, entries: [ { @@ -156,6 +97,7 @@ describe('When on the Trusted Apps Page', () => { coreStart = mockedContext.coreStart; (licenseService.isPlatinumPlus as jest.Mock).mockReturnValue(true); waitForAction = mockedContext.middlewareSpy.waitForAction; + mockedApis = trustedAppsAllHttpMocks(coreStart.http); render = () => mockedContext.render(); reactTestingLibrary.act(() => { history.push('/administration/trusted_apps'); @@ -174,8 +116,6 @@ describe('When on the Trusted Apps Page', () => { return renderResult; }; - beforeEach(() => mockListApis(coreStart.http)); - it('should display subtitle info about trusted apps', async () => { const { getByTestId } = await renderWithListData(); expect(getByTestId('header-panel-subtitle').textContent).toEqual(expectedAboutInfo); @@ -199,7 +139,8 @@ describe('When on the Trusted Apps Page', () => { renderResult = await renderWithListData(); await act(async () => { - (await renderResult.findAllByTestId('trustedAppCard-header-actions-button'))[0].click(); + // The 3rd Trusted app to be rendered will be a policy specific one + (await renderResult.findAllByTestId('trustedAppCard-header-actions-button'))[2].click(); }); act(() => { @@ -284,7 +225,9 @@ describe('When on the Trusted Apps Page', () => { }); it('should persist edit params to url', () => { - expect(history.location.search).toEqual('?show=edit&id=1111-2222-3333-4444'); + expect(history.location.search).toEqual( + '?show=edit&id=2d95bec3-b48f-4db7-9622-a2b061cc031d' + ); }); it('should display the Edit flyout', () => { @@ -315,14 +258,19 @@ describe('When on the Trusted Apps Page', () => { 'addTrustedAppFlyout-createForm-descriptionField' ) as HTMLTextAreaElement; - expect(formNameInput.value).toEqual('one app'); - expect(formDescriptionInput.value).toEqual('a good one'); + expect(formNameInput.value).toEqual('Generated Exception (3xnng)'); + expect(formDescriptionInput.value).toEqual('created by ExceptionListItemGenerator'); }); describe('and when Save is clicked', () => { - it('should call the correct api (PUT)', () => { - act(() => { + it('should call the correct api (PUT)', async () => { + await act(async () => { fireEvent.click(renderResult.getByTestId('addTrustedAppFlyout-createButton')); + await waitForAction('trustedAppCreationSubmissionResourceStateChanged', { + validate({ payload }) { + return isLoadedResourceState(payload.newState); + }, + }); }); expect(coreStart.http.put).toHaveBeenCalledTimes(1); @@ -332,33 +280,43 @@ describe('When on the Trusted Apps Page', () => { HttpFetchOptions ]; - expect(lastCallToPut[0]).toEqual('/api/endpoint/trusted_apps/1111-2222-3333-4444'); + expect(lastCallToPut[0]).toEqual('/api/exception_lists/items'); + expect(JSON.parse(lastCallToPut[1].body as string)).toEqual({ - name: 'one app', - os: 'windows', + _version: '3o9za', + name: 'Generated Exception (3xnng)', + description: 'created by ExceptionListItemGenerator', entries: [ + { + field: 'process.hash.md5', + operator: 'included', + type: 'match', + value: '1234234659af249ddf3e40864e9fb241', + }, { field: 'process.executable.caseless', - value: 'one/two', operator: 'included', type: 'match', + value: '/one/two/three', }, ], - description: 'a good one', - effectScope: { - type: 'global', - }, - version: 'abc123', + os_types: ['windows'], + tags: [ + 'policy:ddf6570b-9175-4a6d-b288-61a09771c647', + 'policy:b8e616ae-44fc-4be7-846c-ce8fa5c082dd', + ], + id: '05b5e350-0cad-4dc3-a61d-6e6796b0af39', + comments: [], + item_id: '2d95bec3-b48f-4db7-9622-a2b061cc031d', + meta: {}, + namespace_type: 'agnostic', + type: 'simple', }); }); }); }); describe('and attempting to show Edit panel based on URL params', () => { - const TRUSTED_APP_GET_URI = resolvePathVariables(TRUSTED_APPS_GET_API, { - id: '9999-edit-8888', - }); - const renderAndWaitForGetApi = async () => { // the store action watcher is setup prior to render because `renderWithListData()` // also awaits API calls and this action could be missed. @@ -381,23 +339,6 @@ describe('When on the Trusted Apps Page', () => { }; beforeEach(() => { - // Mock the API GET for the trusted application - const priorMockImplementation = coreStart.http.get.getMockImplementation(); - coreStart.http.get.mockImplementation(async (...args) => { - if ('string' === typeof args[0] && args[0] === TRUSTED_APP_GET_URI) { - return { - data: { - ...getFakeTrustedApp(), - id: '9999-edit-8888', - name: 'one app for edit', - }, - }; - } - if (priorMockImplementation) { - return priorMockImplementation(...args); - } - }); - reactTestingLibrary.act(() => { history.push('/administration/trusted_apps?show=edit&id=9999-edit-8888'); }); @@ -406,7 +347,15 @@ describe('When on the Trusted Apps Page', () => { it('should retrieve trusted app via API using url `id`', async () => { renderResult = await renderAndWaitForGetApi(); - expect(coreStart.http.get).toHaveBeenCalledWith(TRUSTED_APP_GET_URI); + expect(coreStart.http.get.mock.calls).toContainEqual([ + EXCEPTION_LIST_ITEM_URL, + { + query: { + item_id: '9999-edit-8888', + namespace_type: 'agnostic', + }, + }, + ]); expect( ( @@ -414,7 +363,7 @@ describe('When on the Trusted Apps Page', () => { 'addTrustedAppFlyout-createForm-nameTextField' ) as HTMLInputElement ).value - ).toEqual('one app for edit'); + ).toEqual('Generated Exception (u6kh2)'); }); it('should redirect to list and show toast message if `id` is missing from URL', async () => { @@ -432,14 +381,8 @@ describe('When on the Trusted Apps Page', () => { it('should redirect to list and show toast message on API error for GET of `id`', async () => { // Mock the API GET for the trusted application - const priorMockImplementation = coreStart.http.get.getMockImplementation(); - coreStart.http.get.mockImplementation(async (...args) => { - if ('string' === typeof args[0] && args[0] === TRUSTED_APP_GET_URI) { - throw new Error('test: api error response'); - } - if (priorMockImplementation) { - return priorMockImplementation(...args); - } + mockedApis.responseProvider.trustedApp.mockImplementation(() => { + throw new Error('test: api error response'); }); await renderAndWaitForGetApi(); @@ -486,8 +429,6 @@ describe('When on the Trusted Apps Page', () => { return renderResult; }; - beforeEach(() => mockListApis(coreStart.http)); - it('should display the create flyout', async () => { const { getByTestId } = await renderAndClickAddButton(); const flyout = getByTestId('addTrustedAppFlyout'); @@ -505,6 +446,14 @@ describe('When on the Trusted Apps Page', () => { }); it('should preserve other URL search params', async () => { + const createListResponse = + mockedApis.responseProvider.trustedAppsList.getMockImplementation()!; + mockedApis.responseProvider.trustedAppsList.mockImplementation((...args) => { + const response = createListResponse(...args); + response.total = 100; // Trigger the UI to show pagination + return response; + }); + reactTestingLibrary.act(() => { history.push('/administration/trusted_apps?page_index=2&page_size=20'); }); @@ -524,7 +473,7 @@ describe('When on the Trusted Apps Page', () => { act(() => { fireEvent.click(renderResult.getByTestId('perPolicy')); }); - expect(renderResult.getByTestId('policy-abc123')); + expect(renderResult.getByTestId('policy-ddf6570b-9175-4a6d-b288-61a09771c647')); resetEnv(); }); @@ -582,39 +531,33 @@ describe('When on the Trusted Apps Page', () => { describe('and the Flyout Add button is clicked', () => { let renderResult: ReturnType; - let resolveHttpPost: (response?: PostTrustedAppCreateResponse) => void; - let httpPostBody: string; - let rejectHttpPost: (response: Error) => void; + let releasePostCreateApi: () => void; beforeEach(async () => { - // Mock the http.post() call and expose `resolveHttpPost()` method so that - // we can control when the API call response is returned, which will allow us - // to test the UI behaviours while the API call is in flight - coreStart.http.post.mockImplementation( - // @ts-expect-error TS2345 - async (_, options: HttpFetchOptions) => { - return new Promise((resolve, reject) => { - httpPostBody = options.body as string; - resolveHttpPost = resolve; - rejectHttpPost = reject; - }); - } + // Add a delay to the create api response provider and expose a function that allows + // us to release it at the right time. + mockedApis.responseProvider.trustedAppCreate.mockDelay.mockReturnValue( + new Promise((resolve) => { + releasePostCreateApi = resolve as typeof releasePostCreateApi; + }) ); renderResult = await renderAndClickAddButton(); await fillInCreateForm(); + const userClickedSaveActionWatcher = waitForAction('trustedAppCreationDialogConfirmed'); reactTestingLibrary.act(() => { fireEvent.click(renderResult.getByTestId('addTrustedAppFlyout-createButton'), { button: 1, }); }); + await reactTestingLibrary.act(async () => { await userClickedSaveActionWatcher; }); }); - afterEach(() => resolveHttpPost()); + afterEach(() => releasePostCreateApi()); it('should display info about Trusted Apps', async () => { expect(renderResult.getByTestId('addTrustedAppFlyout-about').textContent).toEqual( @@ -627,7 +570,7 @@ describe('When on the Trusted Apps Page', () => { (renderResult.getByTestId('addTrustedAppFlyout-cancelButton') as HTMLButtonElement) .disabled ).toBe(true); - resolveHttpPost(); + releasePostCreateApi(); }); it('should hide the dialog close button', async () => { @@ -644,23 +587,13 @@ describe('When on the Trusted Apps Page', () => { describe('and if create was successful', () => { beforeEach(async () => { - const successCreateApiResponse: PostTrustedAppCreateResponse = { - data: { - ...(JSON.parse(httpPostBody) as NewTrustedApp), - id: '1', - version: 'abc123', - created_at: '2020-09-16T14:09:45.484Z', - created_by: 'kibana', - updated_at: '2021-01-04T13:55:00.561Z', - updated_by: 'me', - }, - }; await reactTestingLibrary.act(async () => { const serverResponseAction = waitForAction( 'trustedAppCreationSubmissionResourceStateChanged' ); + coreStart.http.get.mockClear(); - resolveHttpPost(successCreateApiResponse); + releasePostCreateApi(); await serverResponseAction; }); }); @@ -671,33 +604,47 @@ describe('When on the Trusted Apps Page', () => { it('should show success toast notification', () => { expect(coreStart.notifications.toasts.addSuccess.mock.calls[0][0]).toEqual({ - text: '"one app" has been added to the Trusted Applications list.', + text: '"Generated Exception (3xnng)" has been added to the Trusted Applications list.', title: 'Success!', }); }); it('should trigger the List to reload', () => { const isCalled = coreStart.http.get.mock.calls.some( - (call) => call[0].toString() === TRUSTED_APPS_LIST_API + (call) => call[0].toString() === `${EXCEPTION_LIST_ITEM_URL}/_find` ); expect(isCalled).toEqual(true); }); }); describe('and if create failed', () => { + const ServerErrorResponseBodyMock = class extends Error { + public readonly body: { message: string }; + constructor(message = 'Test - Bad Call') { + super(message); + this.body = { + message, + }; + } + }; beforeEach(async () => { - const failedCreateApiResponse: Error & { body?: { message: string } } = new Error( - 'Bad call' - ); - failedCreateApiResponse.body = { - message: 'bad call', - }; + const failedCreateApiResponse = new ServerErrorResponseBodyMock(); + + mockedApis.responseProvider.trustedAppCreate.mockImplementation(() => { + throw failedCreateApiResponse; + }); + await reactTestingLibrary.act(async () => { const serverResponseAction = waitForAction( - 'trustedAppCreationSubmissionResourceStateChanged' + 'trustedAppCreationSubmissionResourceStateChanged', + { + validate({ payload }) { + return isFailedResourceState(payload.newState); + }, + } ); - coreStart.http.get.mockClear(); - rejectHttpPost(failedCreateApiResponse); + + releasePostCreateApi(); await serverResponseAction; }); }); @@ -773,54 +720,31 @@ describe('When on the Trusted Apps Page', () => { }); describe('and there are no trusted apps', () => { - const releaseExistsResponse: jest.MockedFunction<() => Promise> = - jest.fn(async () => { - return { - data: [], - total: 0, - page: 1, - per_page: 1, - }; - }); - const releaseListResponse: jest.MockedFunction<() => Promise> = - jest.fn(async () => { - return { - data: [], - total: 0, - page: 1, - per_page: 20, - }; - }); + const releaseExistsResponse = jest.fn((): FoundExceptionListItemSchema => { + return { + data: [], + total: 0, + page: 1, + per_page: 1, + }; + }); + const releaseListResponse = jest.fn((): FoundExceptionListItemSchema => { + return { + data: [], + total: 0, + page: 1, + per_page: 20, + }; + }); beforeEach(() => { - const priorMockImplementation = coreStart.http.get.getMockImplementation(); - // @ts-expect-error TS7006 - coreStart.http.get.mockImplementation((path, options) => { - if (path === TRUSTED_APPS_LIST_API) { - const { page, per_page: perPage } = options.query as { page: number; per_page: number }; - - if (page === 1 && perPage === 1) { - return releaseExistsResponse(); - } else { - return releaseListResponse(); - } - } - - if (path === PACKAGE_POLICY_API_ROUTES.LIST_PATTERN) { - const policy = generator.generatePolicyPackagePolicy(); - policy.name = 'test policy A'; - policy.id = 'abc123'; + mockedApis.responseProvider.trustedAppsList.mockImplementation(({ query }) => { + const { page, per_page: perPage } = query as { page: number; per_page: number }; - const response: GetPackagePoliciesResponse = { - items: [policy], - page: 1, - perPage: 1000, - total: 1, - }; - return response; - } - if (priorMockImplementation) { - return priorMockImplementation(path); + if (page === 1 && perPage === 1) { + return releaseExistsResponse(); + } else { + return releaseListResponse(); } }); }); @@ -831,8 +755,6 @@ describe('When on the Trusted Apps Page', () => { }); it('should show a loader until trusted apps existence can be confirmed', async () => { - // Make the call that checks if Trusted Apps exists not respond back - releaseExistsResponse.mockImplementationOnce(() => new Promise(() => {})); const renderResult = render(); expect(await renderResult.findByTestId('trustedAppsListLoader')).not.toBeNull(); }); @@ -851,14 +773,14 @@ describe('When on the Trusted Apps Page', () => { await waitForAction('trustedAppsExistStateChanged'); }); expect(await renderResult.findByTestId('trustedAppEmptyState')).not.toBeNull(); - releaseListResponse.mockResolvedValueOnce({ - data: [getFakeTrustedApp()], + releaseListResponse.mockReturnValueOnce({ + data: [mockedApis.responseProvider.trustedApp({ query: {} } as HttpFetchOptionsWithPath)], total: 1, page: 1, per_page: 20, }); - releaseExistsResponse.mockResolvedValueOnce({ - data: [getFakeTrustedApp()], + releaseExistsResponse.mockReturnValueOnce({ + data: [mockedApis.responseProvider.trustedApp({ query: {} } as HttpFetchOptionsWithPath)], total: 1, page: 1, per_page: 1, @@ -875,14 +797,14 @@ describe('When on the Trusted Apps Page', () => { }); it('should should show empty prompt once the last trusted app entry is deleted', async () => { - releaseListResponse.mockResolvedValueOnce({ - data: [getFakeTrustedApp()], + releaseListResponse.mockReturnValueOnce({ + data: [mockedApis.responseProvider.trustedApp({ query: {} } as HttpFetchOptionsWithPath)], total: 1, page: 1, per_page: 20, }); - releaseExistsResponse.mockResolvedValueOnce({ - data: [getFakeTrustedApp()], + releaseExistsResponse.mockReturnValueOnce({ + data: [mockedApis.responseProvider.trustedApp({ query: {} } as HttpFetchOptionsWithPath)], total: 1, page: 1, per_page: 1, @@ -896,19 +818,6 @@ describe('When on the Trusted Apps Page', () => { expect(await renderResult.findByTestId('trustedAppsListPageContent')).not.toBeNull(); - releaseListResponse.mockResolvedValueOnce({ - data: [], - total: 0, - page: 1, - per_page: 20, - }); - releaseExistsResponse.mockResolvedValueOnce({ - data: [], - total: 0, - page: 1, - per_page: 1, - }); - await act(async () => { mockedContext.store.dispatch({ type: 'trustedAppsListDataOutdated', @@ -931,7 +840,6 @@ describe('When on the Trusted Apps Page', () => { describe('and the search is dispatched', () => { let renderResult: ReturnType; beforeEach(async () => { - mockListApis(coreStart.http); reactTestingLibrary.act(() => { history.push('/administration/trusted_apps?filter=test'); }); @@ -956,28 +864,6 @@ describe('When on the Trusted Apps Page', () => { describe('and the back button is present', () => { let renderResult: ReturnType; beforeEach(async () => { - // Ensure implementation is defined before render to avoid undefined responses from hidden api calls - const priorMockImplementation = coreStart.http.get.getMockImplementation(); - // @ts-expect-error TS7006 - coreStart.http.get.mockImplementation((path, options) => { - if (path === PACKAGE_POLICY_API_ROUTES.LIST_PATTERN) { - const policy = generator.generatePolicyPackagePolicy(); - policy.name = 'test policy A'; - policy.id = 'abc123'; - - const response: GetPackagePoliciesResponse = { - items: [policy], - page: 1, - perPage: 1000, - total: 1, - }; - return response; - } - if (priorMockImplementation) { - return priorMockImplementation(path); - } - }); - renderResult = render(); await act(async () => { await waitForAction('trustedAppsListResourceStateChanged'); diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_apps_page.tsx b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_apps_page.tsx index dcdf86e395619..2382877ce6682 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_apps_page.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_apps_page.tsx @@ -9,7 +9,7 @@ import React, { memo, useMemo, useCallback } from 'react'; import { useDispatch } from 'react-redux'; import { Dispatch } from 'redux'; import { useLocation } from 'react-router-dom'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiEmptyPrompt, diff --git a/x-pack/plugins/security_solution/public/network/components/embeddables/index_patterns_missing_prompt.tsx b/x-pack/plugins/security_solution/public/network/components/embeddables/index_patterns_missing_prompt.tsx index a0ed555b6cec2..97fe8713705e3 100644 --- a/x-pack/plugins/security_solution/public/network/components/embeddables/index_patterns_missing_prompt.tsx +++ b/x-pack/plugins/security_solution/public/network/components/embeddables/index_patterns_missing_prompt.tsx @@ -6,7 +6,7 @@ */ import { EuiButton, EuiCode, EuiEmptyPrompt } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { useKibana, useBasePath } from '../../../common/lib/kibana'; diff --git a/x-pack/plugins/security_solution/public/overview/components/endpoint_notice/index.tsx b/x-pack/plugins/security_solution/public/overview/components/endpoint_notice/index.tsx index 39193742021f1..38d82fe36d805 100644 --- a/x-pack/plugins/security_solution/public/overview/components/endpoint_notice/index.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/endpoint_notice/index.tsx @@ -7,7 +7,7 @@ import React, { memo } from 'react'; import { EuiCallOut, EuiButton, EuiButtonEmpty } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useKibana } from '../../../common/lib/kibana'; import { APP_UI_ID } from '../../../../common/constants'; import { getEndpointListPath } from '../../../management/common/routing'; diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/cti_disabled_module.test.tsx b/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/cti_disabled_module.test.tsx index 1ad7975572f46..ce641d5309916 100644 --- a/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/cti_disabled_module.test.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/cti_disabled_module.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { Provider } from 'react-redux'; import { cloneDeep } from 'lodash/fp'; import { render, screen } from '@testing-library/react'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { CtiDisabledModule } from './cti_disabled_module'; import { ThemeProvider } from 'styled-components'; import { createStore, State } from '../../../common/store'; diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/cti_enabled_module.test.tsx b/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/cti_enabled_module.test.tsx index 310b03959746e..db83d9e1bcfe5 100644 --- a/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/cti_enabled_module.test.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/cti_enabled_module.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { Provider } from 'react-redux'; import { cloneDeep } from 'lodash/fp'; import { render, screen } from '@testing-library/react'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { CtiEnabledModule } from './cti_enabled_module'; import { ThemeProvider } from 'styled-components'; import { createStore, State } from '../../../common/store'; diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/cti_no_events.test.tsx b/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/cti_no_events.test.tsx index 926f6175c3129..8f624dabd64d1 100644 --- a/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/cti_no_events.test.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/cti_no_events.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { Provider } from 'react-redux'; import { cloneDeep } from 'lodash/fp'; import { render, screen } from '@testing-library/react'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { CtiNoEvents } from './cti_no_events'; import { ThemeProvider } from 'styled-components'; import { createStore, State } from '../../../common/store'; diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/cti_with_events.test.tsx b/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/cti_with_events.test.tsx index fac05bb72df38..a50e3e91ab9e5 100644 --- a/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/cti_with_events.test.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/cti_with_events.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { Provider } from 'react-redux'; import { cloneDeep } from 'lodash/fp'; import { mount } from 'enzyme'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { CtiWithEvents } from './cti_with_events'; import { ThemeProvider } from 'styled-components'; import { createStore, State } from '../../../common/store'; diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/index.test.tsx b/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/index.test.tsx index b614c5e2fb906..dfd9c6c9a7fcd 100644 --- a/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/index.test.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/index.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { Provider } from 'react-redux'; import { cloneDeep } from 'lodash/fp'; import { mount } from 'enzyme'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { ThreatIntelLinkPanel } from '.'; import { ThemeProvider } from 'styled-components'; import { createStore, State } from '../../../common/store'; diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/threat_intel_panel_view.tsx b/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/threat_intel_panel_view.tsx index 0e968be1573de..189f230c02c8d 100644 --- a/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/threat_intel_panel_view.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/threat_intel_panel_view.tsx @@ -7,7 +7,7 @@ import React, { useMemo } from 'react'; import { EuiButton, EuiTableFieldDataColumnType } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useKibana } from '../../../common/lib/kibana'; import * as i18n from './translations'; diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_host/index.tsx b/x-pack/plugins/security_solution/public/overview/components/overview_host/index.tsx index 723c768190cb5..32585c8836cc3 100644 --- a/x-pack/plugins/security_solution/public/overview/components/overview_host/index.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/overview_host/index.tsx @@ -8,7 +8,7 @@ import { isEmpty } from 'lodash/fp'; import { EuiFlexItem, EuiPanel } from '@elastic/eui'; import numeral from '@elastic/numeral'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useMemo, useCallback } from 'react'; import { DEFAULT_NUMBER_FORMAT, APP_UI_ID } from '../../../../common/constants'; diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_host_stats/index.tsx b/x-pack/plugins/security_solution/public/overview/components/overview_host_stats/index.tsx index 7ddf5d06712db..2c2b92213d22f 100644 --- a/x-pack/plugins/security_solution/public/overview/components/overview_host_stats/index.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/overview_host_stats/index.tsx @@ -6,7 +6,7 @@ */ import { EuiAccordion, EuiFlexGroup, EuiFlexItem, EuiHorizontalRule, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import styled from 'styled-components'; diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_network/index.tsx b/x-pack/plugins/security_solution/public/overview/components/overview_network/index.tsx index dd779f1656e92..7607a9eac4926 100644 --- a/x-pack/plugins/security_solution/public/overview/components/overview_network/index.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/overview_network/index.tsx @@ -8,7 +8,7 @@ import { isEmpty } from 'lodash/fp'; import { EuiFlexItem, EuiPanel } from '@elastic/eui'; import numeral from '@elastic/numeral'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useMemo, useCallback } from 'react'; import { DEFAULT_NUMBER_FORMAT, APP_UI_ID } from '../../../../common/constants'; diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_network_stats/index.tsx b/x-pack/plugins/security_solution/public/overview/components/overview_network_stats/index.tsx index 6feec6e649e70..aacde72700b75 100644 --- a/x-pack/plugins/security_solution/public/overview/components/overview_network_stats/index.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/overview_network_stats/index.tsx @@ -6,7 +6,7 @@ */ import { EuiAccordion, EuiFlexGroup, EuiFlexItem, EuiHorizontalRule, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import styled from 'styled-components'; diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/index.test.tsx b/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/index.test.tsx index aecd702077d43..2476b4d07c3c7 100644 --- a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/index.test.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/index.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { Provider } from 'react-redux'; import { cloneDeep } from 'lodash/fp'; import { render, screen } from '@testing-library/react'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { ThemeProvider } from 'styled-components'; import { mockTheme } from '../overview_cti_links/mock'; import { RiskyHostLinks } from '.'; diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_disabled_module.test.tsx b/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_disabled_module.test.tsx index 9aa1421287220..07108fd4f6ccb 100644 --- a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_disabled_module.test.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_disabled_module.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { Provider } from 'react-redux'; import { cloneDeep } from 'lodash/fp'; import { render, screen } from '@testing-library/react'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { ThemeProvider } from 'styled-components'; import { createStore, State } from '../../../common/store'; import { diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_enabled_module.test.tsx b/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_enabled_module.test.tsx index 0126f115bec88..912945549be8c 100644 --- a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_enabled_module.test.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_enabled_module.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { Provider } from 'react-redux'; import { cloneDeep } from 'lodash/fp'; import { render, screen } from '@testing-library/react'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { ThemeProvider } from 'styled-components'; import { createStore, State } from '../../../common/store'; import { diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_panel_view.tsx b/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_panel_view.tsx index 84864902f75d3..eb4e226940c5f 100644 --- a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_panel_view.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_panel_view.tsx @@ -8,7 +8,7 @@ import React, { useMemo } from 'react'; import { EuiButton, EuiTableFieldDataColumnType } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { InnerLinkPanel, LinkPanel, LinkPanelListItem } from '../link_panel'; import { LinkPanelViewProps } from '../link_panel/types'; import { Link } from '../link_panel/link'; diff --git a/x-pack/plugins/security_solution/public/resolver/test_utilities/simulator/mock_resolver.tsx b/x-pack/plugins/security_solution/public/resolver/test_utilities/simulator/mock_resolver.tsx index b49279dbe3710..b8dbb5611b26c 100644 --- a/x-pack/plugins/security_solution/public/resolver/test_utilities/simulator/mock_resolver.tsx +++ b/x-pack/plugins/security_solution/public/resolver/test_utilities/simulator/mock_resolver.tsx @@ -9,7 +9,7 @@ import React, { useEffect, useState, useCallback } from 'react'; import { Router } from 'react-router-dom'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { Provider } from 'react-redux'; import { Store } from 'redux'; import { KibanaContextProvider } from '../../../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/security_solution/public/resolver/view/edge_line.tsx b/x-pack/plugins/security_solution/public/resolver/view/edge_line.tsx index 43c1905e91c82..5508a7e0aed76 100644 --- a/x-pack/plugins/security_solution/public/resolver/view/edge_line.tsx +++ b/x-pack/plugins/security_solution/public/resolver/view/edge_line.tsx @@ -9,7 +9,7 @@ import React from 'react'; import styled from 'styled-components'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { applyMatrix3, distance, angle } from '../models/vector2'; import { Vector2, Matrix3, EdgeLineMetadata } from '../types'; import { fontSize } from './font_size'; diff --git a/x-pack/plugins/security_solution/public/resolver/view/limit_warnings.tsx b/x-pack/plugins/security_solution/public/resolver/view/limit_warnings.tsx index 45d4e741e4b89..22d6990710687 100644 --- a/x-pack/plugins/security_solution/public/resolver/view/limit_warnings.tsx +++ b/x-pack/plugins/security_solution/public/resolver/view/limit_warnings.tsx @@ -8,7 +8,7 @@ /* eslint-disable react/display-name */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { LimitWarningsEuiCallOut } from './styles'; const lineageLimitMessage = ( diff --git a/x-pack/plugins/security_solution/public/resolver/view/panels/descriptive_name.test.tsx b/x-pack/plugins/security_solution/public/resolver/view/panels/descriptive_name.test.tsx index 43b8b8dfa0064..75698bf726642 100644 --- a/x-pack/plugins/security_solution/public/resolver/view/panels/descriptive_name.test.tsx +++ b/x-pack/plugins/security_solution/public/resolver/view/panels/descriptive_name.test.tsx @@ -10,7 +10,7 @@ import { EndpointDocGenerator } from '../../../../common/endpoint/generate_data' import { DescriptiveName } from './descriptive_name'; import { SafeResolverEvent } from '../../../../common/endpoint/types'; import { mount, ReactWrapper } from 'enzyme'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; describe('DescriptiveName', () => { let generator: EndpointDocGenerator; diff --git a/x-pack/plugins/security_solution/public/resolver/view/panels/descriptive_name.tsx b/x-pack/plugins/security_solution/public/resolver/view/panels/descriptive_name.tsx index 9811a89bf0e10..a95f52d612a76 100644 --- a/x-pack/plugins/security_solution/public/resolver/view/panels/descriptive_name.tsx +++ b/x-pack/plugins/security_solution/public/resolver/view/panels/descriptive_name.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { isLegacyEventSafeVersion, diff --git a/x-pack/plugins/security_solution/public/resolver/view/panels/event_detail.tsx b/x-pack/plugins/security_solution/public/resolver/view/panels/event_detail.tsx index 6fde15b85a2fc..500dbb35f5767 100644 --- a/x-pack/plugins/security_solution/public/resolver/view/panels/event_detail.tsx +++ b/x-pack/plugins/security_solution/public/resolver/view/panels/event_detail.tsx @@ -11,7 +11,7 @@ import React, { memo, useMemo, Fragment, HTMLAttributes } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiSpacer, EuiText, EuiDescriptionList, EuiTextColor, EuiTitle } from '@elastic/eui'; import styled from 'styled-components'; import { useSelector } from 'react-redux'; diff --git a/x-pack/plugins/security_solution/public/resolver/view/panels/node_detail.tsx b/x-pack/plugins/security_solution/public/resolver/view/panels/node_detail.tsx index a3f1b1fccb5de..eaa7813ddc966 100644 --- a/x-pack/plugins/security_solution/public/resolver/view/panels/node_detail.tsx +++ b/x-pack/plugins/security_solution/public/resolver/view/panels/node_detail.tsx @@ -11,7 +11,7 @@ import React, { memo, useMemo, HTMLAttributes } from 'react'; import { useSelector } from 'react-redux'; import { i18n } from '@kbn/i18n'; import { htmlIdGenerator, EuiSpacer, EuiTitle, EuiText, EuiTextColor, EuiLink } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import styled from 'styled-components'; import { EuiDescriptionListProps } from '@elastic/eui/src/components/description_list/description_list'; import { StyledDescriptionList, StyledTitle } from './styles'; diff --git a/x-pack/plugins/security_solution/public/resolver/view/panels/node_events.tsx b/x-pack/plugins/security_solution/public/resolver/view/panels/node_events.tsx index e7cd37506134f..61e848782a8ed 100644 --- a/x-pack/plugins/security_solution/public/resolver/view/panels/node_events.tsx +++ b/x-pack/plugins/security_solution/public/resolver/view/panels/node_events.tsx @@ -10,7 +10,7 @@ import React, { memo, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiBasicTableColumn, EuiButtonEmpty, EuiSpacer, EuiInMemoryTable } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useSelector } from 'react-redux'; import { Breadcrumbs } from './breadcrumbs'; import * as event from '../../../../common/endpoint/models/event'; diff --git a/x-pack/plugins/security_solution/public/resolver/view/panels/node_events_of_type.tsx b/x-pack/plugins/security_solution/public/resolver/view/panels/node_events_of_type.tsx index 09437c662ead9..ebe04139802f4 100644 --- a/x-pack/plugins/security_solution/public/resolver/view/panels/node_events_of_type.tsx +++ b/x-pack/plugins/security_solution/public/resolver/view/panels/node_events_of_type.tsx @@ -19,7 +19,7 @@ import { EuiCallOut, } from '@elastic/eui'; import { useSelector } from 'react-redux'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { StyledPanel } from '../styles'; import { BoldCode, StyledTime } from './styles'; import { Breadcrumbs } from './breadcrumbs'; diff --git a/x-pack/plugins/security_solution/public/resolver/view/process_event_dot.tsx b/x-pack/plugins/security_solution/public/resolver/view/process_event_dot.tsx index 86b908c5afd9f..214f8eba0eec8 100644 --- a/x-pack/plugins/security_solution/public/resolver/view/process_event_dot.tsx +++ b/x-pack/plugins/security_solution/public/resolver/view/process_event_dot.tsx @@ -9,7 +9,7 @@ import React, { useCallback, useMemo, useContext } from 'react'; import styled from 'styled-components'; import { htmlIdGenerator, EuiButton, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { useSelector } from 'react-redux'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { NodeSubMenu } from './styles'; import { applyMatrix3 } from '../models/vector2'; diff --git a/x-pack/plugins/security_solution/public/resolver/view/resolver_without_providers.tsx b/x-pack/plugins/security_solution/public/resolver/view/resolver_without_providers.tsx index e0fd79597dd1f..863ca21e4fd7e 100644 --- a/x-pack/plugins/security_solution/public/resolver/view/resolver_without_providers.tsx +++ b/x-pack/plugins/security_solution/public/resolver/view/resolver_without_providers.tsx @@ -10,7 +10,7 @@ import React, { useContext, useCallback } from 'react'; import { useSelector } from 'react-redux'; import { EuiLoadingSpinner } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useResolverQueryParamCleaner } from './use_resolver_query_params_cleaner'; import * as selectors from '../store/selectors'; import { EdgeLine } from './edge_line'; diff --git a/x-pack/plugins/security_solution/public/resolver/view/submenu.tsx b/x-pack/plugins/security_solution/public/resolver/view/submenu.tsx index 1315a7d6c45d9..fe25547ef99dc 100644 --- a/x-pack/plugins/security_solution/public/resolver/view/submenu.tsx +++ b/x-pack/plugins/security_solution/public/resolver/view/submenu.tsx @@ -7,7 +7,7 @@ import { i18n } from '@kbn/i18n'; import React, { useMemo, useContext, useCallback } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useDispatch } from 'react-redux'; import { EuiI18nNumber } from '@elastic/eui'; import { EventStats } from '../../../common/endpoint/types'; diff --git a/x-pack/plugins/security_solution/public/timelines/components/create_field_button/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/create_field_button/index.test.tsx index d373710c29444..1708509b31864 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/create_field_button/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/create_field_button/index.test.tsx @@ -11,7 +11,7 @@ import { CreateFieldButton } from './index'; import { indexPatternFieldEditorPluginMock, Start, -} from '../../../../../../../src/plugins/index_pattern_field_editor/public/mocks'; +} from '../../../../../../../src/plugins/data_view_field_editor/public/mocks'; import { TestProviders } from '../../../common/mock'; import { useKibana } from '../../../common/lib/kibana'; @@ -28,7 +28,7 @@ const runAllPromises = () => new Promise(setImmediate); describe('CreateFieldButton', () => { beforeEach(() => { mockIndexPatternFieldEditor = indexPatternFieldEditorPluginMock.createStartContract(); - useKibanaMock().services.indexPatternFieldEditor = mockIndexPatternFieldEditor; + useKibanaMock().services.dataViewFieldEditor = mockIndexPatternFieldEditor; useKibanaMock().services.data.dataViews.get = () => new Promise(() => undefined); }); diff --git a/x-pack/plugins/security_solution/public/timelines/components/create_field_button/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/create_field_button/index.tsx index 8c6b8a01ea1f6..088c37d36c167 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/create_field_button/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/create_field_button/index.tsx @@ -39,7 +39,7 @@ export const CreateFieldButton = React.memo( const { indexFieldsSearch } = useDataView(); const { - indexPatternFieldEditor, + dataViewFieldEditor, data: { dataViews }, } = useKibana().services; @@ -51,8 +51,8 @@ export const CreateFieldButton = React.memo( const onClick = useCallback(() => { if (dataView) { - indexPatternFieldEditor?.openEditor({ - ctx: { indexPattern: dataView }, + dataViewFieldEditor?.openEditor({ + ctx: { dataView }, onSave: (field: DataViewField) => { // Fetch the updated list of fields indexFieldsSearch(selectedDataViewId); @@ -74,7 +74,7 @@ export const CreateFieldButton = React.memo( } onClickParam(); }, [ - indexPatternFieldEditor, + dataViewFieldEditor, dataView, onClickParam, indexFieldsSearch, @@ -83,7 +83,7 @@ export const CreateFieldButton = React.memo( timelineId, ]); - if (!indexPatternFieldEditor?.userPermissions.editIndexPattern()) { + if (!dataViewFieldEditor?.userPermissions.editIndexPattern()) { return null; } diff --git a/x-pack/plugins/security_solution/public/timelines/components/field_renderers/field_renderers.tsx b/x-pack/plugins/security_solution/public/timelines/components/field_renderers/field_renderers.tsx index af5596be0732f..610ab8ae986cc 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/field_renderers/field_renderers.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/field_renderers/field_renderers.tsx @@ -6,7 +6,7 @@ */ import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiPopover, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { getOr } from 'lodash/fp'; import React, { useCallback, Fragment, useMemo, useState } from 'react'; import styled from 'styled-components'; diff --git a/x-pack/plugins/security_solution/public/timelines/components/flyout/header/active_timelines.tsx b/x-pack/plugins/security_solution/public/timelines/components/flyout/header/active_timelines.tsx index 639bc1ac6b57f..e97c225a4fb5d 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/flyout/header/active_timelines.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/flyout/header/active_timelines.tsx @@ -10,7 +10,7 @@ import React, { useCallback, useMemo } from 'react'; import { useDispatch } from 'react-redux'; import { isEmpty } from 'lodash/fp'; import styled from 'styled-components'; -import { FormattedRelative } from '@kbn/i18n/react'; +import { FormattedRelative } from '@kbn/i18n-react'; import { TimelineStatus, TimelineType } from '../../../../../common/types/timeline'; import { TimelineEventsCountBadge } from '../../../../common/hooks/use_timeline_events_count'; diff --git a/x-pack/plugins/security_solution/public/timelines/components/flyout/header/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/flyout/header/index.test.tsx index 7b103fae483b1..a76e5e652d4ff 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/flyout/header/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/flyout/header/index.test.tsx @@ -26,8 +26,8 @@ jest.mock('../../../containers/kpis', () => ({ })); const useKibanaMock = useKibana as jest.Mocked; jest.mock('../../../../common/lib/kibana'); -jest.mock('@kbn/i18n/react', () => { - const originalModule = jest.requireActual('@kbn/i18n/react'); +jest.mock('@kbn/i18n-react', () => { + const originalModule = jest.requireActual('@kbn/i18n-react'); const FormattedRelative = jest.fn().mockImplementation(() => '20 hours ago'); return { diff --git a/x-pack/plugins/security_solution/public/timelines/components/flyout/header/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/flyout/header/index.tsx index bddd6256a992c..9c5b2887d2a8e 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/flyout/header/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/flyout/header/index.tsx @@ -19,7 +19,7 @@ import React, { MouseEventHandler, MouseEvent, useCallback, useMemo } from 'reac import { isEmpty, get, pick } from 'lodash/fp'; import { useDispatch, useSelector } from 'react-redux'; import styled from 'styled-components'; -import { FormattedRelative } from '@kbn/i18n/react'; +import { FormattedRelative } from '@kbn/i18n-react'; import { useDeepEqualSelector } from '../../../../common/hooks/use_selector'; import { diff --git a/x-pack/plugins/security_solution/public/timelines/components/formatted_duration/tooltip/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/formatted_duration/tooltip/index.tsx index 8c58078892b28..c2f8a46da5cf5 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/formatted_duration/tooltip/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/formatted_duration/tooltip/index.tsx @@ -7,7 +7,7 @@ import { EuiToolTip } from '@elastic/eui'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import styled from 'styled-components'; import { getHumanizedDuration } from '../helpers'; diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/delete_timeline_modal/delete_timeline_modal.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/delete_timeline_modal/delete_timeline_modal.tsx index f0efda6528507..bb82464a5aae9 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/delete_timeline_modal/delete_timeline_modal.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/delete_timeline_modal/delete_timeline_modal.tsx @@ -6,7 +6,7 @@ */ import { EuiConfirmModal, EUI_MODAL_CONFIRM_BUTTON } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useCallback } from 'react'; import { isEmpty } from 'lodash/fp'; diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/note_previews/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/note_previews/index.tsx index 7693efad0730d..57d9a330d2e58 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/note_previews/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/note_previews/index.tsx @@ -13,7 +13,7 @@ import { EuiScreenReaderOnly, EuiText, } from '@elastic/eui'; -import { FormattedRelative } from '@kbn/i18n/react'; +import { FormattedRelative } from '@kbn/i18n-react'; import React, { useCallback, useMemo } from 'react'; import styled from 'styled-components'; import { useDispatch } from 'react-redux'; diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline.tsx b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline.tsx index 05f5a90346379..fcecca2da5df1 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline.tsx @@ -7,7 +7,7 @@ import { EuiBasicTable } from '@elastic/eui'; import React, { useCallback, useMemo, useRef } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import styled from 'styled-components'; import { TimelineType, TimelineStatus } from '../../../../common/types/timeline'; diff --git a/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/footer.tsx b/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/footer.tsx index 535ad225a81cf..50fe19f4d804a 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/footer.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/footer.tsx @@ -56,7 +56,9 @@ export const EventDetailsFooterComponent = React.memo( timelineQuery, }: EventDetailsFooterProps & PropsFromRedux) => { const ruleIndex = useMemo( - () => find({ category: 'signal', field: 'signal.rule.index' }, detailsData)?.values, + () => + find({ category: 'signal', field: 'signal.rule.index' }, detailsData)?.values ?? + find({ category: 'kibana', field: 'kibana.alert.rule.index' }, detailsData)?.values, [detailsData] ); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.tsx index 5ca2db730da85..4ccec85c9a96c 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/actions/index.tsx @@ -165,7 +165,7 @@ const ActionsComponent: React.FC = ({
<> - {timelineId !== TimelineId.active && eventType === 'signal' && ( + {timelineId !== TimelineId.active && ( ({ + useShallowEqualSelector: jest.fn(), + useDeepEqualSelector: jest.fn(), +})); jest.mock('../../../../../common/lib/kibana', () => ({ useKibana: () => ({ services: { timelines: { ...mockTimelines }, + data: { + search: jest.fn(), + query: jest.fn(), + }, application: { capabilities: { siem: { crud_alerts: true, read_alerts: true }, @@ -146,7 +153,6 @@ describe('EventColumnView', () => { const wrapper = mount( , { diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/index.test.tsx index b00fbd32c2c07..63eccd921743d 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/index.test.tsx @@ -40,6 +40,10 @@ jest.mock('../../../../common/lib/kibana', () => { siem: { crud_alerts: true, read_alerts: true }, }, }, + data: { + search: jest.fn(), + query: jest.fn(), + }, uiSettings: { get: jest.fn(), }, diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/indicator_details.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/indicator_details.tsx index 68498f736c6dd..a484499424b65 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/indicator_details.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/indicator_details.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { INDICATOR_MATCHED_TYPE, diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/match_details.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/match_details.tsx index 31c5065cde59a..4a29bc677d810 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/match_details.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/match_details.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { INDICATOR_MATCHED_FIELD } from '../../../../../../../common/cti/constants'; import { DraggableBadge } from '../../../../../../common/components/draggables'; diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/footer/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/footer/index.tsx index c11aaa3b17370..1a100e5bf4815 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/footer/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/footer/index.tsx @@ -19,7 +19,7 @@ import { EuiPopoverProps, EuiPagination, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { FC, useCallback, useEffect, useState, useMemo } from 'react'; import styled from 'styled-components'; import { useDispatch } from 'react-redux'; diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/index.test.tsx index f5ceebf9cdb11..158db862028f6 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/index.test.tsx @@ -35,8 +35,8 @@ jest.mock('./tabs_content'); jest.mock('../../../common/lib/kibana'); jest.mock('../../../common/components/url_state/normalize_time_range.ts'); -jest.mock('@kbn/i18n/react', () => { - const originalModule = jest.requireActual('@kbn/i18n/react'); +jest.mock('@kbn/i18n-react', () => { + const originalModule = jest.requireActual('@kbn/i18n-react'); const FormattedRelative = jest.fn().mockImplementation(() => '20 hours ago'); return { diff --git a/x-pack/plugins/security_solution/public/types.ts b/x-pack/plugins/security_solution/public/types.ts index 475aa71a4b564..cfca95fddc507 100644 --- a/x-pack/plugins/security_solution/public/types.ts +++ b/x-pack/plugins/security_solution/public/types.ts @@ -41,7 +41,7 @@ import { Management } from './management'; import { Ueba } from './ueba'; import { LicensingPluginStart, LicensingPluginSetup } from '../../licensing/public'; import { DashboardStart } from '../../../../src/plugins/dashboard/public'; -import { IndexPatternFieldEditorStart } from '../../../../src/plugins/index_pattern_field_editor/public'; +import { IndexPatternFieldEditorStart } from '../../../../src/plugins/data_view_field_editor/public'; export interface SetupPlugins { home?: HomePublicPluginSetup; @@ -68,7 +68,7 @@ export interface StartPlugins { uiActions: UiActionsStart; ml?: MlPluginStart; spaces?: SpacesPluginStart; - indexPatternFieldEditor: IndexPatternFieldEditorStart; + dataViewFieldEditor: IndexPatternFieldEditorStart; } export type StartServices = CoreStart & diff --git a/x-pack/plugins/security_solution/server/config.mock.ts b/x-pack/plugins/security_solution/server/config.mock.ts index 1c404104fb3f2..9325f2f57bdd6 100644 --- a/x-pack/plugins/security_solution/server/config.mock.ts +++ b/x-pack/plugins/security_solution/server/config.mock.ts @@ -23,8 +23,6 @@ export const createMockConfig = (): ConfigType => { maxTimelineImportExportSize: 10000, maxTimelineImportPayloadBytes: 10485760, enableExperimental, - endpointResultListDefaultFirstPageIndex: 0, - endpointResultListDefaultPageSize: 10, packagerTaskInterval: '60s', alertMergeStrategy: 'missingFields', alertIgnoreFields: [], diff --git a/x-pack/plugins/security_solution/server/config.ts b/x-pack/plugins/security_solution/server/config.ts index 16a69eeb8e05f..ba1c547a1bbce 100644 --- a/x-pack/plugins/security_solution/server/config.ts +++ b/x-pack/plugins/security_solution/server/config.ts @@ -118,12 +118,6 @@ export const configSchema = schema.object({ ), }), - /** - * Host Endpoint Configuration - */ - endpointResultListDefaultFirstPageIndex: schema.number({ defaultValue: 0 }), - endpointResultListDefaultPageSize: schema.number({ defaultValue: 10 }), - /** * Artifacts Configuration */ diff --git a/x-pack/plugins/security_solution/server/endpoint/errors.ts b/x-pack/plugins/security_solution/server/endpoint/errors.ts index 7260d6055b310..198bf2ce5e12c 100644 --- a/x-pack/plugins/security_solution/server/endpoint/errors.ts +++ b/x-pack/plugins/security_solution/server/endpoint/errors.ts @@ -7,13 +7,7 @@ /* eslint-disable max-classes-per-file */ -export class EndpointError extends Error { - constructor(message: string, public readonly meta?: unknown) { - super(message); - // For debugging - capture name of subclasses - this.name = this.constructor.name; - } -} +import { EndpointError } from '../../common/endpoint/errors'; export class NotFoundError extends EndpointError {} diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/task.ts b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/task.ts index cf6665a5dde2b..06192fa8ba82f 100644 --- a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/task.ts +++ b/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/task.ts @@ -18,7 +18,7 @@ import { isEmptyManifestDiff, Manifest } from './manifest'; import { InvalidInternalManifestError } from '../../services/artifacts/errors'; import { ManifestManager } from '../../services'; import { wrapErrorIfNeeded } from '../../utils'; -import { EndpointError } from '../../errors'; +import { EndpointError } from '../../../../common/endpoint/errors'; export const ManifestTaskConstants = { TIMEOUT: '1m', diff --git a/x-pack/plugins/security_solution/server/endpoint/mocks.ts b/x-pack/plugins/security_solution/server/endpoint/mocks.ts index c428cf49b1e11..4c722672efe46 100644 --- a/x-pack/plugins/security_solution/server/endpoint/mocks.ts +++ b/x-pack/plugins/security_solution/server/endpoint/mocks.ts @@ -17,6 +17,7 @@ import { createMockAgentPolicyService, createMockAgentService, createArtifactsClientMock, + fleetAuthzMock, } from '../../../fleet/server/mocks'; import { createMockConfig } from '../lib/detection_engine/routes/__mocks__'; import { @@ -153,6 +154,9 @@ export const createMockPackageService = (): jest.Mocked => { */ export const createMockFleetStartContract = (indexPattern: string): FleetStartContract => { return { + authz: { + fromRequest: jest.fn().mockResolvedValue(fleetAuthzMock), + }, fleetSetupCompleted: jest.fn().mockResolvedValue(undefined), esIndexPatternService: { getESIndexPattern: jest.fn().mockResolvedValue(indexPattern), diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/handlers.ts b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/handlers.ts index 8b0e5abad228b..63e56af3fec6f 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/handlers.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/handlers.ts @@ -5,8 +5,6 @@ * 2.0. */ -import Boom from '@hapi/boom'; - import { TypeOf } from '@kbn/config-schema'; import { IKibanaResponse, @@ -25,30 +23,26 @@ import { } from '../../../../common/endpoint/types'; import type { SecuritySolutionRequestHandlerContext } from '../../../types'; -import { - getESQueryHostMetadataByID, - getPagingProperties, - kibanaRequestToMetadataListESQuery, -} from './query_builders'; -import { Agent, PackagePolicy } from '../../../../../fleet/common/types/models'; +import { getPagingProperties, kibanaRequestToMetadataListESQuery } from './query_builders'; +import { PackagePolicy } from '../../../../../fleet/common/types/models'; import { AgentNotFoundError } from '../../../../../fleet/server'; import { EndpointAppContext, HostListQueryResult } from '../../types'; -import { - GetMetadataListRequestSchema, - GetMetadataListRequestSchemaV2, - GetMetadataRequestSchema, -} from './index'; +import { GetMetadataListRequestSchema, GetMetadataRequestSchema } from './index'; import { findAllUnenrolledAgentIds } from './support/unenroll'; import { getAllEndpointPackagePolicies } from './support/endpoint_package_policies'; import { findAgentIdsByStatus } from './support/agent_status'; import { EndpointAppContextService } from '../../endpoint_app_context_services'; -import { catchAndWrapError, fleetAgentStatusToEndpointHostStatus } from '../../utils'; -import { - queryResponseToHostListResult, - queryResponseToHostResult, -} from './support/query_strategies'; -import { EndpointError, NotFoundError } from '../../errors'; +import { fleetAgentStatusToEndpointHostStatus } from '../../utils'; +import { queryResponseToHostListResult } from './support/query_strategies'; +import { NotFoundError } from '../../errors'; +import { EndpointError } from '../../../../common/endpoint/errors'; import { EndpointHostUnEnrolledError } from '../../services/metadata'; +import { CustomHttpRequestError } from '../../../utils/custom_http_request_error'; +import { GetMetadataListRequestQuery } from '../../../../common/endpoint/schema/metadata'; +import { + ENDPOINT_DEFAULT_PAGE, + ENDPOINT_DEFAULT_PAGE_SIZE, +} from '../../../../common/endpoint/constants'; export interface MetadataRequestContext { esClient?: IScopedClusterClient; @@ -67,6 +61,15 @@ const errorHandler = ( res: KibanaResponseFactory, error: E ): IKibanaResponse => { + logger.error(error); + + if (error instanceof CustomHttpRequestError) { + return res.customError({ + statusCode: error.statusCode, + body: error, + }); + } + if (error instanceof NotFoundError) { return res.notFound({ body: error }); } @@ -75,16 +78,6 @@ const errorHandler = ( return res.badRequest({ body: error }); } - // legacy check for Boom errors. for the errors around non-standard error properties - // @ts-expect-error TS2339 - const boomStatusCode = error.isBoom && error?.output?.statusCode; - if (boomStatusCode) { - return res.customError({ - statusCode: boomStatusCode, - body: error, - }); - } - // Kibana CORE will take care of `500` errors when the handler `throw`'s, including logging the error throw error; }; @@ -172,15 +165,12 @@ export function getMetadataListRequestHandlerV2( logger: Logger ): RequestHandler< unknown, - TypeOf, + GetMetadataListRequestQuery, unknown, SecuritySolutionRequestHandlerContext > { return async (context, request, response) => { const endpointMetadataService = endpointAppContext.service.getEndpointMetadataService(); - if (!endpointMetadataService) { - throw new EndpointError('endpoint metadata service not available'); - } let doesUnitedIndexExist = false; let didUnitedIndexError = false; @@ -217,8 +207,8 @@ export function getMetadataListRequestHandlerV2( body = { data: legacyResponse.hosts, total: legacyResponse.total, - page: request.query.page, - pageSize: request.query.pageSize, + page: request.query.page || ENDPOINT_DEFAULT_PAGE, + pageSize: request.query.pageSize || ENDPOINT_DEFAULT_PAGE_SIZE, }; return response.ok({ body }); } @@ -233,8 +223,8 @@ export function getMetadataListRequestHandlerV2( body = { data, total, - page: request.query.page, - pageSize: request.query.pageSize, + page: request.query.page || ENDPOINT_DEFAULT_PAGE, + pageSize: request.query.pageSize || ENDPOINT_DEFAULT_PAGE_SIZE, }; } catch (error) { return errorHandler(logger, response, error); @@ -269,107 +259,6 @@ export const getMetadataRequestHandler = function ( }; }; -export async function getHostMetaData( - metadataRequestContext: MetadataRequestContext, - id: string -): Promise { - if ( - !metadataRequestContext.esClient && - !metadataRequestContext.requestHandlerContext?.core.elasticsearch.client - ) { - throw Boom.badRequest('esClient not found'); - } - - if ( - !metadataRequestContext.savedObjectsClient && - !metadataRequestContext.requestHandlerContext?.core.savedObjects - ) { - throw Boom.badRequest('savedObjectsClient not found'); - } - - const esClient = (metadataRequestContext?.esClient ?? - metadataRequestContext.requestHandlerContext?.core.elasticsearch - .client) as IScopedClusterClient; - - const query = getESQueryHostMetadataByID(id); - - const response = await esClient.asCurrentUser - .search(query) - .catch(catchAndWrapError); - - const hostResult = queryResponseToHostResult(response.body); - - const hostMetadata = hostResult.result; - if (!hostMetadata) { - return undefined; - } - - return hostMetadata; -} - -export async function getHostData( - metadataRequestContext: MetadataRequestContext, - id: string -): Promise { - if (!metadataRequestContext.savedObjectsClient) { - throw Boom.badRequest('savedObjectsClient not found'); - } - - if ( - !metadataRequestContext.esClient && - !metadataRequestContext.requestHandlerContext?.core.elasticsearch.client - ) { - throw Boom.badRequest('esClient not found'); - } - - const hostMetadata = await getHostMetaData(metadataRequestContext, id); - - if (!hostMetadata) { - return undefined; - } - - const agent = await findAgent(metadataRequestContext, hostMetadata); - - if (agent && !agent.active) { - throw Boom.badRequest('the requested endpoint is unenrolled'); - } - - const metadata = await enrichHostMetadata(hostMetadata, metadataRequestContext); - - return metadata; -} - -async function findAgent( - metadataRequestContext: MetadataRequestContext, - hostMetadata: HostMetadata -): Promise { - try { - if ( - !metadataRequestContext.esClient && - !metadataRequestContext.requestHandlerContext?.core.elasticsearch.client - ) { - throw new Error('esClient not found'); - } - - const esClient = (metadataRequestContext?.esClient ?? - metadataRequestContext.requestHandlerContext?.core.elasticsearch - .client) as IScopedClusterClient; - - return await metadataRequestContext.endpointAppContextService - ?.getAgentService() - ?.getAgent(esClient.asCurrentUser, hostMetadata.elastic.agent.id); - } catch (e) { - if (e instanceof AgentNotFoundError) { - metadataRequestContext.logger.warn( - `agent with id ${hostMetadata.elastic.agent.id} not found` - ); - return undefined; - } else { - throw e; - } - } -} - export async function mapToHostResultList( // eslint-disable-next-line @typescript-eslint/no-explicit-any queryParams: Record, @@ -506,7 +395,7 @@ async function legacyListMetadataQuery( endpointAppContext: EndpointAppContext, logger: Logger, endpointPolicies: PackagePolicy[], - queryOptions: TypeOf + queryOptions: GetMetadataListRequestQuery ): Promise { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const agentService = endpointAppContext.service.getAgentService()!; @@ -532,13 +421,13 @@ async function legacyListMetadataQuery( const statusAgentIds = await findAgentIdsByStatus( agentService, context.core.elasticsearch.client.asCurrentUser, - queryOptions.hostStatuses + queryOptions?.hostStatuses || [] ); const queryParams = await kibanaRequestToMetadataListESQuery({ - page: queryOptions.page, - pageSize: queryOptions.pageSize, - kuery: queryOptions.kuery, + page: queryOptions?.page || ENDPOINT_DEFAULT_PAGE, + pageSize: queryOptions?.pageSize || ENDPOINT_DEFAULT_PAGE_SIZE, + kuery: queryOptions?.kuery || '', unenrolledAgentIds, statusAgentIds, }); diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/index.ts b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/index.ts index 5ea465aa21799..ffa0bf0637900 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/index.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/index.ts @@ -17,9 +17,12 @@ import { } from './handlers'; import type { SecuritySolutionPluginRouter } from '../../../types'; import { + ENDPOINT_DEFAULT_PAGE, + ENDPOINT_DEFAULT_PAGE_SIZE, HOST_METADATA_GET_ROUTE, HOST_METADATA_LIST_ROUTE, } from '../../../../common/endpoint/constants'; +import { GetMetadataListRequestSchemaV2 } from '../../../../common/endpoint/schema/metadata'; /* Filters that can be applied to the endpoint fetch route */ export const endpointFilters = schema.object({ @@ -51,12 +54,18 @@ export const GetMetadataListRequestSchema = { * the number of results to return for this request per page */ schema.object({ - page_size: schema.number({ defaultValue: 10, min: 1, max: 10000 }), + page_size: schema.number({ + defaultValue: ENDPOINT_DEFAULT_PAGE_SIZE, + min: 1, + max: 10000, + }), }), /** * the zero based page index of the the total number of pages of page size */ - schema.object({ page_index: schema.number({ defaultValue: 0, min: 0 }) }), + schema.object({ + page_index: schema.number({ defaultValue: ENDPOINT_DEFAULT_PAGE, min: 0 }), + }), ]) ) ), @@ -65,24 +74,6 @@ export const GetMetadataListRequestSchema = { ), }; -export const GetMetadataListRequestSchemaV2 = { - query: schema.object({ - page: schema.number({ defaultValue: 0 }), - pageSize: schema.number({ defaultValue: 10, min: 1, max: 10000 }), - kuery: schema.maybe(schema.string()), - hostStatuses: schema.arrayOf( - schema.oneOf([ - schema.literal(HostStatus.HEALTHY.toString()), - schema.literal(HostStatus.OFFLINE.toString()), - schema.literal(HostStatus.UPDATING.toString()), - schema.literal(HostStatus.UNHEALTHY.toString()), - schema.literal(HostStatus.INACTIVE.toString()), - ]), - { defaultValue: [] } - ), - }), -}; - export function registerEndpointRoutes( router: SecuritySolutionPluginRouter, endpointAppContext: EndpointAppContext diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/query_builders.ts b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/query_builders.ts index 2262028ec43bf..6121ec47243af 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/query_builders.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/query_builders.ts @@ -6,16 +6,17 @@ */ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import { TypeOf } from '@kbn/config-schema'; import { fromKueryExpression, toElasticsearchQuery } from '@kbn/es-query'; import { + ENDPOINT_DEFAULT_PAGE, + ENDPOINT_DEFAULT_PAGE_SIZE, metadataCurrentIndexPattern, METADATA_UNITED_INDEX, } from '../../../../common/endpoint/constants'; import { KibanaRequest } from '../../../../../../../src/core/server'; import { EndpointAppContext } from '../../types'; import { buildStatusesKuery } from './support/agent_status'; -import { GetMetadataListRequestSchemaV2 } from '.'; +import { GetMetadataListRequestQuery } from '../../../../common/endpoint/schema/metadata'; /** * 00000000-0000-0000-0000-000000000000 is initial Elastic Agent id sent by Endpoint before policy is configured @@ -79,7 +80,6 @@ export async function getPagingProperties( request: KibanaRequest, endpointAppContext: EndpointAppContext ) { - const config = await endpointAppContext.config(); const pagingProperties: { page_size?: number; page_index?: number } = {}; if (request?.body?.paging_properties) { for (const property of request.body.paging_properties) { @@ -90,8 +90,8 @@ export async function getPagingProperties( } } return { - pageSize: pagingProperties.page_size || config.endpointResultListDefaultPageSize, - pageIndex: pagingProperties.page_index ?? config.endpointResultListDefaultFirstPageIndex, + pageSize: pagingProperties.page_size || ENDPOINT_DEFAULT_PAGE_SIZE, + pageIndex: pagingProperties.page_index || ENDPOINT_DEFAULT_PAGE, }; } @@ -234,14 +234,16 @@ interface BuildUnitedIndexQueryResponse { } export async function buildUnitedIndexQuery( - { - page = 0, - pageSize = 10, - hostStatuses = [], - kuery = '', - }: TypeOf, + queryOptions: GetMetadataListRequestQuery, endpointPolicyIds: string[] = [] ): Promise { + const { + page = ENDPOINT_DEFAULT_PAGE, + pageSize = ENDPOINT_DEFAULT_PAGE_SIZE, + hostStatuses = [], + kuery = '', + } = queryOptions || {}; + const statusesKuery = buildStatusesKuery(hostStatuses); const filterIgnoredAgents = { diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/agent_status.ts b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/agent_status.ts index a7781cb77e8c0..f9e04f4edebee 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/agent_status.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/agent_status.ts @@ -36,7 +36,7 @@ export function buildStatusesKuery(statusesToFilter: string[]): string | undefin export async function findAgentIdsByStatus( agentService: AgentService, esClient: ElasticsearchClient, - statuses: string[] = [], + statuses: string[], pageSize: number = 1000 ): Promise { if (!statuses.length) { diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/errors.ts b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/errors.ts index 1810c46ef4313..626ff46ad7192 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/errors.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/errors.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { EndpointError } from '../../errors'; +import { EndpointError } from '../../../../common/endpoint/errors'; /** * Indicates that the internal manifest that is managed by ManifestManager is invalid or contains diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.test.ts b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.test.ts index 0ef2abd5f50aa..95d0c8b607cb6 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.test.ts @@ -38,8 +38,8 @@ import { import { ManifestManager } from './manifest_manager'; import { EndpointArtifactClientInterface } from '../artifact_client'; -import { EndpointError } from '../../../errors'; import { InvalidInternalManifestError } from '../errors'; +import { EndpointError } from '../../../../../common/endpoint/errors'; const getArtifactObject = (artifact: InternalArtifactSchema) => JSON.parse(Buffer.from(artifact.body!, 'base64').toString()); diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.ts b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.ts index b687519bf5573..af985bf230173 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.ts @@ -38,7 +38,7 @@ import { ManifestClient } from '../manifest_client'; import { ExperimentalFeatures } from '../../../../../common/experimental_features'; import { InvalidInternalManifestError } from '../errors'; import { wrapErrorIfNeeded } from '../../../utils'; -import { EndpointError } from '../../../errors'; +import { EndpointError } from '../../../../../common/endpoint/errors'; interface ArtifactsBuildResult { defaultArtifacts: InternalArtifactCompleteSchema[]; diff --git a/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts b/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts index 5af108304ff9d..cba94cce83232 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts @@ -21,10 +21,10 @@ import { getESQueryHostMetadataByFleetAgentIds, buildUnitedIndexQuery, } from '../../routes/metadata/query_builders'; -import { EndpointError } from '../../errors'; import { HostMetadata } from '../../../../common/endpoint/types'; import { Agent } from '../../../../../fleet/common'; import { AgentPolicyServiceInterface } from '../../../../../fleet/server/services'; +import { EndpointError } from '../../../../common/endpoint/errors'; describe('EndpointMetadataService', () => { let testMockedContext: EndpointMetadataServiceTestContextMock; diff --git a/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.ts b/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.ts index 832b8b507e5d4..00bc0618f57ad 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.ts @@ -12,7 +12,6 @@ import { SavedObjectsServiceStart, } from 'kibana/server'; -import { TypeOf } from '@kbn/config-schema'; import { TransportResult } from '@elastic/elasticsearch'; import { SearchTotalHits, SearchResponse } from '@elastic/elasticsearch/lib/api/types'; import { @@ -52,12 +51,12 @@ import { fleetAgentStatusToEndpointHostStatus, wrapErrorIfNeeded, } from '../../utils'; -import { EndpointError } from '../../errors'; import { createInternalReadonlySoClient } from '../../utils/create_internal_readonly_so_client'; import { METADATA_UNITED_INDEX } from '../../../../common/endpoint/constants'; import { getAllEndpointPackagePolicies } from '../../routes/metadata/support/endpoint_package_policies'; import { getAgentStatus } from '../../../../../fleet/common/services/agent_status'; -import { GetMetadataListRequestSchemaV2 } from '../../routes/metadata'; +import { GetMetadataListRequestQuery } from '../../../../common/endpoint/schema/metadata'; +import { EndpointError } from '../../../../common/endpoint/errors'; type AgentPolicyWithPackagePolicies = Omit & { package_policies: PackagePolicy[]; @@ -403,7 +402,7 @@ export class EndpointMetadataService { */ async getHostMetadataList( esClient: ElasticsearchClient, - queryOptions: TypeOf + queryOptions: GetMetadataListRequestQuery ): Promise> { const endpointPolicies = await getAllEndpointPackagePolicies( this.packagePolicyService, diff --git a/x-pack/plugins/security_solution/server/endpoint/services/metadata/errors.ts b/x-pack/plugins/security_solution/server/endpoint/services/metadata/errors.ts index c825211fede2d..d13f9eca71893 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/metadata/errors.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/metadata/errors.ts @@ -7,7 +7,8 @@ /* eslint-disable max-classes-per-file */ -import { EndpointError, NotFoundError } from '../../errors'; +import { NotFoundError } from '../../errors'; +import { EndpointError } from '../../../../common/endpoint/errors'; export class EndpointHostNotFoundError extends NotFoundError {} diff --git a/x-pack/plugins/security_solution/server/endpoint/utils/create_internal_readonly_so_client.ts b/x-pack/plugins/security_solution/server/endpoint/utils/create_internal_readonly_so_client.ts index 17b5bf16f7b96..2a76b24cc4655 100644 --- a/x-pack/plugins/security_solution/server/endpoint/utils/create_internal_readonly_so_client.ts +++ b/x-pack/plugins/security_solution/server/endpoint/utils/create_internal_readonly_so_client.ts @@ -6,7 +6,7 @@ */ import { KibanaRequest, SavedObjectsClientContract, SavedObjectsServiceStart } from 'kibana/server'; -import { EndpointError } from '../errors'; +import { EndpointError } from '../../../common/endpoint/errors'; type SavedObjectsClientContractKeys = keyof SavedObjectsClientContract; diff --git a/x-pack/plugins/security_solution/server/endpoint/utils/wrap_errors.ts b/x-pack/plugins/security_solution/server/endpoint/utils/wrap_errors.ts index 5ff4307574fcd..071a735a3091a 100644 --- a/x-pack/plugins/security_solution/server/endpoint/utils/wrap_errors.ts +++ b/x-pack/plugins/security_solution/server/endpoint/utils/wrap_errors.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { EndpointError } from '../errors'; +import { EndpointError } from '../../../common/endpoint/errors'; /** * Will wrap the given Error with `EndpointError`, which will help getting a good picture of where in diff --git a/x-pack/plugins/security_solution/server/index.ts b/x-pack/plugins/security_solution/server/index.ts index 43da8f5d8f0ef..777bc27a06866 100644 --- a/x-pack/plugins/security_solution/server/index.ts +++ b/x-pack/plugins/security_solution/server/index.ts @@ -54,4 +54,3 @@ export type { ConfigType, PluginSetup, PluginStart }; export { Plugin }; export { AppClient }; export type { SecuritySolutionApiRequestHandlerContext } from './types'; -export { EndpointError } from './endpoint/errors'; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/notifications/build_signals_query.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/notifications/build_signals_query.test.ts index 6feae924c6381..ab0e4cd64fceb 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/notifications/build_signals_query.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/notifications/build_signals_query.test.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { ALERT_RULE_RULE_ID } from '@kbn/rule-data-utils'; import { buildSignalsSearchQuery } from './build_signals_query'; describe('buildSignalsSearchQuery', () => { @@ -29,11 +30,18 @@ describe('buildSignalsSearchQuery', () => { filter: [ { bool: { - should: { - match: { - 'signal.rule.rule_id': ruleId, + should: [ + { + match: { + 'signal.rule.rule_id': ruleId, + }, }, - }, + { + match: { + [ALERT_RULE_RULE_ID]: ruleId, + }, + }, + ], minimum_should_match: 1, }, }, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/notifications/build_signals_query.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/notifications/build_signals_query.ts index ac9a6b73c71fd..9455f40aa83ed 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/notifications/build_signals_query.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/notifications/build_signals_query.ts @@ -28,11 +28,18 @@ export const buildSignalsSearchQuery = ({ filter: [ { bool: { - should: { - match: { - 'signal.rule.rule_id': ruleId, + should: [ + { + match: { + 'signal.rule.rule_id': ruleId, + }, }, - }, + { + match: { + 'kibana.alert.rule.rule_id': ruleId, + }, + }, + ], minimum_should_match: 1, }, }, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_bulk_route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_bulk_route.ts index b6e7858854efa..1db9cca2ca2d8 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_bulk_route.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/create_rules_bulk_route.ts @@ -125,7 +125,7 @@ export const createRulesBulkRoute = ( } catch (err) { return transformBulkError( internalRule.params.ruleId, - err as Error & { statusCode?: number | undefined } + err as Error & { statusCode?: number } ); } }) diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.test.ts index 66ad07b9d1029..5fe15c2839066 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.test.ts @@ -5,8 +5,6 @@ * 2.0. */ -import Boom from '@hapi/boom'; - import { SavedObjectsFindResponse } from 'kibana/server'; import { rulesClientMock } from '../../../../../alerting/server/mocks'; @@ -26,6 +24,7 @@ import { getAlertMock } from './__mocks__/request_responses'; import { AlertExecutionStatusErrorReasons } from '../../../../../alerting/common'; import { getQueryRuleParams } from '../schemas/rule_schemas.mock'; import { RuleExecutionStatus } from '../../../../common/detection_engine/schemas/common/schemas'; +import { CustomHttpRequestError } from '../../../utils/custom_http_request_error'; let rulesClient: ReturnType; @@ -34,17 +33,17 @@ describe.each([ ['RAC', true], ])('utils - %s', (_, isRuleRegistryEnabled) => { describe('transformBulkError', () => { - test('returns transformed object if it is a boom object', () => { - const boom = new Boom.Boom('some boom message', { statusCode: 400 }); - const transformed = transformBulkError('rule-1', boom); + test('returns transformed object if it is a custom error object', () => { + const customError = new CustomHttpRequestError('some custom error message', 400); + const transformed = transformBulkError('rule-1', customError); const expected: BulkError = { rule_id: 'rule-1', - error: { message: 'some boom message', status_code: 400 }, + error: { message: 'some custom error message', status_code: 400 }, }; expect(transformed).toEqual(expected); }); - test('returns a normal error if it is some non boom object that has a statusCode', () => { + test('returns a normal error if it is some non custom error that has a statusCode', () => { const error: Error & { statusCode?: number } = { statusCode: 403, name: 'some name', @@ -71,7 +70,7 @@ describe.each([ expect(transformed).toEqual(expected); }); - test('it detects a BadRequestError and returns a Boom status of 400', () => { + test('it detects a BadRequestError and returns an error status of 400', () => { const error: BadRequestError = new BadRequestError('I have a type error'); const transformed = transformBulkError('rule-1', error); const expected: BulkError = { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.ts index a15dc4f176232..127c52496a5c5 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.ts @@ -5,7 +5,6 @@ * 2.0. */ -import Boom from '@hapi/boom'; import { has, snakeCase } from 'lodash/fp'; import { BadRequestError } from '@kbn/securitysolution-es-utils'; import { SanitizedAlert } from '../../../../../alerting/common'; @@ -19,6 +18,7 @@ import { RulesClient } from '../../../../../alerting/server'; import { RuleStatusResponse, IRuleStatusSOAttributes } from '../rules/types'; import { RuleParams } from '../schemas/rule_schemas'; +import { CustomHttpRequestError } from '../../../utils/custom_http_request_error'; export interface OutputError { message: string; @@ -104,10 +104,10 @@ export const transformBulkError = ( ruleId: string, err: Error & { statusCode?: number } ): BulkError => { - if (Boom.isBoom(err)) { + if (err instanceof CustomHttpRequestError) { return createBulkErrorObject({ ruleId, - statusCode: err.output.statusCode, + statusCode: err.statusCode ?? 400, message: err.message, }); } else if (err instanceof BadRequestError) { @@ -254,7 +254,7 @@ export const getFailingRules = async ( }; }, {}); } catch (exc) { - if (Boom.isBoom(exc)) { + if (exc instanceof CustomHttpRequestError) { throw exc; } throw new Error(`Failed to get executionStatus with RulesClient: ${(exc as Error).message}`); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_execution_log/__mocks__/rule_execution_log_client.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_execution_log/__mocks__/rule_execution_log_client.ts index 518e4aa903d95..c01d6afa95190 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_execution_log/__mocks__/rule_execution_log_client.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_execution_log/__mocks__/rule_execution_log_client.ts @@ -19,7 +19,6 @@ export const ruleExecutionLogClientMock = { deleteCurrentStatus: jest.fn(), logStatusChange: jest.fn(), - logExecutionMetrics: jest.fn(), }), }; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_execution_log/event_log_adapter/event_log_adapter.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_execution_log/event_log_adapter/event_log_adapter.ts index 8b55339aa9f02..f622ea9248b24 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_execution_log/event_log_adapter/event_log_adapter.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_execution_log/event_log_adapter/event_log_adapter.ts @@ -79,9 +79,8 @@ export class EventLogAdapter implements IRuleExecutionLogClient { // EventLog execution events are immutable, nothing to do here } - public async logExecutionMetrics(args: LogExecutionMetricsArgs) { + private async logExecutionMetrics(args: LogExecutionMetricsArgs) { const { ruleId, spaceId, ruleType, ruleName, metrics } = args; - await this.savedObjectsAdapter.logExecutionMetrics(args); this.eventLogClient.logExecutionMetrics({ ruleId, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_execution_log/rule_execution_log_client.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_execution_log/rule_execution_log_client.ts index 005097ac3fd82..bc77c6e44fa56 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_execution_log/rule_execution_log_client.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_execution_log/rule_execution_log_client.ts @@ -11,7 +11,6 @@ import { IRuleStatusSOAttributes } from '../rules/types'; import { EventLogAdapter } from './event_log_adapter/event_log_adapter'; import { SavedObjectsAdapter } from './saved_objects_adapter/saved_objects_adapter'; import { - LogExecutionMetricsArgs, FindBulkExecutionLogArgs, FindExecutionLogArgs, IRuleExecutionLogClient, @@ -75,10 +74,6 @@ export class RuleExecutionLogClient implements IRuleExecutionLogClient { return this.client.deleteCurrentStatus(ruleId); } - public async logExecutionMetrics(args: LogExecutionMetricsArgs) { - return this.client.logExecutionMetrics(args); - } - public async logStatusChange(args: LogStatusChangeArgs) { const message = args.message ? truncateMessage(args.message) : args.message; return this.client.logStatusChange({ diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_execution_log/saved_objects_adapter/saved_objects_adapter.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_execution_log/saved_objects_adapter/saved_objects_adapter.ts index 53b50bb8fe638..230306c453ace 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_execution_log/saved_objects_adapter/saved_objects_adapter.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_execution_log/saved_objects_adapter/saved_objects_adapter.ts @@ -11,28 +11,26 @@ import { SavedObjectsClientContract } from '../../../../../../../../src/core/ser import { RuleExecutionStatus } from '../../../../../common/detection_engine/schemas/common/schemas'; // eslint-disable-next-line no-restricted-imports import { legacyGetRuleReference } from '../../rules/legacy_rule_status/legacy_utils'; - import { IRuleStatusSOAttributes } from '../../rules/types'; import { - RuleStatusSavedObjectsClient, - ruleStatusSavedObjectsClientFactory, -} from './rule_status_saved_objects_client'; -import { - LogExecutionMetricsArgs, + ExecutionMetrics, FindBulkExecutionLogArgs, FindExecutionLogArgs, - IRuleExecutionLogClient, - ExecutionMetrics, - LogStatusChangeArgs, - GetLastFailuresArgs, GetCurrentStatusArgs, GetCurrentStatusBulkArgs, GetCurrentStatusBulkResult, + GetLastFailuresArgs, + IRuleExecutionLogClient, + LogStatusChangeArgs, } from '../types'; -import { assertUnreachable } from '../../../../../common'; +import { + RuleStatusSavedObjectsClient, + ruleStatusSavedObjectsClientFactory, +} from './rule_status_saved_objects_client'; +const MAX_ERRORS = 5; // 1st is mutable status, followed by 5 most recent failures -export const MAX_RULE_STATUSES = 6; +const MAX_RULE_STATUSES = 1 + MAX_ERRORS; const convertMetricFields = ( metrics: ExecutionMetrics @@ -100,112 +98,73 @@ export class SavedObjectsAdapter implements IRuleExecutionLogClient { await Promise.all(statusSavedObjects.map((so) => this.ruleStatusClient.delete(so.id))); } - public async logExecutionMetrics({ ruleId, metrics }: LogExecutionMetricsArgs) { - const references: SavedObjectReference[] = [legacyGetRuleReference(ruleId)]; - const [currentStatus] = await this.getOrCreateRuleStatuses(ruleId); - - await this.ruleStatusClient.update( - currentStatus.id, - { - ...currentStatus.attributes, - ...convertMetricFields(metrics), - }, - { references } - ); - } - - private createNewRuleStatus = async ( + private findRuleStatuses = async ( ruleId: string - ): Promise> => { - const references: SavedObjectReference[] = [legacyGetRuleReference(ruleId)]; - const now = new Date().toISOString(); - return this.ruleStatusClient.create( - { - statusDate: now, - status: RuleExecutionStatus['going to run'], - lastFailureAt: null, - lastSuccessAt: null, - lastFailureMessage: null, - lastSuccessMessage: null, - gap: null, - bulkCreateTimeDurations: [], - searchAfterTimeDurations: [], - lastLookBackDate: null, - }, - { references } - ); - }; - - private getOrCreateRuleStatuses = async ( - ruleId: string - ): Promise>> => { - const existingStatuses = await this.findRuleStatusSavedObjects(ruleId, MAX_RULE_STATUSES); - if (existingStatuses.length > 0) { - return existingStatuses; - } - - const newStatus = await this.createNewRuleStatus(ruleId); - return [newStatus]; - }; + ): Promise>> => + this.findRuleStatusSavedObjects(ruleId, MAX_RULE_STATUSES); public async logStatusChange({ newStatus, ruleId, message, metrics }: LogStatusChangeArgs) { const references: SavedObjectReference[] = [legacyGetRuleReference(ruleId)]; + const ruleStatuses = await this.findRuleStatuses(ruleId); + const [currentStatus] = ruleStatuses; + const attributes = buildRuleStatusAttributes({ + status: newStatus, + message, + metrics, + currentAttributes: currentStatus?.attributes, + }); + // Create or update current status + if (currentStatus) { + await this.ruleStatusClient.update(currentStatus.id, attributes, { references }); + } else { + await this.ruleStatusClient.create(attributes, { references }); + } - switch (newStatus) { - case RuleExecutionStatus['going to run']: - case RuleExecutionStatus.succeeded: - case RuleExecutionStatus.warning: - case RuleExecutionStatus['partial failure']: { - const [currentStatus] = await this.getOrCreateRuleStatuses(ruleId); - - await this.ruleStatusClient.update( - currentStatus.id, - { - ...currentStatus.attributes, - ...buildRuleStatusAttributes(newStatus, message, metrics), - }, - { references } - ); - - return; - } - - case RuleExecutionStatus.failed: { - const ruleStatuses = await this.getOrCreateRuleStatuses(ruleId); - const [currentStatus] = ruleStatuses; - - const failureAttributes = { - ...currentStatus.attributes, - ...buildRuleStatusAttributes(RuleExecutionStatus.failed, message, metrics), - }; - - // We always update the newest status, so to 'persist' a failure we push a copy to the head of the list - await this.ruleStatusClient.update(currentStatus.id, failureAttributes, { references }); - const lastStatus = await this.ruleStatusClient.create(failureAttributes, { references }); - - // drop oldest failures - const oldStatuses = [lastStatus, ...ruleStatuses].slice(MAX_RULE_STATUSES); - await Promise.all(oldStatuses.map((status) => this.ruleStatusClient.delete(status.id))); - - return; - } - default: - assertUnreachable(newStatus, 'Unknown rule execution status supplied to logStatusChange'); + if (newStatus === RuleExecutionStatus.failed) { + await Promise.all([ + // Persist the current failure in the last five errors list + this.ruleStatusClient.create(attributes, { references }), + // Drop oldest failures + ...ruleStatuses + .slice(MAX_RULE_STATUSES - 1) + .map((status) => this.ruleStatusClient.delete(status.id)), + ]); } } } -const buildRuleStatusAttributes: ( - status: RuleExecutionStatus, - message?: string, - metrics?: ExecutionMetrics -) => Partial = (status, message, metrics = {}) => { +const defaultStatusAttributes: IRuleStatusSOAttributes = { + statusDate: '', + status: RuleExecutionStatus['going to run'], + lastFailureAt: null, + lastSuccessAt: null, + lastFailureMessage: null, + lastSuccessMessage: null, + gap: null, + bulkCreateTimeDurations: [], + searchAfterTimeDurations: [], + lastLookBackDate: null, +}; + +const buildRuleStatusAttributes = ({ + status, + message, + metrics = {}, + currentAttributes, +}: { + status: RuleExecutionStatus; + message?: string; + metrics?: ExecutionMetrics; + currentAttributes?: IRuleStatusSOAttributes; +}): IRuleStatusSOAttributes => { const now = new Date().toISOString(); - const baseAttributes: Partial = { - ...convertMetricFields(metrics), + const baseAttributes: IRuleStatusSOAttributes = { + ...defaultStatusAttributes, + ...currentAttributes, + statusDate: now, status: status === RuleExecutionStatus.warning ? RuleExecutionStatus['partial failure'] : status, - statusDate: now, + ...convertMetricFields(metrics), }; switch (status) { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_execution_log/types.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_execution_log/types.ts index 88802f9f28822..06a0b90985af7 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_execution_log/types.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_execution_log/types.ts @@ -28,7 +28,6 @@ export interface IRuleExecutionLogClient { deleteCurrentStatus(ruleId: string): Promise; logStatusChange(args: LogStatusChangeArgs): Promise; - logExecutionMetrics(args: LogExecutionMetricsArgs): Promise; } /** @deprecated */ diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert_group_from_sequence.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert_group_from_sequence.test.ts index 86b57b1ed1698..ff3851ae0024f 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert_group_from_sequence.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert_group_from_sequence.test.ts @@ -124,7 +124,6 @@ describe('buildAlert', () => { ]), [ALERT_DEPTH]: 2, [ALERT_RULE_CONSUMER]: SERVER_APP_ID, - [ALERT_BUILDING_BLOCK_TYPE]: 'default', }), }) ); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert_group_from_sequence.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert_group_from_sequence.ts index 23958451800b0..7b29c71b3b8ac 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert_group_from_sequence.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert_group_from_sequence.ts @@ -24,6 +24,7 @@ import { ALERT_BUILDING_BLOCK_TYPE, ALERT_GROUP_ID, ALERT_GROUP_INDEX, + ALERT_ORIGINAL_TIME, } from '../../../../../../common/field_maps/field_names'; /** @@ -91,6 +92,13 @@ export const buildAlertRoot = ( spaceId: string | null | undefined, buildReasonMessage: BuildReasonMessage ): RACAlert => { + const timestamps = wrappedBuildingBlocks + .sort( + (block1, block2) => + (block1._source[ALERT_ORIGINAL_TIME] as number) - + (block2._source[ALERT_ORIGINAL_TIME] as number) + ) + .map((alert) => alert._source[ALERT_ORIGINAL_TIME]); const rule = buildRuleWithoutOverrides(completeRule); const mergedAlerts = objectArrayIntersection(wrappedBuildingBlocks.map((alert) => alert._source)); const reason = buildReasonMessage({ rule, mergedDoc: mergedAlerts as SignalSourceHit }); @@ -101,6 +109,8 @@ export const buildAlertRoot = ( kind: 'signal', }, ...doc, + [ALERT_ORIGINAL_TIME]: timestamps[0], + [ALERT_BUILDING_BLOCK_TYPE]: undefined, [ALERT_GROUP_ID]: generateAlertId(doc), }; }; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_timelines/README.md b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_timelines/README.md index 09257371bca60..e0ada4aad0817 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_timelines/README.md +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_timelines/README.md @@ -29,7 +29,7 @@ - echo '{"savedObjectId":null,"version":null,"columns":[{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"@timestamp","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"signal.rule.description","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"event.action","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"process.name","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"The working directory of the process.","columnHeaderType":"not-filtered","id":"process.working_directory","category":"process","type":"string","searchable":null,"example":"/home/alice"},{"indexes":null,"aggregatable":true,"name":null,"description":"Array of process arguments, starting with the absolute path to\nthe executable.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.args","category":"process","type":"string","searchable":null,"example":"[\"/usr/bin/ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"process.pid","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"Absolute path to the process executable.","columnHeaderType":"not-filtered","id":"process.parent.executable","category":"process","type":"string","searchable":null,"example":"/usr/bin/ssh"},{"indexes":null,"aggregatable":true,"name":null,"description":"Array of process arguments.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.parent.args","category":"process","type":"string","searchable":null,"example":"[\"ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"indexes":null,"aggregatable":true,"name":null,"description":"Process id.","columnHeaderType":"not-filtered","id":"process.parent.pid","category":"process","type":"number","searchable":null,"example":"4242"},{"indexes":null,"aggregatable":true,"name":null,"description":"Short name or login of the user.","columnHeaderType":"not-filtered","id":"user.name","category":"user","type":"string","searchable":null,"example":"albert"},{"indexes":null,"aggregatable":true,"name":null,"description":"Name of the host.\n\nIt can contain what `hostname` returns on Unix systems, the fully qualified\ndomain name, or a name specified by the user. The sender decides which value\nto use.","columnHeaderType":"not-filtered","id":"host.name","category":"host","type":"string","searchable":null}],"dataProviders":[{"excluded":false,"and":[],"kqlQuery":"","name":"590eb946a7fdbacaa587ed0f6b1a16f5ad3d659ec47ef35ad0826c47af133bde","queryMatch":{"displayValue":null,"field":"_id","displayField":null,"value":"590eb946a7fdbacaa587ed0f6b1a16f5ad3d659ec47ef35ad0826c47af133bde","operator":":"},"id":"send-signal-to-timeline-action-default-draggable-event-details-value-formatted-field-value-timeline-1-signal-id-590eb946a7fdbacaa587ed0f6b1a16f5ad3d659ec47ef35ad0826c47af133bde","enabled":true}],"description":"","eventType":"all","filters":[],"kqlMode":"filter","kqlQuery":{"filterQuery":{"kuery":{"kind":"kuery","expression":""},"serializedQuery":""}},"title":"Generic Process Timeline","dateRange":{"start":1588161020848,"end":1588162280848},"savedQueryId":null,"sort":{"columnId":"@timestamp","sortDirection":"desc"},"created":1588162404153,"createdBy":"Elastic","updated":1588604767818,"updatedBy":"Elastic","eventNotes":[],"globalNotes":[],"pinnedEventIds":[],"timelineType":"template","status":"immutable","templateTimelineId":"2c7e0663-5a91-0004-aa15-26bf756d2c40","templateTimelineVersion":1}' > my_new_template.json``` + echo '{"savedObjectId":null,"version":null,"columns":[{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"@timestamp","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"kibana.alert.rule.description","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"event.action","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"process.name","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"The working directory of the process.","columnHeaderType":"not-filtered","id":"process.working_directory","category":"process","type":"string","searchable":null,"example":"/home/alice"},{"indexes":null,"aggregatable":true,"name":null,"description":"Array of process arguments, starting with the absolute path to\nthe executable.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.args","category":"process","type":"string","searchable":null,"example":"[\"/usr/bin/ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"process.pid","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"Absolute path to the process executable.","columnHeaderType":"not-filtered","id":"process.parent.executable","category":"process","type":"string","searchable":null,"example":"/usr/bin/ssh"},{"indexes":null,"aggregatable":true,"name":null,"description":"Array of process arguments.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.parent.args","category":"process","type":"string","searchable":null,"example":"[\"ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"indexes":null,"aggregatable":true,"name":null,"description":"Process id.","columnHeaderType":"not-filtered","id":"process.parent.pid","category":"process","type":"number","searchable":null,"example":"4242"},{"indexes":null,"aggregatable":true,"name":null,"description":"Short name or login of the user.","columnHeaderType":"not-filtered","id":"user.name","category":"user","type":"string","searchable":null,"example":"albert"},{"indexes":null,"aggregatable":true,"name":null,"description":"Name of the host.\n\nIt can contain what `hostname` returns on Unix systems, the fully qualified\ndomain name, or a name specified by the user. The sender decides which value\nto use.","columnHeaderType":"not-filtered","id":"host.name","category":"host","type":"string","searchable":null}],"dataProviders":[{"excluded":false,"and":[],"kqlQuery":"","name":"590eb946a7fdbacaa587ed0f6b1a16f5ad3d659ec47ef35ad0826c47af133bde","queryMatch":{"displayValue":null,"field":"_id","displayField":null,"value":"590eb946a7fdbacaa587ed0f6b1a16f5ad3d659ec47ef35ad0826c47af133bde","operator":":"},"id":"send-signal-to-timeline-action-default-draggable-event-details-value-formatted-field-value-timeline-1-signal-id-590eb946a7fdbacaa587ed0f6b1a16f5ad3d659ec47ef35ad0826c47af133bde","enabled":true}],"description":"","eventType":"all","filters":[],"kqlMode":"filter","kqlQuery":{"filterQuery":{"kuery":{"kind":"kuery","expression":""},"serializedQuery":""}},"title":"Generic Process Timeline","dateRange":{"start":1588161020848,"end":1588162280848},"savedQueryId":null,"sort":{"columnId":"@timestamp","sortDirection":"desc"},"created":1588162404153,"createdBy":"Elastic","updated":1588604767818,"updatedBy":"Elastic","eventNotes":[],"globalNotes":[],"pinnedEventIds":[],"timelineType":"template","status":"immutable","templateTimelineId":"2c7e0663-5a91-0004-aa15-26bf756d2c40","templateTimelineVersion":1}' > my_new_template.json``` #### Note that the json has to be minified. #### Fields to hightlight for on boarding a new prepackaged timeline: diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_timelines/endpoint.json b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_timelines/endpoint.json index acc5f69358798..71039b929d75a 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_timelines/endpoint.json +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_timelines/endpoint.json @@ -1 +1 @@ -{"savedObjectId":null,"version":null,"columns":[{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"@timestamp","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"signal.rule.description","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"event.action","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"process.name","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"The working directory of the process.","columnHeaderType":"not-filtered","id":"process.working_directory","category":"process","type":"string","searchable":null,"example":"/home/alice"},{"indexes":null,"aggregatable":true,"name":null,"description":"Array of process arguments, starting with the absolute path to\nthe executable.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.args","category":"process","type":"string","searchable":null,"example":"[\"/usr/bin/ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"process.pid","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"Absolute path to the process executable.","columnHeaderType":"not-filtered","id":"process.parent.executable","category":"process","type":"string","searchable":null,"example":"/usr/bin/ssh"},{"indexes":null,"aggregatable":true,"name":null,"description":"Array of process arguments.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.parent.args","category":"process","type":"string","searchable":null,"example":"[\"ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"indexes":null,"aggregatable":true,"name":null,"description":"Process id.","columnHeaderType":"not-filtered","id":"process.parent.pid","category":"process","type":"number","searchable":null,"example":"4242"},{"indexes":null,"aggregatable":true,"name":null,"description":"Short name or login of the user.","columnHeaderType":"not-filtered","id":"user.name","category":"user","type":"string","searchable":null,"example":"albert"},{"indexes":null,"aggregatable":true,"name":null,"description":"Name of the host.\n\nIt can contain what `hostname` returns on Unix systems, the fully qualified\ndomain name, or a name specified by the user. The sender decides which value\nto use.","columnHeaderType":"not-filtered","id":"host.name","category":"host","type":"string","searchable":null}],"dataProviders":[{"excluded":false,"and":[],"kqlQuery":"","name":"","queryMatch":{"displayValue":"endpoint","field":"agent.type","displayField":"agent.type","value":"endpoint","operator":":"},"id":"timeline-1-4685da24-35c1-43f3-892d-1f926dbf5568","type":"default","enabled":true}],"description":"","eventType":"all","filters":[],"kqlMode":"filter","kqlQuery":{"filterQuery":{"kuery":{"kind":"kuery","expression":""},"serializedQuery":""}},"title":"Generic Endpoint Timeline","timelineType":"template","templateTimelineVersion":2,"templateTimelineId":"db366523-f1c6-4c1f-8731-6ce5ed9e5717","dateRange":{"start":1588161020848,"end":1588162280848},"savedQueryId":null,"sort":{"columnId":"@timestamp","sortDirection":"desc"},"created":1594735857110,"createdBy":"Elastic","updated":1611609999115,"updatedBy":"Elastic","eventNotes":[],"globalNotes":[],"pinnedEventIds":[],"status":"immutable"} +{"savedObjectId":null,"version":null,"columns":[{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"@timestamp","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"kibana.alert.rule.description","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"event.action","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"process.name","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"The working directory of the process.","columnHeaderType":"not-filtered","id":"process.working_directory","category":"process","type":"string","searchable":null,"example":"/home/alice"},{"indexes":null,"aggregatable":true,"name":null,"description":"Array of process arguments, starting with the absolute path to\nthe executable.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.args","category":"process","type":"string","searchable":null,"example":"[\"/usr/bin/ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"process.pid","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"Absolute path to the process executable.","columnHeaderType":"not-filtered","id":"process.parent.executable","category":"process","type":"string","searchable":null,"example":"/usr/bin/ssh"},{"indexes":null,"aggregatable":true,"name":null,"description":"Array of process arguments.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.parent.args","category":"process","type":"string","searchable":null,"example":"[\"ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"indexes":null,"aggregatable":true,"name":null,"description":"Process id.","columnHeaderType":"not-filtered","id":"process.parent.pid","category":"process","type":"number","searchable":null,"example":"4242"},{"indexes":null,"aggregatable":true,"name":null,"description":"Short name or login of the user.","columnHeaderType":"not-filtered","id":"user.name","category":"user","type":"string","searchable":null,"example":"albert"},{"indexes":null,"aggregatable":true,"name":null,"description":"Name of the host.\n\nIt can contain what `hostname` returns on Unix systems, the fully qualified\ndomain name, or a name specified by the user. The sender decides which value\nto use.","columnHeaderType":"not-filtered","id":"host.name","category":"host","type":"string","searchable":null}],"dataProviders":[{"excluded":false,"and":[],"kqlQuery":"","name":"","queryMatch":{"displayValue":"endpoint","field":"agent.type","displayField":"agent.type","value":"endpoint","operator":":"},"id":"timeline-1-4685da24-35c1-43f3-892d-1f926dbf5568","type":"default","enabled":true}],"description":"","eventType":"all","filters":[],"kqlMode":"filter","kqlQuery":{"filterQuery":{"kuery":{"kind":"kuery","expression":""},"serializedQuery":""}},"title":"Generic Endpoint Timeline","timelineType":"template","templateTimelineVersion":2,"templateTimelineId":"db366523-f1c6-4c1f-8731-6ce5ed9e5717","dateRange":{"start":1588161020848,"end":1588162280848},"savedQueryId":null,"sort":{"columnId":"@timestamp","sortDirection":"desc"},"created":1594735857110,"createdBy":"Elastic","updated":1611609999115,"updatedBy":"Elastic","eventNotes":[],"globalNotes":[],"pinnedEventIds":[],"status":"immutable"} diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_timelines/index.ndjson b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_timelines/index.ndjson index 6922cacd17b68..549f6733b0208 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_timelines/index.ndjson +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_timelines/index.ndjson @@ -8,7 +8,7 @@ // Auto generated file from scripts/regen_prepackage_timelines_index.sh // Do not hand edit. Run that script to regenerate package information instead -{"savedObjectId":null,"version":null,"columns":[{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"@timestamp","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"signal.rule.description","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"event.action","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"process.name","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"The working directory of the process.","columnHeaderType":"not-filtered","id":"process.working_directory","category":"process","type":"string","searchable":null,"example":"/home/alice"},{"indexes":null,"aggregatable":true,"name":null,"description":"Array of process arguments, starting with the absolute path to\nthe executable.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.args","category":"process","type":"string","searchable":null,"example":"[\"/usr/bin/ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"process.pid","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"Absolute path to the process executable.","columnHeaderType":"not-filtered","id":"process.parent.executable","category":"process","type":"string","searchable":null,"example":"/usr/bin/ssh"},{"indexes":null,"aggregatable":true,"name":null,"description":"Array of process arguments.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.parent.args","category":"process","type":"string","searchable":null,"example":"[\"ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"indexes":null,"aggregatable":true,"name":null,"description":"Process id.","columnHeaderType":"not-filtered","id":"process.parent.pid","category":"process","type":"number","searchable":null,"example":"4242"},{"indexes":null,"aggregatable":true,"name":null,"description":"Short name or login of the user.","columnHeaderType":"not-filtered","id":"user.name","category":"user","type":"string","searchable":null,"example":"albert"},{"indexes":null,"aggregatable":true,"name":null,"description":"Name of the host.\n\nIt can contain what `hostname` returns on Unix systems, the fully qualified\ndomain name, or a name specified by the user. The sender decides which value\nto use.","columnHeaderType":"not-filtered","id":"host.name","category":"host","type":"string","searchable":null}],"dataProviders":[{"excluded":false,"and":[],"kqlQuery":"","name":"","queryMatch":{"displayValue":"endpoint","field":"agent.type","displayField":"agent.type","value":"endpoint","operator":":"},"id":"timeline-1-4685da24-35c1-43f3-892d-1f926dbf5568","type":"default","enabled":true}],"description":"","eventType":"all","filters":[],"kqlMode":"filter","kqlQuery":{"filterQuery":{"kuery":{"kind":"kuery","expression":""},"serializedQuery":""}},"title":"Generic Endpoint Timeline","timelineType":"template","templateTimelineVersion":2,"templateTimelineId":"db366523-f1c6-4c1f-8731-6ce5ed9e5717","dateRange":{"start":1588161020848,"end":1588162280848},"savedQueryId":null,"sort":{"columnId":"@timestamp","sortDirection":"desc"},"created":1594735857110,"createdBy":"Elastic","updated":1611609999115,"updatedBy":"Elastic","eventNotes":[],"globalNotes":[],"pinnedEventIds":[],"status":"immutable"} -{"savedObjectId":null,"version":null,"columns":[{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"@timestamp","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"signal.rule.description","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"The action captured by the event.\n\nThis describes the information in the event. It is more specific than `event.category`.\nExamples are `group-add`, `process-started`, `file-created`. The value is\nnormally defined by the implementer.","columnHeaderType":"not-filtered","id":"event.action","category":"event","type":"string","searchable":null,"example":"user-password-change"},{"indexes":null,"aggregatable":true,"name":null,"description":"Array of process arguments, starting with the absolute path to\nthe executable.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.args","category":"process","type":"string","searchable":null,"example":"[\"/usr/bin/ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"process.pid","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"IP address of the source (IPv4 or IPv6).","columnHeaderType":"not-filtered","id":"source.ip","category":"source","type":"ip","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"Port of the source.","columnHeaderType":"not-filtered","id":"source.port","category":"source","type":"number","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"IP address of the destination (IPv4 or IPv6).","columnHeaderType":"not-filtered","id":"destination.ip","category":"destination","type":"ip","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"destination.port","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"Short name or login of the user.","columnHeaderType":"not-filtered","id":"user.name","category":"user","type":"string","searchable":null,"example":"albert"},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"host.name","searchable":null}],"dataProviders":[{"and":[{"enabled":true,"excluded":false,"id":"timeline-1-e37e37c5-a6e7-4338-af30-47bfbc3c0e1e","kqlQuery":"","name":"{destination.ip}","queryMatch":{"displayField":"destination.ip","displayValue":"{destination.ip}","field":"destination.ip","operator":":","value":"{destination.ip}"},"type":"template"}],"enabled":true,"excluded":false,"id":"timeline-1-ec778f01-1802-40f0-9dfb-ed8de1f656cb","kqlQuery":"","name":"{source.ip}","queryMatch":{"displayField":"source.ip","displayValue":"{source.ip}","field":"source.ip","operator":":","value":"{source.ip}"},"type":"template"}],"description":"","eventType":"all","filters":[],"kqlMode":"filter","kqlQuery":{"filterQuery":{"kuery":{"kind":"kuery","expression":""},"serializedQuery":""}},"title":"Generic Network Timeline","timelineType":"template","templateTimelineVersion":2,"templateTimelineId":"91832785-286d-4ebe-b884-1a208d111a70","dateRange":{"start":1588255858373,"end":1588256218373},"savedQueryId":null,"sort":{"columnId":"@timestamp","sortDirection":"desc"},"created":1594735573866,"createdBy":"Elastic","updated":1611609960850,"updatedBy":"Elastic","eventNotes":[],"globalNotes":[],"pinnedEventIds":[],"status":"immutable"} -{"savedObjectId":null,"version":null,"columns":[{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"@timestamp","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"signal.rule.description","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"event.action","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"process.name","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"The working directory of the process.","columnHeaderType":"not-filtered","id":"process.working_directory","category":"process","type":"string","searchable":null,"example":"/home/alice"},{"indexes":null,"aggregatable":true,"name":null,"description":"Array of process arguments, starting with the absolute path to\nthe executable.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.args","category":"process","type":"string","searchable":null,"example":"[\"/usr/bin/ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"process.pid","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"Absolute path to the process executable.","columnHeaderType":"not-filtered","id":"process.parent.executable","category":"process","type":"string","searchable":null,"example":"/usr/bin/ssh"},{"indexes":null,"aggregatable":true,"name":null,"description":"Array of process arguments.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.parent.args","category":"process","type":"string","searchable":null,"example":"[\"ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"indexes":null,"aggregatable":true,"name":null,"description":"Process id.","columnHeaderType":"not-filtered","id":"process.parent.pid","category":"process","type":"number","searchable":null,"example":"4242"},{"indexes":null,"aggregatable":true,"name":null,"description":"Short name or login of the user.","columnHeaderType":"not-filtered","id":"user.name","category":"user","type":"string","searchable":null,"example":"albert"},{"indexes":null,"aggregatable":true,"name":null,"description":"Name of the host.\n\nIt can contain what `hostname` returns on Unix systems, the fully qualified\ndomain name, or a name specified by the user. The sender decides which value\nto use.","columnHeaderType":"not-filtered","id":"host.name","category":"host","type":"string","searchable":null}],"dataProviders":[{"excluded":false,"and":[],"kqlQuery":"","name":"{process.name}","queryMatch":{"displayValue":null,"field":"process.name","displayField":null,"value":"{process.name}","operator":":"},"id":"timeline-1-8622010a-61fb-490d-b162-beac9c36a853","type":"template","enabled":true}],"description":"","eventType":"all","filters":[],"kqlMode":"filter","kqlQuery":{"filterQuery":{"kuery":{"kind":"kuery","expression":""},"serializedQuery":""}},"title":"Generic Process Timeline","timelineType":"template","templateTimelineVersion":2,"templateTimelineId":"76e52245-7519-4251-91ab-262fb1a1728c","dateRange":{"start":1588161020848,"end":1588162280848},"savedQueryId":null,"sort":{"columnId":"@timestamp","sortDirection":"desc"},"created":1594735629389,"createdBy":"Elastic","updated":1611609848602,"updatedBy":"Elastic","eventNotes":[],"globalNotes":[],"pinnedEventIds":[],"status":"immutable"} -{"savedObjectId":null,"version":null,"columns":[{"columnHeaderType":"not-filtered","id":"@timestamp"},{"columnHeaderType":"not-filtered","id":"signal.rule.description"},{"aggregatable":true,"description":"The action captured by the event.\n\nThis describes the information in the event. It is more specific than `event.category`.\nExamples are `group-add`, `process-started`, `file-created`. The value is\nnormally defined by the implementer.","columnHeaderType":"not-filtered","id":"event.action","category":"event","type":"string","example":"user-password-change"},{"aggregatable":true,"description":"Array of process arguments, starting with the absolute path to\nthe executable.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.args","category":"process","type":"string","example":"[\"/usr/bin/ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"columnHeaderType":"not-filtered","id":"process.pid"},{"aggregatable":true,"description":"IP address of the source (IPv4 or IPv6).","columnHeaderType":"not-filtered","id":"source.ip","category":"source","type":"ip"},{"aggregatable":true,"description":"Port of the source.","columnHeaderType":"not-filtered","id":"source.port","category":"source","type":"number"},{"aggregatable":true,"description":"IP address of the destination (IPv4 or IPv6).","columnHeaderType":"not-filtered","id":"destination.ip","category":"destination","type":"ip"},{"columnHeaderType":"not-filtered","id":"destination.port"},{"aggregatable":true,"description":"Short name or login of the user.","columnHeaderType":"not-filtered","id":"user.name","category":"user","type":"string","example":"albert"},{"columnHeaderType":"not-filtered","id":"host.name"}],"dataProviders":[{"excluded":false,"and":[{"excluded":false,"kqlQuery":"","name":"{threat.enrichments.matched.type}","queryMatch":{"displayValue":null,"field":"threat.enrichments.matched.type","displayField":null,"value":"{threat.enrichments.matched.type}","operator":":"},"id":"timeline-1-ae18ef4b-f690-4122-a24d-e13b6818fba8","type":"template","enabled":true},{"excluded":false,"kqlQuery":"","name":"{threat.enrichments.matched.field}","queryMatch":{"displayValue":null,"field":"threat.enrichments.matched.field","displayField":null,"value":"{threat.enrichments.matched.field}","operator":":"},"id":"timeline-1-7b4cf27e-6788-4d8e-9188-7687f0eba0f2","type":"template","enabled":true}],"kqlQuery":"","name":"{threat.enrichments.matched.atomic}","queryMatch":{"displayValue":null,"field":"threat.enrichments.matched.atomic","displayField":null,"value":"{threat.enrichments.matched.atomic}","operator":":"},"id":"timeline-1-7db7d278-a80a-4853-971a-904319c50777","type":"template","enabled":true}],"description":"This Timeline template is for alerts generated by Indicator Match detection rules.","eqlOptions":{"eventCategoryField":"event.category","tiebreakerField":"","timestampField":"@timestamp","query":"","size":100},"eventType":"alert","filters":[],"kqlMode":"filter","kqlQuery":{"filterQuery":{"kuery":{"kind":"kuery","expression":""},"serializedQuery":""}},"dataViewId": "security-solution","indexNames":[".siem-signals-default"],"title":"Generic Threat Match Timeline","timelineType":"template","templateTimelineVersion":2,"templateTimelineId":"495ad7a7-316e-4544-8a0f-9c098daee76e","dateRange":{"start":1588161020848,"end":1588162280848},"savedQueryId":null,"sort":[{"sortDirection":"desc","columnId":"@timestamp"}],"created":1616696609311,"createdBy":"elastic","updated":1616788372794,"updatedBy":"elastic","eventNotes":[],"globalNotes":[],"pinnedEventIds":[],"status":"immutable"} +{"savedObjectId":null,"version":null,"columns":[{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"@timestamp","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"kibana.alert.rule.description","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"event.action","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"process.name","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"The working directory of the process.","columnHeaderType":"not-filtered","id":"process.working_directory","category":"process","type":"string","searchable":null,"example":"/home/alice"},{"indexes":null,"aggregatable":true,"name":null,"description":"Array of process arguments, starting with the absolute path to\nthe executable.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.args","category":"process","type":"string","searchable":null,"example":"[\"/usr/bin/ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"process.pid","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"Absolute path to the process executable.","columnHeaderType":"not-filtered","id":"process.parent.executable","category":"process","type":"string","searchable":null,"example":"/usr/bin/ssh"},{"indexes":null,"aggregatable":true,"name":null,"description":"Array of process arguments.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.parent.args","category":"process","type":"string","searchable":null,"example":"[\"ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"indexes":null,"aggregatable":true,"name":null,"description":"Process id.","columnHeaderType":"not-filtered","id":"process.parent.pid","category":"process","type":"number","searchable":null,"example":"4242"},{"indexes":null,"aggregatable":true,"name":null,"description":"Short name or login of the user.","columnHeaderType":"not-filtered","id":"user.name","category":"user","type":"string","searchable":null,"example":"albert"},{"indexes":null,"aggregatable":true,"name":null,"description":"Name of the host.\n\nIt can contain what `hostname` returns on Unix systems, the fully qualified\ndomain name, or a name specified by the user. The sender decides which value\nto use.","columnHeaderType":"not-filtered","id":"host.name","category":"host","type":"string","searchable":null}],"dataProviders":[{"excluded":false,"and":[],"kqlQuery":"","name":"","queryMatch":{"displayValue":"endpoint","field":"agent.type","displayField":"agent.type","value":"endpoint","operator":":"},"id":"timeline-1-4685da24-35c1-43f3-892d-1f926dbf5568","type":"default","enabled":true}],"description":"","eventType":"all","filters":[],"kqlMode":"filter","kqlQuery":{"filterQuery":{"kuery":{"kind":"kuery","expression":""},"serializedQuery":""}},"title":"Generic Endpoint Timeline","timelineType":"template","templateTimelineVersion":2,"templateTimelineId":"db366523-f1c6-4c1f-8731-6ce5ed9e5717","dateRange":{"start":1588161020848,"end":1588162280848},"savedQueryId":null,"sort":{"columnId":"@timestamp","sortDirection":"desc"},"created":1594735857110,"createdBy":"Elastic","updated":1611609999115,"updatedBy":"Elastic","eventNotes":[],"globalNotes":[],"pinnedEventIds":[],"status":"immutable"} +{"savedObjectId":null,"version":null,"columns":[{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"@timestamp","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"kibana.alert.rule.description","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"The action captured by the event.\n\nThis describes the information in the event. It is more specific than `event.category`.\nExamples are `group-add`, `process-started`, `file-created`. The value is\nnormally defined by the implementer.","columnHeaderType":"not-filtered","id":"event.action","category":"event","type":"string","searchable":null,"example":"user-password-change"},{"indexes":null,"aggregatable":true,"name":null,"description":"Array of process arguments, starting with the absolute path to\nthe executable.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.args","category":"process","type":"string","searchable":null,"example":"[\"/usr/bin/ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"process.pid","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"IP address of the source (IPv4 or IPv6).","columnHeaderType":"not-filtered","id":"source.ip","category":"source","type":"ip","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"Port of the source.","columnHeaderType":"not-filtered","id":"source.port","category":"source","type":"number","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"IP address of the destination (IPv4 or IPv6).","columnHeaderType":"not-filtered","id":"destination.ip","category":"destination","type":"ip","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"destination.port","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"Short name or login of the user.","columnHeaderType":"not-filtered","id":"user.name","category":"user","type":"string","searchable":null,"example":"albert"},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"host.name","searchable":null}],"dataProviders":[{"and":[{"enabled":true,"excluded":false,"id":"timeline-1-e37e37c5-a6e7-4338-af30-47bfbc3c0e1e","kqlQuery":"","name":"{destination.ip}","queryMatch":{"displayField":"destination.ip","displayValue":"{destination.ip}","field":"destination.ip","operator":":","value":"{destination.ip}"},"type":"template"}],"enabled":true,"excluded":false,"id":"timeline-1-ec778f01-1802-40f0-9dfb-ed8de1f656cb","kqlQuery":"","name":"{source.ip}","queryMatch":{"displayField":"source.ip","displayValue":"{source.ip}","field":"source.ip","operator":":","value":"{source.ip}"},"type":"template"}],"description":"","eventType":"all","filters":[],"kqlMode":"filter","kqlQuery":{"filterQuery":{"kuery":{"kind":"kuery","expression":""},"serializedQuery":""}},"title":"Generic Network Timeline","timelineType":"template","templateTimelineVersion":2,"templateTimelineId":"91832785-286d-4ebe-b884-1a208d111a70","dateRange":{"start":1588255858373,"end":1588256218373},"savedQueryId":null,"sort":{"columnId":"@timestamp","sortDirection":"desc"},"created":1594735573866,"createdBy":"Elastic","updated":1611609960850,"updatedBy":"Elastic","eventNotes":[],"globalNotes":[],"pinnedEventIds":[],"status":"immutable"} +{"savedObjectId":null,"version":null,"columns":[{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"@timestamp","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"kibana.alert.rule.description","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"event.action","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"process.name","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"The working directory of the process.","columnHeaderType":"not-filtered","id":"process.working_directory","category":"process","type":"string","searchable":null,"example":"/home/alice"},{"indexes":null,"aggregatable":true,"name":null,"description":"Array of process arguments, starting with the absolute path to\nthe executable.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.args","category":"process","type":"string","searchable":null,"example":"[\"/usr/bin/ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"process.pid","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"Absolute path to the process executable.","columnHeaderType":"not-filtered","id":"process.parent.executable","category":"process","type":"string","searchable":null,"example":"/usr/bin/ssh"},{"indexes":null,"aggregatable":true,"name":null,"description":"Array of process arguments.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.parent.args","category":"process","type":"string","searchable":null,"example":"[\"ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"indexes":null,"aggregatable":true,"name":null,"description":"Process id.","columnHeaderType":"not-filtered","id":"process.parent.pid","category":"process","type":"number","searchable":null,"example":"4242"},{"indexes":null,"aggregatable":true,"name":null,"description":"Short name or login of the user.","columnHeaderType":"not-filtered","id":"user.name","category":"user","type":"string","searchable":null,"example":"albert"},{"indexes":null,"aggregatable":true,"name":null,"description":"Name of the host.\n\nIt can contain what `hostname` returns on Unix systems, the fully qualified\ndomain name, or a name specified by the user. The sender decides which value\nto use.","columnHeaderType":"not-filtered","id":"host.name","category":"host","type":"string","searchable":null}],"dataProviders":[{"excluded":false,"and":[],"kqlQuery":"","name":"{process.name}","queryMatch":{"displayValue":null,"field":"process.name","displayField":null,"value":"{process.name}","operator":":"},"id":"timeline-1-8622010a-61fb-490d-b162-beac9c36a853","type":"template","enabled":true}],"description":"","eventType":"all","filters":[],"kqlMode":"filter","kqlQuery":{"filterQuery":{"kuery":{"kind":"kuery","expression":""},"serializedQuery":""}},"title":"Generic Process Timeline","timelineType":"template","templateTimelineVersion":2,"templateTimelineId":"76e52245-7519-4251-91ab-262fb1a1728c","dateRange":{"start":1588161020848,"end":1588162280848},"savedQueryId":null,"sort":{"columnId":"@timestamp","sortDirection":"desc"},"created":1594735629389,"createdBy":"Elastic","updated":1611609848602,"updatedBy":"Elastic","eventNotes":[],"globalNotes":[],"pinnedEventIds":[],"status":"immutable"} +{"savedObjectId":null,"version":null,"columns":[{"columnHeaderType":"not-filtered","id":"@timestamp"},{"columnHeaderType":"not-filtered","id":"kibana.alert.rule.description"},{"aggregatable":true,"description":"The action captured by the event.\n\nThis describes the information in the event. It is more specific than `event.category`.\nExamples are `group-add`, `process-started`, `file-created`. The value is\nnormally defined by the implementer.","columnHeaderType":"not-filtered","id":"event.action","category":"event","type":"string","example":"user-password-change"},{"aggregatable":true,"description":"Array of process arguments, starting with the absolute path to\nthe executable.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.args","category":"process","type":"string","example":"[\"/usr/bin/ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"columnHeaderType":"not-filtered","id":"process.pid"},{"aggregatable":true,"description":"IP address of the source (IPv4 or IPv6).","columnHeaderType":"not-filtered","id":"source.ip","category":"source","type":"ip"},{"aggregatable":true,"description":"Port of the source.","columnHeaderType":"not-filtered","id":"source.port","category":"source","type":"number"},{"aggregatable":true,"description":"IP address of the destination (IPv4 or IPv6).","columnHeaderType":"not-filtered","id":"destination.ip","category":"destination","type":"ip"},{"columnHeaderType":"not-filtered","id":"destination.port"},{"aggregatable":true,"description":"Short name or login of the user.","columnHeaderType":"not-filtered","id":"user.name","category":"user","type":"string","example":"albert"},{"columnHeaderType":"not-filtered","id":"host.name"}],"dataProviders":[{"excluded":false,"and":[{"excluded":false,"kqlQuery":"","name":"{threat.enrichments.matched.type}","queryMatch":{"displayValue":null,"field":"threat.enrichments.matched.type","displayField":null,"value":"{threat.enrichments.matched.type}","operator":":"},"id":"timeline-1-ae18ef4b-f690-4122-a24d-e13b6818fba8","type":"template","enabled":true},{"excluded":false,"kqlQuery":"","name":"{threat.enrichments.matched.field}","queryMatch":{"displayValue":null,"field":"threat.enrichments.matched.field","displayField":null,"value":"{threat.enrichments.matched.field}","operator":":"},"id":"timeline-1-7b4cf27e-6788-4d8e-9188-7687f0eba0f2","type":"template","enabled":true}],"kqlQuery":"","name":"{threat.enrichments.matched.atomic}","queryMatch":{"displayValue":null,"field":"threat.enrichments.matched.atomic","displayField":null,"value":"{threat.enrichments.matched.atomic}","operator":":"},"id":"timeline-1-7db7d278-a80a-4853-971a-904319c50777","type":"template","enabled":true}],"description":"This Timeline template is for alerts generated by Indicator Match detection rules.","eqlOptions":{"eventCategoryField":"event.category","tiebreakerField":"","timestampField":"@timestamp","query":"","size":100},"eventType":"alert","filters":[],"kqlMode":"filter","kqlQuery":{"filterQuery":{"kuery":{"kind":"kuery","expression":""},"serializedQuery":""}},"dataViewId": "security-solution","indexNames":[".siem-signals-default"],"title":"Generic Threat Match Timeline","timelineType":"template","templateTimelineVersion":2,"templateTimelineId":"495ad7a7-316e-4544-8a0f-9c098daee76e","dateRange":{"start":1588161020848,"end":1588162280848},"savedQueryId":null,"sort":[{"sortDirection":"desc","columnId":"@timestamp"}],"created":1616696609311,"createdBy":"elastic","updated":1616788372794,"updatedBy":"elastic","eventNotes":[],"globalNotes":[],"pinnedEventIds":[],"status":"immutable"} diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_timelines/network.json b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_timelines/network.json index 6e93387579d22..ef79a83853293 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_timelines/network.json +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_timelines/network.json @@ -1 +1 @@ -{"savedObjectId":null,"version":null,"columns":[{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"@timestamp","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"signal.rule.description","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"The action captured by the event.\n\nThis describes the information in the event. It is more specific than `event.category`.\nExamples are `group-add`, `process-started`, `file-created`. The value is\nnormally defined by the implementer.","columnHeaderType":"not-filtered","id":"event.action","category":"event","type":"string","searchable":null,"example":"user-password-change"},{"indexes":null,"aggregatable":true,"name":null,"description":"Array of process arguments, starting with the absolute path to\nthe executable.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.args","category":"process","type":"string","searchable":null,"example":"[\"/usr/bin/ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"process.pid","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"IP address of the source (IPv4 or IPv6).","columnHeaderType":"not-filtered","id":"source.ip","category":"source","type":"ip","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"Port of the source.","columnHeaderType":"not-filtered","id":"source.port","category":"source","type":"number","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"IP address of the destination (IPv4 or IPv6).","columnHeaderType":"not-filtered","id":"destination.ip","category":"destination","type":"ip","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"destination.port","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"Short name or login of the user.","columnHeaderType":"not-filtered","id":"user.name","category":"user","type":"string","searchable":null,"example":"albert"},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"host.name","searchable":null}],"dataProviders":[{"and":[{"enabled":true,"excluded":false,"id":"timeline-1-e37e37c5-a6e7-4338-af30-47bfbc3c0e1e","kqlQuery":"","name":"{destination.ip}","queryMatch":{"displayField":"destination.ip","displayValue":"{destination.ip}","field":"destination.ip","operator":":","value":"{destination.ip}"},"type":"template"}],"enabled":true,"excluded":false,"id":"timeline-1-ec778f01-1802-40f0-9dfb-ed8de1f656cb","kqlQuery":"","name":"{source.ip}","queryMatch":{"displayField":"source.ip","displayValue":"{source.ip}","field":"source.ip","operator":":","value":"{source.ip}"},"type":"template"}],"description":"","eventType":"all","filters":[],"kqlMode":"filter","kqlQuery":{"filterQuery":{"kuery":{"kind":"kuery","expression":""},"serializedQuery":""}},"title":"Generic Network Timeline","timelineType":"template","templateTimelineVersion":2,"templateTimelineId":"91832785-286d-4ebe-b884-1a208d111a70","dateRange":{"start":1588255858373,"end":1588256218373},"savedQueryId":null,"sort":{"columnId":"@timestamp","sortDirection":"desc"},"created":1594735573866,"createdBy":"Elastic","updated":1611609960850,"updatedBy":"Elastic","eventNotes":[],"globalNotes":[],"pinnedEventIds":[],"status":"immutable"} +{"savedObjectId":null,"version":null,"columns":[{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"@timestamp","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"kibana.alert.rule.description","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"The action captured by the event.\n\nThis describes the information in the event. It is more specific than `event.category`.\nExamples are `group-add`, `process-started`, `file-created`. The value is\nnormally defined by the implementer.","columnHeaderType":"not-filtered","id":"event.action","category":"event","type":"string","searchable":null,"example":"user-password-change"},{"indexes":null,"aggregatable":true,"name":null,"description":"Array of process arguments, starting with the absolute path to\nthe executable.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.args","category":"process","type":"string","searchable":null,"example":"[\"/usr/bin/ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"process.pid","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"IP address of the source (IPv4 or IPv6).","columnHeaderType":"not-filtered","id":"source.ip","category":"source","type":"ip","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"Port of the source.","columnHeaderType":"not-filtered","id":"source.port","category":"source","type":"number","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"IP address of the destination (IPv4 or IPv6).","columnHeaderType":"not-filtered","id":"destination.ip","category":"destination","type":"ip","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"destination.port","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"Short name or login of the user.","columnHeaderType":"not-filtered","id":"user.name","category":"user","type":"string","searchable":null,"example":"albert"},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"host.name","searchable":null}],"dataProviders":[{"and":[{"enabled":true,"excluded":false,"id":"timeline-1-e37e37c5-a6e7-4338-af30-47bfbc3c0e1e","kqlQuery":"","name":"{destination.ip}","queryMatch":{"displayField":"destination.ip","displayValue":"{destination.ip}","field":"destination.ip","operator":":","value":"{destination.ip}"},"type":"template"}],"enabled":true,"excluded":false,"id":"timeline-1-ec778f01-1802-40f0-9dfb-ed8de1f656cb","kqlQuery":"","name":"{source.ip}","queryMatch":{"displayField":"source.ip","displayValue":"{source.ip}","field":"source.ip","operator":":","value":"{source.ip}"},"type":"template"}],"description":"","eventType":"all","filters":[],"kqlMode":"filter","kqlQuery":{"filterQuery":{"kuery":{"kind":"kuery","expression":""},"serializedQuery":""}},"title":"Generic Network Timeline","timelineType":"template","templateTimelineVersion":2,"templateTimelineId":"91832785-286d-4ebe-b884-1a208d111a70","dateRange":{"start":1588255858373,"end":1588256218373},"savedQueryId":null,"sort":{"columnId":"@timestamp","sortDirection":"desc"},"created":1594735573866,"createdBy":"Elastic","updated":1611609960850,"updatedBy":"Elastic","eventNotes":[],"globalNotes":[],"pinnedEventIds":[],"status":"immutable"} diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_timelines/process.json b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_timelines/process.json index c25873746a9e9..b876ef16379ff 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_timelines/process.json +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_timelines/process.json @@ -1 +1 @@ -{"savedObjectId":null,"version":null,"columns":[{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"@timestamp","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"signal.rule.description","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"event.action","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"process.name","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"The working directory of the process.","columnHeaderType":"not-filtered","id":"process.working_directory","category":"process","type":"string","searchable":null,"example":"/home/alice"},{"indexes":null,"aggregatable":true,"name":null,"description":"Array of process arguments, starting with the absolute path to\nthe executable.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.args","category":"process","type":"string","searchable":null,"example":"[\"/usr/bin/ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"process.pid","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"Absolute path to the process executable.","columnHeaderType":"not-filtered","id":"process.parent.executable","category":"process","type":"string","searchable":null,"example":"/usr/bin/ssh"},{"indexes":null,"aggregatable":true,"name":null,"description":"Array of process arguments.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.parent.args","category":"process","type":"string","searchable":null,"example":"[\"ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"indexes":null,"aggregatable":true,"name":null,"description":"Process id.","columnHeaderType":"not-filtered","id":"process.parent.pid","category":"process","type":"number","searchable":null,"example":"4242"},{"indexes":null,"aggregatable":true,"name":null,"description":"Short name or login of the user.","columnHeaderType":"not-filtered","id":"user.name","category":"user","type":"string","searchable":null,"example":"albert"},{"indexes":null,"aggregatable":true,"name":null,"description":"Name of the host.\n\nIt can contain what `hostname` returns on Unix systems, the fully qualified\ndomain name, or a name specified by the user. The sender decides which value\nto use.","columnHeaderType":"not-filtered","id":"host.name","category":"host","type":"string","searchable":null}],"dataProviders":[{"excluded":false,"and":[],"kqlQuery":"","name":"{process.name}","queryMatch":{"displayValue":null,"field":"process.name","displayField":null,"value":"{process.name}","operator":":"},"id":"timeline-1-8622010a-61fb-490d-b162-beac9c36a853","type":"template","enabled":true}],"description":"","eventType":"all","filters":[],"kqlMode":"filter","kqlQuery":{"filterQuery":{"kuery":{"kind":"kuery","expression":""},"serializedQuery":""}},"title":"Generic Process Timeline","timelineType":"template","templateTimelineVersion":2,"templateTimelineId":"76e52245-7519-4251-91ab-262fb1a1728c","dateRange":{"start":1588161020848,"end":1588162280848},"savedQueryId":null,"sort":{"columnId":"@timestamp","sortDirection":"desc"},"created":1594735629389,"createdBy":"Elastic","updated":1611609848602,"updatedBy":"Elastic","eventNotes":[],"globalNotes":[],"pinnedEventIds":[],"status":"immutable"} +{"savedObjectId":null,"version":null,"columns":[{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"@timestamp","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"kibana.alert.rule.description","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"event.action","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"process.name","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"The working directory of the process.","columnHeaderType":"not-filtered","id":"process.working_directory","category":"process","type":"string","searchable":null,"example":"/home/alice"},{"indexes":null,"aggregatable":true,"name":null,"description":"Array of process arguments, starting with the absolute path to\nthe executable.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.args","category":"process","type":"string","searchable":null,"example":"[\"/usr/bin/ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"process.pid","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"Absolute path to the process executable.","columnHeaderType":"not-filtered","id":"process.parent.executable","category":"process","type":"string","searchable":null,"example":"/usr/bin/ssh"},{"indexes":null,"aggregatable":true,"name":null,"description":"Array of process arguments.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.parent.args","category":"process","type":"string","searchable":null,"example":"[\"ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"indexes":null,"aggregatable":true,"name":null,"description":"Process id.","columnHeaderType":"not-filtered","id":"process.parent.pid","category":"process","type":"number","searchable":null,"example":"4242"},{"indexes":null,"aggregatable":true,"name":null,"description":"Short name or login of the user.","columnHeaderType":"not-filtered","id":"user.name","category":"user","type":"string","searchable":null,"example":"albert"},{"indexes":null,"aggregatable":true,"name":null,"description":"Name of the host.\n\nIt can contain what `hostname` returns on Unix systems, the fully qualified\ndomain name, or a name specified by the user. The sender decides which value\nto use.","columnHeaderType":"not-filtered","id":"host.name","category":"host","type":"string","searchable":null}],"dataProviders":[{"excluded":false,"and":[],"kqlQuery":"","name":"{process.name}","queryMatch":{"displayValue":null,"field":"process.name","displayField":null,"value":"{process.name}","operator":":"},"id":"timeline-1-8622010a-61fb-490d-b162-beac9c36a853","type":"template","enabled":true}],"description":"","eventType":"all","filters":[],"kqlMode":"filter","kqlQuery":{"filterQuery":{"kuery":{"kind":"kuery","expression":""},"serializedQuery":""}},"title":"Generic Process Timeline","timelineType":"template","templateTimelineVersion":2,"templateTimelineId":"76e52245-7519-4251-91ab-262fb1a1728c","dateRange":{"start":1588161020848,"end":1588162280848},"savedQueryId":null,"sort":{"columnId":"@timestamp","sortDirection":"desc"},"created":1594735629389,"createdBy":"Elastic","updated":1611609848602,"updatedBy":"Elastic","eventNotes":[],"globalNotes":[],"pinnedEventIds":[],"status":"immutable"} diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_timelines/threat.json b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_timelines/threat.json index 0d74cc6e43619..588ead3db2c44 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_timelines/threat.json +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_timelines/threat.json @@ -1 +1 @@ -{"savedObjectId":null,"version":null,"columns":[{"columnHeaderType":"not-filtered","id":"@timestamp"},{"columnHeaderType":"not-filtered","id":"signal.rule.description"},{"aggregatable":true,"description":"The action captured by the event.\n\nThis describes the information in the event. It is more specific than `event.category`.\nExamples are `group-add`, `process-started`, `file-created`. The value is\nnormally defined by the implementer.","columnHeaderType":"not-filtered","id":"event.action","category":"event","type":"string","example":"user-password-change"},{"aggregatable":true,"description":"Array of process arguments, starting with the absolute path to\nthe executable.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.args","category":"process","type":"string","example":"[\"/usr/bin/ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"columnHeaderType":"not-filtered","id":"process.pid"},{"aggregatable":true,"description":"IP address of the source (IPv4 or IPv6).","columnHeaderType":"not-filtered","id":"source.ip","category":"source","type":"ip"},{"aggregatable":true,"description":"Port of the source.","columnHeaderType":"not-filtered","id":"source.port","category":"source","type":"number"},{"aggregatable":true,"description":"IP address of the destination (IPv4 or IPv6).","columnHeaderType":"not-filtered","id":"destination.ip","category":"destination","type":"ip"},{"columnHeaderType":"not-filtered","id":"destination.port"},{"aggregatable":true,"description":"Short name or login of the user.","columnHeaderType":"not-filtered","id":"user.name","category":"user","type":"string","example":"albert"},{"columnHeaderType":"not-filtered","id":"host.name"}],"dataProviders":[{"excluded":false,"and":[{"excluded":false,"kqlQuery":"","name":"{threat.enrichments.matched.type}","queryMatch":{"displayValue":null,"field":"threat.enrichments.matched.type","displayField":null,"value":"{threat.enrichments.matched.type}","operator":":"},"id":"timeline-1-ae18ef4b-f690-4122-a24d-e13b6818fba8","type":"template","enabled":true},{"excluded":false,"kqlQuery":"","name":"{threat.enrichments.matched.field}","queryMatch":{"displayValue":null,"field":"threat.enrichments.matched.field","displayField":null,"value":"{threat.enrichments.matched.field}","operator":":"},"id":"timeline-1-7b4cf27e-6788-4d8e-9188-7687f0eba0f2","type":"template","enabled":true}],"kqlQuery":"","name":"{threat.enrichments.matched.atomic}","queryMatch":{"displayValue":null,"field":"threat.enrichments.matched.atomic","displayField":null,"value":"{threat.enrichments.matched.atomic}","operator":":"},"id":"timeline-1-7db7d278-a80a-4853-971a-904319c50777","type":"template","enabled":true}],"description":"This Timeline template is for alerts generated by Indicator Match detection rules.","eqlOptions":{"eventCategoryField":"event.category","tiebreakerField":"","timestampField":"@timestamp","query":"","size":100},"eventType":"alert","filters":[],"kqlMode":"filter","kqlQuery":{"filterQuery":{"kuery":{"kind":"kuery","expression":""},"serializedQuery":""}},"dataViewId": "security-solution","indexNames":[".siem-signals-default"],"title":"Generic Threat Match Timeline","timelineType":"template","templateTimelineVersion":2,"templateTimelineId":"495ad7a7-316e-4544-8a0f-9c098daee76e","dateRange":{"start":1588161020848,"end":1588162280848},"savedQueryId":null,"sort":[{"sortDirection":"desc","columnId":"@timestamp"}],"created":1616696609311,"createdBy":"elastic","updated":1616788372794,"updatedBy":"elastic","eventNotes":[],"globalNotes":[],"pinnedEventIds":[],"status":"immutable"} +{"savedObjectId":null,"version":null,"columns":[{"columnHeaderType":"not-filtered","id":"@timestamp"},{"columnHeaderType":"not-filtered","id":"kibana.alert.rule.description"},{"aggregatable":true,"description":"The action captured by the event.\n\nThis describes the information in the event. It is more specific than `event.category`.\nExamples are `group-add`, `process-started`, `file-created`. The value is\nnormally defined by the implementer.","columnHeaderType":"not-filtered","id":"event.action","category":"event","type":"string","example":"user-password-change"},{"aggregatable":true,"description":"Array of process arguments, starting with the absolute path to\nthe executable.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.args","category":"process","type":"string","example":"[\"/usr/bin/ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"columnHeaderType":"not-filtered","id":"process.pid"},{"aggregatable":true,"description":"IP address of the source (IPv4 or IPv6).","columnHeaderType":"not-filtered","id":"source.ip","category":"source","type":"ip"},{"aggregatable":true,"description":"Port of the source.","columnHeaderType":"not-filtered","id":"source.port","category":"source","type":"number"},{"aggregatable":true,"description":"IP address of the destination (IPv4 or IPv6).","columnHeaderType":"not-filtered","id":"destination.ip","category":"destination","type":"ip"},{"columnHeaderType":"not-filtered","id":"destination.port"},{"aggregatable":true,"description":"Short name or login of the user.","columnHeaderType":"not-filtered","id":"user.name","category":"user","type":"string","example":"albert"},{"columnHeaderType":"not-filtered","id":"host.name"}],"dataProviders":[{"excluded":false,"and":[{"excluded":false,"kqlQuery":"","name":"{threat.enrichments.matched.type}","queryMatch":{"displayValue":null,"field":"threat.enrichments.matched.type","displayField":null,"value":"{threat.enrichments.matched.type}","operator":":"},"id":"timeline-1-ae18ef4b-f690-4122-a24d-e13b6818fba8","type":"template","enabled":true},{"excluded":false,"kqlQuery":"","name":"{threat.enrichments.matched.field}","queryMatch":{"displayValue":null,"field":"threat.enrichments.matched.field","displayField":null,"value":"{threat.enrichments.matched.field}","operator":":"},"id":"timeline-1-7b4cf27e-6788-4d8e-9188-7687f0eba0f2","type":"template","enabled":true}],"kqlQuery":"","name":"{threat.enrichments.matched.atomic}","queryMatch":{"displayValue":null,"field":"threat.enrichments.matched.atomic","displayField":null,"value":"{threat.enrichments.matched.atomic}","operator":":"},"id":"timeline-1-7db7d278-a80a-4853-971a-904319c50777","type":"template","enabled":true}],"description":"This Timeline template is for alerts generated by Indicator Match detection rules.","eqlOptions":{"eventCategoryField":"event.category","tiebreakerField":"","timestampField":"@timestamp","query":"","size":100},"eventType":"alert","filters":[],"kqlMode":"filter","kqlQuery":{"filterQuery":{"kuery":{"kind":"kuery","expression":""},"serializedQuery":""}},"dataViewId": "security-solution","indexNames":[".siem-signals-default"],"title":"Generic Threat Match Timeline","timelineType":"template","templateTimelineVersion":2,"templateTimelineId":"495ad7a7-316e-4544-8a0f-9c098daee76e","dateRange":{"start":1588161020848,"end":1588162280848},"savedQueryId":null,"sort":[{"sortDirection":"desc","columnId":"@timestamp"}],"created":1616696609311,"createdBy":"elastic","updated":1616788372794,"updatedBy":"elastic","eventNotes":[],"globalNotes":[],"pinnedEventIds":[],"status":"immutable"} diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/preview/preview_rule_execution_log_client.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/preview/preview_rule_execution_log_client.ts index c2c1b5d7615c2..5ab32f27c349e 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/preview/preview_rule_execution_log_client.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/preview/preview_rule_execution_log_client.ts @@ -9,7 +9,6 @@ import { SavedObjectsFindResult } from 'kibana/server'; import { IRuleExecutionLogClient, LogStatusChangeArgs, - LogExecutionMetricsArgs, FindBulkExecutionLogArgs, FindBulkExecutionLogResponse, FindExecutionLogArgs, @@ -65,10 +64,6 @@ export const createWarningsAndErrors = () => { warningsAndErrorsStore.push(args); return Promise.resolve(); }, - - logExecutionMetrics(args: LogExecutionMetricsArgs): Promise { - return Promise.resolve(); - }, }; return { previewRuleExecutionLogClient, warningsAndErrorsStore }; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/bulk_create_threshold_signals.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/bulk_create_threshold_signals.ts index 4dbe1577365d6..1c2bdd0d70ced 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/bulk_create_threshold_signals.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/bulk_create_threshold_signals.ts @@ -144,7 +144,7 @@ const getTransformedHits = ( const source = { [TIMESTAMP]: bucket.maxTimestamp, ...bucket.terms.reduce((termAcc, term) => { - if (!term.field.startsWith('signal.')) { + if (!term.field.startsWith('signal.') && !term.field.startsWith('kibana.alert.')) { // We don't want to overwrite `signal.*` fields. // See: https://github.com/elastic/kibana/issues/83218 return { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/find_threshold_signals.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/find_threshold_signals.test.ts index e74434869c55b..5374ae53a74e8 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/find_threshold_signals.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threshold/find_threshold_signals.test.ts @@ -23,7 +23,7 @@ const queryFilter = getQueryFilter('', 'kuery', [], ['*'], []); const mockSingleSearchAfter = jest.fn(); // Failing with rule registry enabled -describe.skip('findThresholdSignals', () => { +describe('findThresholdSignals', () => { let mockService: AlertServicesMock; beforeEach(() => { diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/sender.ts b/x-pack/plugins/security_solution/server/lib/telemetry/sender.ts index 3a8d503c9311f..bd7e0b5bee84b 100644 --- a/x-pack/plugins/security_solution/server/lib/telemetry/sender.ts +++ b/x-pack/plugins/security_solution/server/lib/telemetry/sender.ts @@ -265,7 +265,7 @@ export class TelemetryEventsSender { headers: { 'Content-Type': 'application/x-ndjson', 'X-Elastic-Cluster-ID': clusterUuid, - 'X-Elastic-Stack-Version': clusterVersionNumber ? clusterVersionNumber : '7.10.0', + 'X-Elastic-Stack-Version': clusterVersionNumber ? clusterVersionNumber : '8.0.0', ...(licenseId ? { 'X-Elastic-License-ID': licenseId } : {}), }, }); diff --git a/x-pack/plugins/security_solution/server/lib/timeline/__mocks__/prepackaged_timelines.ndjson b/x-pack/plugins/security_solution/server/lib/timeline/__mocks__/prepackaged_timelines.ndjson index f7113a4ac395e..dd64f9b0ec685 100644 --- a/x-pack/plugins/security_solution/server/lib/timeline/__mocks__/prepackaged_timelines.ndjson +++ b/x-pack/plugins/security_solution/server/lib/timeline/__mocks__/prepackaged_timelines.ndjson @@ -1 +1 @@ -{"savedObjectId":"mocked-timeline-id-1","version":"WzExNzEyLDFd","columns":[{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"@timestamp","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"signal.rule.description","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"The action captured by the event.\n\nThis describes the information in the event. It is more specific than `event.category`.\nExamples are `group-add`, `process-started`, `file-created`. The value is\nnormally defined by the implementer.","columnHeaderType":"not-filtered","id":"event.action","category":"event","type":"string","searchable":null,"example":"user-password-change"},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"endgame.data.rule_name","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"rule.reference","searchable":null},{"aggregatable":true,"description":"Name of the host.\n\nIt can contain what `hostname` returns on Unix systems, the fully qualified\ndomain name, or a name specified by the user. The sender decides which value\nto use.","columnHeaderType":"not-filtered","id":"host.name","category":"host","type":"string"},{"aggregatable":true,"description":"Operating system name, without the version.","columnHeaderType":"not-filtered","id":"host.os.name","category":"host","type":"string","example":"Mac OS X"}],"dataProviders":[{"excluded":false,"and":[],"kqlQuery":"","name":"3c322ed995865f642c1a269d54cbd177bd4b0e6efcf15a589f4f8582efbe7509","queryMatch":{"displayValue":null,"field":"_id","displayField":null,"value":"3c322ed995865f642c1a269d54cbd177bd4b0e6efcf15a589f4f8582efbe7509","operator":":"},"id":"send-signal-to-timeline-action-default-draggable-event-details-value-formatted-field-value-timeline-1-signal-id-3c322ed995865f642c1a269d54cbd177bd4b0e6efcf15a589f4f8582efbe7509","enabled":true}],"description":"","eventType":"all","filters":[],"kqlMode":"filter","kqlQuery":{"filterQuery":{"kuery":{"kind":"kuery","expression":""},"serializedQuery":""}},"title":"Generic Endpoint Timeline","dateRange":{"start":1588257731065,"end":1588258391065},"savedQueryId":null,"sort":{"columnId":"@timestamp","sortDirection":"desc"},"created":1588258576517,"createdBy":"elastic","updated":1588261039030,"updatedBy":"elastic","eventNotes":[],"globalNotes":[],"pinnedEventIds":[],"timelineType":"template"} +{"savedObjectId":"mocked-timeline-id-1","version":"WzExNzEyLDFd","columns":[{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"@timestamp","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"kibana.alert.rule.description","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"The action captured by the event.\n\nThis describes the information in the event. It is more specific than `event.category`.\nExamples are `group-add`, `process-started`, `file-created`. The value is\nnormally defined by the implementer.","columnHeaderType":"not-filtered","id":"event.action","category":"event","type":"string","searchable":null,"example":"user-password-change"},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"endgame.data.rule_name","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"rule.reference","searchable":null},{"aggregatable":true,"description":"Name of the host.\n\nIt can contain what `hostname` returns on Unix systems, the fully qualified\ndomain name, or a name specified by the user. The sender decides which value\nto use.","columnHeaderType":"not-filtered","id":"host.name","category":"host","type":"string"},{"aggregatable":true,"description":"Operating system name, without the version.","columnHeaderType":"not-filtered","id":"host.os.name","category":"host","type":"string","example":"Mac OS X"}],"dataProviders":[{"excluded":false,"and":[],"kqlQuery":"","name":"3c322ed995865f642c1a269d54cbd177bd4b0e6efcf15a589f4f8582efbe7509","queryMatch":{"displayValue":null,"field":"_id","displayField":null,"value":"3c322ed995865f642c1a269d54cbd177bd4b0e6efcf15a589f4f8582efbe7509","operator":":"},"id":"send-signal-to-timeline-action-default-draggable-event-details-value-formatted-field-value-timeline-1-signal-id-3c322ed995865f642c1a269d54cbd177bd4b0e6efcf15a589f4f8582efbe7509","enabled":true}],"description":"","eventType":"all","filters":[],"kqlMode":"filter","kqlQuery":{"filterQuery":{"kuery":{"kind":"kuery","expression":""},"serializedQuery":""}},"title":"Generic Endpoint Timeline","dateRange":{"start":1588257731065,"end":1588258391065},"savedQueryId":null,"sort":{"columnId":"@timestamp","sortDirection":"desc"},"created":1588258576517,"createdBy":"elastic","updated":1588261039030,"updatedBy":"elastic","eventNotes":[],"globalNotes":[],"pinnedEventIds":[],"timelineType":"template"} diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/prepackaged_timelines/install_prepackaged_timelines/helpers.test.ts b/x-pack/plugins/security_solution/server/lib/timeline/routes/prepackaged_timelines/install_prepackaged_timelines/helpers.test.ts index 4e174f23d0746..d4425d17671a3 100644 --- a/x-pack/plugins/security_solution/server/lib/timeline/routes/prepackaged_timelines/install_prepackaged_timelines/helpers.test.ts +++ b/x-pack/plugins/security_solution/server/lib/timeline/routes/prepackaged_timelines/install_prepackaged_timelines/helpers.test.ts @@ -104,7 +104,7 @@ describe.each([ indexes: null, name: null, columnHeaderType: 'not-filtered', - id: 'signal.rule.description', + id: 'kibana.alert.rule.description', searchable: null, }, { diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/get_timelines/index.ts b/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/get_timelines/index.ts index 4599916092611..37ab77646b65c 100644 --- a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/get_timelines/index.ts +++ b/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/get_timelines/index.ts @@ -4,7 +4,6 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import Boom from '@hapi/boom'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; @@ -19,13 +18,14 @@ import { SetupPlugins } from '../../../../../plugin'; import { buildSiemResponse } from '../../../../detection_engine/routes/utils'; +import { CustomHttpRequestError } from '../../../../../utils/custom_http_request_error'; import { buildFrameworkRequest, escapeHatch, throwErrors } from '../../../utils/common'; import { getAllTimeline } from '../../../saved_object/timelines'; import { getTimelinesQuerySchema } from '../../../schemas/timelines'; export const getTimelinesRoute = ( router: SecuritySolutionPluginRouter, - config: ConfigType, + _config: ConfigType, security: SetupPlugins['security'] ) => { router.get( @@ -39,11 +39,12 @@ export const getTimelinesRoute = ( }, }, async (context, request, response) => { + const customHttpRequestError = (message: string) => new CustomHttpRequestError(message, 400); try { const frameworkRequest = await buildFrameworkRequest(context, security, request); const queryParams = pipe( getTimelinesQuerySchema.decode(request.query), - fold(throwErrors(Boom.badRequest), identity) + fold(throwErrors(customHttpRequestError), identity) ); const onlyUserFavorite = queryParams?.only_user_favorite === 'true' ? true : false; const pageSize = queryParams?.page_size ? parseInt(queryParams.page_size, 10) : null; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/query.host_details.dsl.test.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/query.host_details.dsl.test.ts index aef3e6ff3dd77..c54e20c70c632 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/query.host_details.dsl.test.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/query.host_details.dsl.test.ts @@ -9,7 +9,7 @@ import { buildHostDetailsQuery } from './query.host_details.dsl'; import { mockOptions, expectedDsl } from './__mocks__/'; // Failing with rule registry enabled -describe.skip('buildHostDetailsQuery', () => { +describe('buildHostDetailsQuery', () => { test('build query from options correctly', () => { expect(buildHostDetailsQuery(mockOptions)).toEqual(expectedDsl); }); diff --git a/x-pack/plugins/security_solution/server/utils/custom_http_request_error.ts b/x-pack/plugins/security_solution/server/utils/custom_http_request_error.ts new file mode 100644 index 0000000000000..e4edaeb3e3dcf --- /dev/null +++ b/x-pack/plugins/security_solution/server/utils/custom_http_request_error.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +export class CustomHttpRequestError extends Error { + constructor(message: string, public readonly statusCode: number = 500) { + super(message); + // For debugging - capture name of subclasses + this.name = this.constructor.name; + this.message = message; + } +} diff --git a/x-pack/plugins/security_solution/tsconfig.json b/x-pack/plugins/security_solution/tsconfig.json index 8f4d602e26461..d518eaf7f8243 100644 --- a/x-pack/plugins/security_solution/tsconfig.json +++ b/x-pack/plugins/security_solution/tsconfig.json @@ -27,6 +27,7 @@ { "path": "../../../src/plugins/usage_collection/tsconfig.json" }, { "path": "../../../src/plugins/telemetry/tsconfig.json" }, { "path": "../../../src/plugins/telemetry_management_section/tsconfig.json" }, + { "path": "../../../src/plugins/data_view_field_editor/tsconfig.json" }, { "path": "../actions/tsconfig.json" }, { "path": "../alerting/tsconfig.json" }, { "path": "../cases/tsconfig.json" }, diff --git a/x-pack/plugins/snapshot_restore/__jest__/client_integration/home.test.ts b/x-pack/plugins/snapshot_restore/__jest__/client_integration/home.test.ts index 7338e84f5c095..e738cea578ca2 100644 --- a/x-pack/plugins/snapshot_restore/__jest__/client_integration/home.test.ts +++ b/x-pack/plugins/snapshot_restore/__jest__/client_integration/home.test.ts @@ -22,8 +22,8 @@ import { REPOSITORY_NAME } from './helpers/constant'; const { setup } = pageHelpers.home; // Mocking FormattedDate and FormattedTime due to timezone differences on CI -jest.mock('@kbn/i18n/react', () => { - const original = jest.requireActual('@kbn/i18n/react'); +jest.mock('@kbn/i18n-react', () => { + const original = jest.requireActual('@kbn/i18n-react'); return { ...original, diff --git a/x-pack/plugins/snapshot_restore/public/application/app.tsx b/x-pack/plugins/snapshot_restore/public/application/app.tsx index a7993300079ab..f7056a673cfbb 100644 --- a/x-pack/plugins/snapshot_restore/public/application/app.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/app.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { Redirect, Route, Switch } from 'react-router-dom'; import { EuiPageContent } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { APP_WRAPPER_CLASS } from '../../../../../src/core/public'; diff --git a/x-pack/plugins/snapshot_restore/public/application/components/collapsible_lists/collapsible_data_streams_list.tsx b/x-pack/plugins/snapshot_restore/public/application/components/collapsible_lists/collapsible_data_streams_list.tsx index ba45cd914c7bd..f96ef15be4852 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/collapsible_lists/collapsible_data_streams_list.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/collapsible_lists/collapsible_data_streams_list.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiTitle, EuiLink, EuiIcon, EuiText, EuiSpacer } from '@elastic/eui'; import { useCollapsibleList } from './use_collapsible_list'; diff --git a/x-pack/plugins/snapshot_restore/public/application/components/collapsible_lists/collapsible_indices_list.tsx b/x-pack/plugins/snapshot_restore/public/application/components/collapsible_lists/collapsible_indices_list.tsx index 8f2fb0eac5df3..5f05e69c36eda 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/collapsible_lists/collapsible_indices_list.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/collapsible_lists/collapsible_indices_list.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiTitle, EuiLink, EuiIcon, EuiText, EuiSpacer } from '@elastic/eui'; import { useCollapsibleList } from './use_collapsible_list'; diff --git a/x-pack/plugins/snapshot_restore/public/application/components/formatted_date_time.tsx b/x-pack/plugins/snapshot_restore/public/application/components/formatted_date_time.tsx index f874183f3f02e..8505fb843649d 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/formatted_date_time.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/formatted_date_time.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment } from 'react'; -import { FormattedDate, FormattedTime } from '@kbn/i18n/react'; +import { FormattedDate, FormattedTime } from '@kbn/i18n-react'; interface Props { epochMs: number; diff --git a/x-pack/plugins/snapshot_restore/public/application/components/policy_delete_provider.tsx b/x-pack/plugins/snapshot_restore/public/application/components/policy_delete_provider.tsx index 792538a730ebe..5fa2b3718f7f0 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/policy_delete_provider.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/policy_delete_provider.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment, useRef, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiConfirmModal } from '@elastic/eui'; import { useServices, useToastNotifications } from '../app_context'; diff --git a/x-pack/plugins/snapshot_restore/public/application/components/policy_execute_provider.tsx b/x-pack/plugins/snapshot_restore/public/application/components/policy_execute_provider.tsx index 5636ca651b628..bfab80c046e02 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/policy_execute_provider.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/policy_execute_provider.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment, useRef, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiConfirmModal } from '@elastic/eui'; import { useServices, useToastNotifications } from '../app_context'; diff --git a/x-pack/plugins/snapshot_restore/public/application/components/policy_form/policy_form.tsx b/x-pack/plugins/snapshot_restore/public/application/components/policy_form/policy_form.tsx index 185d3bb90bae5..8603c72918bed 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/policy_form/policy_form.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/policy_form/policy_form.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiButtonEmpty, diff --git a/x-pack/plugins/snapshot_restore/public/application/components/policy_form/steps/step_logistics.tsx b/x-pack/plugins/snapshot_restore/public/application/components/policy_form/steps/step_logistics.tsx index 34a36961d4281..501057066a5b0 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/policy_form/steps/step_logistics.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/policy_form/steps/step_logistics.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiTitle, diff --git a/x-pack/plugins/snapshot_restore/public/application/components/policy_form/steps/step_retention.tsx b/x-pack/plugins/snapshot_restore/public/application/components/policy_form/steps/step_retention.tsx index ee2c12c0815b2..c6ae5f0aac11d 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/policy_form/steps/step_retention.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/policy_form/steps/step_retention.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiTitle, diff --git a/x-pack/plugins/snapshot_restore/public/application/components/policy_form/steps/step_review.tsx b/x-pack/plugins/snapshot_restore/public/application/components/policy_form/steps/step_review.tsx index 2af8751066a50..f6de83c6b586f 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/policy_form/steps/step_review.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/policy_form/steps/step_review.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCodeBlock, EuiFlexGroup, diff --git a/x-pack/plugins/snapshot_restore/public/application/components/policy_form/steps/step_settings/fields/indices_and_data_streams_field/data_streams_and_indices_list_help_text.tsx b/x-pack/plugins/snapshot_restore/public/application/components/policy_form/steps/step_settings/fields/indices_and_data_streams_field/data_streams_and_indices_list_help_text.tsx index f6f439bf1c16c..ce7650ec3bfcb 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/policy_form/steps/step_settings/fields/indices_and_data_streams_field/data_streams_and_indices_list_help_text.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/policy_form/steps/step_settings/fields/indices_and_data_streams_field/data_streams_and_indices_list_help_text.tsx @@ -6,7 +6,7 @@ */ import React, { FunctionComponent } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiLink } from '@elastic/eui'; interface Props { diff --git a/x-pack/plugins/snapshot_restore/public/application/components/policy_form/steps/step_settings/fields/indices_and_data_streams_field/indices_and_data_streams_field.tsx b/x-pack/plugins/snapshot_restore/public/application/components/policy_form/steps/step_settings/fields/indices_and_data_streams_field/indices_and_data_streams_field.tsx index 7d37134f998a3..cf2b92cf9e9d5 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/policy_form/steps/step_settings/fields/indices_and_data_streams_field/indices_and_data_streams_field.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/policy_form/steps/step_settings/fields/indices_and_data_streams_field/indices_and_data_streams_field.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment, FunctionComponent, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiComboBox, diff --git a/x-pack/plugins/snapshot_restore/public/application/components/policy_form/steps/step_settings/step_settings.tsx b/x-pack/plugins/snapshot_restore/public/application/components/policy_form/steps/step_settings/step_settings.tsx index 7027ccb566d41..1abccc789c678 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/policy_form/steps/step_settings/step_settings.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/policy_form/steps/step_settings/step_settings.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiTitle, diff --git a/x-pack/plugins/snapshot_restore/public/application/components/repository_delete_provider.tsx b/x-pack/plugins/snapshot_restore/public/application/components/repository_delete_provider.tsx index f02f160958a20..ba9f750401e12 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/repository_delete_provider.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/repository_delete_provider.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment, useRef, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiConfirmModal } from '@elastic/eui'; import { Repository } from '../../../common/types'; diff --git a/x-pack/plugins/snapshot_restore/public/application/components/repository_form/step_one.tsx b/x-pack/plugins/snapshot_restore/public/application/components/repository_form/step_one.tsx index 91802c6bcf1fa..79a311395e5d7 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/repository_form/step_one.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/repository_form/step_one.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiButtonEmpty, diff --git a/x-pack/plugins/snapshot_restore/public/application/components/repository_form/step_two.tsx b/x-pack/plugins/snapshot_restore/public/application/components/repository_form/step_two.tsx index a985a6dee0bae..fc33fb7f682c6 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/repository_form/step_two.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/repository_form/step_two.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiButtonEmpty, diff --git a/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/azure_settings.tsx b/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/azure_settings.tsx index b2657d0bfc0fb..2fca0169c717e 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/azure_settings.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/azure_settings.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiFieldText, diff --git a/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/common/chunk_size.tsx b/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/common/chunk_size.tsx index cecf4983fede9..0eb7185aaa4b9 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/common/chunk_size.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/common/chunk_size.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiFieldText, EuiFormRow, EuiTitle, EuiCode } from '@elastic/eui'; import { RepositorySettingsValidation } from '../../../../services/validation'; diff --git a/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/common/max_restore.tsx b/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/common/max_restore.tsx index 281fe26d5b9d3..b5be6d079558b 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/common/max_restore.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/common/max_restore.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiFieldText, EuiFormRow, EuiTitle, EuiCode } from '@elastic/eui'; import { RepositorySettingsValidation } from '../../../../services/validation'; diff --git a/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/common/max_snapshots.tsx b/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/common/max_snapshots.tsx index 85b9153c711b9..b126770e37ac1 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/common/max_snapshots.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/common/max_snapshots.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiFieldText, EuiFormRow, EuiTitle, EuiCode } from '@elastic/eui'; import { RepositorySettingsValidation } from '../../../../services/validation'; diff --git a/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/fs_settings.tsx b/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/fs_settings.tsx index af3e6e8231262..bc7aafc781081 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/fs_settings.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/fs_settings.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCode, EuiDescribedFormGroup, diff --git a/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/gcs_settings.tsx b/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/gcs_settings.tsx index dac31b7074de1..97eb0b25b1485 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/gcs_settings.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/gcs_settings.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiFieldText, EuiFormRow, EuiSwitch, EuiTitle } from '@elastic/eui'; import { GCSRepository, Repository } from '../../../../../common/types'; diff --git a/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/hdfs_settings.tsx b/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/hdfs_settings.tsx index 2cece7d6d396a..724f3a6a17a5f 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/hdfs_settings.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/hdfs_settings.tsx @@ -7,7 +7,7 @@ import React, { Fragment, useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCode, EuiDescribedFormGroup, diff --git a/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/index.tsx b/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/index.tsx index 45036a31ccbde..90c4cff74a3b0 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/index.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/index.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { REPOSITORY_TYPES } from '../../../../../common'; import { Repository, RepositoryType, EmptyRepository } from '../../../../../common/types'; diff --git a/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/readonly_settings.tsx b/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/readonly_settings.tsx index 5d93cf28501f2..a6451bb538cc5 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/readonly_settings.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/readonly_settings.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCode, EuiDescribedFormGroup, diff --git a/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/s3_settings.tsx b/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/s3_settings.tsx index a67cb2610b5bb..ad0a30f3102cd 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/s3_settings.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/s3_settings.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCode, EuiDescribedFormGroup, diff --git a/x-pack/plugins/snapshot_restore/public/application/components/repository_verification_badge.tsx b/x-pack/plugins/snapshot_restore/public/application/components/repository_verification_badge.tsx index 5de86608b1823..11f405346c695 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/repository_verification_badge.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/repository_verification_badge.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiHealth } from '@elastic/eui'; import { RepositoryVerification } from '../../../common/types'; diff --git a/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/restore_snapshot_form.tsx b/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/restore_snapshot_form.tsx index 6608060d76a12..5419e6a4625c9 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/restore_snapshot_form.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/restore_snapshot_form.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiButtonEmpty, diff --git a/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/steps/step_logistics/data_streams_and_indices_list_help_text.tsx b/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/steps/step_logistics/data_streams_and_indices_list_help_text.tsx index 74a32ee067311..566c13120894b 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/steps/step_logistics/data_streams_and_indices_list_help_text.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/steps/step_logistics/data_streams_and_indices_list_help_text.tsx @@ -6,7 +6,7 @@ */ import React, { FunctionComponent } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiLink } from '@elastic/eui'; interface Props { diff --git a/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/steps/step_logistics/data_streams_global_state_call_out.tsx b/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/steps/step_logistics/data_streams_global_state_call_out.tsx index e99f122efaeeb..64e3d73126273 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/steps/step_logistics/data_streams_global_state_call_out.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/steps/step_logistics/data_streams_global_state_call_out.tsx @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { FunctionComponent } from 'react'; import { EuiCallOut, EuiLink } from '@elastic/eui'; import { useCore } from '../../../../app_context'; diff --git a/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/steps/step_logistics/step_logistics.tsx b/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/steps/step_logistics/step_logistics.tsx index 2ae096f00e04d..ca9cf20f06393 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/steps/step_logistics/step_logistics.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/steps/step_logistics/step_logistics.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import semverGt from 'semver/functions/gt'; import { EuiButtonEmpty, diff --git a/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/steps/step_review.tsx b/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/steps/step_review.tsx index 2974a7b686039..039cac124d9d3 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/steps/step_review.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/steps/step_review.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGrid, EuiFlexGroup, diff --git a/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/steps/step_settings.tsx b/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/steps/step_settings.tsx index 446e3f4c3c4ab..c56af689efb28 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/steps/step_settings.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/steps/step_settings.tsx @@ -6,7 +6,7 @@ */ import React, { useState, Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, EuiCode, diff --git a/x-pack/plugins/snapshot_restore/public/application/components/retention_execute_modal_provider.tsx b/x-pack/plugins/snapshot_restore/public/application/components/retention_execute_modal_provider.tsx index 4ce1d93955952..7e79e4226765d 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/retention_execute_modal_provider.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/retention_execute_modal_provider.tsx @@ -6,7 +6,7 @@ */ import React, { useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiConfirmModal } from '@elastic/eui'; import { useServices, useToastNotifications } from '../app_context'; diff --git a/x-pack/plugins/snapshot_restore/public/application/components/retention_update_modal_provider.tsx b/x-pack/plugins/snapshot_restore/public/application/components/retention_update_modal_provider.tsx index dcf087bb9ddc8..a7dd01a2fd893 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/retention_update_modal_provider.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/retention_update_modal_provider.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment, useRef, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiModal, EuiModalHeader, diff --git a/x-pack/plugins/snapshot_restore/public/application/components/snapshot_delete_provider.tsx b/x-pack/plugins/snapshot_restore/public/application/components/snapshot_delete_provider.tsx index 74614efb314aa..b27b88b66164c 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/snapshot_delete_provider.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/snapshot_delete_provider.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment, useRef, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiConfirmModal, EuiCallOut, diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/home.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/home.tsx index 211d30181c25c..1f9dbf251d1eb 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/home/home.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/home.tsx @@ -6,7 +6,7 @@ */ import React, { useEffect } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Route, RouteComponentProps, Switch } from 'react-router-dom'; import { EuiButtonEmpty, EuiPageHeader, EuiSpacer } from '@elastic/eui'; diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_details/policy_details.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_details/policy_details.tsx index 33f83ca30c04e..408587f6465a0 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_details/policy_details.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_details/policy_details.tsx @@ -6,7 +6,7 @@ */ import React, { useState, useEffect } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, EuiFlexGroup, diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_details/tabs/tab_history.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_details/tabs/tab_history.tsx index 4944d9bde379a..4dff022b82ff0 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_details/tabs/tab_history.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_details/tabs/tab_history.tsx @@ -7,7 +7,7 @@ import React, { Fragment } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_details/tabs/tab_summary.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_details/tabs/tab_summary.tsx index 10dd430295319..22277ca6e50dd 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_details/tabs/tab_summary.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_details/tabs/tab_summary.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCallOut, EuiFlexGroup, diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_list.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_list.tsx index 63aae47e63837..569acec2041ba 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_list.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_list.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment, useEffect } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { RouteComponentProps } from 'react-router-dom'; import { EuiPageContent, EuiEmptyPrompt, EuiButton, EuiCallOut, EuiSpacer } from '@elastic/eui'; diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_retention_schedule/policy_retention_schedule.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_retention_schedule/policy_retention_schedule.tsx index 87ab06c0c6158..cd5bfe16c2e5a 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_retention_schedule/policy_retention_schedule.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_retention_schedule/policy_retention_schedule.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_table/policy_table.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_table/policy_table.tsx index d3c2d42d1b52f..c1d05dfaa450c 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_table/policy_table.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_table/policy_table.tsx @@ -6,7 +6,7 @@ */ import React, { useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiFlexGroup, diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/repository_details.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/repository_details.tsx index 1b905123b799d..6e6a84c1d3159 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/repository_details.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/repository_details.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment, useState, useEffect } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiButtonEmpty, diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/azure_details.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/azure_details.tsx index eea217b9acad4..4acb429e34eba 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/azure_details.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/azure_details.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescriptionList, EuiSpacer, EuiTitle } from '@elastic/eui'; import { AzureRepository } from '../../../../../../../common/types'; diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/default_details.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/default_details.tsx index f829b990927b3..c1a379785ffd1 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/default_details.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/default_details.tsx @@ -9,7 +9,7 @@ import 'react-ace'; import 'brace/theme/textmate'; import React, { Fragment } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiSpacer, EuiTitle } from '@elastic/eui'; import { Repository } from '../../../../../../../common/types'; diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/fs_details.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/fs_details.tsx index 3e4e916d16b3a..cad687e9c6f3f 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/fs_details.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/fs_details.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescriptionList, EuiSpacer, EuiTitle } from '@elastic/eui'; import { FSRepository } from '../../../../../../../common/types'; diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/gcs_details.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/gcs_details.tsx index f5521a7192049..62dbbe1e898d1 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/gcs_details.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/gcs_details.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescriptionList, EuiSpacer, EuiTitle } from '@elastic/eui'; import { GCSRepository } from '../../../../../../../common/types'; diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/hdfs_details.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/hdfs_details.tsx index c9b6ee50a8ad7..63d651bf455df 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/hdfs_details.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/hdfs_details.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescriptionList, EuiSpacer, EuiTitle } from '@elastic/eui'; import { HDFSRepository } from '../../../../../../../common/types'; diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/readonly_details.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/readonly_details.tsx index 4657468090f06..d3833b1d18c42 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/readonly_details.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/readonly_details.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescriptionList, EuiSpacer, EuiTitle } from '@elastic/eui'; import { ReadonlyRepository } from '../../../../../../../common/types'; diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/s3_details.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/s3_details.tsx index 23251b34ace79..0181e4942a30f 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/s3_details.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/s3_details.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescriptionList, EuiSpacer, EuiTitle } from '@elastic/eui'; import { S3Repository } from '../../../../../../../common/types'; diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_list.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_list.tsx index 1a39e6267e5fb..df5a45216dbcf 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_list.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_list.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment, useEffect } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { RouteComponentProps } from 'react-router-dom'; import { EuiPageContent, EuiButton, EuiEmptyPrompt } from '@elastic/eui'; diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_table/repository_table.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_table/repository_table.tsx index 4b5a251237df2..e19a5b7845805 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_table/repository_table.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_table/repository_table.tsx @@ -6,7 +6,7 @@ */ import React, { useState, Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiButtonIcon, diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/restore_list/restore_list.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/restore_list/restore_list.tsx index 14044d3aaa161..5922846beb283 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/home/restore_list/restore_list.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/restore_list/restore_list.tsx @@ -6,7 +6,7 @@ */ import React, { useEffect, useState, Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiPageContent, EuiEmptyPrompt, diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/restore_list/restore_table/restore_table.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/restore_list/restore_table/restore_table.tsx index 73e5a2646a2fc..b94e3f631fb16 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/home/restore_list/restore_table/restore_table.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/restore_list/restore_table/restore_table.tsx @@ -6,7 +6,7 @@ */ import React, { useState, useMemo } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { orderBy } from 'lodash'; import { EuiBasicTable, EuiButtonIcon, EuiHealth } from '@elastic/eui'; import { RIGHT_ALIGNMENT } from '@elastic/eui/lib/services'; diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/restore_list/restore_table/shards_table.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/restore_list/restore_table/shards_table.tsx index 4db0ff2afb9d3..c5c4d8fa76b3f 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/home/restore_list/restore_table/shards_table.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/restore_list/restore_table/shards_table.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiBasicTable, EuiProgress, diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/components/repository_empty_prompt.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/components/repository_empty_prompt.tsx index 4c5e050ea489c..082c9d0bfd47d 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/components/repository_empty_prompt.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/components/repository_empty_prompt.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { useHistory } from 'react-router-dom'; import { EuiButton, EuiEmptyPrompt, EuiPageContent } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { reactRouterNavigate } from '../../../../../shared_imports'; import { linkToAddRepository } from '../../../../services/navigation'; diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/components/repository_error.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/components/repository_error.tsx index d3902770333cc..dc2bbe6306249 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/components/repository_error.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/components/repository_error.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { useHistory } from 'react-router-dom'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiEmptyPrompt, EuiLink, EuiPageContent } from '@elastic/eui'; import { reactRouterNavigate } from '../../../../../shared_imports'; import { linkToRepositories } from '../../../../services/navigation'; diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/components/snapshot_empty_prompt.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/components/snapshot_empty_prompt.tsx index 2cfc1d5ebefc5..b92f92ba0209e 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/components/snapshot_empty_prompt.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/components/snapshot_empty_prompt.tsx @@ -8,7 +8,7 @@ import React, { Fragment } from 'react'; import { useHistory } from 'react-router-dom'; import { EuiButton, EuiEmptyPrompt, EuiIcon, EuiLink, EuiPageContent } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { APP_SLM_CLUSTER_PRIVILEGES } from '../../../../../../common'; import { reactRouterNavigate, WithPrivileges } from '../../../../../shared_imports'; import { linkToAddPolicy, linkToPolicies } from '../../../../services/navigation'; diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/components/snapshot_search_bar.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/components/snapshot_search_bar.tsx index b3e2c24e396f0..a577bdf59563c 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/components/snapshot_search_bar.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/components/snapshot_search_bar.tsx @@ -8,7 +8,7 @@ import React, { useState } from 'react'; import useDebounce from 'react-use/lib/useDebounce'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { SearchFilterConfig } from '@elastic/eui/src/components/search_bar/search_filters'; import { SchemaType } from '@elastic/eui/src/components/search_bar/search_box'; diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/components/snapshot_table.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/components/snapshot_table.tsx index 5db702fcbd963..1272d841173c6 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/components/snapshot_table.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/components/snapshot_table.tsx @@ -6,7 +6,7 @@ */ import React, { useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiTableSortingType } from '@elastic/eui/src/components/basic_table/table_types'; import { diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/snapshot_details/snapshot_details.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/snapshot_details/snapshot_details.tsx index d635e2f08ae48..1b4bf28169044 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/snapshot_details/snapshot_details.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/snapshot_details/snapshot_details.tsx @@ -21,7 +21,7 @@ import { EuiText, } from '@elastic/eui'; import React, { Fragment, useState, useEffect } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { SnapshotDetails as ISnapshotDetails } from '../../../../../../common/types'; import { SectionError, Error } from '../../../../../shared_imports'; diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/snapshot_details/tabs/tab_failures.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/snapshot_details/tabs/tab_failures.tsx index 17c6f3de53cc9..e21179320122d 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/snapshot_details/tabs/tab_failures.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/snapshot_details/tabs/tab_failures.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCodeBlock, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui'; import { SNAPSHOT_STATE } from '../../../../../constants'; diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/snapshot_details/tabs/tab_summary.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/snapshot_details/tabs/tab_summary.tsx index 37bf3f263839f..56317533a3f5a 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/snapshot_details/tabs/tab_summary.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/snapshot_details/tabs/tab_summary.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescriptionList, EuiDescriptionListDescription, diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/snapshot_list.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/snapshot_list.tsx index da7ec42f746a3..0245f14addd42 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/snapshot_list.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/snapshot_list/snapshot_list.tsx @@ -7,7 +7,7 @@ import React, { useState, useEffect } from 'react'; import { parse } from 'query-string'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { RouteComponentProps } from 'react-router-dom'; import { EuiCallOut, EuiLink, EuiSpacer } from '@elastic/eui'; diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/policy_add/policy_add.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/policy_add/policy_add.tsx index 3927b73abf093..8e7124b935aaa 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/policy_add/policy_add.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/policy_add/policy_add.tsx @@ -6,7 +6,7 @@ */ import React, { useEffect, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { RouteComponentProps } from 'react-router-dom'; import { EuiPageContentBody, EuiSpacer, EuiPageHeader } from '@elastic/eui'; diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/policy_edit/policy_edit.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/policy_edit/policy_edit.tsx index cbf63ddaac014..fcfb8045025de 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/policy_edit/policy_edit.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/policy_edit/policy_edit.tsx @@ -6,7 +6,7 @@ */ import React, { useEffect, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { RouteComponentProps } from 'react-router-dom'; import { EuiPageContentBody, EuiPageHeader, EuiSpacer, EuiCallOut } from '@elastic/eui'; diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/repository_add/repository_add.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/repository_add/repository_add.tsx index 100d345a49c4d..fb7229cdce0d8 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/repository_add/repository_add.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/repository_add/repository_add.tsx @@ -7,7 +7,7 @@ import { parse } from 'query-string'; import React, { useEffect, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { RouteComponentProps } from 'react-router-dom'; import { EuiPageContentBody, EuiSpacer, EuiPageHeader } from '@elastic/eui'; diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/repository_edit/repository_edit.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/repository_edit/repository_edit.tsx index 9ecd1d0e3fafe..a544160ed55ee 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/repository_edit/repository_edit.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/repository_edit/repository_edit.tsx @@ -6,7 +6,7 @@ */ import React, { useEffect, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { RouteComponentProps } from 'react-router-dom'; import { EuiCallOut, EuiPageContentBody, EuiPageHeader, EuiSpacer } from '@elastic/eui'; diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/restore_snapshot/restore_snapshot.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/restore_snapshot/restore_snapshot.tsx index be889323122f0..249380ddb2083 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/restore_snapshot/restore_snapshot.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/restore_snapshot/restore_snapshot.tsx @@ -6,7 +6,7 @@ */ import React, { useEffect, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { RouteComponentProps } from 'react-router-dom'; import { EuiPageContentBody, EuiPageHeader, EuiSpacer } from '@elastic/eui'; diff --git a/x-pack/plugins/spaces/public/advanced_settings/components/advanced_settings_subtitle/advanced_settings_subtitle.tsx b/x-pack/plugins/spaces/public/advanced_settings/components/advanced_settings_subtitle/advanced_settings_subtitle.tsx index 613cd9fdaebce..a717bc837b522 100644 --- a/x-pack/plugins/spaces/public/advanced_settings/components/advanced_settings_subtitle/advanced_settings_subtitle.tsx +++ b/x-pack/plugins/spaces/public/advanced_settings/components/advanced_settings_subtitle/advanced_settings_subtitle.tsx @@ -8,7 +8,7 @@ import { EuiCallOut, EuiSpacer } from '@elastic/eui'; import React, { Fragment, useEffect, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { Space } from '../../../../common'; diff --git a/x-pack/plugins/spaces/public/advanced_settings/components/advanced_settings_title/advanced_settings_title.tsx b/x-pack/plugins/spaces/public/advanced_settings/components/advanced_settings_title/advanced_settings_title.tsx index a5af84bd33948..5ee988969d969 100644 --- a/x-pack/plugins/spaces/public/advanced_settings/components/advanced_settings_title/advanced_settings_title.tsx +++ b/x-pack/plugins/spaces/public/advanced_settings/components/advanced_settings_title/advanced_settings_title.tsx @@ -8,7 +8,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner, EuiTitle } from '@elastic/eui'; import React, { lazy, Suspense, useEffect, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { Space } from '../../../../common'; import { getSpaceAvatarComponent } from '../../../space_avatar'; diff --git a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_status_indicator.tsx b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_status_indicator.tsx index caad5a0fafd9c..27c8108a0c768 100644 --- a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_status_indicator.tsx +++ b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_status_indicator.tsx @@ -8,7 +8,7 @@ import { EuiIconTip, EuiLoadingSpinner } from '@elastic/eui'; import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { SummarizedCopyToSpaceResult, SummarizedSavedObjectResult } from '../lib'; import type { ImportRetry } from '../types'; diff --git a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_status_summary_indicator.tsx b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_status_summary_indicator.tsx index 74fa3622f88c7..34cb51a144f75 100644 --- a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_status_summary_indicator.tsx +++ b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_status_summary_indicator.tsx @@ -10,7 +10,7 @@ import './copy_status_summary_indicator.scss'; import { EuiBadge, EuiIconTip, EuiLoadingSpinner } from '@elastic/eui'; import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { SpacesDataEntry } from '../../types'; import type { SummarizedCopyToSpaceResult } from '../lib'; diff --git a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout_footer.tsx b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout_footer.tsx index c2000348973c2..28536c28f8fb7 100644 --- a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout_footer.tsx +++ b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout_footer.tsx @@ -16,7 +16,7 @@ import { import React, { Fragment } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { FailedImport, ProcessedImportResponse } from '../lib'; import type { ImportRetry } from '../types'; diff --git a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout_internal.tsx b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout_internal.tsx index 3ff72e131aa66..ab63ceb7d6b29 100644 --- a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout_internal.tsx +++ b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout_internal.tsx @@ -23,7 +23,7 @@ import { mapValues } from 'lodash'; import React, { useEffect, useMemo, useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useSpaces } from '../../spaces_context'; import type { SpacesDataEntry } from '../../types'; diff --git a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_form.tsx b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_form.tsx index 1b92936816e52..5e6f0123a86f3 100644 --- a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_form.tsx +++ b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_form.tsx @@ -8,7 +8,7 @@ import { EuiFormRow, EuiSpacer, EuiTitle } from '@elastic/eui'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { SpacesDataEntry } from '../../types'; import type { CopyOptions, CopyToSpaceSavedObjectTarget } from '../types'; diff --git a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/processing_copy_to_space.tsx b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/processing_copy_to_space.tsx index 91ee2acf6bb42..eb0cb9f0be8f6 100644 --- a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/processing_copy_to_space.tsx +++ b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/processing_copy_to_space.tsx @@ -14,7 +14,7 @@ import { } from '@elastic/eui'; import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { SpacesDataEntry } from '../../types'; import type { ProcessedImportResponse } from '../lib'; diff --git a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/resolve_all_conflicts.tsx b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/resolve_all_conflicts.tsx index 4e9afb12e1a76..9c8784a587605 100644 --- a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/resolve_all_conflicts.tsx +++ b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/resolve_all_conflicts.tsx @@ -11,7 +11,7 @@ import { EuiContextMenuItem, EuiContextMenuPanel, EuiLink, EuiPopover } from '@e import React, { Component } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { SummarizedCopyToSpaceResult } from '../lib'; import type { ImportRetry } from '../types'; diff --git a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/selectable_spaces_control.tsx b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/selectable_spaces_control.tsx index 57b55ac5a2618..5439a6150a750 100644 --- a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/selectable_spaces_control.tsx +++ b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/selectable_spaces_control.tsx @@ -11,7 +11,7 @@ import type { EuiSelectableOption } from '@elastic/eui'; import { EuiIconTip, EuiLoadingSpinner, EuiSelectable } from '@elastic/eui'; import React, { lazy, Suspense } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { SPACE_SEARCH_COUNT_THRESHOLD } from '../../../common'; import { getSpaceAvatarComponent } from '../../space_avatar'; diff --git a/x-pack/plugins/spaces/public/legacy_urls/components/embeddable_legacy_url_conflict_internal.tsx b/x-pack/plugins/spaces/public/legacy_urls/components/embeddable_legacy_url_conflict_internal.tsx index 8f86c2658cc3c..913d8cf6710e5 100644 --- a/x-pack/plugins/spaces/public/legacy_urls/components/embeddable_legacy_url_conflict_internal.tsx +++ b/x-pack/plugins/spaces/public/legacy_urls/components/embeddable_legacy_url_conflict_internal.tsx @@ -17,7 +17,7 @@ import React, { useState } from 'react'; import useAsync from 'react-use/lib/useAsync'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { StartServicesAccessor } from 'src/core/public'; import type { PluginsStart } from '../../plugin'; diff --git a/x-pack/plugins/spaces/public/legacy_urls/components/legacy_url_conflict_internal.tsx b/x-pack/plugins/spaces/public/legacy_urls/components/legacy_url_conflict_internal.tsx index a108e44fefe6e..71bcafe2b07fc 100644 --- a/x-pack/plugins/spaces/public/legacy_urls/components/legacy_url_conflict_internal.tsx +++ b/x-pack/plugins/spaces/public/legacy_urls/components/legacy_url_conflict_internal.tsx @@ -20,7 +20,7 @@ import useAsync from 'react-use/lib/useAsync'; import { first } from 'rxjs/operators'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { StartServicesAccessor } from 'src/core/public'; import { DEFAULT_OBJECT_NOUN } from '../../constants'; diff --git a/x-pack/plugins/spaces/public/management/components/confirm_delete_modal/confirm_delete_modal.tsx b/x-pack/plugins/spaces/public/management/components/confirm_delete_modal/confirm_delete_modal.tsx index 4c808f9a47582..00596d665d138 100644 --- a/x-pack/plugins/spaces/public/management/components/confirm_delete_modal/confirm_delete_modal.tsx +++ b/x-pack/plugins/spaces/public/management/components/confirm_delete_modal/confirm_delete_modal.tsx @@ -12,7 +12,7 @@ import useAsync from 'react-use/lib/useAsync'; import useAsyncFn from 'react-use/lib/useAsyncFn'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; import type { Space } from '../../../../common'; diff --git a/x-pack/plugins/spaces/public/management/components/unauthorized_prompt/unauthorized_prompt.tsx b/x-pack/plugins/spaces/public/management/components/unauthorized_prompt/unauthorized_prompt.tsx index 095e6cd311d84..68a35fd70a82b 100644 --- a/x-pack/plugins/spaces/public/management/components/unauthorized_prompt/unauthorized_prompt.tsx +++ b/x-pack/plugins/spaces/public/management/components/unauthorized_prompt/unauthorized_prompt.tsx @@ -8,7 +8,7 @@ import { EuiEmptyPrompt } from '@elastic/eui'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const UnauthorizedPrompt = () => ( void; diff --git a/x-pack/plugins/spaces/public/management/edit_space/customize_space/customize_space.tsx b/x-pack/plugins/spaces/public/management/edit_space/customize_space/customize_space.tsx index 27de0e012faf9..23c9f8fd96091 100644 --- a/x-pack/plugins/spaces/public/management/edit_space/customize_space/customize_space.tsx +++ b/x-pack/plugins/spaces/public/management/edit_space/customize_space/customize_space.tsx @@ -18,7 +18,7 @@ import type { ChangeEvent } from 'react'; import React, { Component, lazy, Suspense } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { getSpaceAvatarComponent, getSpaceColor, getSpaceInitials } from '../../../space_avatar'; import type { SpaceValidator } from '../../lib'; diff --git a/x-pack/plugins/spaces/public/management/edit_space/delete_spaces_button.tsx b/x-pack/plugins/spaces/public/management/edit_space/delete_spaces_button.tsx index dc78441c3ba02..ab1a40a2ee261 100644 --- a/x-pack/plugins/spaces/public/management/edit_space/delete_spaces_button.tsx +++ b/x-pack/plugins/spaces/public/management/edit_space/delete_spaces_button.tsx @@ -10,7 +10,7 @@ import { EuiButton, EuiButtonIcon } from '@elastic/eui'; import React, { Component, Fragment } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { NotificationsStart } from 'src/core/public'; import type { Space } from '../../../common'; diff --git a/x-pack/plugins/spaces/public/management/edit_space/enabled_features/enabled_features.tsx b/x-pack/plugins/spaces/public/management/edit_space/enabled_features/enabled_features.tsx index 9860d701ee4ab..7acca89fe5d2b 100644 --- a/x-pack/plugins/spaces/public/management/edit_space/enabled_features/enabled_features.tsx +++ b/x-pack/plugins/spaces/public/management/edit_space/enabled_features/enabled_features.tsx @@ -10,7 +10,7 @@ import type { FunctionComponent } from 'react'; import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; import type { KibanaFeatureConfig } from '../../../../../features/public'; diff --git a/x-pack/plugins/spaces/public/management/edit_space/enabled_features/toggle_all_features.tsx b/x-pack/plugins/spaces/public/management/edit_space/enabled_features/toggle_all_features.tsx index 644faf24a33e1..52cc330b11ee2 100644 --- a/x-pack/plugins/spaces/public/management/edit_space/enabled_features/toggle_all_features.tsx +++ b/x-pack/plugins/spaces/public/management/edit_space/enabled_features/toggle_all_features.tsx @@ -11,7 +11,7 @@ import { EuiContextMenuItem, EuiContextMenuPanel, EuiLink, EuiPopover } from '@e import React, { Component } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; interface Props { onChange: (visible: boolean) => void; diff --git a/x-pack/plugins/spaces/public/management/edit_space/manage_space_page.tsx b/x-pack/plugins/spaces/public/management/edit_space/manage_space_page.tsx index 8480d2646292c..1920aee6c439b 100644 --- a/x-pack/plugins/spaces/public/management/edit_space/manage_space_page.tsx +++ b/x-pack/plugins/spaces/public/management/edit_space/manage_space_page.tsx @@ -21,7 +21,7 @@ import { difference } from 'lodash'; import React, { Component } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { Capabilities, NotificationsStart, ScopedHistory } from 'src/core/public'; import { SectionLoading } from '../../../../../../src/plugins/es_ui_shared/public'; diff --git a/x-pack/plugins/spaces/public/management/edit_space/reserved_space_badge.tsx b/x-pack/plugins/spaces/public/management/edit_space/reserved_space_badge.tsx index 6415444a05620..5f9e709598484 100644 --- a/x-pack/plugins/spaces/public/management/edit_space/reserved_space_badge.tsx +++ b/x-pack/plugins/spaces/public/management/edit_space/reserved_space_badge.tsx @@ -8,7 +8,7 @@ import { EuiBadge, EuiToolTip } from '@elastic/eui'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { Space } from '../../../common'; import { isReservedSpace } from '../../../common'; diff --git a/x-pack/plugins/spaces/public/management/spaces_grid/spaces_grid_page.tsx b/x-pack/plugins/spaces/public/management/spaces_grid/spaces_grid_page.tsx index e40f92bd54486..c65530e773148 100644 --- a/x-pack/plugins/spaces/public/management/spaces_grid/spaces_grid_page.tsx +++ b/x-pack/plugins/spaces/public/management/spaces_grid/spaces_grid_page.tsx @@ -19,7 +19,7 @@ import { import React, { Component, lazy, Suspense } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { ApplicationStart, Capabilities, diff --git a/x-pack/plugins/spaces/public/management/spaces_management_app.tsx b/x-pack/plugins/spaces/public/management/spaces_management_app.tsx index 8ea947a33037d..30a724ba504b3 100644 --- a/x-pack/plugins/spaces/public/management/spaces_management_app.tsx +++ b/x-pack/plugins/spaces/public/management/spaces_management_app.tsx @@ -16,6 +16,7 @@ import type { RegisterManagementAppArgs } from 'src/plugins/management/public'; import { APP_WRAPPER_CLASS } from '../../../../../src/core/public'; import { KibanaContextProvider, + KibanaThemeProvider, RedirectAppLinks, } from '../../../../../src/plugins/kibana_react/public'; import type { Space } from '../../common'; @@ -39,7 +40,7 @@ export const spacesManagementApp = Object.freeze({ order: 2, title, - async mount({ element, setBreadcrumbs, history }) { + async mount({ element, theme$, setBreadcrumbs, history }) { const [[coreStart, { features }], { SpacesGridPage }, { ManageSpacePage }] = await Promise.all([getStartServices(), import('./spaces_grid'), import('./edit_space')]); @@ -114,21 +115,23 @@ export const spacesManagementApp = Object.freeze({ render( - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + , element diff --git a/x-pack/plugins/spaces/public/nav_control/components/manage_spaces_button.tsx b/x-pack/plugins/spaces/public/nav_control/components/manage_spaces_button.tsx index 11d77b347c15b..e48a685e926f0 100644 --- a/x-pack/plugins/spaces/public/nav_control/components/manage_spaces_button.tsx +++ b/x-pack/plugins/spaces/public/nav_control/components/manage_spaces_button.tsx @@ -9,7 +9,7 @@ import { EuiButton } from '@elastic/eui'; import type { CSSProperties } from 'react'; import React, { Component } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { ApplicationStart, Capabilities } from 'src/core/public'; interface Props { diff --git a/x-pack/plugins/spaces/public/nav_control/components/spaces_menu.tsx b/x-pack/plugins/spaces/public/nav_control/components/spaces_menu.tsx index 5fafe151dade9..9a88b3c2db169 100644 --- a/x-pack/plugins/spaces/public/nav_control/components/spaces_menu.tsx +++ b/x-pack/plugins/spaces/public/nav_control/components/spaces_menu.tsx @@ -18,8 +18,8 @@ import { import type { ReactElement } from 'react'; import React, { Component, lazy, Suspense } from 'react'; -import type { InjectedIntl } from '@kbn/i18n/react'; -import { FormattedMessage, injectI18n } from '@kbn/i18n/react'; +import type { InjectedIntl } from '@kbn/i18n-react'; +import { FormattedMessage, injectI18n } from '@kbn/i18n-react'; import type { ApplicationStart, Capabilities } from 'src/core/public'; import type { Space } from '../../../common'; diff --git a/x-pack/plugins/spaces/public/nav_control/nav_control.tsx b/x-pack/plugins/spaces/public/nav_control/nav_control.tsx index aa4d9e0bef704..1afb6c9244f35 100644 --- a/x-pack/plugins/spaces/public/nav_control/nav_control.tsx +++ b/x-pack/plugins/spaces/public/nav_control/nav_control.tsx @@ -11,10 +11,12 @@ import ReactDOM from 'react-dom'; import type { CoreStart } from 'src/core/public'; +import { KibanaThemeProvider } from '../../../../../src/plugins/kibana_react/public'; import type { SpacesManager } from '../spaces_manager'; export function initSpacesNavControl(spacesManager: SpacesManager, core: CoreStart) { const I18nContext = core.i18n.Context; + const { theme$ } = core.theme; core.chrome.navControls.registerLeft({ order: 1000, mount(targetDomElement: HTMLElement) { @@ -30,15 +32,17 @@ export function initSpacesNavControl(spacesManager: SpacesManager, core: CoreSta ReactDOM.render( - }> - - + + }> + + + , targetDomElement ); diff --git a/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/alias_table.tsx b/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/alias_table.tsx index a8431b1561400..52cf55e72c996 100644 --- a/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/alias_table.tsx +++ b/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/alias_table.tsx @@ -16,7 +16,7 @@ import { import type { FunctionComponent } from 'react'; import React, { lazy, Suspense, useMemo, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { getSpaceAvatarComponent } from '../../space_avatar'; import type { SpacesDataEntry } from '../../types'; diff --git a/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/no_spaces_available.tsx b/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/no_spaces_available.tsx index 7dcb50e6cb1db..bfd0594f3afa0 100644 --- a/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/no_spaces_available.tsx +++ b/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/no_spaces_available.tsx @@ -8,7 +8,7 @@ import { EuiLink, EuiSpacer, EuiText } from '@elastic/eui'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { ApplicationStart } from 'src/core/public'; interface Props { diff --git a/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/relatives_footer.tsx b/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/relatives_footer.tsx index 97318ea5312be..89a5d5700bd44 100644 --- a/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/relatives_footer.tsx +++ b/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/relatives_footer.tsx @@ -8,7 +8,7 @@ import { EuiHorizontalRule, EuiText } from '@elastic/eui'; import React, { useMemo } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { SavedObjectReferenceWithContext } from 'src/core/public'; import type { ShareToSpaceSavedObjectTarget } from '../types'; diff --git a/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/selectable_spaces_control.tsx b/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/selectable_spaces_control.tsx index 9ba2e41098fdb..72976d7bd3157 100644 --- a/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/selectable_spaces_control.tsx +++ b/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/selectable_spaces_control.tsx @@ -22,7 +22,7 @@ import { import React, { lazy, Suspense } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { SPACE_SEARCH_COUNT_THRESHOLD } from '../../../common'; import { ALL_SPACES_ID, UNKNOWN_SPACE } from '../../../common/constants'; diff --git a/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_mode_control.tsx b/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_mode_control.tsx index 45a2d3f4964b1..6e39a554420ec 100644 --- a/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_mode_control.tsx +++ b/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_mode_control.tsx @@ -19,7 +19,7 @@ import { import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ALL_SPACES_ID } from '../../../common/constants'; import { useSpaces } from '../../spaces_context'; diff --git a/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_flyout_internal.tsx b/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_flyout_internal.tsx index bc39f9c681fd4..21bf46773e0bb 100644 --- a/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_flyout_internal.tsx +++ b/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_flyout_internal.tsx @@ -24,7 +24,7 @@ import { import React, { lazy, Suspense, useEffect, useMemo, useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { SavedObjectReferenceWithContext, ToastsStart } from 'src/core/public'; import { ALL_SPACES_ID, UNKNOWN_SPACE } from '../../../common/constants'; diff --git a/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_form.tsx b/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_form.tsx index 1841d634c6482..4d39a590d8603 100644 --- a/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_form.tsx +++ b/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_form.tsx @@ -10,7 +10,7 @@ import './share_to_space_form.scss'; import { EuiCallOut, EuiLink, EuiSpacer } from '@elastic/eui'; import React, { Fragment } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { SpacesDataEntry } from '../../types'; import type { ShareOptions } from '../types'; diff --git a/x-pack/plugins/spaces/public/space_list/space_list_internal.tsx b/x-pack/plugins/spaces/public/space_list/space_list_internal.tsx index fbc09ff023714..50f24c8df2f35 100644 --- a/x-pack/plugins/spaces/public/space_list/space_list_internal.tsx +++ b/x-pack/plugins/spaces/public/space_list/space_list_internal.tsx @@ -17,7 +17,7 @@ import type { ReactNode } from 'react'; import React, { lazy, Suspense, useEffect, useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ALL_SPACES_ID, UNKNOWN_SPACE } from '../../common/constants'; import { getSpaceAvatarComponent } from '../space_avatar'; diff --git a/x-pack/plugins/spaces/public/space_selector/space_selector.tsx b/x-pack/plugins/spaces/public/space_selector/space_selector.tsx index 00ad39bf0027f..438822de36134 100644 --- a/x-pack/plugins/spaces/public/space_selector/space_selector.tsx +++ b/x-pack/plugins/spaces/public/space_selector/space_selector.tsx @@ -26,9 +26,10 @@ import React, { Component, Fragment } from 'react'; import ReactDOM from 'react-dom'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; -import type { CoreStart } from 'src/core/public'; +import { FormattedMessage } from '@kbn/i18n-react'; +import type { AppMountParameters, CoreStart } from 'src/core/public'; +import { KibanaThemeProvider } from '../../../../../src/plugins/kibana_react/public'; import type { Space } from '../../common'; import { SPACE_SEARCH_COUNT_THRESHOLD } from '../../common/constants'; import type { SpacesManager } from '../spaces_manager'; @@ -213,12 +214,18 @@ export class SpaceSelector extends Component { }; } -export const renderSpaceSelectorApp = (i18nStart: CoreStart['i18n'], el: Element, props: Props) => { +export const renderSpaceSelectorApp = ( + i18nStart: CoreStart['i18n'], + { element, theme$ }: Pick, + props: Props +) => { ReactDOM.render( - + + + , - el + element ); - return () => ReactDOM.unmountComponentAtNode(el); + return () => ReactDOM.unmountComponentAtNode(element); }; diff --git a/x-pack/plugins/spaces/public/space_selector/space_selector_app.tsx b/x-pack/plugins/spaces/public/space_selector/space_selector_app.tsx index 542a4be50d57c..d6935e065815d 100644 --- a/x-pack/plugins/spaces/public/space_selector/space_selector_app.tsx +++ b/x-pack/plugins/spaces/public/space_selector/space_selector_app.tsx @@ -26,15 +26,19 @@ export const spaceSelectorApp = Object.freeze({ }), chromeless: true, appRoute: '/spaces/space_selector', - mount: async (params: AppMountParameters) => { + mount: async ({ element, theme$ }: AppMountParameters) => { const [[coreStart], { renderSpaceSelectorApp }] = await Promise.all([ getStartServices(), import('./space_selector'), ]); - return renderSpaceSelectorApp(coreStart.i18n, params.element, { - spacesManager, - serverBasePath: coreStart.http.basePath.serverBasePath, - }); + return renderSpaceSelectorApp( + coreStart.i18n, + { element, theme$ }, + { + spacesManager, + serverBasePath: coreStart.http.basePath.serverBasePath, + } + ); }, }); }, diff --git a/x-pack/plugins/spaces/server/plugin.ts b/x-pack/plugins/spaces/server/plugin.ts index 7f1abdb0a806c..6ed718ed3f301 100644 --- a/x-pack/plugins/spaces/server/plugin.ts +++ b/x-pack/plugins/spaces/server/plugin.ts @@ -57,9 +57,6 @@ export interface PluginsStart { export interface SpacesPluginSetup { /** * Service for interacting with spaces. - * - * @deprecated Please use the `spacesService` available on this plugin's start contract. - * @removeBy 7.16 */ spacesService: SpacesServiceSetup; diff --git a/x-pack/plugins/spaces/server/spaces_service/spaces_service.ts b/x-pack/plugins/spaces/server/spaces_service/spaces_service.ts index 2ffe77a4c9a89..36b9ed25fa541 100644 --- a/x-pack/plugins/spaces/server/spaces_service/spaces_service.ts +++ b/x-pack/plugins/spaces/server/spaces_service/spaces_service.ts @@ -20,27 +20,18 @@ export interface SpacesServiceSetup { /** * Retrieves the space id associated with the provided request. * @param request the request. - * - * @deprecated Use `getSpaceId` from the `SpacesServiceStart` contract instead. - * @removeBy 7.16 */ getSpaceId(request: KibanaRequest): string; /** * Converts the provided space id into the corresponding Saved Objects `namespace` id. * @param spaceId the space id to convert. - * - * @deprecated use `spaceIdToNamespace` from the `SpacesServiceStart` contract instead. - * @removeBy 7.16 */ spaceIdToNamespace(spaceId: string): string | undefined; /** * Converts the provided namespace into the corresponding space id. * @param namespace the namespace to convert. - * - * @deprecated use `namespaceToSpaceId` from the `SpacesServiceStart` contract instead. - * @removeBy 7.16 */ namespaceToSpaceId(namespace: string | undefined): string; } diff --git a/x-pack/plugins/stack_alerts/public/alert_types/components/index_select_popover.tsx b/x-pack/plugins/stack_alerts/public/alert_types/components/index_select_popover.tsx index bc614dccc0edf..fbfb296c7b270 100644 --- a/x-pack/plugins/stack_alerts/public/alert_types/components/index_select_popover.tsx +++ b/x-pack/plugins/stack_alerts/public/alert_types/components/index_select_popover.tsx @@ -8,7 +8,7 @@ import React, { useEffect, useState } from 'react'; import { i18n } from '@kbn/i18n'; import { isString } from 'lodash'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonIcon, EuiComboBox, diff --git a/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression.tsx b/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression.tsx index b98df85e0b8a0..8963007b8b764 100644 --- a/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression.tsx +++ b/x-pack/plugins/stack_alerts/public/alert_types/es_query/expression.tsx @@ -7,7 +7,7 @@ import React, { useState, Fragment, useEffect } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { XJsonMode } from '@kbn/ace'; import 'brace/theme/github'; diff --git a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx b/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx index 5a41a0ae4f62c..3b5d03a3e9c39 100644 --- a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx +++ b/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/expressions/entity_index_expression.tsx @@ -7,7 +7,7 @@ import React, { Fragment, FunctionComponent, useEffect, useRef } from 'react'; import { EuiFormRow } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { DataPublicPluginStart } from 'src/plugins/data/public'; import { HttpSetup } from 'kibana/public'; diff --git a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx b/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx index cdc5c12659ce6..3440914e13b2a 100644 --- a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx +++ b/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/index.tsx @@ -7,7 +7,7 @@ import React, { Fragment, useEffect, useState } from 'react'; import { EuiCallOut, EuiFlexItem, EuiSpacer, EuiTitle } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { AlertTypeParamsExpressionProps } from '../../../../../triggers_actions_ui/public'; import { GeoContainmentAlertParams } from '../types'; diff --git a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.tsx b/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.tsx index 2e7765e16be76..672b2f11753af 100644 --- a/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.tsx +++ b/x-pack/plugins/stack_alerts/public/alert_types/geo_containment/query_builder/util_components/geo_index_pattern_select.tsx @@ -8,7 +8,7 @@ import React, { Component } from 'react'; import { EuiCallOut, EuiFormRow, EuiLink, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { IndexPattern, IndexPatternsContract } from 'src/plugins/data/public'; import { HttpSetup } from 'kibana/public'; diff --git a/x-pack/plugins/stack_alerts/public/alert_types/threshold/expression.tsx b/x-pack/plugins/stack_alerts/public/alert_types/threshold/expression.tsx index 380e2793043f8..8ada4e2128fd8 100644 --- a/x-pack/plugins/stack_alerts/public/alert_types/threshold/expression.tsx +++ b/x-pack/plugins/stack_alerts/public/alert_types/threshold/expression.tsx @@ -7,7 +7,7 @@ import React, { useState, Fragment, useEffect } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiSpacer, EuiCallOut, EuiEmptyPrompt, EuiText, EuiTitle } from '@elastic/eui'; import { HttpSetup } from 'kibana/public'; import { useKibana } from '../../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/stack_alerts/public/alert_types/threshold/visualization.tsx b/x-pack/plugins/stack_alerts/public/alert_types/threshold/visualization.tsx index 68141945d73fd..1a576c01dce8b 100644 --- a/x-pack/plugins/stack_alerts/public/alert_types/threshold/visualization.tsx +++ b/x-pack/plugins/stack_alerts/public/alert_types/threshold/visualization.tsx @@ -28,7 +28,7 @@ import { EuiText, EuiLoadingSpinner, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ChartsPluginSetup } from 'src/plugins/charts/public'; import { FieldFormatsStart } from 'src/plugins/field_formats/public'; import { useKibana } from '../../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/task_manager/server/plugin.ts b/x-pack/plugins/task_manager/server/plugin.ts index 4e1db9c274b5e..c0f0994a7ead5 100644 --- a/x-pack/plugins/task_manager/server/plugin.ts +++ b/x-pack/plugins/task_manager/server/plugin.ts @@ -66,12 +66,14 @@ export class TaskManagerPlugin private middleware: Middleware = createInitialMiddleware(); private elasticsearchAndSOAvailability$?: Observable; private monitoringStats$ = new Subject(); + private readonly kibanaVersion: PluginInitializerContext['env']['packageInfo']['version']; constructor(private readonly initContext: PluginInitializerContext) { this.initContext = initContext; this.logger = initContext.logger.get(); this.config = initContext.config.get(); this.definitions = new TaskTypeDictionary(this.logger); + this.kibanaVersion = initContext.env.packageInfo.version; } public setup( @@ -92,15 +94,26 @@ export class TaskManagerPlugin this.logger.info(`TaskManager is identified by the Kibana UUID: ${this.taskManagerId}`); } + const startServicesPromise = core.getStartServices().then(([coreServices]) => ({ + elasticsearch: coreServices.elasticsearch, + })); + + const usageCounter = plugins.usageCollection?.createUsageCounter(`taskManager`); + // Routes const router = core.http.createRouter(); - const { serviceStatus$, monitoredHealth$ } = healthRoute( + const { serviceStatus$, monitoredHealth$ } = healthRoute({ router, - this.monitoringStats$, - this.logger, - this.taskManagerId, - this.config! - ); + monitoringStats$: this.monitoringStats$, + logger: this.logger, + taskManagerId: this.taskManagerId, + config: this.config!, + usageCounter, + kibanaVersion: this.kibanaVersion, + kibanaIndexName: core.savedObjects.getKibanaIndex(), + getClusterClient: () => + startServicesPromise.then(({ elasticsearch }) => elasticsearch.client), + }); core.status.derivedStatus$.subscribe((status) => this.logger.debug(`status core.status.derivedStatus now set to ${status.level}`) diff --git a/x-pack/plugins/task_manager/server/routes/health.test.ts b/x-pack/plugins/task_manager/server/routes/health.test.ts index 663dee2120eab..b6fecdd02abb7 100644 --- a/x-pack/plugins/task_manager/server/routes/health.test.ts +++ b/x-pack/plugins/task_manager/server/routes/health.test.ts @@ -13,7 +13,8 @@ import { httpServiceMock } from 'src/core/server/mocks'; import { healthRoute } from './health'; import { mockHandlerArguments } from './_mock_handler_arguments'; import { sleep } from '../test_utils'; -import { loggingSystemMock } from '../../../../../src/core/server/mocks'; +import { elasticsearchServiceMock, loggingSystemMock } from 'src/core/server/mocks'; +import { usageCountersServiceMock } from 'src/plugins/usage_collection/server/usage_counters/usage_counters_service.mock'; import { HealthStatus, MonitoringStats, @@ -29,6 +30,23 @@ jest.mock('../lib/log_health_metrics', () => ({ logHealthMetrics: jest.fn(), })); +const mockUsageCountersSetup = usageCountersServiceMock.createSetupContract(); +const mockUsageCounter = mockUsageCountersSetup.createUsageCounter('test'); + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +const createMockClusterClient = (response: any) => { + const mockScopedClusterClient = elasticsearchServiceMock.createScopedClusterClient(); + mockScopedClusterClient.asCurrentUser.security.hasPrivileges.mockResolvedValue({ + body: response, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + } as any); + + const mockClusterClient = elasticsearchServiceMock.createClusterClient(); + mockClusterClient.asScoped.mockReturnValue(mockScopedClusterClient); + + return { mockClusterClient, mockScopedClusterClient }; +}; + describe('healthRoute', () => { const logger = loggingSystemMock.create().get(); @@ -38,13 +56,132 @@ describe('healthRoute', () => { it('registers the route', async () => { const router = httpServiceMock.createRouter(); - healthRoute(router, of(), logger, uuid.v4(), getTaskManagerConfig()); + healthRoute({ + router, + monitoringStats$: of(), + logger, + taskManagerId: uuid.v4(), + config: getTaskManagerConfig(), + kibanaVersion: '8.0', + kibanaIndexName: '.kibana', + getClusterClient: () => Promise.resolve(elasticsearchServiceMock.createClusterClient()), + usageCounter: mockUsageCounter, + }); const [config] = router.get.mock.calls[0]; expect(config.path).toMatchInlineSnapshot(`"/api/task_manager/_health"`); }); + it('checks user privileges and increments usage counter when API is accessed', async () => { + const { mockClusterClient, mockScopedClusterClient } = createMockClusterClient({ + has_all_requested: false, + }); + const router = httpServiceMock.createRouter(); + healthRoute({ + router, + monitoringStats$: of(), + logger, + taskManagerId: uuid.v4(), + config: getTaskManagerConfig(), + kibanaVersion: '8.0', + kibanaIndexName: 'foo', + getClusterClient: () => Promise.resolve(mockClusterClient), + usageCounter: mockUsageCounter, + }); + + const [, handler] = router.get.mock.calls[0]; + const [context, req, res] = mockHandlerArguments({}, {}, ['ok']); + await handler(context, req, res); + + expect(mockScopedClusterClient.asCurrentUser.security.hasPrivileges).toHaveBeenCalledWith({ + body: { + application: [ + { + application: `kibana-foo`, + resources: ['*'], + privileges: [`api:8.0:taskManager`], + }, + ], + }, + }); + expect(mockUsageCounter.incrementCounter).toHaveBeenCalledTimes(1); + expect(mockUsageCounter.incrementCounter).toHaveBeenNthCalledWith(1, { + counterName: `taskManagerHealthApiAccess`, + counterType: 'taskManagerHealthApi', + incrementBy: 1, + }); + }); + + it('checks user privileges and increments admin usage counter when API is accessed when user has access to task manager feature', async () => { + const { mockClusterClient, mockScopedClusterClient } = createMockClusterClient({ + has_all_requested: true, + }); + const router = httpServiceMock.createRouter(); + healthRoute({ + router, + monitoringStats$: of(), + logger, + taskManagerId: uuid.v4(), + config: getTaskManagerConfig(), + kibanaVersion: '8.0', + kibanaIndexName: 'foo', + getClusterClient: () => Promise.resolve(mockClusterClient), + usageCounter: mockUsageCounter, + }); + + const [, handler] = router.get.mock.calls[0]; + const [context, req, res] = mockHandlerArguments({}, {}, ['ok']); + await handler(context, req, res); + + expect(mockScopedClusterClient.asCurrentUser.security.hasPrivileges).toHaveBeenCalledWith({ + body: { + application: [ + { + application: `kibana-foo`, + resources: ['*'], + privileges: [`api:8.0:taskManager`], + }, + ], + }, + }); + + expect(mockUsageCounter.incrementCounter).toHaveBeenCalledTimes(2); + expect(mockUsageCounter.incrementCounter).toHaveBeenNthCalledWith(1, { + counterName: `taskManagerHealthApiAccess`, + counterType: 'taskManagerHealthApi', + incrementBy: 1, + }); + expect(mockUsageCounter.incrementCounter).toHaveBeenNthCalledWith(2, { + counterName: `taskManagerHealthApiAdminAccess`, + counterType: 'taskManagerHealthApi', + incrementBy: 1, + }); + }); + + it('skips checking user privileges if usage counter is undefined', async () => { + const { mockClusterClient, mockScopedClusterClient } = createMockClusterClient({ + has_all_requested: false, + }); + const router = httpServiceMock.createRouter(); + healthRoute({ + router, + monitoringStats$: of(), + logger, + taskManagerId: uuid.v4(), + config: getTaskManagerConfig(), + kibanaVersion: '8.0', + kibanaIndexName: 'foo', + getClusterClient: () => Promise.resolve(mockClusterClient), + }); + + const [, handler] = router.get.mock.calls[0]; + const [context, req, res] = mockHandlerArguments({}, {}, ['ok']); + await handler(context, req, res); + + expect(mockScopedClusterClient.asCurrentUser.security.hasPrivileges).not.toHaveBeenCalled(); + }); + it('logs the Task Manager stats at a fixed interval', async () => { const router = httpServiceMock.createRouter(); const calculateHealthStatus = calculateHealthStatusMock.create(); @@ -60,20 +197,24 @@ describe('healthRoute', () => { const stats$ = new Subject(); const id = uuid.v4(); - healthRoute( + healthRoute({ router, - stats$, + monitoringStats$: stats$, logger, - id, - getTaskManagerConfig({ + taskManagerId: id, + config: getTaskManagerConfig({ monitored_stats_required_freshness: 1000, monitored_stats_health_verbose_log: { enabled: true, warn_delayed_task_start_in_seconds: 100, }, monitored_aggregated_stats_refresh_rate: 60000, - }) - ); + }), + kibanaVersion: '8.0', + kibanaIndexName: '.kibana', + getClusterClient: () => Promise.resolve(elasticsearchServiceMock.createClusterClient()), + usageCounter: mockUsageCounter, + }); stats$.next(mockStat); await sleep(500); @@ -114,20 +255,24 @@ describe('healthRoute', () => { const stats$ = new Subject(); const id = uuid.v4(); - healthRoute( + healthRoute({ router, - stats$, + monitoringStats$: stats$, logger, - id, - getTaskManagerConfig({ + taskManagerId: id, + config: getTaskManagerConfig({ monitored_stats_required_freshness: 1000, monitored_stats_health_verbose_log: { enabled: true, warn_delayed_task_start_in_seconds: 120, }, monitored_aggregated_stats_refresh_rate: 60000, - }) - ); + }), + kibanaVersion: '8.0', + kibanaIndexName: '.kibana', + getClusterClient: () => Promise.resolve(elasticsearchServiceMock.createClusterClient()), + usageCounter: mockUsageCounter, + }); stats$.next(warnRuntimeStat); await sleep(1001); @@ -186,20 +331,24 @@ describe('healthRoute', () => { const stats$ = new Subject(); const id = uuid.v4(); - healthRoute( + healthRoute({ router, - stats$, + monitoringStats$: stats$, logger, - id, - getTaskManagerConfig({ + taskManagerId: id, + config: getTaskManagerConfig({ monitored_stats_required_freshness: 1000, monitored_stats_health_verbose_log: { enabled: true, warn_delayed_task_start_in_seconds: 120, }, monitored_aggregated_stats_refresh_rate: 60000, - }) - ); + }), + kibanaVersion: '8.0', + kibanaIndexName: '.kibana', + getClusterClient: () => Promise.resolve(elasticsearchServiceMock.createClusterClient()), + usageCounter: mockUsageCounter, + }); stats$.next(errorRuntimeStat); await sleep(1001); @@ -249,16 +398,20 @@ describe('healthRoute', () => { const stats$ = new Subject(); - const { serviceStatus$ } = healthRoute( + const { serviceStatus$ } = healthRoute({ router, - stats$, + monitoringStats$: stats$, logger, - uuid.v4(), - getTaskManagerConfig({ + taskManagerId: uuid.v4(), + config: getTaskManagerConfig({ monitored_stats_required_freshness: 1000, monitored_aggregated_stats_refresh_rate: 60000, - }) - ); + }), + kibanaVersion: '8.0', + kibanaIndexName: '.kibana', + getClusterClient: () => Promise.resolve(elasticsearchServiceMock.createClusterClient()), + usageCounter: mockUsageCounter, + }); const serviceStatus = getLatest(serviceStatus$); @@ -326,16 +479,20 @@ describe('healthRoute', () => { const stats$ = new Subject(); - healthRoute( + healthRoute({ router, - stats$, + monitoringStats$: stats$, logger, - uuid.v4(), - getTaskManagerConfig({ + taskManagerId: uuid.v4(), + config: getTaskManagerConfig({ monitored_stats_required_freshness: 5000, monitored_aggregated_stats_refresh_rate: 60000, - }) - ); + }), + kibanaVersion: '8.0', + kibanaIndexName: '.kibana', + getClusterClient: () => Promise.resolve(elasticsearchServiceMock.createClusterClient()), + usageCounter: mockUsageCounter, + }); await sleep(0); @@ -395,16 +552,20 @@ describe('healthRoute', () => { const router = httpServiceMock.createRouter(); const stats$ = new Subject(); - healthRoute( + healthRoute({ router, - stats$, + monitoringStats$: stats$, logger, - uuid.v4(), - getTaskManagerConfig({ + taskManagerId: uuid.v4(), + config: getTaskManagerConfig({ monitored_stats_required_freshness: 1000, monitored_aggregated_stats_refresh_rate: 60000, - }) - ); + }), + kibanaVersion: '8.0', + kibanaIndexName: '.kibana', + getClusterClient: () => Promise.resolve(elasticsearchServiceMock.createClusterClient()), + usageCounter: mockUsageCounter, + }); await sleep(0); diff --git a/x-pack/plugins/task_manager/server/routes/health.ts b/x-pack/plugins/task_manager/server/routes/health.ts index 4101662184430..f980cf82e76ca 100644 --- a/x-pack/plugins/task_manager/server/routes/health.ts +++ b/x-pack/plugins/task_manager/server/routes/health.ts @@ -12,9 +12,11 @@ import { IKibanaResponse, KibanaResponseFactory, } from 'kibana/server'; +import { IClusterClient } from 'src/core/server'; import { Observable, Subject } from 'rxjs'; import { tap, map } from 'rxjs/operators'; import { throttleTime } from 'rxjs/operators'; +import { UsageCounter } from 'src/plugins/usage_collection/server'; import { Logger, ServiceStatus, ServiceStatusLevels } from '../../../../../src/core/server'; import { MonitoringStats, @@ -47,16 +49,34 @@ const LEVEL_SUMMARY = { */ type TaskManagerServiceStatus = ServiceStatus; -export function healthRoute( - router: IRouter, - monitoringStats$: Observable, - logger: Logger, - taskManagerId: string, - config: TaskManagerConfig -): { +export interface HealthRouteParams { + router: IRouter; + monitoringStats$: Observable; + logger: Logger; + taskManagerId: string; + config: TaskManagerConfig; + kibanaVersion: string; + kibanaIndexName: string; + getClusterClient: () => Promise; + usageCounter?: UsageCounter; +} + +export function healthRoute(params: HealthRouteParams): { serviceStatus$: Observable; monitoredHealth$: Observable; } { + const { + router, + monitoringStats$, + logger, + taskManagerId, + config, + kibanaVersion, + kibanaIndexName, + getClusterClient, + usageCounter, + } = params; + // if "hot" health stats are any more stale than monitored_stats_required_freshness (pollInterval +1s buffer by default) // consider the system unhealthy const requiredHotStatsFreshness: number = config.monitored_stats_required_freshness; @@ -95,6 +115,8 @@ export function healthRoute( router.get( { path: '/api/task_manager/_health', + // Uncomment when we determine that we can restrict API usage to Global admins based on telemetry + // options: { tags: ['access:taskManager'] }, validate: false, }, async function ( @@ -102,6 +124,39 @@ export function healthRoute( req: KibanaRequest, res: KibanaResponseFactory ): Promise { + // If we are able to count usage, we want to check whether the user has access to + // the `taskManager` feature, which is only available as part of the Global All privilege. + if (usageCounter) { + const clusterClient = await getClusterClient(); + const { body: hasPrivilegesResponse } = await clusterClient + .asScoped(req) + .asCurrentUser.security.hasPrivileges({ + body: { + application: [ + { + application: `kibana-${kibanaIndexName}`, + resources: ['*'], + privileges: [`api:${kibanaVersion}:taskManager`], + }, + ], + }, + }); + + // Keep track of total access vs admin access + usageCounter.incrementCounter({ + counterName: `taskManagerHealthApiAccess`, + counterType: 'taskManagerHealthApi', + incrementBy: 1, + }); + if (hasPrivilegesResponse.has_all_requested) { + usageCounter.incrementCounter({ + counterName: `taskManagerHealthApiAdminAccess`, + counterType: 'taskManagerHealthApi', + incrementBy: 1, + }); + } + } + return res.ok({ body: lastMonitoredStats ? getHealthStatus(lastMonitoredStats) diff --git a/x-pack/plugins/timelines/public/components/fields_browser/index.tsx b/x-pack/plugins/timelines/public/components/fields_browser/index.tsx index 3b67d530bc63f..31b8e9f62803e 100644 --- a/x-pack/plugins/timelines/public/components/fields_browser/index.tsx +++ b/x-pack/plugins/timelines/public/components/fields_browser/index.tsx @@ -8,7 +8,7 @@ import React from 'react'; import type { Store } from 'redux'; import { Provider } from 'react-redux'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import type { FieldBrowserProps } from '../t_grid/toolbar/fields_browser/types'; import { StatefulFieldsBrowser } from '../t_grid/toolbar/fields_browser'; export type { FieldBrowserProps } from '../t_grid/toolbar/fields_browser/types'; diff --git a/x-pack/plugins/timelines/public/components/hover_actions/index.tsx b/x-pack/plugins/timelines/public/components/hover_actions/index.tsx index 12aef1ad00a71..f2089deed7b4b 100644 --- a/x-pack/plugins/timelines/public/components/hover_actions/index.tsx +++ b/x-pack/plugins/timelines/public/components/hover_actions/index.tsx @@ -5,7 +5,7 @@ * 2.0. */ import { EuiLoadingSpinner } from '@elastic/eui'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import React, { ReactElement } from 'react'; import { Provider } from 'react-redux'; import { Store } from 'redux'; diff --git a/x-pack/plugins/timelines/public/components/index.tsx b/x-pack/plugins/timelines/public/components/index.tsx index 0ff8c9bf97e8b..ad2081af324cf 100644 --- a/x-pack/plugins/timelines/public/components/index.tsx +++ b/x-pack/plugins/timelines/public/components/index.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { Provider } from 'react-redux'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import type { Store } from 'redux'; import { Storage } from '../../../../../src/plugins/kibana_utils/public'; diff --git a/x-pack/plugins/timelines/public/components/last_updated/index.test.tsx b/x-pack/plugins/timelines/public/components/last_updated/index.test.tsx index 4c179efd8b7d3..2e23d455157f8 100644 --- a/x-pack/plugins/timelines/public/components/last_updated/index.test.tsx +++ b/x-pack/plugins/timelines/public/components/last_updated/index.test.tsx @@ -7,11 +7,11 @@ import React from 'react'; import { mount } from 'enzyme'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { LastUpdatedAt } from './'; -jest.mock('@kbn/i18n/react', () => { - const originalModule = jest.requireActual('@kbn/i18n/react'); +jest.mock('@kbn/i18n-react', () => { + const originalModule = jest.requireActual('@kbn/i18n-react'); const FormattedRelative = jest.fn(); FormattedRelative.mockImplementation(() => '2 minutes ago'); diff --git a/x-pack/plugins/timelines/public/components/last_updated/index.tsx b/x-pack/plugins/timelines/public/components/last_updated/index.tsx index f60b0e147b689..c3297cb7ae18d 100644 --- a/x-pack/plugins/timelines/public/components/last_updated/index.tsx +++ b/x-pack/plugins/timelines/public/components/last_updated/index.tsx @@ -6,7 +6,7 @@ */ import { EuiText, EuiToolTip } from '@elastic/eui'; -import { FormattedRelative } from '@kbn/i18n/react'; +import { FormattedRelative } from '@kbn/i18n-react'; import React, { useEffect, useMemo, useState } from 'react'; import * as i18n from './translations'; diff --git a/x-pack/plugins/timelines/public/components/t_grid/event_rendered_view/index.tsx b/x-pack/plugins/timelines/public/components/t_grid/event_rendered_view/index.tsx index 3caa53988c005..ea823630fe005 100644 --- a/x-pack/plugins/timelines/public/components/t_grid/event_rendered_view/index.tsx +++ b/x-pack/plugins/timelines/public/components/t_grid/event_rendered_view/index.tsx @@ -15,7 +15,11 @@ import { EuiHorizontalRule, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { ALERT_RULE_NAME } from '@kbn/rule-data-utils/technical_field_names'; +import { + ALERT_REASON, + ALERT_RULE_NAME, + ALERT_RULE_UUID, +} from '@kbn/rule-data-utils/technical_field_names'; import { get } from 'lodash'; import moment from 'moment'; import React, { ComponentType, useCallback, useMemo } from 'react'; @@ -161,8 +165,8 @@ const EventRenderedViewComponent = ({ truncateText: false, mobileOptions: { show: true }, render: (name: unknown, item: TimelineItem) => { - const ruleName = get(item, `ecs.signal.rule.name`); /* `ecs.${ALERT_RULE_NAME}`*/ - const ruleId = get(item, `ecs.signal.rule.id`); /* `ecs.${ALERT_RULE_ID}`*/ + const ruleName = get(item, `ecs.signal.rule.name`) ?? get(item, `ecs.${ALERT_RULE_NAME}`); + const ruleId = get(item, `ecs.signal.rule.id`) ?? get(item, `ecs.${ALERT_RULE_UUID}`); return ; }, }, @@ -175,7 +179,7 @@ const EventRenderedViewComponent = ({ mobileOptions: { show: true }, render: (name: unknown, item: TimelineItem) => { const ecsData = get(item, 'ecs'); - const reason = get(item, `ecs.signal.reason`); /* `ecs.${ALERT_REASON}`*/ + const reason = get(item, `ecs.signal.reason`) ?? get(item, `ecs.${ALERT_REASON}`); const rowRenderersValid = rowRenderers.filter((rowRenderer) => rowRenderer.isInstance(ecsData) ); diff --git a/x-pack/plugins/timelines/public/components/t_grid/footer/index.tsx b/x-pack/plugins/timelines/public/components/t_grid/footer/index.tsx index a9e13ab5f415a..8f47943f63976 100644 --- a/x-pack/plugins/timelines/public/components/t_grid/footer/index.tsx +++ b/x-pack/plugins/timelines/public/components/t_grid/footer/index.tsx @@ -17,7 +17,7 @@ import { EuiPopoverProps, EuiPagination, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { FC, useCallback, useEffect, useState, useMemo } from 'react'; import styled from 'styled-components'; import { useDispatch } from 'react-redux'; diff --git a/x-pack/plugins/timelines/public/components/t_grid/shared/index.tsx b/x-pack/plugins/timelines/public/components/t_grid/shared/index.tsx index f4a9158a3e4e7..f2899547b464e 100644 --- a/x-pack/plugins/timelines/public/components/t_grid/shared/index.tsx +++ b/x-pack/plugins/timelines/public/components/t_grid/shared/index.tsx @@ -15,7 +15,7 @@ import { EuiText, EuiTitle, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; import type { CoreStart } from '../../../../../../../src/core/public'; diff --git a/x-pack/plugins/timelines/public/components/t_grid/standalone/index.tsx b/x-pack/plugins/timelines/public/components/t_grid/standalone/index.tsx index cc065c505537a..f08cb4db9b119 100644 --- a/x-pack/plugins/timelines/public/components/t_grid/standalone/index.tsx +++ b/x-pack/plugins/timelines/public/components/t_grid/standalone/index.tsx @@ -105,6 +105,7 @@ export interface TGridStandaloneProps { itemsPerPageOptions: number[]; query: Query; onRuleChange?: () => void; + onStateChange?: (state: State) => void; renderCellValue: (props: CellValueElementProps) => React.ReactNode; rowRenderers: RowRenderer[]; runtimeMappings: MappingRuntimeFields; diff --git a/x-pack/plugins/timelines/public/index.ts b/x-pack/plugins/timelines/public/index.ts index d80074c0a91cc..2329d0a1bebf4 100644 --- a/x-pack/plugins/timelines/public/index.ts +++ b/x-pack/plugins/timelines/public/index.ts @@ -26,7 +26,7 @@ export type { export { Direction } from '../common/search_strategy/common'; export { tGridReducer } from './store/t_grid/reducer'; export type { TGridModelForTimeline, TimelineState, TimelinesUIStart } from './types'; -export type { TGridType, SortDirection } from './types'; +export type { TGridType, SortDirection, State as TGridState, TGridModel } from './types'; export type { OnColumnFocused } from '../common/utils/accessibility'; export { ARIA_COLINDEX_ATTRIBUTE, diff --git a/x-pack/plugins/timelines/public/methods/index.tsx b/x-pack/plugins/timelines/public/methods/index.tsx index 06bb1ae443216..c8b5e28c2d21e 100644 --- a/x-pack/plugins/timelines/public/methods/index.tsx +++ b/x-pack/plugins/timelines/public/methods/index.tsx @@ -7,7 +7,7 @@ import React, { lazy, Suspense } from 'react'; import { EuiLoadingSpinner } from '@elastic/eui'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import type { Store } from 'redux'; import { Provider } from 'react-redux'; import type { Storage } from '../../../../../src/plugins/kibana_utils/public'; diff --git a/x-pack/plugins/timelines/public/mock/test_providers.tsx b/x-pack/plugins/timelines/public/mock/test_providers.tsx index 0fb1afec43627..12f8a5329af6a 100644 --- a/x-pack/plugins/timelines/public/mock/test_providers.tsx +++ b/x-pack/plugins/timelines/public/mock/test_providers.tsx @@ -6,7 +6,7 @@ */ import { euiDarkVars } from '@kbn/ui-shared-deps-src/theme'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import React from 'react'; import { DragDropContext, DropResult, ResponderProvided } from 'react-beautiful-dnd'; diff --git a/x-pack/plugins/timelines/public/plugin.ts b/x-pack/plugins/timelines/public/plugin.ts index 2151ff0bc5e9b..0ecb063445a46 100644 --- a/x-pack/plugins/timelines/public/plugin.ts +++ b/x-pack/plugins/timelines/public/plugin.ts @@ -5,7 +5,8 @@ * 2.0. */ -import { Store } from 'redux'; +import { Store, Unsubscribe } from 'redux'; +import { throttle } from 'lodash'; import { Storage } from '../../../../src/plugins/kibana_utils/public'; import type { CoreSetup, Plugin, CoreStart } from '../../../../src/core/public'; @@ -29,6 +30,7 @@ import { getHoverActions } from './components/hover_actions'; export class TimelinesPlugin implements Plugin { private _store: Store | undefined; private _storage = new Storage(localStorage); + private _storeUnsubscribe: Unsubscribe | undefined; public setup(core: CoreSetup) {} @@ -43,6 +45,13 @@ export class TimelinesPlugin implements Plugin { const state = getState(); if (state && state.app) { this._store = undefined; + } else { + if (props.onStateChange) { + this._storeUnsubscribe = this._store.subscribe( + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + throttle(() => props.onStateChange!(getState()), 500) + ); + } } } return getTGridLazy(props, { @@ -118,5 +127,9 @@ export class TimelinesPlugin implements Plugin { this._store = store; } - public stop() {} + public stop() { + if (this._storeUnsubscribe) { + this._storeUnsubscribe(); + } + } } diff --git a/x-pack/plugins/timelines/public/store/t_grid/types.ts b/x-pack/plugins/timelines/public/store/t_grid/types.ts index 41f69b9f55d0d..0bc3f0d66f1e2 100644 --- a/x-pack/plugins/timelines/public/store/t_grid/types.ts +++ b/x-pack/plugins/timelines/public/store/t_grid/types.ts @@ -9,6 +9,8 @@ import { Storage } from '../../../../../../src/plugins/kibana_utils/public'; import type { ColumnHeaderOptions } from '../../../common'; import type { TGridModel, TGridModelSettings } from './model'; +export type { TGridModel }; + export interface AutoSavedWarningMsg { timelineId: string | null; newTimelineModel: TGridModel | null; diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/all/query.events_all.dsl.ts b/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/all/query.events_all.dsl.ts index 8c4f34e930f8d..04c61a645cf16 100644 --- a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/all/query.events_all.dsl.ts +++ b/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/all/query.events_all.dsl.ts @@ -85,7 +85,7 @@ export const buildTimelineEventsAllQuery = ({ track_total_hits: true, sort: getSortField(sort), fields, - _source: ['signal.*'], + _source: ['signal.*', 'kibana.alert.*'], }, }; diff --git a/x-pack/plugins/transform/public/alerting/transform_health_rule_type/tests_selection_control.tsx b/x-pack/plugins/transform/public/alerting/transform_health_rule_type/tests_selection_control.tsx index cd00b21862364..780fe72409b2b 100644 --- a/x-pack/plugins/transform/public/alerting/transform_health_rule_type/tests_selection_control.tsx +++ b/x-pack/plugins/transform/public/alerting/transform_health_rule_type/tests_selection_control.tsx @@ -7,7 +7,7 @@ import React, { FC, useCallback } from 'react'; import { EuiDescribedFormGroup, EuiForm, EuiFormRow, EuiSpacer, EuiSwitch } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { TransformHealthRuleTestsConfig, diff --git a/x-pack/plugins/transform/public/alerting/transform_health_rule_type/transform_health_rule_trigger.tsx b/x-pack/plugins/transform/public/alerting/transform_health_rule_type/transform_health_rule_trigger.tsx index c3e4046a30626..860ca3032964a 100644 --- a/x-pack/plugins/transform/public/alerting/transform_health_rule_type/transform_health_rule_trigger.tsx +++ b/x-pack/plugins/transform/public/alerting/transform_health_rule_type/transform_health_rule_trigger.tsx @@ -7,7 +7,7 @@ import { EuiForm, EuiSpacer } from '@elastic/eui'; import React, { FC, useCallback, useEffect, useMemo, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import type { AlertTypeParamsExpressionProps } from '../../../../triggers_actions_ui/public'; import type { TransformHealthRuleParams } from '../../../common/types/alerting'; diff --git a/x-pack/plugins/transform/public/app/app.tsx b/x-pack/plugins/transform/public/app/app.tsx index 54bd81f0c364f..fd14ab8440202 100644 --- a/x-pack/plugins/transform/public/app/app.tsx +++ b/x-pack/plugins/transform/public/app/app.tsx @@ -12,7 +12,7 @@ import { ScopedHistory } from 'kibana/public'; import { EuiErrorBoundary } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { KibanaContextProvider } from '../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/transform/public/app/hooks/use_index_data.test.tsx b/x-pack/plugins/transform/public/app/hooks/use_index_data.test.tsx index 7aae41cf2e769..74d5167c12697 100644 --- a/x-pack/plugins/transform/public/app/hooks/use_index_data.test.tsx +++ b/x-pack/plugins/transform/public/app/hooks/use_index_data.test.tsx @@ -6,7 +6,7 @@ */ import React, { FC } from 'react'; -import { __IntlProvider as IntlProvider } from '@kbn/i18n/react'; +import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; import '@testing-library/jest-dom/extend-expect'; import { render, screen, waitFor } from '@testing-library/react'; @@ -78,8 +78,7 @@ describe('Transform: useIndexData()', () => { }); }); -// FLAKY: https://github.com/elastic/kibana/issues/109943 -describe.skip('Transform: with useIndexData()', () => { +describe('Transform: with useIndexData()', () => { test('Minimal initialization, no cross cluster search warning.', async () => { // Arrange const indexPattern = { diff --git a/x-pack/plugins/transform/public/app/lib/authorization/components/with_privileges.tsx b/x-pack/plugins/transform/public/app/lib/authorization/components/with_privileges.tsx index cdf4407b4233f..a214563db9dae 100644 --- a/x-pack/plugins/transform/public/app/lib/authorization/components/with_privileges.tsx +++ b/x-pack/plugins/transform/public/app/lib/authorization/components/with_privileges.tsx @@ -9,7 +9,7 @@ import React, { useContext, FC } from 'react'; import { EuiFlexItem, EuiFlexGroup, EuiPageContent } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { MissingPrivileges } from '../../../../../common/types/privileges'; diff --git a/x-pack/plugins/transform/public/app/sections/clone_transform/clone_transform_section.tsx b/x-pack/plugins/transform/public/app/sections/clone_transform/clone_transform_section.tsx index 221bce34e58de..76a3b06ef5574 100644 --- a/x-pack/plugins/transform/public/app/sections/clone_transform/clone_transform_section.tsx +++ b/x-pack/plugins/transform/public/app/sections/clone_transform/clone_transform_section.tsx @@ -9,7 +9,7 @@ import React, { useEffect, useState, FC } from 'react'; import { RouteComponentProps } from 'react-router-dom'; import { parse } from 'query-string'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/advanced_runtime_mappings_settings/advanced_runtime_mappings_settings.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/advanced_runtime_mappings_settings/advanced_runtime_mappings_settings.tsx index 4e70b7d7fe9b7..2c0bd8d57f68c 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/advanced_runtime_mappings_settings/advanced_runtime_mappings_settings.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/advanced_runtime_mappings_settings/advanced_runtime_mappings_settings.tsx @@ -17,7 +17,7 @@ import { EuiText, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { StepDefineFormHook } from '../step_define'; import { AdvancedRuntimeMappingsEditor } from '../advanced_runtime_mappings_editor/advanced_runtime_mappings_editor'; import { AdvancedRuntimeMappingsEditorSwitch } from '../advanced_runtime_mappings_editor_switch'; diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/aggregation_list/sub_aggs_section.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/aggregation_list/sub_aggs_section.tsx index db291752cb67f..c2390ac38910e 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/aggregation_list/sub_aggs_section.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/aggregation_list/sub_aggs_section.tsx @@ -8,7 +8,7 @@ import React, { FC, useCallback, useContext, useMemo } from 'react'; import { EuiComboBoxOptionOption, EuiSpacer, EuiToolTip } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { AggListForm } from './list_form'; import { DropDown } from '../aggregation_dropdown'; import { PivotAggsConfig } from '../../../../common'; diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_create/step_create_form.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_create/step_create_form.tsx index 29dad46616000..874dd149da3e0 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_create/step_create_form.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_create/step_create_form.tsx @@ -23,7 +23,7 @@ import { EuiText, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { toMountPoint } from '../../../../../../../../../src/plugins/kibana_react/public'; import { diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_agg_form.test.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_agg_form.test.tsx index 61bc7ac0ecdd1..8c3c649749c2f 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_agg_form.test.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_agg_form.test.tsx @@ -7,7 +7,7 @@ import { render, fireEvent } from '@testing-library/react'; import React from 'react'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { FilterAggForm } from './filter_agg_form'; import { CreateTransformWizardContext } from '../../../../wizard/wizard'; import { diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_agg_form.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_agg_form.tsx index 543ecc7dee195..c87ed84165ca8 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_agg_form.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_agg_form.tsx @@ -7,7 +7,7 @@ import React, { useContext, useMemo } from 'react'; import { EuiFormRow, EuiIcon, EuiSelect, EuiToolTip } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import useUpdateEffect from 'react-use/lib/useUpdateEffect'; import { CreateTransformWizardContext } from '../../../../wizard/wizard'; import { commonFilterAggs, filterAggsFieldSupport } from '../constants'; diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_range_form.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_range_form.tsx index 67c904946d302..98fdb32b4bd49 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_range_form.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_range_form.tsx @@ -14,7 +14,7 @@ import { EuiSpacer, EuiButton, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { FilterAggConfigRange } from '../types'; const BUTTON_SIZE = 40; diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_term_form.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_term_form.tsx index 2456c61b6c2ed..66bdbcc299da4 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_term_form.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_term_form.tsx @@ -8,7 +8,7 @@ import React, { useCallback, useContext, useEffect, useState } from 'react'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { EuiComboBox, EuiComboBoxOptionOption, EuiFormRow } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { debounce } from 'lodash'; import useUpdateEffect from 'react-use/lib/useUpdateEffect'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/top_metrics_agg/components/top_metrics_agg_form.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/top_metrics_agg/components/top_metrics_agg_form.tsx index 6af319274a5c2..f5cfc33fd0ded 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/top_metrics_agg/components/top_metrics_agg_form.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/common/top_metrics_agg/components/top_metrics_agg_form.tsx @@ -7,7 +7,7 @@ import React, { useCallback, useContext } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFormRow, EuiSelect, EuiButtonGroup, EuiSpacer } from '@elastic/eui'; import { PivotAggsConfigTopMetrics, TopMetricsAggConfig } from '../types'; import { PivotConfigurationContext } from '../../../../pivot_configuration/pivot_configuration'; diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/latest_function_form.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/latest_function_form.tsx index abb5e382b728b..64bedfa61479c 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/latest_function_form.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/latest_function_form.tsx @@ -7,7 +7,7 @@ import React, { FC } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonIcon, EuiCallOut, EuiComboBox, EuiCopy, EuiFormRow } from '@elastic/eui'; import { LatestFunctionService } from './hooks/use_latest_function_config'; diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/step_define_form.test.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/step_define_form.test.tsx index 772168aaa3151..6e80b6162048e 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/step_define_form.test.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/step_define_form.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { render } from '@testing-library/react'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { KibanaContextProvider } from '../../../../../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/step_define_summary.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/step_define_summary.tsx index ebadc97b59fc2..2abb3f4c4cda8 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/step_define_summary.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_define/step_define_summary.tsx @@ -7,7 +7,7 @@ import React, { Fragment, FC } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiBadge, EuiCodeBlock, EuiForm, EuiFormRow, EuiSpacer, EuiText } from '@elastic/eui'; diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_form.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_form.tsx index ad40a65fdf2e5..3e9f80de9152e 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_form.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_form.tsx @@ -8,7 +8,7 @@ import React, { FC, useEffect, useState, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiAccordion, diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_time_field.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_time_field.tsx index 1c5d9aadbcd67..8d7f6b451f985 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_time_field.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_time_field.tsx @@ -7,7 +7,7 @@ import React, { FC } from 'react'; import { EuiFormRow, EuiSelect } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; interface Props { diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/create_transform_section.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/create_transform_section.tsx index d736bd60f2df6..c377a280f213b 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/create_transform_section.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/create_transform_section.tsx @@ -8,7 +8,7 @@ import React, { useEffect, FC } from 'react'; import { RouteComponentProps } from 'react-router-dom'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, diff --git a/x-pack/plugins/transform/public/app/sections/transform_management/components/action_discover/discover_action_name.test.tsx b/x-pack/plugins/transform/public/app/sections/transform_management/components/action_discover/discover_action_name.test.tsx index 6fe9849737d34..9c8945264f000 100644 --- a/x-pack/plugins/transform/public/app/sections/transform_management/components/action_discover/discover_action_name.test.tsx +++ b/x-pack/plugins/transform/public/app/sections/transform_management/components/action_discover/discover_action_name.test.tsx @@ -7,7 +7,7 @@ import { cloneDeep } from 'lodash'; import React from 'react'; -import { __IntlProvider as IntlProvider } from '@kbn/i18n/react'; +import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; import { render, waitFor, screen } from '@testing-library/react'; diff --git a/x-pack/plugins/transform/public/app/sections/transform_management/components/create_transform_button/create_transform_button.tsx b/x-pack/plugins/transform/public/app/sections/transform_management/components/create_transform_button/create_transform_button.tsx index 96b0b51294f08..14697f9af4080 100644 --- a/x-pack/plugins/transform/public/app/sections/transform_management/components/create_transform_button/create_transform_button.tsx +++ b/x-pack/plugins/transform/public/app/sections/transform_management/components/create_transform_button/create_transform_button.tsx @@ -9,7 +9,7 @@ import React, { useContext, FC, MouseEventHandler } from 'react'; import { EuiButton, EuiToolTip } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { createCapabilityFailureMessage, diff --git a/x-pack/plugins/transform/public/app/sections/transform_management/components/refresh_transform_list_button/refresh_transform_list_button.tsx b/x-pack/plugins/transform/public/app/sections/transform_management/components/refresh_transform_list_button/refresh_transform_list_button.tsx index 183847362851b..d0ea13ec11df1 100644 --- a/x-pack/plugins/transform/public/app/sections/transform_management/components/refresh_transform_list_button/refresh_transform_list_button.tsx +++ b/x-pack/plugins/transform/public/app/sections/transform_management/components/refresh_transform_list_button/refresh_transform_list_button.tsx @@ -8,7 +8,7 @@ import React, { FC } from 'react'; import { EuiButton } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; interface RefreshTransformListButton { isLoading: boolean; diff --git a/x-pack/plugins/transform/public/app/sections/transform_management/components/search_selection/search_selection.tsx b/x-pack/plugins/transform/public/app/sections/transform_management/components/search_selection/search_selection.tsx index 5a9b4dc3bce97..391ea16ecd89e 100644 --- a/x-pack/plugins/transform/public/app/sections/transform_management/components/search_selection/search_selection.tsx +++ b/x-pack/plugins/transform/public/app/sections/transform_management/components/search_selection/search_selection.tsx @@ -7,7 +7,7 @@ import { EuiModalBody, EuiModalHeader, EuiModalHeaderTitle } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { FC } from 'react'; import { SavedObjectFinderUi } from '../../../../../../../../../src/plugins/saved_objects/public'; import { useAppDependencies } from '../../../../app_dependencies'; diff --git a/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row.test.tsx b/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row.test.tsx index af85049ce6915..e9ef4a4373116 100644 --- a/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row.test.tsx +++ b/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row.test.tsx @@ -20,8 +20,7 @@ jest.mock('../../../../../app/app_dependencies'); import { MlSharedContext } from '../../../../../app/__mocks__/shared_context'; import { getMlSharedImports } from '../../../../../shared_imports'; -// FLAKY https://github.com/elastic/kibana/issues/112922 -describe.skip('Transform: Transform List ', () => { +describe('Transform: Transform List ', () => { const onAlertEdit = jest.fn(); // Set timezone to US/Eastern for consistent test results. beforeEach(() => { diff --git a/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/transforms_stats_bar.tsx b/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/transforms_stats_bar.tsx index 16d5cd800b548..d64724d2e079e 100644 --- a/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/transforms_stats_bar.tsx +++ b/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/transforms_stats_bar.tsx @@ -10,7 +10,7 @@ import React, { FC } from 'react'; import { EuiCallOut, EuiLink, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { TRANSFORM_MODE, TRANSFORM_STATE } from '../../../../../../common/constants'; diff --git a/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/use_columns.tsx b/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/use_columns.tsx index 4e269c2f42729..5a39d4eab9abe 100644 --- a/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/use_columns.tsx +++ b/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/use_columns.tsx @@ -7,7 +7,7 @@ import React, { Fragment } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiBadge, EuiTableActionsColumnType, diff --git a/x-pack/plugins/transform/public/app/sections/transform_management/transform_management_section.tsx b/x-pack/plugins/transform/public/app/sections/transform_management/transform_management_section.tsx index 055e1e50701f8..5a4ae26e8d4e5 100644 --- a/x-pack/plugins/transform/public/app/sections/transform_management/transform_management_section.tsx +++ b/x-pack/plugins/transform/public/app/sections/transform_management/transform_management_section.tsx @@ -7,7 +7,7 @@ import React, { FC, useEffect, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, diff --git a/x-pack/plugins/transform/tsconfig.json b/x-pack/plugins/transform/tsconfig.json index 99e8baf3f92fc..9d13498814dc4 100644 --- a/x-pack/plugins/transform/tsconfig.json +++ b/x-pack/plugins/transform/tsconfig.json @@ -16,7 +16,6 @@ ], "references": [ { "path": "../../../src/core/tsconfig.json" }, - { "path": "../../../src/plugins/index_pattern_management/tsconfig.json" }, { "path": "../features/tsconfig.json" }, { "path": "../license_management/tsconfig.json" }, { "path": "../licensing/tsconfig.json" }, diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index a27ec93d02c98..229a61d88e590 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -3245,8 +3245,6 @@ "indexPatternManagement.editIndexPattern.fields.table.isAggregatableAria": "は集約可能です", "indexPatternManagement.editIndexPattern.fields.table.isExcludedAria": "は除外されています", "indexPatternManagement.editIndexPattern.fields.table.isSearchableAria": "は検索可能です", - "indexPatternManagement.editIndexPattern.fields.table.multiTypeAria": "複数タイプのフィールド", - "indexPatternManagement.editIndexPattern.fields.table.multiTypeTooltip": "このフィールドのタイプはインデックスごとに変わります。多くの分析機能には使用できません。", "indexPatternManagement.editIndexPattern.fields.table.nameHeader": "名前", "indexPatternManagement.editIndexPattern.fields.table.primaryTimeAriaLabel": "プライマリ時間フィールド", "indexPatternManagement.editIndexPattern.fields.table.primaryTimeTooltip": "このフィールドはイベントの発生時刻を表します。", @@ -3444,8 +3442,6 @@ "kbnConfig.deprecations.replacedSettingMessage": "\"{fullOldPath}\"設定は\"{fullNewPath}\"で置換されました", "kbnConfig.deprecations.unusedSetting.manualStepOneMessage": "Kibana構成ファイル、CLIフラグ、または環境変数(Dockerのみ)から\"{fullPath}\"を削除します。", "kbnConfig.deprecations.unusedSettingMessage": "\"{fullPath}\"を構成する必要はありません。", - "kibana_legacy.notify.toaster.errorStatusMessage": "エラー {errStatus} {errStatusText}: {errMessage}", - "kibana_legacy.notify.toaster.unavailableServerErrorMessage": "HTTP リクエストで接続に失敗しました。Kibana サーバーが実行されていて、ご使用のブラウザの接続が正常に動作していることを確認するか、システム管理者にお問い合わせください。", "kibana_utils.history.savedObjectIsMissingNotificationMessage": "保存されたオブジェクトがありません", "kibana_utils.stateManagement.stateHash.unableToRestoreUrlErrorMessage": "URL を完全に復元できません。共有機能を使用していることを確認してください。", "kibana_utils.stateManagement.stateHash.unableToStoreHistoryInSessionErrorMessage": "セッションがいっぱいで安全に削除できるアイテムが見つからないため、Kibana は履歴アイテムを保存できません。\n\nこれは大抵新規タブに移動することで解決されますが、より大きな問題が原因である可能性もあります。このメッセージが定期的に表示される場合は、{gitHubIssuesUrl} で問題を報告してください。", @@ -5666,7 +5662,6 @@ "xpack.apm.errorsTable.errorMessageAndCulpritColumnLabel": "エラーメッセージと原因", "xpack.apm.errorsTable.groupIdColumnDescription": "スタックトレースのハッシュ。動的パラメータのため、エラーメッセージが異なる場合でも、類似したエラーをグループ化します。", "xpack.apm.errorsTable.groupIdColumnLabel": "グループ ID", - "xpack.apm.errorsTable.latestOccurrenceColumnLabel": "最近のオカレンス", "xpack.apm.errorsTable.noErrorsLabel": "エラーが見つかりません", "xpack.apm.errorsTable.occurrencesColumnLabel": "オカレンス", "xpack.apm.errorsTable.typeColumnLabel": "型", @@ -5975,7 +5970,6 @@ "xpack.apm.serviceNodeMetrics.unidentifiedServiceNodesWarningText": "これらのメトリックが所属する JVM を特定できませんでした。7.5 よりも古い APM Server を実行していることが原因である可能性が高いです。この問題は APM Server 7.5 以降にアップグレードすることで解決されます。アップグレードに関する詳細は、{link} をご覧ください。代わりに Kibana クエリバーを使ってホスト名、コンテナー ID、またはその他フィールドでフィルタリングすることもできます。", "xpack.apm.serviceNodeMetrics.unidentifiedServiceNodesWarningTitle": "JVM を特定できませんでした", "xpack.apm.serviceNodeNameMissing": "(空)", - "xpack.apm.serviceOveriew.errorsTableOccurrences": "{occurrencesCount} occ.", "xpack.apm.serviceOverview.dependenciesTableColumn": "依存関係", "xpack.apm.serviceOverview.dependenciesTableTabLink": "依存関係を表示", "xpack.apm.serviceOverview.dependenciesTableTitle": "依存関係", @@ -7528,6 +7522,8 @@ "xpack.canvas.workpadTemplates.table.descriptionColumnTitle": "説明", "xpack.canvas.workpadTemplates.table.nameColumnTitle": "テンプレート名", "xpack.canvas.workpadTemplates.table.tagsColumnTitle": "タグ", + "xpack.canvas.formatMsg.toaster.errorStatusMessage": "错误 {errStatus} {errStatusText}:{errMessage}", + "xpack.canvas.formatMsg.toaster.unavailableServerErrorMessage": "HTTP 请求无法连接。请检查 Kibana 服务器是否正在运行以及您的浏览器是否具有有效的连接,或请联系您的系统管理员。", "xpack.cases.addConnector.title": "コネクターの追加", "xpack.cases.allCases.actions": "アクション", "xpack.cases.allCases.comments": "コメント", @@ -10301,9 +10297,6 @@ "xpack.fleet.createPackagePolicy.stepConfigure.integrationSettingsSectionDescription": "この統合の使用方法を識別できるように、名前と説明を選択してください。", "xpack.fleet.createPackagePolicy.stepConfigure.integrationSettingsSectionTitle": "統合設定", "xpack.fleet.createPackagePolicy.stepConfigure.noPolicyOptionsMessage": "構成するものがありません", - "xpack.fleet.createPackagePolicy.stepConfigure.packagePolicyDataRetentionLabel": "データ保持設定", - "xpack.fleet.createPackagePolicy.stepConfigure.packagePolicyDataRetentionLearnMoreLink": "詳細", - "xpack.fleet.createPackagePolicy.stepConfigure.packagePolicyDataRetentionText": "デフォルトでは、すべてのログとメトリックがホットティアに格納されます。この統合のデータ保持ポリシーの変更については、{learnMore}してください。", "xpack.fleet.createPackagePolicy.stepConfigure.packagePolicyDescriptionInputLabel": "説明", "xpack.fleet.createPackagePolicy.stepConfigure.packagePolicyNameInputLabel": "統合名", "xpack.fleet.createPackagePolicy.stepConfigure.packagePolicyNamespaceHelpLabel": "選択したエージェントポリシーから継承されたデフォルト名前空間を変更します。この設定により、統合のデータストリームの名前が変更されます。{learnMore}。", @@ -10700,40 +10693,14 @@ "xpack.fleet.serverError.enrollmentKeyDuplicate": "エージェントポリシーの{agentPolicyId}登録キー{providedKeyName}はすでに存在します", "xpack.fleet.serverError.returnedIncorrectKey": "find enrollmentKeyByIdで正しくないキーが返されました", "xpack.fleet.serverError.unableToCreateEnrollmentKey": "登録APIキーを作成できません", - "xpack.fleet.settings.additionalYamlConfig": "Elasticsearch出力構成(YAML)", "xpack.fleet.settings.deleteHostButton": "ホストの削除", - "xpack.fleet.settings.elasticHostDuplicateError": "重複するURL", - "xpack.fleet.settings.elasticHostError": "無効なURL", - "xpack.fleet.settings.elasticsearchUrlLabel": "Elasticsearchホスト", - "xpack.fleet.settings.elasticsearchUrlsHelpTect": "エージェントがデータを送信するElasticsearch URLを指定します。Elasticsearchはデフォルトで9200番ポートを使用します。", "xpack.fleet.settings.fleetServerHostsDifferentPathOrProtocolError": "各URLのプロトコルとパスは同じでなければなりません", "xpack.fleet.settings.fleetServerHostsDuplicateError": "重複するURL", "xpack.fleet.settings.fleetServerHostsEmptyError": "1つ以上のURLが必要です。", "xpack.fleet.settings.fleetServerHostsError": "無効なURL", - "xpack.fleet.settings.flyoutTitle": "Fleet 設定", - "xpack.fleet.settings.globalOutputDescription": "これらの設定はグローバルにすべてのエージェントポリシーの{outputs}セクションに適用され、すべての登録されたエージェントに影響します。", - "xpack.fleet.settings.invalidYamlFormatErrorMessage": "無効なYAML形式:{reason}", - "xpack.fleet.settings.saveButtonLabel": "設定を保存して適用", - "xpack.fleet.settings.saveButtonLoadingLabel": "設定を適用しています...", "xpack.fleet.settings.sortHandle": "ホストハンドルの並べ替え", - "xpack.fleet.settings.success.message": "設定が保存されました", "xpack.fleet.settings.userGuideLink": "FleetおよびElasticエージェントガイド", "xpack.fleet.settings.yamlCodeEditor": "YAMLコードエディター", - "xpack.fleet.settingsConfirmModal.calloutTitle": "すべてのエージェントポリシーと登録されたエージェントが更新されます", - "xpack.fleet.settingsConfirmModal.cancelButton": "キャンセル", - "xpack.fleet.settingsConfirmModal.confirmButton": "設定を適用", - "xpack.fleet.settingsConfirmModal.defaultChangeLabel": "不明な設定", - "xpack.fleet.settingsConfirmModal.elasticsearchAddedLabel": "Elasticsearchホスト(新)", - "xpack.fleet.settingsConfirmModal.elasticsearchHosts": "Elasticsearchホスト", - "xpack.fleet.settingsConfirmModal.elasticsearchRemovedLabel": "Elasticsearchホスト(旧)", - "xpack.fleet.settingsConfirmModal.eserverChangedText": "新しい{elasticsearchHosts}で接続できないエージェントは、データを送信できない場合でも、正常ステータスです。FleetサーバーがElasticsearchに接続するために使用するURLを更新するには、Fleetサーバーを再登録する必要があります。", - "xpack.fleet.settingsConfirmModal.fieldLabel": "フィールド", - "xpack.fleet.settingsConfirmModal.fleetServerAddedLabel": "Fleetサーバーホスト(新)", - "xpack.fleet.settingsConfirmModal.fleetServerChangedText": "新しい{fleetServerHosts}に接続できないエージェントはエラーが記録されます。新しいURLで接続するまでは、エージェントは現在のポリシーを使用し、古いURLで更新を確認します。", - "xpack.fleet.settingsConfirmModal.fleetServerHosts": "Fleetサーバーホスト", - "xpack.fleet.settingsConfirmModal.fleetServerRemovedLabel": "Fleetサーバーホスト(旧)", - "xpack.fleet.settingsConfirmModal.title": "設定をすべてのエージェントポリシーに適用", - "xpack.fleet.settingsConfirmModal.valueLabel": "値", "xpack.fleet.setup.titleLabel": "Fleetを読み込んでいます...", "xpack.fleet.setup.uiPreconfigurationErrorTitle": "構成エラー", "xpack.fleet.setupPage.apiKeyServiceLink": "APIキーサービス", @@ -14116,7 +14083,6 @@ "xpack.lens.editorFrame.noColorIndicatorLabel": "このディメンションには個別の色がありません", "xpack.lens.editorFrame.paletteColorIndicatorLabel": "このディメンションはパレットを使用しています", "xpack.lens.editorFrame.previewErrorLabel": "レンダリングのプレビューに失敗しました", - "xpack.lens.editorFrame.requiredDimensionWarningLabel": "必要な次元", "xpack.lens.editorFrame.suggestionPanelTitle": "提案", "xpack.lens.editorFrame.workspaceLabel": "ワークスペース", "xpack.lens.embeddable.failure": "ビジュアライゼーションを表示できませんでした", @@ -15438,7 +15404,6 @@ "xpack.maps.style.customColorPaletteLabel": "カスタムカラーパレット", "xpack.maps.style.customColorRampLabel": "カスタマカラーランプ", "xpack.maps.style.fieldSelect.OriginLabel": "{fieldOrigin} からのフィールド", - "xpack.maps.style.heatmap.resolutionStyleErrorMessage": "解像度パラメーターが認識されません:{resolution}", "xpack.maps.styles.categorical.otherCategoryLabel": "その他", "xpack.maps.styles.categoricalDataMapping.isEnabled.local": "無効にすると、ローカルデータからカテゴリを計算し、データが変更されたときにカテゴリを再計算します。ユーザーがパン、ズーム、フィルターを使用するときにスタイルが一貫しない場合があります。", "xpack.maps.styles.categoricalDataMapping.isEnabled.server": "データセット全体からカテゴリを計算します。ユーザーがパン、ズーム、フィルターを使用するときにスタイルが一貫します。", @@ -19286,6 +19251,8 @@ "xpack.monitoring.updateLicenseButtonLabel": "ライセンスを更新", "xpack.monitoring.updateLicenseTitle": "ライセンスの更新", "xpack.monitoring.useAvailableLicenseDescription": "すでに新しいライセンスがある場合は、今すぐアップロードしてください。", + "xpack.monitoring.formatMsg.toaster.errorStatusMessage": "错误 {errStatus} {errStatusText}:{errMessage}", + "xpack.monitoring.formatMsg.toaster.unavailableServerErrorMessage": "HTTP 请求无法连接。请检查 Kibana 服务器是否正在运行以及您的浏览器是否具有有效的连接,或请联系您的系统管理员。", "xpack.observability..synthetics.addDataButtonLabel": "Syntheticsデータの追加", "xpack.observability.alerts.manageRulesButtonLabel": "ルールの管理", "xpack.observability.alerts.searchBarPlaceholder": "検索アラート(例:kibana.alert.evaluation.threshold > 75)", @@ -19418,7 +19385,6 @@ "xpack.observability.expView.heading.addToCase.notification": "ビジュアライゼーションが正常にケースに追加されました:{caseTitle}", "xpack.observability.expView.heading.addToCase.notification.error": "選択したケースにビジュアライゼーションを追加できませんでした。", "xpack.observability.expView.heading.addToCase.notification.viewCase": "ケースの表示", - "xpack.observability.expView.heading.experimental": "実験的", "xpack.observability.expView.heading.label": "データの探索", "xpack.observability.expView.heading.openInLens": "Lensで開く", "xpack.observability.expView.heading.saveLensVisualization": "保存", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index e63a873cac3e4..b17c984ac2474 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -3268,8 +3268,6 @@ "indexPatternManagement.editIndexPattern.fields.table.isAggregatableAria": "可聚合", "indexPatternManagement.editIndexPattern.fields.table.isExcludedAria": "已排除", "indexPatternManagement.editIndexPattern.fields.table.isSearchableAria": "可搜索", - "indexPatternManagement.editIndexPattern.fields.table.multiTypeAria": "多类型字段", - "indexPatternManagement.editIndexPattern.fields.table.multiTypeTooltip": "此字段的类型在不同的索引中会有所不同。其不可用于许多分析功能。", "indexPatternManagement.editIndexPattern.fields.table.nameHeader": "名称", "indexPatternManagement.editIndexPattern.fields.table.primaryTimeAriaLabel": "主要时间字段", "indexPatternManagement.editIndexPattern.fields.table.primaryTimeTooltip": "此字段表示事件发生的时间。", @@ -3469,8 +3467,6 @@ "kbnConfig.deprecations.replacedSettingMessage": "设置“{fullOldPath}”已替换为“{fullNewPath}”", "kbnConfig.deprecations.unusedSetting.manualStepOneMessage": "从 Kibana 配置文件、CLI 标志或环境变量中移除“{fullPath}”(仅适用于 Docker)。", "kbnConfig.deprecations.unusedSettingMessage": "您不再需要配置“{fullPath}”。", - "kibana_legacy.notify.toaster.errorStatusMessage": "错误 {errStatus} {errStatusText}:{errMessage}", - "kibana_legacy.notify.toaster.unavailableServerErrorMessage": "HTTP 请求无法连接。请检查 Kibana 服务器是否正在运行以及您的浏览器是否具有有效的连接,或请联系您的系统管理员。", "kibana_utils.history.savedObjectIsMissingNotificationMessage": "已保存对象缺失", "kibana_utils.stateManagement.stateHash.unableToRestoreUrlErrorMessage": "无法完全还原 URL,请确保使用共享功能。", "kibana_utils.stateManagement.stateHash.unableToStoreHistoryInSessionErrorMessage": "Kibana 无法将历史记录项存储在您的会话中,因为其已满,另外,似乎没有任何可安全删除的项目。\n\n通常,这可以通过移到全新的选项卡来解决,但这种情况可能是由更大的问题造成。如果您定期看到这个消息,请在 {gitHubIssuesUrl} 报告问题。", @@ -5704,8 +5700,7 @@ "xpack.apm.errorsTable.errorMessageAndCulpritColumnLabel": "错误消息和原因", "xpack.apm.errorsTable.groupIdColumnDescription": "堆栈跟踪的哈希。将类似错误分组在一起,即使因动态参数造成错误消息不同。", "xpack.apm.errorsTable.groupIdColumnLabel": "组 ID", - "xpack.apm.errorsTable.latestOccurrenceColumnLabel": "最新一次发生", - "xpack.apm.errorsTable.noErrorsLabel": "未找到错误", + "xpack.apm.errorsTable.noErrorsLabel": "未找到任何错误", "xpack.apm.errorsTable.occurrencesColumnLabel": "发生次数", "xpack.apm.errorsTable.typeColumnLabel": "类型", "xpack.apm.errorsTable.unhandledLabel": "未处理", @@ -6016,8 +6011,6 @@ "xpack.apm.serviceNodeMetrics.unidentifiedServiceNodesWarningText": "无法识别这些指标属于哪些 JVM。这可能因为运行的 APM Server 版本低于 7.5。如果升级到 APM Server 7.5 或更高版本,应可解决此问题。有关升级的详细信息,请参阅 {link}。或者,也可以使用 Kibana 查询栏按主机名、容器 ID 或其他字段筛选。", "xpack.apm.serviceNodeMetrics.unidentifiedServiceNodesWarningTitle": "找不到 JVM", "xpack.apm.serviceNodeNameMissing": "(空)", - "xpack.apm.serviceOveriew.errorsTableOccurrences": "{occurrencesCount} 次", - "xpack.apm.serviceOverview.dependenciesTableColumn": "依赖项", "xpack.apm.serviceOverview.dependenciesTableTabLink": "查看依赖项", "xpack.apm.serviceOverview.dependenciesTableTitle": "依赖项", "xpack.apm.serviceOverview.errorsTable.errorMessage": "无法提取", @@ -7583,6 +7576,8 @@ "xpack.canvas.workpadTemplates.table.descriptionColumnTitle": "描述", "xpack.canvas.workpadTemplates.table.nameColumnTitle": "模板名称", "xpack.canvas.workpadTemplates.table.tagsColumnTitle": "标签", + "xpack.canvas.formatMsg.toaster.errorStatusMessage": "错误 {errStatus} {errStatusText}:{errMessage}", + "xpack.canvas.formatMsg.toaster.unavailableServerErrorMessage": "HTTP 请求无法连接。请检查 Kibana 服务器是否正在运行以及您的浏览器是否具有有效的连接,或请联系您的系统管理员。", "xpack.cases.addConnector.title": "添加连接器", "xpack.cases.allCases.actions": "操作", "xpack.cases.allCases.comments": "注释", @@ -10398,9 +10393,6 @@ "xpack.fleet.createPackagePolicy.stepConfigure.integrationSettingsSectionDescription": "选择有助于确定如何使用此集成的名称和描述。", "xpack.fleet.createPackagePolicy.stepConfigure.integrationSettingsSectionTitle": "集成设置", "xpack.fleet.createPackagePolicy.stepConfigure.noPolicyOptionsMessage": "没有可配置的内容", - "xpack.fleet.createPackagePolicy.stepConfigure.packagePolicyDataRetentionLabel": "数据保留设置", - "xpack.fleet.createPackagePolicy.stepConfigure.packagePolicyDataRetentionLearnMoreLink": "了解详情", - "xpack.fleet.createPackagePolicy.stepConfigure.packagePolicyDataRetentionText": "默认情况下,所有日志和指标数据存储在热层中。{learnMore}如何更改此集成的数据保留策略。", "xpack.fleet.createPackagePolicy.stepConfigure.packagePolicyDescriptionInputLabel": "描述", "xpack.fleet.createPackagePolicy.stepConfigure.packagePolicyNameInputLabel": "集成名称", "xpack.fleet.createPackagePolicy.stepConfigure.packagePolicyNamespaceHelpLabel": "更改从选定代理策略继承的默认命名空间。此设置将更改集成的数据流的名称。{learnMore}。", @@ -10807,40 +10799,14 @@ "xpack.fleet.serverError.enrollmentKeyDuplicate": "称作 {providedKeyName} 的注册密钥对于代理策略 {agentPolicyId} 已存在", "xpack.fleet.serverError.returnedIncorrectKey": "find enrollmentKeyById 返回错误的密钥", "xpack.fleet.serverError.unableToCreateEnrollmentKey": "无法创建注册 api 密钥", - "xpack.fleet.settings.additionalYamlConfig": "Elasticsearch 输出配置 (YAML)", "xpack.fleet.settings.deleteHostButton": "删除主机", - "xpack.fleet.settings.elasticHostDuplicateError": "复制 URL", - "xpack.fleet.settings.elasticHostError": "URL 无效", - "xpack.fleet.settings.elasticsearchUrlLabel": "Elasticsearch 主机", - "xpack.fleet.settings.elasticsearchUrlsHelpTect": "指定代理用于发送数据的 Elasticsearch URL。Elasticsearch 默认使用端口 9200。", "xpack.fleet.settings.fleetServerHostsDifferentPathOrProtocolError": "对于每个 URL,协议和路径必须相同", "xpack.fleet.settings.fleetServerHostsDuplicateError": "复制 URL", "xpack.fleet.settings.fleetServerHostsEmptyError": "至少需要一个 URL", "xpack.fleet.settings.fleetServerHostsError": "URL 无效", - "xpack.fleet.settings.flyoutTitle": "Fleet 设置", - "xpack.fleet.settings.globalOutputDescription": "这些设置将全局应用到所有代理策略的 {outputs} 部分并影响所有注册的代理。", - "xpack.fleet.settings.invalidYamlFormatErrorMessage": "YAML 无效:{reason}", - "xpack.fleet.settings.saveButtonLabel": "保存并应用设置", - "xpack.fleet.settings.saveButtonLoadingLabel": "正在应用设置......", "xpack.fleet.settings.sortHandle": "排序主机手柄", - "xpack.fleet.settings.success.message": "设置已保存", "xpack.fleet.settings.userGuideLink": "Fleet 和 Elastic 代理指南", "xpack.fleet.settings.yamlCodeEditor": "YAML 代码编辑器", - "xpack.fleet.settingsConfirmModal.calloutTitle": "此操作更新所有代理策略和注册的代理", - "xpack.fleet.settingsConfirmModal.cancelButton": "取消", - "xpack.fleet.settingsConfirmModal.confirmButton": "应用设置", - "xpack.fleet.settingsConfirmModal.defaultChangeLabel": "未知设置", - "xpack.fleet.settingsConfirmModal.elasticsearchAddedLabel": "Elasticsearch 主机(新)", - "xpack.fleet.settingsConfirmModal.elasticsearchHosts": "Elasticsearch 主机", - "xpack.fleet.settingsConfirmModal.elasticsearchRemovedLabel": "Elasticsearch 主机(旧)", - "xpack.fleet.settingsConfirmModal.eserverChangedText": "无法连接新 {elasticsearchHosts} 的代理有运行正常状态,即使无法发送数据。要更新 Fleet 服务器用于连接 Elasticsearch 的 URL,必须重新注册 Fleet 服务器。", - "xpack.fleet.settingsConfirmModal.fieldLabel": "字段", - "xpack.fleet.settingsConfirmModal.fleetServerAddedLabel": "Fleet 服务器主机(新)", - "xpack.fleet.settingsConfirmModal.fleetServerChangedText": "无法连接到新 {fleetServerHosts}的代理会记录错误。代理仍基于当前策略,并检查位于旧 URL 的更新,直到连接到新 URL。", - "xpack.fleet.settingsConfirmModal.fleetServerHosts": "Fleet 服务器主机", - "xpack.fleet.settingsConfirmModal.fleetServerRemovedLabel": "Fleet 服务器主机(旧)", - "xpack.fleet.settingsConfirmModal.title": "将设置应用到所有代理策略", - "xpack.fleet.settingsConfirmModal.valueLabel": "值", "xpack.fleet.setup.titleLabel": "正在加载 Fleet......", "xpack.fleet.setup.uiPreconfigurationErrorTitle": "配置错误", "xpack.fleet.setupPage.apiKeyServiceLink": "API 密钥服务", @@ -14304,7 +14270,6 @@ "xpack.lens.editorFrame.noColorIndicatorLabel": "此维度没有单独的颜色", "xpack.lens.editorFrame.paletteColorIndicatorLabel": "此维度正在使用调色板", "xpack.lens.editorFrame.previewErrorLabel": "预览呈现失败", - "xpack.lens.editorFrame.requiredDimensionWarningLabel": "所需尺寸", "xpack.lens.editorFrame.suggestionPanelTitle": "建议", "xpack.lens.editorFrame.workspaceLabel": "工作区", "xpack.lens.embeddable.failure": "无法显示可视化", @@ -15637,7 +15602,6 @@ "xpack.maps.style.customColorPaletteLabel": "定制调色板", "xpack.maps.style.customColorRampLabel": "定制颜色渐变", "xpack.maps.style.fieldSelect.OriginLabel": "来自 {fieldOrigin} 的字段", - "xpack.maps.style.heatmap.resolutionStyleErrorMessage": "无法识别分辨率参数:{resolution}", "xpack.maps.styles.categorical.otherCategoryLabel": "其他", "xpack.maps.styles.categoricalDataMapping.isEnabled.local": "禁用后,从本地数据计算类别,并在数据更改时重新计算类别。在用户平移、缩放和筛选时,样式可能不一致。", "xpack.maps.styles.categoricalDataMapping.isEnabled.server": "从整个数据集计算类别。在用户平移、缩放和筛选时,样式保持一致。", @@ -19568,6 +19532,8 @@ "xpack.monitoring.updateLicenseButtonLabel": "更新许可证", "xpack.monitoring.updateLicenseTitle": "更新您的许可证", "xpack.monitoring.useAvailableLicenseDescription": "如果您已经持有新的许可证,请立即上传。", + "xpack.monitoring.formatMsg.toaster.errorStatusMessage": "错误 {errStatus} {errStatusText}:{errMessage}", + "xpack.monitoring.formatMsg.toaster.unavailableServerErrorMessage": "HTTP 请求无法连接。请检查 Kibana 服务器是否正在运行以及您的浏览器是否具有有效的连接,或请联系您的系统管理员。", "xpack.observability..synthetics.addDataButtonLabel": "添加 Synthetics 数据", "xpack.observability.alerts.manageRulesButtonLabel": "管理规则", "xpack.observability.alerts.searchBarPlaceholder": "搜索告警(例如 kibana.alert.evaluation.threshold > 75)", @@ -19701,7 +19667,6 @@ "xpack.observability.expView.heading.addToCase.notification": "已成功将可视化添加到案例:{caseTitle}", "xpack.observability.expView.heading.addToCase.notification.error": "未能将可视化添加到所选案例。", "xpack.observability.expView.heading.addToCase.notification.viewCase": "查看案例", - "xpack.observability.expView.heading.experimental": "实验性", "xpack.observability.expView.heading.label": "浏览数据", "xpack.observability.expView.heading.openInLens": "在 Lens 中打开", "xpack.observability.expView.heading.saveLensVisualization": "保存", diff --git a/x-pack/plugins/triggers_actions_ui/public/application/app.tsx b/x-pack/plugins/triggers_actions_ui/public/application/app.tsx index ac0e6d95393b9..0e79eddfb3d57 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/app.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/app.tsx @@ -9,7 +9,7 @@ import React, { lazy } from 'react'; import { Switch, Route, Redirect, Router } from 'react-router-dom'; import { ChromeBreadcrumb, CoreStart, ScopedHistory } from 'kibana/public'; import { render, unmountComponentAtNode } from 'react-dom'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import useObservable from 'react-use/lib/useObservable'; import { KibanaFeature } from '../../../features/common'; import { Section, routeToRuleDetails, legacyRouteToRuleDetails } from './constants'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/email/email_connector.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/email/email_connector.tsx index 31cf609eefe9d..6e591753af35e 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/email/email_connector.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/email/email_connector.tsx @@ -19,7 +19,7 @@ import { EuiSpacer, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiLink } from '@elastic/eui'; import { ActionConnectorFieldsProps } from '../../../../types'; import { EmailActionConnector } from '../types'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/email/email_params.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/email/email_params.tsx index 5d19a1958c1c6..1187a736496ed 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/email/email_params.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/email/email_params.tsx @@ -6,7 +6,7 @@ */ import React, { useState, useEffect } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiComboBox, EuiButtonEmpty, EuiFormRow } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { ActionParamsProps } from '../../../../types'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/email/exchange_form.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/email/exchange_form.tsx index e1a0db952c8ee..1616e964147ab 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/email/exchange_form.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/email/exchange_form.tsx @@ -15,7 +15,7 @@ import { EuiLink, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { IErrorObject } from '../../../../types'; import { EmailActionConnector } from '../types'; import { nullableString } from './email_connector'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/es_index/es_index_connector.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/es_index/es_index_connector.tsx index 81cc88dd7e569..c99477bfa83f9 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/es_index/es_index_connector.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/es_index/es_index_connector.tsx @@ -17,7 +17,7 @@ import { EuiIconTip, EuiLink, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { ActionConnectorFieldsProps } from '../../../../types'; import { EsIndexActionConnector } from '.././types'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/es_index/es_index_params.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/es_index/es_index_params.tsx index 7a04c2f24725e..2ab867987182e 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/es_index/es_index_params.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/es_index/es_index_params.tsx @@ -16,7 +16,7 @@ import { EuiSpacer, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ActionParamsProps, AlertHistoryEsIndexConnectorId, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/jira/jira_params.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/jira/jira_params.test.tsx index 812c234e80d9e..6c39236b3ff98 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/jira/jira_params.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/jira/jira_params.test.tsx @@ -400,14 +400,7 @@ describe('JiraParamsFields renders', () => { expect(comments.simulate('change', changeEvent)); expect(editAction.mock.calls[1][1].comments.length).toEqual(1); }); - test('An empty comment does not trigger editAction', () => { - const wrapper = mount(); - const emptyComment = { target: { value: '' } }; - const comments = wrapper.find('[data-test-subj="commentsTextArea"] textarea'); - expect(editAction.mock.calls[0][1].comments.length).toEqual(0); - expect(comments.simulate('change', emptyComment)); - expect(editAction.mock.calls.length).toEqual(1); - }); + test('Clears any left behind priority when issueType changes and hasPriority becomes false', () => { useGetFieldsByIssueTypeMock .mockReturnValueOnce(useGetFieldsByIssueTypeResponse) diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/jira/jira_params.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/jira/jira_params.tsx index 32390c163cf2a..1987e52c187f1 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/jira/jira_params.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/jira/jira_params.tsx @@ -94,9 +94,7 @@ const JiraParamsFields: React.FunctionComponent { - if (value.length > 0) { - editSubActionProperty(key, [{ commentId: '1', comment: value }]); - } + editSubActionProperty(key, [{ commentId: '1', comment: value }]); }, [editSubActionProperty] ); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/pagerduty/pagerduty_connectors.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/pagerduty/pagerduty_connectors.tsx index 3ac7832d0462e..c734750a59f3b 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/pagerduty/pagerduty_connectors.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/pagerduty/pagerduty_connectors.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiFieldText, EuiFormRow, EuiLink } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ActionConnectorFieldsProps } from '../../../../types'; import { PagerDutyActionConnector } from '.././types'; import { useKibana } from '../../../../common/lib/kibana'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/resilient/resilient_params.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/resilient/resilient_params.test.tsx index 277a566c6827e..247e968d08fc6 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/resilient/resilient_params.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/resilient/resilient_params.test.tsx @@ -223,12 +223,5 @@ describe('ResilientParamsFields renders', () => { expect(comments.simulate('change', changeEvent)); expect(editAction.mock.calls[0][1].comments.length).toEqual(1); }); - test('An empty comment does not trigger editAction', () => { - const wrapper = mount(); - const emptyComment = { target: { value: '' } }; - const comments = wrapper.find('[data-test-subj="commentsTextArea"] textarea'); - expect(comments.simulate('change', emptyComment)); - expect(editAction.mock.calls.length).toEqual(0); - }); }); }); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/resilient/resilient_params.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/resilient/resilient_params.tsx index 68a47efb73b18..a50736b8c737b 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/resilient/resilient_params.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/resilient/resilient_params.tsx @@ -108,9 +108,7 @@ const ResilientParamsFields: React.FunctionComponent { - if (value.length > 0) { - editSubActionProperty(key, [{ commentId: '1', comment: value }]); - } + editSubActionProperty(key, [{ commentId: '1', comment: value }]); }, [editSubActionProperty] ); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/credentials_api_url.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/credentials_api_url.tsx index 5ddef8bab6700..f6247bd12f61c 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/credentials_api_url.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/credentials_api_url.tsx @@ -6,7 +6,7 @@ */ import React, { memo, useCallback } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFormRow, EuiLink, EuiFieldText, EuiSpacer } from '@elastic/eui'; import { useKibana } from '../../../../common/lib/kibana'; import type { ActionConnectorFieldsProps } from '../../../../types'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/deprecated_callout.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/deprecated_callout.test.tsx index 0c125f3851636..209e7352b70de 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/deprecated_callout.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/deprecated_callout.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { fireEvent, render, screen } from '@testing-library/react'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { DeprecatedCallout } from './deprecated_callout'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/deprecated_callout.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/deprecated_callout.tsx index faeeaa1bbbffe..d01a32564490d 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/deprecated_callout.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/deprecated_callout.tsx @@ -8,7 +8,7 @@ import React, { memo } from 'react'; import { EuiSpacer, EuiCallOut, EuiLink } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; interface Props { onMigrate: () => void; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_itsm_params.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_itsm_params.test.tsx index 078b5535c16eb..05fc7194c0069 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_itsm_params.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_itsm_params.test.tsx @@ -259,13 +259,5 @@ describe('ServiceNowITSMParamsFields renders', () => { expect(comments.simulate('change', changeEvent)); expect(editAction.mock.calls[0][1].comments.length).toEqual(1); }); - - test('An empty comment does not trigger editAction', () => { - const wrapper = mountWithIntl(); - const emptyComment = { target: { value: '' } }; - const comments = wrapper.find('[data-test-subj="commentsTextArea"] textarea'); - expect(comments.simulate('change', emptyComment)); - expect(editAction.mock.calls.length).toEqual(0); - }); }); }); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_itsm_params.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_itsm_params.tsx index dcfdfe3af0e0e..ca4eb72bcd5c1 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_itsm_params.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_itsm_params.tsx @@ -15,7 +15,7 @@ import { EuiTitle, EuiLink, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useKibana } from '../../../../common/lib/kibana'; import { ActionParamsProps } from '../../../../types'; @@ -75,9 +75,7 @@ const ServiceNowParamsFields: React.FunctionComponent< const editComment = useCallback( (key, value) => { - if (value.length > 0) { - editSubActionProperty(key, [{ commentId: '1', comment: value }]); - } + editSubActionProperty(key, [{ commentId: '1', comment: value }]); }, [editSubActionProperty] ); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_sir_params.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_sir_params.test.tsx index 48827e00087b7..a511689fc89be 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_sir_params.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_sir_params.test.tsx @@ -306,13 +306,5 @@ describe('ServiceNowSIRParamsFields renders', () => { expect(comments.simulate('change', changeEvent)); expect(editAction.mock.calls[0][1].comments.length).toEqual(1); }); - - test('An empty comment does not trigger editAction', () => { - const wrapper = mountWithIntl(); - const emptyComment = { target: { value: '' } }; - const comments = wrapper.find('[data-test-subj="commentsTextArea"] textarea'); - expect(comments.simulate('change', emptyComment)); - expect(editAction.mock.calls.length).toEqual(0); - }); }); }); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_sir_params.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_sir_params.tsx index a264ed5421c2e..f4d0cfecb675b 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_sir_params.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/servicenow_sir_params.tsx @@ -15,7 +15,7 @@ import { EuiTitle, EuiLink, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useKibana } from '../../../../common/lib/kibana'; import { ActionParamsProps } from '../../../../types'; @@ -72,9 +72,7 @@ const ServiceNowSIRParamsFields: React.FunctionComponent< const editComment = useCallback( (key, value) => { - if (value.length > 0) { - editSubActionProperty(key, [{ commentId: '1', comment: value }]); - } + editSubActionProperty(key, [{ commentId: '1', comment: value }]); }, [editSubActionProperty] ); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/update_connector.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/update_connector.tsx index f937b4e0a9be4..4e21b0f66642d 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/update_connector.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/servicenow/update_connector.tsx @@ -20,7 +20,7 @@ import { EuiSteps, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ActionConnectorFieldsProps } from '../../../../../public/types'; import { ServiceNowActionConnector } from './types'; import { CredentialsApiUrl } from './credentials_api_url'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/slack/slack_connectors.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/slack/slack_connectors.tsx index 82af2e09ba711..e93ca46ddc2f7 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/slack/slack_connectors.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/slack/slack_connectors.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiFieldText, EuiFormRow, EuiLink } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ActionConnectorFieldsProps } from '../../../../types'; import { SlackActionConnector } from '../types'; import { useKibana } from '../../../../common/lib/kibana'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/swimlane/steps/swimlane_connection.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/swimlane/steps/swimlane_connection.tsx index e81b607f55971..823883b3a5b60 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/swimlane/steps/swimlane_connection.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/swimlane/steps/swimlane_connection.tsx @@ -14,7 +14,7 @@ import { EuiFieldPassword, } from '@elastic/eui'; import React, { useCallback } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import * as i18n from '../translations'; import { useKibana } from '../../../../../common/lib/kibana'; import { SwimlaneActionConnector } from '../types'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/swimlane/swimlane_params.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/swimlane/swimlane_params.test.tsx index 32cf2c3c786d3..f1d7efca39551 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/swimlane/swimlane_params.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/swimlane/swimlane_params.test.tsx @@ -125,13 +125,5 @@ describe('SwimlaneParamsFields renders', () => { expect(comments.simulate('change', changeEvent)); expect(editAction.mock.calls[0][1].comments.length).toEqual(1); }); - - test('An empty comment does not trigger editAction', () => { - const wrapper = mountWithIntl(); - const emptyComment = { target: { value: '' } }; - const comments = wrapper.find('[data-test-subj="commentsTextArea"] textarea'); - expect(comments.simulate('change', emptyComment)); - expect(editAction.mock.calls.length).toEqual(0); - }); }); }); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/swimlane/swimlane_params.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/swimlane/swimlane_params.tsx index 2a4521ef1edaf..098e6490f3fe2 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/swimlane/swimlane_params.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/swimlane/swimlane_params.tsx @@ -77,9 +77,7 @@ const SwimlaneParamsFields: React.FunctionComponent { - if (value.length > 0) { - editSubActionProperty(key, [{ commentId: '1', comment: value }]); - } + editSubActionProperty(key, [{ commentId: '1', comment: value }]); }, [editSubActionProperty] ); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/teams/teams_connectors.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/teams/teams_connectors.tsx index 5550b841d81b4..586727e0d1965 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/teams/teams_connectors.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/teams/teams_connectors.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiFieldText, EuiFormRow, EuiLink } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ActionConnectorFieldsProps } from '../../../../types'; import { TeamsActionConnector } from '../types'; import { useKibana } from '../../../../common/lib/kibana'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/webhook/webhook_connectors.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/webhook/webhook_connectors.tsx index ba0e7016caa76..fbd3bdbef2e71 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/webhook/webhook_connectors.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/webhook/webhook_connectors.tsx @@ -6,7 +6,7 @@ */ import React, { useEffect, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFieldPassword, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/get_encrypted_field_notify_label.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/get_encrypted_field_notify_label.tsx index 51168e591f619..af23c471f2b41 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/get_encrypted_field_notify_label.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/get_encrypted_field_notify_label.tsx @@ -8,7 +8,7 @@ import { EuiSpacer, EuiCallOut, EuiText } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const getEncryptedFieldNotifyLabel = ( isCreate: boolean, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/health_check.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/health_check.tsx index 835c64ee0a05b..c2946d0d5fb15 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/health_check.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/health_check.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { Option, none, some, fold } from 'fp-ts/lib/Option'; import { pipe } from 'fp-ts/lib/pipeable'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiLink, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/prompts/empty_connectors_prompt.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/prompts/empty_connectors_prompt.tsx index 84ac46605905e..4637b6aa1d801 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/prompts/empty_connectors_prompt.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/prompts/empty_connectors_prompt.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { EuiButton, EuiEmptyPrompt, EuiIcon, EuiSpacer, EuiTitle } from '@elastic/eui'; import './empty_connectors_prompt.scss'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/prompts/empty_prompt.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/prompts/empty_prompt.tsx index 39187ccb14cd8..aef842c9baccb 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/prompts/empty_prompt.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/prompts/empty_prompt.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { EuiButton, EuiEmptyPrompt } from '@elastic/eui'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/home.tsx b/x-pack/plugins/triggers_actions_ui/public/application/home.tsx index 3da3e210c846e..db8bda0cd16e0 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/home.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/home.tsx @@ -7,7 +7,7 @@ import React, { lazy, useEffect } from 'react'; import { Route, RouteComponentProps, Switch } from 'react-router-dom'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiSpacer, EuiButtonEmpty, EuiPageHeader } from '@elastic/eui'; import { Section, routeToConnectors, routeToRules } from './constants'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/lib/check_action_type_enabled.tsx b/x-pack/plugins/triggers_actions_ui/public/application/lib/check_action_type_enabled.tsx index 1c2a56f4cccaa..fa85719ed11a0 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/lib/check_action_type_enabled.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/lib/check_action_type_enabled.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { upperFirst } from 'lodash'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCard, EuiLink } from '@elastic/eui'; import { ActionType, ActionConnector } from '../../types'; import { VIEW_LICENSE_OPTIONS_LINK } from '../../common/constants'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_connector_form.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_connector_form.tsx index 5ee294b6dbd52..b2000f172ef32 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_connector_form.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_connector_form.tsx @@ -18,7 +18,7 @@ import { EuiTitle, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { IErrorObject, ActionTypeRegistryContract, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_form.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_form.tsx index eda0b99e859a6..836e63fa7a68a 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_form.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_form.tsx @@ -7,7 +7,7 @@ import React, { useState, useEffect, useCallback } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiFlexGroup, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_form.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_form.tsx index 526d899b7efb1..c190ee564230f 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_form.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_form.tsx @@ -7,7 +7,7 @@ import React, { Suspense, useEffect, useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_menu.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_menu.tsx index cc7e08bc73d15..42daf4d4da2e6 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_menu.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_type_menu.tsx @@ -9,7 +9,7 @@ import React, { useEffect, useState } from 'react'; import { EuiFlexItem, EuiCard, EuiIcon, EuiFlexGrid, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { EuiToolTip } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ActionType, ActionTypeIndex, ActionTypeRegistryContract } from '../../../types'; import { loadActionTypes } from '../../lib/action_connector_api'; import { actionTypeCompare } from '../../lib/action_type_compare'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_add_flyout.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_add_flyout.tsx index 1bf833acfaf30..ef26dfc6fd2a0 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_add_flyout.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_add_flyout.tsx @@ -6,7 +6,7 @@ */ import React, { useCallback, useState, useReducer, useEffect } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiTitle, EuiFlyoutHeader, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_add_inline.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_add_inline.tsx index 0cdcf8bd44413..540470ed83eaa 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_add_inline.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_add_inline.tsx @@ -7,7 +7,7 @@ import React, { useEffect, useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiFlexGroup, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_add_modal.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_add_modal.tsx index 474a124905c89..9b6344498559b 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_add_modal.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_add_modal.tsx @@ -6,7 +6,7 @@ */ import React, { useCallback, useEffect, useMemo, useReducer, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiModal, EuiButton, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_edit_flyout.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_edit_flyout.tsx index 51f622d0b5de5..80239d069ef6a 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_edit_flyout.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_edit_flyout.tsx @@ -6,7 +6,7 @@ */ import React, { useCallback, useReducer, useState, useEffect } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiTitle, EuiFlyoutHeader, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/test_connector_form.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/test_connector_form.test.tsx index ae15670ce8ab9..7a3edcf4cb948 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/test_connector_form.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/test_connector_form.test.tsx @@ -6,7 +6,7 @@ */ import React, { lazy } from 'react'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import TestConnectorForm from './test_connector_form'; import { none, some } from 'fp-ts/lib/Option'; import { diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/test_connector_form.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/test_connector_form.tsx index 242c1c33d8d79..2b64a01f11827 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/test_connector_form.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/test_connector_form.tsx @@ -20,7 +20,7 @@ import { } from '@elastic/eui'; import { Option, map, getOrElse } from 'fp-ts/lib/Option'; import { pipe } from 'fp-ts/lib/pipeable'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { ActionConnector, ActionTypeRegistryContract, IErrorObject } from '../../../types'; import { ActionTypeExecutorResult } from '../../../../../actions/common'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/actions_connectors_list/components/actions_connectors_list.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/actions_connectors_list/components/actions_connectors_list.tsx index 6b52479f2ac87..3c4e39554f485 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/actions_connectors_list/components/actions_connectors_list.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/actions_connectors_list/components/actions_connectors_list.tsx @@ -24,7 +24,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { omit } from 'lodash'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { withTheme, EuiTheme } from '../../../../../../../../src/plugins/kibana_react/common'; import { loadAllActions, loadActionTypes, deleteActions } from '../../../lib/action_connector_api'; import { diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alert_details.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alert_details.tsx index 93aaec8b13650..a8e46864a0873 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alert_details.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/alert_details.tsx @@ -26,7 +26,7 @@ import { EuiEmptyPrompt, EuiPageTemplate, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { AlertExecutionStatusErrorReasons } from '../../../../../../alerting/common'; import { hasAllPrivilege, hasExecuteActionsCapability } from '../../../lib/capabilities'; import { getAlertingSectionBreadcrumb, getAlertDetailsBreadcrumb } from '../../../lib/breadcrumb'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/view_in_app.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/view_in_app.tsx index 1e7903545ab2c..458501c9a6992 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/view_in_app.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_details/components/view_in_app.tsx @@ -7,7 +7,7 @@ import React, { useState, useEffect } from 'react'; import { EuiButtonEmpty } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { CoreStart } from 'kibana/public'; import { fromNullable, fold } from 'fp-ts/lib/Option'; import { pipe } from 'fp-ts/lib/pipeable'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.test.tsx index ffcda22195ff5..786d67168ecbd 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.test.tsx @@ -9,7 +9,7 @@ import uuid from 'uuid'; import React, { FunctionComponent } from 'react'; import { mountWithIntl, nextTick } from '@kbn/test/jest'; import { act } from 'react-dom/test-utils'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFormLabel } from '@elastic/eui'; import { coreMock } from '../../../../../../../src/core/public/mocks'; import AlertAdd from './alert_add'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.tsx index 2b376ea0d0b30..8525960824002 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.tsx @@ -6,7 +6,7 @@ */ import React, { useReducer, useMemo, useState, useEffect } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiTitle, EuiFlyoutHeader, EuiFlyout, EuiFlyoutBody, EuiPortal } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { isEmpty } from 'lodash'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add_footer.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add_footer.tsx index ef96c80be6dda..a0f0ec66d2346 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add_footer.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add_footer.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlyoutFooter, EuiFlexGroup, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_conditions.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_conditions.test.tsx index da727f276b8db..f4ed8d0b05a85 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_conditions.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_conditions.test.tsx @@ -10,7 +10,7 @@ import { mountWithIntl, nextTick } from '@kbn/test/jest'; import { act } from 'react-dom/test-utils'; import { ReactWrapper } from 'enzyme'; import { AlertConditions, ActionGroupWithCondition } from './alert_conditions'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiTitle, EuiDescriptionList, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_conditions.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_conditions.tsx index e12c7f98bc9ba..217f99c62a4f9 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_conditions.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_conditions.tsx @@ -6,7 +6,7 @@ */ import React, { PropsWithChildren } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexItem, EuiText, EuiFlexGroup, EuiTitle, EuiButtonEmpty } from '@elastic/eui'; import { partition } from 'lodash'; import { ActionGroup, getBuiltinActionGroups } from '../../../../../alerting/common'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_edit.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_edit.tsx index 11f75994486a5..46a4190c611db 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_edit.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_edit.tsx @@ -6,7 +6,7 @@ */ import React, { useReducer, useState, useEffect } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiTitle, EuiFlyoutHeader, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.tsx index 24bd266179c6f..03aeafb948ff7 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.tsx @@ -7,7 +7,7 @@ import React, { Fragment, useState, useEffect, useCallback, Suspense } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_notify_when.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_notify_when.tsx index 8c2be10b03baf..34aed5ea2bce4 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_notify_when.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_notify_when.tsx @@ -7,7 +7,7 @@ import React, { useState, useEffect, useCallback } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/confirm_alert_close.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/confirm_alert_close.tsx index df54ecb921156..e3de4804dc08f 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/confirm_alert_close.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/confirm_alert_close.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiConfirmModal } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; interface Props { diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/confirm_alert_save.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/confirm_alert_save.tsx index f81293293f557..ebc2407774bda 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/confirm_alert_save.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/confirm_alert_save.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiConfirmModal } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; interface Props { diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/solution_filter.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/solution_filter.tsx index f49d1ef49f6ed..f46ec441227bf 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/solution_filter.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/solution_filter.tsx @@ -6,7 +6,7 @@ */ import React, { useEffect, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFilterGroup, EuiPopover, EuiFilterButton, EuiFilterSelectItem } from '@elastic/eui'; interface SolutionFilterProps { diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/action_type_filter.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/action_type_filter.tsx index 0771377ed85a2..531b06364fee0 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/action_type_filter.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/action_type_filter.tsx @@ -6,7 +6,7 @@ */ import React, { useEffect, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFilterGroup, EuiPopover, EuiFilterButton, EuiFilterSelectItem } from '@elastic/eui'; import { ActionType } from '../../../../types'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alert_status_filter.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alert_status_filter.tsx index 50295548f9aa4..fb6580e576ce3 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alert_status_filter.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alert_status_filter.tsx @@ -6,7 +6,7 @@ */ import React, { useEffect, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFilterGroup, EuiPopover, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alerts_list.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alerts_list.tsx index 27623654245eb..9a9e8f0f56717 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alerts_list.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alerts_list.tsx @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import { capitalize, sortBy } from 'lodash'; import moment from 'moment'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useEffect, useState } from 'react'; import { EuiBasicTable, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/manage_license_modal.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/manage_license_modal.tsx index ba1e19959d883..77cca21ad33cf 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/manage_license_modal.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/manage_license_modal.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiConfirmModal } from '@elastic/eui'; import { capitalize } from 'lodash'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/type_filter.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/type_filter.tsx index cadfbece849b8..3351e903f7bcd 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/type_filter.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/type_filter.tsx @@ -6,7 +6,7 @@ */ import React, { Fragment, useEffect, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFilterGroup, EuiPopover, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/alert_quick_edit_buttons.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/alert_quick_edit_buttons.tsx index 660c86e97a35e..347ebb227e445 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/alert_quick_edit_buttons.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/alert_quick_edit_buttons.tsx @@ -7,7 +7,7 @@ import { i18n } from '@kbn/i18n'; import React, { useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, EuiFlexItem, EuiFlexGroup } from '@elastic/eui'; import { AlertTableItem } from '../../../../types'; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/bulk_operation_popover.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/bulk_operation_popover.tsx index 764ae9ded9076..f4edf0ad1a9b8 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/bulk_operation_popover.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/bulk_operation_popover.tsx @@ -6,7 +6,7 @@ */ import React, { useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiPopover } from '@elastic/eui'; export const BulkOperationPopover: React.FunctionComponent = ({ children }) => { diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/execution_duration_chart.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/execution_duration_chart.tsx index c376095938c68..d74c1c52e8b07 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/execution_duration_chart.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/execution_duration_chart.tsx @@ -7,7 +7,7 @@ import { i18n } from '@kbn/i18n'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, diff --git a/x-pack/plugins/triggers_actions_ui/public/common/expression_items/for_the_last.test.tsx b/x-pack/plugins/triggers_actions_ui/public/common/expression_items/for_the_last.test.tsx index 2c6143a1329ef..e1a0109e235ab 100644 --- a/x-pack/plugins/triggers_actions_ui/public/common/expression_items/for_the_last.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/common/expression_items/for_the_last.test.tsx @@ -7,7 +7,7 @@ import * as React from 'react'; import { shallow } from 'enzyme'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ForLastExpression } from './for_the_last'; describe('for the last expression', () => { diff --git a/x-pack/plugins/triggers_actions_ui/public/common/expression_items/for_the_last.tsx b/x-pack/plugins/triggers_actions_ui/public/common/expression_items/for_the_last.tsx index 0afb4ee3577d7..d99de651a57e6 100644 --- a/x-pack/plugins/triggers_actions_ui/public/common/expression_items/for_the_last.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/common/expression_items/for_the_last.tsx @@ -6,7 +6,7 @@ */ import React, { useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiExpression, diff --git a/x-pack/plugins/triggers_actions_ui/public/common/expression_items/group_by_over.test.tsx b/x-pack/plugins/triggers_actions_ui/public/common/expression_items/group_by_over.test.tsx index d373001c07aa3..2933d6f4389c3 100644 --- a/x-pack/plugins/triggers_actions_ui/public/common/expression_items/group_by_over.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/common/expression_items/group_by_over.test.tsx @@ -8,7 +8,7 @@ import * as React from 'react'; import { shallow } from 'enzyme'; import { GroupByExpression } from './group_by_over'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; describe('group by expression', () => { it('renders with builtin group by types', () => { diff --git a/x-pack/plugins/triggers_actions_ui/public/common/expression_items/group_by_over.tsx b/x-pack/plugins/triggers_actions_ui/public/common/expression_items/group_by_over.tsx index 1430c40340771..738990f89f906 100644 --- a/x-pack/plugins/triggers_actions_ui/public/common/expression_items/group_by_over.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/common/expression_items/group_by_over.tsx @@ -6,7 +6,7 @@ */ import React, { useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiExpression, diff --git a/x-pack/plugins/triggers_actions_ui/public/common/expression_items/of.test.tsx b/x-pack/plugins/triggers_actions_ui/public/common/expression_items/of.test.tsx index f68736bebd7fa..fdc6b60c651fa 100644 --- a/x-pack/plugins/triggers_actions_ui/public/common/expression_items/of.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/common/expression_items/of.test.tsx @@ -8,7 +8,7 @@ import * as React from 'react'; import { shallow } from 'enzyme'; import { OfExpression } from './of'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; describe('of expression', () => { it('renders of builtin aggregation types', () => { diff --git a/x-pack/plugins/triggers_actions_ui/public/common/expression_items/of.tsx b/x-pack/plugins/triggers_actions_ui/public/common/expression_items/of.tsx index ccba6df04a2aa..ca249e4ed2e1a 100644 --- a/x-pack/plugins/triggers_actions_ui/public/common/expression_items/of.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/common/expression_items/of.tsx @@ -7,7 +7,7 @@ import React, { useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiExpression, EuiPopover, diff --git a/x-pack/plugins/triggers_actions_ui/public/common/expression_items/when.test.tsx b/x-pack/plugins/triggers_actions_ui/public/common/expression_items/when.test.tsx index d97526d89b62b..04aac646c1975 100644 --- a/x-pack/plugins/triggers_actions_ui/public/common/expression_items/when.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/common/expression_items/when.test.tsx @@ -8,7 +8,7 @@ import * as React from 'react'; import { shallow } from 'enzyme'; import { WhenExpression } from './when'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; describe('when expression', () => { it('renders with builtin aggregation types', () => { diff --git a/x-pack/plugins/triggers_actions_ui/public/common/expression_items/when.tsx b/x-pack/plugins/triggers_actions_ui/public/common/expression_items/when.tsx index 907db8135ff7d..a49fa95de0cc8 100644 --- a/x-pack/plugins/triggers_actions_ui/public/common/expression_items/when.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/common/expression_items/when.tsx @@ -7,7 +7,7 @@ import React, { useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiExpression, EuiPopover, EuiSelect } from '@elastic/eui'; import { builtInAggregationTypes } from '../constants'; import { AggregationType } from '../types'; diff --git a/x-pack/plugins/ui_actions_enhanced/public/components/action_wizard/action_wizard.tsx b/x-pack/plugins/ui_actions_enhanced/public/components/action_wizard/action_wizard.tsx index 049adbd09e84e..94fc3de891a75 100644 --- a/x-pack/plugins/ui_actions_enhanced/public/components/action_wizard/action_wizard.tsx +++ b/x-pack/plugins/ui_actions_enhanced/public/components/action_wizard/action_wizard.tsx @@ -22,7 +22,7 @@ import { EuiLink, EuiBetaBadge, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { txtBetaActionFactoryLabel, txtBetaActionFactoryTooltip, diff --git a/x-pack/plugins/upgrade_assistant/public/application/app.tsx b/x-pack/plugins/upgrade_assistant/public/application/app.tsx index 70350b6d56eca..d101c41bd0169 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/app.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/app.tsx @@ -7,7 +7,7 @@ import React, { useState, useEffect } from 'react'; import { Router, Switch, Route, Redirect } from 'react-router-dom'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiEmptyPrompt, EuiPageContent, EuiLoadingSpinner } from '@elastic/eui'; import { ScopedHistory } from 'src/core/public'; diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/coming_soon_prompt.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/coming_soon_prompt.tsx index 883a8675e0ce0..77f897c973693 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/coming_soon_prompt.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/coming_soon_prompt.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiEmptyPrompt, EuiPageContent, EuiLink } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useAppContext } from '../app_context'; export const ComingSoonPrompt: React.FunctionComponent = () => { diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecation_logs/es_deprecation_logs.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecation_logs/es_deprecation_logs.tsx index f778566758294..af43620c1d009 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecation_logs/es_deprecation_logs.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecation_logs/es_deprecation_logs.tsx @@ -16,7 +16,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { METRIC_TYPE } from '@kbn/analytics'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useAppContext } from '../../app_context'; import { uiMetricService, UIM_ES_DEPRECATION_LOGS_PAGE_LOAD } from '../../lib/ui_metric'; diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecation_logs/fix_deprecation_logs/deprecations_count_checkpoint/deprecations_count_checkpoint.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecation_logs/fix_deprecation_logs/deprecations_count_checkpoint/deprecations_count_checkpoint.tsx index c958eb68c86ec..83f09eaf9e8d1 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecation_logs/fix_deprecation_logs/deprecations_count_checkpoint/deprecations_count_checkpoint.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecation_logs/fix_deprecation_logs/deprecations_count_checkpoint/deprecations_count_checkpoint.tsx @@ -7,7 +7,7 @@ import React, { FunctionComponent, useState } from 'react'; import moment from 'moment-timezone'; -import { FormattedDate, FormattedTime, FormattedMessage } from '@kbn/i18n/react'; +import { FormattedDate, FormattedTime, FormattedMessage } from '@kbn/i18n-react'; import { METRIC_TYPE } from '@kbn/analytics'; import { i18n } from '@kbn/i18n'; import { EuiCallOut, EuiButton, EuiLoadingContent } from '@elastic/eui'; diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecation_logs/fix_deprecation_logs/external_links.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecation_logs/fix_deprecation_logs/external_links.tsx index dec43145ef966..486f101aca737 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecation_logs/fix_deprecation_logs/external_links.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecation_logs/fix_deprecation_logs/external_links.tsx @@ -8,7 +8,7 @@ import { encode } from 'rison-node'; import React, { FunctionComponent, useState, useEffect } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { METRIC_TYPE } from '@kbn/analytics'; import { EuiLink, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiPanel, EuiText } from '@elastic/eui'; diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecation_logs/fix_deprecation_logs/fix_deprecation_logs.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecation_logs/fix_deprecation_logs/fix_deprecation_logs.tsx index ff1cfc172905f..1f4e6572db426 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecation_logs/fix_deprecation_logs/fix_deprecation_logs.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecation_logs/fix_deprecation_logs/fix_deprecation_logs.tsx @@ -7,7 +7,7 @@ import React, { FunctionComponent, useState, useEffect } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiText, EuiSpacer, EuiLink, EuiCallOut, EuiCode } from '@elastic/eui'; import { useAppContext } from '../../../app_context'; diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/ml_snapshots/flyout.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/ml_snapshots/flyout.tsx index a5830cf1ca655..a031d7dcfdcd3 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/ml_snapshots/flyout.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/ml_snapshots/flyout.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { METRIC_TYPE } from '@kbn/analytics'; import { diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/checklist_step.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/checklist_step.tsx index e0b9b25d73235..85d8b260c1b79 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/checklist_step.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/checklist_step.tsx @@ -19,7 +19,7 @@ import { EuiSpacer, EuiText, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { ReindexStatus } from '../../../../../../../common/types'; diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/container.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/container.tsx index 82d0f57c22a55..ab2ec0d633323 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/container.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/container.tsx @@ -6,7 +6,7 @@ */ import React, { useCallback, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlyoutHeader, EuiSpacer, EuiTitle } from '@elastic/eui'; import { METRIC_TYPE } from '@kbn/analytics'; diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/progress.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/progress.tsx index cf32a8bb3ab65..a58f386216a80 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/progress.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/progress.tsx @@ -8,7 +8,7 @@ import React, { ReactNode } from 'react'; import { EuiCallOut, EuiFlexGroup, EuiFlexItem, EuiLink, EuiText, EuiTitle } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ReindexStatus, ReindexStep } from '../../../../../../../common/types'; import { CancelLoadingState } from '../../../../types'; diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/warning_step.test.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/warning_step.test.tsx index 35e4a4b0b843f..4eac1ec739cfc 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/warning_step.test.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/warning_step.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { mount, shallow } from 'enzyme'; import React from 'react'; import SemVer from 'semver/classes/semver'; diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/warning_step_checkbox.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/warning_step_checkbox.tsx index 904e9a5e1fec6..abc7e513f785f 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/warning_step_checkbox.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/warning_step_checkbox.tsx @@ -17,7 +17,7 @@ import { EuiFlexItem, EuiIconTip, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { DocLinksStart } from 'kibana/public'; import { ReindexWarning, ReindexWarningTypes } from '../../../../../../../common/types'; diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/warnings_step.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/warnings_step.tsx index d8909d4ea039f..09cc8f103709a 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/warnings_step.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/warnings_step.tsx @@ -18,7 +18,7 @@ import { EuiSpacer, EuiTitle, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ReindexWarning, ReindexWarningTypes } from '../../../../../../../common/types'; import { useAppContext } from '../../../../../app_context'; diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/es_deprecations.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/es_deprecations.tsx index 270f597cb964f..b74ed4275a17e 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/es_deprecations.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/es_deprecations.tsx @@ -10,7 +10,7 @@ import { withRouter, RouteComponentProps } from 'react-router-dom'; import { EuiPageHeader, EuiSpacer, EuiPageContent, EuiLink } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { DocLinksStart } from 'kibana/public'; import { METRIC_TYPE } from '@kbn/analytics'; @@ -46,7 +46,7 @@ const i18nTexts = { }), pageDescription: i18n.translate('xpack.upgradeAssistant.esDeprecations.pageDescription', { defaultMessage: - 'Resolve all critical issues before upgrading. Before making changes, ensure you have a current snapshot of your cluster. Indices created before 7.0 must be reindexed or removed. To start multiple reindexing tasks in a single request, use the Kibana batch reindexing API.', + 'Resolve all critical issues before upgrading. Before making changes, ensure you have a current snapshot of your cluster. Indices created before 7.0 must be reindexed or removed.', }), isLoading: i18n.translate('xpack.upgradeAssistant.esDeprecations.loadingText', { defaultMessage: 'Loading deprecation issues…', @@ -136,8 +136,7 @@ export const EsDeprecations = withRouter(({ history }: RouteComponentProps) => { pageTitle={i18nTexts.pageTitle} description={ <> - {i18nTexts.pageDescription} - {getBatchReindexLink(docLinks)} + {i18nTexts.pageDescription} {getBatchReindexLink(docLinks)} } > diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/kibana_deprecations/deprecation_details_flyout.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/kibana_deprecations/deprecation_details_flyout.tsx index baf725b48e6af..2b022a6c7fff4 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/kibana_deprecations/deprecation_details_flyout.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/kibana_deprecations/deprecation_details_flyout.tsx @@ -7,7 +7,7 @@ import React, { useCallback } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { METRIC_TYPE } from '@kbn/analytics'; import { diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/overview/backup_step/cloud_backup.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/overview/backup_step/cloud_backup.tsx index 4ab860a0bf6a7..fc87f1a620930 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/overview/backup_step/cloud_backup.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/overview/backup_step/cloud_backup.tsx @@ -7,7 +7,7 @@ import React, { useEffect } from 'react'; import moment from 'moment-timezone'; -import { FormattedDate, FormattedTime, FormattedMessage } from '@kbn/i18n/react'; +import { FormattedDate, FormattedTime, FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { METRIC_TYPE } from '@kbn/analytics'; import { diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/overview/backup_step/on_prem_backup.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/overview/backup_step/on_prem_backup.tsx index e512eb5a301dc..1bccb4eb3f8dc 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/overview/backup_step/on_prem_backup.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/overview/backup_step/on_prem_backup.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { METRIC_TYPE } from '@kbn/analytics'; import { EuiText, EuiButton, EuiSpacer } from '@elastic/eui'; diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/overview/fix_issues_step/fix_issues_step.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/overview/fix_issues_step/fix_issues_step.tsx index 410eb695240f9..aa3fe2cf3602d 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/overview/fix_issues_step/fix_issues_step.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/overview/fix_issues_step/fix_issues_step.tsx @@ -9,7 +9,7 @@ import React, { FunctionComponent, useState, useEffect } from 'react'; import { EuiText, EuiFlexItem, EuiFlexGroup, EuiSpacer, EuiLink } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import type { EuiStepProps } from '@elastic/eui/src/components/steps/step'; import { DEPRECATION_LOGS_INDEX } from '../../../../../common/constants'; diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/overview/migrate_system_indices/migrate_system_indices.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/overview/migrate_system_indices/migrate_system_indices.tsx index d14958148b2f8..2b4eb6ee1037f 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/overview/migrate_system_indices/migrate_system_indices.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/overview/migrate_system_indices/migrate_system_indices.tsx @@ -8,7 +8,7 @@ import React, { FunctionComponent, useEffect } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiText, EuiButton, diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/overview/overview.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/overview/overview.tsx index 900c89671315d..ad24f65bf6bd1 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/overview/overview.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/overview/overview.tsx @@ -19,7 +19,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { METRIC_TYPE } from '@kbn/analytics'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { withRouter, RouteComponentProps } from 'react-router-dom'; import { useAppContext } from '../../app_context'; diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/shared/no_deprecations.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/shared/no_deprecations.tsx index 7763450c6cfcf..6e06ffe03f904 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/shared/no_deprecations.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/shared/no_deprecations.tsx @@ -9,7 +9,7 @@ import React, { FunctionComponent } from 'react'; import { EuiLink, EuiEmptyPrompt } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; const i18nTexts = { getEmptyPromptTitle: (deprecationType: string) => diff --git a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/index_settings.test.ts b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/index_settings.test.ts index 957198cde8da9..0c31a5b8d2fe5 100644 --- a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/index_settings.test.ts +++ b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/index_settings.test.ts @@ -64,6 +64,7 @@ describe('transformFlatSettings', () => { 'index.verified_before_close': 'true', 'index.version.created': '123123', 'index.version.upgraded': '123123', + 'index.mapper.dynamic': 'true', // Deprecated settings 'index.force_memory_term_dictionary': '1024', diff --git a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/index_settings.ts b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/index_settings.ts index b65984af5deb3..870dd3ae45c30 100644 --- a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/index_settings.ts +++ b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/index_settings.ts @@ -178,6 +178,9 @@ const removeUnsettableSettings = (settings: FlatSettings['settings']) => 'index.verified_before_close', 'index.version.created', + // Ignored since 6.x and forbidden in 7.x + 'index.mapper.dynamic', + // Deprecated in 9.0 'index.version.upgraded', ]); diff --git a/x-pack/plugins/uptime/common/config.ts b/x-pack/plugins/uptime/common/config.ts new file mode 100644 index 0000000000000..ccd5e7b5a2cc6 --- /dev/null +++ b/x-pack/plugins/uptime/common/config.ts @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { PluginConfigDescriptor } from 'kibana/server'; +import { schema, TypeOf } from '@kbn/config-schema'; + +export const config: PluginConfigDescriptor = { + exposeToBrowser: { + ui: true, + }, + schema: schema.maybe( + schema.object({ + index: schema.maybe(schema.string()), + ui: schema.maybe( + schema.object({ + unsafe: schema.maybe( + schema.object({ + monitorManagement: schema.maybe( + schema.object({ + enabled: schema.boolean(), + }) + ), + }) + ), + }) + ), + unsafe: schema.maybe( + schema.object({ + service: schema.maybe( + schema.object({ + enabled: schema.boolean(), + username: schema.string(), + password: schema.string(), + manifestUrl: schema.string(), + hosts: schema.arrayOf(schema.string()), + }) + ), + }) + ), + }) + ), +}; + +export type UptimeConfig = TypeOf; +export interface UptimeUiConfig { + ui?: TypeOf['ui']; +} diff --git a/x-pack/plugins/uptime/common/constants/ui.ts b/x-pack/plugins/uptime/common/constants/ui.ts index 659d5727abc0c..b1d92db8eae12 100644 --- a/x-pack/plugins/uptime/common/constants/ui.ts +++ b/x-pack/plugins/uptime/common/constants/ui.ts @@ -7,6 +7,10 @@ export const MONITOR_ROUTE = '/monitor/:monitorId?'; +export const MONITOR_ADD_ROUTE = '/add-monitor'; + +export const MONITOR_EDIT_ROUTE = '/edit-monitor/:monitorId'; + export const OVERVIEW_ROUTE = '/'; export const SETTINGS_ROUTE = '/settings'; diff --git a/x-pack/plugins/uptime/common/requests/get_certs_request_body.ts b/x-pack/plugins/uptime/common/requests/get_certs_request_body.ts index ca72717ff4113..1c5685ad4613e 100644 --- a/x-pack/plugins/uptime/common/requests/get_certs_request_body.ts +++ b/x-pack/plugins/uptime/common/requests/get_certs_request_body.ts @@ -85,28 +85,37 @@ export const getCertsRequestBody = ({ }, }, }, - ...(notValidBefore - ? [ - { - range: { - 'tls.certificate_not_valid_before': { - lte: notValidBefore, - }, - }, - }, - ] - : []), - ...(notValidAfter - ? [ - { - range: { - 'tls.certificate_not_valid_after': { - lte: notValidAfter, - }, - }, - }, - ] - : []), + { + bool: { + // these notValidBefore and notValidAfter should be inside should block, since + // we want to match either of the condition, making ir an OR operation + minimum_should_match: 1, + should: [ + ...(notValidBefore + ? [ + { + range: { + 'tls.certificate_not_valid_before': { + lte: notValidBefore, + }, + }, + }, + ] + : []), + ...(notValidAfter + ? [ + { + range: { + 'tls.certificate_not_valid_after': { + lte: notValidAfter, + }, + }, + }, + ] + : []), + ], + }, + }, ] as estypes.QueryDslQueryContainer, }, }, diff --git a/x-pack/plugins/uptime/common/runtime_types/dynamic_settings.ts b/x-pack/plugins/uptime/common/runtime_types/dynamic_settings.ts index cc3ca4a7060c5..d7d20361bea96 100644 --- a/x-pack/plugins/uptime/common/runtime_types/dynamic_settings.ts +++ b/x-pack/plugins/uptime/common/runtime_types/dynamic_settings.ts @@ -7,7 +7,7 @@ import * as t from 'io-ts'; -export const DynamicSettingsType = t.type({ +export const DynamicSettingsType = t.strict({ heartbeatIndices: t.string, certAgeThreshold: t.number, certExpirationThreshold: t.number, diff --git a/x-pack/plugins/uptime/common/types/index.ts b/x-pack/plugins/uptime/common/types/index.ts index ef7130ff96673..734cfcc5f42d4 100644 --- a/x-pack/plugins/uptime/common/types/index.ts +++ b/x-pack/plugins/uptime/common/types/index.ts @@ -5,6 +5,8 @@ * 2.0. */ +import { SimpleSavedObject } from 'kibana/public'; + /** Represents the average monitor duration ms at a point in time. */ export interface MonitorDurationAveragePoint { /** The timeseries value for this point. */ @@ -28,3 +30,17 @@ export interface MonitorDurationResult { export interface MonitorIdParam { monitorId: string; } + +export type SyntheticsMonitorSavedObject = SimpleSavedObject<{ + name: string; + runOnce: boolean; + urls?: string[]; + tags?: string[]; + schedule: string; + type: 'http' | 'tcp' | 'icmp' | 'browser'; + source?: { + inline: { + script: string; + }; + }; +}>; diff --git a/x-pack/plugins/uptime/public/apps/plugin.ts b/x-pack/plugins/uptime/public/apps/plugin.ts index 0cd0af6231c9c..ec6deef429ca9 100644 --- a/x-pack/plugins/uptime/public/apps/plugin.ts +++ b/x-pack/plugins/uptime/public/apps/plugin.ts @@ -15,6 +15,7 @@ import { from } from 'rxjs'; import { map } from 'rxjs/operators'; import { i18n } from '@kbn/i18n'; import { DEFAULT_APP_CATEGORIES } from '../../../../../src/core/public'; + import { FeatureCatalogueCategory, HomePublicPluginSetup, @@ -43,6 +44,7 @@ import { } from '../components/fleet_package'; import { LazySyntheticsCustomAssetsExtension } from '../components/fleet_package/lazy_synthetics_custom_assets_extension'; import { Start as InspectorPluginStart } from '../../../../../src/plugins/inspector/public'; +import { UptimeUiConfig } from '../../common/config'; export interface ClientPluginsSetup { data: DataPublicPluginSetup; @@ -73,9 +75,10 @@ export type ClientStart = void; export class UptimePlugin implements Plugin { - constructor(_context: PluginInitializerContext) {} + constructor(private readonly initContext: PluginInitializerContext) {} public setup(core: CoreSetup, plugins: ClientPluginsSetup): void { + const config = this.initContext.config.get(); if (plugins.home) { plugins.home.featureCatalogue.register({ id: PLUGIN.ID, @@ -203,7 +206,7 @@ export class UptimePlugin const [coreStart, corePlugins] = await core.getStartServices(); const { renderApp } = await import('./render_app'); - return renderApp(coreStart, plugins, corePlugins, params); + return renderApp(coreStart, plugins, corePlugins, params, config); }, }); } diff --git a/x-pack/plugins/uptime/public/apps/render_app.tsx b/x-pack/plugins/uptime/public/apps/render_app.tsx index 376fb4c8364c0..cc831680dbf09 100644 --- a/x-pack/plugins/uptime/public/apps/render_app.tsx +++ b/x-pack/plugins/uptime/public/apps/render_app.tsx @@ -17,12 +17,14 @@ import { } from '../../common/constants'; import { UptimeApp, UptimeAppProps } from './uptime_app'; import { ClientPluginsSetup, ClientPluginsStart } from './plugin'; +import { UptimeUiConfig } from '../../common/config'; export function renderApp( core: CoreStart, plugins: ClientPluginsSetup, startPlugins: ClientPluginsStart, - appMountParameters: AppMountParameters + appMountParameters: AppMountParameters, + config: UptimeUiConfig ) { const { application: { capabilities }, @@ -70,6 +72,7 @@ export function renderApp( setBadge, appMountParameters, setBreadcrumbs: core.chrome.setBreadcrumbs, + config, }; ReactDOM.render(, appMountParameters.element); diff --git a/x-pack/plugins/uptime/public/apps/uptime_app.tsx b/x-pack/plugins/uptime/public/apps/uptime_app.tsx index 991657f258029..7eb2c9626e37f 100644 --- a/x-pack/plugins/uptime/public/apps/uptime_app.tsx +++ b/x-pack/plugins/uptime/public/apps/uptime_app.tsx @@ -13,6 +13,7 @@ import { I18nStart, ChromeBreadcrumb, CoreStart, AppMountParameters } from 'kiba import { APP_WRAPPER_CLASS } from '../../../../../src/core/public'; import { KibanaContextProvider, + KibanaThemeProvider, RedirectAppLinks, } from '../../../../../src/plugins/kibana_react/public'; import { ClientPluginsSetup, ClientPluginsStart } from './plugin'; @@ -34,6 +35,7 @@ import { EuiThemeProvider } from '../../../../../src/plugins/kibana_react/common import { Storage } from '../../../../../src/plugins/kibana_utils/public'; import { UptimeIndexPatternContextProvider } from '../contexts/uptime_index_pattern_context'; import { InspectorContextProvider } from '../../../observability/public'; +import { UptimeUiConfig } from '../../common/config'; export interface UptimeAppColors { danger: string; @@ -62,6 +64,7 @@ export interface UptimeAppProps { commonlyUsedRanges: CommonlyUsedRange[]; setBreadcrumbs: (crumbs: ChromeBreadcrumb[]) => void; appMountParameters: AppMountParameters; + config: UptimeUiConfig; } const Application = (props: UptimeAppProps) => { @@ -76,6 +79,7 @@ const Application = (props: UptimeAppProps) => { setBadge, startPlugins, appMountParameters, + config, } = props; useEffect(() => { @@ -96,6 +100,7 @@ const Application = (props: UptimeAppProps) => { }, [canSave, renderGlobalHelpControls, setBadge]); kibanaService.core = core; + kibanaService.theme = props.appMountParameters.theme$; store.dispatch(setBasePath(basePath)); @@ -104,46 +109,48 @@ const Application = (props: UptimeAppProps) => { return ( - - - - - - - - - -
- - - - - - - -
-
-
-
-
-
-
-
-
-
+ + + + + + + + + + +
+ + + + + + + +
+
+
+
+
+
+
+
+
+
+
); diff --git a/x-pack/plugins/uptime/public/apps/use_no_data_config.ts b/x-pack/plugins/uptime/public/apps/use_no_data_config.ts index 6e73a6d5e8268..dc00a25e3a111 100644 --- a/x-pack/plugins/uptime/public/apps/use_no_data_config.ts +++ b/x-pack/plugins/uptime/public/apps/use_no_data_config.ts @@ -31,13 +31,13 @@ export function useNoDataConfig(): KibanaPageTemplateProps['noDataConfig'] { actions: { beats: { title: i18n.translate('xpack.uptime.noDataConfig.beatsCard.title', { - defaultMessage: 'Add monitors with the Elastic Synthetics integration', + defaultMessage: 'Add monitors with Heartbeat', }), description: i18n.translate('xpack.uptime.noDataConfig.beatsCard.description', { defaultMessage: 'Proactively monitor the availability of your sites and services. Receive alerts and resolve issues faster to optimize your users experience.', }), - href: basePath + `/app/integrations/detail/synthetics/overview`, + href: basePath + `/app/home#/tutorial/uptimeMonitors`, }, }, docsLink: docLinks!.links.observability.guide, diff --git a/x-pack/plugins/uptime/public/components/certificates/cert_status.tsx b/x-pack/plugins/uptime/public/components/certificates/cert_status.tsx index 86bd496ea865d..30bbb241205e5 100644 --- a/x-pack/plugins/uptime/public/components/certificates/cert_status.tsx +++ b/x-pack/plugins/uptime/public/components/certificates/cert_status.tsx @@ -9,7 +9,7 @@ import React from 'react'; import moment from 'moment'; import styled from 'styled-components'; import { EuiHealth, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useSelector } from 'react-redux'; import { Cert } from '../../../common/runtime_types'; import { useCertStatus } from '../../hooks'; diff --git a/x-pack/plugins/uptime/public/components/certificates/certificate_title.tsx b/x-pack/plugins/uptime/public/components/certificates/certificate_title.tsx index 41367fcb8ef46..cd84cfd9ff317 100644 --- a/x-pack/plugins/uptime/public/components/certificates/certificate_title.tsx +++ b/x-pack/plugins/uptime/public/components/certificates/certificate_title.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useSelector } from 'react-redux'; import { certificatesSelector } from '../../state/certificates/certificates'; diff --git a/x-pack/plugins/uptime/public/components/certificates/use_cert_search.ts b/x-pack/plugins/uptime/public/components/certificates/use_cert_search.ts index c4379e550b47a..0f6431fb7ab7e 100644 --- a/x-pack/plugins/uptime/public/components/certificates/use_cert_search.ts +++ b/x-pack/plugins/uptime/public/components/certificates/use_cert_search.ts @@ -50,7 +50,7 @@ export const useCertSearch = ({ const { data: result, loading } = useEsSearch( esParams, - [settings.settings?.heartbeatIndices, size, pageIndex, lastRefresh, search], + [settings.settings?.heartbeatIndices, size, pageIndex, lastRefresh, search, sortBy, direction], { name: 'getTLSCertificates', } diff --git a/x-pack/plugins/uptime/public/components/common/charts/annotation_tooltip.tsx b/x-pack/plugins/uptime/public/components/common/charts/annotation_tooltip.tsx index 4de551d00d27a..50a8760c10af0 100644 --- a/x-pack/plugins/uptime/public/components/common/charts/annotation_tooltip.tsx +++ b/x-pack/plugins/uptime/public/components/common/charts/annotation_tooltip.tsx @@ -8,7 +8,7 @@ import React from 'react'; import moment from 'moment'; import styled from 'styled-components'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; const Header = styled.div` font-weight: bold; diff --git a/x-pack/plugins/uptime/public/components/common/charts/chart_empty_state.test.tsx b/x-pack/plugins/uptime/public/components/common/charts/chart_empty_state.test.tsx index de537641bee8c..9d8aa3d4d091f 100644 --- a/x-pack/plugins/uptime/public/components/common/charts/chart_empty_state.test.tsx +++ b/x-pack/plugins/uptime/public/components/common/charts/chart_empty_state.test.tsx @@ -8,7 +8,7 @@ import { ChartEmptyState } from './chart_empty_state'; import { shallowWithIntl } from '@kbn/test/jest'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; describe('ChartEmptyState', () => { it('renders string values', () => { diff --git a/x-pack/plugins/uptime/public/components/common/charts/duration_chart.tsx b/x-pack/plugins/uptime/public/components/common/charts/duration_chart.tsx index ae9683cef8078..1a09a38835578 100644 --- a/x-pack/plugins/uptime/public/components/common/charts/duration_chart.tsx +++ b/x-pack/plugins/uptime/public/components/common/charts/duration_chart.tsx @@ -8,7 +8,7 @@ import React, { useContext, useState } from 'react'; import { i18n } from '@kbn/i18n'; import moment from 'moment'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Axis, Chart, diff --git a/x-pack/plugins/uptime/public/components/common/charts/monitor_bar_series.tsx b/x-pack/plugins/uptime/public/components/common/charts/monitor_bar_series.tsx index 145ec5f199db4..34cf55c0af48c 100644 --- a/x-pack/plugins/uptime/public/components/common/charts/monitor_bar_series.tsx +++ b/x-pack/plugins/uptime/public/components/common/charts/monitor_bar_series.tsx @@ -20,7 +20,7 @@ import { import { i18n } from '@kbn/i18n'; import React, { useContext } from 'react'; import moment from 'moment'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiText, EuiToolTip } from '@elastic/eui'; import { HistogramPoint } from '../../../../common/runtime_types'; import { getChartDateLabel, seriesHasDownValues } from '../../../lib/helper'; diff --git a/x-pack/plugins/uptime/public/components/common/charts/ping_histogram.tsx b/x-pack/plugins/uptime/public/components/common/charts/ping_histogram.tsx index 5c4be0e6719f4..b0e39fd5bf651 100644 --- a/x-pack/plugins/uptime/public/components/common/charts/ping_histogram.tsx +++ b/x-pack/plugins/uptime/public/components/common/charts/ping_histogram.tsx @@ -20,7 +20,7 @@ import { import { EuiTitle, EuiFlexGroup, EuiFlexItem, EuiButton } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React, { useContext } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import numeral from '@elastic/numeral'; import moment from 'moment'; import { useSelector } from 'react-redux'; diff --git a/x-pack/plugins/uptime/public/components/common/header/action_menu_content.test.tsx b/x-pack/plugins/uptime/public/components/common/header/action_menu_content.test.tsx index 47dc2084a788f..89aaec5f133c2 100644 --- a/x-pack/plugins/uptime/public/components/common/header/action_menu_content.test.tsx +++ b/x-pack/plugins/uptime/public/components/common/header/action_menu_content.test.tsx @@ -45,13 +45,11 @@ describe('ActionMenuContent', () => { it('renders Add Data link', () => { const { getByLabelText, getByText } = render(); - const addDataAnchor = getByLabelText( - 'Navigate to the Elastic Synthetics integration to add Uptime data' - ); + const addDataAnchor = getByLabelText('Navigate to a tutorial about adding Uptime data'); // this href value is mocked, so it doesn't correspond to the real link // that Kibana core services will provide - expect(addDataAnchor.getAttribute('href')).toBe('/integrations/detail/synthetics/overview'); + expect(addDataAnchor.getAttribute('href')).toBe('/home#/tutorial/uptimeMonitors'); expect(getByText('Add data')); }); }); diff --git a/x-pack/plugins/uptime/public/components/common/header/action_menu_content.tsx b/x-pack/plugins/uptime/public/components/common/header/action_menu_content.tsx index 7b510432f773b..853b3111bbdf7 100644 --- a/x-pack/plugins/uptime/public/components/common/header/action_menu_content.tsx +++ b/x-pack/plugins/uptime/public/components/common/header/action_menu_content.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiHeaderLinks, EuiToolTip, EuiHeaderLink } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useHistory } from 'react-router-dom'; import { useSelector } from 'react-redux'; import { createExploratoryViewUrl } from '../../../../../observability/public'; @@ -31,7 +31,7 @@ const ANALYZE_DATA = i18n.translate('xpack.uptime.analyzeDataButtonLabel', { const ANALYZE_MESSAGE = i18n.translate('xpack.uptime.analyzeDataButtonLabel.message', { defaultMessage: - 'EXPERIMENTAL - Explore Data allows you to select and filter result data in any dimension and look for the cause or impact of performance problems.', + 'Explore Data allows you to select and filter result data in any dimension and look for the cause or impact of performance problems.', }); export function ActionMenuContent(): React.ReactElement { @@ -99,11 +99,9 @@ export function ActionMenuContent(): React.ReactElement { diff --git a/x-pack/plugins/uptime/public/components/fleet_package/browser/advanced_fields.tsx b/x-pack/plugins/uptime/public/components/fleet_package/browser/advanced_fields.tsx index 61af9f8ec6143..cbbc9a33642b5 100644 --- a/x-pack/plugins/uptime/public/components/fleet_package/browser/advanced_fields.tsx +++ b/x-pack/plugins/uptime/public/components/fleet_package/browser/advanced_fields.tsx @@ -6,7 +6,7 @@ */ import React, { useCallback } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiAccordion, EuiSelect, diff --git a/x-pack/plugins/uptime/public/components/fleet_package/browser/script_recorder_fields.tsx b/x-pack/plugins/uptime/public/components/fleet_package/browser/script_recorder_fields.tsx index 9b99b4094e63b..e85bebe7f6b83 100644 --- a/x-pack/plugins/uptime/public/components/fleet_package/browser/script_recorder_fields.tsx +++ b/x-pack/plugins/uptime/public/components/fleet_package/browser/script_recorder_fields.tsx @@ -7,7 +7,7 @@ import React, { useState, useCallback } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiLink, EuiFlexGroup, diff --git a/x-pack/plugins/uptime/public/components/fleet_package/browser/simple_fields.tsx b/x-pack/plugins/uptime/public/components/fleet_package/browser/simple_fields.tsx index 50ad14aa98287..ae58df0e058af 100644 --- a/x-pack/plugins/uptime/public/components/fleet_package/browser/simple_fields.tsx +++ b/x-pack/plugins/uptime/public/components/fleet_package/browser/simple_fields.tsx @@ -6,7 +6,7 @@ */ import React, { memo, useMemo, useCallback } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFormRow } from '@elastic/eui'; import { ConfigKeys, Validation } from '../types'; import { useBrowserSimpleFieldsContext } from '../contexts'; diff --git a/x-pack/plugins/uptime/public/components/fleet_package/browser/source_field.tsx b/x-pack/plugins/uptime/public/components/fleet_package/browser/source_field.tsx index f0e06d17340b5..a3de661a49a5b 100644 --- a/x-pack/plugins/uptime/public/components/fleet_package/browser/source_field.tsx +++ b/x-pack/plugins/uptime/public/components/fleet_package/browser/source_field.tsx @@ -6,7 +6,7 @@ */ import React, { useEffect, useState } from 'react'; import styled from 'styled-components'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiTabbedContent, diff --git a/x-pack/plugins/uptime/public/components/fleet_package/browser/zip_url_tls_fields.tsx b/x-pack/plugins/uptime/public/components/fleet_package/browser/zip_url_tls_fields.tsx index ed1ad9a8ce65c..caa5875504441 100644 --- a/x-pack/plugins/uptime/public/components/fleet_package/browser/zip_url_tls_fields.tsx +++ b/x-pack/plugins/uptime/public/components/fleet_package/browser/zip_url_tls_fields.tsx @@ -9,7 +9,7 @@ import React, { useCallback, useEffect } from 'react'; import { EuiSwitch, EuiFormRow } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { TLSOptions, TLSConfig } from '../common/tls_options'; import { diff --git a/x-pack/plugins/uptime/public/components/fleet_package/common/common_fields.tsx b/x-pack/plugins/uptime/public/components/fleet_package/common/common_fields.tsx index 57d5094958ca3..a8f7b041d998c 100644 --- a/x-pack/plugins/uptime/public/components/fleet_package/common/common_fields.tsx +++ b/x-pack/plugins/uptime/public/components/fleet_package/common/common_fields.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFormRow, EuiFieldText, EuiFieldNumber } from '@elastic/eui'; import { ConfigKeys, Validation, ICommonFields } from '../types'; import { ComboBox } from '../combo_box'; diff --git a/x-pack/plugins/uptime/public/components/fleet_package/common/tls_options.tsx b/x-pack/plugins/uptime/public/components/fleet_package/common/tls_options.tsx index 44a948b24823b..76b49c04ad2cb 100644 --- a/x-pack/plugins/uptime/public/components/fleet_package/common/tls_options.tsx +++ b/x-pack/plugins/uptime/public/components/fleet_package/common/tls_options.tsx @@ -7,7 +7,7 @@ import React, { useEffect, useState, memo } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCallOut, EuiComboBox, diff --git a/x-pack/plugins/uptime/public/components/fleet_package/custom_fields.tsx b/x-pack/plugins/uptime/public/components/fleet_package/custom_fields.tsx index 0bdb2d62a7367..f8754307e0820 100644 --- a/x-pack/plugins/uptime/public/components/fleet_package/custom_fields.tsx +++ b/x-pack/plugins/uptime/public/components/fleet_package/custom_fields.tsx @@ -6,7 +6,7 @@ */ import React, { useMemo, memo } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, diff --git a/x-pack/plugins/uptime/public/components/fleet_package/header_field.tsx b/x-pack/plugins/uptime/public/components/fleet_package/header_field.tsx index 035d71d3c7132..b77b7239b8e30 100644 --- a/x-pack/plugins/uptime/public/components/fleet_package/header_field.tsx +++ b/x-pack/plugins/uptime/public/components/fleet_package/header_field.tsx @@ -6,7 +6,7 @@ */ import React, { useEffect, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ContentType, Mode } from './types'; import { KeyValuePairsField, Pair } from './key_value_field'; diff --git a/x-pack/plugins/uptime/public/components/fleet_package/http/advanced_fields.tsx b/x-pack/plugins/uptime/public/components/fleet_package/http/advanced_fields.tsx index c38ac509e377e..5299fa93e6dab 100644 --- a/x-pack/plugins/uptime/public/components/fleet_package/http/advanced_fields.tsx +++ b/x-pack/plugins/uptime/public/components/fleet_package/http/advanced_fields.tsx @@ -7,7 +7,7 @@ import React, { useCallback, memo } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiAccordion, EuiCode, diff --git a/x-pack/plugins/uptime/public/components/fleet_package/http/simple_fields.tsx b/x-pack/plugins/uptime/public/components/fleet_package/http/simple_fields.tsx index 90f94324fe657..8d487a0222979 100644 --- a/x-pack/plugins/uptime/public/components/fleet_package/http/simple_fields.tsx +++ b/x-pack/plugins/uptime/public/components/fleet_package/http/simple_fields.tsx @@ -6,7 +6,7 @@ */ import React, { memo } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFormRow, EuiFieldText, EuiFieldNumber } from '@elastic/eui'; import { ConfigKeys, Validation } from '../types'; import { useHTTPSimpleFieldsContext } from '../contexts'; diff --git a/x-pack/plugins/uptime/public/components/fleet_package/icmp/simple_fields.tsx b/x-pack/plugins/uptime/public/components/fleet_package/icmp/simple_fields.tsx index 32c843f1ce114..9c605dacdfd22 100644 --- a/x-pack/plugins/uptime/public/components/fleet_package/icmp/simple_fields.tsx +++ b/x-pack/plugins/uptime/public/components/fleet_package/icmp/simple_fields.tsx @@ -6,7 +6,7 @@ */ import React, { memo } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFormRow, EuiFieldText, EuiFieldNumber } from '@elastic/eui'; import { ConfigKeys, Validation } from '../types'; import { useICMPSimpleFieldsContext } from '../contexts'; diff --git a/x-pack/plugins/uptime/public/components/fleet_package/index_response_body_field.tsx b/x-pack/plugins/uptime/public/components/fleet_package/index_response_body_field.tsx index fc53b275f0828..990b6fcf8eb56 100644 --- a/x-pack/plugins/uptime/public/components/fleet_package/index_response_body_field.tsx +++ b/x-pack/plugins/uptime/public/components/fleet_package/index_response_body_field.tsx @@ -7,7 +7,7 @@ import React, { useEffect, useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiCheckbox, EuiFlexGroup, EuiFlexItem, EuiSelect } from '@elastic/eui'; import { ResponseBodyIndexPolicy } from './types'; diff --git a/x-pack/plugins/uptime/public/components/fleet_package/key_value_field.tsx b/x-pack/plugins/uptime/public/components/fleet_package/key_value_field.tsx index ea82259b16c90..8165577bfa530 100644 --- a/x-pack/plugins/uptime/public/components/fleet_package/key_value_field.tsx +++ b/x-pack/plugins/uptime/public/components/fleet_package/key_value_field.tsx @@ -8,7 +8,7 @@ import React, { Fragment, useCallback, useEffect, useState } from 'react'; import styled from 'styled-components'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButton, EuiButtonIcon, diff --git a/x-pack/plugins/uptime/public/components/fleet_package/optional_label.tsx b/x-pack/plugins/uptime/public/components/fleet_package/optional_label.tsx index 6f207d3ccd208..8d81b77b01faf 100644 --- a/x-pack/plugins/uptime/public/components/fleet_package/optional_label.tsx +++ b/x-pack/plugins/uptime/public/components/fleet_package/optional_label.tsx @@ -5,7 +5,7 @@ * 2.0. */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiText } from '@elastic/eui'; export const OptionalLabel = () => { diff --git a/x-pack/plugins/uptime/public/components/fleet_package/request_body_field.tsx b/x-pack/plugins/uptime/public/components/fleet_package/request_body_field.tsx index 1fdde7c2b63fc..6c2b6a3383b26 100644 --- a/x-pack/plugins/uptime/public/components/fleet_package/request_body_field.tsx +++ b/x-pack/plugins/uptime/public/components/fleet_package/request_body_field.tsx @@ -6,7 +6,7 @@ */ import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { stringify, parse } from 'query-string'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiTabbedContent } from '@elastic/eui'; import { Mode, MonacoEditorLangId } from './types'; diff --git a/x-pack/plugins/uptime/public/components/fleet_package/tcp/advanced_fields.tsx b/x-pack/plugins/uptime/public/components/fleet_package/tcp/advanced_fields.tsx index 9db07afa559b9..f96b5103a8edc 100644 --- a/x-pack/plugins/uptime/public/components/fleet_package/tcp/advanced_fields.tsx +++ b/x-pack/plugins/uptime/public/components/fleet_package/tcp/advanced_fields.tsx @@ -6,7 +6,7 @@ */ import React, { useCallback } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiAccordion, EuiCheckbox, diff --git a/x-pack/plugins/uptime/public/components/fleet_package/tcp/simple_fields.tsx b/x-pack/plugins/uptime/public/components/fleet_package/tcp/simple_fields.tsx index 53a0074a47d73..28ee223c5f2f8 100644 --- a/x-pack/plugins/uptime/public/components/fleet_package/tcp/simple_fields.tsx +++ b/x-pack/plugins/uptime/public/components/fleet_package/tcp/simple_fields.tsx @@ -6,7 +6,7 @@ */ import React, { memo } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFormRow, EuiFieldText } from '@elastic/eui'; import { ConfigKeys, Validation } from '../types'; import { useTCPSimpleFieldsContext } from '../contexts'; diff --git a/x-pack/plugins/uptime/public/components/monitor/ml/confirm_alert_delete.tsx b/x-pack/plugins/uptime/public/components/monitor/ml/confirm_alert_delete.tsx index 597fcdf6ef861..0d8700ff41169 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ml/confirm_alert_delete.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ml/confirm_alert_delete.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiConfirmModal } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import * as labels from './translations'; interface Props { diff --git a/x-pack/plugins/uptime/public/components/monitor/ml/confirm_delete.tsx b/x-pack/plugins/uptime/public/components/monitor/ml/confirm_delete.tsx index 96c67227cabaf..a0d1d7b5c1732 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ml/confirm_delete.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ml/confirm_delete.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiConfirmModal, EuiLoadingSpinner } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import * as labels from './translations'; interface Props { diff --git a/x-pack/plugins/uptime/public/components/monitor/ml/ml_flyout.test.tsx b/x-pack/plugins/uptime/public/components/monitor/ml/ml_flyout.test.tsx index 29c4a852e208b..c2c4baf0751c4 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ml/ml_flyout.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ml/ml_flyout.test.tsx @@ -40,6 +40,7 @@ describe('ML Flyout component', () => { isApmAvailable: true, isInfraAvailable: true, isLogsAvailable: true, + config: {}, }; const { findByText, findAllByText } = render( @@ -66,6 +67,7 @@ describe('ML Flyout component', () => { isApmAvailable: true, isInfraAvailable: true, isLogsAvailable: true, + config: {}, }; const { queryByText } = render( diff --git a/x-pack/plugins/uptime/public/components/monitor/ml/ml_flyout.tsx b/x-pack/plugins/uptime/public/components/monitor/ml/ml_flyout.tsx index dd854af67a8f2..5500324e4bdd8 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ml/ml_flyout.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ml/ml_flyout.tsx @@ -20,7 +20,7 @@ import { EuiText, EuiTitle, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useSelector } from 'react-redux'; import * as labels from './translations'; import { UptimeSettingsContext } from '../../../contexts'; diff --git a/x-pack/plugins/uptime/public/components/monitor/ml/ml_flyout_container.tsx b/x-pack/plugins/uptime/public/components/monitor/ml/ml_flyout_container.tsx index c1e32613a2ffb..3a6bc9a38c3e6 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ml/ml_flyout_container.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ml/ml_flyout_container.tsx @@ -7,6 +7,8 @@ import React, { useContext, useEffect, useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; +import type { Observable } from 'rxjs'; +import type { CoreTheme } from 'kibana/public'; import { canCreateMLJobSelector, hasMLJobSelector, @@ -29,7 +31,7 @@ import { useGetUrlParams } from '../../../hooks'; import { getDynamicSettings } from '../../../state/actions/dynamic_settings'; import { useMonitorId } from '../../../hooks'; import { kibanaService } from '../../../state/kibana_service'; -import { toMountPoint } from '../../../../../../../src/plugins/kibana_react/public'; +import { toMountPoint, useKibana } from '../../../../../../../src/plugins/kibana_react/public'; import { CLIENT_ALERT_TYPES } from '../../../../common/constants/alerts'; interface Props { @@ -42,13 +44,15 @@ const showMLJobNotification = ( range: { to: string; from: string }, success: boolean, awaitingNodeAssignment: boolean, + theme$?: Observable, error?: Error ) => { if (success) { kibanaService.toasts.addSuccess( { title: toMountPoint( -

{labels.JOB_CREATED_SUCCESS_TITLE}

+

{labels.JOB_CREATED_SUCCESS_TITLE}

, + { theme$ } ), text: toMountPoint(

@@ -58,7 +62,8 @@ const showMLJobNotification = ( {labels.VIEW_JOB} -

+

, + { theme$ } ), }, { toastLifeTimeMs: 10000 } @@ -73,6 +78,7 @@ const showMLJobNotification = ( }; export const MachineLearningFlyout: React.FC = ({ onClose }) => { + const core = useKibana(); const dispatch = useDispatch(); const { data: hasMLJob, error } = useSelector(hasNewMLJobSelector); const isMLJobCreating = useSelector(isMLJobCreatingSelector); @@ -111,7 +117,8 @@ export const MachineLearningFlyout: React.FC = ({ onClose }) => { basePath, { to: dateRangeEnd, from: dateRangeStart }, true, - hasMLJob.awaitingNodeAssignment + hasMLJob.awaitingNodeAssignment, + core.services.theme?.theme$ ); const loadMLJob = (jobId: string) => dispatch(getExistingMLJobAction.get({ monitorId: monitorId as string })); @@ -128,6 +135,7 @@ export const MachineLearningFlyout: React.FC = ({ onClose }) => { { to: dateRangeEnd, from: dateRangeStart }, false, false, + core.services.theme?.theme$, error as Error ); } diff --git a/x-pack/plugins/uptime/public/components/monitor/monitor_duration/monitor_duration.tsx b/x-pack/plugins/uptime/public/components/monitor/monitor_duration/monitor_duration.tsx index 9ce5a509bdd52..dbd8846707d1b 100644 --- a/x-pack/plugins/uptime/public/components/monitor/monitor_duration/monitor_duration.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/monitor_duration/monitor_duration.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, EuiPanel, EuiTitle, EuiSpacer } from '@elastic/eui'; import { LocationDurationLine } from '../../../../common/types'; import { MLIntegrationComponent } from '../ml/ml_integeration'; diff --git a/x-pack/plugins/uptime/public/components/monitor/monitor_title.tsx b/x-pack/plugins/uptime/public/components/monitor/monitor_title.tsx index aa68e2aa7fc4b..8cbc9eed0a210 100644 --- a/x-pack/plugins/uptime/public/components/monitor/monitor_title.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/monitor_title.tsx @@ -6,7 +6,7 @@ */ import { EuiBadge, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiLink, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { useSelector } from 'react-redux'; import { useMonitorId } from '../../hooks'; diff --git a/x-pack/plugins/uptime/public/components/monitor/ping_list/columns/ping_timestamp/no_image_available.tsx b/x-pack/plugins/uptime/public/components/monitor/ping_list/columns/ping_timestamp/no_image_available.tsx index 8dbe80d2b5b46..c73753fd62783 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ping_list/columns/ping_timestamp/no_image_available.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ping_list/columns/ping_timestamp/no_image_available.tsx @@ -6,7 +6,7 @@ */ import { EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { euiStyled } from '../../../../../../../../../src/plugins/kibana_react/common'; diff --git a/x-pack/plugins/uptime/public/components/monitor/ping_list/doc_link_body.tsx b/x-pack/plugins/uptime/public/components/monitor/ping_list/doc_link_body.tsx index 67561022bce93..f56df517455de 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ping_list/doc_link_body.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ping_list/doc_link_body.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiLink, EuiText } from '@elastic/eui'; diff --git a/x-pack/plugins/uptime/public/components/monitor/ping_list/ping_list_header.tsx b/x-pack/plugins/uptime/public/components/monitor/ping_list/ping_list_header.tsx index 0284211d6259c..b94663630aee6 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ping_list/ping_list_header.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ping_list/ping_list_header.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiFlexGroup, EuiFlexItem, EuiTitle } from '@elastic/eui'; import { StatusFilter } from '../../overview/monitor_list/status_filter'; import { FilterGroup } from '../../overview/filter_group/filter_group'; diff --git a/x-pack/plugins/uptime/public/components/monitor/status_details/availability_reporting/availability_reporting.tsx b/x-pack/plugins/uptime/public/components/monitor/status_details/availability_reporting/availability_reporting.tsx index 878752ef3ede5..5ec298ee82a59 100644 --- a/x-pack/plugins/uptime/public/components/monitor/status_details/availability_reporting/availability_reporting.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/status_details/availability_reporting/availability_reporting.tsx @@ -7,7 +7,7 @@ import React, { useState } from 'react'; import { EuiBasicTable, EuiSpacer, Criteria, Pagination } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { StatusTag } from './location_status_tags'; import { TagLabel } from './tag_label'; import { AvailabilityLabel, LastCheckLabel, LocationLabel } from '../translations'; diff --git a/x-pack/plugins/uptime/public/components/monitor/status_details/status_bar/ssl_certificate.tsx b/x-pack/plugins/uptime/public/components/monitor/status_details/status_bar/ssl_certificate.tsx index e4ac37689a7e6..ca47db608451c 100644 --- a/x-pack/plugins/uptime/public/components/monitor/status_details/status_bar/ssl_certificate.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/status_details/status_bar/ssl_certificate.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { Link } from 'react-router-dom'; import { EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Tls, X509Expiry } from '../../../../../common/runtime_types'; import { CERTIFICATES_ROUTE } from '../../../../../common/constants'; import { MonListDescription, MonListTitle } from './status_bar'; diff --git a/x-pack/plugins/uptime/public/components/monitor/status_details/status_bar/status_bar.tsx b/x-pack/plugins/uptime/public/components/monitor/status_details/status_bar/status_bar.tsx index e8374d3792bfe..9b2a9efc3b6c7 100644 --- a/x-pack/plugins/uptime/public/components/monitor/status_details/status_bar/status_bar.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/status_details/status_bar/status_bar.tsx @@ -14,7 +14,7 @@ import { EuiDescriptionListTitle, EuiDescriptionListDescription, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { MonitorSSLCertificate } from './ssl_certificate'; import * as labels from '../translations'; diff --git a/x-pack/plugins/uptime/public/components/monitor/status_details/status_bar/status_by_location.tsx b/x-pack/plugins/uptime/public/components/monitor/status_details/status_bar/status_by_location.tsx index 19682fe40e822..f07508b50e3e5 100644 --- a/x-pack/plugins/uptime/public/components/monitor/status_details/status_bar/status_by_location.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/status_details/status_bar/status_by_location.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiTitle } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { MonitorLocation } from '../../../../../common/runtime_types'; interface StatusByLocationsProps { diff --git a/x-pack/plugins/uptime/public/components/monitor/synthetics/step_detail/step_page_title.tsx b/x-pack/plugins/uptime/public/components/monitor/synthetics/step_detail/step_page_title.tsx index c9e3dc8c3c44f..44a318401a789 100644 --- a/x-pack/plugins/uptime/public/components/monitor/synthetics/step_detail/step_page_title.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/synthetics/step_detail/step_page_title.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; interface Props { stepName: string; diff --git a/x-pack/plugins/uptime/public/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_container.tsx b/x-pack/plugins/uptime/public/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_container.tsx index 95da0ea0a45f6..ffa9cb5f2925f 100644 --- a/x-pack/plugins/uptime/public/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_container.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_container.tsx @@ -7,7 +7,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiText, EuiLoadingChart, EuiCallOut } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useEffect } from 'react'; import { useSelector, useDispatch } from 'react-redux'; import { getNetworkEvents } from '../../../../../state/actions/network_events'; diff --git a/x-pack/plugins/uptime/public/components/monitor/synthetics/waterfall/components/middle_truncated_text.tsx b/x-pack/plugins/uptime/public/components/monitor/synthetics/waterfall/components/middle_truncated_text.tsx index 3e3b08f49d705..11cff8d164858 100644 --- a/x-pack/plugins/uptime/public/components/monitor/synthetics/waterfall/components/middle_truncated_text.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/synthetics/waterfall/components/middle_truncated_text.tsx @@ -6,7 +6,7 @@ */ import React, { useMemo } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, EuiScreenReaderOnly, diff --git a/x-pack/plugins/uptime/public/components/monitor/synthetics/waterfall/components/network_requests_total.tsx b/x-pack/plugins/uptime/public/components/monitor/synthetics/waterfall/components/network_requests_total.tsx index 5ccd60b0ce7a8..fe45c45b13d25 100644 --- a/x-pack/plugins/uptime/public/components/monitor/synthetics/waterfall/components/network_requests_total.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/synthetics/waterfall/components/network_requests_total.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { EuiIconTip } from '@elastic/eui'; import { NetworkRequestsTotalStyle } from './styles'; diff --git a/x-pack/plugins/uptime/public/components/monitor/synthetics/waterfall/components/waterfall_markers.tsx b/x-pack/plugins/uptime/public/components/monitor/synthetics/waterfall/components/waterfall_markers.tsx index d8f6468015ede..1d4ba01d529b4 100644 --- a/x-pack/plugins/uptime/public/components/monitor/synthetics/waterfall/components/waterfall_markers.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/synthetics/waterfall/components/waterfall_markers.tsx @@ -5,116 +5,142 @@ * 2.0. */ -import React from 'react'; +import React, { useMemo } from 'react'; import { AnnotationDomainType, LineAnnotation } from '@elastic/charts'; import { i18n } from '@kbn/i18n'; import { useWaterfallContext } from '..'; import { useTheme } from '../../../../../../../observability/public'; import { euiStyled } from '../../../../../../../../../src/plugins/kibana_react/common'; +import { MarkerItems } from '../context/waterfall_chart'; import { WaterfallMarkerIcon } from './waterfall_marker_icon'; -export const FCP_LABEL = i18n.translate('xpack.uptime.synthetics.waterfall.fcpLabel', { - defaultMessage: 'First contentful paint', -}); +export const FIELD_SYNTHETICS_LCP = 'browser.experience.lcp.us'; +export const FIELD_SYNTHETICS_FCP = 'browser.experience.fcp.us'; +export const FIELD_SYNTHETICS_DOCUMENT_ONLOAD = 'browser.experience.load.us'; +export const FIELD_SYNTHETICS_DCL = 'browser.experience.dcl.us'; +export const LAYOUT_SHIFT = 'layoutShift'; -export const LCP_LABEL = i18n.translate('xpack.uptime.synthetics.waterfall.lcpLabel', { - defaultMessage: 'Largest contentful paint', -}); +export function WaterfallChartMarkers() { + const { markerItems } = useWaterfallContext(); -export const LAYOUT_SHIFT_LABEL = i18n.translate( - 'xpack.uptime.synthetics.waterfall.layoutShiftLabel', - { - defaultMessage: 'Layout shift', - } -); + const theme = useTheme(); -export const LOAD_EVENT_LABEL = i18n.translate('xpack.uptime.synthetics.waterfall.loadEventLabel', { - defaultMessage: 'Load event', -}); + const markerItemsByOffset = useMemo( + () => + (markerItems ?? []).reduce((acc, cur) => { + acc.set(cur.offset, [...(acc.get(cur.offset) ?? []), cur]); + return acc; + }, new Map()), + [markerItems] + ); -export const DOCUMENT_CONTENT_LOADED_LABEL = i18n.translate( - 'xpack.uptime.synthetics.waterfall.domContentLabel', - { - defaultMessage: 'DOM Content Loaded', - } -); + const annotations = useMemo(() => { + return Array.from(markerItemsByOffset.entries()).map(([offset, items]) => { + let uniqueIds = (items ?? []) + .map(({ id }) => id) + .filter((id, index, arr) => arr.indexOf(id) === index); -export const SYNTHETICS_CLS = 'browser.experience.cls'; -export const SYNTHETICS_LCP = 'browser.experience.lcp.us'; -export const SYNTHETICS_FCP = 'browser.experience.fcp.us'; -export const SYNTHETICS_DOCUMENT_ONLOAD = 'browser.experience.load.us'; -export const SYNTHETICS_DCL = 'browser.experience.dcl.us'; + // Omit coinciding layoutShift's with other vital marks + if (uniqueIds.length > 1) { + uniqueIds = uniqueIds.filter((id) => id !== LAYOUT_SHIFT); + } -export function WaterfallChartMarkers() { - const { markerItems } = useWaterfallContext(); + const label = uniqueIds.map((id) => getMarkersInfo(id, theme)?.label ?? id).join(' / '); + const id = uniqueIds[0]; + const markersInfo = getMarkersInfo(id, theme); - const theme = useTheme(); + return { + id, + offset, + label, + field: markersInfo?.field ?? '', + color: markersInfo?.color ?? theme.eui.euiColorMediumShade, + strokeWidth: markersInfo?.strokeWidth ?? 1, + }; + }); + }, [markerItemsByOffset, theme]); if (!markerItems) { return null; } - const markersInfo: Record = { - domContentLoaded: { - label: DOCUMENT_CONTENT_LOADED_LABEL, - color: theme.eui.euiColorVis0, - field: SYNTHETICS_DCL, - }, - firstContentfulPaint: { - label: FCP_LABEL, - color: theme.eui.euiColorVis1, - field: SYNTHETICS_FCP, - }, - largestContentfulPaint: { - label: LCP_LABEL, - color: theme.eui.euiColorVis2, - field: SYNTHETICS_LCP, - }, - layoutShift: { - label: LAYOUT_SHIFT_LABEL, - color: theme.eui.euiColorVis3, - field: SYNTHETICS_CLS, - }, - loadEvent: { - label: LOAD_EVENT_LABEL, - color: theme.eui.euiColorVis9, - field: SYNTHETICS_DOCUMENT_ONLOAD, - }, - }; - return ( - {markerItems.map(({ id, offset }) => ( - - } - style={{ - line: { - strokeWidth: 2, - stroke: markersInfo[id]?.color ?? theme.eui.euiColorMediumShade, - opacity: 1, - }, - }} - /> - ))} + {annotations.map(({ id, offset, label, field, color, strokeWidth }) => { + const key = `${id}-${offset}`; + + return ( + } + style={{ + line: { + strokeWidth, + stroke: color, + opacity: 1, + }, + }} + /> + ); + })} ); } +function getMarkersInfo(id: string, theme: ReturnType) { + switch (id) { + case 'domContentLoaded': + return { + label: DOCUMENT_CONTENT_LOADED_LABEL, + color: theme.eui.euiColorVis0, + field: FIELD_SYNTHETICS_DCL, + strokeWidth: 2, + }; + case 'firstContentfulPaint': + return { + label: FCP_LABEL, + color: theme.eui.euiColorVis1, + field: FIELD_SYNTHETICS_FCP, + strokeWidth: 2, + }; + case 'largestContentfulPaint': + return { + label: LCP_LABEL, + color: theme.eui.euiColorVis2, + field: FIELD_SYNTHETICS_LCP, + strokeWidth: 2, + }; + case 'layoutShift': + return { + label: LAYOUT_SHIFT_LABEL, + color: theme.eui.euiColorVis6, + field: '', + strokeWidth: 1, + }; + case 'loadEvent': + return { + label: LOAD_EVENT_LABEL, + color: theme.eui.euiColorVis9, + field: FIELD_SYNTHETICS_DOCUMENT_ONLOAD, + strokeWidth: 2, + }; + } + + return undefined; +} + const Wrapper = euiStyled.span` &&& { > .echAnnotation__icon { @@ -122,3 +148,29 @@ const Wrapper = euiStyled.span` } } `; + +export const FCP_LABEL = i18n.translate('xpack.uptime.synthetics.waterfall.fcpLabel', { + defaultMessage: 'First contentful paint', +}); + +export const LCP_LABEL = i18n.translate('xpack.uptime.synthetics.waterfall.lcpLabel', { + defaultMessage: 'Largest contentful paint', +}); + +export const LAYOUT_SHIFT_LABEL = i18n.translate( + 'xpack.uptime.synthetics.waterfall.layoutShiftLabel', + { + defaultMessage: 'Layout shift', + } +); + +export const LOAD_EVENT_LABEL = i18n.translate('xpack.uptime.synthetics.waterfall.loadEventLabel', { + defaultMessage: 'Load event', +}); + +export const DOCUMENT_CONTENT_LOADED_LABEL = i18n.translate( + 'xpack.uptime.synthetics.waterfall.domContentLabel', + { + defaultMessage: 'DOM Content Loaded', + } +); diff --git a/x-pack/plugins/uptime/public/components/overview/alerts/anomaly_alert/select_severity.tsx b/x-pack/plugins/uptime/public/components/overview/alerts/anomaly_alert/select_severity.tsx index d7560a2154a05..92ae02972ff62 100644 --- a/x-pack/plugins/uptime/public/components/overview/alerts/anomaly_alert/select_severity.tsx +++ b/x-pack/plugins/uptime/public/components/overview/alerts/anomaly_alert/select_severity.tsx @@ -7,7 +7,7 @@ import React, { Fragment, FC, useState, useEffect } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiHealth, EuiSpacer, EuiSuperSelect, EuiText } from '@elastic/eui'; import { getSeverityColor } from '../../../../../../ml/public'; diff --git a/x-pack/plugins/uptime/public/components/overview/alerts/monitor_status_alert/alert_monitor_status.tsx b/x-pack/plugins/uptime/public/components/overview/alerts/monitor_status_alert/alert_monitor_status.tsx index 8ed4b8f7a0032..c3524dbc78533 100644 --- a/x-pack/plugins/uptime/public/components/overview/alerts/monitor_status_alert/alert_monitor_status.tsx +++ b/x-pack/plugins/uptime/public/components/overview/alerts/monitor_status_alert/alert_monitor_status.tsx @@ -7,7 +7,7 @@ import React, { useCallback, useEffect, useState } from 'react'; import { EuiCallOut, EuiSpacer, EuiHorizontalRule, EuiLoadingSpinner } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { FiltersExpressionsSelect, StatusExpressionSelect } from '../monitor_expressions'; import { AddFilterButton } from './add_filter_btn'; import { OldAlertCallOut } from './old_alert_call_out'; diff --git a/x-pack/plugins/uptime/public/components/overview/alerts/monitor_status_alert/old_alert_call_out.tsx b/x-pack/plugins/uptime/public/components/overview/alerts/monitor_status_alert/old_alert_call_out.tsx index c326ee96099ba..bce33bea4cca3 100644 --- a/x-pack/plugins/uptime/public/components/overview/alerts/monitor_status_alert/old_alert_call_out.tsx +++ b/x-pack/plugins/uptime/public/components/overview/alerts/monitor_status_alert/old_alert_call_out.tsx @@ -7,7 +7,7 @@ import { EuiSpacer, EuiCallOut } from '@elastic/eui'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; interface Props { isOldAlert: boolean; diff --git a/x-pack/plugins/uptime/public/components/overview/alerts/settings_message_expression_popover.tsx b/x-pack/plugins/uptime/public/components/overview/alerts/settings_message_expression_popover.tsx index 93551f016f351..9c373731d7bb5 100644 --- a/x-pack/plugins/uptime/public/components/overview/alerts/settings_message_expression_popover.tsx +++ b/x-pack/plugins/uptime/public/components/overview/alerts/settings_message_expression_popover.tsx @@ -8,7 +8,7 @@ import { EuiLink } from '@elastic/eui'; import { EuiExpression, EuiPopover } from '@elastic/eui'; import React, { useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; interface SettingsMessageExpressionPopoverProps { diff --git a/x-pack/plugins/uptime/public/components/overview/alerts/toggle_alert_flyout_button.tsx b/x-pack/plugins/uptime/public/components/overview/alerts/toggle_alert_flyout_button.tsx index 22193fe4623d6..43678c1dcc677 100644 --- a/x-pack/plugins/uptime/public/components/overview/alerts/toggle_alert_flyout_button.tsx +++ b/x-pack/plugins/uptime/public/components/overview/alerts/toggle_alert_flyout_button.tsx @@ -14,7 +14,7 @@ import { EuiPopover, } from '@elastic/eui'; import React, { useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; import { CLIENT_ALERT_TYPES } from '../../../../common/constants/alerts'; import { ToggleFlyoutTranslations } from './translations'; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/define_connectors.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/define_connectors.tsx index dcc70c16e920b..065e9bd8028c6 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/define_connectors.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/define_connectors.tsx @@ -7,7 +7,7 @@ import React, { useState } from 'react'; import { EuiSwitch, EuiPopover, EuiText, EuiFormRow } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ReactRouterEuiLink } from '../../../common/react_router_helpers'; import { SETTINGS_ROUTE } from '../../../../../common/constants'; import { ENABLE_STATUS_ALERT } from './translations'; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_group.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_group.tsx index 5347558ed347e..ca799f8915a4c 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_group.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_group.tsx @@ -8,7 +8,7 @@ import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import React, { useContext } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { IntegrationLink } from './integration_link'; import { getLegacyApmHref, diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.tsx index 8ab094299a167..7d746afb006c4 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiCallOut, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { LocationLink } from '../../../common/location_link'; import { MonitorStatusRow } from './monitor_status_row'; import { Ping } from '../../../../../common/runtime_types'; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_header.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_header.tsx index 78cb19e183358..c7268dbb358e2 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_header.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_header.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiTitle } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import styled from 'styled-components'; import { StatusFilter } from './status_filter'; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_page_size_select.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_page_size_select.tsx index 84d7e0fc44a95..369bcb124eba0 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_page_size_select.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_page_size_select.tsx @@ -7,7 +7,7 @@ import { EuiButtonEmpty, EuiContextMenuPanel, EuiContextMenuItem, EuiPopover } from '@elastic/eui'; import React, { useState, useEffect } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useUrlParams, UpdateUrlParams } from '../../../hooks'; interface PopoverButtonProps { diff --git a/x-pack/plugins/uptime/public/components/overview/synthetics_callout.tsx b/x-pack/plugins/uptime/public/components/overview/synthetics_callout.tsx index 4e9c3256f1578..2fed30fcb8fc2 100644 --- a/x-pack/plugins/uptime/public/components/overview/synthetics_callout.tsx +++ b/x-pack/plugins/uptime/public/components/overview/synthetics_callout.tsx @@ -8,7 +8,7 @@ import { EuiButton, EuiButtonEmpty, EuiCallOut, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import React, { useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; const SYNTHETICS_CALLOUT_LS_KEY = 'xpack.uptime.syntheticsCallout.display'; const shouldShowSyntheticsCallout = () => { diff --git a/x-pack/plugins/uptime/public/components/settings/add_connector_flyout.tsx b/x-pack/plugins/uptime/public/components/settings/add_connector_flyout.tsx index b2363a1b21f05..99f9310129786 100644 --- a/x-pack/plugins/uptime/public/components/settings/add_connector_flyout.tsx +++ b/x-pack/plugins/uptime/public/components/settings/add_connector_flyout.tsx @@ -6,7 +6,7 @@ */ import React, { useMemo, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useDispatch } from 'react-redux'; import { EuiButtonEmpty } from '@elastic/eui'; import { TriggersAndActionsUIPublicPluginStart } from '../../../../triggers_actions_ui/public'; diff --git a/x-pack/plugins/uptime/public/components/settings/alert_defaults_form.tsx b/x-pack/plugins/uptime/public/components/settings/alert_defaults_form.tsx index bfe7a1eb7f841..1a0cfdda55d51 100644 --- a/x-pack/plugins/uptime/public/components/settings/alert_defaults_form.tsx +++ b/x-pack/plugins/uptime/public/components/settings/alert_defaults_form.tsx @@ -6,7 +6,7 @@ */ import React, { useEffect, useState, useRef, useCallback } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiFormRow, diff --git a/x-pack/plugins/uptime/public/components/settings/certificate_form.tsx b/x-pack/plugins/uptime/public/components/settings/certificate_form.tsx index 1aaa38db9982a..ba167290d308e 100644 --- a/x-pack/plugins/uptime/public/components/settings/certificate_form.tsx +++ b/x-pack/plugins/uptime/public/components/settings/certificate_form.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiFormRow, diff --git a/x-pack/plugins/uptime/public/components/settings/indices_form.tsx b/x-pack/plugins/uptime/public/components/settings/indices_form.tsx index e68b8b869505f..2ad2791f2beba 100644 --- a/x-pack/plugins/uptime/public/components/settings/indices_form.tsx +++ b/x-pack/plugins/uptime/public/components/settings/indices_form.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiDescribedFormGroup, EuiFormRow, diff --git a/x-pack/plugins/uptime/public/components/synthetics/check_steps/step_expanded_row/screenshot_link.tsx b/x-pack/plugins/uptime/public/components/synthetics/check_steps/step_expanded_row/screenshot_link.tsx index 1ba10da6ceace..771c5155910f3 100644 --- a/x-pack/plugins/uptime/public/components/synthetics/check_steps/step_expanded_row/screenshot_link.tsx +++ b/x-pack/plugins/uptime/public/components/synthetics/check_steps/step_expanded_row/screenshot_link.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ReactRouterEuiLink } from '../../../common/react_router_helpers'; import { JourneyStep } from '../../../../../common/runtime_types/ping/synthetics'; import { euiStyled } from '../../../../../../../../src/plugins/kibana_react/common'; diff --git a/x-pack/plugins/uptime/public/components/synthetics/check_steps/step_expanded_row/step_screenshots.tsx b/x-pack/plugins/uptime/public/components/synthetics/check_steps/step_expanded_row/step_screenshots.tsx index f8776f74b780e..873144a21c002 100644 --- a/x-pack/plugins/uptime/public/components/synthetics/check_steps/step_expanded_row/step_screenshots.tsx +++ b/x-pack/plugins/uptime/public/components/synthetics/check_steps/step_expanded_row/step_screenshots.tsx @@ -8,7 +8,7 @@ import moment from 'moment'; import React from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { StepScreenshotDisplay } from '../../step_screenshot_display'; import { JourneyStep } from '../../../../../common/runtime_types/ping/synthetics'; import { euiStyled } from '../../../../../../../../src/plugins/kibana_react/common'; diff --git a/x-pack/plugins/uptime/public/components/synthetics/console_output_event_list.tsx b/x-pack/plugins/uptime/public/components/synthetics/console_output_event_list.tsx index c34344717e3b4..4935c9ec5e3eb 100644 --- a/x-pack/plugins/uptime/public/components/synthetics/console_output_event_list.tsx +++ b/x-pack/plugins/uptime/public/components/synthetics/console_output_event_list.tsx @@ -6,7 +6,7 @@ */ import { EuiCodeBlock, EuiSpacer, EuiTitle } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { FC } from 'react'; import { ConsoleEvent } from './console_event'; import { JourneyStep } from '../../../common/runtime_types/ping'; diff --git a/x-pack/plugins/uptime/public/components/synthetics/empty_journey.tsx b/x-pack/plugins/uptime/public/components/synthetics/empty_journey.tsx index ef9239d80c32e..13fdcfe11b148 100644 --- a/x-pack/plugins/uptime/public/components/synthetics/empty_journey.tsx +++ b/x-pack/plugins/uptime/public/components/synthetics/empty_journey.tsx @@ -6,7 +6,7 @@ */ import { EuiEmptyPrompt } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { FC } from 'react'; interface Props { diff --git a/x-pack/plugins/uptime/public/components/synthetics/step_screenshot_display.tsx b/x-pack/plugins/uptime/public/components/synthetics/step_screenshot_display.tsx index 2a83fc3115ce3..7fde4033c0409 100644 --- a/x-pack/plugins/uptime/public/components/synthetics/step_screenshot_display.tsx +++ b/x-pack/plugins/uptime/public/components/synthetics/step_screenshot_display.tsx @@ -15,7 +15,7 @@ import { } from '@elastic/eui'; import styled from 'styled-components'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React, { useContext, useEffect, useMemo, useRef, useState, FC } from 'react'; import useIntersection from 'react-use/lib/useIntersection'; import { diff --git a/x-pack/plugins/uptime/public/contexts/uptime_settings_context.tsx b/x-pack/plugins/uptime/public/contexts/uptime_settings_context.tsx index dacaeb89a5cc5..63f21a23e30d3 100644 --- a/x-pack/plugins/uptime/public/contexts/uptime_settings_context.tsx +++ b/x-pack/plugins/uptime/public/contexts/uptime_settings_context.tsx @@ -10,6 +10,7 @@ import { UptimeAppProps } from '../apps/uptime_app'; import { CLIENT_DEFAULTS, CONTEXT_DEFAULTS } from '../../common/constants'; import { CommonlyUsedRange } from '../components/common/uptime_date_picker'; import { useGetUrlParams } from '../hooks'; +import { UptimeUiConfig } from '../../common/config'; export interface UptimeSettingsContextValues { basePath: string; @@ -18,6 +19,7 @@ export interface UptimeSettingsContextValues { isApmAvailable: boolean; isInfraAvailable: boolean; isLogsAvailable: boolean; + config: UptimeUiConfig; commonlyUsedRanges?: CommonlyUsedRange[]; } @@ -36,11 +38,19 @@ const defaultContext: UptimeSettingsContextValues = { isApmAvailable: true, isInfraAvailable: true, isLogsAvailable: true, + config: {}, }; export const UptimeSettingsContext = createContext(defaultContext); export const UptimeSettingsContextProvider: React.FC = ({ children, ...props }) => { - const { basePath, isApmAvailable, isInfraAvailable, isLogsAvailable, commonlyUsedRanges } = props; + const { + basePath, + isApmAvailable, + isInfraAvailable, + isLogsAvailable, + commonlyUsedRanges, + config, + } = props; const { dateRangeStart, dateRangeEnd } = useGetUrlParams(); @@ -51,6 +61,7 @@ export const UptimeSettingsContextProvider: React.FC = ({ childr isInfraAvailable, isLogsAvailable, commonlyUsedRanges, + config, dateRangeStart: dateRangeStart ?? DATE_RANGE_START, dateRangeEnd: dateRangeEnd ?? DATE_RANGE_END, }; @@ -62,6 +73,7 @@ export const UptimeSettingsContextProvider: React.FC = ({ childr dateRangeStart, dateRangeEnd, commonlyUsedRanges, + config, ]); return ; diff --git a/x-pack/plugins/uptime/public/hooks/use_telemetry.ts b/x-pack/plugins/uptime/public/hooks/use_telemetry.ts index f5abdb473fb0d..0c97bf7ac972a 100644 --- a/x-pack/plugins/uptime/public/hooks/use_telemetry.ts +++ b/x-pack/plugins/uptime/public/hooks/use_telemetry.ts @@ -14,6 +14,8 @@ export enum UptimePage { Overview = 'Overview', MappingError = 'MappingError', Monitor = 'Monitor', + MonitorAdd = 'AddMonitor', + MonitorEdit = 'EditMonitor', Settings = 'Settings', Certificates = 'Certificates', StepDetail = 'StepDetail', diff --git a/x-pack/plugins/uptime/public/lib/alert_types/alert_messages.tsx b/x-pack/plugins/uptime/public/lib/alert_types/alert_messages.tsx index 8d08bdbb26c91..8e5a3076a154e 100644 --- a/x-pack/plugins/uptime/public/lib/alert_types/alert_messages.tsx +++ b/x-pack/plugins/uptime/public/lib/alert_types/alert_messages.tsx @@ -5,13 +5,18 @@ * 2.0. */ +import type { Observable } from 'rxjs'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; +import type { CoreTheme } from 'kibana/public'; import { toMountPoint } from '../../../../../../src/plugins/kibana_react/public'; import { ActionConnector } from '../../state/alerts/alerts'; -export const simpleAlertEnabled = (defaultActions: ActionConnector[]) => { +export const simpleAlertEnabled = ( + defaultActions: ActionConnector[], + theme$: Observable +) => { return { title: i18n.translate('xpack.uptime.overview.alerts.enabled.success', { defaultMessage: 'Rule successfully enabled ', @@ -23,7 +28,8 @@ export const simpleAlertEnabled = (defaultActions: ActionConnector[]) => { values={{ actionConnectors: {defaultActions.map(({ name }) => name).join(', ')}, }} - /> + />, + { theme$ } ), }; }; diff --git a/x-pack/plugins/uptime/public/lib/helper/rtl_helpers.tsx b/x-pack/plugins/uptime/public/lib/helper/rtl_helpers.tsx index 60ccec84c3bb1..fe7fd0918450b 100644 --- a/x-pack/plugins/uptime/public/lib/helper/rtl_helpers.tsx +++ b/x-pack/plugins/uptime/public/lib/helper/rtl_helpers.tsx @@ -12,7 +12,8 @@ import { render as reactTestLibRender, RenderOptions } from '@testing-library/re import { Router } from 'react-router-dom'; import { createMemoryHistory, History } from 'history'; import { CoreStart } from 'kibana/public'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; +import { EuiPageTemplate } from '@elastic/eui'; import { coreMock } from 'src/core/public/mocks'; // eslint-disable-next-line import/no-extraneous-dependencies import { configure } from '@testing-library/dom'; @@ -83,7 +84,7 @@ const createMockStore = () => { const mockAppUrls: Record = { uptime: '/app/uptime', observability: '/app/observability', - '/integrations/detail/synthetics/overview': '/integrations/detail/synthetics/overview', + '/home#/tutorial/uptimeMonitors': '/home#/tutorial/uptimeMonitors', }; /* default mock core */ @@ -113,6 +114,12 @@ const mockCore: () => Partial = () => { triggersActionsUi: triggersActionsUiMock.createStart(), storage: createMockStore(), data: dataPluginMock.createStartContract(), + observability: { + navigation: { + // @ts-ignore + PageTemplate: EuiPageTemplate, + }, + }, }; return core; diff --git a/x-pack/plugins/uptime/public/pages/add_monitor.tsx b/x-pack/plugins/uptime/public/pages/add_monitor.tsx new file mode 100644 index 0000000000000..10e3d9d6ce29a --- /dev/null +++ b/x-pack/plugins/uptime/public/pages/add_monitor.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; + +export const AddMonitorPage: React.FC = () => { + return null; +}; diff --git a/x-pack/plugins/uptime/public/pages/edit_monitor.tsx b/x-pack/plugins/uptime/public/pages/edit_monitor.tsx new file mode 100644 index 0000000000000..3be1bc7b35d8d --- /dev/null +++ b/x-pack/plugins/uptime/public/pages/edit_monitor.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; + +export const EditMonitorPage: React.FC = () => { + return null; +}; diff --git a/x-pack/plugins/uptime/public/pages/index.ts b/x-pack/plugins/uptime/public/pages/index.ts index 352ceb39123e8..6833a90c8bd82 100644 --- a/x-pack/plugins/uptime/public/pages/index.ts +++ b/x-pack/plugins/uptime/public/pages/index.ts @@ -10,3 +10,5 @@ export { MonitorPage } from './monitor'; export { StepDetailPage } from './synthetics/step_detail_page'; export { SettingsPage } from './settings'; export { NotFoundPage } from './not_found'; +export { AddMonitorPage } from './add_monitor'; +export { EditMonitorPage } from './edit_monitor'; diff --git a/x-pack/plugins/uptime/public/pages/mapping_error.tsx b/x-pack/plugins/uptime/public/pages/mapping_error.tsx index 9c234700136b0..116586b140524 100644 --- a/x-pack/plugins/uptime/public/pages/mapping_error.tsx +++ b/x-pack/plugins/uptime/public/pages/mapping_error.tsx @@ -7,7 +7,7 @@ import { EuiCode, EuiEmptyPrompt, EuiLink, EuiTitle } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; diff --git a/x-pack/plugins/uptime/public/pages/not_found.tsx b/x-pack/plugins/uptime/public/pages/not_found.tsx index 7d61a092d8763..936781323256f 100644 --- a/x-pack/plugins/uptime/public/pages/not_found.tsx +++ b/x-pack/plugins/uptime/public/pages/not_found.tsx @@ -15,7 +15,7 @@ import { } from '@elastic/eui'; import React from 'react'; import { useHistory } from 'react-router-dom'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export const NotFoundPage = () => { const history = useHistory(); diff --git a/x-pack/plugins/uptime/public/pages/settings.tsx b/x-pack/plugins/uptime/public/pages/settings.tsx index 88bae5536c05f..b9745b9a733b1 100644 --- a/x-pack/plugins/uptime/public/pages/settings.tsx +++ b/x-pack/plugins/uptime/public/pages/settings.tsx @@ -15,7 +15,7 @@ import { EuiForm, EuiSpacer, } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useDispatch, useSelector } from 'react-redux'; import { selectDynamicSettings } from '../state/selectors'; import { getDynamicSettings, setDynamicSettings } from '../state/actions/dynamic_settings'; diff --git a/x-pack/plugins/uptime/public/pages/synthetics/checks_navigation.tsx b/x-pack/plugins/uptime/public/pages/synthetics/checks_navigation.tsx index 291019d93c398..435254ad882c4 100644 --- a/x-pack/plugins/uptime/public/pages/synthetics/checks_navigation.tsx +++ b/x-pack/plugins/uptime/public/pages/synthetics/checks_navigation.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { useHistory } from 'react-router-dom'; import moment from 'moment'; import { SyntheticsJourneyApiResponse } from '../../../common/runtime_types/ping'; diff --git a/x-pack/plugins/uptime/public/routes.test.tsx b/x-pack/plugins/uptime/public/routes.test.tsx new file mode 100644 index 0000000000000..5b7815610fe62 --- /dev/null +++ b/x-pack/plugins/uptime/public/routes.test.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +// app.test.js +import { screen } from '@testing-library/react'; +import { render } from './lib/helper/rtl_helpers'; +import { createMemoryHistory } from 'history'; +import React from 'react'; +import * as telemetry from './hooks/use_telemetry'; +import { MONITOR_ADD_ROUTE, MONITOR_EDIT_ROUTE } from '../common/constants'; + +import '@testing-library/jest-dom'; + +import { PageRouter } from './routes'; + +describe('PageRouter', () => { + beforeEach(() => { + jest.spyOn(telemetry, 'useUptimeTelemetry').mockImplementation(() => {}); + }); + it.each([MONITOR_ADD_ROUTE, MONITOR_EDIT_ROUTE])( + 'hides ui monitor management pages when feature flag is not enabled', + (page) => { + const history = createMemoryHistory(); + history.push(page); + render(, { history }); + + expect(screen.getByText(/Page not found/i)).toBeInTheDocument(); + } + ); + + it.each([ + [MONITOR_ADD_ROUTE, 'Add Monitor'], + [MONITOR_EDIT_ROUTE, 'Edit Monitor'], + ])('hides ui monitor management pages when feature flag is not enabled', (page, heading) => { + const history = createMemoryHistory(); + history.push(page); + render(, { + history, + }); + + expect(screen.getByText(heading)).toBeInTheDocument(); + }); +}); diff --git a/x-pack/plugins/uptime/public/routes.tsx b/x-pack/plugins/uptime/public/routes.tsx index 54f2110c88bc4..64d7411f1673d 100644 --- a/x-pack/plugins/uptime/public/routes.tsx +++ b/x-pack/plugins/uptime/public/routes.tsx @@ -7,18 +7,28 @@ import React, { FC, useEffect } from 'react'; import { Route, Switch } from 'react-router-dom'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { CERTIFICATES_ROUTE, MAPPING_ERROR_ROUTE, MONITOR_ROUTE, + MONITOR_ADD_ROUTE, + MONITOR_EDIT_ROUTE, OVERVIEW_ROUTE, SETTINGS_ROUTE, STEP_DETAIL_ROUTE, SYNTHETIC_CHECK_STEPS_ROUTE, } from '../common/constants'; -import { MappingErrorPage, MonitorPage, StepDetailPage, NotFoundPage, SettingsPage } from './pages'; +import { + MappingErrorPage, + MonitorPage, + AddMonitorPage, + EditMonitorPage, + StepDetailPage, + NotFoundPage, + SettingsPage, +} from './pages'; import { CertificatesPage } from './pages/certificates'; import { UptimePage, useUptimeTelemetry } from './hooks'; import { OverviewPageComponent } from './pages/overview'; @@ -41,6 +51,11 @@ import { import { UptimePageTemplateComponent } from './apps/uptime_page_template'; import { apiService } from './state/api/utils'; import { useInspectorContext } from '../../observability/public'; +import { UptimeConfig } from '../common/config'; + +interface PageRouterProps { + config: UptimeConfig; +} interface RouteProps { path: string; @@ -63,109 +78,151 @@ export const MONITORING_OVERVIEW_LABEL = i18n.translate('xpack.uptime.overview.h defaultMessage: 'Monitors', }); -const Routes: RouteProps[] = [ - { - title: i18n.translate('xpack.uptime.monitorRoute.title', { - defaultMessage: 'Monitor | {baseTitle}', - values: { baseTitle }, - }), - path: MONITOR_ROUTE, - component: MonitorPage, - dataTestSubj: 'uptimeMonitorPage', - telemetryId: UptimePage.Monitor, - pageHeader: { - children: , - pageTitle: , - rightSideItems: [], +const getRoutes = (config: UptimeConfig): RouteProps[] => { + return [ + { + title: i18n.translate('xpack.uptime.monitorRoute.title', { + defaultMessage: 'Monitor | {baseTitle}', + values: { baseTitle }, + }), + path: MONITOR_ROUTE, + component: MonitorPage, + dataTestSubj: 'uptimeMonitorPage', + telemetryId: UptimePage.Monitor, + pageHeader: { + children: , + pageTitle: , + rightSideItems: [], + }, }, - }, - { - title: i18n.translate('xpack.uptime.settingsRoute.title', { - defaultMessage: `Settings | {baseTitle}`, - values: { baseTitle }, - }), - path: SETTINGS_ROUTE, - component: SettingsPage, - dataTestSubj: 'uptimeSettingsPage', - telemetryId: UptimePage.Settings, - pageHeader: { - pageTitle: ( - - ), + { + title: i18n.translate('xpack.uptime.settingsRoute.title', { + defaultMessage: `Settings | {baseTitle}`, + values: { baseTitle }, + }), + path: SETTINGS_ROUTE, + component: SettingsPage, + dataTestSubj: 'uptimeSettingsPage', + telemetryId: UptimePage.Settings, + pageHeader: { + pageTitle: ( + + ), + }, }, - }, - { - title: i18n.translate('xpack.uptime.certificatesRoute.title', { - defaultMessage: `Certificates | {baseTitle}`, - values: { baseTitle }, - }), - path: CERTIFICATES_ROUTE, - component: CertificatesPage, - dataTestSubj: 'uptimeCertificatesPage', - telemetryId: UptimePage.Certificates, - pageHeader: { - pageTitle: , - rightSideItems: [], + { + title: i18n.translate('xpack.uptime.certificatesRoute.title', { + defaultMessage: `Certificates | {baseTitle}`, + values: { baseTitle }, + }), + path: CERTIFICATES_ROUTE, + component: CertificatesPage, + dataTestSubj: 'uptimeCertificatesPage', + telemetryId: UptimePage.Certificates, + pageHeader: { + pageTitle: , + rightSideItems: [], + }, }, - }, - { - title: i18n.translate('xpack.uptime.stepDetailRoute.title', { - defaultMessage: 'Synthetics detail | {baseTitle}', - values: { baseTitle }, - }), - path: STEP_DETAIL_ROUTE, - component: StepDetailPage, - dataTestSubj: 'uptimeStepDetailPage', - telemetryId: UptimePage.StepDetail, - pageHeader: { - children: , - pageTitle: , - rightSideItems: [], + { + title: i18n.translate('xpack.uptime.stepDetailRoute.title', { + defaultMessage: 'Synthetics detail | {baseTitle}', + values: { baseTitle }, + }), + path: STEP_DETAIL_ROUTE, + component: StepDetailPage, + dataTestSubj: 'uptimeStepDetailPage', + telemetryId: UptimePage.StepDetail, + pageHeader: { + children: , + pageTitle: , + rightSideItems: [], + }, }, - }, - { - title: baseTitle, - path: SYNTHETIC_CHECK_STEPS_ROUTE, - component: SyntheticsCheckSteps, - dataTestSubj: 'uptimeSyntheticCheckStepsPage', - telemetryId: UptimePage.SyntheticCheckStepsPage, - pageHeader: { - pageTitle: , - rightSideItems: [], + { + title: baseTitle, + path: SYNTHETIC_CHECK_STEPS_ROUTE, + component: SyntheticsCheckSteps, + dataTestSubj: 'uptimeSyntheticCheckStepsPage', + telemetryId: UptimePage.SyntheticCheckStepsPage, + pageHeader: { + pageTitle: , + rightSideItems: [], + }, }, - }, - { - title: baseTitle, - path: OVERVIEW_ROUTE, - component: OverviewPageComponent, - dataTestSubj: 'uptimeOverviewPage', - telemetryId: UptimePage.Overview, - pageHeader: { - pageTitle: MONITORING_OVERVIEW_LABEL, - rightSideItems: [], + { + title: baseTitle, + path: OVERVIEW_ROUTE, + component: OverviewPageComponent, + dataTestSubj: 'uptimeOverviewPage', + telemetryId: UptimePage.Overview, + pageHeader: { + pageTitle: MONITORING_OVERVIEW_LABEL, + rightSideItems: [], + }, }, - }, - { - title: i18n.translate('xpack.uptime.mappingErrorRoute.title', { - defaultMessage: 'Synthetics | mapping error', - }), - path: MAPPING_ERROR_ROUTE, - component: MappingErrorPage, - dataTestSubj: 'uptimeMappingErrorPage', - telemetryId: UptimePage.MappingError, - pageHeader: { - pageTitle: ( -
- -
- ), - rightSideItems: [], + { + title: i18n.translate('xpack.uptime.mappingErrorRoute.title', { + defaultMessage: 'Synthetics | mapping error', + }), + path: MAPPING_ERROR_ROUTE, + component: MappingErrorPage, + dataTestSubj: 'uptimeMappingErrorPage', + telemetryId: UptimePage.MappingError, + pageHeader: { + pageTitle: ( +
+ +
+ ), + rightSideItems: [], + }, }, - }, -]; + ...(config.ui?.unsafe?.monitorManagement?.enabled + ? [ + { + title: i18n.translate('xpack.uptime.addMonitorRoute.title', { + defaultMessage: 'Add Monitor | {baseTitle}', + values: { baseTitle }, + }), + path: MONITOR_ADD_ROUTE, + component: AddMonitorPage, + dataTestSubj: 'uptimeMonitorAddPage', + telemetryId: UptimePage.MonitorAdd, + pageHeader: { + pageTitle: ( + + ), + }, + }, + { + title: i18n.translate('xpack.uptime.editMonitorRoute.title', { + defaultMessage: 'Edit Monitor | {baseTitle}', + values: { baseTitle }, + }), + path: MONITOR_EDIT_ROUTE, + component: EditMonitorPage, + dataTestSubj: 'uptimeMonitorEditPage', + telemetryId: UptimePage.MonitorEdit, + pageHeader: { + pageTitle: ( + + ), + }, + }, + ] + : []), + ]; +}; const RouteInit: React.FC> = ({ path, @@ -179,14 +236,15 @@ const RouteInit: React.FC> = return null; }; -export const PageRouter: FC = () => { +export const PageRouter: FC = ({ config = {} }) => { + const routes = getRoutes(config); const { addInspectorRequest } = useInspectorContext(); apiService.addInspectorRequest = addInspectorRequest; return ( - {Routes.map( + {routes.map( ({ title, path, component: RouteComponent, dataTestSubj, telemetryId, pageHeader }) => (
diff --git a/x-pack/plugins/uptime/public/state/alerts/alerts.ts b/x-pack/plugins/uptime/public/state/alerts/alerts.ts index d5bb34c08966f..cc934a8c68d8b 100644 --- a/x-pack/plugins/uptime/public/state/alerts/alerts.ts +++ b/x-pack/plugins/uptime/public/state/alerts/alerts.ts @@ -151,7 +151,7 @@ export function* fetchAlertsEffect() { yield put(createAlertAction.success(response)); kibanaService.core.notifications.toasts.addSuccess( - simpleAlertEnabled(action.payload.defaultActions) + simpleAlertEnabled(action.payload.defaultActions, kibanaService.theme) ); yield put(getMonitorAlertsAction.get()); } catch (err) { diff --git a/x-pack/plugins/uptime/public/state/api/dynamic_settings.test.ts b/x-pack/plugins/uptime/public/state/api/dynamic_settings.test.ts new file mode 100644 index 0000000000000..46a10144edb08 --- /dev/null +++ b/x-pack/plugins/uptime/public/state/api/dynamic_settings.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { omit } from 'lodash'; +import { apiService } from './utils'; +import { getDynamicSettings } from './dynamic_settings'; +import { HttpSetup } from 'src/core/public'; +import { DynamicSettings } from '../../../common/runtime_types/dynamic_settings'; + +describe('Dynamic Settings API', () => { + let fetchMock: jest.SpyInstance>; + const defaultResponse: DynamicSettings & { _inspect: never[] } = { + heartbeatIndices: 'heartbeat-8*', + certAgeThreshold: 1, + certExpirationThreshold: 1337, + defaultConnectors: [], + _inspect: [], + }; + + beforeEach(() => { + apiService.http = { + get: jest.fn(), + fetch: jest.fn(), + } as unknown as HttpSetup; + + apiService.addInspectorRequest = jest.fn(); + + fetchMock = jest.spyOn(apiService.http, 'fetch'); + }); + + afterEach(() => { + jest.clearAllMocks(); + }); + + it('omits the _inspect prop on the response as decoding', async () => { + fetchMock.mockReturnValue(new Promise((r) => r(defaultResponse))); + + const resp = await getDynamicSettings(); + + expect(resp).toEqual(omit(defaultResponse, ['_inspect'])); + }); +}); diff --git a/x-pack/plugins/uptime/public/state/kibana_service.ts b/x-pack/plugins/uptime/public/state/kibana_service.ts index 53f3379738d5f..6ca2651bf9748 100644 --- a/x-pack/plugins/uptime/public/state/kibana_service.ts +++ b/x-pack/plugins/uptime/public/state/kibana_service.ts @@ -5,12 +5,14 @@ * 2.0. */ -import { CoreStart } from 'kibana/public'; +import type { Observable } from 'rxjs'; +import type { CoreStart, CoreTheme } from 'kibana/public'; import { apiService } from './api/utils'; class KibanaService { private static instance: KibanaService; private _core!: CoreStart; + private _theme!: Observable; public get core() { return this._core; @@ -21,6 +23,14 @@ class KibanaService { apiService.http = this._core.http; } + public get theme() { + return this._theme; + } + + public set theme(coreTheme: Observable) { + this._theme = coreTheme; + } + public get toasts() { return this._core.notifications.toasts; } diff --git a/x-pack/plugins/uptime/server/config.ts b/x-pack/plugins/uptime/server/config.ts deleted file mode 100644 index 1f08d52a25694..0000000000000 --- a/x-pack/plugins/uptime/server/config.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { PluginConfigDescriptor } from 'kibana/server'; -import { schema, TypeOf } from '@kbn/config-schema'; - -export const config: PluginConfigDescriptor = { - schema: schema.maybe( - schema.object({ - index: schema.string(), - }) - ), -}; - -export type UptimeConfig = TypeOf; diff --git a/x-pack/plugins/uptime/server/index.ts b/x-pack/plugins/uptime/server/index.ts index a48ae37d077f9..7c3b2ec345bd6 100644 --- a/x-pack/plugins/uptime/server/index.ts +++ b/x-pack/plugins/uptime/server/index.ts @@ -11,4 +11,4 @@ import { Plugin } from './plugin'; export const plugin = (initializerContext: PluginInitializerContext) => new Plugin(initializerContext); -export { config } from './config'; +export { config } from '../common/config'; diff --git a/x-pack/plugins/uptime/server/kibana.index.ts b/x-pack/plugins/uptime/server/kibana.index.ts index 589b09e5a13d7..131510e62c5d9 100644 --- a/x-pack/plugins/uptime/server/kibana.index.ts +++ b/x-pack/plugins/uptime/server/kibana.index.ts @@ -12,7 +12,7 @@ import { PLUGIN } from '../common/constants/plugin'; import { compose } from './lib/compose/kibana'; import { initUptimeServer } from './uptime_server'; import { UptimeCorePlugins, UptimeCoreSetup } from './lib/adapters/framework'; -import { umDynamicSettings } from './lib/saved_objects'; +import { umDynamicSettings } from './lib/saved_objects/uptime_settings'; import { UptimeRuleRegistry } from './plugin'; export interface KibanaRouteOptions { diff --git a/x-pack/plugins/uptime/server/lib/adapters/framework/adapter_types.ts b/x-pack/plugins/uptime/server/lib/adapters/framework/adapter_types.ts index d5b938d78c864..d9648a8aae575 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/framework/adapter_types.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/framework/adapter_types.ts @@ -18,6 +18,7 @@ import { MlPluginSetup as MlSetup } from '../../../../../ml/server'; import { RuleRegistryPluginSetupContract } from '../../../../../rule_registry/server'; import { UptimeESClient } from '../../lib'; import type { UptimeRouter } from '../../../types'; +import { UptimeConfig } from '../../../../common/config'; export type UMElasticsearchQueryFn = ( params: { @@ -33,6 +34,7 @@ export type UMSavedObjectsQueryFn = ( export interface UptimeCoreSetup { router: UptimeRouter; + config: UptimeConfig; } export interface UptimeCorePlugins { diff --git a/x-pack/plugins/uptime/server/lib/adapters/telemetry/kibana_telemetry_adapter.ts b/x-pack/plugins/uptime/server/lib/adapters/telemetry/kibana_telemetry_adapter.ts index 631bcf1b245db..d829044da5047 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/telemetry/kibana_telemetry_adapter.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/telemetry/kibana_telemetry_adapter.ts @@ -9,7 +9,7 @@ import moment from 'moment'; import { ISavedObjectsRepository, SavedObjectsClientContract } from 'kibana/server'; import { CollectorFetchContext, UsageCollectionSetup } from 'src/plugins/usage_collection/server'; import { PageViewParams, UptimeTelemetry, Usage } from './types'; -import { savedObjectsAdapter } from '../../saved_objects'; +import { savedObjectsAdapter } from '../../saved_objects/saved_objects'; import { UptimeESClient, createUptimeESClient } from '../../lib'; interface UptimeTelemetryCollector { diff --git a/x-pack/plugins/uptime/server/lib/alerts/test_utils/index.ts b/x-pack/plugins/uptime/server/lib/alerts/test_utils/index.ts index daab16a342c4e..bc9aa76cb4a5b 100644 --- a/x-pack/plugins/uptime/server/lib/alerts/test_utils/index.ts +++ b/x-pack/plugins/uptime/server/lib/alerts/test_utils/index.ts @@ -27,7 +27,7 @@ export const bootstrapDependencies = (customRequests?: any, customPlugins: any = const router = {} as UptimeRouter; // these server/libs parameters don't have any functionality, which is fine // because we aren't testing them here - const server: UptimeCoreSetup = { router }; + const server: UptimeCoreSetup = { router, config: {} }; const plugins: UptimeCorePlugins = customPlugins as any; const libs: UMServerLibs = { requests: {} } as UMServerLibs; libs.requests = { ...libs.requests, ...customRequests }; diff --git a/x-pack/plugins/uptime/server/lib/alerts/tls.test.ts b/x-pack/plugins/uptime/server/lib/alerts/tls.test.ts index b069d368b2a39..cc5a13d606e28 100644 --- a/x-pack/plugins/uptime/server/lib/alerts/tls.test.ts +++ b/x-pack/plugins/uptime/server/lib/alerts/tls.test.ts @@ -12,7 +12,7 @@ import { CertResult, DynamicSettings } from '../../../common/runtime_types'; import { createRuleTypeMocks, bootstrapDependencies } from './test_utils'; import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../common/constants'; -import { savedObjectsAdapter, UMSavedObjectsAdapter } from '../saved_objects'; +import { savedObjectsAdapter, UMSavedObjectsAdapter } from '../saved_objects/saved_objects'; /** * This function aims to provide an easy way to give mock props that will diff --git a/x-pack/plugins/uptime/server/lib/alerts/tls.ts b/x-pack/plugins/uptime/server/lib/alerts/tls.ts index 8e49c07f62c42..12b4fdb23a1a1 100644 --- a/x-pack/plugins/uptime/server/lib/alerts/tls.ts +++ b/x-pack/plugins/uptime/server/lib/alerts/tls.ts @@ -17,7 +17,7 @@ import { TlsTranslations } from '../../../common/translations'; import { ActionGroupIdsOf } from '../../../../alerting/common'; -import { savedObjectsAdapter } from '../saved_objects'; +import { savedObjectsAdapter } from '../saved_objects/saved_objects'; import { createUptimeESClient } from '../lib'; export type ActionGroupIds = ActionGroupIdsOf; diff --git a/x-pack/plugins/uptime/server/lib/alerts/tls_legacy.ts b/x-pack/plugins/uptime/server/lib/alerts/tls_legacy.ts index fe49fc8416482..8236af03de85c 100644 --- a/x-pack/plugins/uptime/server/lib/alerts/tls_legacy.ts +++ b/x-pack/plugins/uptime/server/lib/alerts/tls_legacy.ts @@ -18,7 +18,7 @@ import { ActionGroupIdsOf } from '../../../../alerting/common'; import { AlertInstanceContext } from '../../../../alerting/common'; import { AlertInstance } from '../../../../alerting/server'; -import { savedObjectsAdapter } from '../saved_objects'; +import { savedObjectsAdapter } from '../saved_objects/saved_objects'; import { createUptimeESClient } from '../lib'; import { DEFAULT_FROM, diff --git a/x-pack/plugins/uptime/server/lib/lib.ts b/x-pack/plugins/uptime/server/lib/lib.ts index fbd0494a3ca82..151f7b25adc1e 100644 --- a/x-pack/plugins/uptime/server/lib/lib.ts +++ b/x-pack/plugins/uptime/server/lib/lib.ts @@ -16,7 +16,7 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { UMBackendFrameworkAdapter } from './adapters'; import { UMLicenseCheck } from './domains'; import { UptimeRequests } from './requests'; -import { savedObjectsAdapter } from './saved_objects'; +import { savedObjectsAdapter } from './saved_objects/saved_objects'; import { ESSearchResponse } from '../../../../../src/core/types/elasticsearch'; import { RequestStatus } from '../../../../../src/plugins/inspector'; import { getInspectResponse } from '../../../observability/server'; diff --git a/x-pack/plugins/uptime/server/lib/requests/get_certs.test.ts b/x-pack/plugins/uptime/server/lib/requests/get_certs.test.ts index dbbbf5d82c970..2ac31c2c59af7 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_certs.test.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_certs.test.ts @@ -101,6 +101,7 @@ describe('getCerts', () => { size: 30, sortBy: 'not_after', direction: 'desc', + notValidAfter: 'now+100d', }); expect(result).toMatchInlineSnapshot(` Object { @@ -184,6 +185,20 @@ describe('getCerts', () => { }, }, }, + Object { + "bool": Object { + "minimum_should_match": 1, + "should": Array [ + Object { + "range": Object { + "tls.certificate_not_valid_after": Object { + "lte": "now+100d", + }, + }, + }, + ], + }, + }, ], "minimum_should_match": 1, "should": Array [ diff --git a/x-pack/plugins/uptime/server/lib/requests/get_index_pattern.ts b/x-pack/plugins/uptime/server/lib/requests/get_index_pattern.ts index a0eab63492c2d..e79779133e78c 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_index_pattern.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_index_pattern.ts @@ -7,7 +7,7 @@ import { FieldDescriptor, IndexPatternsFetcher } from '../../../../../../src/plugins/data/server'; import { UptimeESClient } from '../lib'; -import { savedObjectsAdapter } from '../saved_objects'; +import { savedObjectsAdapter } from '../saved_objects/saved_objects'; export interface IndexPatternTitleAndFields { title: string; diff --git a/x-pack/plugins/uptime/server/lib/requests/get_monitor_availability.test.ts b/x-pack/plugins/uptime/server/lib/requests/get_monitor_availability.test.ts index ee8386dfce5d7..4133d2a4109b7 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_monitor_availability.test.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_monitor_availability.test.ts @@ -197,6 +197,11 @@ describe('monitor availability', () => { "query": Object { "bool": Object { "filter": Array [ + Object { + "exists": Object { + "field": "summary", + }, + }, Object { "range": Object { "@timestamp": Object { @@ -374,6 +379,11 @@ describe('monitor availability', () => { "query": Object { "bool": Object { "filter": Array [ + Object { + "exists": Object { + "field": "summary", + }, + }, Object { "range": Object { "@timestamp": Object { @@ -688,6 +698,11 @@ describe('monitor availability', () => { "query": Object { "bool": Object { "filter": Array [ + Object { + "exists": Object { + "field": "summary", + }, + }, Object { "range": Object { "@timestamp": Object { @@ -786,6 +801,11 @@ describe('monitor availability', () => { "query": Object { "bool": Object { "filter": Array [ + Object { + "exists": Object { + "field": "summary", + }, + }, Object { "range": Object { "@timestamp": Object { @@ -905,6 +925,11 @@ describe('monitor availability', () => { "query": Object { "bool": Object { "filter": Array [ + Object { + "exists": Object { + "field": "summary", + }, + }, Object { "range": Object { "@timestamp": Object { diff --git a/x-pack/plugins/uptime/server/lib/requests/get_monitor_availability.ts b/x-pack/plugins/uptime/server/lib/requests/get_monitor_availability.ts index 4d51a4857ecaa..2a9bc86db60bc 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_monitor_availability.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_monitor_availability.ts @@ -9,6 +9,7 @@ import { UMElasticsearchQueryFn } from '../adapters'; import { GetMonitorAvailabilityParams, Ping } from '../../../common/runtime_types'; import { asMutableArray } from '../../../common/utils/as_mutable_array'; import { AfterKey } from './get_monitor_status'; +import { UNNAMED_LOCATION } from '../../../common/constants'; export interface AvailabilityKey { monitorId: string; @@ -28,6 +29,7 @@ export const formatBuckets = async (buckets: any[]): Promise ({ ...key, + location: key.location === null ? UNNAMED_LOCATION : (key.location as string), monitorInfo: fields?.hits?.hits?.[0]?._source, up: up_sum.value, down: down_sum.value, @@ -60,6 +62,11 @@ export const getMonitorAvailability: UMElasticsearchQueryFn< query: { bool: { filter: [ + { + exists: { + field: 'summary', + }, + }, { range: { '@timestamp': { diff --git a/x-pack/plugins/uptime/server/lib/requests/get_monitor_status.test.ts b/x-pack/plugins/uptime/server/lib/requests/get_monitor_status.test.ts index 4a790ad2a1e99..fba1f57868e0c 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_monitor_status.test.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_monitor_status.test.ts @@ -105,6 +105,11 @@ describe('getMonitorStatus', () => { "fields": Object { "top_hits": Object { "size": 1, + "sort": Array [ + Object { + "@timestamp": "desc", + }, + ], }, }, }, @@ -141,8 +146,15 @@ describe('getMonitorStatus', () => { "bool": Object { "filter": Array [ Object { - "term": Object { - "monitor.status": "down", + "exists": Object { + "field": "summary", + }, + }, + Object { + "range": Object { + "summary.down": Object { + "gt": "0", + }, }, }, Object { @@ -234,6 +246,11 @@ describe('getMonitorStatus', () => { "fields": Object { "top_hits": Object { "size": 1, + "sort": Array [ + Object { + "@timestamp": "desc", + }, + ], }, }, }, @@ -270,8 +287,15 @@ describe('getMonitorStatus', () => { "bool": Object { "filter": Array [ Object { - "term": Object { - "monitor.status": "down", + "exists": Object { + "field": "summary", + }, + }, + Object { + "range": Object { + "summary.down": Object { + "gt": "0", + }, }, }, Object { @@ -400,6 +424,11 @@ describe('getMonitorStatus', () => { "fields": Object { "top_hits": Object { "size": 1, + "sort": Array [ + Object { + "@timestamp": "desc", + }, + ], }, }, }, @@ -436,8 +465,15 @@ describe('getMonitorStatus', () => { "bool": Object { "filter": Array [ Object { - "term": Object { - "monitor.status": "down", + "exists": Object { + "field": "summary", + }, + }, + Object { + "range": Object { + "summary.down": Object { + "gt": "0", + }, }, }, Object { @@ -559,6 +595,11 @@ describe('getMonitorStatus', () => { "fields": Object { "top_hits": Object { "size": 1, + "sort": Array [ + Object { + "@timestamp": "desc", + }, + ], }, }, }, @@ -595,8 +636,15 @@ describe('getMonitorStatus', () => { "bool": Object { "filter": Array [ Object { - "term": Object { - "monitor.status": "down", + "exists": Object { + "field": "summary", + }, + }, + Object { + "range": Object { + "summary.down": Object { + "gt": "0", + }, }, }, Object { @@ -693,6 +741,11 @@ describe('getMonitorStatus', () => { "fields": Object { "top_hits": Object { "size": 1, + "sort": Array [ + Object { + "@timestamp": "desc", + }, + ], }, }, }, @@ -729,8 +782,15 @@ describe('getMonitorStatus', () => { "bool": Object { "filter": Array [ Object { - "term": Object { - "monitor.status": "down", + "exists": Object { + "field": "summary", + }, + }, + Object { + "range": Object { + "summary.down": Object { + "gt": "0", + }, }, }, Object { diff --git a/x-pack/plugins/uptime/server/lib/requests/get_monitor_status.ts b/x-pack/plugins/uptime/server/lib/requests/get_monitor_status.ts index ab21a12aa735e..81a1e6ba7ca7a 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_monitor_status.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_monitor_status.ts @@ -7,9 +7,13 @@ import { JsonObject } from '@kbn/utility-types'; import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import { PromiseType } from 'utility-types'; import { asMutableArray } from '../../../common/utils/as_mutable_array'; import { UMElasticsearchQueryFn } from '../adapters'; import { Ping } from '../../../common/runtime_types/ping'; +import { createEsQuery } from '../../../common/utils/es_search'; +import { UptimeESClient } from '../lib'; +import { UNNAMED_LOCATION } from '../../../common/constants'; export interface GetMonitorStatusParams { filters?: JsonObject; @@ -41,24 +45,36 @@ const getLocationClause = (locations: string[]) => ({ export type AfterKey = Record | undefined; -export const getMonitorStatus: UMElasticsearchQueryFn< - GetMonitorStatusParams, - GetMonitorStatusResult[] -> = async ({ uptimeEsClient, filters, locations, numTimes, timespanRange, timestampRange }) => { - let afterKey: AfterKey; - - const STATUS = 'down'; - let monitors: any = []; - do { - // today this value is hardcoded. In the future we may support - // multiple status types for this alert, and this will become a parameter - const esParams = { +const executeQueryParams = async ({ + timestampRange, + timespanRange, + filters, + afterKey, + uptimeEsClient, + locations, +}: { + timespanRange: GetMonitorStatusParams['timespanRange']; + timestampRange: GetMonitorStatusParams['timestampRange']; + filters: GetMonitorStatusParams['filters']; + afterKey?: AfterKey; + uptimeEsClient: UptimeESClient; + locations: string[]; +}) => { + const queryParams = createEsQuery({ + body: { query: { bool: { filter: [ { - term: { - 'monitor.status': STATUS, + exists: { + field: 'summary', + }, + }, + { + range: { + 'summary.down': { + gt: '0', + }, }, }, { @@ -121,34 +137,65 @@ export const getMonitorStatus: UMElasticsearchQueryFn< fields: { top_hits: { size: 1, + sort: [{ '@timestamp': 'desc' }], }, }, }, }, }, - }; + }, + }); + + /** + * Perform a logical `and` against the selected location filters. + */ + if (locations.length) { + queryParams.body.query.bool.filter.push(getLocationClause(locations)); + } - /** - * Perform a logical `and` against the selected location filters. - */ - if (locations.length) { - esParams.query.bool.filter.push(getLocationClause(locations)); - } + const { body: result } = await uptimeEsClient.search(queryParams); + const afterKeyRes = result?.aggregations?.monitors?.after_key; + + const monitors = result?.aggregations?.monitors?.buckets || []; + + return { afterKeyRes, monitors }; +}; + +type QueryResponse = PromiseType>; + +export const getMonitorStatus: UMElasticsearchQueryFn< + GetMonitorStatusParams, + GetMonitorStatusResult[] +> = async ({ uptimeEsClient, filters, locations, numTimes, timespanRange, timestampRange }) => { + let afterKey: QueryResponse['afterKeyRes']; + + let monitors: QueryResponse['monitors'] = []; + + do { + // today this value is hardcoded. In the future we may support + // multiple status types for this alert, and this will become a parameter - const { body: result } = await uptimeEsClient.search({ - body: esParams, + const { afterKeyRes, monitors: monitorRes } = await executeQueryParams({ + afterKey, + timespanRange, + timestampRange, + filters, + uptimeEsClient, + locations, }); - afterKey = result?.aggregations?.monitors?.after_key as AfterKey; + afterKey = afterKeyRes; - monitors = monitors.concat(result?.aggregations?.monitors?.buckets || []); + monitors = monitors.concat(monitorRes); } while (afterKey !== undefined); return monitors - .filter((monitor: any) => monitor?.doc_count >= numTimes) - .map(({ key, doc_count: count, fields }: any) => ({ - ...key, + .filter((monitor) => monitor?.doc_count >= numTimes) + .map(({ key, doc_count: count, fields }) => ({ count, + monitorId: key.monitorId as string, + status: key.status as string, + location: key.location === null ? UNNAMED_LOCATION : (key.location as string), monitorInfo: fields?.hits?.hits?.[0]?._source, })); }; diff --git a/x-pack/plugins/uptime/server/lib/saved_objects.ts b/x-pack/plugins/uptime/server/lib/saved_objects.ts deleted file mode 100644 index cf5b86564a714..0000000000000 --- a/x-pack/plugins/uptime/server/lib/saved_objects.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; -import { DYNAMIC_SETTINGS_DEFAULTS } from '../../common/constants'; -import { DynamicSettings } from '../../common/runtime_types'; -import { SavedObjectsType, SavedObjectsErrorHelpers } from '../../../../../src/core/server'; -import { UMSavedObjectsQueryFn } from './adapters'; -import { UptimeConfig } from '../config'; - -export interface UMSavedObjectsAdapter { - config: UptimeConfig; - getUptimeDynamicSettings: UMSavedObjectsQueryFn; - setUptimeDynamicSettings: UMSavedObjectsQueryFn; -} - -export const settingsObjectType = 'uptime-dynamic-settings'; -export const settingsObjectId = 'uptime-dynamic-settings-singleton'; - -export const umDynamicSettings: SavedObjectsType = { - name: settingsObjectType, - hidden: false, - namespaceType: 'single', - mappings: { - dynamic: false, - properties: { - /* Leaving these commented to make it clear that these fields exist, even though we don't want them indexed. - When adding new fields please add them here. If they need to be searchable put them in the uncommented - part of properties. - heartbeatIndices: { - type: 'keyword', - }, - certAgeThreshold: { - type: 'long', - }, - certExpirationThreshold: { - type: 'long', - }, - defaultConnectors: { - type: 'keyword', - }, - */ - }, - }, - management: { - importableAndExportable: true, - icon: 'uptimeApp', - getTitle: () => - i18n.translate('xpack.uptime.uptimeSettings.index', { - defaultMessage: 'Uptime Settings - Index', - }), - }, -}; - -export const savedObjectsAdapter: UMSavedObjectsAdapter = { - config: null, - getUptimeDynamicSettings: async (client): Promise => { - try { - const obj = await client.get(umDynamicSettings.name, settingsObjectId); - return obj?.attributes ?? DYNAMIC_SETTINGS_DEFAULTS; - } catch (getErr) { - const config = savedObjectsAdapter.config; - if (SavedObjectsErrorHelpers.isNotFoundError(getErr)) { - if (config?.index) { - return { ...DYNAMIC_SETTINGS_DEFAULTS, heartbeatIndices: config.index }; - } - return DYNAMIC_SETTINGS_DEFAULTS; - } - throw getErr; - } - }, - setUptimeDynamicSettings: async (client, settings): Promise => { - await client.create(umDynamicSettings.name, settings, { - id: settingsObjectId, - overwrite: true, - }); - }, -}; diff --git a/x-pack/plugins/uptime/server/lib/saved_objects/saved_objects.ts b/x-pack/plugins/uptime/server/lib/saved_objects/saved_objects.ts new file mode 100644 index 0000000000000..7a53a37b804e9 --- /dev/null +++ b/x-pack/plugins/uptime/server/lib/saved_objects/saved_objects.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { + SavedObjectsErrorHelpers, + SavedObjectsServiceSetup, +} from '../../../../../../src/core/server'; +import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../common/constants'; +import { DynamicSettings } from '../../../common/runtime_types'; +import { UMSavedObjectsQueryFn } from '../adapters'; +import { UptimeConfig } from '../../../common/config'; +import { settingsObjectId, umDynamicSettings } from './uptime_settings'; +import { syntheticsMonitor } from './synthetics_monitor'; + +export interface UMSavedObjectsAdapter { + config: UptimeConfig; + getUptimeDynamicSettings: UMSavedObjectsQueryFn; + setUptimeDynamicSettings: UMSavedObjectsQueryFn; +} + +export const registerUptimeSavedObjects = ( + savedObjectsService: SavedObjectsServiceSetup, + config: UptimeConfig +) => { + savedObjectsService.registerType(umDynamicSettings); + + if (config?.unsafe?.service.enabled) { + savedObjectsService.registerType(syntheticsMonitor); + } +}; + +export const savedObjectsAdapter: UMSavedObjectsAdapter = { + config: null, + getUptimeDynamicSettings: async (client): Promise => { + try { + const obj = await client.get(umDynamicSettings.name, settingsObjectId); + return obj?.attributes ?? DYNAMIC_SETTINGS_DEFAULTS; + } catch (getErr) { + const config = savedObjectsAdapter.config; + if (SavedObjectsErrorHelpers.isNotFoundError(getErr)) { + if (config?.index) { + return { ...DYNAMIC_SETTINGS_DEFAULTS, heartbeatIndices: config.index }; + } + return DYNAMIC_SETTINGS_DEFAULTS; + } + throw getErr; + } + }, + setUptimeDynamicSettings: async (client, settings): Promise => { + await client.create(umDynamicSettings.name, settings, { + id: settingsObjectId, + overwrite: true, + }); + }, +}; diff --git a/x-pack/plugins/uptime/server/lib/saved_objects/synthetics_monitor.ts b/x-pack/plugins/uptime/server/lib/saved_objects/synthetics_monitor.ts new file mode 100644 index 0000000000000..88e9ad6f7f0fb --- /dev/null +++ b/x-pack/plugins/uptime/server/lib/saved_objects/synthetics_monitor.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { SavedObjectsType } from 'kibana/server'; +import { i18n } from '@kbn/i18n'; + +export const syntheticsMonitorType = 'synthetics-monitor'; + +export const syntheticsMonitor: SavedObjectsType = { + name: syntheticsMonitorType, + hidden: false, + namespaceType: 'single', + mappings: { + dynamic: false, + properties: { + name: { + type: 'keyword', + }, + id: { + type: 'keyword', + }, + type: { + type: 'keyword', + }, + urls: { + type: 'keyword', + }, + tags: { + type: 'keyword', + }, + }, + }, + management: { + importableAndExportable: true, + icon: 'uptimeApp', + getTitle: (savedObject) => + savedObject.attributes.name + + ' - ' + + i18n.translate('xpack.uptime.syntheticsMonitors', { + defaultMessage: 'Uptime - Monitor', + }), + }, +}; diff --git a/x-pack/plugins/uptime/server/lib/saved_objects/uptime_settings.ts b/x-pack/plugins/uptime/server/lib/saved_objects/uptime_settings.ts new file mode 100644 index 0000000000000..0360b0ed11eb2 --- /dev/null +++ b/x-pack/plugins/uptime/server/lib/saved_objects/uptime_settings.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { SavedObjectsType } from 'kibana/server'; +import { i18n } from '@kbn/i18n'; +export const settingsObjectType = 'uptime-dynamic-settings'; +export const settingsObjectId = 'uptime-dynamic-settings-singleton'; + +export const umDynamicSettings: SavedObjectsType = { + name: settingsObjectType, + hidden: false, + namespaceType: 'single', + mappings: { + dynamic: false, + properties: { + /* Leaving these commented to make it clear that these fields exist, even though we don't want them indexed. + When adding new fields please add them here. If they need to be searchable put them in the uncommented + part of properties. + heartbeatIndices: { + type: 'keyword', + }, + certAgeThreshold: { + type: 'long', + }, + certExpirationThreshold: { + type: 'long', + }, + defaultConnectors: { + type: 'keyword', + }, + */ + }, + }, + management: { + importableAndExportable: true, + icon: 'uptimeApp', + getTitle: () => + i18n.translate('xpack.uptime.uptimeSettings.index', { + defaultMessage: 'Uptime Settings - Index', + }), + }, +}; diff --git a/x-pack/plugins/uptime/server/plugin.ts b/x-pack/plugins/uptime/server/plugin.ts index efb613dfda826..b1b85eb943c81 100644 --- a/x-pack/plugins/uptime/server/plugin.ts +++ b/x-pack/plugins/uptime/server/plugin.ts @@ -16,10 +16,10 @@ import { import { uptimeRuleFieldMap } from '../common/rules/uptime_rule_field_map'; import { initServerWithKibana } from './kibana.index'; import { KibanaTelemetryAdapter, UptimeCorePlugins } from './lib/adapters'; -import { savedObjectsAdapter, umDynamicSettings } from './lib/saved_objects'; +import { registerUptimeSavedObjects, savedObjectsAdapter } from './lib/saved_objects/saved_objects'; import { mappingFromFieldMap } from '../../rule_registry/common/mapping_from_field_map'; import { Dataset } from '../../rule_registry/server'; -import { UptimeConfig } from './config'; +import { UptimeConfig } from '../common/config'; export type UptimeRuleRegistry = ReturnType['ruleRegistry']; @@ -28,7 +28,7 @@ export class Plugin implements PluginType { private initContext: PluginInitializerContext; private logger?: Logger; - constructor(_initializerContext: PluginInitializerContext) { + constructor(_initializerContext: PluginInitializerContext) { this.initContext = _initializerContext; } @@ -54,12 +54,14 @@ export class Plugin implements PluginType { }); initServerWithKibana( - { router: core.http.createRouter() }, + { router: core.http.createRouter(), config }, plugins, ruleDataClient, this.logger ); - core.savedObjects.registerType(umDynamicSettings); + + registerUptimeSavedObjects(core.savedObjects, config); + KibanaTelemetryAdapter.registerUsageCollector( plugins.usageCollection, () => this.savedObjectsClient diff --git a/x-pack/plugins/uptime/server/rest_api/dynamic_settings.ts b/x-pack/plugins/uptime/server/rest_api/dynamic_settings.ts index 5d9947e23cf44..79fe6f67908a6 100644 --- a/x-pack/plugins/uptime/server/rest_api/dynamic_settings.ts +++ b/x-pack/plugins/uptime/server/rest_api/dynamic_settings.ts @@ -11,14 +11,14 @@ import { PathReporter } from 'io-ts/lib/PathReporter'; import { UMServerLibs } from '../lib/lib'; import { DynamicSettings, DynamicSettingsType } from '../../common/runtime_types'; import { UMRestApiRouteFactory } from '.'; -import { savedObjectsAdapter } from '../lib/saved_objects'; +import { savedObjectsAdapter } from '../lib/saved_objects/saved_objects'; import { VALUE_MUST_BE_GREATER_THAN_ZERO, VALUE_MUST_BE_AN_INTEGER, } from '../../common/translations'; import { API_URLS } from '../../common/constants'; -export const createGetDynamicSettingsRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ +export const createGetDynamicSettingsRoute: UMRestApiRouteFactory = (_libs: UMServerLibs) => ({ method: 'GET', path: API_URLS.DYNAMIC_SETTINGS, validate: false, @@ -46,7 +46,7 @@ export const validateCertsValues = ( } }; -export const createPostDynamicSettingsRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ +export const createPostDynamicSettingsRoute: UMRestApiRouteFactory = (_libs: UMServerLibs) => ({ method: 'POST', path: API_URLS.DYNAMIC_SETTINGS, validate: { diff --git a/x-pack/plugins/watcher/public/application/app.tsx b/x-pack/plugins/watcher/public/application/app.tsx index 98d10bce3b6b2..2f8ca489a5787 100644 --- a/x-pack/plugins/watcher/public/application/app.tsx +++ b/x-pack/plugins/watcher/public/application/app.tsx @@ -19,7 +19,7 @@ import { Router, Switch, Route, Redirect, withRouter, RouteComponentProps } from import { EuiPageContent, EuiEmptyPrompt, EuiLink } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { RegisterManagementAppArgs, diff --git a/x-pack/plugins/watcher/public/application/components/page_error/page_error_forbidden.tsx b/x-pack/plugins/watcher/public/application/components/page_error/page_error_forbidden.tsx index 56dc5c7dc22b5..585947bab93f5 100644 --- a/x-pack/plugins/watcher/public/application/components/page_error/page_error_forbidden.tsx +++ b/x-pack/plugins/watcher/public/application/components/page_error/page_error_forbidden.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiEmptyPrompt } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function PageErrorForbidden() { return ( diff --git a/x-pack/plugins/watcher/public/application/components/page_error/page_error_not_exist.tsx b/x-pack/plugins/watcher/public/application/components/page_error/page_error_not_exist.tsx index 0f8fd799e0dd6..58b5f0edcd71c 100644 --- a/x-pack/plugins/watcher/public/application/components/page_error/page_error_not_exist.tsx +++ b/x-pack/plugins/watcher/public/application/components/page_error/page_error_not_exist.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiEmptyPrompt } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; export function PageErrorNotExist({ id }: { id?: string }) { return ( diff --git a/x-pack/plugins/watcher/public/application/sections/watch_edit/components/json_watch_edit/json_watch_edit_form.tsx b/x-pack/plugins/watcher/public/application/sections/watch_edit/components/json_watch_edit/json_watch_edit_form.tsx index c59147d7e7ce6..ce963b30b5d52 100644 --- a/x-pack/plugins/watcher/public/application/sections/watch_edit/components/json_watch_edit/json_watch_edit_form.tsx +++ b/x-pack/plugins/watcher/public/application/sections/watch_edit/components/json_watch_edit/json_watch_edit_form.tsx @@ -19,7 +19,7 @@ import { EuiSpacer, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { XJsonMode } from '@kbn/ace'; import { serializeJsonWatch } from '../../../../../../common/lib/serialization'; diff --git a/x-pack/plugins/watcher/public/application/sections/watch_edit/components/json_watch_edit/json_watch_edit_simulate.tsx b/x-pack/plugins/watcher/public/application/sections/watch_edit/components/json_watch_edit/json_watch_edit_simulate.tsx index 034c0080c852c..788d374df4aba 100644 --- a/x-pack/plugins/watcher/public/application/sections/watch_edit/components/json_watch_edit/json_watch_edit_simulate.tsx +++ b/x-pack/plugins/watcher/public/application/sections/watch_edit/components/json_watch_edit/json_watch_edit_simulate.tsx @@ -23,7 +23,7 @@ import { EuiText, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { XJsonMode } from '@kbn/ace'; const xJsonMode = new XJsonMode(); diff --git a/x-pack/plugins/watcher/public/application/sections/watch_edit/components/json_watch_edit/json_watch_edit_simulate_results.tsx b/x-pack/plugins/watcher/public/application/sections/watch_edit/components/json_watch_edit/json_watch_edit_simulate_results.tsx index a0afa95582e9b..c96070b076e1a 100644 --- a/x-pack/plugins/watcher/public/application/sections/watch_edit/components/json_watch_edit/json_watch_edit_simulate_results.tsx +++ b/x-pack/plugins/watcher/public/application/sections/watch_edit/components/json_watch_edit/json_watch_edit_simulate_results.tsx @@ -18,7 +18,7 @@ import { EuiTitle, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { ExecutedWatchDetails, ExecutedWatchResults, diff --git a/x-pack/plugins/watcher/public/application/sections/watch_edit/components/monitoring_watch_edit/monitoring_watch_edit.tsx b/x-pack/plugins/watcher/public/application/sections/watch_edit/components/monitoring_watch_edit/monitoring_watch_edit.tsx index b00e4dc310e27..c7a2039b713ba 100644 --- a/x-pack/plugins/watcher/public/application/sections/watch_edit/components/monitoring_watch_edit/monitoring_watch_edit.tsx +++ b/x-pack/plugins/watcher/public/application/sections/watch_edit/components/monitoring_watch_edit/monitoring_watch_edit.tsx @@ -8,7 +8,7 @@ import React, { useContext } from 'react'; import { EuiPageContent, EuiEmptyPrompt, EuiLink } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { WatchContext } from '../../watch_context'; import { useAppContext } from '../../../../app_context'; diff --git a/x-pack/plugins/watcher/public/application/sections/watch_edit/components/request_flyout.tsx b/x-pack/plugins/watcher/public/application/sections/watch_edit/components/request_flyout.tsx index 7bb798e21b1af..bb0e1d4ef6429 100644 --- a/x-pack/plugins/watcher/public/application/sections/watch_edit/components/request_flyout.tsx +++ b/x-pack/plugins/watcher/public/application/sections/watch_edit/components/request_flyout.tsx @@ -6,7 +6,7 @@ */ import React, { PureComponent } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiButtonEmpty, diff --git a/x-pack/plugins/watcher/public/application/sections/watch_edit/components/threshold_watch_edit/threshold_watch_action_accordion.tsx b/x-pack/plugins/watcher/public/application/sections/watch_edit/components/threshold_watch_edit/threshold_watch_action_accordion.tsx index 389ec55e82e0b..69fa65ab48645 100644 --- a/x-pack/plugins/watcher/public/application/sections/watch_edit/components/threshold_watch_edit/threshold_watch_action_accordion.tsx +++ b/x-pack/plugins/watcher/public/application/sections/watch_edit/components/threshold_watch_edit/threshold_watch_action_accordion.tsx @@ -22,7 +22,7 @@ import { EuiSpacer, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Action } from '../../../../models/action'; import { WatchHistoryItem } from '../../../../models/watch_history_item'; diff --git a/x-pack/plugins/watcher/public/application/sections/watch_edit/components/threshold_watch_edit/threshold_watch_action_dropdown.tsx b/x-pack/plugins/watcher/public/application/sections/watch_edit/components/threshold_watch_edit/threshold_watch_action_dropdown.tsx index 9d25d0df16f59..2b7e604776b21 100644 --- a/x-pack/plugins/watcher/public/application/sections/watch_edit/components/threshold_watch_edit/threshold_watch_action_dropdown.tsx +++ b/x-pack/plugins/watcher/public/application/sections/watch_edit/components/threshold_watch_edit/threshold_watch_action_dropdown.tsx @@ -18,7 +18,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React, { useContext, useState } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Action } from '../../../../models/action'; import { ACTION_TYPES } from '../../../../../../common/constants'; diff --git a/x-pack/plugins/watcher/public/application/sections/watch_edit/components/threshold_watch_edit/threshold_watch_edit.tsx b/x-pack/plugins/watcher/public/application/sections/watch_edit/components/threshold_watch_edit/threshold_watch_edit.tsx index 667fe6b6fae9d..a4c19827c902a 100644 --- a/x-pack/plugins/watcher/public/application/sections/watch_edit/components/threshold_watch_edit/threshold_watch_edit.tsx +++ b/x-pack/plugins/watcher/public/application/sections/watch_edit/components/threshold_watch_edit/threshold_watch_edit.tsx @@ -28,7 +28,7 @@ import { EuiPageContentBody, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { TIME_UNITS } from '../../../../../../common/constants'; import { serializeThresholdWatch } from '../../../../../../common/lib/serialization'; import { ErrableFormRow, SectionError, Error as ServerError } from '../../../../components'; diff --git a/x-pack/plugins/watcher/public/application/sections/watch_edit/components/threshold_watch_edit/watch_visualization.tsx b/x-pack/plugins/watcher/public/application/sections/watch_edit/components/threshold_watch_edit/watch_visualization.tsx index c995e4a449867..fc6ad7ae4a7d8 100644 --- a/x-pack/plugins/watcher/public/application/sections/watch_edit/components/threshold_watch_edit/watch_visualization.tsx +++ b/x-pack/plugins/watcher/public/application/sections/watch_edit/components/threshold_watch_edit/watch_visualization.tsx @@ -20,7 +20,7 @@ import dateMath from '@elastic/datemath'; import moment from 'moment-timezone'; import { IUiSettingsClient } from 'kibana/public'; import { EuiCallOut, EuiLoadingChart, EuiSpacer, EuiEmptyPrompt, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { VisualizeOptions } from '../../../../models/visualize_options'; import { ThresholdWatch } from '../../../../models/watch/threshold_watch'; diff --git a/x-pack/plugins/watcher/public/application/sections/watch_edit/components/watch_edit.tsx b/x-pack/plugins/watcher/public/application/sections/watch_edit/components/watch_edit.tsx index fa3c7e374f7b5..363060fbfb96c 100644 --- a/x-pack/plugins/watcher/public/application/sections/watch_edit/components/watch_edit.tsx +++ b/x-pack/plugins/watcher/public/application/sections/watch_edit/components/watch_edit.tsx @@ -10,7 +10,7 @@ import { isEqual } from 'lodash'; import { EuiPageContent } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { WATCH_TYPES } from '../../../../../common/constants'; import { BaseWatch } from '../../../../../common/types/watch_types'; diff --git a/x-pack/plugins/watcher/public/application/sections/watch_list/components/watch_list.tsx b/x-pack/plugins/watcher/public/application/sections/watch_list/components/watch_list.tsx index f3f23ac995ea6..b8322c792461e 100644 --- a/x-pack/plugins/watcher/public/application/sections/watch_list/components/watch_list.tsx +++ b/x-pack/plugins/watcher/public/application/sections/watch_list/components/watch_list.tsx @@ -25,7 +25,7 @@ import { EuiPageHeader, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Moment } from 'moment'; import { reactRouterNavigate } from '../../../../../../../../src/plugins/kibana_react/public'; diff --git a/x-pack/plugins/watcher/public/application/sections/watch_status/components/watch_detail.tsx b/x-pack/plugins/watcher/public/application/sections/watch_status/components/watch_detail.tsx index ba172a4bca2b4..90042ee85ad95 100644 --- a/x-pack/plugins/watcher/public/application/sections/watch_status/components/watch_detail.tsx +++ b/x-pack/plugins/watcher/public/application/sections/watch_status/components/watch_detail.tsx @@ -7,7 +7,7 @@ import React, { Fragment, useState, useEffect, useContext } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { EuiInMemoryTable, diff --git a/x-pack/plugins/watcher/public/application/sections/watch_status/components/watch_history.tsx b/x-pack/plugins/watcher/public/application/sections/watch_status/components/watch_history.tsx index b1352017bf2f8..ba591b7da5357 100644 --- a/x-pack/plugins/watcher/public/application/sections/watch_status/components/watch_history.tsx +++ b/x-pack/plugins/watcher/public/application/sections/watch_status/components/watch_history.tsx @@ -7,7 +7,7 @@ import React, { Fragment, useState, useContext } from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { Moment } from 'moment'; import { diff --git a/x-pack/plugins/watcher/public/application/sections/watch_status/components/watch_status.tsx b/x-pack/plugins/watcher/public/application/sections/watch_status/components/watch_status.tsx index 73400b9ccaaa7..0d1c4663ed39f 100644 --- a/x-pack/plugins/watcher/public/application/sections/watch_status/components/watch_status.tsx +++ b/x-pack/plugins/watcher/public/application/sections/watch_status/components/watch_status.tsx @@ -15,7 +15,7 @@ import { EuiPageHeader, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; +import { FormattedMessage } from '@kbn/i18n-react'; import { WatchDetail } from './watch_detail'; import { WatchHistory } from './watch_history'; import { listBreadcrumb, statusBreadcrumb } from '../../../lib/breadcrumbs'; diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/tests/alerting/health.ts b/x-pack/test/alerting_api_integration/security_and_spaces/tests/alerting/health.ts index 21e5c782d185c..601d663a70759 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/tests/alerting/health.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/tests/alerting/health.ts @@ -77,11 +77,22 @@ export default function createFindTests({ getService }: FtrProviderContext) { const { body: health } = await supertestWithoutAuth .get(`${getUrlPrefix(space.id)}/api/alerting/_health`) .auth(user.username, user.password); - expect(health.is_sufficiently_secure).to.eql(true); - expect(health.has_permanent_encryption_key).to.eql(true); - expect(health.alerting_framework_heath.decryption_health.status).to.eql('ok'); - expect(health.alerting_framework_heath.execution_health.status).to.eql('ok'); - expect(health.alerting_framework_heath.read_health.status).to.eql('ok'); + switch (scenario.id) { + case 'no_kibana_privileges at space1': + case 'space_1_all at space2': + expect(health).to.eql({ + statusCode: 403, + error: 'Forbidden', + message: 'Unauthorized to access alerting framework health', + }); + break; + default: + expect(health.is_sufficiently_secure).to.eql(true); + expect(health.has_permanent_encryption_key).to.eql(true); + expect(health.alerting_framework_heath.decryption_health.status).to.eql('ok'); + expect(health.alerting_framework_heath.execution_health.status).to.eql('ok'); + expect(health.alerting_framework_heath.read_health.status).to.eql('ok'); + } }); it('should return error when a rule in the default space is failing', async () => { @@ -116,10 +127,22 @@ export default function createFindTests({ getService }: FtrProviderContext) { const { body: health } = await supertestWithoutAuth .get(`${getUrlPrefix(space.id)}/api/alerting/_health`) .auth(user.username, user.password); - expect(health.alerting_framework_heath.execution_health.status).to.eql('warn'); - expect(health.alerting_framework_heath.execution_health.timestamp).to.eql( - ruleInErrorStatus.execution_status.last_execution_date - ); + + switch (scenario.id) { + case 'no_kibana_privileges at space1': + case 'space_1_all at space2': + expect(health).to.eql({ + statusCode: 403, + error: 'Forbidden', + message: 'Unauthorized to access alerting framework health', + }); + break; + default: + expect(health.alerting_framework_heath.execution_health.status).to.eql('warn'); + expect(health.alerting_framework_heath.execution_health.timestamp).to.eql( + ruleInErrorStatus.execution_status.last_execution_date + ); + } }); }); }); diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/migrations.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/migrations.ts index 250f78c6b2800..f1a9ef5de2bb7 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/migrations.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/migrations.ts @@ -10,6 +10,7 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { getUrlPrefix } from '../../../common/lib'; import { FtrProviderContext } from '../../../common/ftr_provider_context'; import type { RawAlert, RawAlertAction } from '../../../../../plugins/alerting/server/types'; +import { FILEBEAT_7X_INDICATOR_PATH } from '../../../../../plugins/alerting/server/saved_objects/migrations'; // eslint-disable-next-line import/no-default-export export default function createGetTests({ getService }: FtrProviderContext) { @@ -285,5 +286,65 @@ export default function createGetTests({ getService }: FtrProviderContext) { }, ]); }); + + it('8.0 migrates security_solution (Legacy) threat match rules to add default threatIndicatorPath value if missing', async () => { + const response = await es.get<{ + alert: { + params: { + threatIndicatorPath: string; + }; + }; + }>( + { + index: '.kibana', + id: 'alert:ece1ece2-9394-48df-a634-d5457c351ece', + }, + { meta: true } + ); + expect(response.statusCode).to.eql(200); + expect(response.body._source?.alert?.params?.threatIndicatorPath).to.eql( + FILEBEAT_7X_INDICATOR_PATH + ); + }); + + it('8.0 does not migrate security_solution (Legacy) threat match rules if threatIndicatorPath value is present', async () => { + const response = await es.get<{ + alert: { + params: { + threatIndicatorPath: string; + }; + }; + }>( + { + index: '.kibana', + id: 'alert:fce1ece2-9394-48df-a634-d5457c351fce', + }, + { meta: true } + ); + expect(response.statusCode).to.eql(200); + expect(response.body._source?.alert?.params?.threatIndicatorPath).to.eql( + 'custom.indicator.path' + ); + }); + + it('8.0 does not migrate security_solution (Legacy) rules other than threat_match rules if threatIndicatorPath value is missing', async () => { + const response = await es.get<{ + alert: { + params: { + threatIndicatorPath: string; + }; + }; + }>( + { + index: '.kibana', + id: 'alert:1ce1ece2-9394-48df-a634-d5457c3511ce', + }, + { meta: true } + ); + expect(response.statusCode).to.eql(200); + expect(response.body._source?.alert?.params?.threatIndicatorPath).not.to.eql( + FILEBEAT_7X_INDICATOR_PATH + ); + }); }); } diff --git a/x-pack/test/api_integration/apis/maps/get_grid_tile.js b/x-pack/test/api_integration/apis/maps/get_grid_tile.js index a757e7487a4ac..6b96311654d0f 100644 --- a/x-pack/test/api_integration/apis/maps/get_grid_tile.js +++ b/x-pack/test/api_integration/apis/maps/get_grid_tile.js @@ -19,6 +19,7 @@ export default function ({ getService }) { `/api/maps/mvt/getGridTile/3/2/3.pbf\ ?geometryFieldName=geo.coordinates\ &index=logstash-*\ +&gridPrecision=8\ &requestBody=(_source:(excludes:!()),aggs:(avg_of_bytes:(avg:(field:bytes))),fields:!((field:%27@timestamp%27,format:date_time),(field:%27relatedContent.article:modified_time%27,format:date_time),(field:%27relatedContent.article:published_time%27,format:date_time),(field:utc_time,format:date_time)),query:(bool:(filter:!((match_all:()),(range:(%27@timestamp%27:(format:strict_date_optional_time,gte:%272015-09-20T00:00:00.000Z%27,lte:%272015-09-20T01:00:00.000Z%27)))),must:!(),must_not:!(),should:!())),runtime_mappings:(),script_fields:(hour_of_day:(script:(lang:painless,source:%27doc[!%27@timestamp!%27].value.getHour()%27))),size:0,stored_fields:!(%27*%27))\ &requestType=point` ) @@ -80,6 +81,7 @@ export default function ({ getService }) { `/api/maps/mvt/getGridTile/3/2/3.pbf\ ?geometryFieldName=geo.coordinates\ &index=logstash-*\ +&gridPrecision=8\ &requestBody=(_source:(excludes:!()),aggs:(avg_of_bytes:(avg:(field:bytes))),fields:!((field:%27@timestamp%27,format:date_time),(field:%27relatedContent.article:modified_time%27,format:date_time),(field:%27relatedContent.article:published_time%27,format:date_time),(field:utc_time,format:date_time)),query:(bool:(filter:!((match_all:()),(range:(%27@timestamp%27:(format:strict_date_optional_time,gte:%272015-09-20T00:00:00.000Z%27,lte:%272015-09-20T01:00:00.000Z%27)))),must:!(),must_not:!(),should:!())),runtime_mappings:(),script_fields:(hour_of_day:(script:(lang:painless,source:%27doc[!%27@timestamp!%27].value.getHour()%27))),size:0,stored_fields:!(%27*%27))\ &requestType=grid` ) diff --git a/x-pack/test/api_integration/apis/ml/job_audit_messages/clear_messages.ts b/x-pack/test/api_integration/apis/ml/job_audit_messages/clear_messages.ts index e96759c70fcae..d2a2f9a4d02dd 100644 --- a/x-pack/test/api_integration/apis/ml/job_audit_messages/clear_messages.ts +++ b/x-pack/test/api_integration/apis/ml/job_audit_messages/clear_messages.ts @@ -16,6 +16,7 @@ export default ({ getService }: FtrProviderContext) => { const esArchiver = getService('esArchiver'); const supertest = getService('supertestWithoutAuth'); const ml = getService('ml'); + const retry = getService('retry'); let notificationIndices: string[] = []; @@ -57,20 +58,25 @@ export default ({ getService }: FtrProviderContext) => { expect(body.success).to.eql(true); expect(body.last_cleared).to.be.above(timestamp); - const { body: getBody } = await supertest - .get(`/api/ml/job_audit_messages/messages/test_get_job_audit_messages_1`) - .auth(USER.ML_POWERUSER, ml.securityCommon.getPasswordForUser(USER.ML_POWERUSER)) - .set(COMMON_REQUEST_HEADERS) - .expect(200); - - expect(getBody.messages.length).to.eql(1); - - expect(omit(getBody.messages[0], ['timestamp', 'node_name'])).to.eql({ - job_id: 'test_get_job_audit_messages_1', - message: 'Job created', - level: 'info', - job_type: 'anomaly_detector', - cleared: true, + await retry.tryForTime(5000, async () => { + const { body: getBody } = await supertest + .get(`/api/ml/job_audit_messages/messages/test_get_job_audit_messages_1`) + .auth(USER.ML_POWERUSER, ml.securityCommon.getPasswordForUser(USER.ML_POWERUSER)) + .set(COMMON_REQUEST_HEADERS) + .expect(200); + + expect(getBody.messages.length).to.eql( + 1, + `Expected 1 job audit message, got ${JSON.stringify(getBody.messages, null, 2)}` + ); + + expect(omit(getBody.messages[0], ['timestamp', 'node_name'])).to.eql({ + job_id: 'test_get_job_audit_messages_1', + message: 'Job created', + level: 'info', + job_type: 'anomaly_detector', + cleared: true, + }); }); }); diff --git a/x-pack/test/api_integration/apis/ml/job_audit_messages/get_job_audit_messages.ts b/x-pack/test/api_integration/apis/ml/job_audit_messages/get_job_audit_messages.ts index c653f01c1027b..a288a7b491bb6 100644 --- a/x-pack/test/api_integration/apis/ml/job_audit_messages/get_job_audit_messages.ts +++ b/x-pack/test/api_integration/apis/ml/job_audit_messages/get_job_audit_messages.ts @@ -16,6 +16,7 @@ export default ({ getService }: FtrProviderContext) => { const esArchiver = getService('esArchiver'); const supertest = getService('supertestWithoutAuth'); const ml = getService('ml'); + const retry = getService('retry'); describe('get_job_audit_messages', function () { before(async () => { @@ -32,63 +33,81 @@ export default ({ getService }: FtrProviderContext) => { }); it('should fetch all audit messages', async () => { - const { body } = await supertest - .get(`/api/ml/job_audit_messages/messages`) - .auth(USER.ML_POWERUSER, ml.securityCommon.getPasswordForUser(USER.ML_POWERUSER)) - .set(COMMON_REQUEST_HEADERS) - .expect(200); - - expect(body.messages.length).to.eql(2); + await retry.tryForTime(5000, async () => { + const { body } = await supertest + .get(`/api/ml/job_audit_messages/messages`) + .auth(USER.ML_POWERUSER, ml.securityCommon.getPasswordForUser(USER.ML_POWERUSER)) + .set(COMMON_REQUEST_HEADERS) + .expect(200); - const messagesDict = keyBy(body.messages, 'job_id'); + expect(body.messages.length).to.eql( + 2, + `Expected 2 job audit messages, got ${JSON.stringify(body.messages, null, 2)}` + ); + const messagesDict = keyBy(body.messages, 'job_id'); - expect(omit(messagesDict.test_get_job_audit_messages_2, ['timestamp', 'node_name'])).to.eql({ - job_id: 'test_get_job_audit_messages_2', - message: 'Job created', - level: 'info', - job_type: 'anomaly_detector', + expect(omit(messagesDict.test_get_job_audit_messages_2, ['timestamp', 'node_name'])).to.eql( + { + job_id: 'test_get_job_audit_messages_2', + message: 'Job created', + level: 'info', + job_type: 'anomaly_detector', + } + ); + expect(omit(messagesDict.test_get_job_audit_messages_1, ['timestamp', 'node_name'])).to.eql( + { + job_id: 'test_get_job_audit_messages_1', + message: 'Job created', + level: 'info', + job_type: 'anomaly_detector', + } + ); + expect(body.notificationIndices).to.eql(['.ml-notifications-000002']); }); - expect(omit(messagesDict.test_get_job_audit_messages_1, ['timestamp', 'node_name'])).to.eql({ - job_id: 'test_get_job_audit_messages_1', - message: 'Job created', - level: 'info', - job_type: 'anomaly_detector', - }); - expect(body.notificationIndices).to.eql(['.ml-notifications-000002']); }); it('should fetch audit messages for specified job', async () => { - const { body } = await supertest - .get(`/api/ml/job_audit_messages/messages/test_get_job_audit_messages_1`) - .auth(USER.ML_POWERUSER, ml.securityCommon.getPasswordForUser(USER.ML_POWERUSER)) - .set(COMMON_REQUEST_HEADERS) - .expect(200); + await retry.tryForTime(5000, async () => { + const { body } = await supertest + .get(`/api/ml/job_audit_messages/messages/test_get_job_audit_messages_1`) + .auth(USER.ML_POWERUSER, ml.securityCommon.getPasswordForUser(USER.ML_POWERUSER)) + .set(COMMON_REQUEST_HEADERS) + .expect(200); - expect(body.messages.length).to.eql(1); - expect(omit(body.messages[0], ['timestamp', 'node_name'])).to.eql({ - job_id: 'test_get_job_audit_messages_1', - message: 'Job created', - level: 'info', - job_type: 'anomaly_detector', + expect(body.messages.length).to.eql( + 1, + `Expected 1 job audit message, got ${JSON.stringify(body.messages, null, 2)}` + ); + expect(omit(body.messages[0], ['timestamp', 'node_name'])).to.eql({ + job_id: 'test_get_job_audit_messages_1', + message: 'Job created', + level: 'info', + job_type: 'anomaly_detector', + }); + expect(body.notificationIndices).to.eql(['.ml-notifications-000002']); }); - expect(body.notificationIndices).to.eql(['.ml-notifications-000002']); }); it('should fetch audit messages for user with ML read permissions', async () => { - const { body } = await supertest - .get(`/api/ml/job_audit_messages/messages/test_get_job_audit_messages_1`) - .auth(USER.ML_VIEWER, ml.securityCommon.getPasswordForUser(USER.ML_VIEWER)) - .set(COMMON_REQUEST_HEADERS) - .expect(200); + await retry.tryForTime(5000, async () => { + const { body } = await supertest + .get(`/api/ml/job_audit_messages/messages/test_get_job_audit_messages_1`) + .auth(USER.ML_VIEWER, ml.securityCommon.getPasswordForUser(USER.ML_VIEWER)) + .set(COMMON_REQUEST_HEADERS) + .expect(200); - expect(body.messages.length).to.eql(1); - expect(omit(body.messages[0], ['timestamp', 'node_name'])).to.eql({ - job_id: 'test_get_job_audit_messages_1', - message: 'Job created', - level: 'info', - job_type: 'anomaly_detector', + expect(body.messages.length).to.eql( + 1, + `Expected 1 job audit message, got ${JSON.stringify(body.messages, null, 2)}` + ); + expect(omit(body.messages[0], ['timestamp', 'node_name'])).to.eql({ + job_id: 'test_get_job_audit_messages_1', + message: 'Job created', + level: 'info', + job_type: 'anomaly_detector', + }); + expect(body.notificationIndices).to.eql(['.ml-notifications-000002']); }); - expect(body.notificationIndices).to.eql(['.ml-notifications-000002']); }); it('should not allow to fetch audit messages for unauthorized user', async () => { diff --git a/x-pack/test/api_integration/apis/ml/modules/index.ts b/x-pack/test/api_integration/apis/ml/modules/index.ts index c6a75eccfa4c8..c842fdad81bef 100644 --- a/x-pack/test/api_integration/apis/ml/modules/index.ts +++ b/x-pack/test/api_integration/apis/ml/modules/index.ts @@ -10,9 +10,9 @@ import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getService, loadTestFile }: FtrProviderContext) { const esArchiver = getService('esArchiver'); const ml = getService('ml'); - const supertest = getService('supertest'); const fleetPackages = ['apache', 'nginx']; + const installedPackages: string[] = []; describe('modules', function () { before(async () => { @@ -20,15 +20,16 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) { await esArchiver.load('x-pack/test/functional/es_archives/empty_kibana'); // Fleet need to be setup to be able to setup packages - await supertest.post(`/api/fleet/setup`).set({ 'kbn-xsrf': 'some-xsrf-token' }).expect(200); + await ml.testResources.setupFleet(); for (const fleetPackage of fleetPackages) { - await ml.testResources.installFleetPackage(fleetPackage); + const packageWithVersion = await ml.testResources.installFleetPackage(fleetPackage); + installedPackages.push(packageWithVersion); } }); after(async () => { - for (const fleetPackage of fleetPackages) { + for (const fleetPackage of installedPackages) { await ml.testResources.removeFleetPackage(fleetPackage); } await esArchiver.unload('x-pack/test/functional/es_archives/empty_kibana'); diff --git a/x-pack/test/api_integration/apis/uptime/rest/dynamic_settings.ts b/x-pack/test/api_integration/apis/uptime/rest/dynamic_settings.ts index 84e01ecef63d6..bccde2e6d9cb8 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/dynamic_settings.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/dynamic_settings.ts @@ -16,6 +16,7 @@ import { DYNAMIC_SETTINGS_DEFAULTS, API_URLS, } from '../../../../../plugins/uptime/common/constants'; + export default function ({ getService }: FtrProviderContext) { const supertest = getService('supertest'); diff --git a/x-pack/test/api_integration/apis/uptime/rest/index.ts b/x-pack/test/api_integration/apis/uptime/rest/index.ts index a37a4ab8f299d..dc3c00b03f712 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/index.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/index.ts @@ -9,7 +9,7 @@ import { FtrProviderContext } from '../../../ftr_provider_context'; import { settingsObjectId, settingsObjectType, -} from '../../../../../plugins/uptime/server/lib/saved_objects'; +} from '../../../../../plugins/uptime/server/lib/saved_objects/uptime_settings'; export default function ({ getService, loadTestFile }: FtrProviderContext) { const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/apm_api_integration/tests/errors/error_group_list.spec.ts b/x-pack/test/apm_api_integration/tests/errors/error_group_list.spec.ts index 5fc3f70d0d023..ce27183e84ca1 100644 --- a/x-pack/test/apm_api_integration/tests/errors/error_group_list.spec.ts +++ b/x-pack/test/apm_api_integration/tests/errors/error_group_list.spec.ts @@ -13,7 +13,8 @@ import { import { RecursivePartial } from '../../../../plugins/apm/typings/common'; import { FtrProviderContext } from '../../common/ftr_provider_context'; -type ErrorGroups = APIReturnType<'GET /internal/apm/services/{serviceName}/errors'>['errorGroups']; +type ErrorGroups = + APIReturnType<'GET /internal/apm/services/{serviceName}/errors/groups/main_statistics'>['errorGroups']; export default function ApiTest({ getService }: FtrProviderContext) { const registry = getService('registry'); @@ -26,17 +27,18 @@ export default function ApiTest({ getService }: FtrProviderContext) { async function callApi( overrides?: RecursivePartial< - APIClientRequestParamsOf<'GET /internal/apm/services/{serviceName}/errors'>['params'] + APIClientRequestParamsOf<'GET /internal/apm/services/{serviceName}/errors/groups/main_statistics'>['params'] > ) { return await apmApiClient.readUser({ - endpoint: `GET /internal/apm/services/{serviceName}/errors`, + endpoint: 'GET /internal/apm/services/{serviceName}/errors/groups/main_statistics', params: { path: { serviceName, ...overrides?.path }, query: { start: new Date(start).toISOString(), end: new Date(end).toISOString(), environment: 'ENVIRONMENT_ALL', + transactionType: 'request', kuery: '', ...overrides?.query, }, @@ -133,12 +135,12 @@ export default function ApiTest({ getService }: FtrProviderContext) { it('returns correct number of errors', () => { expect(errorGroups.length).to.equal(2); - expect(errorGroups.map((error) => error.message).sort()).to.eql(['error 1', 'error 2']); + expect(errorGroups.map((error) => error.name).sort()).to.eql(['error 1', 'error 2']); }); it('returns correct occurences', () => { const numberOfBuckets = 15; - expect(errorGroups.map((error) => error.occurrenceCount).sort()).to.eql([ + expect(errorGroups.map((error) => error.occurrences).sort()).to.eql([ appleTransaction.failureRate * numberOfBuckets, bananaTransaction.failureRate * numberOfBuckets, ]); diff --git a/x-pack/test/apm_api_integration/tests/feature_controls.spec.ts b/x-pack/test/apm_api_integration/tests/feature_controls.spec.ts index f20aaaff2b23d..64e9ce248b455 100644 --- a/x-pack/test/apm_api_integration/tests/feature_controls.spec.ts +++ b/x-pack/test/apm_api_integration/tests/feature_controls.spec.ts @@ -44,7 +44,7 @@ export default function featureControlsTests({ getService }: FtrProviderContext) { // this doubles as a smoke test for the _inspect query parameter req: { - url: `/internal/apm/services/foo/errors?start=${start}&end=${end}&_inspect=true&environment=ENVIRONMENT_ALL&kuery=`, + url: `/internal/apm/services/foo/errors/groups/main_statistics?start=${start}&end=${end}&_inspect=true&environment=ENVIRONMENT_ALL&transactionType=bar&kuery=`, }, expectForbidden: expect403, expectResponse: expect200, diff --git a/x-pack/test/apm_api_integration/tests/services/error_groups/error_groups_detailed_statistics.spec.ts b/x-pack/test/apm_api_integration/tests/services/error_groups/error_groups_detailed_statistics.spec.ts index e94de1d5410f1..164a613cd2a14 100644 --- a/x-pack/test/apm_api_integration/tests/services/error_groups/error_groups_detailed_statistics.spec.ts +++ b/x-pack/test/apm_api_integration/tests/services/error_groups/error_groups_detailed_statistics.spec.ts @@ -19,7 +19,7 @@ import { config, generateData } from './generate_data'; import { getErrorGroupIds } from './get_error_group_ids'; type ErrorGroupsDetailedStatistics = - APIReturnType<'GET /internal/apm/services/{serviceName}/error_groups/detailed_statistics'>; + APIReturnType<'GET /internal/apm/services/{serviceName}/errors/groups/detailed_statistics'>; export default function ApiTest({ getService }: FtrProviderContext) { const registry = getService('registry'); @@ -32,11 +32,11 @@ export default function ApiTest({ getService }: FtrProviderContext) { async function callApi( overrides?: RecursivePartial< - APIClientRequestParamsOf<'GET /internal/apm/services/{serviceName}/error_groups/detailed_statistics'>['params'] + APIClientRequestParamsOf<'GET /internal/apm/services/{serviceName}/errors/groups/detailed_statistics'>['params'] > ) { return await apmApiClient.readUser({ - endpoint: `GET /internal/apm/services/{serviceName}/error_groups/detailed_statistics`, + endpoint: `GET /internal/apm/services/{serviceName}/errors/groups/detailed_statistics`, params: { path: { serviceName, ...overrides?.path }, query: { diff --git a/x-pack/test/apm_api_integration/tests/services/error_groups/error_groups_main_statistics.spec.ts b/x-pack/test/apm_api_integration/tests/services/error_groups/error_groups_main_statistics.spec.ts index 5774ce4225f5a..cf2a0865b1cbc 100644 --- a/x-pack/test/apm_api_integration/tests/services/error_groups/error_groups_main_statistics.spec.ts +++ b/x-pack/test/apm_api_integration/tests/services/error_groups/error_groups_main_statistics.spec.ts @@ -15,7 +15,7 @@ import { FtrProviderContext } from '../../../common/ftr_provider_context'; import { generateData, config } from './generate_data'; type ErrorGroupsMainStatistics = - APIReturnType<'GET /internal/apm/services/{serviceName}/error_groups/main_statistics'>; + APIReturnType<'GET /internal/apm/services/{serviceName}/errors/groups/main_statistics'>; export default function ApiTest({ getService }: FtrProviderContext) { const registry = getService('registry'); @@ -28,11 +28,11 @@ export default function ApiTest({ getService }: FtrProviderContext) { async function callApi( overrides?: RecursivePartial< - APIClientRequestParamsOf<'GET /internal/apm/services/{serviceName}/error_groups/main_statistics'>['params'] + APIClientRequestParamsOf<'GET /internal/apm/services/{serviceName}/errors/groups/main_statistics'>['params'] > ) { return await apmApiClient.readUser({ - endpoint: `GET /internal/apm/services/{serviceName}/error_groups/main_statistics`, + endpoint: `GET /internal/apm/services/{serviceName}/errors/groups/main_statistics`, params: { path: { serviceName, ...overrides?.path }, query: { @@ -54,8 +54,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { it('handles empty state', async () => { const response = await callApi(); expect(response.status).to.be(200); - expect(response.body.error_groups).to.empty(); - expect(response.body.is_aggregation_accurate).to.eql(true); + expect(response.body.errorGroups).to.empty(); }); } ); @@ -81,8 +80,8 @@ export default function ApiTest({ getService }: FtrProviderContext) { }); it('returns correct number of occurrences', () => { - expect(errorGroupMainStatistics.error_groups.length).to.equal(2); - expect(errorGroupMainStatistics.error_groups.map((error) => error.name).sort()).to.eql([ + expect(errorGroupMainStatistics.errorGroups.length).to.equal(2); + expect(errorGroupMainStatistics.errorGroups.map((error) => error.name).sort()).to.eql([ ERROR_NAME_1, ERROR_NAME_2, ]); @@ -91,7 +90,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { it('returns correct occurences', () => { const numberOfBuckets = 15; expect( - errorGroupMainStatistics.error_groups.map((error) => error.occurrences).sort() + errorGroupMainStatistics.errorGroups.map((error) => error.occurrences).sort() ).to.eql([ PROD_LIST_ERROR_RATE * numberOfBuckets, PROD_ID_ERROR_RATE * numberOfBuckets, @@ -99,7 +98,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { }); it('has same last seen value as end date', () => { - errorGroupMainStatistics.error_groups.map((error) => { + errorGroupMainStatistics.errorGroups.map((error) => { expect(error.lastSeen).to.equal(moment(end).startOf('minute').valueOf()); }); }); diff --git a/x-pack/test/apm_api_integration/tests/services/error_groups/get_error_group_ids.ts b/x-pack/test/apm_api_integration/tests/services/error_groups/get_error_group_ids.ts index cfc0867fdcfb9..a5b7d1a095767 100644 --- a/x-pack/test/apm_api_integration/tests/services/error_groups/get_error_group_ids.ts +++ b/x-pack/test/apm_api_integration/tests/services/error_groups/get_error_group_ids.ts @@ -22,7 +22,7 @@ export async function getErrorGroupIds({ count?: number; }) { const { body } = await apmApiClient.readUser({ - endpoint: `GET /internal/apm/services/{serviceName}/error_groups/main_statistics`, + endpoint: `GET /internal/apm/services/{serviceName}/errors/groups/main_statistics`, params: { path: { serviceName }, query: { @@ -35,5 +35,5 @@ export async function getErrorGroupIds({ }, }); - return take(body.error_groups.map((group) => group.group_id).sort(), count); + return take(body.errorGroups.map((group) => group.groupId).sort(), count); } diff --git a/x-pack/test/examples/search_examples/search_example.ts b/x-pack/test/examples/search_examples/search_example.ts index fb3cef4055e33..949e13ca3b750 100644 --- a/x-pack/test/examples/search_examples/search_example.ts +++ b/x-pack/test/examples/search_examples/search_example.ts @@ -16,12 +16,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const comboBox = getService('comboBox'); const toasts = getService('toasts'); - describe('Search session example', () => { + describe('Search example', () => { const appId = 'searchExamples'; before(async function () { await PageObjects.common.navigateToApp(appId, { insertTimestamp: false }); - await comboBox.set('indexPatternSelector', 'logstash-*'); + await comboBox.setCustom('indexPatternSelector', 'logstash-*'); await comboBox.set('searchBucketField', 'geo.src'); await comboBox.set('searchMetricField', 'memory'); await PageObjects.timePicker.setAbsoluteRange( diff --git a/x-pack/test/examples/search_examples/search_session_example.ts b/x-pack/test/examples/search_examples/search_session_example.ts index e6261f69e14f6..ae191c16da14a 100644 --- a/x-pack/test/examples/search_examples/search_session_example.ts +++ b/x-pack/test/examples/search_examples/search_session_example.ts @@ -14,9 +14,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const log = getService('log'); const es = getService('es'); const searchSessions = getService('searchSessions'); + const comboBox = getService('comboBox'); - // FLAKY: https://github.com/elastic/kibana/issues/118921 - describe.skip('Search session example', () => { + describe('Search session example', () => { const appId = 'searchExamples'; before(async function () { @@ -36,6 +36,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should start search, save session, restore session using "restore" button', async () => { + await comboBox.setCustom('indexPatternSelector', 'logstash-*'); + await comboBox.setCustom('searchMetricField', 'bytes'); await testSubjects.clickWhenNotDisabled('startSearch'); await testSubjects.find('searchResults-1'); await searchSessions.expectState('completed'); diff --git a/x-pack/test/examples/search_examples/search_sessions_cache.ts b/x-pack/test/examples/search_examples/search_sessions_cache.ts index 0da2de46a1f62..4e5374a8c32a3 100644 --- a/x-pack/test/examples/search_examples/search_sessions_cache.ts +++ b/x-pack/test/examples/search_examples/search_sessions_cache.ts @@ -27,13 +27,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { return text; } - // FLAKY: https://github.com/elastic/kibana/issues/116537 - describe.skip('Search session client side cache', () => { + describe('Search session client side cache', () => { const appId = 'searchExamples'; before(async function () { await PageObjects.common.navigateToApp(appId, { insertTimestamp: false }); - await comboBox.set('indexPatternSelector', 'logstash-*'); + await comboBox.setCustom('indexPatternSelector', 'logstash-*'); await comboBox.set('searchBucketField', 'extension.raw'); await comboBox.set('searchMetricField', 'phpmemory'); }); diff --git a/x-pack/test/fleet_api_integration/apis/epm/final_pipeline.ts b/x-pack/test/fleet_api_integration/apis/epm/final_pipeline.ts index 85ebf346aa202..3d413a280b521 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/final_pipeline.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/final_pipeline.ts @@ -101,7 +101,7 @@ export default function (providerContext: FtrProviderContext) { await supertest.post(`/api/fleet/setup`).set('kbn-xsrf', 'xxxx'); const pipelineRes = await es.ingest.getPipeline({ id: FINAL_PIPELINE_ID }); expect(pipelineRes).to.have.property(FINAL_PIPELINE_ID); - expect(pipelineRes[FINAL_PIPELINE_ID].version).to.be(1); + expect(pipelineRes[FINAL_PIPELINE_ID].version).to.be(2); }); it('should correctly setup the final pipeline and apply to fleet managed index template', async () => { diff --git a/x-pack/test/fleet_api_integration/apis/epm/update_assets.ts b/x-pack/test/fleet_api_integration/apis/epm/update_assets.ts index 357345777e52e..032abac4be4de 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/update_assets.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/update_assets.ts @@ -52,7 +52,15 @@ export default function (providerContext: FtrProviderContext) { }, { meta: true } ); + expect(resPolicy.body.all_assets.policy).eql({ + _meta: { + managed: true, + managed_by: 'fleet', + package: { + name: 'all_assets', + }, + }, phases: { hot: { min_age: '1ms', @@ -265,6 +273,8 @@ export default function (providerContext: FtrProviderContext) { name: 'logs-all_assets.test_logs@custom', component_template: { _meta: { + managed: true, + managed_by: 'fleet', package: { name: 'all_assets', }, diff --git a/x-pack/test/functional/apps/dashboard/feature_controls/dashboard_security.ts b/x-pack/test/functional/apps/dashboard/feature_controls/dashboard_security.ts index 1b1aa9abc831a..1873aeffb3884 100644 --- a/x-pack/test/functional/apps/dashboard/feature_controls/dashboard_security.ts +++ b/x-pack/test/functional/apps/dashboard/feature_controls/dashboard_security.ts @@ -499,8 +499,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { }); }); - // FLAKY: https://github.com/elastic/kibana/issues/116881 - describe.skip('no dashboard privileges', () => { + describe('no dashboard privileges', () => { before(async () => { await security.role.create('no_dashboard_privileges_role', { elasticsearch: { diff --git a/x-pack/test/functional/apps/maps/es_geo_grid_source.js b/x-pack/test/functional/apps/maps/es_geo_grid_source.js index 26eabafef7d1f..3a1a9f6bed771 100644 --- a/x-pack/test/functional/apps/maps/es_geo_grid_source.js +++ b/x-pack/test/functional/apps/maps/es_geo_grid_source.js @@ -13,7 +13,7 @@ export default function ({ getPageObjects, getService }) { const DOC_COUNT_PROP_NAME = 'doc_count'; const security = getService('security'); - describe('layer geo grid aggregation source', () => { + describe('geojson vector layer - es geo grid source', () => { const DATA_CENTER_LON = -98; const DATA_CENTER_LAT = 38; @@ -102,69 +102,7 @@ export default function ({ getPageObjects, getService }) { }); } - describe('heatmap', () => { - before(async () => { - await PageObjects.maps.loadSavedMap('geo grid heatmap example'); - }); - - const LAYER_ID = '3xlvm'; - const HEATMAP_PROP_NAME = '__kbn_heatmap_weight__'; - - it('should re-fetch geotile_grid aggregation with refresh timer', async () => { - const beforeRefreshTimerTimestamp = await getRequestTimestamp(); - expect(beforeRefreshTimerTimestamp.length).to.be(24); - await PageObjects.maps.triggerSingleRefresh(1000); - const afterRefreshTimerTimestamp = await getRequestTimestamp(); - expect(beforeRefreshTimerTimestamp).not.to.equal(afterRefreshTimerTimestamp); - }); - - it('should decorate feature properties with scaled doc_count property', async () => { - const mapboxStyle = await PageObjects.maps.getMapboxStyle(); - expect(mapboxStyle.sources[LAYER_ID].data.features.length).to.equal(6); - - mapboxStyle.sources[LAYER_ID].data.features.forEach(({ properties }) => { - expect(properties.hasOwnProperty(HEATMAP_PROP_NAME)).to.be(true); - expect(properties.hasOwnProperty(DOC_COUNT_PROP_NAME)).to.be(true); - }); - }); - - makeRequestTestsForGeoPrecision(LAYER_ID, 4, 2); - - describe('query bar', () => { - before(async () => { - await PageObjects.maps.setAndSubmitQuery('machine.os.raw : "win 8"'); - await PageObjects.maps.setView(0, 0, 0); - }); - - after(async () => { - await PageObjects.maps.setAndSubmitQuery(''); - }); - - it('should apply query to geotile_grid aggregation request', async () => { - const { rawResponse: response } = await PageObjects.maps.getResponse(); - expect(response.aggregations.gridSplit.buckets.length).to.equal(1); - }); - }); - - describe('inspector', () => { - afterEach(async () => { - await inspector.close(); - }); - - it('should contain geotile_grid aggregation elasticsearch request', async () => { - const { rawResponse: response } = await PageObjects.maps.getResponse(); - expect(response.aggregations.gridSplit.buckets.length).to.equal(4); - }); - - it('should not contain any elasticsearch request after layer is deleted', async () => { - await PageObjects.maps.removeLayer('logstash-*'); - const noRequests = await PageObjects.maps.doesInspectorHaveRequests(); - expect(noRequests).to.equal(true); - }); - }); - }); - - describe('vector(grid)', () => { + describe('geo_point', () => { before(async () => { await PageObjects.maps.loadSavedMap('geo grid vector grid example'); }); @@ -227,7 +165,7 @@ export default function ({ getPageObjects, getService }) { }); }); - describe('vector grid with geo_shape', () => { + describe('geo_shape', () => { before(async () => { await PageObjects.maps.loadSavedMap('geo grid vector grid example with shape'); }); diff --git a/x-pack/test/functional/apps/maps/mvt_geotile_grid.js b/x-pack/test/functional/apps/maps/mvt_geotile_grid.js index 929942714ab2e..1e31631471475 100644 --- a/x-pack/test/functional/apps/maps/mvt_geotile_grid.js +++ b/x-pack/test/functional/apps/maps/mvt_geotile_grid.js @@ -31,12 +31,25 @@ export default function ({ getPageObjects, getService }) { await PageObjects.maps.loadSavedMap('MVT geotile grid (style meta from ES)'); const mapboxStyle = await PageObjects.maps.getMapboxStyle(); - //Source should be correct - expect( - mapboxStyle.sources[MB_VECTOR_SOURCE_ID].tiles[0].startsWith( - `/api/maps/mvt/getGridTile/{z}/{x}/{y}.pbf?geometryFieldName=geo.coordinates&index=logstash-*&requestBody=(_source:(excludes:!()),aggs:(max_of_bytes:(max:(field:bytes))),fields:!((field:'@timestamp',format:date_time),(field:'relatedContent.article:modified_time',format:date_time),(field:'relatedContent.article:published_time',format:date_time),(field:utc_time,format:date_time)),query:(bool:(filter:!((range:('@timestamp':(format:strict_date_optional_time,gte:'2015-09-20T00:00:00.000Z',lte:'2015-09-20T01:00:00.000Z')))),must:!(),must_not:!(),should:!())),runtime_mappings:(),script_fields:(hour_of_day:(script:(lang:painless,source:'doc[!'@timestamp!'].value.getHour()'))),size:0,stored_fields:!('*'))&requestType=grid` - ) - ).to.equal(true); + const tileUrl = new URL( + mapboxStyle.sources[MB_VECTOR_SOURCE_ID].tiles[0], + 'http://absolute_path' + ); + const searchParams = Object.fromEntries(tileUrl.searchParams); + + expect(tileUrl.pathname).to.equal('/api/maps/mvt/getGridTile/%7Bz%7D/%7Bx%7D/%7By%7D.pbf'); + + // token is an unique id that changes between runs + expect(typeof searchParams.token).to.equal('string'); + delete searchParams.token; + + expect(searchParams).to.eql({ + geometryFieldName: 'geo.coordinates', + index: 'logstash-*', + gridPrecision: 8, + requestType: 'grid', + requestBody: `(_source:(excludes:!()),aggs:(max_of_bytes:(max:(field:bytes))),fields:!((field:'@timestamp',format:date_time),(field:'relatedContent.article:modified_time',format:date_time),(field:'relatedContent.article:published_time',format:date_time),(field:utc_time,format:date_time)),query:(bool:(filter:!((range:('@timestamp':(format:strict_date_optional_time,gte:'2015-09-20T00:00:00.000Z',lte:'2015-09-20T01:00:00.000Z')))),must:!(),must_not:!(),should:!())),runtime_mappings:(),script_fields:(hour_of_day:(script:(lang:painless,source:'doc[!'@timestamp!'].value.getHour()'))),size:0,stored_fields:!('*'))`, + }); //Should correctly load meta for style-rule (sigma is set to 1, opacity to 1) const fillLayer = mapboxStyle.layers.find( @@ -169,5 +182,35 @@ export default function ({ getPageObjects, getService }) { 'fill-opacity': 0.75, }); }); + + it('should render heatmap layer', async () => { + await PageObjects.maps.loadSavedMap('geo grid heatmap example'); + const mapboxStyle = await PageObjects.maps.getMapboxStyle(); + + const heatmapLayer = mapboxStyle.layers.find((layer) => layer.id === '3xlvm_heatmap'); + + expect(heatmapLayer.paint).to.eql({ + 'heatmap-radius': 128, + 'heatmap-color': [ + 'interpolate', + ['linear'], + ['heatmap-density'], + 0, + 'rgba(0, 0, 255, 0)', + 0.1, + 'rgb(65, 105, 225)', + 0.28, + 'rgb(0, 256, 256)', + 0.45999999999999996, + 'rgb(0, 256, 0)', + 0.64, + 'rgb(256, 256, 0)', + 0.82, + 'rgb(256, 0, 0)', + ], + 'heatmap-opacity': 0.75, + 'heatmap-weight': ['/', ['get', '_count'], 1], + }); + }); }); } diff --git a/x-pack/test/functional/apps/ml/anomaly_detection/anomaly_explorer.ts b/x-pack/test/functional/apps/ml/anomaly_detection/anomaly_explorer.ts index 2804ca7ba7a7b..4373da71512e4 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection/anomaly_explorer.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection/anomaly_explorer.ts @@ -63,8 +63,7 @@ export default function ({ getService }: FtrProviderContext) { const ml = getService('ml'); const elasticChart = getService('elasticChart'); - // FLAKY: https://github.com/elastic/kibana/issues/118584 - describe.skip('anomaly explorer', function () { + describe('anomaly explorer', function () { this.tags(['mlqa']); before(async () => { await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/farequote'); diff --git a/x-pack/test/functional/apps/monitoring/elasticsearch/nodes.js b/x-pack/test/functional/apps/monitoring/elasticsearch/nodes.js index d7c4e5dd12f52..80c8c13b16ddf 100644 --- a/x-pack/test/functional/apps/monitoring/elasticsearch/nodes.js +++ b/x-pack/test/functional/apps/monitoring/elasticsearch/nodes.js @@ -17,7 +17,8 @@ export default function ({ getService, getPageObjects }) { // FF issue: https://github.com/elastic/kibana/issues/35551 this.tags(['skipFirefox']); - describe('with offline node', () => { + // FLAKY: https://github.com/elastic/kibana/issues/116533 + describe.skip('with offline node', () => { const { setup, tearDown } = getLifecycleMethods(getService, getPageObjects); before(async () => { diff --git a/x-pack/test/functional/apps/spaces/enter_space.ts b/x-pack/test/functional/apps/spaces/enter_space.ts index 7a3ffc50a4821..229da6aa708f5 100644 --- a/x-pack/test/functional/apps/spaces/enter_space.ts +++ b/x-pack/test/functional/apps/spaces/enter_space.ts @@ -14,9 +14,10 @@ export default function enterSpaceFunctonalTests({ const esArchiver = getService('esArchiver'); const PageObjects = getPageObjects(['security', 'spaceSelector']); - // FLAKY: https://github.com/elastic/kibana/issues/100570 - describe.skip('Enter Space', function () { - this.tags('includeFirefox'); + describe('Enter Space', function () { + // FLAKY: https://github.com/elastic/kibana/issues/100570 + // These tests fail very intermittently in Firefox. Skip Firefox testing until resolved. + // this.tags('includeFirefox'); before(async () => { await esArchiver.load('x-pack/test/functional/es_archives/spaces/enter_space'); await PageObjects.security.forceLogout(); diff --git a/x-pack/test/functional/apps/uptime/index.ts b/x-pack/test/functional/apps/uptime/index.ts index ef5a4e576da88..79e0fbd56e39e 100644 --- a/x-pack/test/functional/apps/uptime/index.ts +++ b/x-pack/test/functional/apps/uptime/index.ts @@ -9,7 +9,7 @@ import { FtrProviderContext } from '../../ftr_provider_context'; import { settingsObjectId, settingsObjectType, -} from '../../../../plugins/uptime/server/lib/saved_objects'; +} from '../../../../plugins/uptime/server/lib/saved_objects/uptime_settings'; const ARCHIVE = 'x-pack/test/functional/es_archives/uptime/full_heartbeat'; diff --git a/x-pack/test/functional/es_archives/alerts/data.json b/x-pack/test/functional/es_archives/alerts/data.json index 880a81a8fc209..c40137fa4b5a6 100644 --- a/x-pack/test/functional/es_archives/alerts/data.json +++ b/x-pack/test/functional/es_archives/alerts/data.json @@ -492,3 +492,124 @@ } } } + +{ + "type": "doc", + "value": { + "id": "alert:ece1ece2-9394-48df-a634-d5457c351ece", + "index": ".kibana_1", + "source": { + "alert" : { + "name" : "test addition of default threat_indicator_path", + "alertTypeId" : "siem.signals", + "consumer" : "alertsFixture", + "params" : { + "type": "threat_match" + }, + "schedule" : { + "interval" : "1m" + }, + "enabled" : true, + "actions" : [ ], + "throttle" : null, + "apiKeyOwner" : null, + "apiKey" : null, + "createdBy" : "elastic", + "updatedBy" : "elastic", + "createdAt" : "2021-07-27T20:42:55.896Z", + "muteAll" : false, + "mutedInstanceIds" : [ ], + "scheduledTaskId" : null, + "tags": [] + }, + "type" : "alert", + "migrationVersion" : { + "alert" : "7.8.0" + }, + "updated_at" : "2021-08-13T23:00:11.985Z", + "references": [ + ] + } + } +} + +{ + "type": "doc", + "value": { + "id": "alert:fce1ece2-9394-48df-a634-d5457c351fce", + "index": ".kibana_1", + "source": { + "alert" : { + "name" : "test addition of default threat_indicator_path", + "alertTypeId" : "siem.signals", + "consumer" : "alertsFixture", + "params" : { + "type": "threat_match", + "threatIndicatorPath": "custom.indicator.path" + }, + "schedule" : { + "interval" : "1m" + }, + "enabled" : true, + "actions" : [ ], + "throttle" : null, + "apiKeyOwner" : null, + "apiKey" : null, + "createdBy" : "elastic", + "updatedBy" : "elastic", + "createdAt" : "2021-07-27T20:42:55.896Z", + "muteAll" : false, + "mutedInstanceIds" : [ ], + "scheduledTaskId" : null, + "tags": [] + }, + "type" : "alert", + "migrationVersion" : { + "alert" : "7.8.0" + }, + "updated_at" : "2021-08-13T23:00:11.985Z", + "references": [ + ] + } + } +} + +{ + "type": "doc", + "value": { + "id": "alert:1ce1ece2-9394-48df-a634-d5457c3511ce", + "index": ".kibana_1", + "source": { + "alert" : { + "name" : "test addition of default threat_indicator_path", + "alertTypeId" : "siem.signals", + "consumer" : "alertsFixture", + "params" : { + "type": "eql" + }, + "schedule" : { + "interval" : "1m" + }, + "enabled" : true, + "actions" : [ ], + "throttle" : null, + "apiKeyOwner" : null, + "apiKey" : null, + "createdBy" : "elastic", + "updatedBy" : "elastic", + "createdAt" : "2021-07-27T20:42:55.896Z", + "muteAll" : false, + "mutedInstanceIds" : [ ], + "scheduledTaskId" : null, + "tags": [] + }, + "type" : "alert", + "migrationVersion" : { + "alert" : "7.8.0" + }, + "updated_at" : "2021-08-13T23:00:11.985Z", + "references": [ + ] + } + } +} diff --git a/x-pack/test/functional/page_objects/tag_management_page.ts b/x-pack/test/functional/page_objects/tag_management_page.ts index 8b85bc89b1181..55e587c3c16f3 100644 --- a/x-pack/test/functional/page_objects/tag_management_page.ts +++ b/x-pack/test/functional/page_objects/tag_management_page.ts @@ -245,8 +245,15 @@ export class TagManagementPageObject extends FtrService { private readonly header = this.ctx.getPageObject('header'); private readonly settings = this.ctx.getPageObject('settings'); - public readonly tagModal = new TagModal(this.ctx, this); - public readonly assignFlyout = new TagAssignmentFlyout(this.ctx, this); + public readonly tagModal: TagModal; + public readonly assignFlyout: TagAssignmentFlyout; + + constructor(ctx: FtrProviderContext) { + super(ctx); + + this.tagModal = new TagModal(this.ctx, this); + this.assignFlyout = new TagAssignmentFlyout(this.ctx, this); + } /** * Navigate to the tag management section, by accessing the management app, then clicking diff --git a/x-pack/test/functional/services/ml/anomaly_explorer.ts b/x-pack/test/functional/services/ml/anomaly_explorer.ts index 4392de7ee5567..22032799020ad 100644 --- a/x-pack/test/functional/services/ml/anomaly_explorer.ts +++ b/x-pack/test/functional/services/ml/anomaly_explorer.ts @@ -9,7 +9,11 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; -export function MachineLearningAnomalyExplorerProvider({ getService }: FtrProviderContext) { +export function MachineLearningAnomalyExplorerProvider({ + getPageObject, + getService, +}: FtrProviderContext) { + const dashboardPage = getPageObject('dashboard'); const retry = getService('retry'); const testSubjects = getService('testSubjects'); @@ -83,9 +87,16 @@ export function MachineLearningAnomalyExplorerProvider({ getService }: FtrProvid }, async addAndEditSwimlaneInDashboard(dashboardTitle: string) { - await this.filterDashboardSearchWithSearchString(dashboardTitle); - await this.selectAllDashboards(); - await testSubjects.clickWhenNotDisabled('mlAddAndEditDashboardButton'); + await retry.tryForTime(30 * 1000, async () => { + await this.filterDashboardSearchWithSearchString(dashboardTitle); + await this.selectAllDashboards(); + await this.waitForAddAndEditDashboardButtonEnabled(); + await testSubjects.clickWhenNotDisabled('mlAddAndEditDashboardButton'); + + // make sure the dashboard page actually loaded + const dashboardItemCount = await dashboardPage.getSharedItemsCount(); + expect(dashboardItemCount).to.not.eql(undefined); + }); // changing to the dashboard app might take sime time const embeddable = await testSubjects.find('mlAnomalySwimlaneEmbeddableWrapper', 30 * 1000); const swimlane = await embeddable.findByClassName('mlSwimLaneContainer'); @@ -100,7 +111,14 @@ export function MachineLearningAnomalyExplorerProvider({ getService }: FtrProvid }, async waitForDashboardsToLoad() { - await testSubjects.existOrFail('~mlDashboardSelectionTable', { timeout: 60 * 1000 }); + await testSubjects.existOrFail('mlDashboardSelectionTable loaded', { timeout: 60 * 1000 }); + }, + + async waitForAddAndEditDashboardButtonEnabled() { + await retry.tryForTime(3000, async () => { + const isEnabled = await testSubjects.isEnabled('mlAddAndEditDashboardButton'); + expect(isEnabled).to.eql(true, 'Button to add and edit dashboard should be enabled'); + }); }, async filterDashboardSearchWithSearchString(filter: string) { @@ -109,6 +127,7 @@ export function MachineLearningAnomalyExplorerProvider({ getService }: FtrProvid await searchBarInput.clearValueWithKeyboard(); await searchBarInput.type(filter); await this.assertDashboardSearchInputValue(filter); + await this.waitForDashboardsToLoad(); }, async assertDashboardSearchInputValue(expectedSearchValue: string) { @@ -122,9 +141,11 @@ export function MachineLearningAnomalyExplorerProvider({ getService }: FtrProvid async selectAllDashboards() { await retry.tryForTime(3000, async () => { - await testSubjects.clickWhenNotDisabled('mlDashboardSelectionTable > checkboxSelectAll'); + await testSubjects.clickWhenNotDisabled( + 'mlDashboardSelectionTable loaded > checkboxSelectAll' + ); expect( - await testSubjects.isChecked('mlDashboardSelectionTable > checkboxSelectAll') + await testSubjects.isChecked('mlDashboardSelectionTable loaded > checkboxSelectAll') ).to.eql(true, 'Checkbox to select all dashboards should be selected'); }); }, diff --git a/x-pack/test/functional/services/ml/custom_urls.ts b/x-pack/test/functional/services/ml/custom_urls.ts index 3d26236741a8a..1695b575e1f05 100644 --- a/x-pack/test/functional/services/ml/custom_urls.ts +++ b/x-pack/test/functional/services/ml/custom_urls.ts @@ -16,6 +16,7 @@ export function MachineLearningCustomUrlsProvider({ getService, getPageObjects, }: FtrProviderContext) { + const browser = getService('browser'); const testSubjects = getService('testSubjects'); const retry = getService('retry'); const comboBox = getService('comboBox'); @@ -169,6 +170,9 @@ export function MachineLearningCustomUrlsProvider({ async assertDiscoverCustomUrlAction(expectedHitCountFormatted: string) { await PageObjects.discover.waitForDiscoverAppOnScreen(); + // Make sure all existing popovers are closed + await browser.pressKeys(browser.keys.ESCAPE); + // During cloud tests, the small browser width might cause hit count to be invisible // so temporarily collapsing the sidebar ensures the count shows await PageObjects.discover.closeSidebar(); diff --git a/x-pack/test/functional/services/ml/test_resources.ts b/x-pack/test/functional/services/ml/test_resources.ts index affd317d22e81..7546aa39ab6fd 100644 --- a/x-pack/test/functional/services/ml/test_resources.ts +++ b/x-pack/test/functional/services/ml/test_resources.ts @@ -462,26 +462,34 @@ export function MachineLearningTestResourcesProvider({ getService }: FtrProvider log.debug('> ML saved objects deleted.'); }, - async installFleetPackage(packageName: string) { + async setupFleet() { + log.debug(`Setting up Fleet`); + await retry.tryForTime(2 * 60 * 1000, async () => { + await supertest.post(`/api/fleet/setup`).set(COMMON_REQUEST_HEADERS).expect(200); + }); + log.debug(` > Setup done`); + }, + + async installFleetPackage(packageName: string): Promise { log.debug(`Installing Fleet package '${packageName}'`); const version = await this.getFleetPackageVersion(packageName); + const packageWithVersion = `${packageName}-${version}`; await supertest - .post(`/api/fleet/epm/packages/${packageName}-${version}`) + .post(`/api/fleet/epm/packages/${packageWithVersion}`) .set(COMMON_REQUEST_HEADERS) .expect(200); log.debug(` > Installed`); + return packageWithVersion; }, - async removeFleetPackage(packageName: string) { - log.debug(`Removing Fleet package '${packageName}'`); - - const version = await this.getFleetPackageVersion(packageName); + async removeFleetPackage(packageWithVersion: string) { + log.debug(`Removing Fleet package '${packageWithVersion}'`); await supertest - .delete(`/api/fleet/epm/packages/${packageName}-${version}`) + .delete(`/api/fleet/epm/packages/${packageWithVersion}`) .set(COMMON_REQUEST_HEADERS) .expect(200); @@ -490,21 +498,25 @@ export function MachineLearningTestResourcesProvider({ getService }: FtrProvider async getFleetPackageVersion(packageName: string): Promise { log.debug(`Fetching version for Fleet package '${packageName}'`); + let packageVersion = ''; - const { body } = await supertest - .get(`/api/fleet/epm/packages?experimental=true`) - .set(COMMON_REQUEST_HEADERS) - .expect(200); + await retry.tryForTime(10 * 1000, async () => { + const { body } = await supertest + .get(`/api/fleet/epm/packages?experimental=true`) + .set(COMMON_REQUEST_HEADERS) + .expect(200); - const packageVersion = - body.response.find( - ({ name, version }: { name: string; version: string }) => name === packageName && version - )?.version ?? ''; + packageVersion = + body.response.find( + ({ name, version }: { name: string; version: string }) => + name === packageName && version + )?.version ?? ''; - expect(packageVersion).to.not.eql( - '', - `Fleet package definition for '${packageName}' should exist and have a version` - ); + expect(packageVersion).to.not.eql( + '', + `Fleet package definition for '${packageName}' should exist and have a version` + ); + }); log.debug(` > found version '${packageVersion}'`); return packageVersion; diff --git a/x-pack/test/functional/services/user_menu.js b/x-pack/test/functional/services/user_menu.js index b69f853249e41..e3f589386fc2e 100644 --- a/x-pack/test/functional/services/user_menu.js +++ b/x-pack/test/functional/services/user_menu.js @@ -45,7 +45,7 @@ export function UserMenuProvider({ getService }) { await retry.try(async () => { await testSubjects.click('userMenuButton'); - await testSubjects.existOrFail('userMenu'); + await testSubjects.existOrFail('userMenu', { timeout: 2500 }); }); } })(); diff --git a/x-pack/test/functional_execution_context/config.ts b/x-pack/test/functional_execution_context/config.ts index 456d31b586ad0..6c7935593a18d 100644 --- a/x-pack/test/functional_execution_context/config.ts +++ b/x-pack/test/functional_execution_context/config.ts @@ -55,6 +55,10 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { '--logging.loggers[1].name=execution_context', '--logging.loggers[1].level=debug', `--logging.loggers[1].appenders=${JSON.stringify(['file'])}`, + + '--logging.loggers[2].name=http.server.response', + '--logging.loggers[2].level=all', + `--logging.loggers[2].appenders=${JSON.stringify(['file'])}`, ], }, }; diff --git a/x-pack/test/functional_execution_context/fixtures/plugins/alerts/server/plugin.ts b/x-pack/test/functional_execution_context/fixtures/plugins/alerts/server/plugin.ts index ec4e3ef99c6df..20e0adbf5dacd 100644 --- a/x-pack/test/functional_execution_context/fixtures/plugins/alerts/server/plugin.ts +++ b/x-pack/test/functional_execution_context/fixtures/plugins/alerts/server/plugin.ts @@ -6,7 +6,7 @@ */ import apmAgent from 'elastic-apm-node'; -import { Plugin, CoreSetup } from 'kibana/server'; +import type { Plugin, CoreSetup } from 'kibana/server'; import { PluginSetupContract as AlertingPluginSetup } from '../../../../../../plugins/alerting/server/plugin'; import { EncryptedSavedObjectsPluginStart } from '../../../../../../plugins/encrypted_saved_objects/server'; import { PluginSetupContract as FeaturesPluginSetup } from '../../../../../../plugins/features/server'; @@ -93,10 +93,14 @@ export class FixturePlugin implements Plugin { + // Kibana might set transactiopnSampleRate < 1.0 on CI, so we need to + // enforce transaction creation to prevent the test from failing. const transaction = apmAgent.startTransaction(); const subscription = req.events.completed$.subscribe(() => { - transaction?.end(); - subscription.unsubscribe(); + setTimeout(() => { + transaction?.end(); + subscription.unsubscribe(); + }, 1_000); }); await ctx.core.elasticsearch.client.asInternalUser.ping(); diff --git a/x-pack/test/functional_execution_context/tests/log_correlation.ts b/x-pack/test/functional_execution_context/tests/log_correlation.ts index 80bb2285a665e..fddaf282b7a7f 100644 --- a/x-pack/test/functional_execution_context/tests/log_correlation.ts +++ b/x-pack/test/functional_execution_context/tests/log_correlation.ts @@ -14,23 +14,46 @@ export default function ({ getService }: FtrProviderContext) { describe('Log Correlation', () => { it('Emits "trace.id" into the logs', async () => { - const response1 = await supertest - .get('/emit_log_with_trace_id') - .set('x-opaque-id', 'myheader1'); - + const response1 = await supertest.get('/emit_log_with_trace_id'); + expect(response1.status).to.be(200); expect(response1.body.traceId).to.be.a('string'); const response2 = await supertest.get('/emit_log_with_trace_id'); + expect(response2.status).to.be(200); expect(response1.body.traceId).to.be.a('string'); expect(response2.body.traceId).not.to.be(response1.body.traceId); + let responseTraceId: string | undefined; await assertLogContains({ - description: 'traceId included in the Kibana logs', - predicate: (record) => + description: 'traceId included in the http logs', + predicate: (record) => { // we don't check trace.id value since trace.id in the test plugin and Kibana are different on CI. // because different 'elastic-apm-node' instaces are imported - Boolean(record.http?.request?.id?.includes('myheader1') && record.trace?.id), + if ( + record.log?.logger === 'http.server.response' && + record.url?.path === '/emit_log_with_trace_id' + ) { + responseTraceId = record.trace?.id; + return true; + } + return false; + }, + retry, + }); + + expect(responseTraceId).to.be.a('string'); + + await assertLogContains({ + description: 'elasticsearch logs have the same traceId', + predicate: (record) => + Boolean( + record.log?.logger === 'elasticsearch.query.data' && + record.trace?.id === responseTraceId && + // esClient.ping() request + record.message?.includes('HEAD /') + ), + retry, }); }); diff --git a/x-pack/test/observability_functional/apps/observability/alerts/index.ts b/x-pack/test/observability_functional/apps/observability/alerts/index.ts index 2b760b65a1c46..bd5f2ada4990d 100644 --- a/x-pack/test/observability_functional/apps/observability/alerts/index.ts +++ b/x-pack/test/observability_functional/apps/observability/alerts/index.ts @@ -163,7 +163,7 @@ export default ({ getService }: FtrProviderContext) => { 'Oct 19, 2021 @ 15:00:41.555', '20 minutes', '5', - '30.73', + '30.727896995708154', 'Failed transaction rate threshold', ]; diff --git a/x-pack/test/observability_functional/apps/observability/alerts/table_storage.ts b/x-pack/test/observability_functional/apps/observability/alerts/table_storage.ts new file mode 100644 index 0000000000000..649465f6a0173 --- /dev/null +++ b/x-pack/test/observability_functional/apps/observability/alerts/table_storage.ts @@ -0,0 +1,67 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import expect from '@kbn/expect'; + +import { FtrProviderContext } from '../../../ftr_provider_context'; + +export default ({ getService, getPageObject }: FtrProviderContext) => { + describe('Observability alert table state storage', function () { + this.tags('includeFirefox'); + + const observability = getService('observability'); + const esArchiver = getService('esArchiver'); + const testSubjects = getService('testSubjects'); + + before(async () => { + await esArchiver.load('x-pack/test/functional/es_archives/observability/alerts'); + await esArchiver.load('x-pack/test/functional/es_archives/infra/metrics_and_logs'); + + await observability.alerts.common.navigateToTimeWithData(); + }); + + after(async () => { + await esArchiver.unload('x-pack/test/functional/es_archives/infra/metrics_and_logs'); + await esArchiver.unload('x-pack/test/functional/es_archives/observability/alerts'); + }); + + it('remembers column changes', async () => { + const durationColumnButton = await testSubjects.find( + 'dataGridHeaderCellActionButton-kibana.alert.duration.us' + ); + await durationColumnButton.click(); + const columnMenu = await testSubjects.find( + 'dataGridHeaderCellActionGroup-kibana.alert.duration.us' + ); + const removeButton = await columnMenu.findByCssSelector('[title="Remove column"]'); + await removeButton.click(); + + await observability.alerts.common.navigateToTimeWithData(); + + const durationColumnExists = await testSubjects.exists( + 'dataGridHeaderCellActionButton-kibana.alert.duration.us' + ); + + expect(durationColumnExists).to.be(false); + }); + + it('remembers sorting changes', async () => { + const timestampColumnButton = await testSubjects.find( + 'dataGridHeaderCellActionButton-@timestamp' + ); + await timestampColumnButton.click(); + const columnMenu = await testSubjects.find('dataGridHeaderCellActionGroup-@timestamp'); + const sortButton = await columnMenu.findByCssSelector('[title="Sort Old-New"]'); + await sortButton.click(); + + await observability.alerts.common.navigateToTimeWithData(); + + const timestampColumnHeading = await testSubjects.find('dataGridHeaderCell-@timestamp'); + expect(await timestampColumnHeading.getAttribute('aria-sort')).to.be('ascending'); + }); + }); +}; diff --git a/x-pack/test/observability_functional/apps/observability/index.ts b/x-pack/test/observability_functional/apps/observability/index.ts index f2483e5f1401b..bc78fa138c39b 100644 --- a/x-pack/test/observability_functional/apps/observability/index.ts +++ b/x-pack/test/observability_functional/apps/observability/index.ts @@ -19,5 +19,6 @@ export default function ({ loadTestFile }: FtrProviderContext) { loadTestFile(require.resolve('./alerts/add_to_case')); loadTestFile(require.resolve('./alerts/state_synchronization')); loadTestFile(require.resolve('./alerts/bulk_actions')); + loadTestFile(require.resolve('./alerts/table_storage')); }); } diff --git a/x-pack/test/plugin_api_integration/test_suites/task_manager/health_route.ts b/x-pack/test/plugin_api_integration/test_suites/task_manager/health_route.ts index b79583b8fe5d7..abed8ac85f0dd 100644 --- a/x-pack/test/plugin_api_integration/test_suites/task_manager/health_route.ts +++ b/x-pack/test/plugin_api_integration/test_suites/task_manager/health_route.ts @@ -109,7 +109,8 @@ export default function ({ getService }: FtrProviderContext) { const monitoredAggregatedStatsRefreshRate = 5000; - describe('health', () => { + // FLAKY: https://github.com/elastic/kibana/issues/119258 + describe.skip('health', () => { it('should return basic configuration of task manager', async () => { const health = await getHealth(); expect(health.status).to.eql('OK'); diff --git a/x-pack/test/plugin_functional/plugins/resolver_test/public/applications/resolver_test/index.tsx b/x-pack/test/plugin_functional/plugins/resolver_test/public/applications/resolver_test/index.tsx index 47535e1aa9a58..148b82f613a67 100644 --- a/x-pack/test/plugin_functional/plugins/resolver_test/public/applications/resolver_test/index.tsx +++ b/x-pack/test/plugin_functional/plugins/resolver_test/public/applications/resolver_test/index.tsx @@ -12,7 +12,7 @@ import ReactDOM from 'react-dom'; import { AppMountParameters, CoreStart } from 'kibana/public'; import { useMemo } from 'react'; import styled from 'styled-components'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { KibanaContextProvider } from '../../../../../../../../src/plugins/kibana_react/public'; import { DataAccessLayer, diff --git a/x-pack/test/plugin_functional/plugins/timelines_test/public/applications/timelines_test/index.tsx b/x-pack/test/plugin_functional/plugins/timelines_test/public/applications/timelines_test/index.tsx index f756838fbd24c..c034ba1612a2c 100644 --- a/x-pack/test/plugin_functional/plugins/timelines_test/public/applications/timelines_test/index.tsx +++ b/x-pack/test/plugin_functional/plugins/timelines_test/public/applications/timelines_test/index.tsx @@ -9,7 +9,7 @@ import { Router } from 'react-router-dom'; import React, { useCallback, useRef } from 'react'; import ReactDOM from 'react-dom'; import { AppMountParameters, CoreStart } from 'kibana/public'; -import { I18nProvider } from '@kbn/i18n/react'; +import { I18nProvider } from '@kbn/i18n-react'; import { KibanaContextProvider } from '../../../../../../../../src/plugins/kibana_react/public'; import { EuiThemeProvider } from '../../../../../../../../src/plugins/kibana_react/common'; import { TimelinesUIStart } from '../../../../../../../plugins/timelines/public'; diff --git a/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts b/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts index 88462a2872fe4..61773aaf825fa 100644 --- a/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts +++ b/x-pack/test/security_solution_endpoint/apps/endpoint/policy_details.ts @@ -540,12 +540,16 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { // Fleet has its own form inputs, like description. When those are updated, the changes // are also dispatched to the embedded endpoint Policy form. Update to the Endpoint Policy // form after that should preserve the changes done on the Fleet form + // NOTE: A few delays were added below due to sporadic failures of this test case (see #100236) + const sleep = (ms = 100) => new Promise((resolve) => setTimeout(resolve, ms)); // Wait for the endpoint form to load and then update the policy description await testSubjects.existOrFail('endpointIntegrationPolicyForm'); + await sleep(); // Allow forms to sync await pageObjects.ingestManagerCreatePackagePolicy.setPackagePolicyDescription( 'protect everything' ); + await sleep(); // Allow forms to sync const winDnsEventingCheckbox = await testSubjects.find('policyWindowsEvent_dns'); await pageObjects.ingestManagerCreatePackagePolicy.scrollToCenterOfWindow( diff --git a/x-pack/test/security_solution_endpoint/services/endpoint.ts b/x-pack/test/security_solution_endpoint/services/endpoint.ts index f59aa5e5f5990..dbc2c165577c7 100644 --- a/x-pack/test/security_solution_endpoint/services/endpoint.ts +++ b/x-pack/test/security_solution_endpoint/services/endpoint.ts @@ -12,7 +12,6 @@ import { metadataCurrentIndexPattern, metadataTransformPrefix, } from '../../../plugins/security_solution/common/endpoint/constants'; -import { EndpointError } from '../../../plugins/security_solution/server'; import { deleteIndexedHostsAndAlerts, IndexedHostsAndAlertsResponse, @@ -22,6 +21,7 @@ import { TransformConfigUnion } from '../../../plugins/transform/common/types/tr import { GetTransformsResponseSchema } from '../../../plugins/transform/common/api_schemas/transforms'; import { catchAndWrapError } from '../../../plugins/security_solution/server/endpoint/utils'; import { installOrUpgradeEndpointFleetPackage } from '../../../plugins/security_solution/common/endpoint/data_loaders/setup_fleet_for_endpoint'; +import { EndpointError } from '../../../plugins/security_solution/common/endpoint/errors'; export class EndpointTestResources extends FtrService { private readonly esClient = this.ctx.getService('es'); diff --git a/x-pack/test/security_solution_endpoint/services/endpoint_policy.ts b/x-pack/test/security_solution_endpoint/services/endpoint_policy.ts index f718390dc291a..7383ef80d49c2 100644 --- a/x-pack/test/security_solution_endpoint/services/endpoint_policy.ts +++ b/x-pack/test/security_solution_endpoint/services/endpoint_policy.ts @@ -24,7 +24,7 @@ import { Immutable } from '../../../plugins/security_solution/common/endpoint/ty // NOTE: import path below should be the deep path to the actual module - else we get CI errors import { pkgKeyFromPackageInfo } from '../../../plugins/fleet/public/services/pkg_key_from_package_info'; -import { EndpointError } from '../../../plugins/security_solution/server'; +import { EndpointError } from '../../../plugins/security_solution/common/endpoint/errors'; const INGEST_API_ROOT = '/api/fleet'; const INGEST_API_AGENT_POLICIES = `${INGEST_API_ROOT}/agent_policies`; diff --git a/x-pack/test/tsconfig.json b/x-pack/test/tsconfig.json index 1ffe3834d782d..752bf09d96df0 100644 --- a/x-pack/test/tsconfig.json +++ b/x-pack/test/tsconfig.json @@ -29,7 +29,7 @@ { "path": "../../src/plugins/es_ui_shared/tsconfig.json" }, { "path": "../../src/plugins/expressions/tsconfig.json" }, { "path": "../../src/plugins/home/tsconfig.json" }, - { "path": "../../src/plugins/index_pattern_management/tsconfig.json" }, + { "path": "../../src/plugins/data_view_management/tsconfig.json" }, { "path": "../../src/plugins/kibana_overview/tsconfig.json" }, { "path": "../../src/plugins/kibana_react/tsconfig.json" }, { "path": "../../src/plugins/kibana_usage_collection/tsconfig.json" }, diff --git a/x-pack/test/usage_collection/test_suites/stack_management_usage/index.ts b/x-pack/test/usage_collection/test_suites/stack_management_usage/index.ts index a14018baaaf6b..3bcf6f6384fd1 100644 --- a/x-pack/test/usage_collection/test_suites/stack_management_usage/index.ts +++ b/x-pack/test/usage_collection/test_suites/stack_management_usage/index.ts @@ -10,7 +10,8 @@ import { FtrProviderContext } from '../../ftr_provider_context'; import { stackManagementSchema } from '../../../../../src/plugins/kibana_usage_collection/server/collectors/management/schema'; export default function ({ getService, getPageObjects }: FtrProviderContext) { - describe('Stack Management', function () { + // FLAKY: https://github.com/elastic/kibana/issues/119038 + describe.skip('Stack Management', function () { this.tags('ciGroup1'); const { common } = getPageObjects(['common']); const browser = getService('browser'); diff --git a/yarn.lock b/yarn.lock index d1e1de94393a7..3d1ab34b02f85 100644 --- a/yarn.lock +++ b/yarn.lock @@ -32,7 +32,7 @@ dependencies: "@babel/highlight" "^7.10.4" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.0", "@babel/code-frame@^7.5.5": +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.0", "@babel/code-frame@^7.5.5", "@babel/code-frame@^7.8.3": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.0.tgz#0dfc80309beec8411e65e706461c408b0bb9b431" integrity sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA== @@ -91,7 +91,7 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/core@>=7.9.0", "@babel/core@^7.1.0", "@babel/core@^7.12.1", "@babel/core@^7.12.3", "@babel/core@^7.16.0", "@babel/core@^7.7.5": +"@babel/core@>=7.9.0", "@babel/core@^7.1.0", "@babel/core@^7.12.10", "@babel/core@^7.12.3", "@babel/core@^7.16.0", "@babel/core@^7.7.5": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.16.0.tgz#c4ff44046f5fe310525cc9eb4ef5147f0c5374d4" integrity sha512-mYZEvshBRHGsIAiyH5PzCFTCfbWfoYbO/jcSdXQSUQu1/pW0xDZAUP7KEc32heqWTAfAHhV9j1vH8Sav7l+JNQ== @@ -128,7 +128,7 @@ dependencies: eslint-rule-composer "^0.3.0" -"@babel/generator@^7.12.1", "@babel/generator@^7.12.5", "@babel/generator@^7.16.0", "@babel/generator@^7.4.4": +"@babel/generator@^7.12.11", "@babel/generator@^7.12.5", "@babel/generator@^7.16.0", "@babel/generator@^7.4.4": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.16.0.tgz#d40f3d1d5075e62d3500bccb67f3daa8a95265b2" integrity sha512-RR8hUCfRQn9j9RPKEVXo9LiwoxLPYn6hNZlvUOR8tSnaxlD0p0+la00ZP9/SnRt6HchKr+X0fO2r8vrETiJGew== @@ -182,10 +182,10 @@ "@babel/helper-annotate-as-pure" "^7.16.0" regexpu-core "^4.7.1" -"@babel/helper-define-polyfill-provider@^0.2.4": - version "0.2.4" - resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.4.tgz#8867aed79d3ea6cade40f801efb7ac5c66916b10" - integrity sha512-OrpPZ97s+aPi6h2n1OXzdhVis1SGSsMU2aMHgLcOKfsp4/v1NWpx3CWT3lBj5eeBq9cDkPkh+YCfdF7O12uNDQ== +"@babel/helper-define-polyfill-provider@^0.1.5": + version "0.1.5" + resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.1.5.tgz#3c2f91b7971b9fc11fe779c945c014065dea340e" + integrity sha512-nXuzCSwlJ/WKr8qxzW816gwyT6VZgiJG17zR40fou70yfAcqjoNyTLl/DQ+FExw5Hx5KNqshmN8Ldl/r2N7cTg== dependencies: "@babel/helper-compilation-targets" "^7.13.0" "@babel/helper-module-imports" "^7.12.13" @@ -372,17 +372,12 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.12.3", "@babel/parser@^7.12.7", "@babel/parser@^7.14.7", "@babel/parser@^7.16.0", "@babel/parser@^7.16.3", "@babel/parser@^7.4.5": - version "7.16.3" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.3.tgz#271bafcb811080905a119222edbc17909c82261d" - integrity sha512-dcNwU1O4sx57ClvLBVFbEgx0UZWfd0JQX5X6fxFRCLHelFBGXFfSz6Y0FAq2PEwUqlqLkdVjVr4VASEOuUnLJw== - -"@babel/parser@^7.16.4": +"@babel/parser@^7.1.0", "@babel/parser@^7.12.11", "@babel/parser@^7.12.7", "@babel/parser@^7.14.7", "@babel/parser@^7.16.0", "@babel/parser@^7.16.3", "@babel/parser@^7.16.4", "@babel/parser@^7.4.5": version "7.16.4" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.4.tgz#d5f92f57cf2c74ffe9b37981c0e72fee7311372e" integrity sha512-6V0qdPUaiVHH3RtZeLIsc+6pDhbYzHR8ogA8w+f+Wc77DuXto19g2QUwveINoS34Uw+W8/hQDGJCx+i4n7xcng== -"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.16.0", "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.16.2": +"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.16.2": version "7.16.2" resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.16.2.tgz#2977fca9b212db153c195674e57cfab807733183" integrity sha512-h37CvpLSf8gb2lIJ2CgC3t+EjFbi0t8qS7LCS1xcJIlEXE4czlofwaW7W1HA8zpgOCzI9C1nmoqNR1zWkk0pQg== @@ -398,16 +393,7 @@ "@babel/helper-skip-transparent-expression-wrappers" "^7.16.0" "@babel/plugin-proposal-optional-chaining" "^7.16.0" -"@babel/plugin-proposal-async-generator-functions@^7.16.0", "@babel/plugin-proposal-async-generator-functions@^7.2.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.16.0.tgz#11425d47a60364352f668ad5fbc1d6596b2c5caf" - integrity sha512-nyYmIo7ZqKsY6P4lnVmBlxp9B3a96CscbLotlsNuktMHahkDwoPYEjXrZHU0Tj844Z9f1IthVxQln57mhkcExw== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-remap-async-to-generator" "^7.16.0" - "@babel/plugin-syntax-async-generators" "^7.8.4" - -"@babel/plugin-proposal-async-generator-functions@^7.16.4": +"@babel/plugin-proposal-async-generator-functions@^7.16.4", "@babel/plugin-proposal-async-generator-functions@^7.2.0": version "7.16.4" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.16.4.tgz#e606eb6015fec6fa5978c940f315eae4e300b081" integrity sha512-/CUekqaAaZCQHleSK/9HajvcD/zdnJiKRiuUFq8ITE+0HsPzquf53cpFiqAwl/UfmJbR6n5uGPQSPdrmKOvHHg== @@ -441,7 +427,7 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-class-static-block" "^7.14.5" -"@babel/plugin-proposal-decorators@^7.12.1": +"@babel/plugin-proposal-decorators@^7.12.12": version "7.13.5" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.13.5.tgz#d28071457a5ba8ee1394b23e38d5dcf32ea20ef7" integrity sha512-i0GDfVNuoapwiheevUOuSW67mInqJ8qw7uWfpjNVeHMn143kXblEy/bmL9AdZ/0yf/4BMQeWXezK0tQIvNPqag== @@ -542,7 +528,7 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" -"@babel/plugin-proposal-optional-chaining@^7.12.1", "@babel/plugin-proposal-optional-chaining@^7.16.0": +"@babel/plugin-proposal-optional-chaining@^7.12.7", "@babel/plugin-proposal-optional-chaining@^7.16.0": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.16.0.tgz#56dbc3970825683608e9efb55ea82c2a2d6c8dc0" integrity sha512-Y4rFpkZODfHrVo70Uaj6cC1JJOt3Pp0MdWSwIKtb8z1/lsjl9AmnB7ErRFV+QNGIfcY1Eruc2UMx5KaRnXjMyg== @@ -754,7 +740,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-block-scoping@^7.12.1", "@babel/plugin-transform-block-scoping@^7.16.0", "@babel/plugin-transform-block-scoping@^7.4.4": +"@babel/plugin-transform-block-scoping@^7.12.12", "@babel/plugin-transform-block-scoping@^7.16.0", "@babel/plugin-transform-block-scoping@^7.4.4": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.16.0.tgz#bcf433fb482fe8c3d3b4e8a66b1c4a8e77d37c16" integrity sha512-27n3l67/R3UrXfizlvHGuTwsRIFyce3D/6a37GRxn28iyTPvNXaW4XvznexRh1zUNLPjbLL22Id0XQElV94ruw== @@ -952,7 +938,7 @@ "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-jsx" "^7.10.4" -"@babel/plugin-transform-react-jsx@^7.0.0", "@babel/plugin-transform-react-jsx@^7.12.1", "@babel/plugin-transform-react-jsx@^7.16.0": +"@babel/plugin-transform-react-jsx@^7.0.0", "@babel/plugin-transform-react-jsx@^7.12.1", "@babel/plugin-transform-react-jsx@^7.12.12", "@babel/plugin-transform-react-jsx@^7.16.0": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.16.0.tgz#55b797d4960c3de04e07ad1c0476e2bc6a4889f1" integrity sha512-rqDgIbukZ44pqq7NIRPGPGNklshPkvlmvqjdx3OZcGPk4zGIenYkxDTvl3LsSL8gqcc3ZzGmXPE6hR/u/voNOw== @@ -1121,87 +1107,7 @@ js-levenshtein "^1.1.3" semver "^5.5.0" -"@babel/preset-env@^7.12.1": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.16.0.tgz#97228393d217560d6a1c6c56f0adb9d12bca67f5" - integrity sha512-cdTu/W0IrviamtnZiTfixPfIncr2M1VqRrkjzZWlr1B4TVYimCFK5jkyOdP4qw2MrlKHi+b3ORj6x8GoCew8Dg== - dependencies: - "@babel/compat-data" "^7.16.0" - "@babel/helper-compilation-targets" "^7.16.0" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-validator-option" "^7.14.5" - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.16.0" - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.16.0" - "@babel/plugin-proposal-async-generator-functions" "^7.16.0" - "@babel/plugin-proposal-class-properties" "^7.16.0" - "@babel/plugin-proposal-class-static-block" "^7.16.0" - "@babel/plugin-proposal-dynamic-import" "^7.16.0" - "@babel/plugin-proposal-export-namespace-from" "^7.16.0" - "@babel/plugin-proposal-json-strings" "^7.16.0" - "@babel/plugin-proposal-logical-assignment-operators" "^7.16.0" - "@babel/plugin-proposal-nullish-coalescing-operator" "^7.16.0" - "@babel/plugin-proposal-numeric-separator" "^7.16.0" - "@babel/plugin-proposal-object-rest-spread" "^7.16.0" - "@babel/plugin-proposal-optional-catch-binding" "^7.16.0" - "@babel/plugin-proposal-optional-chaining" "^7.16.0" - "@babel/plugin-proposal-private-methods" "^7.16.0" - "@babel/plugin-proposal-private-property-in-object" "^7.16.0" - "@babel/plugin-proposal-unicode-property-regex" "^7.16.0" - "@babel/plugin-syntax-async-generators" "^7.8.4" - "@babel/plugin-syntax-class-properties" "^7.12.13" - "@babel/plugin-syntax-class-static-block" "^7.14.5" - "@babel/plugin-syntax-dynamic-import" "^7.8.3" - "@babel/plugin-syntax-export-namespace-from" "^7.8.3" - "@babel/plugin-syntax-json-strings" "^7.8.3" - "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - "@babel/plugin-syntax-numeric-separator" "^7.10.4" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" - "@babel/plugin-syntax-private-property-in-object" "^7.14.5" - "@babel/plugin-syntax-top-level-await" "^7.14.5" - "@babel/plugin-transform-arrow-functions" "^7.16.0" - "@babel/plugin-transform-async-to-generator" "^7.16.0" - "@babel/plugin-transform-block-scoped-functions" "^7.16.0" - "@babel/plugin-transform-block-scoping" "^7.16.0" - "@babel/plugin-transform-classes" "^7.16.0" - "@babel/plugin-transform-computed-properties" "^7.16.0" - "@babel/plugin-transform-destructuring" "^7.16.0" - "@babel/plugin-transform-dotall-regex" "^7.16.0" - "@babel/plugin-transform-duplicate-keys" "^7.16.0" - "@babel/plugin-transform-exponentiation-operator" "^7.16.0" - "@babel/plugin-transform-for-of" "^7.16.0" - "@babel/plugin-transform-function-name" "^7.16.0" - "@babel/plugin-transform-literals" "^7.16.0" - "@babel/plugin-transform-member-expression-literals" "^7.16.0" - "@babel/plugin-transform-modules-amd" "^7.16.0" - "@babel/plugin-transform-modules-commonjs" "^7.16.0" - "@babel/plugin-transform-modules-systemjs" "^7.16.0" - "@babel/plugin-transform-modules-umd" "^7.16.0" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.16.0" - "@babel/plugin-transform-new-target" "^7.16.0" - "@babel/plugin-transform-object-super" "^7.16.0" - "@babel/plugin-transform-parameters" "^7.16.0" - "@babel/plugin-transform-property-literals" "^7.16.0" - "@babel/plugin-transform-regenerator" "^7.16.0" - "@babel/plugin-transform-reserved-words" "^7.16.0" - "@babel/plugin-transform-shorthand-properties" "^7.16.0" - "@babel/plugin-transform-spread" "^7.16.0" - "@babel/plugin-transform-sticky-regex" "^7.16.0" - "@babel/plugin-transform-template-literals" "^7.16.0" - "@babel/plugin-transform-typeof-symbol" "^7.16.0" - "@babel/plugin-transform-unicode-escapes" "^7.16.0" - "@babel/plugin-transform-unicode-regex" "^7.16.0" - "@babel/preset-modules" "^0.1.5" - "@babel/types" "^7.16.0" - babel-plugin-polyfill-corejs2 "^0.2.3" - babel-plugin-polyfill-corejs3 "^0.3.0" - babel-plugin-polyfill-regenerator "^0.2.3" - core-js-compat "^3.19.0" - semver "^6.3.0" - -"@babel/preset-env@^7.16.4": +"@babel/preset-env@^7.12.11", "@babel/preset-env@^7.16.4": version "7.16.4" resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.16.4.tgz#4f6ec33b2a3fe72d6bfdcdf3859500232563a2e3" integrity sha512-v0QtNd81v/xKj4gNKeuAerQ/azeNn/G1B1qMLeXOcV8+4TWlD2j3NV1u8q29SDFBXx/NBq5kyEAO+0mpRgacjA== @@ -1311,7 +1217,7 @@ "@babel/plugin-transform-react-jsx-self" "^7.0.0" "@babel/plugin-transform-react-jsx-source" "^7.0.0" -"@babel/preset-react@^7.12.1", "@babel/preset-react@^7.16.0": +"@babel/preset-react@^7.12.10", "@babel/preset-react@^7.16.0": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.16.0.tgz#f71d3e8dff5218478011df037fad52660ee6d82a" integrity sha512-d31IFW2bLRB28uL1WoElyro8RH5l6531XfxMtCeCmp6RVAF1uTfxxUA0LH1tXl+psZdwfmIbwoG4U5VwgbhtLw== @@ -1323,7 +1229,7 @@ "@babel/plugin-transform-react-jsx-development" "^7.16.0" "@babel/plugin-transform-react-pure-annotations" "^7.16.0" -"@babel/preset-typescript@^7.12.1", "@babel/preset-typescript@^7.16.0": +"@babel/preset-typescript@^7.12.7", "@babel/preset-typescript@^7.16.0": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.16.0.tgz#b0b4f105b855fb3d631ec036cdc9d1ffd1fa5eac" integrity sha512-txegdrZYgO9DlPbv+9QOVpMnKbOtezsLHWsnsRF4AjbSIsVaujrq1qg8HK0mxQpWv0jnejt0yEoW1uWpvbrDTg== @@ -1362,21 +1268,7 @@ core-js-pure "^3.0.0" regenerator-runtime "^0.13.4" -"@babel/runtime@7.3.1": - version "7.3.1" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.3.1.tgz#574b03e8e8a9898eaf4a872a92ea20b7846f6f2a" - integrity sha512-7jGW8ppV0ant637pIqAcFfQDDH1orEPGJb8aXfUozuCU3QqX7rX4DA8iwrbPrR1hcH0FTTHz47yQnk+bl5xHQA== - dependencies: - regenerator-runtime "^0.12.0" - -"@babel/runtime@7.3.4": - version "7.3.4" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.3.4.tgz#73d12ba819e365fcf7fd152aed56d6df97d21c83" - integrity sha512-IvfvnMdSaLBateu0jfsYIpZTxAc2cKEXEMiezGGN75QcBcecDUKd3PgLAncT0oOgxKy8dd8hrJKj9MfzgfZd6g== - dependencies: - regenerator-runtime "^0.12.0" - -"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.10", "@babel/runtime@^7.14.0", "@babel/runtime@^7.16.0", "@babel/runtime@^7.16.3", "@babel/runtime@^7.3.1", "@babel/runtime@^7.4.4", "@babel/runtime@^7.4.5", "@babel/runtime@^7.5.0", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.2", "@babel/runtime@^7.6.3", "@babel/runtime@^7.7.2", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2": +"@babel/runtime@7.3.1", "@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.10", "@babel/runtime@^7.14.0", "@babel/runtime@^7.16.0", "@babel/runtime@^7.16.3", "@babel/runtime@^7.3.1", "@babel/runtime@^7.4.4", "@babel/runtime@^7.4.5", "@babel/runtime@^7.5.0", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.2", "@babel/runtime@^7.6.3", "@babel/runtime@^7.7.2", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2": version "7.16.3" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.16.3.tgz#b86f0db02a04187a3c17caa77de69840165d42d5" integrity sha512-WBwekcqacdY2e9AF/Q7WLFUWmdJGJTkbjqTjoMDgXkVZ3ZRUvOPsLb5KdwISoQVsbP+DQzVZW4Zhci0DvpbNTQ== @@ -1392,7 +1284,7 @@ "@babel/parser" "^7.16.0" "@babel/types" "^7.16.0" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.12.9", "@babel/traverse@^7.13.0", "@babel/traverse@^7.16.0", "@babel/traverse@^7.16.3", "@babel/traverse@^7.4.5": +"@babel/traverse@^7.1.0", "@babel/traverse@^7.12.11", "@babel/traverse@^7.12.9", "@babel/traverse@^7.13.0", "@babel/traverse@^7.16.0", "@babel/traverse@^7.16.3", "@babel/traverse@^7.4.5": version "7.16.3" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.16.3.tgz#f63e8a938cc1b780f66d9ed3c54f532ca2d14787" integrity sha512-eolumr1vVMjqevCpwVO99yN/LoGL0EyHiLO5I043aYQvwOJ9eR5UsZSClHVCzfhBduMAsSzgA/6AyqPjNayJag== @@ -1407,7 +1299,7 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.12.7", "@babel/types@^7.16.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": +"@babel/types@^7.0.0", "@babel/types@^7.12.11", "@babel/types@^7.12.7", "@babel/types@^7.16.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.16.0.tgz#db3b313804f96aadd0b776c4823e127ad67289ba" integrity sha512-PJgg/k3SdLsGb3hhisFvtLOw5ts113klrpLuIPtCJIU+BB24fqq6lf8RWqKJEjzqXR9AEH1rIb5XTqwBHB+kQg== @@ -1415,10 +1307,10 @@ "@babel/helper-validator-identifier" "^7.15.7" to-fast-properties "^2.0.0" -"@base2/pretty-print-object@1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@base2/pretty-print-object/-/pretty-print-object-1.0.0.tgz#860ce718b0b73f4009e153541faff2cb6b85d047" - integrity sha512-4Th98KlMHr5+JkxfcoDT//6vY8vM+iSPrLNpHhRyLx2CFYi8e2RfqPLdpbnpo0Q5lQC5hNB79yes07zb02fvCw== +"@base2/pretty-print-object@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@base2/pretty-print-object/-/pretty-print-object-1.0.1.tgz#371ba8be66d556812dc7fb169ebc3c08378f69d4" + integrity sha512-4iri8i1AqYHJE2DstZYkyEprg6Pq6sKx3xn5FpySk9sNhH7qN2LLlHJCfDTZRILNwQNPD7mATWM0TBui7uC1pA== "@bazel/ibazel@^0.15.10": version "0.15.10" @@ -1549,6 +1441,11 @@ enabled "2.0.x" kuler "^2.0.0" +"@discoveryjs/json-ext@^0.5.3": + version "0.5.5" + resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.5.tgz#9283c9ce5b289a3c4f61c12757469e59377f81f3" + integrity sha512-6nFkfkmSeV/rqSaS4oWHgmpnYw194f6hmWF5is6b0J1naJZoiD0NTc9AiUwPHvWsowkjuHErCZT1wa0jg+BLIA== + "@dnd-kit/accessibility@^3.0.0": version "3.0.0" resolved "https://registry.yarnpkg.com/@dnd-kit/accessibility/-/accessibility-3.0.0.tgz#b56e3750414fd907b7d6972b3116aa8f96d07fde" @@ -1623,10 +1520,10 @@ dependencies: object-hash "^1.3.0" -"@elastic/charts@39.0.2": - version "39.0.2" - resolved "https://registry.yarnpkg.com/@elastic/charts/-/charts-39.0.2.tgz#5533fc57c4ceed4c5ae826cd9a13c55cc03c55e5" - integrity sha512-jjdZSV6PGKsjA2qDAwEw+SjHWq5/Rm9FQk9lrmxrX+0rc7TlsPyr840RT1BAfkDDoo8+o3WWbfg+r61Y0FQ1Pg== +"@elastic/charts@40.0.0": + version "40.0.0" + resolved "https://registry.yarnpkg.com/@elastic/charts/-/charts-40.0.0.tgz#aa79a34c160086bff3a4ade5f6c48bfdf4c7eab5" + integrity sha512-81gq7/loJO5znr3jUxKKUiXPvOFewsdFAGI/yIsbJJCMJ+1MR63A8V1h4ZzqVYoVne4S4btl/beIx0s/JFN+aw== dependencies: "@popperjs/core" "^2.4.0" chroma-js "^2.1.0" @@ -2102,7 +1999,7 @@ "@emotion/serialize" "^0.11.15" "@emotion/utils" "0.11.3" -"@emotion/styled@^10.0.23", "@emotion/styled@^10.0.27": +"@emotion/styled@^10.0.27": version "10.0.27" resolved "https://registry.yarnpkg.com/@emotion/styled/-/styled-10.0.27.tgz#12cb67e91f7ad7431e1875b1d83a94b814133eaf" integrity sha512-iK/8Sh7+NLJzyp9a5+vIQIXTYxfT4yB/OJbjzQanB2RZpvmzBQOHZWhpAMZWYEKRNNbsD6WfBw5sVWkb6WzS/Q== @@ -2680,7 +2577,7 @@ jest-runner "^26.6.3" jest-runtime "^26.6.3" -"@jest/transform@^26.0.0", "@jest/transform@^26.6.2": +"@jest/transform@^26.6.2": version "26.6.2" resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-26.6.2.tgz#5ac57c5fa1ad17b2aae83e73e45813894dcf2e4b" integrity sha512-E9JjhUgNzvuQ+vVAL21vlyfy12gP0GhazGgJC4h6qUt1jSdUXGWJ1wfu/X7Sd8etSgxV4ovT1pb9v5D6QW4XgA== @@ -2710,16 +2607,6 @@ "@types/istanbul-reports" "^1.1.1" "@types/yargs" "^13.0.0" -"@jest/types@^25.5.0": - version "25.5.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-25.5.0.tgz#4d6a4793f7b9599fc3680877b856a97dbccf2a9d" - integrity sha512-OXD0RgQ86Tu3MazKo8bnrkDRaDXXMGUqd+kTtLtK1Zb7CRzQcaSRPPPV37SvYTdevXEBVxe0HXylEjs8ibkmCw== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^1.1.1" - "@types/yargs" "^15.0.0" - chalk "^3.0.0" - "@jest/types@^26.6.2": version "26.6.2" resolved "https://registry.yarnpkg.com/@jest/types/-/types-26.6.2.tgz#bef5a532030e1d88a2f5a6d933f84e97226ed48e" @@ -3112,6 +2999,10 @@ version "0.0.0" uid "" +"@kbn/i18n-react@link:bazel-bin/packages/kbn-i18n-react": + version "0.0.0" + uid "" + "@kbn/i18n@link:bazel-bin/packages/kbn-i18n": version "0.0.0" uid "" @@ -3445,7 +3336,7 @@ resolved "https://registry.yarnpkg.com/@mapbox/whoots-js/-/whoots-js-3.1.0.tgz#497c67a1cef50d1a2459ba60f315e448d2ad87fe" integrity sha512-Es6WcD0nO5l+2BOQS4uLfNPYQaNDfbot3X1XUoloz+x0mPDS3eeORZJl06HXjwBG1fOGwCRnzK88LMdxKRrd6Q== -"@mdx-js/loader@^1.6.19": +"@mdx-js/loader@^1.6.22": version "1.6.22" resolved "https://registry.yarnpkg.com/@mdx-js/loader/-/loader-1.6.22.tgz#d9e8fe7f8185ff13c9c8639c048b123e30d322c4" integrity sha512-9CjGwy595NaxAYp0hF9B/A0lH6C8Rms97e2JS9d3jVUtILn6pT5i5IV965ra3lIWc7Rs1GG1tBdVF7dCowYe6Q== @@ -3454,7 +3345,7 @@ "@mdx-js/react" "1.6.22" loader-utils "2.0.0" -"@mdx-js/mdx@1.6.22", "@mdx-js/mdx@^1.6.19": +"@mdx-js/mdx@1.6.22", "@mdx-js/mdx@^1.6.22": version "1.6.22" resolved "https://registry.yarnpkg.com/@mdx-js/mdx/-/mdx-1.6.22.tgz#8a723157bf90e78f17dc0f27995398e6c731f1ba" integrity sha512-AMxuLxPz2j5/6TpF/XSdKpQP1NlG0z11dFOlq+2IP/lSgl11GY8ji6S/rgsViN/L0BDvHvUMruRb7ub+24LUYA== @@ -3479,7 +3370,7 @@ unist-builder "2.0.3" unist-util-visit "2.0.3" -"@mdx-js/react@1.6.22", "@mdx-js/react@^1.6.19": +"@mdx-js/react@1.6.22", "@mdx-js/react@^1.6.22": version "1.6.22" resolved "https://registry.yarnpkg.com/@mdx-js/react/-/react-1.6.22.tgz#ae09b4744fddc74714ee9f9d6f17a66e77c43573" integrity sha512-TDoPum4SHdfPiGSAaRBw7ECyI8VaHpK8GJugbJIJuqyh6kzw9ZLJZW3HGL3NNrJGxcAixUvqROm+YuQOo5eXtg== @@ -3922,7 +3813,7 @@ which "^2.0.1" winston "^3.0.0" -"@pmmmwh/react-refresh-webpack-plugin@^0.4.2": +"@pmmmwh/react-refresh-webpack-plugin@^0.4.3": version "0.4.3" resolved "https://registry.yarnpkg.com/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.4.3.tgz#1eec460596d200c0236bf195b078a5d1df89b766" integrity sha512-br5Qwvh8D2OQqSXpd1g/xqXKnK0r+Jz6qVKBbWmpUcrbGOxUrf39V5oZ1876084CGn18uMdR5uvPqBv9UqtBjQ== @@ -3934,10 +3825,10 @@ schema-utils "^2.6.5" source-map "^0.7.3" -"@popperjs/core@^2.4.0", "@popperjs/core@^2.5.4": - version "2.9.0" - resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.9.0.tgz#32e63212293dd3efbb521cd35a5020ab66eaa546" - integrity sha512-wjtKehFAIARq2OxK8j3JrggNlEslJfNuSm2ArteIbKyRMts2g0a7KzTxfRVNUM+O0gnBJ2hNV8nWPOYBgI1sew== +"@popperjs/core@^2.4.0", "@popperjs/core@^2.5.4", "@popperjs/core@^2.6.0": + version "2.10.2" + resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.10.2.tgz#0798c03351f0dea1a5a4cabddf26a55a7cbee590" + integrity sha512-IXf3XA7+XyN7CP9gGh/XB0UxVMlvARGEgGXLubFICsUMGz6Q+DU+i4gGlpOxTjKvXjkJDJC8YdqdKkDj9qZHEQ== "@probe.gl/stats@^3.3.0": version "3.3.0" @@ -3999,7 +3890,7 @@ resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" integrity sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA= -"@reach/router@^1.3.3", "@reach/router@^1.3.4": +"@reach/router@^1.3.4": version "1.3.4" resolved "https://registry.yarnpkg.com/@reach/router/-/router-1.3.4.tgz#d2574b19370a70c80480ed91f3da840136d10f8c" integrity sha512-+mtn9wjlB9NN2CNnnC/BRYtwdKBfSyyasPYraNAyvaV1occr/5NnB4CVzjEZipNHwYebQwcndGUmpFzxAUoqSA== @@ -4180,276 +4071,258 @@ "@types/node" ">=8.9.0" axios "^0.21.1" -"@storybook/addon-a11y@^6.1.20": - version "6.1.20" - resolved "https://registry.yarnpkg.com/@storybook/addon-a11y/-/addon-a11y-6.1.20.tgz#71102a84ebaf37948e19a6d28fb58de5adadd1b6" - integrity sha512-ytktgT4XyXtbqpYt76R2PWlRTku7NjoZHLCF6Gv+OSEYfys8e0twZ+BJ+Cojch6WLwHYXVcSfcmhgY+DedI0BA== - dependencies: - "@storybook/addons" "6.1.20" - "@storybook/api" "6.1.20" - "@storybook/channels" "6.1.20" - "@storybook/client-api" "6.1.20" - "@storybook/client-logger" "6.1.20" - "@storybook/components" "6.1.20" - "@storybook/core-events" "6.1.20" - "@storybook/theming" "6.1.20" - axe-core "^4.0.1" - core-js "^3.0.1" - global "^4.3.2" - lodash "^4.17.15" - react-sizeme "^2.5.2" +"@storybook/addon-a11y@^6.3.12": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@storybook/addon-a11y/-/addon-a11y-6.3.12.tgz#2f930fc84fc275a4ed43a716fc09cc12caf4e110" + integrity sha512-q1NdRHFJV6sLEEJw0hatCc5ZIthELqM/AWdrEWDyhcJNyiq7Tq4nKqQBMTQSYwHiUAmxVgw7i4oa1vM2M51/3g== + dependencies: + "@storybook/addons" "6.3.12" + "@storybook/api" "6.3.12" + "@storybook/channels" "6.3.12" + "@storybook/client-api" "6.3.12" + "@storybook/client-logger" "6.3.12" + "@storybook/components" "6.3.12" + "@storybook/core-events" "6.3.12" + "@storybook/theming" "6.3.12" + axe-core "^4.2.0" + core-js "^3.8.2" + global "^4.4.0" + lodash "^4.17.20" + react-sizeme "^3.0.1" regenerator-runtime "^0.13.7" ts-dedent "^2.0.0" util-deprecate "^1.0.2" -"@storybook/addon-actions@6.1.20", "@storybook/addon-actions@^6.1.20": - version "6.1.20" - resolved "https://registry.yarnpkg.com/@storybook/addon-actions/-/addon-actions-6.1.20.tgz#a7c5f8d079d309f89b38ac8fb89b0838e63afc43" - integrity sha512-94KH/+Y+Do9k9XgVGup2XgRnzaz/6fSR41nKW4x8oUbnmke8FeZEAurBzjsK+0EGZhVilEpVvabZXc7t9tRZyg== - dependencies: - "@storybook/addons" "6.1.20" - "@storybook/api" "6.1.20" - "@storybook/client-api" "6.1.20" - "@storybook/components" "6.1.20" - "@storybook/core-events" "6.1.20" - "@storybook/theming" "6.1.20" - core-js "^3.0.1" - fast-deep-equal "^3.1.1" - global "^4.3.2" - lodash "^4.17.15" - polished "^3.4.4" +"@storybook/addon-actions@6.3.12", "@storybook/addon-actions@^6.3.12": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@storybook/addon-actions/-/addon-actions-6.3.12.tgz#69eb5f8f780f1b00456051da6290d4b959ba24a0" + integrity sha512-mzuN4Ano4eyicwycM2PueGzzUCAEzt9/6vyptWEIVJu0sjK0J9KtBRlqFi1xGQxmCfimDR/n/vWBBkc7fp2uJA== + dependencies: + "@storybook/addons" "6.3.12" + "@storybook/api" "6.3.12" + "@storybook/client-api" "6.3.12" + "@storybook/components" "6.3.12" + "@storybook/core-events" "6.3.12" + "@storybook/theming" "6.3.12" + core-js "^3.8.2" + fast-deep-equal "^3.1.3" + global "^4.4.0" + lodash "^4.17.20" + polished "^4.0.5" prop-types "^15.7.2" - react-inspector "^5.0.1" + react-inspector "^5.1.0" regenerator-runtime "^0.13.7" ts-dedent "^2.0.0" util-deprecate "^1.0.2" - uuid "^8.0.0" - -"@storybook/addon-backgrounds@6.1.20": - version "6.1.20" - resolved "https://registry.yarnpkg.com/@storybook/addon-backgrounds/-/addon-backgrounds-6.1.20.tgz#317cf6e123b8bc42f401cff1c0531aaa33d9d1ac" - integrity sha512-7YF+18DaekpiN1zyyLYOT6iqCPr8kGt6PFdAtMa/HtIalGryDwlRNHaUfylWAsaRWrOAz2tBzrX16olMuE+i3g== - dependencies: - "@storybook/addons" "6.1.20" - "@storybook/api" "6.1.20" - "@storybook/client-logger" "6.1.20" - "@storybook/components" "6.1.20" - "@storybook/core-events" "6.1.20" - "@storybook/theming" "6.1.20" - core-js "^3.0.1" - global "^4.3.2" + uuid-browser "^3.1.0" + +"@storybook/addon-backgrounds@6.3.12": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@storybook/addon-backgrounds/-/addon-backgrounds-6.3.12.tgz#5feecd461f48178aa976ba2694418e9ea1d621b3" + integrity sha512-51cHBx0HV7K/oRofJ/1pE05qti6sciIo8m4iPred1OezXIrJ/ckzP+gApdaUdzgcLAr6/MXQWLk0sJuImClQ6w== + dependencies: + "@storybook/addons" "6.3.12" + "@storybook/api" "6.3.12" + "@storybook/client-logger" "6.3.12" + "@storybook/components" "6.3.12" + "@storybook/core-events" "6.3.12" + "@storybook/theming" "6.3.12" + core-js "^3.8.2" + global "^4.4.0" memoizerific "^1.11.3" regenerator-runtime "^0.13.7" ts-dedent "^2.0.0" util-deprecate "^1.0.2" -"@storybook/addon-controls@6.1.20": - version "6.1.20" - resolved "https://registry.yarnpkg.com/@storybook/addon-controls/-/addon-controls-6.1.20.tgz#28fdbde325d55f910caad5f4694feee242c146ef" - integrity sha512-UZMZipa0B5IjKuZfOAa2xLYckzKuOtXbMTcTiT97ygyDSxMTkaCyfmuBdoUyoCv/+0PwQl2dN6EUqI+7I0ZZYA== - dependencies: - "@storybook/addons" "6.1.20" - "@storybook/api" "6.1.20" - "@storybook/client-api" "6.1.20" - "@storybook/components" "6.1.20" - "@storybook/node-logger" "6.1.20" - "@storybook/theming" "6.1.20" - core-js "^3.0.1" +"@storybook/addon-controls@6.3.12": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@storybook/addon-controls/-/addon-controls-6.3.12.tgz#dbb732c62cf06fb7ccaf87d6ab11c876d14456fc" + integrity sha512-WO/PbygE4sDg3BbstJ49q0uM3Xu5Nw4lnHR5N4hXSvRAulZt1d1nhphRTHjfX+CW+uBcfzkq9bksm6nKuwmOyw== + dependencies: + "@storybook/addons" "6.3.12" + "@storybook/api" "6.3.12" + "@storybook/client-api" "6.3.12" + "@storybook/components" "6.3.12" + "@storybook/node-logger" "6.3.12" + "@storybook/theming" "6.3.12" + core-js "^3.8.2" ts-dedent "^2.0.0" -"@storybook/addon-docs@6.1.20", "@storybook/addon-docs@^6.1.20": - version "6.1.20" - resolved "https://registry.yarnpkg.com/@storybook/addon-docs/-/addon-docs-6.1.20.tgz#390ea245686cfc464cfb94d441e494f1dbaf1b89" - integrity sha512-dc51UHcgMe/sa68+GFaJALJnkxoU8HNmNJmjwJoxZ1boTMC9D6CjVZl3tGqoLwoStlGB98lM7s+esONz+RAXtA== +"@storybook/addon-docs@6.3.12", "@storybook/addon-docs@^6.3.12": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@storybook/addon-docs/-/addon-docs-6.3.12.tgz#2ec73b4f231d9f190d5c89295bc47bea6a95c6d1" + integrity sha512-iUrqJBMTOn2PgN8AWNQkfxfIPkh8pEg27t8UndMgfOpeGK/VWGw2UEifnA82flvntcilT4McxmVbRHkeBY9K5A== dependencies: - "@babel/core" "^7.12.1" - "@babel/generator" "^7.12.1" - "@babel/parser" "^7.12.3" - "@babel/plugin-transform-react-jsx" "^7.12.1" - "@babel/preset-env" "^7.12.1" - "@jest/transform" "^26.0.0" - "@mdx-js/loader" "^1.6.19" - "@mdx-js/mdx" "^1.6.19" - "@mdx-js/react" "^1.6.19" - "@storybook/addons" "6.1.20" - "@storybook/api" "6.1.20" - "@storybook/client-api" "6.1.20" - "@storybook/client-logger" "6.1.20" - "@storybook/components" "6.1.20" - "@storybook/core" "6.1.20" - "@storybook/core-events" "6.1.20" + "@babel/core" "^7.12.10" + "@babel/generator" "^7.12.11" + "@babel/parser" "^7.12.11" + "@babel/plugin-transform-react-jsx" "^7.12.12" + "@babel/preset-env" "^7.12.11" + "@jest/transform" "^26.6.2" + "@mdx-js/loader" "^1.6.22" + "@mdx-js/mdx" "^1.6.22" + "@mdx-js/react" "^1.6.22" + "@storybook/addons" "6.3.12" + "@storybook/api" "6.3.12" + "@storybook/builder-webpack4" "6.3.12" + "@storybook/client-api" "6.3.12" + "@storybook/client-logger" "6.3.12" + "@storybook/components" "6.3.12" + "@storybook/core" "6.3.12" + "@storybook/core-events" "6.3.12" "@storybook/csf" "0.0.1" - "@storybook/node-logger" "6.1.20" - "@storybook/postinstall" "6.1.20" - "@storybook/source-loader" "6.1.20" - "@storybook/theming" "6.1.20" - acorn "^7.1.0" - acorn-jsx "^5.1.0" - acorn-walk "^7.0.0" - core-js "^3.0.1" + "@storybook/csf-tools" "6.3.12" + "@storybook/node-logger" "6.3.12" + "@storybook/postinstall" "6.3.12" + "@storybook/source-loader" "6.3.12" + "@storybook/theming" "6.3.12" + acorn "^7.4.1" + acorn-jsx "^5.3.1" + acorn-walk "^7.2.0" + core-js "^3.8.2" doctrine "^3.0.0" - escodegen "^1.12.0" - fast-deep-equal "^3.1.1" - global "^4.3.2" + escodegen "^2.0.0" + fast-deep-equal "^3.1.3" + global "^4.4.0" html-tags "^3.1.0" js-string-escape "^1.0.1" - lodash "^4.17.15" - prettier "~2.0.5" + loader-utils "^2.0.0" + lodash "^4.17.20" + p-limit "^3.1.0" + prettier "~2.2.1" prop-types "^15.7.2" - react-element-to-jsx-string "^14.3.1" + react-element-to-jsx-string "^14.3.2" regenerator-runtime "^0.13.7" - remark-external-links "^6.0.0" + remark-external-links "^8.0.0" remark-slug "^6.0.0" ts-dedent "^2.0.0" util-deprecate "^1.0.2" -"@storybook/addon-essentials@^6.1.20": - version "6.1.20" - resolved "https://registry.yarnpkg.com/@storybook/addon-essentials/-/addon-essentials-6.1.20.tgz#4cd38e61e6a763c3ff291d0d8da04f2968395265" - integrity sha512-8ne21UO3mE8nxUq8Nk8rF3zSJiLVjQdBv9aimwXUgOBeQTBRyY/H0nswjbIas8WrEk4D0pK+ylel4CdmMXJxxw== - dependencies: - "@storybook/addon-actions" "6.1.20" - "@storybook/addon-backgrounds" "6.1.20" - "@storybook/addon-controls" "6.1.20" - "@storybook/addon-docs" "6.1.20" - "@storybook/addon-toolbars" "6.1.20" - "@storybook/addon-viewport" "6.1.20" - "@storybook/addons" "6.1.20" - "@storybook/api" "6.1.20" - "@storybook/node-logger" "6.1.20" - core-js "^3.0.1" +"@storybook/addon-essentials@^6.3.12": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@storybook/addon-essentials/-/addon-essentials-6.3.12.tgz#445cc4bc2eb9168a9e5de1fdfb5ef3b92974e74b" + integrity sha512-PK0pPE0xkq00kcbBcFwu/5JGHQTu4GvLIHfwwlEGx6GWNQ05l6Q+1Z4nE7xJGv2PSseSx3CKcjn8qykNLe6O6g== + dependencies: + "@storybook/addon-actions" "6.3.12" + "@storybook/addon-backgrounds" "6.3.12" + "@storybook/addon-controls" "6.3.12" + "@storybook/addon-docs" "6.3.12" + "@storybook/addon-measure" "^2.0.0" + "@storybook/addon-toolbars" "6.3.12" + "@storybook/addon-viewport" "6.3.12" + "@storybook/addons" "6.3.12" + "@storybook/api" "6.3.12" + "@storybook/node-logger" "6.3.12" + core-js "^3.8.2" regenerator-runtime "^0.13.7" + storybook-addon-outline "^1.4.1" ts-dedent "^2.0.0" -"@storybook/addon-knobs@^6.1.20": - version "6.1.20" - resolved "https://registry.yarnpkg.com/@storybook/addon-knobs/-/addon-knobs-6.1.20.tgz#50e2a6e277fc44df9d50a04dad51f574e4f76f60" - integrity sha512-4G39Od9oRGUgiMqd8ukkNj5TmD54ZPUiw7u53J0gxIJFhgeInhzIE7w754LfaeBaaQ62OIqtc43r5BAKS0uPgQ== - dependencies: - "@storybook/addons" "6.1.20" - "@storybook/api" "6.1.20" - "@storybook/channels" "6.1.20" - "@storybook/client-api" "6.1.20" - "@storybook/components" "6.1.20" - "@storybook/core-events" "6.1.20" - "@storybook/theming" "6.1.20" - copy-to-clipboard "^3.0.8" - core-js "^3.0.1" +"@storybook/addon-knobs@^6.3.1": + version "6.3.1" + resolved "https://registry.yarnpkg.com/@storybook/addon-knobs/-/addon-knobs-6.3.1.tgz#2115c6f0d5759e4fe73d5f25710f4a94ebd6f0db" + integrity sha512-2GGGnQSPXXUhHHYv4IW6pkyQlCPYXKYiyGzfhV7Zhs95M2Ban08OA6KLmliMptWCt7U9tqTO8dB5u0C2cWmCTw== + dependencies: + copy-to-clipboard "^3.3.1" + core-js "^3.8.2" escape-html "^1.0.3" - fast-deep-equal "^3.1.1" - global "^4.3.2" - lodash "^4.17.15" + fast-deep-equal "^3.1.3" + global "^4.4.0" + lodash "^4.17.20" prop-types "^15.7.2" - qs "^6.6.0" - react-color "^2.17.0" + qs "^6.10.0" + react-colorful "^5.1.2" react-lifecycles-compat "^3.0.4" - react-select "^3.0.8" - regenerator-runtime "^0.13.7" + react-select "^3.2.0" + +"@storybook/addon-measure@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@storybook/addon-measure/-/addon-measure-2.0.0.tgz#c40bbe91bacd3f795963dc1ee6ff86be87deeda9" + integrity sha512-ZhdT++cX+L9LwjhGYggvYUUVQH/MGn2rwbrAwCMzA/f2QTFvkjxzX8nDgMxIhaLCDC+gHIxfJG2wrWN0jkBr3g== -"@storybook/addon-storyshots@^6.1.20": - version "6.1.20" - resolved "https://registry.yarnpkg.com/@storybook/addon-storyshots/-/addon-storyshots-6.1.20.tgz#2cedd14159fd40227bcdc364c6c73c2e3b1e6b47" - integrity sha512-DwaiKd0sUut9x1M1mVWbpal6DPZnIYGMpm7QxtGP+2Bmv23/n/FmFZoHVzIC3/KwjOlButKAiY9gB45B5HFrqg== +"@storybook/addon-storyshots@^6.3.12": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@storybook/addon-storyshots/-/addon-storyshots-6.3.12.tgz#542bba23a6ad65a4a0b77427169f177e24f5c5f1" + integrity sha512-plpy/q3pPpXtK9DyofE0trTeCZIyU0Z+baybbxltsM/tKFuQxbHSxTwgluq/7LOMkaRPgbddGyHForHoRLjsWg== dependencies: - "@jest/transform" "^26.0.0" - "@storybook/addons" "6.1.20" - "@storybook/client-api" "6.1.20" - "@storybook/core" "6.1.20" - "@types/glob" "^7.1.1" - "@types/jest" "^25.1.1" + "@jest/transform" "^26.6.2" + "@storybook/addons" "6.3.12" + "@storybook/client-api" "6.3.12" + "@storybook/core" "6.3.12" + "@storybook/core-common" "6.3.12" + "@types/glob" "^7.1.3" + "@types/jest" "^26.0.16" "@types/jest-specific-snapshot" "^0.5.3" babel-plugin-require-context-hook "^1.0.0" - core-js "^3.0.1" - glob "^7.1.3" - global "^4.3.2" + core-js "^3.8.2" + glob "^7.1.6" + global "^4.4.0" jest-specific-snapshot "^4.0.0" - pretty-format "^26.4.0" + preact-render-to-string "^5.1.19" + pretty-format "^26.6.2" react-test-renderer "^16.8.0 || ^17.0.0" - read-pkg-up "^7.0.0" + read-pkg-up "^7.0.1" regenerator-runtime "^0.13.7" ts-dedent "^2.0.0" -"@storybook/addon-toolbars@6.1.20": - version "6.1.20" - resolved "https://registry.yarnpkg.com/@storybook/addon-toolbars/-/addon-toolbars-6.1.20.tgz#a748cdf255607eba229809ab1e4ce51f811204e3" - integrity sha512-r+MGlY9MyGnlJQ6149GZOFnJ6rUZgrnX9RcpcuwOBmfZNUM0andnOlaV3L1s2LY+oEETDi/rqQkQcrr7jbO/wA== - dependencies: - "@storybook/addons" "6.1.20" - "@storybook/api" "6.1.20" - "@storybook/client-api" "6.1.20" - "@storybook/components" "6.1.20" - core-js "^3.0.1" - -"@storybook/addon-viewport@6.1.20": - version "6.1.20" - resolved "https://registry.yarnpkg.com/@storybook/addon-viewport/-/addon-viewport-6.1.20.tgz#42173010cecd5f762534b00c614deaa3a4d42381" - integrity sha512-Xh75q3eh29QYkgYUF7ZEc8/R4HcQjTPazsxxknYZKu+S5TZ1OhoToH74YOL7bDuMAMAco95zv4zHpW02/oYT0g== - dependencies: - "@storybook/addons" "6.1.20" - "@storybook/api" "6.1.20" - "@storybook/client-logger" "6.1.20" - "@storybook/components" "6.1.20" - "@storybook/core-events" "6.1.20" - "@storybook/theming" "6.1.20" - core-js "^3.0.1" - global "^4.3.2" - memoizerific "^1.11.3" - prop-types "^15.7.2" +"@storybook/addon-toolbars@6.3.12": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@storybook/addon-toolbars/-/addon-toolbars-6.3.12.tgz#bc0d420b3476c891c42f7b0ab3b457e9e5ef7ca5" + integrity sha512-8GvP6zmAfLPRnYRARSaIwLkQClLIRbflRh4HZoFk6IMjQLXZb4NL3JS5OLFKG+HRMMU2UQzfoSDqjI7k7ptyRw== + dependencies: + "@storybook/addons" "6.3.12" + "@storybook/api" "6.3.12" + "@storybook/client-api" "6.3.12" + "@storybook/components" "6.3.12" + "@storybook/theming" "6.3.12" + core-js "^3.8.2" regenerator-runtime "^0.13.7" -"@storybook/addons@6.1.20", "@storybook/addons@^6.1.20": - version "6.1.20" - resolved "https://registry.yarnpkg.com/@storybook/addons/-/addons-6.1.20.tgz#da01dabd6692919b719fcb30519d53ea80887097" - integrity sha512-kIhXYgF+ARNpYxO3qhz8yThDvKpaq+HDst8odPU9sCNEI66PSH6hrILhTmnffNnqdtY3LnKkU9rGVfZn+3TOTA== - dependencies: - "@storybook/api" "6.1.20" - "@storybook/channels" "6.1.20" - "@storybook/client-logger" "6.1.20" - "@storybook/core-events" "6.1.20" - "@storybook/router" "6.1.20" - "@storybook/theming" "6.1.20" - core-js "^3.0.1" - global "^4.3.2" +"@storybook/addon-viewport@6.3.12": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@storybook/addon-viewport/-/addon-viewport-6.3.12.tgz#2fd61e60644fb07185a662f75b3e9dad8ad14f01" + integrity sha512-TRjyfm85xouOPmXxeLdEIzXLfJZZ1ePQ7p/5yphDGBHdxMU4m4qiZr8wYpUaxHsRu/UB3dKfaOyGT+ivogbnbw== + dependencies: + "@storybook/addons" "6.3.12" + "@storybook/api" "6.3.12" + "@storybook/client-logger" "6.3.12" + "@storybook/components" "6.3.12" + "@storybook/core-events" "6.3.12" + "@storybook/theming" "6.3.12" + core-js "^3.8.2" + global "^4.4.0" + memoizerific "^1.11.3" + prop-types "^15.7.2" regenerator-runtime "^0.13.7" -"@storybook/api@6.1.20": - version "6.1.20" - resolved "https://registry.yarnpkg.com/@storybook/api/-/api-6.1.20.tgz#3738b0c859ead820b378ee94e936abcf0e2f7436" - integrity sha512-+Uvvj7B+0oGb83mOzNjFuxju3ColjJpgyDjNzD5jI2xCtGyau+c8Lr4rhI9xNc2Dw9b8gpfPmhkvEnBPmd/ecQ== - dependencies: - "@reach/router" "^1.3.3" - "@storybook/channels" "6.1.20" - "@storybook/client-logger" "6.1.20" - "@storybook/core-events" "6.1.20" - "@storybook/csf" "0.0.1" - "@storybook/router" "6.1.20" - "@storybook/semver" "^7.3.2" - "@storybook/theming" "6.1.20" - "@types/reach__router" "^1.3.7" - core-js "^3.0.1" - fast-deep-equal "^3.1.1" - global "^4.3.2" - lodash "^4.17.15" - memoizerific "^1.11.3" +"@storybook/addons@6.3.12", "@storybook/addons@^6.3.0", "@storybook/addons@^6.3.12": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@storybook/addons/-/addons-6.3.12.tgz#8773dcc113c5086dfff722388b7b65580e43b65b" + integrity sha512-UgoMyr7Qr0FS3ezt8u6hMEcHgyynQS9ucr5mAwZky3wpXRPFyUTmMto9r4BBUdqyUvTUj/LRKIcmLBfj+/l0Fg== + dependencies: + "@storybook/api" "6.3.12" + "@storybook/channels" "6.3.12" + "@storybook/client-logger" "6.3.12" + "@storybook/core-events" "6.3.12" + "@storybook/router" "6.3.12" + "@storybook/theming" "6.3.12" + core-js "^3.8.2" + global "^4.4.0" regenerator-runtime "^0.13.7" - store2 "^2.7.1" - telejson "^5.0.2" - ts-dedent "^2.0.0" - util-deprecate "^1.0.2" -"@storybook/api@^6.1.20": - version "6.2.9" - resolved "https://registry.yarnpkg.com/@storybook/api/-/api-6.2.9.tgz#a9b46569192ad5d8da6435c9d63dc4b0c8463b51" - integrity sha512-okkA3HAScE9tGnYBrjTOcgzT+L1lRHNoEh3ZfGgh1u/XNEyHGNkj4grvkd6nX7BzRcYQ/l2VkcKCqmOjUnSkVQ== +"@storybook/api@6.3.12", "@storybook/api@^6.3.0", "@storybook/api@^6.3.12": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@storybook/api/-/api-6.3.12.tgz#2845c20464d5348d676d09665e8ab527825ed7b5" + integrity sha512-LScRXUeCWEW/OP+jiooNMQICVdusv7azTmULxtm72fhkXFRiQs2CdRNTiqNg46JLLC9z95f1W+pGK66X6HiiQA== dependencies: "@reach/router" "^1.3.4" - "@storybook/channels" "6.2.9" - "@storybook/client-logger" "6.2.9" - "@storybook/core-events" "6.2.9" + "@storybook/channels" "6.3.12" + "@storybook/client-logger" "6.3.12" + "@storybook/core-events" "6.3.12" "@storybook/csf" "0.0.1" - "@storybook/router" "6.2.9" + "@storybook/router" "6.3.12" "@storybook/semver" "^7.3.2" - "@storybook/theming" "6.2.9" + "@storybook/theming" "6.3.12" "@types/reach__router" "^1.3.7" core-js "^3.8.2" fast-deep-equal "^3.1.3" @@ -4459,300 +4332,439 @@ qs "^6.10.0" regenerator-runtime "^0.13.7" store2 "^2.12.0" - telejson "^5.1.0" + telejson "^5.3.2" ts-dedent "^2.0.0" util-deprecate "^1.0.2" -"@storybook/channel-postmessage@6.1.20": - version "6.1.20" - resolved "https://registry.yarnpkg.com/@storybook/channel-postmessage/-/channel-postmessage-6.1.20.tgz#d23956e553ff7e5f022bd8496ee7a26defa57440" - integrity sha512-4/zUd48qBnhoD96M4yBK+RlMQmZid0FSUzc6w7mXXjDE7vmRrXgP5ppIwYlzo4mcNSA5wCJsEp4YKRgAfZAUxw== - dependencies: - "@storybook/channels" "6.1.20" - "@storybook/client-logger" "6.1.20" - "@storybook/core-events" "6.1.20" - core-js "^3.0.1" - global "^4.3.2" - qs "^6.6.0" - telejson "^5.0.2" - -"@storybook/channels@6.1.20": - version "6.1.20" - resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-6.1.20.tgz#8dc2763ffda301f3bda811cdcb19f8e88ff4ec80" - integrity sha512-UBvVf07LAUD6JTrk77f4qydS4v5hzjAHJWOfWO6b82oO5bu4hTXt/Rjj/TSz85Rl/NmM4GYAAPIfxJHg53TRTg== - dependencies: - core-js "^3.0.1" +"@storybook/builder-webpack4@6.3.12": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@storybook/builder-webpack4/-/builder-webpack4-6.3.12.tgz#288d541e2801892721c975259476022da695dbfe" + integrity sha512-Dlm5Fc1svqpFDnVPZdAaEBiM/IDZHMV3RfEGbUTY/ZC0q8b/Ug1czzp/w0aTIjOFRuBDcG6IcplikaqHL8CJLg== + dependencies: + "@babel/core" "^7.12.10" + "@babel/plugin-proposal-class-properties" "^7.12.1" + "@babel/plugin-proposal-decorators" "^7.12.12" + "@babel/plugin-proposal-export-default-from" "^7.12.1" + "@babel/plugin-proposal-nullish-coalescing-operator" "^7.12.1" + "@babel/plugin-proposal-object-rest-spread" "^7.12.1" + "@babel/plugin-proposal-optional-chaining" "^7.12.7" + "@babel/plugin-proposal-private-methods" "^7.12.1" + "@babel/plugin-syntax-dynamic-import" "^7.8.3" + "@babel/plugin-transform-arrow-functions" "^7.12.1" + "@babel/plugin-transform-block-scoping" "^7.12.12" + "@babel/plugin-transform-classes" "^7.12.1" + "@babel/plugin-transform-destructuring" "^7.12.1" + "@babel/plugin-transform-for-of" "^7.12.1" + "@babel/plugin-transform-parameters" "^7.12.1" + "@babel/plugin-transform-shorthand-properties" "^7.12.1" + "@babel/plugin-transform-spread" "^7.12.1" + "@babel/plugin-transform-template-literals" "^7.12.1" + "@babel/preset-env" "^7.12.11" + "@babel/preset-react" "^7.12.10" + "@babel/preset-typescript" "^7.12.7" + "@storybook/addons" "6.3.12" + "@storybook/api" "6.3.12" + "@storybook/channel-postmessage" "6.3.12" + "@storybook/channels" "6.3.12" + "@storybook/client-api" "6.3.12" + "@storybook/client-logger" "6.3.12" + "@storybook/components" "6.3.12" + "@storybook/core-common" "6.3.12" + "@storybook/core-events" "6.3.12" + "@storybook/node-logger" "6.3.12" + "@storybook/router" "6.3.12" + "@storybook/semver" "^7.3.2" + "@storybook/theming" "6.3.12" + "@storybook/ui" "6.3.12" + "@types/node" "^14.0.10" + "@types/webpack" "^4.41.26" + autoprefixer "^9.8.6" + babel-loader "^8.2.2" + babel-plugin-macros "^2.8.0" + babel-plugin-polyfill-corejs3 "^0.1.0" + case-sensitive-paths-webpack-plugin "^2.3.0" + core-js "^3.8.2" + css-loader "^3.6.0" + dotenv-webpack "^1.8.0" + file-loader "^6.2.0" + find-up "^5.0.0" + fork-ts-checker-webpack-plugin "^4.1.6" + fs-extra "^9.0.1" + glob "^7.1.6" + glob-promise "^3.4.0" + global "^4.4.0" + html-webpack-plugin "^4.0.0" + pnp-webpack-plugin "1.6.4" + postcss "^7.0.36" + postcss-flexbugs-fixes "^4.2.1" + postcss-loader "^4.2.0" + raw-loader "^4.0.2" + react-dev-utils "^11.0.3" + stable "^0.1.8" + style-loader "^1.3.0" + terser-webpack-plugin "^4.2.3" ts-dedent "^2.0.0" + url-loader "^4.1.1" util-deprecate "^1.0.2" + webpack "4" + webpack-dev-middleware "^3.7.3" + webpack-filter-warnings-plugin "^1.2.1" + webpack-hot-middleware "^2.25.0" + webpack-virtual-modules "^0.2.2" + +"@storybook/channel-postmessage@6.3.12": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@storybook/channel-postmessage/-/channel-postmessage-6.3.12.tgz#3ff9412ac0f445e3b8b44dd414e783a5a47ff7c1" + integrity sha512-Ou/2Ga3JRTZ/4sSv7ikMgUgLTeZMsXXWLXuscz4oaYhmOqAU9CrJw0G1NitwBgK/+qC83lEFSLujHkWcoQDOKg== + dependencies: + "@storybook/channels" "6.3.12" + "@storybook/client-logger" "6.3.12" + "@storybook/core-events" "6.3.12" + core-js "^3.8.2" + global "^4.4.0" + qs "^6.10.0" + telejson "^5.3.2" -"@storybook/channels@6.2.9": - version "6.2.9" - resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-6.2.9.tgz#a9fd7f25102cbec15fb56f76abf891b7b214e9de" - integrity sha512-6dC8Fb2ipNyOQXnUZMDeEUaJGH5DMLzyHlGLhVyDtrO5WR6bO8mQdkzf4+5dSKXgCBNX0BSkssXth4pDjn18rg== +"@storybook/channels@6.3.12": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-6.3.12.tgz#aa0d793895a8b211f0ad3459c61c1bcafd0093c7" + integrity sha512-l4sA+g1PdUV8YCbgs47fIKREdEQAKNdQIZw0b7BfTvY9t0x5yfBywgQhYON/lIeiNGz2OlIuD+VUtqYfCtNSyw== dependencies: core-js "^3.8.2" ts-dedent "^2.0.0" util-deprecate "^1.0.2" -"@storybook/client-api@6.1.20": - version "6.1.20" - resolved "https://registry.yarnpkg.com/@storybook/client-api/-/client-api-6.1.20.tgz#bf6fb3e247a599d2d6c7502898f336ff79e4df4c" - integrity sha512-QLM8h0h8HWkHRh3GYoO6PdwYX4No4/J7oYg6cNVhNbhA9l4a3HDLEyfBGojU4ZUDd2feJ8Sgml92UoP4Vrj0kg== +"@storybook/client-api@6.3.12": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@storybook/client-api/-/client-api-6.3.12.tgz#a0c6d72a871d1cb02b4b98675472839061e39b5b" + integrity sha512-xnW+lKKK2T774z+rOr9Wopt1aYTStfb86PSs9p3Fpnc2Btcftln+C3NtiHZl8Ccqft8Mz/chLGgewRui6tNI8g== dependencies: - "@storybook/addons" "6.1.20" - "@storybook/channel-postmessage" "6.1.20" - "@storybook/channels" "6.1.20" - "@storybook/client-logger" "6.1.20" - "@storybook/core-events" "6.1.20" + "@storybook/addons" "6.3.12" + "@storybook/channel-postmessage" "6.3.12" + "@storybook/channels" "6.3.12" + "@storybook/client-logger" "6.3.12" + "@storybook/core-events" "6.3.12" "@storybook/csf" "0.0.1" - "@types/qs" "^6.9.0" - "@types/webpack-env" "^1.15.3" - core-js "^3.0.1" - global "^4.3.2" - lodash "^4.17.15" + "@types/qs" "^6.9.5" + "@types/webpack-env" "^1.16.0" + core-js "^3.8.2" + global "^4.4.0" + lodash "^4.17.20" memoizerific "^1.11.3" - qs "^6.6.0" + qs "^6.10.0" regenerator-runtime "^0.13.7" stable "^0.1.8" - store2 "^2.7.1" + store2 "^2.12.0" ts-dedent "^2.0.0" util-deprecate "^1.0.2" -"@storybook/client-logger@6.1.20": - version "6.1.20" - resolved "https://registry.yarnpkg.com/@storybook/client-logger/-/client-logger-6.1.20.tgz#f78102bbf4d169c45c5202c1b01cb1e58140be30" - integrity sha512-UKq+5vRXZXcwLgjXEK/NoL61JXar51aSDwnPa4jEFXRpXvIbHZzr6U3TO6r2J2LkTEJO54V2k8F2wnZgUvm3QA== - dependencies: - core-js "^3.0.1" - global "^4.3.2" - -"@storybook/client-logger@6.2.9": - version "6.2.9" - resolved "https://registry.yarnpkg.com/@storybook/client-logger/-/client-logger-6.2.9.tgz#77c1ea39684ad2a2cf6836051b381fc5b354e132" - integrity sha512-IfOQZuvpjh66qBInQCJOb9S0dTGpzZ/Cxlcvokp+PYt95KztaWN3mPm+HaDQCeRsrWNe0Bpm1zuickcJ6dBOXg== +"@storybook/client-logger@6.3.12": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@storybook/client-logger/-/client-logger-6.3.12.tgz#6585c98923b49fcb25dbceeeb96ef2a83e28e0f4" + integrity sha512-zNDsamZvHnuqLznDdP9dUeGgQ9TyFh4ray3t1VGO7ZqWVZ2xtVCCXjDvMnOXI2ifMpX5UsrOvshIPeE9fMBmiQ== dependencies: core-js "^3.8.2" global "^4.4.0" -"@storybook/components@6.1.20", "@storybook/components@^6.1.20": - version "6.1.20" - resolved "https://registry.yarnpkg.com/@storybook/components/-/components-6.1.20.tgz#90834d76d50a17172f8c480e0f366ebade31e108" - integrity sha512-X4k2PF3Q60p3rgRkGtjWh0DWP9tqdwMRwDjA6TGj8WyRM2FdROlmH/hwRy9Op/cs2Yj8ApkUJk8AMUm3hBhYvQ== +"@storybook/components@6.3.12", "@storybook/components@^6.3.0", "@storybook/components@^6.3.12": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@storybook/components/-/components-6.3.12.tgz#0c7967c60354c84afa20dfab4753105e49b1927d" + integrity sha512-kdQt8toUjynYAxDLrJzuG7YSNL6as1wJoyzNUaCfG06YPhvIAlKo7le9tS2mThVFN5e9nbKrW3N1V1sp6ypZXQ== dependencies: - "@popperjs/core" "^2.5.4" - "@storybook/client-logger" "6.1.20" + "@popperjs/core" "^2.6.0" + "@storybook/client-logger" "6.3.12" "@storybook/csf" "0.0.1" - "@storybook/theming" "6.1.20" - "@types/overlayscrollbars" "^1.9.0" - "@types/react-color" "^3.0.1" - "@types/react-syntax-highlighter" "11.0.4" - core-js "^3.0.1" - fast-deep-equal "^3.1.1" - global "^4.3.2" - lodash "^4.17.15" - markdown-to-jsx "^6.11.4" + "@storybook/theming" "6.3.12" + "@types/color-convert" "^2.0.0" + "@types/overlayscrollbars" "^1.12.0" + "@types/react-syntax-highlighter" "11.0.5" + color-convert "^2.0.1" + core-js "^3.8.2" + fast-deep-equal "^3.1.3" + global "^4.4.0" + lodash "^4.17.20" + markdown-to-jsx "^7.1.3" memoizerific "^1.11.3" - overlayscrollbars "^1.10.2" - polished "^3.4.4" - react-color "^2.17.0" + overlayscrollbars "^1.13.1" + polished "^4.0.5" + prop-types "^15.7.2" + react-colorful "^5.1.2" react-popper-tooltip "^3.1.1" - react-syntax-highlighter "^13.5.0" - react-textarea-autosize "^8.1.1" + react-syntax-highlighter "^13.5.3" + react-textarea-autosize "^8.3.0" regenerator-runtime "^0.13.7" ts-dedent "^2.0.0" + util-deprecate "^1.0.2" -"@storybook/core-events@6.1.20", "@storybook/core-events@^6.1.20": - version "6.1.20" - resolved "https://registry.yarnpkg.com/@storybook/core-events/-/core-events-6.1.20.tgz#a23fe6ff858c0a4c48f89beaca1e50be5ba0b598" - integrity sha512-OPKNCbETTrGGypxFzDtsE2cGdHDNolVSJv1mZ17fr9lquc5eyJJCAJ4HbPk+OocRuHBKEnc1/pcA+wWKBM+vnA== - dependencies: - core-js "^3.0.1" - -"@storybook/core-events@6.2.9": - version "6.2.9" - resolved "https://registry.yarnpkg.com/@storybook/core-events/-/core-events-6.2.9.tgz#4f12947cd15d1eb3c4109923657c012feef521cd" - integrity sha512-xQmbX/oYQK1QsAGN8hriXX5SUKOoTUe3L4dVaVHxJqy7MReRWJpprJmCpbAPJzWS6WCbDFfCM5kVEexHLOzJlQ== +"@storybook/core-client@6.3.12": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@storybook/core-client/-/core-client-6.3.12.tgz#fd01bfbc69c331f4451973a4e7597624dc3737e5" + integrity sha512-8Smd9BgZHJpAdevLKQYinwtjSyCZAuBMoetP4P5hnn53mWl0NFbrHFaAdT+yNchDLZQUbf7Y18VmIqEH+RCR5w== dependencies: + "@storybook/addons" "6.3.12" + "@storybook/channel-postmessage" "6.3.12" + "@storybook/client-api" "6.3.12" + "@storybook/client-logger" "6.3.12" + "@storybook/core-events" "6.3.12" + "@storybook/csf" "0.0.1" + "@storybook/ui" "6.3.12" + airbnb-js-shims "^2.2.1" + ansi-to-html "^0.6.11" core-js "^3.8.2" + global "^4.4.0" + lodash "^4.17.20" + qs "^6.10.0" + regenerator-runtime "^0.13.7" + ts-dedent "^2.0.0" + unfetch "^4.2.0" + util-deprecate "^1.0.2" -"@storybook/core@6.1.20", "@storybook/core@^6.1.20": - version "6.1.20" - resolved "https://registry.yarnpkg.com/@storybook/core/-/core-6.1.20.tgz#57e8a86305f7da6cdc13185299c4c5f4b90b7308" - integrity sha512-cXca0s+ixoouXwPXeUoE9sB5OEkOUpkGAA78W8MLP4IHlI09ZBFCmLP989JdcCT2EjFBQ1V/UudNkQHMlyIl2A== +"@storybook/core-common@6.3.12", "@storybook/core-common@^6.3.12": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@storybook/core-common/-/core-common-6.3.12.tgz#95ce953d7efda44394b159322d6a2280c202f21c" + integrity sha512-xlHs2QXELq/moB4MuXjYOczaxU64BIseHsnFBLyboJYN6Yso3qihW5RB7cuJlGohkjb4JwY74dvfT4Ww66rkBA== dependencies: - "@babel/core" "^7.12.3" + "@babel/core" "^7.12.10" "@babel/plugin-proposal-class-properties" "^7.12.1" - "@babel/plugin-proposal-decorators" "^7.12.1" + "@babel/plugin-proposal-decorators" "^7.12.12" "@babel/plugin-proposal-export-default-from" "^7.12.1" "@babel/plugin-proposal-nullish-coalescing-operator" "^7.12.1" "@babel/plugin-proposal-object-rest-spread" "^7.12.1" - "@babel/plugin-proposal-optional-chaining" "^7.12.1" + "@babel/plugin-proposal-optional-chaining" "^7.12.7" "@babel/plugin-proposal-private-methods" "^7.12.1" "@babel/plugin-syntax-dynamic-import" "^7.8.3" "@babel/plugin-transform-arrow-functions" "^7.12.1" - "@babel/plugin-transform-block-scoping" "^7.12.1" + "@babel/plugin-transform-block-scoping" "^7.12.12" "@babel/plugin-transform-classes" "^7.12.1" "@babel/plugin-transform-destructuring" "^7.12.1" "@babel/plugin-transform-for-of" "^7.12.1" "@babel/plugin-transform-parameters" "^7.12.1" "@babel/plugin-transform-shorthand-properties" "^7.12.1" "@babel/plugin-transform-spread" "^7.12.1" - "@babel/plugin-transform-template-literals" "^7.12.1" - "@babel/preset-env" "^7.12.1" - "@babel/preset-react" "^7.12.1" - "@babel/preset-typescript" "^7.12.1" + "@babel/preset-env" "^7.12.11" + "@babel/preset-react" "^7.12.10" + "@babel/preset-typescript" "^7.12.7" "@babel/register" "^7.12.1" - "@storybook/addons" "6.1.20" - "@storybook/api" "6.1.20" - "@storybook/channel-postmessage" "6.1.20" - "@storybook/channels" "6.1.20" - "@storybook/client-api" "6.1.20" - "@storybook/client-logger" "6.1.20" - "@storybook/components" "6.1.20" - "@storybook/core-events" "6.1.20" - "@storybook/csf" "0.0.1" - "@storybook/node-logger" "6.1.20" - "@storybook/router" "6.1.20" + "@storybook/node-logger" "6.3.12" "@storybook/semver" "^7.3.2" - "@storybook/theming" "6.1.20" - "@storybook/ui" "6.1.20" "@types/glob-base" "^0.3.0" "@types/micromatch" "^4.0.1" - "@types/node-fetch" "^2.5.4" - airbnb-js-shims "^2.2.1" - ansi-to-html "^0.6.11" - autoprefixer "^9.7.2" - babel-loader "^8.0.6" - babel-plugin-emotion "^10.0.20" - babel-plugin-macros "^2.8.0" - babel-preset-minify "^0.5.0 || 0.6.0-alpha.5" - better-opn "^2.0.0" - boxen "^4.1.0" - case-sensitive-paths-webpack-plugin "^2.2.0" - chalk "^4.0.0" - cli-table3 "0.6.0" - commander "^5.0.0" - core-js "^3.0.1" - cpy "^8.1.1" - css-loader "^3.5.3" - detect-port "^1.3.0" - dotenv-webpack "^1.7.0" - ejs "^3.1.2" - express "^4.17.0" - file-loader "^6.0.0" + "@types/node" "^14.0.10" + "@types/pretty-hrtime" "^1.0.0" + babel-loader "^8.2.2" + babel-plugin-macros "^3.0.1" + babel-plugin-polyfill-corejs3 "^0.1.0" + chalk "^4.1.0" + core-js "^3.8.2" + express "^4.17.1" file-system-cache "^1.0.5" - find-up "^4.1.0" - fork-ts-checker-webpack-plugin "^4.1.4" - fs-extra "^9.0.0" + find-up "^5.0.0" + fork-ts-checker-webpack-plugin "^6.0.4" glob "^7.1.6" glob-base "^0.3.0" - glob-promise "^3.4.0" - global "^4.3.2" - html-webpack-plugin "^4.2.1" - inquirer "^7.0.0" - interpret "^2.0.0" - ip "^1.1.5" - json5 "^2.1.1" + interpret "^2.2.0" + json5 "^2.1.3" lazy-universal-dotenv "^3.0.1" micromatch "^4.0.2" - node-fetch "^2.6.0" - pkg-dir "^4.2.0" - pnp-webpack-plugin "1.6.4" - postcss-flexbugs-fixes "^4.1.0" - postcss-loader "^3.0.0" + pkg-dir "^5.0.0" pretty-hrtime "^1.0.3" - qs "^6.6.0" - raw-loader "^4.0.1" - react-dev-utils "^11.0.3" - regenerator-runtime "^0.13.7" resolve-from "^5.0.0" + ts-dedent "^2.0.0" + util-deprecate "^1.0.2" + webpack "4" + +"@storybook/core-events@6.3.12", "@storybook/core-events@^6.3.0", "@storybook/core-events@^6.3.12": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@storybook/core-events/-/core-events-6.3.12.tgz#73f6271d485ef2576234e578bb07705b92805290" + integrity sha512-SXfD7xUUMazaeFkB92qOTUV8Y/RghE4SkEYe5slAdjeocSaH7Nz2WV0rqNEgChg0AQc+JUI66no8L9g0+lw4Gw== + dependencies: + core-js "^3.8.2" + +"@storybook/core-server@6.3.12": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@storybook/core-server/-/core-server-6.3.12.tgz#d906f823b263d78a4b087be98810b74191d263cd" + integrity sha512-T/Mdyi1FVkUycdyOnhXvoo3d9nYXLQFkmaJkltxBFLzAePAJUSgAsPL9odNC3+p8Nr2/UDsDzvu/Ow0IF0mzLQ== + dependencies: + "@discoveryjs/json-ext" "^0.5.3" + "@storybook/builder-webpack4" "6.3.12" + "@storybook/core-client" "6.3.12" + "@storybook/core-common" "6.3.12" + "@storybook/csf-tools" "6.3.12" + "@storybook/manager-webpack4" "6.3.12" + "@storybook/node-logger" "6.3.12" + "@storybook/semver" "^7.3.2" + "@types/node" "^14.0.10" + "@types/node-fetch" "^2.5.7" + "@types/pretty-hrtime" "^1.0.0" + "@types/webpack" "^4.41.26" + better-opn "^2.1.1" + boxen "^4.2.0" + chalk "^4.1.0" + cli-table3 "0.6.0" + commander "^6.2.1" + compression "^1.7.4" + core-js "^3.8.2" + cpy "^8.1.1" + detect-port "^1.3.0" + express "^4.17.1" + file-system-cache "^1.0.5" + fs-extra "^9.0.1" + globby "^11.0.2" + ip "^1.1.5" + node-fetch "^2.6.1" + pretty-hrtime "^1.0.3" + prompts "^2.4.0" + regenerator-runtime "^0.13.7" serve-favicon "^2.5.0" - shelljs "^0.8.4" - stable "^0.1.8" - style-loader "^1.2.1" - telejson "^5.0.2" - terser-webpack-plugin "^3.0.0" ts-dedent "^2.0.0" - unfetch "^4.1.0" - url-loader "^4.0.0" util-deprecate "^1.0.2" - webpack "^4.44.2" - webpack-dev-middleware "^3.7.0" - webpack-filter-warnings-plugin "^1.2.1" - webpack-hot-middleware "^2.25.0" - webpack-virtual-modules "^0.2.2" + webpack "4" + +"@storybook/core@6.3.12", "@storybook/core@^6.3.12": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@storybook/core/-/core-6.3.12.tgz#eb945f7ed5c9039493318bcd2bb5a3a897b91cfd" + integrity sha512-FJm2ns8wk85hXWKslLWiUWRWwS9KWRq7jlkN6M9p57ghFseSGr4W71Orcoab4P3M7jI97l5yqBfppbscinE74g== + dependencies: + "@storybook/core-client" "6.3.12" + "@storybook/core-server" "6.3.12" + +"@storybook/csf-tools@6.3.12": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@storybook/csf-tools/-/csf-tools-6.3.12.tgz#d979c6a79d1e9d6c8b5a5e8834d07fcf5b793844" + integrity sha512-wNrX+99ajAXxLo0iRwrqw65MLvCV6SFC0XoPLYrtBvyKr+hXOOnzIhO2f5BNEii8velpC2gl2gcLKeacpVYLqA== + dependencies: + "@babel/generator" "^7.12.11" + "@babel/parser" "^7.12.11" + "@babel/plugin-transform-react-jsx" "^7.12.12" + "@babel/preset-env" "^7.12.11" + "@babel/traverse" "^7.12.11" + "@babel/types" "^7.12.11" + "@mdx-js/mdx" "^1.6.22" + "@storybook/csf" "^0.0.1" + core-js "^3.8.2" + fs-extra "^9.0.1" + js-string-escape "^1.0.1" + lodash "^4.17.20" + prettier "~2.2.1" + regenerator-runtime "^0.13.7" -"@storybook/csf@0.0.1": +"@storybook/csf@0.0.1", "@storybook/csf@^0.0.1": version "0.0.1" resolved "https://registry.yarnpkg.com/@storybook/csf/-/csf-0.0.1.tgz#95901507dc02f0bc6f9ac8ee1983e2fc5bb98ce6" integrity sha512-USTLkZze5gkel8MYCujSRBVIrUQ3YPBrLOx7GNk/0wttvVtlzWXAq9eLbQ4p/NicGxP+3T7KPEMVV//g+yubpw== dependencies: lodash "^4.17.15" -"@storybook/node-logger@6.1.20", "@storybook/node-logger@^6.1.20": - version "6.1.20" - resolved "https://registry.yarnpkg.com/@storybook/node-logger/-/node-logger-6.1.20.tgz#40ec44bfd36e799089c831ecb86588c730023e6c" - integrity sha512-Z6337htb1mxIccvCx2Ai0v9LPDlBlmXzeWhap3q2Y6hg8g1p4+0W5Y6bG9RmXqJoXLaT1trO8uAXgGO7AN92yg== +"@storybook/manager-webpack4@6.3.12": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@storybook/manager-webpack4/-/manager-webpack4-6.3.12.tgz#1c10a60b0acec3f9136dd8b7f22a25469d8b91e5" + integrity sha512-OkPYNrHXg2yZfKmEfTokP6iKx4OLTr0gdI5yehi/bLEuQCSHeruxBc70Dxm1GBk1Mrf821wD9WqMXNDjY5Qtug== + dependencies: + "@babel/core" "^7.12.10" + "@babel/plugin-transform-template-literals" "^7.12.1" + "@babel/preset-react" "^7.12.10" + "@storybook/addons" "6.3.12" + "@storybook/core-client" "6.3.12" + "@storybook/core-common" "6.3.12" + "@storybook/node-logger" "6.3.12" + "@storybook/theming" "6.3.12" + "@storybook/ui" "6.3.12" + "@types/node" "^14.0.10" + "@types/webpack" "^4.41.26" + babel-loader "^8.2.2" + case-sensitive-paths-webpack-plugin "^2.3.0" + chalk "^4.1.0" + core-js "^3.8.2" + css-loader "^3.6.0" + dotenv-webpack "^1.8.0" + express "^4.17.1" + file-loader "^6.2.0" + file-system-cache "^1.0.5" + find-up "^5.0.0" + fs-extra "^9.0.1" + html-webpack-plugin "^4.0.0" + node-fetch "^2.6.1" + pnp-webpack-plugin "1.6.4" + read-pkg-up "^7.0.1" + regenerator-runtime "^0.13.7" + resolve-from "^5.0.0" + style-loader "^1.3.0" + telejson "^5.3.2" + terser-webpack-plugin "^4.2.3" + ts-dedent "^2.0.0" + url-loader "^4.1.1" + util-deprecate "^1.0.2" + webpack "4" + webpack-dev-middleware "^3.7.3" + webpack-virtual-modules "^0.2.2" + +"@storybook/node-logger@6.3.12", "@storybook/node-logger@^6.3.12": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@storybook/node-logger/-/node-logger-6.3.12.tgz#a67cfbe266d2692f317914ef583721627498df19" + integrity sha512-iktOem/Ls2+dsZY9PhPeC6T1QhX/y7OInP88neLsqEPEbB2UXca3Ydv7OZBhBVbvN25W45b05MRzbtNUxYLNRw== dependencies: "@types/npmlog" "^4.1.2" - chalk "^4.0.0" - core-js "^3.0.1" + chalk "^4.1.0" + core-js "^3.8.2" npmlog "^4.1.2" pretty-hrtime "^1.0.3" -"@storybook/postinstall@6.1.20": - version "6.1.20" - resolved "https://registry.yarnpkg.com/@storybook/postinstall/-/postinstall-6.1.20.tgz#3e31f061f3f07f9a4955b970b963796734a45799" - integrity sha512-k9yLNN4T6KrvzWntU504NMesUQEg5YcsqKfNGjpTfKKRJjMR3+k74pbUZFC+XJEfMkCvSkWsJ2NRcE65bAMm3w== +"@storybook/postinstall@6.3.12": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@storybook/postinstall/-/postinstall-6.3.12.tgz#ed98caff76d8c1a1733ec630565ef4162b274614" + integrity sha512-HkZ+abtZ3W6JbGPS6K7OSnNXbwaTwNNd5R02kRs4gV9B29XsBPDtFT6vIwzM3tmVQC7ihL5a8ceWp2OvzaNOuw== dependencies: - core-js "^3.0.1" + core-js "^3.8.2" + +"@storybook/react-docgen-typescript-plugin@1.0.2-canary.253f8c1.0": + version "1.0.2-canary.253f8c1.0" + resolved "https://registry.yarnpkg.com/@storybook/react-docgen-typescript-plugin/-/react-docgen-typescript-plugin-1.0.2-canary.253f8c1.0.tgz#f2da40e6aae4aa586c2fb284a4a1744602c3c7fa" + integrity sha512-mmoRG/rNzAiTbh+vGP8d57dfcR2aP+5/Ll03KKFyfy5FqWFm/Gh7u27ikx1I3LmVMI8n6jh5SdWMkMKon7/tDw== + dependencies: + debug "^4.1.1" + endent "^2.0.1" + find-cache-dir "^3.3.1" + flat-cache "^3.0.4" + micromatch "^4.0.2" + react-docgen-typescript "^2.0.0" + tslib "^2.0.0" -"@storybook/react@^6.1.20": - version "6.1.20" - resolved "https://registry.yarnpkg.com/@storybook/react/-/react-6.1.20.tgz#0e2b858107fc139aa01a1d0fb2dca0611dd2224b" - integrity sha512-9NCWxLXJSjEy/DP9fC8Uj7zUljPA6eREjZuNElHGRI/Tg5R/QBuQnBJX9EagLic1lzpcUbsfWJ/+Bpa2qLXAEw== +"@storybook/react@^6.3.12": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@storybook/react/-/react-6.3.12.tgz#2e172cbfc06f656d2890743dcf49741a10fa1629" + integrity sha512-c1Y/3/eNzye+ZRwQ3BXJux6pUMVt3lhv1/M9Qagl9JItP3jDSj5Ed3JHCgwEqpprP8mvNNXwEJ8+M7vEQyDuHg== dependencies: "@babel/preset-flow" "^7.12.1" - "@babel/preset-react" "^7.12.1" - "@pmmmwh/react-refresh-webpack-plugin" "^0.4.2" - "@storybook/addons" "6.1.20" - "@storybook/core" "6.1.20" - "@storybook/node-logger" "6.1.20" + "@babel/preset-react" "^7.12.10" + "@pmmmwh/react-refresh-webpack-plugin" "^0.4.3" + "@storybook/addons" "6.3.12" + "@storybook/core" "6.3.12" + "@storybook/core-common" "6.3.12" + "@storybook/node-logger" "6.3.12" + "@storybook/react-docgen-typescript-plugin" "1.0.2-canary.253f8c1.0" "@storybook/semver" "^7.3.2" - "@types/webpack-env" "^1.15.3" + "@types/webpack-env" "^1.16.0" babel-plugin-add-react-displayname "^0.0.5" babel-plugin-named-asset-import "^0.3.1" babel-plugin-react-docgen "^4.2.1" - core-js "^3.0.1" - global "^4.3.2" - lodash "^4.17.15" + core-js "^3.8.2" + global "^4.4.0" + lodash "^4.17.20" prop-types "^15.7.2" react-dev-utils "^11.0.3" - react-docgen-typescript-plugin "^0.6.2" react-refresh "^0.8.3" + read-pkg-up "^7.0.1" regenerator-runtime "^0.13.7" ts-dedent "^2.0.0" - webpack "^4.44.2" + webpack "4" -"@storybook/router@6.1.20": - version "6.1.20" - resolved "https://registry.yarnpkg.com/@storybook/router/-/router-6.1.20.tgz#8d27379f53439762f503d77ce4ec2e9ac80644b4" - integrity sha512-hIJiy60znxu9fJgnFP3n5C9YdWr/bHk77vowf0nO0v+dd59EKlgh7ibiDi48Fe2PMU95pYGb6mCDouNS+boN0w== - dependencies: - "@reach/router" "^1.3.3" - "@types/reach__router" "^1.3.7" - core-js "^3.0.1" - global "^4.3.2" - memoizerific "^1.11.3" - qs "^6.6.0" - -"@storybook/router@6.2.9": - version "6.2.9" - resolved "https://registry.yarnpkg.com/@storybook/router/-/router-6.2.9.tgz#547543031dd8330870bb6b473dcf7e51982e841c" - integrity sha512-7Bn1OFoItCl8whXRT8N1qp1Lky7kzXJ3aslWp5E8HcM8rxh4OYXfbaeiyJEJxBTGC5zxgY+tAEXHFjsAviFROg== +"@storybook/router@6.3.12": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@storybook/router/-/router-6.3.12.tgz#0d572ec795f588ca886f39cb9b27b94ff3683f84" + integrity sha512-G/pNGCnrJRetCwyEZulHPT+YOcqEj/vkPVDTUfii2qgqukup6K0cjwgd7IukAURnAnnzTi1gmgFuEKUi8GE/KA== dependencies: "@reach/router" "^1.3.4" - "@storybook/client-logger" "6.2.9" + "@storybook/client-logger" "6.3.12" "@types/reach__router" "^1.3.7" core-js "^3.8.2" fast-deep-equal "^3.1.3" @@ -4770,55 +4782,36 @@ core-js "^3.6.5" find-up "^4.1.0" -"@storybook/source-loader@6.1.20": - version "6.1.20" - resolved "https://registry.yarnpkg.com/@storybook/source-loader/-/source-loader-6.1.20.tgz#884f982430a422063a8a0edee0af1d72dabc75d2" - integrity sha512-rxfh+6JoPrw9RIB+yQ81VpRt586rlLC6mNeGthuwq1KLrw6j4B6Uk3VK0zE1mWdqVfVZZH3SuzM/KEGK86XlTg== +"@storybook/source-loader@6.3.12": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@storybook/source-loader/-/source-loader-6.3.12.tgz#86e72824c04ad0eaa89b807857bd845db97e57bd" + integrity sha512-Lfe0LOJGqAJYkZsCL8fhuQOeFSCgv8xwQCt4dkcBd0Rw5zT2xv0IXDOiIOXGaWBMDtrJUZt/qOXPEPlL81Oaqg== dependencies: - "@storybook/addons" "6.1.20" - "@storybook/client-logger" "6.1.20" + "@storybook/addons" "6.3.12" + "@storybook/client-logger" "6.3.12" "@storybook/csf" "0.0.1" - core-js "^3.0.1" - estraverse "^4.2.0" - global "^4.3.2" + core-js "^3.8.2" + estraverse "^5.2.0" + global "^4.4.0" loader-utils "^2.0.0" - lodash "^4.17.15" - prettier "~2.0.5" + lodash "^4.17.20" + prettier "~2.2.1" regenerator-runtime "^0.13.7" - source-map "^0.7.3" -"@storybook/testing-react@^0.0.17": - version "0.0.17" - resolved "https://registry.yarnpkg.com/@storybook/testing-react/-/testing-react-0.0.17.tgz#632dd22f8815743f78c182b126f444cf51d92d71" - integrity sha512-93nbA/JSWDEys1msd438+wzETRFDEgT2aFqJL2y46++zsyv8g2mCYKZkf9E36KQHMQbO1uJBHT8CmrLQa8VmZw== +"@storybook/testing-react@^0.0.22": + version "0.0.22" + resolved "https://registry.yarnpkg.com/@storybook/testing-react/-/testing-react-0.0.22.tgz#65d3defefbac0183eded0dafb601241d8f135c66" + integrity sha512-XBJpH1cROXkwwKwD89kIcyhyMPEN5zfSyOUanrN+/Tx4nB5IwzVc/Om+7mtSFvh4UTSNOk5G42Y12KE/HbH7VA== -"@storybook/theming@6.1.20", "@storybook/theming@^6.1.20": - version "6.1.20" - resolved "https://registry.yarnpkg.com/@storybook/theming/-/theming-6.1.20.tgz#ed0b330a5c08bbe998e9df95e615f0e84a8d663f" - integrity sha512-yg56fa4uhXs+oNmwSHw/jAt1sWpAfq2k6aP1FOtWiEI372g7ZYddP/0ENoj07R+8jZxkvafLNhMI20aIxXpvTQ== - dependencies: - "@emotion/core" "^10.1.1" - "@emotion/is-prop-valid" "^0.8.6" - "@emotion/styled" "^10.0.23" - "@storybook/client-logger" "6.1.20" - core-js "^3.0.1" - deep-object-diff "^1.1.0" - emotion-theming "^10.0.19" - global "^4.3.2" - memoizerific "^1.11.3" - polished "^3.4.4" - resolve-from "^5.0.0" - ts-dedent "^2.0.0" - -"@storybook/theming@6.2.9": - version "6.2.9" - resolved "https://registry.yarnpkg.com/@storybook/theming/-/theming-6.2.9.tgz#16bf40180861f222c7ed1d80abd5d1e3cb315660" - integrity sha512-183oJW7AD7Fhqg5NT4ct3GJntwteAb9jZnQ6yhf9JSdY+fk8OhxRbPf7ov0au2gYACcGrWDd9K5pYQsvWlP5gA== +"@storybook/theming@6.3.12", "@storybook/theming@^6.3.12": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@storybook/theming/-/theming-6.3.12.tgz#5bddf9bd90a60709b5ab238ecdb7d9055dd7862e" + integrity sha512-wOJdTEa/VFyFB2UyoqyYGaZdym6EN7RALuQOAMT6zHA282FBmKw8nL5DETHEbctpnHdcrMC/391teK4nNSrdOA== dependencies: "@emotion/core" "^10.1.1" "@emotion/is-prop-valid" "^0.8.6" "@emotion/styled" "^10.0.27" - "@storybook/client-logger" "6.2.9" + "@storybook/client-logger" "6.3.12" core-js "^3.8.2" deep-object-diff "^1.1.0" emotion-theming "^10.0.27" @@ -4828,41 +4821,40 @@ resolve-from "^5.0.0" ts-dedent "^2.0.0" -"@storybook/ui@6.1.20": - version "6.1.20" - resolved "https://registry.yarnpkg.com/@storybook/ui/-/ui-6.1.20.tgz#ba585e2f600257e9168e8e5cb704c63593daeb69" - integrity sha512-XKsSgPjoThIzyxltJercXWRFErF99qOVJWYYCZ6/K0WuYHR4wncRPwN9/ur7BboWFJGWlCJll7fredFAmidP+g== +"@storybook/ui@6.3.12": + version "6.3.12" + resolved "https://registry.yarnpkg.com/@storybook/ui/-/ui-6.3.12.tgz#349e1a4c58c4fd18ea65b2ab56269a7c3a164ee7" + integrity sha512-PC2yEz4JMfarq7rUFbeA3hCA+31p5es7YPEtxLRvRwIZhtL0P4zQUfHpotb3KgWdoAIfZesAuoIQwMPQmEFYrw== dependencies: "@emotion/core" "^10.1.1" - "@storybook/addons" "6.1.20" - "@storybook/api" "6.1.20" - "@storybook/channels" "6.1.20" - "@storybook/client-logger" "6.1.20" - "@storybook/components" "6.1.20" - "@storybook/core-events" "6.1.20" - "@storybook/router" "6.1.20" + "@storybook/addons" "6.3.12" + "@storybook/api" "6.3.12" + "@storybook/channels" "6.3.12" + "@storybook/client-logger" "6.3.12" + "@storybook/components" "6.3.12" + "@storybook/core-events" "6.3.12" + "@storybook/router" "6.3.12" "@storybook/semver" "^7.3.2" - "@storybook/theming" "6.1.20" - "@types/markdown-to-jsx" "^6.11.0" - copy-to-clipboard "^3.0.8" - core-js "^3.0.1" - core-js-pure "^3.0.1" - downshift "^6.0.6" - emotion-theming "^10.0.19" + "@storybook/theming" "6.3.12" + "@types/markdown-to-jsx" "^6.11.3" + copy-to-clipboard "^3.3.1" + core-js "^3.8.2" + core-js-pure "^3.8.2" + downshift "^6.0.15" + emotion-theming "^10.0.27" fuse.js "^3.6.1" - global "^4.3.2" - lodash "^4.17.15" + global "^4.4.0" + lodash "^4.17.20" markdown-to-jsx "^6.11.4" memoizerific "^1.11.3" - polished "^3.4.4" - qs "^6.6.0" - react-draggable "^4.0.3" - react-helmet-async "^1.0.2" - react-hotkeys "2.0.0" - react-sizeme "^2.6.7" + polished "^4.0.5" + qs "^6.10.0" + react-draggable "^4.4.3" + react-helmet-async "^1.0.7" + react-sizeme "^3.0.1" regenerator-runtime "^0.13.7" resolve-from "^5.0.0" - store2 "^2.7.1" + store2 "^2.12.0" "@stylelint/postcss-css-in-js@^0.37.2": version "0.37.2" @@ -5139,11 +5131,6 @@ dependencies: "@turf/helpers" "6.x" -"@types/anymatch@*": - version "1.3.1" - resolved "https://registry.yarnpkg.com/@types/anymatch/-/anymatch-1.3.1.tgz#336badc1beecb9dacc38bea2cf32adf627a8421a" - integrity sha512-/+CRPXpBDpo2RK9C68N3b2cOvO0Cf5B9aPijHsoDQTHivnGSObdOF2BRQOYjojWTDy6nQvMjmqRXIxH55VjxxA== - "@types/apidoc@^0.22.3": version "0.22.3" resolved "https://registry.yarnpkg.com/@types/apidoc/-/apidoc-0.22.3.tgz#0227f4b8189b5cde42d23ed81a858526959fc2b7" @@ -5215,6 +5202,14 @@ resolved "https://registry.yarnpkg.com/@types/base64-js/-/base64-js-1.2.5.tgz#582b2476169a6cba460a214d476c744441d873d5" integrity sha1-WCskdhaabLpGCiFNR2x0REHYc9U= +"@types/body-parser@*": + version "1.19.2" + resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.2.tgz#aea2059e28b7658639081347ac4fab3de166e6f0" + integrity sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g== + dependencies: + "@types/connect" "*" + "@types/node" "*" + "@types/braces@*": version "3.0.0" resolved "https://registry.yarnpkg.com/@types/braces/-/braces-3.0.0.tgz#7da1c0d44ff1c7eb660a36ec078ea61ba7eb42cb" @@ -5281,6 +5276,13 @@ dependencies: "@types/color-name" "*" +"@types/color-convert@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@types/color-convert/-/color-convert-2.0.0.tgz#8f5ee6b9e863dcbee5703f5a517ffb13d3ea4e22" + integrity sha512-m7GG7IKKGuJUXvkZ1qqG3ChccdIM/qBBo913z+Xft0nKCX4hAU/IxKwZBU4cpRZ7GS5kV4vOblUkILtSShCPXQ== + dependencies: + "@types/color-name" "*" + "@types/color-name@*", "@types/color-name@^1.1.1": version "1.1.1" resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" @@ -5300,6 +5302,13 @@ dependencies: "@types/webpack" "*" +"@types/connect@*": + version "3.4.35" + resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.35.tgz#5fcf6ae445e4021d1fc2219a4873cc73a3bb2ad1" + integrity sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ== + dependencies: + "@types/node" "*" + "@types/cookiejar@*": version "2.1.0" resolved "https://registry.yarnpkg.com/@types/cookiejar/-/cookiejar-2.1.0.tgz#4b7daf2c51696cfc70b942c11690528229d1a1ce" @@ -5425,6 +5434,25 @@ resolved "https://registry.yarnpkg.com/@types/expect/-/expect-1.20.4.tgz#8288e51737bf7e3ab5d7c77bfa695883745264e5" integrity sha512-Q5Vn3yjTDyCMV50TB6VRIbQNxSE4OmZR86VSbGaNpfUolm0iePBB4KdEEHmxoY5sT2+2DIvXW0rvMDP2nHZ4Mg== +"@types/express-serve-static-core@^4.17.18": + version "4.17.25" + resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.25.tgz#e42f7046adc65ece2eb6059b77aecfbe9e9f82e0" + integrity sha512-OUJIVfRMFijZukGGwTpKNFprqCCXk5WjNGvUgB/CxxBR40QWSjsNK86+yvGKlCOGc7sbwfHLaXhkG+NsytwBaQ== + dependencies: + "@types/node" "*" + "@types/qs" "*" + "@types/range-parser" "*" + +"@types/express@^4.17.13": + version "4.17.13" + resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.13.tgz#a76e2995728999bab51a33fabce1d705a3709034" + integrity sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA== + dependencies: + "@types/body-parser" "*" + "@types/express-serve-static-core" "^4.17.18" + "@types/qs" "*" + "@types/serve-static" "*" + "@types/extract-zip@^1.6.2": version "1.6.2" resolved "https://registry.yarnpkg.com/@types/extract-zip/-/extract-zip-1.6.2.tgz#5c7eb441c41136167a42b88b64051e6260c29e86" @@ -5497,7 +5525,7 @@ "@types/glob" "*" "@types/node" "*" -"@types/glob@*", "@types/glob@^7.1.1", "@types/glob@^7.1.2": +"@types/glob@*", "@types/glob@^7.1.1", "@types/glob@^7.1.2", "@types/glob@^7.1.3": version "7.1.3" resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.3.tgz#e6ba80f36b7daad2c685acd9266382e68985c183" integrity sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w== @@ -5704,7 +5732,7 @@ dependencies: "@types/jest" "*" -"@types/jest@*", "@types/jest@^26.0.22": +"@types/jest@*", "@types/jest@^26.0.16", "@types/jest@^26.0.22": version "26.0.22" resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.22.tgz#8308a1debdf1b807aa47be2838acdcd91e88fbe6" integrity sha512-eeWwWjlqxvBxc4oQdkueW5OF/gtfSceKk4OnOAGlUSwS/liBRtZppbJuz1YkgbrbfGOoeBHun9fOvXnjNwrSOw== @@ -5712,14 +5740,6 @@ jest-diff "^26.0.0" pretty-format "^26.0.0" -"@types/jest@^25.1.1": - version "25.2.3" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-25.2.3.tgz#33d27e4c4716caae4eced355097a47ad363fdcaf" - integrity sha512-JXc1nK/tXHiDhV55dvfzqtmP4S3sy3T3ouV2tkViZgxY/zeUkcpQcQPGRlgF4KmWzWW5oiWYSZwtCB+2RsE4Fw== - dependencies: - jest-diff "^25.2.1" - pretty-format "^25.2.1" - "@types/joi@^17.2.3": version "17.2.3" resolved "https://registry.yarnpkg.com/@types/joi/-/joi-17.2.3.tgz#b7768ed9d84f1ebd393328b9f97c1cf3d2b94798" @@ -5763,7 +5783,7 @@ "@types/parse5" "*" "@types/tough-cookie" "*" -"@types/json-schema@*", "@types/json-schema@^7.0.4", "@types/json-schema@^7.0.6", "@types/json-schema@^7.0.7", "@types/json-schema@^7.0.9": +"@types/json-schema@*", "@types/json-schema@^7.0.4", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.6", "@types/json-schema@^7.0.7", "@types/json-schema@^7.0.9": version "7.0.9" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== @@ -5783,10 +5803,25 @@ resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.30.tgz#44cb52f32a809734ca562e685c6473b5754a7818" integrity sha512-sqm9g7mHlPY/43fcSNrCYfOeX9zkTTK+euO5E6+CVijSMm5tTjkVdwdqRkY3ljjIAf8679vps5jKUoJBCLsMDA== +"@types/jsonwebtoken@^8.5.6": + version "8.5.6" + resolved "https://registry.yarnpkg.com/@types/jsonwebtoken/-/jsonwebtoken-8.5.6.tgz#1913e5a61e70a192c5a444623da4901a7b1a9d42" + integrity sha512-+P3O/xC7nzVizIi5VbF34YtqSonFsdnbXBnWUCYRiKOi1f9gA4sEFvXkrGr/QVV23IbMYvcoerI7nnhDUiWXRQ== + dependencies: + "@types/node" "*" + "@types/kbn__ace@link:bazel-bin/packages/kbn-ace/npm_module_types": version "0.0.0" uid "" +"@types/kbn__i18n-react@link:bazel-bin/packages/kbn-i18n-react/npm_module_types": + version "0.0.0" + uid "" + +"@types/kbn__i18n@link:bazel-bin/packages/kbn-i18n/npm_module_types": + version "0.0.0" + uid "" + "@types/keyv@*": version "3.1.1" resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.1.tgz#e45a45324fca9dab716ab1230ee249c9fb52cfa7" @@ -5866,10 +5901,10 @@ dependencies: "@types/linkify-it" "*" -"@types/markdown-to-jsx@^6.11.0": - version "6.11.1" - resolved "https://registry.yarnpkg.com/@types/markdown-to-jsx/-/markdown-to-jsx-6.11.1.tgz#4d9464aa76337d798b874dd3f2d6b4c86ddd98ad" - integrity sha512-fm/II24OzSx7J7CzXnHjEIf0d+s82bmdcokbyzY7PFMUnhyhnuGJgedt8R+yZgDn1mqhCLHmMjBPMsL8K4Xp9g== +"@types/markdown-to-jsx@^6.11.3": + version "6.11.3" + resolved "https://registry.yarnpkg.com/@types/markdown-to-jsx/-/markdown-to-jsx-6.11.3.tgz#cdd1619308fecbc8be7e6a26f3751260249b020e" + integrity sha512-30nFYpceM/ZEvhGiqWjm5quLUxNeld0HCzJEXMZZDpq53FPkS85mTwkWtCXzCqq8s5JYLgM5W392a02xn8Bdaw== dependencies: "@types/react" "*" @@ -5909,6 +5944,11 @@ resolved "https://registry.yarnpkg.com/@types/mime-types/-/mime-types-2.1.0.tgz#9ca52cda363f699c69466c2a6ccdaad913ea7a73" integrity sha1-nKUs2jY/aZxpRmwqbM2q2RPqenM= +"@types/mime@^1": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a" + integrity sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw== + "@types/mime@^2.0.1": version "2.0.1" resolved "https://registry.yarnpkg.com/@types/mime/-/mime-2.0.1.tgz#dc488842312a7f075149312905b5e3c0b054c79d" @@ -5974,7 +6014,7 @@ dependencies: "@types/node" "*" -"@types/node-fetch@^2.5.4", "@types/node-fetch@^2.5.7": +"@types/node-fetch@^2.5.7": version "2.5.7" resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.7.tgz#20a2afffa882ab04d44ca786449a276f9f6bbf3c" integrity sha512-o2WVNf5UhWRkxlf6eq+jMZDu7kjgpgJfl4xVNlvryc95O/6F2ld8ztKX+qu+Rjyet93WAWm5LjeX9H5FGkODvw== @@ -5996,7 +6036,7 @@ dependencies: "@types/node" "*" -"@types/node@*", "@types/node@12.20.24", "@types/node@16.10.2", "@types/node@>= 8", "@types/node@>=8.9.0", "@types/node@^10.1.0", "@types/node@^14.14.31": +"@types/node@*", "@types/node@12.20.24", "@types/node@16.10.2", "@types/node@>= 8", "@types/node@>=8.9.0", "@types/node@^10.1.0", "@types/node@^14.0.10", "@types/node@^14.14.31": version "16.10.2" resolved "https://registry.yarnpkg.com/@types/node/-/node-16.10.2.tgz#5764ca9aa94470adb4e1185fe2e9f19458992b2e" integrity sha512-zCclL4/rx+W5SQTzFs9wyvvyCwoK9QtBpratqz2IYJ3O8Umrn0m3nsTv0wQBk9sRGpvUe9CwPDrQFB10f1FIjQ== @@ -6049,7 +6089,7 @@ dependencies: "@types/node" "*" -"@types/overlayscrollbars@^1.9.0": +"@types/overlayscrollbars@^1.12.0": version "1.12.0" resolved "https://registry.yarnpkg.com/@types/overlayscrollbars/-/overlayscrollbars-1.12.0.tgz#98456caceca8ad73bd5bb572632a585074e70764" integrity sha512-h/pScHNKi4mb+TrJGDon8Yb06ujFG0mSg12wIO0sWMUF3dQIe2ExRRdNRviaNt9IjxIiOfnRr7FsQAdHwK4sMg== @@ -6108,6 +6148,11 @@ resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.3.2.tgz#fc8c2825e4ed2142473b4a81064e6e081463d1b3" integrity sha512-eI5Yrz3Qv4KPUa/nSIAi0h+qX0XyewOliug5F2QAtuRg6Kjg6jfmxe1GIwoIRhZspD1A0RP8ANrPwvEXXtRFog== +"@types/pretty-hrtime@^1.0.0": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@types/pretty-hrtime/-/pretty-hrtime-1.0.1.tgz#72a26101dc567b0d68fd956cf42314556e42d601" + integrity sha512-VjID5MJb1eGKthz2qUerWT8+R4b9N+CHvGCzg9fn4kWZgaF9AhdYikQio3R7wV8YY1NsQKPaCwKz1Yff+aHNUQ== + "@types/pretty-ms@^5.0.0": version "5.0.1" resolved "https://registry.yarnpkg.com/@types/pretty-ms/-/pretty-ms-5.0.1.tgz#f2f0d7be58caf8613d149053d446e0282ae11ff3" @@ -6135,10 +6180,15 @@ resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.4.tgz#15925414e0ad2cd765bfef58842f7e26a7accb24" integrity sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug== -"@types/qs@^6.9.0": - version "6.9.4" - resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.4.tgz#a59e851c1ba16c0513ea123830dd639a0a15cb6a" - integrity sha512-+wYo+L6ZF6BMoEjtf8zB2esQsqdV6WsjRK/GP9WOgLPrq87PbNWgIxS76dS5uvl/QXtHGakZmwTznIfcPXcKlQ== +"@types/qs@*", "@types/qs@^6.9.5": + version "6.9.7" + resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb" + integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw== + +"@types/range-parser@*": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc" + integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== "@types/rbush@^3.0.0": version "3.0.0" @@ -6159,13 +6209,6 @@ dependencies: "@types/react" "*" -"@types/react-color@^3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@types/react-color/-/react-color-3.0.1.tgz#5433e2f503ea0e0831cbc6fd0c20f8157d93add0" - integrity sha512-J6mYm43Sid9y+OjZ7NDfJ2VVkeeuTPNVImNFITgQNXodHteKfl/t/5pAR5Z9buodZ2tCctsZjgiMlQOpfntakw== - dependencies: - "@types/react" "*" - "@types/react-dom@>=16.9.0", "@types/react-dom@^16.9.8": version "16.9.8" resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-16.9.8.tgz#fe4c1e11dfc67155733dfa6aa65108b4971cb423" @@ -6243,10 +6286,10 @@ "@types/history" "*" "@types/react" "*" -"@types/react-syntax-highlighter@11.0.4": - version "11.0.4" - resolved "https://registry.yarnpkg.com/@types/react-syntax-highlighter/-/react-syntax-highlighter-11.0.4.tgz#d86d17697db62f98046874f62fdb3e53a0bbc4cd" - integrity sha512-9GfTo3a0PHwQeTVoqs0g5bS28KkSY48pp5659wA+Dp4MqceDEa8EHBqrllJvvtyusszyJhViUEap0FDvlk/9Zg== +"@types/react-syntax-highlighter@11.0.5": + version "11.0.5" + resolved "https://registry.yarnpkg.com/@types/react-syntax-highlighter/-/react-syntax-highlighter-11.0.5.tgz#0d546261b4021e1f9d85b50401c0a42acb106087" + integrity sha512-VIOi9i2Oj5XsmWWoB72p3KlZoEbdRAcechJa8Ztebw7bDl2YmR+odxIqhtJGp1q2EozHs02US+gzxJ9nuf56qg== dependencies: "@types/react" "*" @@ -6366,6 +6409,14 @@ resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.4.tgz#43d7168fec6fa0988bb1a513a697b29296721afb" integrity sha512-+nVsLKlcUCeMzD2ufHEYuJ9a2ovstb6Dp52A5VsoKxDXgvE051XgHI/33I1EymwkRGQkwnA0LkhnUzituGs4EQ== +"@types/serve-static@*": + version "1.13.10" + resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.13.10.tgz#f5e0ce8797d2d7cc5ebeda48a52c96c4fa47a8d9" + integrity sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ== + dependencies: + "@types/mime" "^1" + "@types/node" "*" + "@types/set-value@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@types/set-value/-/set-value-2.0.0.tgz#63d386b103926dcf49b50e16e0f6dd49983046be" @@ -6452,7 +6503,7 @@ dependencies: "@types/superagent" "*" -"@types/tapable@*", "@types/tapable@^1.0.5", "@types/tapable@^1.0.6": +"@types/tapable@^1", "@types/tapable@^1.0.5", "@types/tapable@^1.0.6": version "1.0.6" resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.6.tgz#a9ca4b70a18b270ccb2bc0aaafefd1d486b7ea74" integrity sha512-W+bw9ds02rAQaMvaLYxAbJ6cvguW/iJXNT6lTssS1ps6QdrMKttqEAMEG/b5CR8TZl3/L7/lH0ZV5nNR1LXikA== @@ -6599,10 +6650,10 @@ "@types/node" "*" chokidar "^2.1.2" -"@types/webpack-env@^1.15.3": - version "1.15.3" - resolved "https://registry.yarnpkg.com/@types/webpack-env/-/webpack-env-1.15.3.tgz#fb602cd4c2f0b7c0fb857e922075fdf677d25d84" - integrity sha512-5oiXqR7kwDGZ6+gmzIO2lTC+QsriNuQXZDWNYRV3l2XRN/zmPgnC21DLSx2D05zvD8vnXW6qUg7JnXZ4I6qLVQ== +"@types/webpack-env@^1.15.3", "@types/webpack-env@^1.16.0": + version "1.16.3" + resolved "https://registry.yarnpkg.com/@types/webpack-env/-/webpack-env-1.16.3.tgz#b776327a73e561b71e7881d0cd6d34a1424db86a" + integrity sha512-9gtOPPkfyNoEqCQgx4qJKkuNm/x0R2hKR7fdl7zvTJyHnIisuE/LfvXOsYWL0o3qq6uiBnKZNNNzi3l0y/X+xw== "@types/webpack-merge@^4.1.5": version "4.1.5" @@ -6620,16 +6671,16 @@ "@types/source-list-map" "*" source-map "^0.6.1" -"@types/webpack@*", "@types/webpack@^4.4.31", "@types/webpack@^4.41.3", "@types/webpack@^4.41.8": - version "4.41.21" - resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-4.41.21.tgz#cc685b332c33f153bb2f5fc1fa3ac8adeb592dee" - integrity sha512-2j9WVnNrr/8PLAB5csW44xzQSJwS26aOnICsP3pSGCEdsu6KYtfQ6QJsVUKHWRnm1bL7HziJsfh5fHqth87yKA== +"@types/webpack@*", "@types/webpack@^4.4.31", "@types/webpack@^4.41.26", "@types/webpack@^4.41.3", "@types/webpack@^4.41.8": + version "4.41.32" + resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-4.41.32.tgz#a7bab03b72904070162b2f169415492209e94212" + integrity sha512-cb+0ioil/7oz5//7tZUSwbrSAN/NWHrQylz5cW8G0dWTcF/g+/dSdMlKVZspBYuMAN1+WnwHrkxiRrLcwd0Heg== dependencies: - "@types/anymatch" "*" "@types/node" "*" - "@types/tapable" "*" + "@types/tapable" "^1" "@types/uglify-js" "*" "@types/webpack-sources" "*" + anymatch "^3.0.0" source-map "^0.6.0" "@types/write-pkg@^3.1.0": @@ -7011,11 +7062,6 @@ abort-controller@^3.0.0: dependencies: event-target-shim "^5.0.0" -abortcontroller-polyfill@^1.7.3: - version "1.7.3" - resolved "https://registry.yarnpkg.com/abortcontroller-polyfill/-/abortcontroller-polyfill-1.7.3.tgz#1b5b487bd6436b5b764fd52a612509702c3144b5" - integrity sha512-zetDJxd89y3X99Kvo4qFx8GKlt6GsvN3UcRZHwU6iFA/0KiOmhkTVhe8oRoTBiTVPZu09x3vCra47+w8Yz1+2Q== - accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7: version "1.3.7" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" @@ -7040,11 +7086,6 @@ acorn-globals@^6.0.0: acorn "^7.1.1" acorn-walk "^7.1.1" -acorn-jsx@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.1.0.tgz#294adb71b57398b0680015f0a38c563ee1db5384" - integrity sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw== - acorn-jsx@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b" @@ -7064,7 +7105,7 @@ acorn-walk@^6.0.1: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.1.1.tgz#d363b66f5fac5f018ff9c3a1e7b6f8e310cc3913" integrity sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw== -acorn-walk@^7.0.0, acorn-walk@^7.1.1: +acorn-walk@^7.0.0, acorn-walk@^7.1.1, acorn-walk@^7.2.0: version "7.2.0" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== @@ -7084,10 +7125,10 @@ acorn@^6.0.1, acorn@^6.0.4, acorn@^6.4.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.1.tgz#531e58ba3f51b9dacb9a6646ca4debf5b14ca474" integrity sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA== -acorn@^7.0.0, acorn@^7.1.0, acorn@^7.1.1, acorn@^7.4.0: - version "7.4.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.0.tgz#e1ad486e6c54501634c6c397c5c121daa383607c" - integrity sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w== +acorn@^7.0.0, acorn@^7.1.1, acorn@^7.4.0, acorn@^7.4.1: + version "7.4.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" + integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== acorn@^8.4.1: version "8.5.0" @@ -7434,10 +7475,10 @@ anymatch@^2.0.0: micromatch "^3.1.4" normalize-path "^2.1.1" -anymatch@^3.0.3, anymatch@~3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.1.tgz#c55ecf02185e2469259399310c173ce31233b142" - integrity sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg== +anymatch@^3.0.0, anymatch@^3.0.3, anymatch@~3.1.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" + integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== dependencies: normalize-path "^3.0.0" picomatch "^2.0.4" @@ -7977,7 +8018,7 @@ attr-accept@^2.0.0: resolved "https://registry.yarnpkg.com/attr-accept/-/attr-accept-2.2.1.tgz#89b48de019ed4342f1865626b4389c666b3ed231" integrity sha512-GpefLMsbH5ojNgfTW+OBin2xKzuHfyeNA+qCktzZojBhbA/lPZdCFMWdwk5ajb989Ok7ZT+EADqvW3TAFNMjhA== -autoprefixer@^9.7.2, autoprefixer@^9.7.4: +autoprefixer@^9.7.4: version "9.8.5" resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.8.5.tgz#2c225de229ddafe1d1424c02791d0c3e10ccccaa" integrity sha512-C2p5KkumJlsTHoNv9w31NrBRgXhf6eCMteJuHZi2xhkgC+5Vm40MEtCKPhc0qdgAOhox0YPy1SQHTAky05UoKg== @@ -8020,11 +8061,16 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== -axe-core@^4.0.1, axe-core@^4.0.2: +axe-core@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.0.2.tgz#c7cf7378378a51fcd272d3c09668002a4990b1cb" integrity sha512-arU1h31OGFu+LPrOLGZ7nB45v940NMDMEJeNmbutu57P+UFDVnkZg3e+J1I2HJRZ9hT7gO8J91dn/PMrAiKakA== +axe-core@^4.2.0: + version "4.3.5" + resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.3.5.tgz#78d6911ba317a8262bfee292aeafcc1e04b49cc5" + integrity sha512-WKTW1+xAzhMS5dJsxWkliixlO/PqC4VhmO9T4juNYcaTg9jzWiJsou6m5pxWYGfigWbwzJWeFY6z47a+4neRXA== + axios@^0.21.1: version "0.21.1" resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8" @@ -8067,41 +8113,6 @@ babel-generator@^6.18.0: source-map "^0.5.7" trim-right "^1.0.1" -babel-helper-evaluate-path@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.5.0.tgz#a62fa9c4e64ff7ea5cea9353174ef023a900a67c" - integrity sha512-mUh0UhS607bGh5wUMAQfOpt2JX2ThXMtppHRdRU1kL7ZLRWIXxoV2UIV1r2cAeeNeU1M5SB5/RSUgUxrK8yOkA== - -babel-helper-flip-expressions@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-helper-flip-expressions/-/babel-helper-flip-expressions-0.4.3.tgz#3696736a128ac18bc25254b5f40a22ceb3c1d3fd" - integrity sha1-NpZzahKKwYvCUlS19AoizrPB0/0= - -babel-helper-is-nodes-equiv@^0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/babel-helper-is-nodes-equiv/-/babel-helper-is-nodes-equiv-0.0.1.tgz#34e9b300b1479ddd98ec77ea0bbe9342dfe39684" - integrity sha1-NOmzALFHnd2Y7HfqC76TQt/jloQ= - -babel-helper-is-void-0@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-helper-is-void-0/-/babel-helper-is-void-0-0.4.3.tgz#7d9c01b4561e7b95dbda0f6eee48f5b60e67313e" - integrity sha1-fZwBtFYee5Xb2g9u7kj1tg5nMT4= - -babel-helper-mark-eval-scopes@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-helper-mark-eval-scopes/-/babel-helper-mark-eval-scopes-0.4.3.tgz#d244a3bef9844872603ffb46e22ce8acdf551562" - integrity sha1-0kSjvvmESHJgP/tG4izorN9VFWI= - -babel-helper-remove-or-void@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.4.3.tgz#a4f03b40077a0ffe88e45d07010dee241ff5ae60" - integrity sha1-pPA7QAd6D/6I5F0HAQ3uJB/1rmA= - -babel-helper-to-multiple-sequence-expressions@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/babel-helper-to-multiple-sequence-expressions/-/babel-helper-to-multiple-sequence-expressions-0.5.0.tgz#a3f924e3561882d42fcf48907aa98f7979a4588d" - integrity sha512-m2CvfDW4+1qfDdsrtf4dwOslQC3yhbgyBFptncp4wvtdrDHqueW7slsYv4gArie056phvQFhT2nRcGS4bnm6mA== - babel-jest@^26.6.3: version "26.6.3" resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-26.6.3.tgz#d87d25cb0037577a0c89f82e5755c5d293c01056" @@ -8116,16 +8127,6 @@ babel-jest@^26.6.3: graceful-fs "^4.2.4" slash "^3.0.0" -babel-loader@^8.0.6: - version "8.0.6" - resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.0.6.tgz#e33bdb6f362b03f4bb141a0c21ab87c501b70dfb" - integrity sha512-4BmWKtBOBm13uoUwd08UwjZlaw3O9GWf456R9j+5YykFZ6LUIjIKLc0zEZf+hauxPOJs96C8k6FvYD09vWzhYw== - dependencies: - find-cache-dir "^2.0.0" - loader-utils "^1.0.2" - mkdirp "^0.5.1" - pify "^4.0.1" - babel-loader@^8.2.2: version "8.2.2" resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.2.2.tgz#9363ce84c10c9a40e6c753748e1441b60c8a0b81" @@ -8175,7 +8176,7 @@ babel-plugin-dynamic-import-node@^2.3.3: dependencies: object.assign "^4.1.0" -babel-plugin-emotion@^10.0.20, babel-plugin-emotion@^10.0.27: +babel-plugin-emotion@^10.0.27: version "10.0.33" resolved "https://registry.yarnpkg.com/babel-plugin-emotion/-/babel-plugin-emotion-10.0.33.tgz#ce1155dcd1783bbb9286051efee53f4e2be63e03" integrity sha512-bxZbTTGz0AJQDHm8k6Rf3RQJ8tX2scsfsRyKVgAbiUPUNIRtlK+7JxP+TAd1kRLABFxe0CFm2VdK4ePkoA9FxQ== @@ -8257,94 +8258,20 @@ babel-plugin-macros@^2.0.0, babel-plugin-macros@^2.6.1, babel-plugin-macros@^2.8 cosmiconfig "^6.0.0" resolve "^1.12.0" -babel-plugin-minify-builtins@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-builtins/-/babel-plugin-minify-builtins-0.5.0.tgz#31eb82ed1a0d0efdc31312f93b6e4741ce82c36b" - integrity sha512-wpqbN7Ov5hsNwGdzuzvFcjgRlzbIeVv1gMIlICbPj0xkexnfoIDe7q+AZHMkQmAE/F9R5jkrB6TLfTegImlXag== - -babel-plugin-minify-constant-folding@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-constant-folding/-/babel-plugin-minify-constant-folding-0.5.0.tgz#f84bc8dbf6a561e5e350ff95ae216b0ad5515b6e" - integrity sha512-Vj97CTn/lE9hR1D+jKUeHfNy+m1baNiJ1wJvoGyOBUx7F7kJqDZxr9nCHjO/Ad+irbR3HzR6jABpSSA29QsrXQ== - dependencies: - babel-helper-evaluate-path "^0.5.0" - -babel-plugin-minify-dead-code-elimination@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-dead-code-elimination/-/babel-plugin-minify-dead-code-elimination-0.5.0.tgz#d23ef5445238ad06e8addf5c1cf6aec835bcda87" - integrity sha512-XQteBGXlgEoAKc/BhO6oafUdT4LBa7ARi55mxoyhLHNuA+RlzRmeMAfc31pb/UqU01wBzRc36YqHQzopnkd/6Q== - dependencies: - babel-helper-evaluate-path "^0.5.0" - babel-helper-mark-eval-scopes "^0.4.3" - babel-helper-remove-or-void "^0.4.3" - lodash.some "^4.6.0" - -babel-plugin-minify-flip-comparisons@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-flip-comparisons/-/babel-plugin-minify-flip-comparisons-0.4.3.tgz#00ca870cb8f13b45c038b3c1ebc0f227293c965a" - integrity sha1-AMqHDLjxO0XAOLPB68DyJyk8llo= - dependencies: - babel-helper-is-void-0 "^0.4.3" - -babel-plugin-minify-guarded-expressions@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-guarded-expressions/-/babel-plugin-minify-guarded-expressions-0.4.3.tgz#cc709b4453fd21b1f302877444c89f88427ce397" - integrity sha1-zHCbRFP9IbHzAod0RMifiEJ845c= - dependencies: - babel-helper-flip-expressions "^0.4.3" - -babel-plugin-minify-infinity@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-infinity/-/babel-plugin-minify-infinity-0.4.3.tgz#dfb876a1b08a06576384ef3f92e653ba607b39ca" - integrity sha1-37h2obCKBldjhO8/kuZTumB7Oco= - -babel-plugin-minify-mangle-names@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-mangle-names/-/babel-plugin-minify-mangle-names-0.5.0.tgz#bcddb507c91d2c99e138bd6b17a19c3c271e3fd3" - integrity sha512-3jdNv6hCAw6fsX1p2wBGPfWuK69sfOjfd3zjUXkbq8McbohWy23tpXfy5RnToYWggvqzuMOwlId1PhyHOfgnGw== - dependencies: - babel-helper-mark-eval-scopes "^0.4.3" - -babel-plugin-minify-numeric-literals@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-numeric-literals/-/babel-plugin-minify-numeric-literals-0.4.3.tgz#8e4fd561c79f7801286ff60e8c5fd9deee93c0bc" - integrity sha1-jk/VYcefeAEob/YOjF/Z3u6TwLw= - -babel-plugin-minify-replace@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-replace/-/babel-plugin-minify-replace-0.5.0.tgz#d3e2c9946c9096c070efc96761ce288ec5c3f71c" - integrity sha512-aXZiaqWDNUbyNNNpWs/8NyST+oU7QTpK7J9zFEFSA0eOmtUNMU3fczlTTTlnCxHmq/jYNFEmkkSG3DDBtW3Y4Q== - -babel-plugin-minify-simplify@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-simplify/-/babel-plugin-minify-simplify-0.5.0.tgz#1f090018afb90d8b54d3d027fd8a4927f243da6f" - integrity sha512-TM01J/YcKZ8XIQd1Z3nF2AdWHoDsarjtZ5fWPDksYZNsoOjQ2UO2EWm824Ym6sp127m44gPlLFiO5KFxU8pA5Q== - dependencies: - babel-helper-flip-expressions "^0.4.3" - babel-helper-is-nodes-equiv "^0.0.1" - babel-helper-to-multiple-sequence-expressions "^0.5.0" - -babel-plugin-minify-type-constructors@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-plugin-minify-type-constructors/-/babel-plugin-minify-type-constructors-0.4.3.tgz#1bc6f15b87f7ab1085d42b330b717657a2156500" - integrity sha1-G8bxW4f3qxCF1CszC3F2V6IVZQA= +babel-plugin-macros@^3.0.1: + version "3.1.0" + resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz#9ef6dc74deb934b4db344dc973ee851d148c50c1" + integrity sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg== dependencies: - babel-helper-is-void-0 "^0.4.3" + "@babel/runtime" "^7.12.5" + cosmiconfig "^7.0.0" + resolve "^1.19.0" babel-plugin-named-asset-import@^0.3.1: version "0.3.3" resolved "https://registry.yarnpkg.com/babel-plugin-named-asset-import/-/babel-plugin-named-asset-import-0.3.3.tgz#9ba2f3ac4dc78b042651654f07e847adfe50667c" integrity sha512-1XDRysF4894BUdMChT+2HHbtJYiO7zx5Be7U6bT8dISy7OdyETMGIAQBMPQCsY1YRf0xcubwnKKaDr5bk15JTA== -babel-plugin-polyfill-corejs2@^0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.3.tgz#6ed8e30981b062f8fe6aca8873a37ebcc8cc1c0f" - integrity sha512-NDZ0auNRzmAfE1oDDPW2JhzIMXUk+FFe2ICejmt5T4ocKgiQx3e0VCRx9NCAidcMtL2RUZaWtXnmjTCkx0tcbA== - dependencies: - "@babel/compat-data" "^7.13.11" - "@babel/helper-define-polyfill-provider" "^0.2.4" - semver "^6.1.1" - babel-plugin-polyfill-corejs2@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.0.tgz#407082d0d355ba565af24126fb6cb8e9115251fd" @@ -8354,13 +8281,13 @@ babel-plugin-polyfill-corejs2@^0.3.0: "@babel/helper-define-polyfill-provider" "^0.3.0" semver "^6.1.1" -babel-plugin-polyfill-corejs3@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.3.0.tgz#fa7ca3d1ee9ddc6193600ffb632c9785d54918af" - integrity sha512-JLwi9vloVdXLjzACL80j24bG6/T1gYxwowG44dg6HN/7aTPdyPbJJidf6ajoA3RPHHtW0j9KMrSOLpIZpAnPpg== +babel-plugin-polyfill-corejs3@^0.1.0: + version "0.1.7" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.1.7.tgz#80449d9d6f2274912e05d9e182b54816904befd0" + integrity sha512-u+gbS9bbPhZWEeyy1oR/YaaSpod/KDT07arZHb80aTpl8H5ZBq+uN1nN9/xtX7jQyfLdPfoqI4Rue/MQSWJquw== dependencies: - "@babel/helper-define-polyfill-provider" "^0.2.4" - core-js-compat "^3.18.0" + "@babel/helper-define-polyfill-provider" "^0.1.5" + core-js-compat "^3.8.1" babel-plugin-polyfill-corejs3@^0.4.0: version "0.4.0" @@ -8370,13 +8297,6 @@ babel-plugin-polyfill-corejs3@^0.4.0: "@babel/helper-define-polyfill-provider" "^0.3.0" core-js-compat "^3.18.0" -babel-plugin-polyfill-regenerator@^0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.2.3.tgz#2e9808f5027c4336c994992b48a4262580cb8d6d" - integrity sha512-JVE78oRZPKFIeUqFGrSORNzQnrDwZR16oiWeGM8ZyjBn2XAT5OjP+wXx5ESuo33nUsFUEJYjtklnsKbxW5L+7g== - dependencies: - "@babel/helper-define-polyfill-provider" "^0.2.4" - babel-plugin-polyfill-regenerator@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.3.0.tgz#9ebbcd7186e1a33e21c5e20cae4e7983949533be" @@ -8415,78 +8335,19 @@ babel-plugin-styled-components@^1.13.3: dependencies: "@babel/helper-annotate-as-pure" "^7.15.4" "@babel/helper-module-imports" "^7.15.4" - babel-plugin-syntax-jsx "^6.18.0" - lodash "^4.17.11" - -babel-plugin-syntax-jsx@^6.18.0: - version "6.18.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz#0af32a9a6e13ca7a3fd5069e62d7b0f58d0d8946" - integrity sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY= - -babel-plugin-transform-inline-consecutive-adds@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-inline-consecutive-adds/-/babel-plugin-transform-inline-consecutive-adds-0.4.3.tgz#323d47a3ea63a83a7ac3c811ae8e6941faf2b0d1" - integrity sha1-Mj1Ho+pjqDp6w8gRro5pQfrysNE= - -babel-plugin-transform-member-expression-literals@^6.9.4: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-member-expression-literals/-/babel-plugin-transform-member-expression-literals-6.9.4.tgz#37039c9a0c3313a39495faac2ff3a6b5b9d038bf" - integrity sha1-NwOcmgwzE6OUlfqsL/OmtbnQOL8= - -babel-plugin-transform-merge-sibling-variables@^6.9.4: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-merge-sibling-variables/-/babel-plugin-transform-merge-sibling-variables-6.9.4.tgz#85b422fc3377b449c9d1cde44087203532401dae" - integrity sha1-hbQi/DN3tEnJ0c3kQIcgNTJAHa4= - -babel-plugin-transform-minify-booleans@^6.9.4: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-minify-booleans/-/babel-plugin-transform-minify-booleans-6.9.4.tgz#acbb3e56a3555dd23928e4b582d285162dd2b198" - integrity sha1-rLs+VqNVXdI5KOS1gtKFFi3SsZg= + babel-plugin-syntax-jsx "^6.18.0" + lodash "^4.17.11" -babel-plugin-transform-property-literals@^6.9.4: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-property-literals/-/babel-plugin-transform-property-literals-6.9.4.tgz#98c1d21e255736573f93ece54459f6ce24985d39" - integrity sha1-mMHSHiVXNlc/k+zlRFn2ziSYXTk= - dependencies: - esutils "^2.0.2" +babel-plugin-syntax-jsx@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz#0af32a9a6e13ca7a3fd5069e62d7b0f58d0d8946" + integrity sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY= babel-plugin-transform-react-remove-prop-types@^0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-remove-prop-types/-/babel-plugin-transform-react-remove-prop-types-0.4.24.tgz#f2edaf9b4c6a5fbe5c1d678bfb531078c1555f3a" integrity sha512-eqj0hVcJUR57/Ug2zE1Yswsw4LhuqqHhD+8v120T1cl3kjg76QwtyBrdIk4WVwK+lAhBJVYCd/v+4nc4y+8JsA== -babel-plugin-transform-regexp-constructors@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-regexp-constructors/-/babel-plugin-transform-regexp-constructors-0.4.3.tgz#58b7775b63afcf33328fae9a5f88fbd4fb0b4965" - integrity sha1-WLd3W2OvzzMyj66aX4j71PsLSWU= - -babel-plugin-transform-remove-console@^6.9.4: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-console/-/babel-plugin-transform-remove-console-6.9.4.tgz#b980360c067384e24b357a588d807d3c83527780" - integrity sha1-uYA2DAZzhOJLNXpYjYB9PINSd4A= - -babel-plugin-transform-remove-debugger@^6.9.4: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-debugger/-/babel-plugin-transform-remove-debugger-6.9.4.tgz#42b727631c97978e1eb2d199a7aec84a18339ef2" - integrity sha1-QrcnYxyXl44estGZp67IShgznvI= - -babel-plugin-transform-remove-undefined@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-undefined/-/babel-plugin-transform-remove-undefined-0.5.0.tgz#80208b31225766c630c97fa2d288952056ea22dd" - integrity sha512-+M7fJYFaEE/M9CXa0/IRkDbiV3wRELzA1kKQFCJ4ifhrzLKn/9VCCgj9OFmYWwBd8IB48YdgPkHYtbYq+4vtHQ== - dependencies: - babel-helper-evaluate-path "^0.5.0" - -babel-plugin-transform-simplify-comparison-operators@^6.9.4: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.9.4.tgz#f62afe096cab0e1f68a2d753fdf283888471ceb9" - integrity sha1-9ir+CWyrDh9ootdT/fKDiIRxzrk= - -babel-plugin-transform-undefined-to-void@^6.9.4: - version "6.9.4" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-undefined-to-void/-/babel-plugin-transform-undefined-to-void-6.9.4.tgz#be241ca81404030678b748717322b89d0c8fe280" - integrity sha1-viQcqBQEAwZ4t0hxcyK4nQyP4oA= - babel-polyfill@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153" @@ -8522,35 +8383,6 @@ babel-preset-jest@^26.6.2: babel-plugin-jest-hoist "^26.6.2" babel-preset-current-node-syntax "^1.0.0" -"babel-preset-minify@^0.5.0 || 0.6.0-alpha.5": - version "0.5.0" - resolved "https://registry.yarnpkg.com/babel-preset-minify/-/babel-preset-minify-0.5.0.tgz#e25bb8d3590087af02b650967159a77c19bfb96b" - integrity sha512-xj1s9Mon+RFubH569vrGCayA9Fm2GMsCgDRm1Jb8SgctOB7KFcrVc2o8K3YHUyMz+SWP8aea75BoS8YfsXXuiA== - dependencies: - babel-plugin-minify-builtins "^0.5.0" - babel-plugin-minify-constant-folding "^0.5.0" - babel-plugin-minify-dead-code-elimination "^0.5.0" - babel-plugin-minify-flip-comparisons "^0.4.3" - babel-plugin-minify-guarded-expressions "^0.4.3" - babel-plugin-minify-infinity "^0.4.3" - babel-plugin-minify-mangle-names "^0.5.0" - babel-plugin-minify-numeric-literals "^0.4.3" - babel-plugin-minify-replace "^0.5.0" - babel-plugin-minify-simplify "^0.5.0" - babel-plugin-minify-type-constructors "^0.4.3" - babel-plugin-transform-inline-consecutive-adds "^0.4.3" - babel-plugin-transform-member-expression-literals "^6.9.4" - babel-plugin-transform-merge-sibling-variables "^6.9.4" - babel-plugin-transform-minify-booleans "^6.9.4" - babel-plugin-transform-property-literals "^6.9.4" - babel-plugin-transform-regexp-constructors "^0.4.3" - babel-plugin-transform-remove-console "^6.9.4" - babel-plugin-transform-remove-debugger "^6.9.4" - babel-plugin-transform-remove-undefined "^0.5.0" - babel-plugin-transform-simplify-comparison-operators "^6.9.4" - babel-plugin-transform-undefined-to-void "^6.9.4" - lodash.isplainobject "^4.0.6" - babel-runtime@6.x, babel-runtime@^6.11.6, babel-runtime@^6.22.0, babel-runtime@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" @@ -8691,7 +8523,7 @@ basic-auth@^2.0.1: dependencies: safe-buffer "5.1.2" -batch-processor@1.0.0, batch-processor@^1.0.0: +batch-processor@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/batch-processor/-/batch-processor-1.0.0.tgz#75c95c32b748e0850d10c2b168f6bdbe9891ace8" integrity sha1-dclcMrdI4IUNEMKxaPa9vpiRrOg= @@ -8723,10 +8555,10 @@ before-after-hook@^2.0.0, before-after-hook@^2.1.0: resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.1.0.tgz#b6c03487f44e24200dd30ca5e6a1979c5d2fb635" integrity sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A== -better-opn@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/better-opn/-/better-opn-2.0.0.tgz#c70d198e51164bdc220306a28a885d9ac7a14c44" - integrity sha512-PPbGRgO/K0LowMHbH/JNvaV3qY3Vt+A2nH28fzJxy16h/DfR5OsVti6ldGl6S9SMsyUqT13sltikiAVtI6tKLA== +better-opn@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/better-opn/-/better-opn-2.1.1.tgz#94a55b4695dc79288f31d7d0e5f658320759f7c6" + integrity sha512-kIPXZS5qwyKiX/HcRvDYfmBQUa8XP17I0mYZZ0y4UhpYOSvtsLHDYqmomS+Mj20aDvD3knEiQ0ecQy2nhio3yA== dependencies: open "^7.0.3" @@ -8832,7 +8664,7 @@ bowser@^1.7.3: resolved "https://registry.yarnpkg.com/bowser/-/bowser-1.9.4.tgz#890c58a2813a9d3243704334fa81b96a5c150c9a" integrity sha512-9IdMmj2KjigRq6oWhmwv1W36pDuA4STQZ8q6YO9um+x07xgYNCD3Oou+WP/3L1HNz7iqythGet3/p4wvc8AAwQ== -boxen@^4.1.0, boxen@^4.2.0: +boxen@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/boxen/-/boxen-4.2.0.tgz#e411b62357d6d6d36587c8ac3d5d974daa070e64" integrity sha512-eB4uT9RGzg2odpER62bBwSLvUeGC+WbRjjyyFhGsKnc8wp/m0+hQsMUvUe3H2V0D5vw0nBdO1hCJoZo5mKeuIQ== @@ -9172,7 +9004,7 @@ browserslist@4.14.2: escalade "^3.0.2" node-releases "^1.1.61" -browserslist@^4.0.0, browserslist@^4.12.0, browserslist@^4.17.1, browserslist@^4.6.0, browserslist@^4.8.5: +browserslist@^4.0.0, browserslist@^4.12.0, browserslist@^4.6.0: version "4.17.1" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.1.tgz#a98d104f54af441290b7d592626dd541fa642eb9" integrity sha512-aLD0ZMDSnF4lUt4ZDNgqi5BUn9BZ7YdQdI/cYlILrhdSSZJLU9aNZoD5/NBmM4SK34APB2e83MOsRt1EnkuyaQ== @@ -9546,10 +9378,10 @@ cardinal@^2.1.1: ansicolors "~0.3.2" redeyed "~2.1.0" -case-sensitive-paths-webpack-plugin@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.2.0.tgz#3371ef6365ef9c25fa4b81c16ace0e9c7dc58c3e" - integrity sha512-u5ElzokS8A1pm9vM3/iDgTcI3xqHxuCao94Oz8etI3cf0Tio0p8izkDYbTIn09uP3yUUr6+veaE6IkjnTYS46g== +case-sensitive-paths-webpack-plugin@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.3.0.tgz#23ac613cc9a856e4f88ff8bb73bbb5e989825cf7" + integrity sha512-/4YgnZS8y1UXXmC02xD5rRrBEu6T5ub+mQHLNRj0fzTRbgdBYhsNo2V5EqwgqrExjxsjtF/OpAKAMkKsxbD5XQ== caseless@~0.12.0: version "0.12.0" @@ -9716,10 +9548,10 @@ cheerio@^1.0.0-rc.10, cheerio@^1.0.0-rc.3: parse5-htmlparser2-tree-adapter "^6.0.1" tslib "^2.2.0" -chokidar@3.4.3, chokidar@^2.0.0, chokidar@^2.0.4, chokidar@^2.1.1, chokidar@^2.1.2, chokidar@^2.1.8, chokidar@^3.2.2, chokidar@^3.4.0, chokidar@^3.4.1, chokidar@^3.4.3: - version "3.4.3" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.4.3.tgz#c1df38231448e45ca4ac588e6c79573ba6a57d5b" - integrity sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ== +chokidar@3.4.3, chokidar@^2.0.0, chokidar@^2.0.4, chokidar@^2.1.1, chokidar@^2.1.2, chokidar@^2.1.8, chokidar@^3.2.2, chokidar@^3.4.0, chokidar@^3.4.1, chokidar@^3.4.2, chokidar@^3.4.3: + version "3.5.1" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.1.tgz#ee9ce7bbebd2b79f49f304799d5468e31e14e68a" + integrity sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw== dependencies: anymatch "~3.1.1" braces "~3.0.2" @@ -9729,7 +9561,7 @@ chokidar@3.4.3, chokidar@^2.0.0, chokidar@^2.0.4, chokidar@^2.1.1, chokidar@^2.1 normalize-path "~3.0.0" readdirp "~3.5.0" optionalDependencies: - fsevents "~2.1.2" + fsevents "~2.3.1" chownr@^1.1.1: version "1.1.4" @@ -9760,10 +9592,10 @@ chrome-trace-event@^1.0.2: dependencies: tslib "^1.9.0" -chromedriver@^95.0.0: - version "95.0.0" - resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-95.0.0.tgz#ecf854cac6df5137a651dcc132edf55612d3db7f" - integrity sha512-HwSg7S0ZZYsHTjULwxFHrrUqEpz1+ljDudJM3eOquvqD5QKnR5pSe/GlBTY9UU2tVFRYz8bEHYC4Y8qxciQiLQ== +chromedriver@^96.0.0: + version "96.0.0" + resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-96.0.0.tgz#c8473498e4c94950fa168187b112019cce9e5c6c" + integrity sha512-4g6Hn5RHGsbaBmOrJbDlz/hdVPOc22eRsbvoAAMqkZxR2NJCcddHzCw2FAQeW8lX/C7xWVz3nyDsKX3fE9lIIw== dependencies: "@testim/chrome-version" "^1.0.7" axios "^0.21.2" @@ -10028,10 +9860,10 @@ cloneable-readable@^1.0.0: process-nextick-args "^2.0.0" readable-stream "^2.3.5" -clsx@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/clsx/-/clsx-1.0.4.tgz#0c0171f6d5cb2fe83848463c15fcc26b4df8c2ec" - integrity sha512-1mQ557MIZTrL/140j+JVdRM6e31/OA4vTYxXgqIIZlndyfjHpyawKZia1Im05Vp9BWmImkcNrNtFYQMyFcgJDg== +clsx@^1.0.1, clsx@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/clsx/-/clsx-1.1.1.tgz#98b3134f9abbdf23b2663491ace13c5c03a73188" + integrity sha512-6/bPho624p3S2pMyvP5kKBPXnI3ufHLObBFCfgx+LkeR5lg2XYy2hqZqUf45ypD8COn2bhgGJSUE+l5dhNBieA== cmd-shim@^2.1.0: version "2.1.0" @@ -10267,7 +10099,7 @@ commander@^5.1.0: resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae" integrity sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg== -commander@^6.1.0: +commander@^6.1.0, commander@^6.2.1: version "6.2.1" resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA== @@ -10544,10 +10376,10 @@ copy-props@^2.0.1: each-props "^1.3.0" is-plain-object "^2.0.1" -copy-to-clipboard@^3.0.8, copy-to-clipboard@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/copy-to-clipboard/-/copy-to-clipboard-3.2.0.tgz#d2724a3ccbfed89706fac8a894872c979ac74467" - integrity sha512-eOZERzvCmxS8HWzugj4Uxl8OJxa7T2k1Gi0X5qavwydHIfuSHq2dTD09LOg/XyGq4Zpb5IsR/2OJ5lbOegz78w== +copy-to-clipboard@^3.0.8, copy-to-clipboard@^3.2.0, copy-to-clipboard@^3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/copy-to-clipboard/-/copy-to-clipboard-3.3.1.tgz#115aa1a9998ffab6196f93076ad6da3b913662ae" + integrity sha512-i13qo6kIHTTpCm8/Wup+0b1mVWETvu2kIMzKoK8FpkLkFxlt0znUAHcMzox+T8sPlqtZXq3CulEjQHsYiGFJUw== dependencies: toggle-selection "^1.0.6" @@ -10568,23 +10400,7 @@ copy-webpack-plugin@^6.0.2: serialize-javascript "^3.1.0" webpack-sources "^1.4.3" -core-js-compat@^3.1.1: - version "3.6.5" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.6.5.tgz#2a51d9a4e25dfd6e690251aa81f99e3c05481f1c" - integrity sha512-7ItTKOhOZbznhXAQ2g/slGg1PJV5zDO/WdkTwi7UEOJmkvsE32PWvx6mKtDjiMpjnR2CNf6BAD6sSxIlv7ptng== - dependencies: - browserslist "^4.8.5" - semver "7.0.0" - -core-js-compat@^3.18.0: - version "3.18.1" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.18.1.tgz#01942a0877caf9c6e5007c027183cf0bdae6a191" - integrity sha512-XJMYx58zo4W0kLPmIingVZA10+7TuKrMLPt83+EzDmxFJQUMcTVVmQ+n5JP4r6Z14qSzhQBRi3NSWoeVyKKXUg== - dependencies: - browserslist "^4.17.1" - semver "7.0.0" - -core-js-compat@^3.19.0, core-js-compat@^3.19.1: +core-js-compat@^3.1.1, core-js-compat@^3.18.0, core-js-compat@^3.19.1, core-js-compat@^3.8.1: version "3.19.1" resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.19.1.tgz#fe598f1a9bf37310d77c3813968e9f7c7bb99476" integrity sha512-Q/VJ7jAF/y68+aUsQJ/afPOewdsGkDtcMb40J8MbuWKlK3Y+wtHq8bTHKPj2WKWLIqmS5JhHs4CzHtz6pT2W6g== @@ -10592,10 +10408,10 @@ core-js-compat@^3.19.0, core-js-compat@^3.19.1: browserslist "^4.17.6" semver "7.0.0" -core-js-pure@^3.0.0, core-js-pure@^3.0.1: - version "3.6.5" - resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.6.5.tgz#c79e75f5e38dbc85a662d91eea52b8256d53b813" - integrity sha512-lacdXOimsiD0QyNf9BC/mxivNJ/ybBGJXQFKzRekp1WTHoVUWsUHEn+2T8GJAzzIhyOuXA+gOxCVN3l+5PLPUA== +core-js-pure@^3.0.0, core-js-pure@^3.8.2: + version "3.19.1" + resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.19.1.tgz#edffc1fc7634000a55ba05e95b3f0fe9587a5aa4" + integrity sha512-Q0Knr8Es84vtv62ei6/6jXH/7izKmOrtrxH9WJTHLCMAVeU+8TF8z8Nr08CsH4Ot0oJKzBzJJL9SJBYIv7WlfQ== core-js@^1.0.0: version "1.2.7" @@ -10607,7 +10423,7 @@ core-js@^2.4.0, core-js@^2.5.0, core-js@^2.6.9: resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.9.tgz#6b4b214620c834152e179323727fc19741b084f2" integrity sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A== -core-js@^3.0.1, core-js@^3.0.4, core-js@^3.19.1, core-js@^3.6.5, core-js@^3.8.2: +core-js@^3.0.4, core-js@^3.19.1, core-js@^3.6.5, core-js@^3.8.2: version "3.19.1" resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.19.1.tgz#f6f173cae23e73a7d88fa23b6e9da329276c6641" integrity sha512-Tnc7E9iKd/b/ff7GFbhwPVzJzPztGrChB8X8GLqoYGdEOG8IpLnK1xPyo3ZoO3HsK6TodJS58VGPOxA+hLHQMg== @@ -10875,7 +10691,7 @@ css-in-js-utils@^2.0.0: hyphenate-style-name "^1.0.2" isobject "^3.0.1" -css-loader@^3.4.2, css-loader@^3.5.3: +css-loader@^3.4.2, css-loader@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-3.6.0.tgz#2e4b2c7e6e2d27f8c8f28f61bffcd2e6c91ef645" integrity sha512-M5lSukoWi1If8dhQAUCvj4H8vUt3vOnwbQBH9DdTm/s4Ym2B/3dPMtYZeJmq7Q3S3Pa+I94DcZ7pc9bP14cWIQ== @@ -12172,11 +11988,6 @@ diff-sequences@^24.9.0: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.9.0.tgz#5715d6244e2aa65f48bba0bc972db0b0b11e95b5" integrity sha512-Dj6Wk3tWyTE+Fo1rW8v0Xhwk80um6yFYKbuAxc9c3EZxIHFDYwbi34Uk42u1CdnIiVorvt4RmlSDjIPyzGC2ew== -diff-sequences@^25.2.6: - version "25.2.6" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-25.2.6.tgz#5f467c00edd35352b7bca46d7927d60e687a76dd" - integrity sha512-Hq8o7+6GaZeoFjtpgvRBUknSXNeJiCx7V9Fr94ZMljNiCr9n9L8H8aJqgWOQiDDGdyn29fRNcDdRVJ5fdyihfg== - diff-sequences@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-26.6.2.tgz#48ba99157de1923412eed41db6b6d4aa9ca7c0b1" @@ -12430,10 +12241,10 @@ dotenv-expand@^5.1.0: resolved "https://registry.yarnpkg.com/dotenv-expand/-/dotenv-expand-5.1.0.tgz#3fbaf020bfd794884072ea26b1e9791d45a629f0" integrity sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA== -dotenv-webpack@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/dotenv-webpack/-/dotenv-webpack-1.7.0.tgz#4384d8c57ee6f405c296278c14a9f9167856d3a1" - integrity sha512-wwNtOBW/6gLQSkb8p43y0Wts970A3xtNiG/mpwj9MLUhtPCQG6i+/DSXXoNN7fbPCU/vQ7JjwGmgOeGZSSZnsw== +dotenv-webpack@^1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/dotenv-webpack/-/dotenv-webpack-1.8.0.tgz#7ca79cef2497dd4079d43e81e0796bc9d0f68a5e" + integrity sha512-o8pq6NLBehtrqA8Jv8jFQNtG9nhRtVqmoD4yWbgUyoU3+9WBlPe+c2EAiaJok9RB28QvrWvdWLZGeTT5aATDMg== dependencies: dotenv-defaults "^1.0.2" @@ -12464,7 +12275,7 @@ downshift@^3.2.10: prop-types "^15.7.2" react-is "^16.9.0" -downshift@^6.0.6: +downshift@^6.0.15: version "6.1.0" resolved "https://registry.yarnpkg.com/downshift/-/downshift-6.1.0.tgz#f008063d9b63935910d9db12ead07979ab51ce66" integrity sha512-MnEJERij+1pTVAsOPsH3q9MJGNIZuu2sT90uxOCEOZYH6sEzkVGtUcTBVDRQkE8y96zpB7uEbRn24aE9VpHnZg== @@ -12575,7 +12386,7 @@ ee-first@1.1.1: resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= -ejs@^3.1.2, ejs@^3.1.6: +ejs@^3.1.6: version "3.1.6" resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.6.tgz#5bfd0a0689743bb5268b3550cceeebbc1702822a" integrity sha512-9lt9Zse4hPucPkoP7FHDF0LQAlGyF9JVpnClFLFH3aSSbxmyoqINRpp/9wePWJTUl4KOQwRL72Iw3InHPDkoGw== @@ -12664,20 +12475,13 @@ elegant-spinner@^1.0.1: resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e" integrity sha1-2wQ1IcldfjA/2PNFvtwzSc+wcp4= -element-resize-detector@^1.1.12, element-resize-detector@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/element-resize-detector/-/element-resize-detector-1.2.1.tgz#b0305194447a4863155e58f13323a0aef30851d1" - integrity sha512-BdFsPepnQr9fznNPF9nF4vQ457U/ZJXQDSNF1zBe7yaga8v9AdZf3/NElYxFdUh7SitSGt040QygiTo6dtatIw== +element-resize-detector@^1.1.12, element-resize-detector@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/element-resize-detector/-/element-resize-detector-1.2.3.tgz#5078d9b99398fe4c589f8c8df94ff99e5d413ff3" + integrity sha512-+dhNzUgLpq9ol5tyhoG7YLoXL3ssjfFW+0gpszXPwRU6NjGr1fVHMEAF8fVzIiRJq57Nre0RFeIjJwI8Nh2NmQ== dependencies: batch-processor "1.0.0" -element-resize-detector@^1.1.15: - version "1.1.15" - resolved "https://registry.yarnpkg.com/element-resize-detector/-/element-resize-detector-1.1.15.tgz#48eba1a2eaa26969a4c998d972171128c971d8d2" - integrity sha512-16/5avDegXlUxytGgaumhjyQoM6hpp5j3+L79sYq5hlXfTNRy5WMMuTVWkZU3egp/CokCmTmvf18P3KeB57Iog== - dependencies: - batch-processor "^1.0.0" - elliptic@^6.0.0: version "6.5.4" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" @@ -12726,7 +12530,7 @@ emoticon@^3.2.0: resolved "https://registry.yarnpkg.com/emoticon/-/emoticon-3.2.0.tgz#c008ca7d7620fac742fe1bf4af8ff8fed154ae7f" integrity sha512-SNujglcLTTg+lDAcApPNgEdudaqQFiAbJCqzjNxJkvN9vAwCGi0uu8IUVvx+f16h+V44KCY6Y2yboroc9pilHg== -emotion-theming@^10.0.19, emotion-theming@^10.0.27: +emotion-theming@^10.0.27: version "10.0.27" resolved "https://registry.yarnpkg.com/emotion-theming/-/emotion-theming-10.0.27.tgz#1887baaec15199862c89b1b984b79806f2b9ab10" integrity sha512-MlF1yu/gYh8u+sLUqA0YuA9JX0P4Hb69WlKc/9OLo+WCXuX6sy/KoIa+qJimgmr2dWqnypYKYPX37esjDBbhdw== @@ -13112,7 +12916,7 @@ escape-string-regexp@^1.0.0, escape-string-regexp@^1.0.2, escape-string-regexp@^ resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= -escodegen@^1.11.0, escodegen@^1.11.1, escodegen@^1.12.0, escodegen@^1.14.1: +escodegen@^1.11.0, escodegen@^1.11.1, escodegen@^1.14.1: version "1.14.3" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.14.3.tgz#4e7b81fba61581dc97582ed78cab7f0e8d63f503" integrity sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw== @@ -13124,6 +12928,18 @@ escodegen@^1.11.0, escodegen@^1.11.1, escodegen@^1.12.0, escodegen@^1.14.1: optionalDependencies: source-map "~0.6.1" +escodegen@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-2.0.0.tgz#5e32b12833e8aa8fa35e1bf0befa89380484c7dd" + integrity sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw== + dependencies: + esprima "^4.0.1" + estraverse "^5.2.0" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.6.1" + escodegen@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.2.0.tgz#09de7967791cc958b7f89a2ddb6d23451af327e1" @@ -13727,7 +13543,7 @@ expose-loader@^0.7.5: resolved "https://registry.yarnpkg.com/expose-loader/-/expose-loader-0.7.5.tgz#e29ea2d9aeeed3254a3faa1b35f502db9f9c3f6f" integrity sha512-iPowgKUZkTPX5PznYsmifVj9Bob0w2wTHVkt/eYNPSzyebkUgIedmskf/kcfEIWpiWjg3JRjnW+a17XypySMuw== -express@^4.16.3, express@^4.17.0, express@^4.17.1: +express@^4.16.3, express@^4.17.1: version "4.17.1" resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" integrity sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g== @@ -14079,13 +13895,13 @@ file-loader@^4.2.0: loader-utils "^1.2.3" schema-utils "^2.0.0" -file-loader@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-6.0.0.tgz#97bbfaab7a2460c07bcbd72d3a6922407f67649f" - integrity sha512-/aMOAYEFXDdjG0wytpTL5YQLfZnnTmLNjn+AIrJ/6HVnTfDqLsVKUUwkDf4I4kgex36BvjuXEn/TX9B/1ESyqQ== +file-loader@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-6.2.0.tgz#baef7cf8e1840df325e4390b4484879480eebe4d" + integrity sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw== dependencies: loader-utils "^2.0.0" - schema-utils "^2.6.5" + schema-utils "^3.0.0" file-saver@^1.3.8: version "1.3.8" @@ -14403,7 +14219,7 @@ forever-agent@~0.6.1: resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= -fork-ts-checker-webpack-plugin@4.1.6, fork-ts-checker-webpack-plugin@^4.1.4: +fork-ts-checker-webpack-plugin@4.1.6, fork-ts-checker-webpack-plugin@^4.1.6: version "4.1.6" resolved "https://registry.yarnpkg.com/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-4.1.6.tgz#5055c703febcf37fa06405d400c122b905167fc5" integrity sha512-DUxuQaKoqfNne8iikd14SAkh5uw4+8vNifp6gmA73yYNS6ywLIWSLD/n/mBzHQRpW3J7rbATEakmiA8JvkTyZw== @@ -14416,6 +14232,25 @@ fork-ts-checker-webpack-plugin@4.1.6, fork-ts-checker-webpack-plugin@^4.1.4: tapable "^1.0.0" worker-rpc "^0.1.0" +fork-ts-checker-webpack-plugin@^6.0.4: + version "6.4.0" + resolved "https://registry.yarnpkg.com/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-6.4.0.tgz#057e477cf1d8b013b2ed2669437f818680289c4c" + integrity sha512-3I3wFkc4DbzaUDPWEi96wdYGu4EKtxBafhZYm0o4mX51d9bphAY4P3mBl8K5mFXFJqVzHfmdbm9kLGnm7vwwBg== + dependencies: + "@babel/code-frame" "^7.8.3" + "@types/json-schema" "^7.0.5" + chalk "^4.1.0" + chokidar "^3.4.2" + cosmiconfig "^6.0.0" + deepmerge "^4.2.2" + fs-extra "^9.0.0" + glob "^7.1.6" + memfs "^3.1.2" + minimatch "^3.0.4" + schema-utils "2.7.0" + semver "^7.3.2" + tapable "^1.0.0" + form-data@^2.3.1: version "2.5.0" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.5.0.tgz#094ec359dc4b55e7d62e0db4acd76e89fe874d37" @@ -14586,6 +14421,11 @@ fs-mkdirp-stream@^1.0.0: graceful-fs "^4.1.11" through2 "^2.0.3" +fs-monkey@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/fs-monkey/-/fs-monkey-1.0.3.tgz#ae3ac92d53bb328efe0e9a1d9541f6ad8d48e2d3" + integrity sha512-cybjIfiiE+pTWicSCLFHSrXZ6EilF30oh91FDP9S2B051prEa7QWfrVTQm10/dDpswBDXZugPa1Ogu8Yh+HV0Q== + fs-readdir-recursive@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27" @@ -14606,10 +14446,10 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= -fsevents@^2.1.2, fsevents@~2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.2.tgz#4c0a1fb34bc68e543b4b82a9ec392bfbda840805" - integrity sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA== +fsevents@^2.1.2, fsevents@~2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== fsu@^1.0.2: version "1.1.1" @@ -15021,7 +14861,7 @@ global-prefix@^3.0.0: kind-of "^6.0.2" which "^1.3.1" -global@^4.3.1, global@^4.3.2, global@^4.4.0: +global@^4.3.1, global@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/global/-/global-4.4.0.tgz#3e7b105179006a323ed71aafca3e9c57a5cc6406" integrity sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w== @@ -15101,7 +14941,7 @@ globby@^10.0.1: merge2 "^1.2.3" slash "^3.0.0" -globby@^11.0.1, globby@^11.0.3, globby@^11.0.4: +globby@^11.0.1, globby@^11.0.2, globby@^11.0.3, globby@^11.0.4: version "11.0.4" resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5" integrity sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg== @@ -15868,7 +15708,7 @@ html-void-elements@^1.0.0: resolved "https://registry.yarnpkg.com/html-void-elements/-/html-void-elements-1.0.5.tgz#ce9159494e86d95e45795b166c2021c2cfca4483" integrity sha512-uE/TxKuyNIcx44cIWnjr/rfIATDH7ZaOMmstu0CwhFG1Dunhlp4OC6/NMbhiwoq5BpW0ubi303qnEk/PZj614w== -html-webpack-plugin@^4.2.1: +html-webpack-plugin@^4.0.0: version "4.3.0" resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-4.3.0.tgz#53bf8f6d696c4637d5b656d3d9863d89ce8174fd" integrity sha512-C0fzKN8yQoVLTelcJxZfJCE+aAvQiY2VUf3UuKrR4a9k5UMWYOtpDLsaXwATbcVCnI05hUS7L9ULQHWLZhyi3w== @@ -16381,7 +16221,7 @@ interpret@^1.0.0, interpret@^1.1.0, interpret@^1.4.0: resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== -interpret@^2.0.0: +interpret@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/interpret/-/interpret-2.2.0.tgz#1a78a0b5965c40a5416d007ad6f50ad27c417df9" integrity sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw== @@ -16415,7 +16255,7 @@ intl@^1.2.5: resolved "https://registry.yarnpkg.com/intl/-/intl-1.2.5.tgz#82244a2190c4e419f8371f5aa34daa3420e2abde" integrity sha1-giRKIZDE5Bn4Nx9ao02qNCDiq94= -invariant@2.2.4, invariant@^2.1.0, invariant@^2.1.1, invariant@^2.2.2, invariant@^2.2.3, invariant@^2.2.4: +invariant@^2.1.0, invariant@^2.1.1, invariant@^2.2.2, invariant@^2.2.3, invariant@^2.2.4: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== @@ -16648,7 +16488,7 @@ is-docker@^2.0.0: resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.0.0.tgz#2cb0df0e75e2d064fe1864c37cdeacb7b2dcf25b" integrity sha512-pJEdRugimx4fBMra5z2/5iRdZ63OhYV0vr0Dwm5+xtW4D1FvRkB8hamMIhnWfyJeDdyr/aa7BDyNbtG38VxgoQ== -is-dom@^1.1.0: +is-dom@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-dom/-/is-dom-1.1.0.tgz#af1fced292742443bb59ca3f76ab5e80907b4e8a" integrity sha512-u82f6mvhYxRPKpw8V1N0W8ce1xXwOrQtgGcxl6UCL5zBmZu3is/18K0rR7uFCnMDuAsS/3W54mGL4vsaFUQlEQ== @@ -16906,6 +16746,11 @@ is-plain-object@3.0.0: dependencies: isobject "^4.0.0" +is-plain-object@5.0.0, is-plain-object@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" + integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== + is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" @@ -16913,11 +16758,6 @@ is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: dependencies: isobject "^3.0.1" -is-plain-object@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" - integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== - is-potential-custom-element-name@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.0.tgz#0c52e54bcca391bb2c494b21e8626d7336c6e397" @@ -16938,7 +16778,7 @@ is-redirect@^1.0.0: resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" integrity sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ= -is-regex@^1.0.4, is-regex@^1.0.5, is-regex@^1.1.0, is-regex@^1.1.1, is-regex@^1.1.2, is-regex@^1.1.3, is-regex@^1.1.4: +is-regex@^1.0.4, is-regex@^1.0.5, is-regex@^1.1.0, is-regex@^1.1.2, is-regex@^1.1.3, is-regex@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== @@ -17385,16 +17225,6 @@ jest-diff@^24.9.0: jest-get-type "^24.9.0" pretty-format "^24.9.0" -jest-diff@^25.2.1: - version "25.5.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-25.5.0.tgz#1dd26ed64f96667c068cef026b677dfa01afcfa9" - integrity sha512-z1kygetuPiREYdNIumRpAHY6RXiGmp70YHptjdaxTWGmA085W3iCnXNx0DhflK3vwrKmrRWyY1wUpkPMVxMK7A== - dependencies: - chalk "^3.0.0" - diff-sequences "^25.2.6" - jest-get-type "^25.2.6" - pretty-format "^25.5.0" - jest-diff@^26.0.0, jest-diff@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-26.6.2.tgz#1aa7468b52c3a68d7d5c5fdcdfcd5e49bd164394" @@ -17472,11 +17302,6 @@ jest-get-type@^24.9.0: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.9.0.tgz#1684a0c8a50f2e4901b6644ae861f579eed2ef0e" integrity sha512-lUseMzAley4LhIcpSP9Jf+fTrQ4a1yHQwLNeeVa2cEmbCGeoZAtYPOIv8JaxLD/sUpKxetKGP+gsHl8f8TSj8Q== -jest-get-type@^25.2.6: - version "25.2.6" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-25.2.6.tgz#0b0a32fab8908b44d508be81681487dbabb8d877" - integrity sha512-DxjtyzOHjObRM+sM1knti6or+eOgcGU4xVSb2HNP1TqO4ahsT+rqZg+nyqHWJSvWgKC5cG3QjGFBqxLghiF/Ig== - jest-get-type@^26.3.0: version "26.3.0" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-26.3.0.tgz#e97dc3c3f53c2b406ca7afaed4493b1d099199e0" @@ -17888,7 +17713,7 @@ jest-when@^3.2.1: bunyan "^1.8.12" expect "^24.8.0" -jest-worker@^26.2.1, jest-worker@^26.5.0, jest-worker@^26.6.2: +jest-worker@^26.5.0, jest-worker@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.6.2.tgz#7f72cbc4d643c365e27b9fd775f9d0eaa9c7a8ed" integrity sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ== @@ -18202,10 +18027,10 @@ json5@^1.0.1: dependencies: minimist "^1.2.0" -json5@^2.1.0, json5@^2.1.1, json5@^2.1.2: - version "2.1.3" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.3.tgz#c9b0f7fa9233bfe5807fe66fcf3a5617ed597d43" - integrity sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA== +json5@^2.1.0, json5@^2.1.2, json5@^2.1.3: + version "2.2.0" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" + integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== dependencies: minimist "^1.2.5" @@ -18966,11 +18791,6 @@ lodash.set@^4.3.2: resolved "https://registry.yarnpkg.com/lodash.set/-/lodash.set-4.3.2.tgz#d8757b1da807dde24816b0d6a84bea1a76230b23" integrity sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM= -lodash.some@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.some/-/lodash.some-4.6.0.tgz#1bb9f314ef6b8baded13b549169b2a945eb68e4d" - integrity sha1-G7nzFO9ri63tE7VJFpsqlF62jk0= - lodash.sortby@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" @@ -19363,6 +19183,11 @@ markdown-to-jsx@^6.11.4: prop-types "^15.6.2" unquote "^1.1.0" +markdown-to-jsx@^7.1.3: + version "7.1.3" + resolved "https://registry.yarnpkg.com/markdown-to-jsx/-/markdown-to-jsx-7.1.3.tgz#f00bae66c0abe7dd2d274123f84cb6bd2a2c7c6a" + integrity sha512-jtQ6VyT7rMT5tPV0g2EJakEnXLiPksnvlYtwQsVVZ611JsWGN8bQ1tVSDX4s6JllfEH6wmsYxNjTUAMrPmNA8w== + match-sorter@^6.0.2: version "6.1.0" resolved "https://registry.yarnpkg.com/match-sorter/-/match-sorter-6.1.0.tgz#7fec6808d94311a35fef7fd842a11634f2361bd7" @@ -19422,13 +19247,6 @@ mdast-squeeze-paragraphs@^4.0.0: dependencies: unist-util-remove "^2.0.0" -mdast-util-definitions@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/mdast-util-definitions/-/mdast-util-definitions-2.0.1.tgz#2c931d8665a96670639f17f98e32c3afcfee25f3" - integrity sha512-Co+DQ6oZlUzvUR7JCpP249PcexxygiaKk9axJh+eRzHDZJk2julbIdKB4PXHVxdBuLzvJ1Izb+YDpj2deGMOuA== - dependencies: - unist-util-visit "^2.0.0" - mdast-util-definitions@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/mdast-util-definitions/-/mdast-util-definitions-4.0.0.tgz#c5c1a84db799173b4dcf7643cda999e440c24db2" @@ -19521,6 +19339,13 @@ media-typer@0.3.0: resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= +memfs@^3.1.2: + version "3.3.0" + resolved "https://registry.yarnpkg.com/memfs/-/memfs-3.3.0.tgz#4da2d1fc40a04b170a56622c7164c6be2c4cbef2" + integrity sha512-BEE62uMfKOavX3iG7GYX43QJ+hAeeWnwIAuJ/R6q96jaMtiLzhsxHJC8B1L7fK7Pt/vXDRwb3SG/yBpNGDPqzg== + dependencies: + fs-monkey "1.0.3" + "memoize-one@>=3.1.1 <6", memoize-one@^5.0.0, memoize-one@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/memoize-one/-/memoize-one-5.1.1.tgz#047b6e3199b508eaec03504de71229b8eb1d75c0" @@ -19707,7 +19532,7 @@ mime-db@1.44.0, mime-db@1.x.x, "mime-db@>= 1.40.0 < 2": resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92" integrity sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg== -mime-types@^2.0.1, mime-types@^2.1.12, mime-types@^2.1.26, mime-types@^2.1.27, mime-types@~2.1.17, mime-types@~2.1.19, mime-types@~2.1.24: +mime-types@^2.0.1, mime-types@^2.1.12, mime-types@^2.1.27, mime-types@~2.1.17, mime-types@~2.1.19, mime-types@~2.1.24: version "2.1.27" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.27.tgz#47949f98e279ea53119f5722e0f34e529bec009f" integrity sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w== @@ -20470,7 +20295,7 @@ node-emoji@^1.10.0: dependencies: lodash.toarray "^4.4.0" -node-fetch@2.6.1, node-fetch@^1.0.1, node-fetch@^2.3.0, node-fetch@^2.6.0, node-fetch@^2.6.1: +node-fetch@2.6.1, node-fetch@^1.0.1, node-fetch@^2.3.0, node-fetch@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== @@ -21244,10 +21069,10 @@ outpipe@^1.1.0: dependencies: shell-quote "^1.4.2" -overlayscrollbars@^1.10.2: - version "1.13.0" - resolved "https://registry.yarnpkg.com/overlayscrollbars/-/overlayscrollbars-1.13.0.tgz#1edb436328133b94877b558f77966d5497ca36a7" - integrity sha512-p8oHrMeRAKxXDMPI/EBNITj/zTVHKNnAnM59Im+xnoZUlV07FyTg46wom2286jJlXGGfcPFG/ba5NUiCwWNd4w== +overlayscrollbars@^1.13.1: + version "1.13.1" + resolved "https://registry.yarnpkg.com/overlayscrollbars/-/overlayscrollbars-1.13.1.tgz#0b840a88737f43a946b9d87875a2f9e421d0338a" + integrity sha512-gIQfzgGgu1wy80EB4/6DaJGHMEGmizq27xHIESrzXq0Y/J0Ay1P3DWk6tuVmEPIZH15zaBlxeEJOqdJKmowHCQ== p-all@^2.1.0: version "2.1.0" @@ -21304,12 +21129,12 @@ p-limit@^2.0.0, p-limit@^2.2.0, p-limit@^2.3.0: dependencies: p-try "^2.0.0" -p-limit@^3.0.1, p-limit@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.0.2.tgz#1664e010af3cadc681baafd3e2a437be7b0fb5fe" - integrity sha512-iwqZSOoWIW+Ew4kAGUlN16J4M7OB3ysMLSZtnhmqx7njIHFPlxWBX8xo3lVTyFVq6mI/lL9qt2IsN1sHwaxJkg== +p-limit@^3.0.1, p-limit@^3.0.2, p-limit@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== dependencies: - p-try "^2.0.0" + yocto-queue "^0.1.0" p-locate@^2.0.0: version "2.0.0" @@ -21841,6 +21666,11 @@ phin@^2.9.1: resolved "https://registry.yarnpkg.com/phin/-/phin-2.9.3.tgz#f9b6ac10a035636fb65dfc576aaaa17b8743125c" integrity sha512-CzFr90qM24ju5f88quFC/6qohjC144rehe5n6DH900lgXmUe86+xCKc10ev56gRKC4/BkHUoG4uSiQgBiIXwDA== +picocolors@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-0.2.1.tgz#570670f793646851d1ba135996962abad587859f" + integrity sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA== + picocolors@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" @@ -21942,6 +21772,13 @@ pkg-dir@^3.0.0: dependencies: find-up "^3.0.0" +pkg-dir@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-5.0.0.tgz#a02d6aebe6ba133a928f74aec20bafdfe6b8e760" + integrity sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA== + dependencies: + find-up "^5.0.0" + pkg-up@3.1.0, pkg-up@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-3.1.0.tgz#100ec235cc150e4fd42519412596a28512a0def5" @@ -22040,7 +21877,7 @@ point-in-polygon@^1.0.1: resolved "https://registry.yarnpkg.com/point-in-polygon/-/point-in-polygon-1.0.1.tgz#d59b64e8fee41c49458aac82b56718c5957b2af7" integrity sha1-1Ztk6P7kHElFiqyCtWcYxZV7Kvc= -polished@^3.4.4, polished@^3.7.2: +polished@^3.7.2: version "3.7.2" resolved "https://registry.yarnpkg.com/polished/-/polished-3.7.2.tgz#ec5ddc17a7d322a574d5e10ddd2a6f01d3e767d1" integrity sha512-pQKtpZGmsZrW8UUpQMAnR7s3ppHeMQVNyMDKtUyKwuvDmklzcEyM5Kllb3JyE/sE/x7arDmyd35i+4vp99H6sQ== @@ -22129,12 +21966,12 @@ postcss-discard-overridden@^4.0.1: dependencies: postcss "^7.0.0" -postcss-flexbugs-fixes@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/postcss-flexbugs-fixes/-/postcss-flexbugs-fixes-4.1.0.tgz#e094a9df1783e2200b7b19f875dcad3b3aff8b20" - integrity sha512-jr1LHxQvStNNAHlgco6PzY308zvLklh7SJVYuWUwyUQncofaAlD2l+P/gxKHOdqWKe7xJSkVLFF/2Tp+JqMSZA== +postcss-flexbugs-fixes@^4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/postcss-flexbugs-fixes/-/postcss-flexbugs-fixes-4.2.1.tgz#9218a65249f30897deab1033aced8578562a6690" + integrity sha512-9SiofaZ9CWpQWxOwRh1b/r85KD5y7GgvsNt1056k6OYLvWUun0czCvogfJgylC22uJTwW1KzY3Gz65NZRlvoiQ== dependencies: - postcss "^7.0.0" + postcss "^7.0.26" postcss-html@^0.36.0: version "0.36.0" @@ -22168,6 +22005,17 @@ postcss-loader@^3.0.0: postcss-load-config "^2.0.0" schema-utils "^1.0.0" +postcss-loader@^4.2.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/postcss-loader/-/postcss-loader-4.3.0.tgz#2c4de9657cd4f07af5ab42bd60a673004da1b8cc" + integrity sha512-M/dSoIiNDOo8Rk0mUqoj4kpGq91gcxCfb9PoyZVdZ76/AuhxylHDYZblNE8o+EQ9AMSASeMFEKxZf5aU6wlx1Q== + dependencies: + cosmiconfig "^7.0.0" + klona "^2.0.4" + loader-utils "^2.0.0" + schema-utils "^3.0.0" + semver "^7.3.4" + postcss-media-query-parser@^0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/postcss-media-query-parser/-/postcss-media-query-parser-0.2.3.tgz#27b39c6f4d94f81b1a73b8f76351c609e5cef244" @@ -22482,20 +22330,26 @@ postcss@^7.0.0, postcss@^7.0.14, postcss@^7.0.16, postcss@^7.0.2, postcss@^7.0.2 source-map "^0.6.1" supports-color "^6.1.0" -postcss@^7.0.1, postcss@^7.0.27, postcss@^7.0.35: - version "7.0.35" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.35.tgz#d2be00b998f7f211d8a276974079f2e92b970e24" - integrity sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg== +postcss@^7.0.1, postcss@^7.0.27, postcss@^7.0.35, postcss@^7.0.36: + version "7.0.39" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.39.tgz#9624375d965630e2e1f2c02a935c82a59cb48309" + integrity sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA== dependencies: - chalk "^2.4.2" + picocolors "^0.2.1" source-map "^0.6.1" - supports-color "^6.1.0" potpack@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/potpack/-/potpack-1.0.1.tgz#d1b1afd89e4c8f7762865ec30bd112ab767e2ebf" integrity sha512-15vItUAbViaYrmaB/Pbw7z6qX2xENbFSTA7Ii4tgbPtasxm5v6ryKhKtL91tpWovDJzTiZqdwzhcFBCwiMVdVw== +preact-render-to-string@^5.1.19: + version "5.1.19" + resolved "https://registry.yarnpkg.com/preact-render-to-string/-/preact-render-to-string-5.1.19.tgz#ffae7c3bd1680be5ecf5991d41fe3023b3051e0e" + integrity sha512-bj8sn/oytIKO6RtOGSS/1+5CrQyRSC99eLUnEVbqUa6MzJX5dYh7wu9bmT0d6lm/Vea21k9KhCQwvr2sYN3rrQ== + dependencies: + pretty-format "^3.8.0" + prebuild-install@^6.1.2: version "6.1.4" resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-6.1.4.tgz#ae3c0142ad611d58570b89af4986088a4937e00f" @@ -22547,10 +22401,10 @@ prettier@^2.4.0: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.4.0.tgz#85bdfe0f70c3e777cf13a4ffff39713ca6f64cba" integrity sha512-DsEPLY1dE5HF3BxCRBmD4uYZ+5DCbvatnolqTqcxEgKVZnL2kUfyu7b8pPQ5+hTBkdhU9SLUmK0/pHb07RE4WQ== -prettier@~2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.5.tgz#d6d56282455243f2f92cc1716692c08aa31522d4" - integrity sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg== +prettier@~2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5" + integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q== pretty-bytes@^5.6.0: version "5.6.0" @@ -22575,17 +22429,7 @@ pretty-format@^24.9.0: ansi-styles "^3.2.0" react-is "^16.8.4" -pretty-format@^25.2.1, pretty-format@^25.5.0: - version "25.5.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-25.5.0.tgz#7873c1d774f682c34b8d48b6743a2bf2ac55791a" - integrity sha512-kbo/kq2LQ/A/is0PQwsEHM7Ca6//bGPPvU6UnsdDRSKTWxT/ru/xb88v4BJf6a69H+uTytOEsTusT9ksd/1iWQ== - dependencies: - "@jest/types" "^25.5.0" - ansi-regex "^5.0.0" - ansi-styles "^4.0.0" - react-is "^16.12.0" - -pretty-format@^26.0.0, pretty-format@^26.4.0, pretty-format@^26.6.2: +pretty-format@^26.0.0, pretty-format@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-26.6.2.tgz#e35c2705f14cb7fe2fe94fa078345b444120fc93" integrity sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg== @@ -22605,6 +22449,11 @@ pretty-format@^27.2.0: ansi-styles "^5.0.0" react-is "^17.0.1" +pretty-format@^3.8.0: + version "3.8.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-3.8.0.tgz#bfbed56d5e9a776645f4b1ff7aa1a3ac4fa3c385" + integrity sha1-v77VbV6ad2ZF9LH/eqGjrE+jw4U= + pretty-hrtime@^1.0.0, pretty-hrtime@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" @@ -22734,6 +22583,14 @@ prompts@2.4.0, prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.5" +prompts@^2.4.0: + version "2.4.2" + resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069" + integrity sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q== + dependencies: + kleur "^3.0.3" + sisteransi "^1.0.5" + prop-types-exact@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/prop-types-exact/-/prop-types-exact-1.2.0.tgz#825d6be46094663848237e3925a98c6e944e9869" @@ -22743,7 +22600,7 @@ prop-types-exact@^1.2.0: object.assign "^4.1.0" reflect.ownkeys "^0.2.0" -prop-types@15.7.2, prop-types@15.x, prop-types@^15.5.10, prop-types@^15.5.7, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2: +prop-types@15.x, prop-types@^15.0.0, prop-types@^15.5.10, prop-types@^15.5.7, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2: version "15.7.2" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== @@ -22951,7 +22808,7 @@ q@^1.1.2, q@^1.5.1: resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= -qs@6.7.0, qs@^6.5.1, qs@^6.6.0: +qs@6.7.0, qs@^6.5.1: version "6.7.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== @@ -23131,13 +22988,13 @@ raw-loader@^3.1.0: loader-utils "^1.1.0" schema-utils "^2.0.1" -raw-loader@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/raw-loader/-/raw-loader-4.0.1.tgz#14e1f726a359b68437e183d5a5b7d33a3eba6933" - integrity sha512-baolhQBSi3iNh1cglJjA0mYzga+wePk7vdEX//1dTFd+v4TsQlQE0jitJSNF1OIP82rdYulH7otaVmdlDaJ64A== +raw-loader@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/raw-loader/-/raw-loader-4.0.2.tgz#1aac6b7d1ad1501e66efdac1522c73e59a584eb6" + integrity sha512-ZnScIV3ag9A4wPX/ZayxL/jZH+euYb6FcUinPcgiQW0+UBtEv0O6Q3lGd3cqJ+GHH+rksEv3Pj99oxJ3u3VIKA== dependencies: loader-utils "^2.0.0" - schema-utils "^2.6.5" + schema-utils "^3.0.0" rbush@^3.0.0, rbush@^3.0.1: version "3.0.1" @@ -23218,7 +23075,7 @@ react-clientside-effect@^1.2.2: dependencies: "@babel/runtime" "^7.0.0" -react-color@^2.13.8, react-color@^2.17.0: +react-color@^2.13.8: version "2.17.0" resolved "https://registry.yarnpkg.com/react-color/-/react-color-2.17.0.tgz#e14b8a11f4e89163f65a34c8b43faf93f7f02aaa" integrity sha512-kJfE5tSaFe6GzalXOHksVjqwCPAsTl+nzS9/BWfP7j3EXbQ4IiLAF9sZGNzk3uq7HfofGYgjmcUgh0JP7xAQ0w== @@ -23230,6 +23087,11 @@ react-color@^2.13.8, react-color@^2.17.0: reactcss "^1.2.0" tinycolor2 "^1.4.1" +react-colorful@^5.1.2: + version "5.5.1" + resolved "https://registry.yarnpkg.com/react-colorful/-/react-colorful-5.5.1.tgz#29d9c4e496f2ca784dd2bb5053a3a4340cfaf784" + integrity sha512-M1TJH2X3RXEt12sWkpa6hLc/bbYS0H6F4rIqjQZ+RxNBstpY67d9TrFXtqdZwhpmBXcCwEi7stKqFue3ZRkiOg== + react-dev-utils@^11.0.3: version "11.0.4" resolved "https://registry.yarnpkg.com/react-dev-utils/-/react-dev-utils-11.0.4.tgz#a7ccb60257a1ca2e0efe7a83e38e6700d17aa37a" @@ -23260,21 +23122,10 @@ react-dev-utils@^11.0.3: strip-ansi "6.0.0" text-table "0.2.0" -react-docgen-typescript-plugin@^0.6.2: - version "0.6.3" - resolved "https://registry.yarnpkg.com/react-docgen-typescript-plugin/-/react-docgen-typescript-plugin-0.6.3.tgz#664b22601df083597ecb1e60bd21beca60125fdf" - integrity sha512-av1S/fmWBNFGgNa4qtkidFjjOz23eEi6EdCtwSWo9WNhGzUMyMygbD/DosMWoeFlZpk9R3MXPkRE7PDH6j5GMQ== - dependencies: - debug "^4.1.1" - endent "^2.0.1" - micromatch "^4.0.2" - react-docgen-typescript "^1.20.5" - tslib "^2.0.0" - -react-docgen-typescript@^1.20.5: - version "1.21.0" - resolved "https://registry.yarnpkg.com/react-docgen-typescript/-/react-docgen-typescript-1.21.0.tgz#3385dde81b63eb1d54f86a935bd4f65f96c821f6" - integrity sha512-E4y/OcXwHukgiVafCGlxwoNHr4BDmM70Ww7oimL/QkMo5dmGALhceewe/xmVjdMxxI7E5syOGOc9/tbHL742rg== +react-docgen-typescript@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/react-docgen-typescript/-/react-docgen-typescript-2.1.1.tgz#c9f9ccb1fa67e0f4caf3b12f2a07512a201c2dcf" + integrity sha512-XWe8bsYqVjxciKdpNoufaHiB7FgUHIOnVQgxUolRL3Zlof2zkdTzuQH6SU2n3Ek9kfy3O1c63ojMtNfpiuNeZQ== react-docgen@^5.0.0: version "5.3.0" @@ -23308,12 +23159,12 @@ react-draggable@3.x, "react-draggable@^2.2.6 || ^3.0.3": classnames "^2.2.5" prop-types "^15.6.0" -react-draggable@^4.0.3: - version "4.1.0" - resolved "https://registry.yarnpkg.com/react-draggable/-/react-draggable-4.1.0.tgz#e1c5b774001e32f0bff397254e1e9d5448ac92a4" - integrity sha512-Or/qe70cfymshqoC8Lsp0ukTzijJObehb7Vfl7tb5JRxoV+b6PDkOGoqYaWBzZ59k9dH/bwraLGsnlW78/3vrA== +react-draggable@^4.0.3, react-draggable@^4.4.3: + version "4.4.4" + resolved "https://registry.yarnpkg.com/react-draggable/-/react-draggable-4.4.4.tgz#5b26d9996be63d32d285a426f41055de87e59b2f" + integrity sha512-6e0WdcNLwpBx/YIDpoyd2Xb04PB0elrDrulKUgdrIlwuYvxh5Ok9M+F8cljm8kPXXs43PmMzek9RrB1b7mLMqA== dependencies: - classnames "^2.2.5" + clsx "^1.1.1" prop-types "^15.6.0" react-dropzone@^11.2.0: @@ -23333,13 +23184,14 @@ react-dropzone@^4.2.9: attr-accept "^1.1.3" prop-types "^15.5.7" -react-element-to-jsx-string@^14.3.1: - version "14.3.1" - resolved "https://registry.yarnpkg.com/react-element-to-jsx-string/-/react-element-to-jsx-string-14.3.1.tgz#a08fa6e46eb76061aca7eabc2e70f433583cb203" - integrity sha512-LRdQWRB+xcVPOL4PU4RYuTg6dUJ/FNmaQ8ls6w38YbzkbV6Yr5tFNESroub9GiSghtnMq8dQg2LcNN5aMIDzVg== +react-element-to-jsx-string@^14.3.2: + version "14.3.4" + resolved "https://registry.yarnpkg.com/react-element-to-jsx-string/-/react-element-to-jsx-string-14.3.4.tgz#709125bc72f06800b68f9f4db485f2c7d31218a8" + integrity sha512-t4ZwvV6vwNxzujDQ+37bspnLwA4JlgUPWhLjBJWsNIDceAf6ZKUTCjdm08cN6WeZ5pTMKiCJkmAYnpmR4Bm+dg== dependencies: - "@base2/pretty-print-object" "1.0.0" - is-plain-object "3.0.0" + "@base2/pretty-print-object" "1.0.1" + is-plain-object "5.0.0" + react-is "17.0.2" react-error-boundary@^3.1.0: version "3.1.1" @@ -23353,12 +23205,12 @@ react-error-overlay@^6.0.9: resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.9.tgz#3c743010c9359608c375ecd6bc76f35d93995b0a" integrity sha512-nQTTcUu+ATDbrSD1BZHr5kgSD4oF8OFjxun8uAaL8RwPBacGBNPf/yAuVVdx17N8XNzRDMrZ9XcKZHCjPW+9ew== -react-fast-compare@2.0.4, react-fast-compare@^2.0.4: +react-fast-compare@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-2.0.4.tgz#e84b4d455b0fec113e0402c329352715196f81f9" integrity sha512-suNP+J1VU1MWFKcyt7RtjiSWUjvidmQSlqu+eHslq+342xCbGTYmC0mEhPCOHxlW0CywylOC1u2DFAT+bv4dBw== -react-fast-compare@^3.0.1: +react-fast-compare@^3.0.1, react-fast-compare@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.0.tgz#641a9da81b6a6320f270e89724fb45a0b39e43bb" integrity sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA== @@ -23398,23 +23250,16 @@ react-grid-layout@^0.16.2: react-draggable "3.x" react-resizable "1.x" -react-helmet-async@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/react-helmet-async/-/react-helmet-async-1.0.2.tgz#bb55dd8268f7b15aac69c6b22e2f950abda8cc44" - integrity sha512-qzzchrM/ibHuPS/60ief8jaibPunuRdeta4iBDQV+ri2SFKwOV+X2NlEpvevZOauhmHrH/I6dI4E90EPVfJBBg== - dependencies: - "@babel/runtime" "7.3.4" - invariant "2.2.4" - prop-types "15.7.2" - react-fast-compare "2.0.4" - shallowequal "1.1.0" - -react-hotkeys@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/react-hotkeys/-/react-hotkeys-2.0.0.tgz#a7719c7340cbba888b0e9184f806a9ec0ac2c53f" - integrity sha512-3n3OU8vLX/pfcJrR3xJ1zlww6KS1kEJt0Whxc4FiGV+MJrQ1mYSYI3qS/11d2MJDFm8IhOXMTFQirfu6AVOF6Q== +react-helmet-async@^1.0.7: + version "1.1.2" + resolved "https://registry.yarnpkg.com/react-helmet-async/-/react-helmet-async-1.1.2.tgz#653b7e6bbfdd239c5dcd6b8df2811c7a363b8334" + integrity sha512-LTTzDDkyIleT/JJ6T/uqx7Y8qi1EuPPSiJawQY/nHHz0h7SPDT6HxP1YDDQx/fzcVxCqpWEEMS3QdrSrNkJYhg== dependencies: - prop-types "^15.6.1" + "@babel/runtime" "^7.12.5" + invariant "^2.2.4" + prop-types "^15.7.2" + react-fast-compare "^3.2.0" + shallowequal "^1.1.0" react-input-autosize@^2.2.1, react-input-autosize@^2.2.2: version "2.2.2" @@ -23423,14 +23268,21 @@ react-input-autosize@^2.2.1, react-input-autosize@^2.2.2: dependencies: prop-types "^15.5.8" -react-inspector@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/react-inspector/-/react-inspector-5.0.1.tgz#8a30f3d488c4f40203624bbe24800f508ae05d3a" - integrity sha512-qRIENuAIcRaytrmg/TL5nN5igYZMzyQqIKlWA8zoYRDltULsZC1bWy2Ua5wYJuwEYnC3gK4FCjcIQnb+5OyLsQ== +react-input-autosize@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/react-input-autosize/-/react-input-autosize-3.0.0.tgz#6b5898c790d4478d69420b55441fcc31d5c50a85" + integrity sha512-nL9uS7jEs/zu8sqwFE5MAPx6pPkNAriACQ2rGLlqmKr2sPGtN7TXTyDdQt4lbNXVx7Uzadb40x8qotIuru6Rhg== dependencies: - "@babel/runtime" "^7.8.7" - is-dom "^1.1.0" - prop-types "^15.6.1" + prop-types "^15.5.8" + +react-inspector@^5.1.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/react-inspector/-/react-inspector-5.1.1.tgz#58476c78fde05d5055646ed8ec02030af42953c8" + integrity sha512-GURDaYzoLbW8pMGXwYPDBIv6nqei4kK7LPRZ9q9HCZF54wqXz/dnylBp/kfE9XmekBhHvLDdcYeyIwSrvtOiWg== + dependencies: + "@babel/runtime" "^7.0.0" + is-dom "^1.0.0" + prop-types "^15.0.0" react-intl@^2.8.0: version "2.8.0" @@ -23443,6 +23295,11 @@ react-intl@^2.8.0: intl-relativeformat "^2.1.0" invariant "^2.1.1" +react-is@17.0.2: + version "17.0.2" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" + integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== + react-is@^16.12.0, react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.0, react-is@^16.8.1, react-is@^16.8.4, react-is@^16.8.6, react-is@^16.9.0: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" @@ -23675,10 +23532,10 @@ react-select@^2.4.4: react-input-autosize "^2.2.1" react-transition-group "^2.2.1" -react-select@^3.0.8: - version "3.1.0" - resolved "https://registry.yarnpkg.com/react-select/-/react-select-3.1.0.tgz#ab098720b2e9fe275047c993f0d0caf5ded17c27" - integrity sha512-wBFVblBH1iuCBprtpyGtd1dGMadsG36W5/t2Aj8OE6WbByDg5jIFyT7X5gT+l0qmT5TqWhxX+VsKJvCEl2uL9g== +react-select@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/react-select/-/react-select-3.2.0.tgz#de9284700196f5f9b5277c5d850a9ce85f5c72fe" + integrity sha512-B/q3TnCZXEKItO0fFN/I0tWOX3WJvi/X2wtdffmwSQVRwg5BpValScTO1vdic9AxlUgmeSzib2hAZAwIUQUZGQ== dependencies: "@babel/runtime" "^7.4.4" "@emotion/cache" "^10.0.9" @@ -23686,7 +23543,7 @@ react-select@^3.0.8: "@emotion/css" "^10.0.9" memoize-one "^5.0.0" prop-types "^15.6.0" - react-input-autosize "^2.2.2" + react-input-autosize "^3.0.0" react-transition-group "^4.3.0" react-shortcuts@^2.0.0: @@ -23710,25 +23567,15 @@ react-sizeme@^2.3.6: invariant "^2.2.2" lodash "^4.17.4" -react-sizeme@^2.5.2: - version "2.6.12" - resolved "https://registry.yarnpkg.com/react-sizeme/-/react-sizeme-2.6.12.tgz#ed207be5476f4a85bf364e92042520499455453e" - integrity sha512-tL4sCgfmvapYRZ1FO2VmBmjPVzzqgHA7kI8lSJ6JS6L78jXFNRdOZFpXyK6P1NBZvKPPCZxReNgzZNUajAerZw== - dependencies: - element-resize-detector "^1.2.1" - invariant "^2.2.4" - shallowequal "^1.1.0" - throttle-debounce "^2.1.0" - -react-sizeme@^2.6.7: - version "2.6.10" - resolved "https://registry.yarnpkg.com/react-sizeme/-/react-sizeme-2.6.10.tgz#9993dcb5e67fab94a8e5d078a0d3820609010f17" - integrity sha512-OJAPQxSqbcpbsXFD+fr5ARw4hNSAOimWcaTOLcRkIqnTp9+IFWY0w3Qdw1sMez6Ao378aimVL/sW6TTsgigdOA== +react-sizeme@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/react-sizeme/-/react-sizeme-3.0.2.tgz#4a2f167905ba8f8b8d932a9e35164e459f9020e4" + integrity sha512-xOIAOqqSSmKlKFJLO3inBQBdymzDuXx4iuwkNcJmC96jeiOg5ojByvL+g3MW9LPEsojLbC6pf68zOfobK8IPlw== dependencies: - element-resize-detector "^1.1.15" + element-resize-detector "^1.2.2" invariant "^2.2.4" shallowequal "^1.1.0" - throttle-debounce "^2.1.0" + throttle-debounce "^3.0.1" react-style-singleton@^2.1.0: version "2.1.0" @@ -23739,7 +23586,7 @@ react-style-singleton@^2.1.0: invariant "^2.2.4" tslib "^1.0.0" -react-syntax-highlighter@^13.5.0, react-syntax-highlighter@^15.3.1: +react-syntax-highlighter@^13.5.3, react-syntax-highlighter@^15.3.1: version "15.3.1" resolved "https://registry.yarnpkg.com/react-syntax-highlighter/-/react-syntax-highlighter-15.3.1.tgz#ba16ae8705f191956b73d0e11ae938fd255f2579" integrity sha512-XVQuug7kQ4/cWxiYE0XfGXvbDqLLqRsMK/GpmD3v1WOLzb6REcgkL59cJo0m3Y2LB0eoRCNhV62jqQe9/Z0p9w== @@ -23760,10 +23607,10 @@ react-test-renderer@^16.0.0-0, react-test-renderer@^16.12.0, "react-test-rendere react-is "^16.8.6" scheduler "^0.18.0" -react-textarea-autosize@^8.1.1: - version "8.2.0" - resolved "https://registry.yarnpkg.com/react-textarea-autosize/-/react-textarea-autosize-8.2.0.tgz#fae38653f5ec172a855fd5fffb39e466d56aebdb" - integrity sha512-grajUlVbkx6VdtSxCgzloUIphIZF5bKr21OYMceWPKkniy7H0mRAT/AXPrRtObAe+zUePnNlBwUc4ivVjUGIjw== +react-textarea-autosize@^8.3.0: + version "8.3.3" + resolved "https://registry.yarnpkg.com/react-textarea-autosize/-/react-textarea-autosize-8.3.3.tgz#f70913945369da453fd554c168f6baacd1fa04d8" + integrity sha512-2XlHXK2TDxS6vbQaoPbMOfQ8GK7+irc2fVK6QFIcC8GOnH3zI/v481n+j1L0WaPVvKxwesnY93fEfH++sus2rQ== dependencies: "@babel/runtime" "^7.10.2" use-composed-ref "^1.0.0" @@ -24227,11 +24074,6 @@ regenerator-runtime@^0.11.0: resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== -regenerator-runtime@^0.12.0: - version "0.12.1" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz#fa1a71544764c036f8c49b13a08b2594c9f8a0de" - integrity sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg== - regenerator-runtime@^0.13.1, regenerator-runtime@^0.13.3, regenerator-runtime@^0.13.4, regenerator-runtime@^0.13.7: version "0.13.7" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz#cac2dacc8a1ea675feaabaeb8ae833898ae46f55" @@ -24373,14 +24215,14 @@ remark-emoji@^2.1.0: node-emoji "^1.10.0" unist-util-visit "^2.0.2" -remark-external-links@^6.0.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/remark-external-links/-/remark-external-links-6.1.0.tgz#1a545b3cf896eae00ec1732d90f595f75a329abe" - integrity sha512-dJr+vhe3wuh1+E9jltQ+efRMqtMDOOnfFkhtoArOmhnBcPQX6THttXMkc/H0kdnAvkXTk7f2QdOYm5qo/sGqdw== +remark-external-links@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/remark-external-links/-/remark-external-links-8.0.0.tgz#308de69482958b5d1cd3692bc9b725ce0240f345" + integrity sha512-5vPSX0kHoSsqtdftSHhIYofVINC8qmp0nctkeU9YoJwV3YfiBRiI6cbFRJ0oI/1F9xS+bopXG0m2KS8VFscuKA== dependencies: extend "^3.0.0" is-absolute-url "^3.0.0" - mdast-util-definitions "^2.0.0" + mdast-util-definitions "^4.0.0" space-separated-tokens "^1.0.0" unist-util-visit "^2.0.0" @@ -24759,7 +24601,7 @@ resolve@1.1.7: resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= -resolve@^1.1.10, resolve@^1.1.4, resolve@^1.1.5, resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.10.1, resolve@^1.12.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.18.1, resolve@^1.20.0, resolve@^1.3.2, resolve@^1.3.3, resolve@^1.4.0, resolve@^1.7.1, resolve@^1.8.1: +resolve@^1.1.10, resolve@^1.1.4, resolve@^1.1.5, resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.10.1, resolve@^1.12.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.18.1, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.3.2, resolve@^1.3.3, resolve@^1.4.0, resolve@^1.7.1, resolve@^1.8.1: version "1.20.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== @@ -25130,15 +24972,7 @@ schema-utils@1.0.0, schema-utils@^0.3.0, schema-utils@^1.0.0: ajv-errors "^1.0.0" ajv-keywords "^3.1.0" -schema-utils@^0.4.5: - version "0.4.7" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-0.4.7.tgz#ba74f597d2be2ea880131746ee17d0a093c68187" - integrity sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ== - dependencies: - ajv "^6.1.0" - ajv-keywords "^3.1.0" - -schema-utils@^2.0.0, schema-utils@^2.0.1, schema-utils@^2.5.0, schema-utils@^2.6.5, schema-utils@^2.6.6, schema-utils@^2.7.0: +schema-utils@2.7.0, schema-utils@^2.0.0, schema-utils@^2.0.1, schema-utils@^2.5.0, schema-utils@^2.6.5, schema-utils@^2.6.6, schema-utils@^2.7.0: version "2.7.0" resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.7.0.tgz#17151f76d8eae67fbbf77960c33c676ad9f4efc7" integrity sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A== @@ -25147,6 +24981,14 @@ schema-utils@^2.0.0, schema-utils@^2.0.1, schema-utils@^2.5.0, schema-utils@^2.6 ajv "^6.12.2" ajv-keywords "^3.4.1" +schema-utils@^0.4.5: + version "0.4.7" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-0.4.7.tgz#ba74f597d2be2ea880131746ee17d0a093c68187" + integrity sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ== + dependencies: + ajv "^6.1.0" + ajv-keywords "^3.1.0" + schema-utils@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.0.0.tgz#67502f6aa2b66a2d4032b4279a2944978a0913ef" @@ -25310,13 +25152,6 @@ serialize-javascript@^3.0.0, serialize-javascript@^3.1.0: dependencies: randombytes "^2.1.0" -serialize-javascript@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-4.0.0.tgz#b525e1238489a5ecfc42afacc3fe99e666f4b1aa" - integrity sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw== - dependencies: - randombytes "^2.1.0" - serve-favicon@^2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/serve-favicon/-/serve-favicon-2.5.0.tgz#935d240cdfe0f5805307fdfe967d88942a2cbcf0" @@ -25444,7 +25279,7 @@ shallow-copy@~0.0.1: resolved "https://registry.yarnpkg.com/shallow-copy/-/shallow-copy-0.0.1.tgz#415f42702d73d810330292cc5ee86eae1a11a170" integrity sha1-QV9CcC1z2BAzApLMXuhurhoRoXA= -shallowequal@1.1.0, shallowequal@^1.1.0: +shallowequal@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8" integrity sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ== @@ -26206,10 +26041,16 @@ store2@^2.12.0: resolved "https://registry.yarnpkg.com/store2/-/store2-2.12.0.tgz#e1f1b7e1a59b6083b2596a8d067f6ee88fd4d3cf" integrity sha512-7t+/wpKLanLzSnQPX8WAcuLCCeuSHoWdQuh9SB3xD0kNOM38DNf+0Oa+wmvxmYueRzkmh6IcdKFtvTa+ecgPDw== -store2@^2.7.1: - version "2.9.0" - resolved "https://registry.yarnpkg.com/store2/-/store2-2.9.0.tgz#9987e3cf491b8163fd6197c42bab7d71c58c179b" - integrity sha512-JmK+95jLX2zAP75DVAJ1HAziQ6f+f495h4P9ez2qbmxazN6fE7doWlitqx9hj2YohH3kOi6RVksJe1UH0sJfPw== +storybook-addon-outline@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/storybook-addon-outline/-/storybook-addon-outline-1.4.1.tgz#0a1b262b9c65df43fc63308a1fdbd4283c3d9458" + integrity sha512-Qvv9X86CoONbi+kYY78zQcTGmCgFaewYnOVR6WL7aOFJoW7TrLiIc/O4hH5X9PsEPZFqjfXEPUPENWVUQim6yw== + dependencies: + "@storybook/addons" "^6.3.0" + "@storybook/api" "^6.3.0" + "@storybook/components" "^6.3.0" + "@storybook/core-events" "^6.3.0" + ts-dedent "^2.1.1" stream-browserify@^2.0.0: version "2.0.2" @@ -26584,13 +26425,13 @@ style-it@^2.1.3: dependencies: react-lib-adler32 "^1.0.3" -style-loader@^1.1.3, style-loader@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-1.2.1.tgz#c5cbbfbf1170d076cfdd86e0109c5bba114baa1a" - integrity sha512-ByHSTQvHLkWE9Ir5+lGbVOXhxX10fbprhLvdg96wedFZb4NDekDPxVKv5Fwmio+QcMlkkNfuK+5W1peQ5CUhZg== +style-loader@^1.1.3, style-loader@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-1.3.0.tgz#828b4a3b3b7e7aa5847ce7bae9e874512114249e" + integrity sha512-V7TCORko8rs9rIqkSrlMfkqA63DfoGBBJmK1kKGCcSi+BWb4cqz0SRsnp4l6rU5iwOEd0/2ePv68SV22VXon4Q== dependencies: loader-utils "^2.0.0" - schema-utils "^2.6.6" + schema-utils "^2.7.0" style-search@^0.1.0: version "0.1.0" @@ -27086,24 +26927,10 @@ tcp-port-used@^1.0.1: debug "4.1.0" is2 "2.0.1" -telejson@^5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/telejson/-/telejson-5.0.2.tgz#ed1e64be250cc1c757a53c19e1740b49832b3d51" - integrity sha512-XCrDHGbinczsscs8LXFr9jDhvy37yBk9piB7FJrCfxE8oP66WDkolNMpaBkWYgQqB9dQGBGtTDzGQPedc9KJmw== - dependencies: - "@types/is-function" "^1.0.0" - global "^4.4.0" - is-function "^1.0.2" - is-regex "^1.1.1" - is-symbol "^1.0.3" - isobject "^4.0.0" - lodash "^4.17.19" - memoizerific "^1.11.3" - -telejson@^5.1.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/telejson/-/telejson-5.1.1.tgz#fd83b594ebddfaeb9a5c4b9660c302fc07c9a65c" - integrity sha512-aU7x+nwodmODJPXhU9sC/REOcX/dx1tNbyeOFV1PCTh6e9Mj+bnyfQ7sr13zfJYya9BtpGwnUNn9Fd76Ybj2eg== +telejson@^5.3.2: + version "5.3.3" + resolved "https://registry.yarnpkg.com/telejson/-/telejson-5.3.3.tgz#fa8ca84543e336576d8734123876a9f02bf41d2e" + integrity sha512-PjqkJZpzEggA9TBpVtJi1LVptP7tYtXB6rEubwlHap76AMjzvOdKX41CxyaW7ahhzDU1aftXnMCx5kAPDZTQBA== dependencies: "@types/is-function" "^1.0.0" global "^4.4.0" @@ -27156,21 +26983,6 @@ terser-webpack-plugin@^1.4.3: webpack-sources "^1.4.0" worker-farm "^1.7.0" -terser-webpack-plugin@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-3.1.0.tgz#91e6d39571460ed240c0cf69d295bcf30ebf98cb" - integrity sha512-cjdZte66fYkZ65rQ2oJfrdCAkkhJA7YLYk5eGOcGCSGlq0ieZupRdjedSQXYknMPo2IveQL+tPdrxUkERENCFA== - dependencies: - cacache "^15.0.5" - find-cache-dir "^3.3.1" - jest-worker "^26.2.1" - p-limit "^3.0.2" - schema-utils "^2.6.6" - serialize-javascript "^4.0.0" - source-map "^0.6.1" - terser "^4.8.0" - webpack-sources "^1.4.3" - terser-webpack-plugin@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-4.2.3.tgz#28daef4a83bd17c1db0297070adc07fc8cfc6a9a" @@ -27195,7 +27007,7 @@ terser@5.4.0: source-map "~0.7.2" source-map-support "~0.5.19" -terser@^4.1.2, terser@^4.6.3, terser@^4.8.0: +terser@^4.1.2, terser@^4.6.3: version "4.8.0" resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.0.tgz#63056343d7c70bb29f3af665865a46fe03a0df17" integrity sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw== @@ -27261,6 +27073,11 @@ throttle-debounce@^2.1.0: resolved "https://registry.yarnpkg.com/throttle-debounce/-/throttle-debounce-2.1.0.tgz#257e648f0a56bd9e54fe0f132c4ab8611df4e1d5" integrity sha512-AOvyNahXQuU7NN+VVvOOX+uW6FPaWdAOdRP5HfwYxAfCzXTFKRMoIMk+n+po318+ktcChx+F1Dd91G3YHeMKyg== +throttle-debounce@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/throttle-debounce/-/throttle-debounce-3.0.1.tgz#32f94d84dfa894f786c9a1f290e7a645b6a19abb" + integrity sha512-dTEWWNu6JmeVXY0ZYoPuH5cRIwc0MeGbJwah9KUNYSJwommQpCzTySTpEe8Gs1J23aeWEuAobe4Ag7EHVt/LOg== + throttleit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/throttleit/-/throttleit-1.0.0.tgz#9e785836daf46743145a5984b6268d828528ac6c" @@ -27651,10 +27468,10 @@ ts-debounce@^3.0.0: resolved "https://registry.yarnpkg.com/ts-debounce/-/ts-debounce-3.0.0.tgz#9beedf59c04de3b5bef8ff28bd6885624df357be" integrity sha512-7jiRWgN4/8IdvCxbIwnwg2W0bbYFBH6BxFqBjMKk442t7+liF2Z1H6AUCcl8e/pD93GjPru+axeiJwFmRww1WQ== -ts-dedent@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ts-dedent/-/ts-dedent-2.0.0.tgz#47c5eb23d9096f3237cc413bc82d387d36dbe690" - integrity sha512-DfxKjSFQfw9+uf7N9Cy8Ebx9fv5fquK4hZ6SD3Rzr+1jKP6AVA6H8+B5457ZpUs0JKsGpGqIevbpZ9DMQJDp1A== +ts-dedent@^2.0.0, ts-dedent@^2.1.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/ts-dedent/-/ts-dedent-2.2.0.tgz#39e4bd297cd036292ae2394eb3412be63f563bb5" + integrity sha512-q5W7tVM71e2xjHZTlgfTDoPF/SmqKG5hddq9SzR49CH2hayqRKJtQ4mtRlSxKaJlR/+9rEM+mnBHf7I2/BQcpQ== ts-easing@^0.2.0: version "0.2.0" @@ -28039,10 +27856,10 @@ undici@^4.7.0: resolved "https://registry.yarnpkg.com/undici/-/undici-4.7.0.tgz#3bda286d67bf45d0ab1b94ca6c84e546dcb3b0d4" integrity sha512-O1q+/EIs4g0HnVMH8colei3qODGiYBLpavWYv3kI+JazBBsBIndnZfUqZ2MEfPJ12H9d56yVdwZG1/nV/xcoSQ== -unfetch@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/unfetch/-/unfetch-4.1.0.tgz#6ec2dd0de887e58a4dee83a050ded80ffc4137db" - integrity sha512-crP/n3eAPUJxZXM9T80/yv0YhkTEx2K1D3h7D1AJM6fzsWZrxdyRuLN0JH/dkZh1LNH8LxCnBzoPFCPbb2iGpg== +unfetch@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/unfetch/-/unfetch-4.2.0.tgz#7e21b0ef7d363d8d9af0fb929a5555f6ef97a3be" + integrity sha512-F9p7yYCn6cIW9El1zi0HI6vqpeIvBsr3dSuRO6Xuppb1u5rXpCPmMvLSyECLhybr9isec8Ohl0hPekMVrEinDA== unherit@^1.0.4: version "1.1.0" @@ -28472,14 +28289,14 @@ url-loader@^2.2.0: mime "^2.4.4" schema-utils "^2.5.0" -url-loader@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/url-loader/-/url-loader-4.1.0.tgz#c7d6b0d6b0fccd51ab3ffc58a78d32b8d89a7be2" - integrity sha512-IzgAAIC8wRrg6NYkFIJY09vtktQcsvU8V6HhtQj9PTefbYImzLB1hufqo4m+RyM5N3mLx5BqJKccgxJS+W3kqw== +url-loader@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/url-loader/-/url-loader-4.1.1.tgz#28505e905cae158cf07c92ca622d7f237e70a4e2" + integrity sha512-3BTV812+AVHHOJQO8O5MkWgZ5aosP7GnROJwvzLS9hWDj00lZ6Z0wNak423Lp9PBZN05N+Jk/N5Si8jRAlGyWA== dependencies: loader-utils "^2.0.0" - mime-types "^2.1.26" - schema-utils "^2.6.5" + mime-types "^2.1.27" + schema-utils "^3.0.0" url-parse-lax@^3.0.0: version "3.0.0" @@ -28643,6 +28460,11 @@ utils-merge@1.0.1: resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= +uuid-browser@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/uuid-browser/-/uuid-browser-3.1.0.tgz#0f05a40aef74f9e5951e20efbf44b11871e56410" + integrity sha1-DwWkCu90+eWVHiDvv0SxGHHlZBA= + uuid@3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" @@ -28663,12 +28485,7 @@ uuid@^7.0.3: resolved "https://registry.yarnpkg.com/uuid/-/uuid-7.0.3.tgz#c5c9f2c8cf25dc0a372c4df1441c41f5bd0c680b" integrity sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg== -uuid@^8.0.0, uuid@^8.3.0: - version "8.3.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.0.tgz#ab738085ca22dc9a8c92725e459b1d507df5d6ea" - integrity sha512-fX6Z5o4m6XsXBdli9g7DtWgAx+osMsRRZFKma1mIUsLCz6vRvv+pz5VNbyu9UEDzpMWulZfvpgb/cmDXVulYFQ== - -uuid@^8.3.2: +uuid@^8.3.0, uuid@^8.3.2: version "8.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== @@ -29383,10 +29200,10 @@ webpack-cli@^3.3.12: v8-compile-cache "^2.1.1" yargs "^13.3.2" -webpack-dev-middleware@^3.7.0, webpack-dev-middleware@^3.7.2: - version "3.7.2" - resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-3.7.2.tgz#0019c3db716e3fa5cecbf64f2ab88a74bab331f3" - integrity sha512-1xC42LxbYoqLNAhV6YzTYacicgMZQTqRd27Sim9wn5hJrX3I5nxYy1SxSd4+gjUFsz1dQFj+yEe6zEVmSkeJjw== +webpack-dev-middleware@^3.7.2, webpack-dev-middleware@^3.7.3: + version "3.7.3" + resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-3.7.3.tgz#0639372b143262e2b84ab95d3b91a7597061c2c5" + integrity sha512-djelc/zGiz9nZj/U7PTBi2ViorGJXEWo/3ltkPbDyxCXhhEXkW0ce99falaok4TPj+AsxLiXJR0EBOb0zh9fKQ== dependencies: memory-fs "^0.4.1" mime "^2.4.4" @@ -29478,7 +29295,7 @@ webpack-virtual-modules@^0.2.2: dependencies: debug "^3.0.0" -webpack@^4.41.5, webpack@^4.44.2: +webpack@4, webpack@^4.41.5: version "4.46.0" resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.46.0.tgz#bf9b4404ea20a073605e0a011d188d77cb6ad542" integrity sha512-6jJuJjg8znb/xRItk7bkT0+Q7AHCYjjFnvKIWQPkNIOyRqoCGvkOs0ipeQzrqz4l5FtN5ZI/ukEHroeX/o1/5Q== @@ -30152,6 +29969,11 @@ yn@3.1.1: resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + z-schema@~3.18.3: version "3.18.4" resolved "https://registry.yarnpkg.com/z-schema/-/z-schema-3.18.4.tgz#ea8132b279533ee60be2485a02f7e3e42541a9a2"