diff --git a/.buildkite/pipeline-utils/test-failures/annotate.ts b/.buildkite/pipeline-utils/test-failures/annotate.ts index 8ac896c99434b..8397fa670af66 100644 --- a/.buildkite/pipeline-utils/test-failures/annotate.ts +++ b/.buildkite/pipeline-utils/test-failures/annotate.ts @@ -150,7 +150,7 @@ export const annotateTestFailures = async () => { } exec( - `buildkite-agent artifact download --include-retried-jobs "target/test_failures/*.json" "${failureDir}"` + `.buildkite/scripts/common/download_artifact.sh --include-retried-jobs "target/test_failures/*.json" "${failureDir}"` ); const failures: TestFailure[] = recursiveReadDir(failureDir) diff --git a/.buildkite/scripts/common/download_artifact.sh b/.buildkite/scripts/common/download_artifact.sh new file mode 100755 index 0000000000000..09f2d9e978a96 --- /dev/null +++ b/.buildkite/scripts/common/download_artifact.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +set -euo pipefail + +source "$(dirname "$0")/util.sh" +download_artifact "$@" diff --git a/.buildkite/scripts/common/util.sh b/.buildkite/scripts/common/util.sh index b25ba2c46213f..1ce05856ec6b7 100755 --- a/.buildkite/scripts/common/util.sh +++ b/.buildkite/scripts/common/util.sh @@ -168,3 +168,9 @@ npm_install_global() { npm install -g "$toInstall" && touch "$successFlag" fi } + +# Download an artifact using the buildkite-agent, takes the same arguments as https://buildkite.com/docs/agent/v3/cli-artifact#downloading-artifacts-usage +# times-out after 60 seconds and retries up to 3 times +download_artifact() { + retry 3 1 timeout 3m buildkite-agent artifact download "$@" +} diff --git a/.buildkite/scripts/download_build_artifacts.sh b/.buildkite/scripts/download_build_artifacts.sh index 1e7525fff25ea..dd0ae660543a8 100755 --- a/.buildkite/scripts/download_build_artifacts.sh +++ b/.buildkite/scripts/download_build_artifacts.sh @@ -2,13 +2,15 @@ set -euo pipefail +source "$(dirname "$0")/common/util.sh" + if [[ ! -d "$KIBANA_BUILD_LOCATION/bin" ]]; then echo '--- Downloading Distribution and Plugin artifacts' cd "$WORKSPACE" - buildkite-agent artifact download kibana-default.tar.gz . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" - buildkite-agent artifact download kibana-default-plugins.tar.gz . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" + download_artifact kibana-default.tar.gz . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" + download_artifact kibana-default-plugins.tar.gz . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" mkdir -p "$KIBANA_BUILD_LOCATION" tar -xzf kibana-default.tar.gz -C "$KIBANA_BUILD_LOCATION" --strip=1 diff --git a/.buildkite/scripts/steps/artifacts/cloud.sh b/.buildkite/scripts/steps/artifacts/cloud.sh index d2d5785093f1e..5bf2285ab162a 100644 --- a/.buildkite/scripts/steps/artifacts/cloud.sh +++ b/.buildkite/scripts/steps/artifacts/cloud.sh @@ -4,12 +4,13 @@ set -euo pipefail .buildkite/scripts/bootstrap.sh +source "$(dirname "$0")/../../common/util.sh" source .buildkite/scripts/steps/artifacts/env.sh echo "--- Build and publish Cloud image" mkdir -p target -buildkite-agent artifact download "kibana-$FULL_VERSION-linux-x86_64.tar.gz" ./target --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" +download_artifact "kibana-$FULL_VERSION-linux-x86_64.tar.gz" ./target --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" node scripts/build \ --skip-initialize \ diff --git a/.buildkite/scripts/steps/artifacts/docker_context.sh b/.buildkite/scripts/steps/artifacts/docker_context.sh index 86c4361173a08..c50fb3e0524fd 100755 --- a/.buildkite/scripts/steps/artifacts/docker_context.sh +++ b/.buildkite/scripts/steps/artifacts/docker_context.sh @@ -4,6 +4,7 @@ set -euo pipefail .buildkite/scripts/bootstrap.sh +source "$(dirname "$0")/../../common/util.sh" source .buildkite/scripts/steps/artifacts/env.sh KIBANA_DOCKER_CONTEXT="${KIBANA_DOCKER_CONTEXT:="default"}" @@ -28,7 +29,7 @@ fi tar -xf "target/$DOCKER_CONTEXT_FILE" -C "$DOCKER_BUILD_FOLDER" cd $DOCKER_BUILD_FOLDER -buildkite-agent artifact download "kibana-$FULL_VERSION-linux-x86_64.tar.gz" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" +download_artifact "kibana-$FULL_VERSION-linux-x86_64.tar.gz" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" echo "--- Build context" docker build . diff --git a/.buildkite/scripts/steps/artifacts/publish.sh b/.buildkite/scripts/steps/artifacts/publish.sh index ed4cb5ca1d4b9..1caee4a0eb025 100644 --- a/.buildkite/scripts/steps/artifacts/publish.sh +++ b/.buildkite/scripts/steps/artifacts/publish.sh @@ -7,8 +7,8 @@ source .buildkite/scripts/steps/artifacts/env.sh echo "--- Download and verify artifacts" function download { - buildkite-agent artifact download "$1" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" - buildkite-agent artifact download "$1.sha512.txt" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" + download_artifact "$1" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" + download_artifact "$1.sha512.txt" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" sha512sum -c "$1.sha512.txt" rm "$1.sha512.txt" } @@ -40,7 +40,7 @@ download "kibana-$FULL_VERSION-windows-x86_64.zip" download "dependencies-$FULL_VERSION.csv" -cd - +cd - echo "--- Set artifact permissions" chmod -R a+r target/* diff --git a/.buildkite/scripts/steps/cloud/build_and_deploy.sh b/.buildkite/scripts/steps/cloud/build_and_deploy.sh index 05427de058225..6488eca2c9cd8 100755 --- a/.buildkite/scripts/steps/cloud/build_and_deploy.sh +++ b/.buildkite/scripts/steps/cloud/build_and_deploy.sh @@ -14,7 +14,7 @@ ECCTL_LOGS=$(mktemp --suffix ".json") echo "--- Download Kibana Distribution" mkdir -p ./target -buildkite-agent artifact download "kibana-$VERSION-linux-x86_64.tar.gz" ./target --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" +download_artifact "kibana-$VERSION-linux-x86_64.tar.gz" ./target --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" echo "--- Build Cloud Distribution" ELASTICSEARCH_MANIFEST_URL="https://storage.googleapis.com/kibana-ci-es-snapshots-daily/$(jq -r '.version' package.json)/manifest-latest-verified.json" diff --git a/.buildkite/scripts/steps/code_coverage/ftr_configs.sh b/.buildkite/scripts/steps/code_coverage/ftr_configs.sh index 1a5eafd2e901f..8aa619651e71e 100755 --- a/.buildkite/scripts/steps/code_coverage/ftr_configs.sh +++ b/.buildkite/scripts/steps/code_coverage/ftr_configs.sh @@ -28,7 +28,7 @@ configs="${FTR_CONFIG:-}" if [[ "$configs" == "" ]]; then echo "--- Downloading ftr test run order" - buildkite-agent artifact download ftr_run_order.json . + download_artifact ftr_run_order.json . configs=$(jq -r '.[env.FTR_CONFIG_GROUP_KEY].names[]' ftr_run_order.json) fi diff --git a/.buildkite/scripts/steps/code_coverage/ingest.sh b/.buildkite/scripts/steps/code_coverage/ingest.sh index 6632009346481..31a24981ce200 100755 --- a/.buildkite/scripts/steps/code_coverage/ingest.sh +++ b/.buildkite/scripts/steps/code_coverage/ingest.sh @@ -29,7 +29,7 @@ revolveBuildHashes() { } collectRan() { - buildkite-agent artifact download target/ran_files/* . + download_artifact target/ran_files/* . while read -r x; do ran=("${ran[@]}" "$(cat "$x")") @@ -51,7 +51,7 @@ fetchArtifacts() { local xs=("$@") for x in "${xs[@]}"; do - buildkite-agent artifact download "target/kibana-coverage/${x}/*" . + download_artifact "target/kibana-coverage/${x}/*" . done } diff --git a/.buildkite/scripts/steps/code_coverage/jest_parallel.sh b/.buildkite/scripts/steps/code_coverage/jest_parallel.sh index fd8ea61f2d220..ec2095b88963c 100755 --- a/.buildkite/scripts/steps/code_coverage/jest_parallel.sh +++ b/.buildkite/scripts/steps/code_coverage/jest_parallel.sh @@ -2,6 +2,7 @@ set -euo pipefail +source "$(dirname "$0")/../../common/util.sh" source .buildkite/scripts/steps/code_coverage/util.sh export JOB=$BUILDKITE_PARALLEL_JOB @@ -18,7 +19,7 @@ fi export TEST_TYPE echo "--- downloading jest test run order" -buildkite-agent artifact download jest_run_order.json . +download_artifact jest_run_order.json . configs=$(jq -r 'getpath([env.TEST_TYPE]) | .groups[env.JOB | tonumber].names | .[]' jest_run_order.json) echo "--- KIBANA_DIR: $KIBANA_DIR" diff --git a/.buildkite/scripts/steps/functional/scalability_dataset_extraction.sh b/.buildkite/scripts/steps/functional/scalability_dataset_extraction.sh index cb17393f5f423..86d067174ba8b 100755 --- a/.buildkite/scripts/steps/functional/scalability_dataset_extraction.sh +++ b/.buildkite/scripts/steps/functional/scalability_dataset_extraction.sh @@ -34,8 +34,8 @@ mkdir "${BUILD_ID}" tar -czf "${BUILD_ID}/scalability_traces.tar.gz" -C target scalability_traces buildkite-agent artifact upload "${BUILD_ID}/scalability_traces.tar.gz" # Upload Kibana build, plugins, commit sha and traces to the bucket -buildkite-agent artifact download kibana-default.tar.gz ./"${BUILD_ID}" -buildkite-agent artifact download kibana-default-plugins.tar.gz ./"${BUILD_ID}" +download_artifact kibana-default.tar.gz ./"${BUILD_ID}" +download_artifact kibana-default-plugins.tar.gz ./"${BUILD_ID}" echo "${BUILDKITE_COMMIT}" > "${BUILD_ID}/KIBANA_COMMIT_HASH" gsutil -m cp -r "${BUILD_ID}" "${GCS_BUCKET}" echo "--- Update reference to the latest CI build" diff --git a/.buildkite/scripts/steps/package_testing/test.sh b/.buildkite/scripts/steps/package_testing/test.sh index 5831f0d938b26..4a2b8a52525d6 100755 --- a/.buildkite/scripts/steps/package_testing/test.sh +++ b/.buildkite/scripts/steps/package_testing/test.sh @@ -2,6 +2,7 @@ set -euo pipefail +source "$(dirname "$0")/../../common/util.sh" .buildkite/scripts/bootstrap.sh echo "--- Package Testing for $TEST_PACKAGE" @@ -9,13 +10,13 @@ echo "--- Package Testing for $TEST_PACKAGE" mkdir -p target cd target if [[ "$TEST_PACKAGE" == "deb" ]]; then - buildkite-agent artifact download 'kibana-*-amd64.deb' . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" + download_artifact 'kibana-*-amd64.deb' . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" KIBANA_IP_ADDRESS="192.168.56.5" elif [[ "$TEST_PACKAGE" == "rpm" ]]; then - buildkite-agent artifact download 'kibana-*-x86_64.rpm' . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" + download_artifact 'kibana-*-x86_64.rpm' . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" KIBANA_IP_ADDRESS="192.168.56.6" elif [[ "$TEST_PACKAGE" == "docker" ]]; then - buildkite-agent artifact download "kibana-$KIBANA_PKG_VERSION*-docker-image.tar.gz" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" + download_artifact "kibana-$KIBANA_PKG_VERSION*-docker-image.tar.gz" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" KIBANA_IP_ADDRESS="192.168.56.7" fi cd .. diff --git a/.buildkite/scripts/steps/test/ftr_configs.sh b/.buildkite/scripts/steps/test/ftr_configs.sh index 52450b30f995c..fca1f78469256 100755 --- a/.buildkite/scripts/steps/test/ftr_configs.sh +++ b/.buildkite/scripts/steps/test/ftr_configs.sh @@ -32,7 +32,7 @@ fi if [ "$configs" == "" ] && [ "$FTR_CONFIG_GROUP_KEY" != "" ]; then echo "--- downloading ftr test run order" - buildkite-agent artifact download ftr_run_order.json . + download_artifact ftr_run_order.json . configs=$(jq -r '.[env.FTR_CONFIG_GROUP_KEY].names[]' ftr_run_order.json) fi diff --git a/.buildkite/scripts/steps/test/jest_parallel.sh b/.buildkite/scripts/steps/test/jest_parallel.sh index 8ca025a3e6516..2c4474abe0b05 100755 --- a/.buildkite/scripts/steps/test/jest_parallel.sh +++ b/.buildkite/scripts/steps/test/jest_parallel.sh @@ -2,6 +2,7 @@ set -euo pipefail +source "$(dirname "$0")/../../common/util.sh" export JOB=${BUILDKITE_PARALLEL_JOB:-0} # a jest failure will result in the script returning an exit code of 10 @@ -20,7 +21,7 @@ fi export TEST_TYPE echo "--- downloading jest test run order" -buildkite-agent artifact download jest_run_order.json . +download_artifact jest_run_order.json . configs=$(jq -r 'getpath([env.TEST_TYPE]) | .groups[env.JOB | tonumber].names | .[]' jest_run_order.json) while read -r config; do diff --git a/.eslintrc.js b/.eslintrc.js index eb3488aa5caff..caa408887c499 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -72,7 +72,7 @@ const ELASTIC_LICENSE_HEADER = ` const SAFER_LODASH_SET_HEADER = ` /* * Elasticsearch B.V licenses this file to you under the MIT License. - * See \`packages/elastic-safer-lodash-set/LICENSE\` for more information. + * See \`packages/kbn-safer-lodash-set/LICENSE\` for more information. */ `; @@ -81,7 +81,7 @@ const SAFER_LODASH_SET_LODASH_HEADER = ` * This file is forked from the lodash project (https://lodash.com/), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See \`packages/elastic-safer-lodash-set/LICENSE\` for more information. + * See \`packages/kbn-safer-lodash-set/LICENSE\` for more information. */ `; @@ -90,7 +90,7 @@ const SAFER_LODASH_SET_DEFINITELYTYPED_HEADER = ` * This file is forked from the DefinitelyTyped project (https://github.com/DefinitelyTyped/DefinitelyTyped), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See \`packages/elastic-safer-lodash-set/LICENSE\` for more information. + * See \`packages/kbn-safer-lodash-set/LICENSE\` for more information. */ `; @@ -186,44 +186,44 @@ const RESTRICTED_IMPORTS = [ { name: 'lodash', importNames: ['set', 'setWith'], - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { name: 'lodash.set', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { name: 'lodash.setwith', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { name: 'lodash/set', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { name: 'lodash/setWith', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { name: 'lodash/fp', importNames: ['set', 'setWith', 'assoc', 'assocPath'], - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { name: 'lodash/fp/set', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { name: 'lodash/fp/setWith', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { name: 'lodash/fp/assoc', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { name: 'lodash/fp/assocPath', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { name: 'lodash', @@ -409,7 +409,7 @@ module.exports = { * safer-lodash-set package requires special license headers */ { - files: ['packages/elastic-safer-lodash-set/**/*.{js,mjs,ts,tsx}'], + files: ['packages/kbn-safer-lodash-set/**/*.{js,mjs,ts,tsx}'], rules: { '@kbn/eslint/require-license-header': [ 'error', @@ -438,7 +438,7 @@ module.exports = { }, { - files: ['packages/elastic-safer-lodash-set/test/*.{js,mjs,ts,tsx}'], + files: ['packages/kbn-safer-lodash-set/test/*.{js,mjs,ts,tsx}'], rules: { '@kbn/eslint/require-license-header': [ 'error', @@ -466,7 +466,7 @@ module.exports = { }, }, { - files: ['packages/elastic-safer-lodash-set/**/*.d.ts'], + files: ['packages/kbn-safer-lodash-set/**/*.d.ts'], rules: { '@kbn/eslint/require-license-header': [ 'error', @@ -734,7 +734,7 @@ module.exports = { * Harden specific rules */ { - files: ['test/harden/*.js', 'packages/elastic-safer-lodash-set/test/*.js'], + files: ['test/harden/*.js', 'packages/kbn-safer-lodash-set/test/*.js'], rules: { 'mocha/handle-done-callback': 'off', }, @@ -754,11 +754,11 @@ module.exports = { paths: [ { name: 'lodash.set', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { name: 'lodash.setwith', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { name: 'lodash.template', @@ -767,11 +767,11 @@ module.exports = { }, { name: 'lodash/set', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { name: 'lodash/setWith', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { name: 'lodash/template', @@ -786,12 +786,12 @@ module.exports = { { object: 'lodash', property: 'set', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { object: '_', property: 'set', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { object: 'lodash', @@ -808,32 +808,32 @@ module.exports = { { object: 'lodash', property: 'setWith', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { object: '_', property: 'setWith', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { object: 'lodash', property: 'assoc', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { object: '_', property: 'assoc', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { object: 'lodash', property: 'assocPath', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, { object: '_', property: 'assocPath', - message: 'Please use @elastic/safer-lodash-set instead', + message: 'Please use @kbn/safer-lodash-set instead', }, ], }, diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 09484706c05e0..d1080cea722e2 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -136,7 +136,7 @@ x-pack/plugins/files @elastic/kibana-app-services /src/apm.js @elastic/kibana-core @vigneshshanmugam /packages/kbn-apm-config-loader/ @elastic/kibana-core @vigneshshanmugam /src/core/types/elasticsearch @elastic/apm-ui -/packages/elastic-apm-synthtrace/ @elastic/apm-ui +/packages/kbn-apm-synthtrace/ @elastic/apm-ui /packages/kbn-shared-svg @elastic/apm-ui #CC# /src/plugins/apm_oss/ @elastic/apm-ui #CC# /x-pack/plugins/observability/ @elastic/apm-ui @@ -597,10 +597,10 @@ x-pack/plugins/security_solution/cypress/README.md @elastic/security-engineering x-pack/test/security_solution_cypress @elastic/security-engineering-productivity ## Security Solution sub teams - adaptive-workload-protection -x-pack/plugins/kubernetes_security @elastic/awp-platform -x-pack/plugins/session_view @elastic/awp-platform -x-pack/plugins/security_solution/public/common/components/sessions_viewer @elastic/awp-platform -x-pack/plugins/security_solution/public/kubernetes @elastic/awp-platform +x-pack/plugins/kubernetes_security @elastic/awp-viz +x-pack/plugins/session_view @elastic/awp-viz +x-pack/plugins/security_solution/public/common/components/sessions_viewer @elastic/awp-viz +x-pack/plugins/security_solution/public/kubernetes @elastic/awp-viz ## Security Solution sub teams - Protections Experience x-pack/plugins/threat_intelligence @elastic/protections-experience @@ -618,6 +618,7 @@ x-pack/test/threat_intelligence_cypress @elastic/protections-experience # Cloud Security Posture /x-pack/plugins/cloud_security_posture/ @elastic/kibana-cloud-security-posture /x-pack/plugins/security_solution/public/cloud_security_posture @elastic/kibana-cloud-security-posture +/x-pack/test/api_integration/apis/cloud_security_posture/ @elastic/kibana-cloud-security-posture # Security Solution onboarding tour /x-pack/plugins/security_solution/public/common/components/guided_onboarding @elastic/platform-onboarding @@ -669,7 +670,6 @@ x-pack/test/threat_intelligence_cypress @elastic/protections-experience # Application Experience ## Shared UX Team -/src/plugins/shared_ux/ @elastic/shared-ux /packages/shared-ux/ @elastic/shared-ux /packages/shared-ux-*/ @elastic/shared-ux diff --git a/.i18nrc.json b/.i18nrc.json index cee83a60c1fd2..28986568d5bf3 100644 --- a/.i18nrc.json +++ b/.i18nrc.json @@ -67,8 +67,6 @@ "savedObjectsManagement": "src/plugins/saved_objects_management", "server": "src/legacy/server", "share": "src/plugins/share", - "sharedUX": "src/plugins/shared_ux", - "sharedUXComponents": "packages/kbn-shared-ux-components/src", "sharedUXPackages": "packages/shared-ux", "coloring": "packages/kbn-coloring/src", "statusPage": "src/legacy/core_plugins/status_page", diff --git a/api_docs/actions.mdx b/api_docs/actions.mdx index 91d5459d66c06..fb370fac704c4 100644 --- a/api_docs/actions.mdx +++ b/api_docs/actions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/actions title: "actions" image: https://source.unsplash.com/400x175/?github description: API docs for the actions plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'actions'] --- import actionsObj from './actions.devdocs.json'; diff --git a/api_docs/advanced_settings.mdx b/api_docs/advanced_settings.mdx index eab29bf01da57..c681b05886b0c 100644 --- a/api_docs/advanced_settings.mdx +++ b/api_docs/advanced_settings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/advancedSettings title: "advancedSettings" image: https://source.unsplash.com/400x175/?github description: API docs for the advancedSettings plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'advancedSettings'] --- import advancedSettingsObj from './advanced_settings.devdocs.json'; diff --git a/api_docs/aiops.mdx b/api_docs/aiops.mdx index 56197bdc37640..bcec7684a470d 100644 --- a/api_docs/aiops.mdx +++ b/api_docs/aiops.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/aiops title: "aiops" image: https://source.unsplash.com/400x175/?github description: API docs for the aiops plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'aiops'] --- import aiopsObj from './aiops.devdocs.json'; diff --git a/api_docs/alerting.mdx b/api_docs/alerting.mdx index 395e0c140beba..815b17bb70560 100644 --- a/api_docs/alerting.mdx +++ b/api_docs/alerting.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/alerting title: "alerting" image: https://source.unsplash.com/400x175/?github description: API docs for the alerting plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'alerting'] --- import alertingObj from './alerting.devdocs.json'; diff --git a/api_docs/apm.mdx b/api_docs/apm.mdx index 9b8b97f4e1acd..448a918e81d3c 100644 --- a/api_docs/apm.mdx +++ b/api_docs/apm.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/apm title: "apm" image: https://source.unsplash.com/400x175/?github description: API docs for the apm plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'apm'] --- import apmObj from './apm.devdocs.json'; diff --git a/api_docs/banners.mdx b/api_docs/banners.mdx index c0c2246c4eb76..c35d69909e4fb 100644 --- a/api_docs/banners.mdx +++ b/api_docs/banners.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/banners title: "banners" image: https://source.unsplash.com/400x175/?github description: API docs for the banners plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'banners'] --- import bannersObj from './banners.devdocs.json'; diff --git a/api_docs/bfetch.mdx b/api_docs/bfetch.mdx index dd05defadd370..0e4d1ce76d72b 100644 --- a/api_docs/bfetch.mdx +++ b/api_docs/bfetch.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/bfetch title: "bfetch" image: https://source.unsplash.com/400x175/?github description: API docs for the bfetch plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'bfetch'] --- import bfetchObj from './bfetch.devdocs.json'; diff --git a/api_docs/canvas.mdx b/api_docs/canvas.mdx index 84d0ab053f01a..936a16e38a6d3 100644 --- a/api_docs/canvas.mdx +++ b/api_docs/canvas.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/canvas title: "canvas" image: https://source.unsplash.com/400x175/?github description: API docs for the canvas plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'canvas'] --- import canvasObj from './canvas.devdocs.json'; diff --git a/api_docs/cases.mdx b/api_docs/cases.mdx index 8c8fc918c9b18..cf2fb0c0e5c1b 100644 --- a/api_docs/cases.mdx +++ b/api_docs/cases.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cases title: "cases" image: https://source.unsplash.com/400x175/?github description: API docs for the cases plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cases'] --- import casesObj from './cases.devdocs.json'; diff --git a/api_docs/charts.devdocs.json b/api_docs/charts.devdocs.json index 96a9ad926a858..6658d572dadd5 100644 --- a/api_docs/charts.devdocs.json +++ b/api_docs/charts.devdocs.json @@ -280,279 +280,6 @@ "returnComment": [], "initialIsOpen": false }, - { - "parentPluginId": "charts", - "id": "def-public.getBrushFromChartBrushEventFn", - "type": "Function", - "tags": [], - "label": "getBrushFromChartBrushEventFn", - "description": [ - "\nHelper function to transform `@elastic/charts` brush event into brush action event" - ], - "signature": [ - "(table: ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.Datatable", - "text": "Datatable" - }, - ", xAccessor: ", - "Accessor", - " | ", - "AccessorFn", - ") => ({ x: selectedRange }: ", - "XYBrushEvent", - ") => ", - { - "pluginId": "charts", - "scope": "public", - "docId": "kibChartsPluginApi", - "section": "def-public.BrushTriggerEvent", - "text": "BrushTriggerEvent" - } - ], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "charts", - "id": "def-public.getBrushFromChartBrushEventFn.$1", - "type": "Object", - "tags": [], - "label": "table", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.Datatable", - "text": "Datatable" - } - ], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "charts", - "id": "def-public.getBrushFromChartBrushEventFn.$2", - "type": "CompoundType", - "tags": [], - "label": "xAccessor", - "description": [], - "signature": [ - "Accessor", - " | ", - "AccessorFn", - "" - ], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "charts", - "id": "def-public.getFilterFromChartClickEventFn", - "type": "Function", - "tags": [], - "label": "getFilterFromChartClickEventFn", - "description": [ - "\nHelper function to transform `@elastic/charts` click event into filter action event\n" - ], - "signature": [ - "(table: ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.Datatable", - "text": "Datatable" - }, - ", xAccessor: ", - "Accessor", - " | ", - "AccessorFn", - ", splitSeriesAccessorFnMap?: Map> | undefined, splitChartAccessor?: ", - "Accessor", - " | ", - "AccessorFn", - " | undefined, negate?: boolean) => (points: [", - "GeometryValue", - ", ", - "XYChartSeriesIdentifier", - "][]) => ", - { - "pluginId": "charts", - "scope": "public", - "docId": "kibChartsPluginApi", - "section": "def-public.ClickTriggerEvent", - "text": "ClickTriggerEvent" - } - ], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "charts", - "id": "def-public.getFilterFromChartClickEventFn.$1", - "type": "Object", - "tags": [], - "label": "table", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.Datatable", - "text": "Datatable" - } - ], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "charts", - "id": "def-public.getFilterFromChartClickEventFn.$2", - "type": "CompoundType", - "tags": [], - "label": "xAccessor", - "description": [], - "signature": [ - "Accessor", - " | ", - "AccessorFn", - "" - ], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "charts", - "id": "def-public.getFilterFromChartClickEventFn.$3", - "type": "Object", - "tags": [], - "label": "splitSeriesAccessorFnMap", - "description": [ - "needed when using `splitSeriesAccessors` as `AccessorFn`" - ], - "signature": [ - "Map> | undefined" - ], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", - "deprecated": false, - "isRequired": false - }, - { - "parentPluginId": "charts", - "id": "def-public.getFilterFromChartClickEventFn.$4", - "type": "CompoundType", - "tags": [], - "label": "splitChartAccessor", - "description": [], - "signature": [ - "Accessor", - " | ", - "AccessorFn", - " | undefined" - ], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", - "deprecated": false, - "isRequired": false - }, - { - "parentPluginId": "charts", - "id": "def-public.getFilterFromChartClickEventFn.$5", - "type": "boolean", - "tags": [], - "label": "negate", - "description": [], - "signature": [ - "boolean" - ], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "charts", - "id": "def-public.getFilterFromSeriesFn", - "type": "Function", - "tags": [], - "label": "getFilterFromSeriesFn", - "description": [ - "\nHelper function to get filter action event from series" - ], - "signature": [ - "(table: ", - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.Datatable", - "text": "Datatable" - }, - ") => ({ splitAccessors, ...rest }: ", - "XYChartSeriesIdentifier", - ", splitSeriesAccessorFnMap?: Map> | undefined, splitChartAccessor?: ", - "Accessor", - " | ", - "AccessorFn", - " | undefined, negate?: boolean) => ", - { - "pluginId": "charts", - "scope": "public", - "docId": "kibChartsPluginApi", - "section": "def-public.ClickTriggerEvent", - "text": "ClickTriggerEvent" - } - ], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "charts", - "id": "def-public.getFilterFromSeriesFn.$1", - "type": "Object", - "tags": [], - "label": "table", - "description": [], - "signature": [ - { - "pluginId": "expressions", - "scope": "common", - "docId": "kibExpressionsPluginApi", - "section": "def-common.Datatable", - "text": "Datatable" - } - ], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, { "parentPluginId": "charts", "id": "def-public.getHeatmapColors", @@ -914,7 +641,7 @@ "tags": [], "label": "BrushTriggerEvent", "description": [], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", + "path": "src/plugins/charts/public/index.ts", "deprecated": false, "children": [ { @@ -927,7 +654,7 @@ "signature": [ "\"brush\"" ], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", + "path": "src/plugins/charts/public/index.ts", "deprecated": false }, { @@ -948,7 +675,7 @@ }, "; column: number; range: number[]; timeFieldName?: string | undefined; }" ], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", + "path": "src/plugins/charts/public/index.ts", "deprecated": false } ], @@ -961,7 +688,7 @@ "tags": [], "label": "ClickTriggerEvent", "description": [], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", + "path": "src/plugins/charts/public/index.ts", "deprecated": false, "children": [ { @@ -974,7 +701,7 @@ "signature": [ "\"filter\"" ], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", + "path": "src/plugins/charts/public/index.ts", "deprecated": false }, { @@ -995,7 +722,7 @@ }, ", \"rows\" | \"columns\">; column: number; row: number; value: any; }[]; timeFieldName?: string | undefined; negate?: boolean | undefined; }" ], - "path": "src/plugins/charts/public/static/utils/transform_click_event.ts", + "path": "src/plugins/charts/public/index.ts", "deprecated": false } ], diff --git a/api_docs/charts.mdx b/api_docs/charts.mdx index 879d3fd2ce32a..7f4b3027a61c8 100644 --- a/api_docs/charts.mdx +++ b/api_docs/charts.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/charts title: "charts" image: https://source.unsplash.com/400x175/?github description: API docs for the charts plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'charts'] --- import chartsObj from './charts.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 272 | 2 | 253 | 9 | +| 261 | 2 | 246 | 9 | ## Client diff --git a/api_docs/cloud.mdx b/api_docs/cloud.mdx index b19cbe910b3f7..030f78d1063cb 100644 --- a/api_docs/cloud.mdx +++ b/api_docs/cloud.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloud title: "cloud" image: https://source.unsplash.com/400x175/?github description: API docs for the cloud plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloud'] --- import cloudObj from './cloud.devdocs.json'; diff --git a/api_docs/cloud_security_posture.mdx b/api_docs/cloud_security_posture.mdx index 6d2856179de5c..d833bb0e50cfc 100644 --- a/api_docs/cloud_security_posture.mdx +++ b/api_docs/cloud_security_posture.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudSecurityPosture title: "cloudSecurityPosture" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudSecurityPosture plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudSecurityPosture'] --- import cloudSecurityPostureObj from './cloud_security_posture.devdocs.json'; diff --git a/api_docs/console.mdx b/api_docs/console.mdx index 37339139f936f..ffaacdcb0eb4f 100644 --- a/api_docs/console.mdx +++ b/api_docs/console.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/console title: "console" image: https://source.unsplash.com/400x175/?github description: API docs for the console plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'console'] --- import consoleObj from './console.devdocs.json'; diff --git a/api_docs/controls.mdx b/api_docs/controls.mdx index 97c69c1387e57..e9526ae69f446 100644 --- a/api_docs/controls.mdx +++ b/api_docs/controls.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/controls title: "controls" image: https://source.unsplash.com/400x175/?github description: API docs for the controls plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'controls'] --- import controlsObj from './controls.devdocs.json'; diff --git a/api_docs/core.mdx b/api_docs/core.mdx index 031ce073990c9..c263ced17e2e2 100644 --- a/api_docs/core.mdx +++ b/api_docs/core.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/core title: "core" image: https://source.unsplash.com/400x175/?github description: API docs for the core plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'core'] --- import coreObj from './core.devdocs.json'; diff --git a/api_docs/core_application.mdx b/api_docs/core_application.mdx index a36996fbf1b26..0f737a23baba3 100644 --- a/api_docs/core_application.mdx +++ b/api_docs/core_application.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/core-application title: "core.application" image: https://source.unsplash.com/400x175/?github description: API docs for the core.application plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'core.application'] --- import coreApplicationObj from './core_application.devdocs.json'; diff --git a/api_docs/core_chrome.mdx b/api_docs/core_chrome.mdx index e8d295e6cf83a..3b4972563bed1 100644 --- a/api_docs/core_chrome.mdx +++ b/api_docs/core_chrome.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/core-chrome title: "core.chrome" image: https://source.unsplash.com/400x175/?github description: API docs for the core.chrome plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'core.chrome'] --- import coreChromeObj from './core_chrome.devdocs.json'; diff --git a/api_docs/core_saved_objects.mdx b/api_docs/core_saved_objects.mdx index f17193f0d4c23..9a8e01136ac2b 100644 --- a/api_docs/core_saved_objects.mdx +++ b/api_docs/core_saved_objects.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/core-savedObjects title: "core.savedObjects" image: https://source.unsplash.com/400x175/?github description: API docs for the core.savedObjects plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'core.savedObjects'] --- import coreSavedObjectsObj from './core_saved_objects.devdocs.json'; diff --git a/api_docs/custom_integrations.mdx b/api_docs/custom_integrations.mdx index e286dd8c873b1..133041b0baec6 100644 --- a/api_docs/custom_integrations.mdx +++ b/api_docs/custom_integrations.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/customIntegrations title: "customIntegrations" image: https://source.unsplash.com/400x175/?github description: API docs for the customIntegrations plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'customIntegrations'] --- import customIntegrationsObj from './custom_integrations.devdocs.json'; diff --git a/api_docs/dashboard.mdx b/api_docs/dashboard.mdx index fcfebd40433be..3796d5be1fdd8 100644 --- a/api_docs/dashboard.mdx +++ b/api_docs/dashboard.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dashboard title: "dashboard" image: https://source.unsplash.com/400x175/?github description: API docs for the dashboard plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dashboard'] --- import dashboardObj from './dashboard.devdocs.json'; diff --git a/api_docs/dashboard_enhanced.mdx b/api_docs/dashboard_enhanced.mdx index 1f2c997f417a4..e3603336d6f06 100644 --- a/api_docs/dashboard_enhanced.mdx +++ b/api_docs/dashboard_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dashboardEnhanced title: "dashboardEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the dashboardEnhanced plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dashboardEnhanced'] --- import dashboardEnhancedObj from './dashboard_enhanced.devdocs.json'; diff --git a/api_docs/data.mdx b/api_docs/data.mdx index 24ce86ff562cc..b432b21937d84 100644 --- a/api_docs/data.mdx +++ b/api_docs/data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/data title: "data" image: https://source.unsplash.com/400x175/?github description: API docs for the data plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data'] --- import dataObj from './data.devdocs.json'; diff --git a/api_docs/data_query.mdx b/api_docs/data_query.mdx index a37df6f5d0325..d452015312014 100644 --- a/api_docs/data_query.mdx +++ b/api_docs/data_query.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/data-query title: "data.query" image: https://source.unsplash.com/400x175/?github description: API docs for the data.query plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data.query'] --- import dataQueryObj from './data_query.devdocs.json'; diff --git a/api_docs/data_search.devdocs.json b/api_docs/data_search.devdocs.json index e767c6ed77ed2..73d0c6793eac8 100644 --- a/api_docs/data_search.devdocs.json +++ b/api_docs/data_search.devdocs.json @@ -28641,7 +28641,7 @@ "label": "GeoPoint", "description": [], "signature": [ - "string | [number, number] | Point" + "string | Point | [number, number]" ], "path": "src/plugins/data/common/search/expressions/geo_point.ts", "deprecated": false, diff --git a/api_docs/data_search.mdx b/api_docs/data_search.mdx index d66fb67babbb6..a38b65ac8f2b6 100644 --- a/api_docs/data_search.mdx +++ b/api_docs/data_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/data-search title: "data.search" image: https://source.unsplash.com/400x175/?github description: API docs for the data.search plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data.search'] --- import dataSearchObj from './data_search.devdocs.json'; diff --git a/api_docs/data_view_editor.mdx b/api_docs/data_view_editor.mdx index 7a59dde802705..246f0f1d56fa4 100644 --- a/api_docs/data_view_editor.mdx +++ b/api_docs/data_view_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViewEditor title: "dataViewEditor" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViewEditor plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewEditor'] --- import dataViewEditorObj from './data_view_editor.devdocs.json'; diff --git a/api_docs/data_view_field_editor.mdx b/api_docs/data_view_field_editor.mdx index 9c663b8898178..3b80d5cd6d62c 100644 --- a/api_docs/data_view_field_editor.mdx +++ b/api_docs/data_view_field_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViewFieldEditor title: "dataViewFieldEditor" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViewFieldEditor plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewFieldEditor'] --- import dataViewFieldEditorObj from './data_view_field_editor.devdocs.json'; diff --git a/api_docs/data_view_management.mdx b/api_docs/data_view_management.mdx index ec132aee9cb52..a4c22013a7391 100644 --- a/api_docs/data_view_management.mdx +++ b/api_docs/data_view_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViewManagement title: "dataViewManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViewManagement plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewManagement'] --- import dataViewManagementObj from './data_view_management.devdocs.json'; diff --git a/api_docs/data_views.mdx b/api_docs/data_views.mdx index a521d13aa7389..7245a253b5a4b 100644 --- a/api_docs/data_views.mdx +++ b/api_docs/data_views.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViews title: "dataViews" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViews plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViews'] --- import dataViewsObj from './data_views.devdocs.json'; diff --git a/api_docs/data_visualizer.mdx b/api_docs/data_visualizer.mdx index 2802ac97df0b5..c9ce1886651f6 100644 --- a/api_docs/data_visualizer.mdx +++ b/api_docs/data_visualizer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataVisualizer title: "dataVisualizer" image: https://source.unsplash.com/400x175/?github description: API docs for the dataVisualizer plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataVisualizer'] --- import dataVisualizerObj from './data_visualizer.devdocs.json'; diff --git a/api_docs/deprecations_by_api.mdx b/api_docs/deprecations_by_api.mdx index c6968e111b533..af93c369b8bbe 100644 --- a/api_docs/deprecations_by_api.mdx +++ b/api_docs/deprecations_by_api.mdx @@ -7,7 +7,7 @@ id: kibDevDocsDeprecationsByApi slug: /kibana-dev-docs/api-meta/deprecated-api-list-by-api title: Deprecated API usage by API description: A list of deprecated APIs, which plugins are still referencing them, and when they need to be removed by. -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -49,16 +49,16 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | lens, observability, dataVisualizer, fleet, cloudSecurityPosture, discoverEnhanced, osquery, synthetics | - | | | esUiShared, home, data, spaces, fleet, observability, ml, apm, indexLifecycleManagement, synthetics, upgradeAssistant, ux, savedObjectsManagement, kibanaOverview | - | | | management, spaces, ml, canvas, enterpriseSearch, osquery, home | - | -| | canvas, visTypeXy | - | +| | canvas | - | | | canvas | - | | | canvas | - | | | canvas | - | -| | canvas, visTypeXy | - | -| | canvas, visTypeXy | - | +| | canvas | - | +| | canvas | - | | | canvas | - | | | canvas | - | | | canvas | - | -| | canvas, visTypeXy | - | +| | canvas | - | | | management, enterpriseSearch | - | | | enterpriseSearch | - | | | actions, ml, savedObjectsTagging, enterpriseSearch | - | diff --git a/api_docs/deprecations_by_plugin.mdx b/api_docs/deprecations_by_plugin.mdx index 7614694432f40..35c5b9e35340d 100644 --- a/api_docs/deprecations_by_plugin.mdx +++ b/api_docs/deprecations_by_plugin.mdx @@ -7,7 +7,7 @@ id: kibDevDocsDeprecationsByPlugin slug: /kibana-dev-docs/api-meta/deprecated-api-list-by-plugin title: Deprecated API usage by plugin description: A list of deprecated APIs, which plugins are still referencing them, and when they need to be removed by. -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -676,17 +676,6 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ -## visTypeXy - -| Deprecated API | Reference location(s) | Remove By | -| ---------------|-----------|-----------| -| | [xy_vis_fn.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/xy/public/expression_functions/xy_vis_fn.ts#:~:text=context) | - | -| | [xy_vis_fn.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/xy/public/expression_functions/xy_vis_fn.ts#:~:text=Render), [xy_vis_fn.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/xy/public/expression_functions/xy_vis_fn.ts#:~:text=Render) | - | -| | [xy_vis_fn.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/xy/public/expression_functions/xy_vis_fn.ts#:~:text=context) | - | -| | [xy_vis_fn.ts](https://github.com/elastic/kibana/tree/master/src/plugins/vis_types/xy/public/expression_functions/xy_vis_fn.ts#:~:text=context) | - | - - - ## visualizations | Deprecated API | Reference location(s) | Remove By | diff --git a/api_docs/deprecations_by_team.mdx b/api_docs/deprecations_by_team.mdx index 23a8791ccc759..212481753680f 100644 --- a/api_docs/deprecations_by_team.mdx +++ b/api_docs/deprecations_by_team.mdx @@ -7,7 +7,7 @@ id: kibDevDocsDeprecationsDueByTeam slug: /kibana-dev-docs/api-meta/deprecations-due-by-team title: Deprecated APIs due to be removed, by team description: Lists the teams that are referencing deprecated APIs with a remove by date. -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- diff --git a/api_docs/dev_tools.mdx b/api_docs/dev_tools.mdx index fe4a8f7fb1b48..d35c58ba11425 100644 --- a/api_docs/dev_tools.mdx +++ b/api_docs/dev_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/devTools title: "devTools" image: https://source.unsplash.com/400x175/?github description: API docs for the devTools plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'devTools'] --- import devToolsObj from './dev_tools.devdocs.json'; diff --git a/api_docs/discover.mdx b/api_docs/discover.mdx index d3d34b75e18b4..341a8d0e8ff75 100644 --- a/api_docs/discover.mdx +++ b/api_docs/discover.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/discover title: "discover" image: https://source.unsplash.com/400x175/?github description: API docs for the discover plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'discover'] --- import discoverObj from './discover.devdocs.json'; diff --git a/api_docs/discover_enhanced.mdx b/api_docs/discover_enhanced.mdx index debc000f91cf8..79bba874c8503 100644 --- a/api_docs/discover_enhanced.mdx +++ b/api_docs/discover_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/discoverEnhanced title: "discoverEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the discoverEnhanced plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'discoverEnhanced'] --- import discoverEnhancedObj from './discover_enhanced.devdocs.json'; diff --git a/api_docs/elastic_apm_synthtrace.mdx b/api_docs/elastic_apm_synthtrace.mdx deleted file mode 100644 index 20db74caf8ea0..0000000000000 --- a/api_docs/elastic_apm_synthtrace.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -#### -#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. -#### Reach out in #docs-engineering for more info. -#### -id: kibElasticApmSynthtracePluginApi -slug: /kibana-dev-docs/api/elastic-apm-synthtrace -title: "@elastic/apm-synthtrace" -image: https://source.unsplash.com/400x175/?github -description: API docs for the @elastic/apm-synthtrace plugin -date: 2022-08-18 -tags: ['contributor', 'dev', 'apidocs', 'kibana', '@elastic/apm-synthtrace'] ---- -import elasticApmSynthtraceObj from './elastic_apm_synthtrace.devdocs.json'; - -Elastic APM trace data generator - -Contact [Owner missing] for questions regarding this plugin. - -**Code health stats** - -| Public API count | Any count | Items lacking comments | Missing exports | -|-------------------|-----------|------------------------|-----------------| -| 74 | 0 | 74 | 11 | - -## Server - -### Objects - - -### Functions - - -### Classes - - -### Interfaces - - -### Enums - - -### Consts, variables and types - - diff --git a/api_docs/embeddable.devdocs.json b/api_docs/embeddable.devdocs.json index 15b274a52b3c1..fcc61f30bb223 100644 --- a/api_docs/embeddable.devdocs.json +++ b/api_docs/embeddable.devdocs.json @@ -8422,6 +8422,38 @@ ], "returnComment": [] }, + { + "parentPluginId": "embeddable", + "id": "def-public.IEmbeddable.updateOutput", + "type": "Function", + "tags": [], + "label": "updateOutput", + "description": [ + "\nUpdates output state with the given changes." + ], + "signature": [ + "(changes: Partial) => void" + ], + "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "embeddable", + "id": "def-public.IEmbeddable.updateOutput.$1", + "type": "Object", + "tags": [], + "label": "changes", + "description": [], + "signature": [ + "Partial" + ], + "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, { "parentPluginId": "embeddable", "id": "def-public.IEmbeddable.getInput$", diff --git a/api_docs/embeddable.mdx b/api_docs/embeddable.mdx index 44b34351db15e..32d11e69592e9 100644 --- a/api_docs/embeddable.mdx +++ b/api_docs/embeddable.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/embeddable title: "embeddable" image: https://source.unsplash.com/400x175/?github description: API docs for the embeddable plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'embeddable'] --- import embeddableObj from './embeddable.devdocs.json'; @@ -21,7 +21,7 @@ Contact [App Services](https://github.com/orgs/elastic/teams/kibana-app-services | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 512 | 0 | 413 | 4 | +| 514 | 0 | 414 | 4 | ## Client diff --git a/api_docs/embeddable_enhanced.mdx b/api_docs/embeddable_enhanced.mdx index f2ebec2b2a4b3..490ab4a490165 100644 --- a/api_docs/embeddable_enhanced.mdx +++ b/api_docs/embeddable_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/embeddableEnhanced title: "embeddableEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the embeddableEnhanced plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'embeddableEnhanced'] --- import embeddableEnhancedObj from './embeddable_enhanced.devdocs.json'; diff --git a/api_docs/encrypted_saved_objects.mdx b/api_docs/encrypted_saved_objects.mdx index 9c9b7e58e1623..3e280a9a3af49 100644 --- a/api_docs/encrypted_saved_objects.mdx +++ b/api_docs/encrypted_saved_objects.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/encryptedSavedObjects title: "encryptedSavedObjects" image: https://source.unsplash.com/400x175/?github description: API docs for the encryptedSavedObjects plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'encryptedSavedObjects'] --- import encryptedSavedObjectsObj from './encrypted_saved_objects.devdocs.json'; diff --git a/api_docs/enterprise_search.devdocs.json b/api_docs/enterprise_search.devdocs.json index 4518c1110b7b1..7cf19747bfb19 100644 --- a/api_docs/enterprise_search.devdocs.json +++ b/api_docs/enterprise_search.devdocs.json @@ -14,6 +14,34 @@ "interfaces": [], "enums": [], "misc": [ + { + "parentPluginId": "enterpriseSearch", + "id": "def-server.ANALYTICS_COLLECTIONS_INDEX", + "type": "string", + "tags": [], + "label": "ANALYTICS_COLLECTIONS_INDEX", + "description": [], + "signature": [ + "\".elastic-analytics-collections\"" + ], + "path": "x-pack/plugins/enterprise_search/server/index.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "enterpriseSearch", + "id": "def-server.ANALYTICS_VERSION", + "type": "string", + "tags": [], + "label": "ANALYTICS_VERSION", + "description": [], + "signature": [ + "\"1\"" + ], + "path": "x-pack/plugins/enterprise_search/server/index.ts", + "deprecated": false, + "initialIsOpen": false + }, { "parentPluginId": "enterpriseSearch", "id": "def-server.ConfigType", diff --git a/api_docs/enterprise_search.mdx b/api_docs/enterprise_search.mdx index eccccd8e0c8f3..107f4985c9a1a 100644 --- a/api_docs/enterprise_search.mdx +++ b/api_docs/enterprise_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/enterpriseSearch title: "enterpriseSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the enterpriseSearch plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'enterpriseSearch'] --- import enterpriseSearchObj from './enterprise_search.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Enterprise Search](https://github.com/orgs/elastic/teams/enterprise-sea | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 6 | 0 | 6 | 0 | +| 8 | 0 | 8 | 0 | ## Server diff --git a/api_docs/es_ui_shared.mdx b/api_docs/es_ui_shared.mdx index a6169ade9a7f0..8756693deb3d4 100644 --- a/api_docs/es_ui_shared.mdx +++ b/api_docs/es_ui_shared.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/esUiShared title: "esUiShared" image: https://source.unsplash.com/400x175/?github description: API docs for the esUiShared plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'esUiShared'] --- import esUiSharedObj from './es_ui_shared.devdocs.json'; diff --git a/api_docs/event_annotation.mdx b/api_docs/event_annotation.mdx index c81c793c6bc06..8bb87d9675760 100644 --- a/api_docs/event_annotation.mdx +++ b/api_docs/event_annotation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/eventAnnotation title: "eventAnnotation" image: https://source.unsplash.com/400x175/?github description: API docs for the eventAnnotation plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventAnnotation'] --- import eventAnnotationObj from './event_annotation.devdocs.json'; diff --git a/api_docs/event_log.mdx b/api_docs/event_log.mdx index 08e0efb364837..accbeb8dd3cd1 100644 --- a/api_docs/event_log.mdx +++ b/api_docs/event_log.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/eventLog title: "eventLog" image: https://source.unsplash.com/400x175/?github description: API docs for the eventLog plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventLog'] --- import eventLogObj from './event_log.devdocs.json'; diff --git a/api_docs/expression_error.mdx b/api_docs/expression_error.mdx index 68db5de55f03b..27120b4b39baf 100644 --- a/api_docs/expression_error.mdx +++ b/api_docs/expression_error.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionError title: "expressionError" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionError plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionError'] --- import expressionErrorObj from './expression_error.devdocs.json'; diff --git a/api_docs/expression_gauge.mdx b/api_docs/expression_gauge.mdx index f512e7e9c75f3..99f0e8a96126b 100644 --- a/api_docs/expression_gauge.mdx +++ b/api_docs/expression_gauge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionGauge title: "expressionGauge" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionGauge plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionGauge'] --- import expressionGaugeObj from './expression_gauge.devdocs.json'; diff --git a/api_docs/expression_heatmap.mdx b/api_docs/expression_heatmap.mdx index 040edccf8c8c3..e89310339a2ff 100644 --- a/api_docs/expression_heatmap.mdx +++ b/api_docs/expression_heatmap.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionHeatmap title: "expressionHeatmap" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionHeatmap plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionHeatmap'] --- import expressionHeatmapObj from './expression_heatmap.devdocs.json'; diff --git a/api_docs/expression_image.mdx b/api_docs/expression_image.mdx index 0d8b0cff8abb8..b069a55c33ff3 100644 --- a/api_docs/expression_image.mdx +++ b/api_docs/expression_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionImage title: "expressionImage" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionImage plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionImage'] --- import expressionImageObj from './expression_image.devdocs.json'; diff --git a/api_docs/expression_legacy_metric_vis.mdx b/api_docs/expression_legacy_metric_vis.mdx index 70526268ccb40..c43c215cd56e3 100644 --- a/api_docs/expression_legacy_metric_vis.mdx +++ b/api_docs/expression_legacy_metric_vis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionLegacyMetricVis title: "expressionLegacyMetricVis" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionLegacyMetricVis plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionLegacyMetricVis'] --- import expressionLegacyMetricVisObj from './expression_legacy_metric_vis.devdocs.json'; diff --git a/api_docs/expression_metric.mdx b/api_docs/expression_metric.mdx index bb29f3d63221b..5cc3c2e272204 100644 --- a/api_docs/expression_metric.mdx +++ b/api_docs/expression_metric.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionMetric title: "expressionMetric" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionMetric plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionMetric'] --- import expressionMetricObj from './expression_metric.devdocs.json'; diff --git a/api_docs/expression_metric_vis.mdx b/api_docs/expression_metric_vis.mdx index 71ac4a737f38d..a32beeda69a71 100644 --- a/api_docs/expression_metric_vis.mdx +++ b/api_docs/expression_metric_vis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionMetricVis title: "expressionMetricVis" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionMetricVis plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionMetricVis'] --- import expressionMetricVisObj from './expression_metric_vis.devdocs.json'; diff --git a/api_docs/expression_partition_vis.mdx b/api_docs/expression_partition_vis.mdx index 3bcf859578437..58381a2c030d9 100644 --- a/api_docs/expression_partition_vis.mdx +++ b/api_docs/expression_partition_vis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionPartitionVis title: "expressionPartitionVis" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionPartitionVis plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionPartitionVis'] --- import expressionPartitionVisObj from './expression_partition_vis.devdocs.json'; diff --git a/api_docs/expression_repeat_image.mdx b/api_docs/expression_repeat_image.mdx index fb5c7b545999b..84d5978ec0717 100644 --- a/api_docs/expression_repeat_image.mdx +++ b/api_docs/expression_repeat_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionRepeatImage title: "expressionRepeatImage" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionRepeatImage plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionRepeatImage'] --- import expressionRepeatImageObj from './expression_repeat_image.devdocs.json'; diff --git a/api_docs/expression_reveal_image.mdx b/api_docs/expression_reveal_image.mdx index b6c9983a9988c..bb42d0c3c0ef8 100644 --- a/api_docs/expression_reveal_image.mdx +++ b/api_docs/expression_reveal_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionRevealImage title: "expressionRevealImage" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionRevealImage plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionRevealImage'] --- import expressionRevealImageObj from './expression_reveal_image.devdocs.json'; diff --git a/api_docs/expression_shape.mdx b/api_docs/expression_shape.mdx index 971bc703be0e2..aff78c3a8b5ce 100644 --- a/api_docs/expression_shape.mdx +++ b/api_docs/expression_shape.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionShape title: "expressionShape" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionShape plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionShape'] --- import expressionShapeObj from './expression_shape.devdocs.json'; diff --git a/api_docs/expression_tagcloud.mdx b/api_docs/expression_tagcloud.mdx index 0e5302d87a970..0d7c788777029 100644 --- a/api_docs/expression_tagcloud.mdx +++ b/api_docs/expression_tagcloud.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionTagcloud title: "expressionTagcloud" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionTagcloud plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionTagcloud'] --- import expressionTagcloudObj from './expression_tagcloud.devdocs.json'; diff --git a/api_docs/expression_x_y.mdx b/api_docs/expression_x_y.mdx index fa81ffc3ef6ba..72629a6cee2f0 100644 --- a/api_docs/expression_x_y.mdx +++ b/api_docs/expression_x_y.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionXY title: "expressionXY" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionXY plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionXY'] --- import expressionXYObj from './expression_x_y.devdocs.json'; diff --git a/api_docs/expressions.devdocs.json b/api_docs/expressions.devdocs.json index 8bf0ad4f7cc46..f39f113576e2a 100644 --- a/api_docs/expressions.devdocs.json +++ b/api_docs/expressions.devdocs.json @@ -7966,10 +7966,6 @@ { "plugin": "canvas", "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/server/pointseries/index.ts" - }, - { - "plugin": "visTypeXy", - "path": "src/plugins/vis_types/xy/public/expression_functions/xy_vis_fn.ts" } ] } @@ -18404,10 +18400,6 @@ { "plugin": "canvas", "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/server/pointseries/index.ts" - }, - { - "plugin": "visTypeXy", - "path": "src/plugins/vis_types/xy/public/expression_functions/xy_vis_fn.ts" } ] } @@ -30224,10 +30216,6 @@ { "plugin": "canvas", "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/server/pointseries/index.ts" - }, - { - "plugin": "visTypeXy", - "path": "src/plugins/vis_types/xy/public/expression_functions/xy_vis_fn.ts" } ] } @@ -34915,14 +34903,6 @@ { "plugin": "canvas", "path": "x-pack/plugins/canvas/canvas_plugin_src/functions/common/table.ts" - }, - { - "plugin": "visTypeXy", - "path": "src/plugins/vis_types/xy/public/expression_functions/xy_vis_fn.ts" - }, - { - "plugin": "visTypeXy", - "path": "src/plugins/vis_types/xy/public/expression_functions/xy_vis_fn.ts" } ], "initialIsOpen": false diff --git a/api_docs/expressions.mdx b/api_docs/expressions.mdx index d5a70f521ffe7..95486711230d5 100644 --- a/api_docs/expressions.mdx +++ b/api_docs/expressions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressions title: "expressions" image: https://source.unsplash.com/400x175/?github description: API docs for the expressions plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressions'] --- import expressionsObj from './expressions.devdocs.json'; diff --git a/api_docs/features.mdx b/api_docs/features.mdx index b85f190a0105b..8801ae66f5f3f 100644 --- a/api_docs/features.mdx +++ b/api_docs/features.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/features title: "features" image: https://source.unsplash.com/400x175/?github description: API docs for the features plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'features'] --- import featuresObj from './features.devdocs.json'; diff --git a/api_docs/field_formats.mdx b/api_docs/field_formats.mdx index 1072dc5d534ca..73e36008e12c9 100644 --- a/api_docs/field_formats.mdx +++ b/api_docs/field_formats.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/fieldFormats title: "fieldFormats" image: https://source.unsplash.com/400x175/?github description: API docs for the fieldFormats plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fieldFormats'] --- import fieldFormatsObj from './field_formats.devdocs.json'; diff --git a/api_docs/file_upload.mdx b/api_docs/file_upload.mdx index 8a2850648317a..27a24293f037e 100644 --- a/api_docs/file_upload.mdx +++ b/api_docs/file_upload.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/fileUpload title: "fileUpload" image: https://source.unsplash.com/400x175/?github description: API docs for the fileUpload plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fileUpload'] --- import fileUploadObj from './file_upload.devdocs.json'; diff --git a/api_docs/files.devdocs.json b/api_docs/files.devdocs.json index d7bb9ef6bf578..0bf3f06e2b7fa 100644 --- a/api_docs/files.devdocs.json +++ b/api_docs/files.devdocs.json @@ -2218,22 +2218,12 @@ "children": [ { "parentPluginId": "files", - "id": "def-server.DeleteForFileArgs.file", - "type": "Object", + "id": "def-server.DeleteForFileArgs.id", + "type": "string", "tags": [], - "label": "file", + "label": "id", "description": [ - "\nThe file object to delete the shares for." - ], - "signature": [ - { - "pluginId": "files", - "scope": "common", - "docId": "kibFilesPluginApi", - "section": "def-common.File", - "text": "File" - }, - "" + "\nThe file id to delete the shares for." ], "path": "x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts", "deprecated": false @@ -2250,7 +2240,7 @@ "description": [ "\nWraps the {@link FileMetadataClient} and {@link BlobStorageClient} client\nto provide basic file CRUD functionality.\n\nFor now this is just a shallow type of the implementation for export purposes." ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", + "path": "x-pack/plugins/files/server/file_client/types.ts", "deprecated": false, "children": [ { @@ -2262,7 +2252,7 @@ "description": [ "See {@link FileMetadata.FileKind}." ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", + "path": "x-pack/plugins/files/server/file_client/types.ts", "deprecated": false }, { @@ -2275,19 +2265,19 @@ "\nSee {@link FileMetadataClient.create}.\n" ], "signature": [ - "(arg: ", + "(arg: ", "CreateArgs", ") => Promise<", { "pluginId": "files", - "scope": "server", + "scope": "common", "docId": "kibFilesPluginApi", - "section": "def-server.FileDescriptor", - "text": "FileDescriptor" + "section": "def-common.File", + "text": "File" }, - ">" + ">" ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", + "path": "x-pack/plugins/files/server/file_client/types.ts", "deprecated": false, "children": [ { @@ -2302,7 +2292,7 @@ "signature": [ "CreateArgs" ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", + "path": "x-pack/plugins/files/server/file_client/types.ts", "deprecated": false, "isRequired": true } @@ -2319,7 +2309,7 @@ "\nSee {@link FileMetadataClient.get}\n" ], "signature": [ - "(arg: ", + "(arg: ", { "pluginId": "files", "scope": "server", @@ -2330,16 +2320,15 @@ ") => Promise<", { "pluginId": "files", - "scope": "server", + "scope": "common", "docId": "kibFilesPluginApi", - "section": "def-server.FileDescriptor", - "text": "FileDescriptor" + "section": "def-common.File", + "text": "File" }, - ">" + ">" ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", + "path": "x-pack/plugins/files/server/file_client/types.ts", "deprecated": false, - "returnComment": [], "children": [ { "parentPluginId": "files", @@ -2359,10 +2348,12 @@ "text": "GetArg" } ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", - "deprecated": false + "path": "x-pack/plugins/files/server/file_client/types.ts", + "deprecated": false, + "isRequired": true } - ] + ], + "returnComment": [] }, { "parentPluginId": "files", @@ -2374,51 +2365,60 @@ "\n{@link FileMetadataClient.update}\n" ], "signature": [ - "(arg: ", + "(id: string, metadata: ", { "pluginId": "files", - "scope": "server", - "docId": "kibFilesPluginApi", - "section": "def-server.UpdateArgs", - "text": "UpdateArgs" - }, - ") => Promise<", - { - "pluginId": "files", - "scope": "server", + "scope": "common", "docId": "kibFilesPluginApi", - "section": "def-server.FileDescriptor", - "text": "FileDescriptor" + "section": "def-common.UpdatableFileMetadata", + "text": "UpdatableFileMetadata" }, - ">" + ") => Promise" ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", + "path": "x-pack/plugins/files/server/file_client/types.ts", "deprecated": false, - "returnComment": [], "children": [ { "parentPluginId": "files", "id": "def-server.FileClient.update.$1", + "type": "string", + "tags": [], + "label": "id", + "description": [ + "- File id" + ], + "signature": [ + "string" + ], + "path": "x-pack/plugins/files/server/file_client/types.ts", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "files", + "id": "def-server.FileClient.update.$2", "type": "Object", "tags": [], - "label": "arg", + "label": "metadata", "description": [ - "- Argument to get a file" + "- new file metadata" ], "signature": [ { "pluginId": "files", - "scope": "server", + "scope": "common", "docId": "kibFilesPluginApi", - "section": "def-server.UpdateArgs", - "text": "UpdateArgs" + "section": "def-common.UpdatableFileMetadata", + "text": "UpdatableFileMetadata" }, - "" + "" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", - "deprecated": false + "path": "x-pack/plugins/files/server/file_client/types.ts", + "deprecated": false, + "isRequired": true } - ] + ], + "returnComment": [] }, { "parentPluginId": "files", @@ -2440,7 +2440,7 @@ }, ") => Promise" ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", + "path": "x-pack/plugins/files/server/file_client/types.ts", "deprecated": false, "children": [ { @@ -2461,43 +2461,13 @@ "text": "DeleteArgs" } ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", + "path": "x-pack/plugins/files/server/file_client/types.ts", "deprecated": false, "isRequired": true } ], "returnComment": [] }, - { - "parentPluginId": "files", - "id": "def-server.FileClient.deleteContent", - "type": "Function", - "tags": [], - "label": "deleteContent", - "description": [ - "\nSee {@link BlobStorageClient.delete}\n" - ], - "signature": [ - "(id: string) => Promise" - ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "files", - "id": "def-server.FileClient.deleteContent.$1", - "type": "string", - "tags": [], - "label": "id", - "description": [ - "- Argument to delete a file" - ], - "path": "x-pack/plugins/files/server/blob_storage_service/types.ts", - "deprecated": false - } - ] - }, { "parentPluginId": "files", "id": "def-server.FileClient.list", @@ -2519,16 +2489,15 @@ " | undefined) => Promise<", { "pluginId": "files", - "scope": "server", + "scope": "common", "docId": "kibFilesPluginApi", - "section": "def-server.FileDescriptor", - "text": "FileDescriptor" + "section": "def-common.File", + "text": "File" }, "[]>" ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", + "path": "x-pack/plugins/files/server/file_client/types.ts", "deprecated": false, - "returnComment": [], "children": [ { "parentPluginId": "files", @@ -2549,10 +2518,12 @@ }, " | undefined" ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", - "deprecated": false + "path": "x-pack/plugins/files/server/file_client/types.ts", + "deprecated": false, + "isRequired": false } - ] + ], + "returnComment": [] }, { "parentPluginId": "files", @@ -2575,16 +2546,15 @@ ") => Promise<", { "pluginId": "files", - "scope": "server", + "scope": "common", "docId": "kibFilesPluginApi", - "section": "def-server.FileDescriptor", - "text": "FileDescriptor" + "section": "def-common.File", + "text": "File" }, "[]>" ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", + "path": "x-pack/plugins/files/server/file_client/types.ts", "deprecated": false, - "returnComment": [], "children": [ { "parentPluginId": "files", @@ -2604,113 +2574,147 @@ "text": "FindFileArgs" } ], - "path": "x-pack/plugins/files/server/file_client/file_metadata_client/file_metadata_client.ts", - "deprecated": false + "path": "x-pack/plugins/files/server/file_client/types.ts", + "deprecated": false, + "isRequired": true } - ] + ], + "returnComment": [] }, { "parentPluginId": "files", - "id": "def-server.FileClient.upload", + "id": "def-server.FileClient.share", "type": "Function", - "tags": [], - "label": "upload", + "tags": [ + "note" + ], + "label": "share", "description": [ - "\nSee {@link BlobStorageClient.upload}\n" + "\nCreate a file share instance for this file.\n" ], "signature": [ - "(id: string, rs: ", - "Readable", - ", opts?: ", - "UploadOptions", - " | undefined) => Promise<{ id: string; size: number; }>" + "(args: ", + "ShareArgs", + ") => Promise<", + { + "pluginId": "files", + "scope": "common", + "docId": "kibFilesPluginApi", + "section": "def-common.FileShareJSONWithToken", + "text": "FileShareJSONWithToken" + }, + ">" ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", + "path": "x-pack/plugins/files/server/file_client/types.ts", "deprecated": false, "children": [ { "parentPluginId": "files", - "id": "def-server.FileClient.upload.$1", - "type": "string", - "tags": [], - "label": "id", - "description": [ - "- Readable stream to upload" - ], - "signature": [ - "string" - ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", - "deprecated": false, - "isRequired": true - }, - { - "parentPluginId": "files", - "id": "def-server.FileClient.upload.$2", + "id": "def-server.FileClient.share.$1", "type": "Object", "tags": [], - "label": "rs", + "label": "args", "description": [ - "- Readable stream to upload" + "- Arguments to create a file share" ], "signature": [ - "Readable" + "ShareArgs" ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", + "path": "x-pack/plugins/files/server/file_client/types.ts", "deprecated": false, "isRequired": true - }, + } + ], + "returnComment": [] + }, + { + "parentPluginId": "files", + "id": "def-server.FileClient.unshare", + "type": "Function", + "tags": [ + "note" + ], + "label": "unshare", + "description": [ + "\nCreate a file share instance for this file.\n" + ], + "signature": [ + "(args: IdArg) => Promise" + ], + "path": "x-pack/plugins/files/server/file_client/types.ts", + "deprecated": false, + "returnComment": [], + "children": [ { "parentPluginId": "files", - "id": "def-server.FileClient.upload.$3", + "id": "def-server.FileClient.unshare.$1", "type": "Object", "tags": [], - "label": "opts", + "label": "args", "description": [ - "- Argument for uploads" + "- Arguments to remove a file share" ], "signature": [ - "UploadOptions", - " | undefined" + "IdArg" ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", - "deprecated": false, - "isRequired": false + "path": "x-pack/plugins/files/server/file_share_service/types.ts", + "deprecated": false } - ], - "returnComment": [] + ] }, { "parentPluginId": "files", - "id": "def-server.FileClient.download", + "id": "def-server.FileClient.listShares", "type": "Function", - "tags": [], - "label": "download", + "tags": [ + "note" + ], + "label": "listShares", "description": [ - "\nSee {@link BlobStorageClient.download}\n" + "\nCreate a file share instance for this file.\n" ], "signature": [ - "(args: { id: string; size?: number | undefined; }) => Promise<", - "Readable", - ">" + "(arg: ", + { + "pluginId": "files", + "scope": "server", + "docId": "kibFilesPluginApi", + "section": "def-server.ListArgs", + "text": "ListArgs" + }, + ") => Promise<{ shares: ", + { + "pluginId": "files", + "scope": "common", + "docId": "kibFilesPluginApi", + "section": "def-common.FileShareJSON", + "text": "FileShareJSON" + }, + "[]; }>" ], - "path": "x-pack/plugins/files/server/file_client/file_client.ts", + "path": "x-pack/plugins/files/server/file_client/types.ts", "deprecated": false, "returnComment": [], "children": [ { "parentPluginId": "files", - "id": "def-server.FileClient.download.$1", + "id": "def-server.FileClient.listShares.$1", "type": "Object", "tags": [], - "label": "args", + "label": "arg", "description": [ - "- to download a file" + "- Arguments to remove a file share" ], "signature": [ - "{ id: string; size?: number | undefined; }" + { + "pluginId": "files", + "scope": "server", + "docId": "kibFilesPluginApi", + "section": "def-server.ListArgs", + "text": "ListArgs" + } ], - "path": "x-pack/plugins/files/server/blob_storage_service/types.ts", + "path": "x-pack/plugins/files/server/file_share_service/types.ts", "deprecated": false } ] @@ -3352,7 +3356,7 @@ "\nUpdate updatable file attributes like name and meta.\n" ], "signature": [ - "(args: ", + "(args: ", { "pluginId": "files", "scope": "server", @@ -3360,15 +3364,7 @@ "section": "def-server.UpdateFileArgs", "text": "UpdateFileArgs" }, - ") => Promise<", - { - "pluginId": "files", - "scope": "common", - "docId": "kibFilesPluginApi", - "section": "def-common.File", - "text": "File" - }, - ">" + ") => Promise" ], "path": "x-pack/plugins/files/server/file_service/file_service.ts", "deprecated": false, @@ -4803,19 +4799,45 @@ "section": "def-common.File", "text": "File" }, - " extends ", - { - "pluginId": "files", - "scope": "common", - "docId": "kibFilesPluginApi", - "section": "def-common.FileJSON", - "text": "FileJSON" - }, "" ], "path": "x-pack/plugins/files/common/types.ts", "deprecated": false, "children": [ + { + "parentPluginId": "files", + "id": "def-common.File.id", + "type": "string", + "tags": [], + "label": "id", + "description": [ + "\nThe file ID" + ], + "path": "x-pack/plugins/files/common/types.ts", + "deprecated": false + }, + { + "parentPluginId": "files", + "id": "def-common.File.data", + "type": "Object", + "tags": [], + "label": "data", + "description": [ + "\nFile metadata in camelCase form." + ], + "signature": [ + { + "pluginId": "files", + "scope": "common", + "docId": "kibFilesPluginApi", + "section": "def-common.FileJSON", + "text": "FileJSON" + }, + "" + ], + "path": "x-pack/plugins/files/common/types.ts", + "deprecated": false + }, { "parentPluginId": "files", "id": "def-common.File.update", @@ -4886,7 +4908,15 @@ "signature": [ "(content: ", "Readable", - ") => Promise" + ") => Promise<", + { + "pluginId": "files", + "scope": "common", + "docId": "kibFilesPluginApi", + "section": "def-common.File", + "text": "File" + }, + ">" ], "path": "x-pack/plugins/files/common/types.ts", "deprecated": false, diff --git a/api_docs/files.mdx b/api_docs/files.mdx index f9e1ebaf95e22..4fa0f071191b4 100644 --- a/api_docs/files.mdx +++ b/api_docs/files.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/files title: "files" image: https://source.unsplash.com/400x175/?github description: API docs for the files plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'files'] --- import filesObj from './files.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-app-services](https://github.com/orgs/elastic/teams/tea | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 236 | 0 | 3 | 2 | +| 237 | 0 | 3 | 2 | ## Client diff --git a/api_docs/fleet.devdocs.json b/api_docs/fleet.devdocs.json index 08581064a4d00..b082176e571a3 100644 --- a/api_docs/fleet.devdocs.json +++ b/api_docs/fleet.devdocs.json @@ -3933,7 +3933,7 @@ "signature": [ "(soClient: ", "SavedObjectsClientContract", - ", ids: string[], options?: { fields?: string[] | undefined; }) => Promise<", + ", ids: string[], options?: { fields?: string[] | undefined; withPackagePolicies?: boolean | undefined; ignoreMissing?: boolean | undefined; }) => Promise<", { "pluginId": "fleet", "scope": "common", @@ -3981,7 +3981,7 @@ "label": "options", "description": [], "signature": [ - "{ fields?: string[] | undefined; }" + "{ fields?: string[] | undefined; withPackagePolicies?: boolean | undefined; ignoreMissing?: boolean | undefined; }" ], "path": "x-pack/plugins/fleet/server/services/agent_policy.ts", "deprecated": false @@ -5312,7 +5312,7 @@ "signature": [ "(soClient: ", "SavedObjectsClientContract", - ", ids: string[]) => Promise<", + ", ids: string[], options?: { ignoreMissing?: boolean | undefined; } | undefined) => Promise<", { "pluginId": "fleet", "scope": "common", @@ -5352,6 +5352,31 @@ "path": "x-pack/plugins/fleet/server/services/package_policy.ts", "deprecated": false, "isRequired": true + }, + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.getByIDs.$3", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "fleet", + "id": "def-server.PackagePolicyServiceInterface.getByIDs.$3.ignoreMissing", + "type": "CompoundType", + "tags": [], + "label": "ignoreMissing", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "x-pack/plugins/fleet/server/services/package_policy.ts", + "deprecated": false + } + ] } ], "returnComment": [] @@ -9768,7 +9793,7 @@ "label": "install_source", "description": [], "signature": [ - "\"upload\" | \"registry\" | \"bundled\"" + "\"registry\" | \"upload\" | \"bundled\"" ], "path": "x-pack/plugins/fleet/common/types/models/epm.ts", "deprecated": false @@ -9918,7 +9943,7 @@ "label": "installSource", "description": [], "signature": [ - "\"upload\" | \"registry\" | \"bundled\"" + "\"registry\" | \"upload\" | \"bundled\"" ], "path": "x-pack/plugins/fleet/common/types/rest_spec/epm.ts", "deprecated": false @@ -14292,6 +14317,16 @@ "path": "x-pack/plugins/fleet/common/constants/routes.ts", "deprecated": false }, + { + "parentPluginId": "fleet", + "id": "def-common.AGENT_POLICY_API_ROUTES.BULK_GET_PATTERN", + "type": "string", + "tags": [], + "label": "BULK_GET_PATTERN", + "description": [], + "path": "x-pack/plugins/fleet/common/constants/routes.ts", + "deprecated": false + }, { "parentPluginId": "fleet", "id": "def-common.AGENT_POLICY_API_ROUTES.INFO_PATTERN", @@ -15641,6 +15676,16 @@ "path": "x-pack/plugins/fleet/common/constants/routes.ts", "deprecated": false }, + { + "parentPluginId": "fleet", + "id": "def-common.PACKAGE_POLICY_API_ROUTES.BULK_GET_PATTERN", + "type": "string", + "tags": [], + "label": "BULK_GET_PATTERN", + "description": [], + "path": "x-pack/plugins/fleet/common/constants/routes.ts", + "deprecated": false + }, { "parentPluginId": "fleet", "id": "def-common.PACKAGE_POLICY_API_ROUTES.INFO_PATTERN", diff --git a/api_docs/fleet.mdx b/api_docs/fleet.mdx index 883c4fd9502fe..0f0f20355f8c9 100644 --- a/api_docs/fleet.mdx +++ b/api_docs/fleet.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/fleet title: "fleet" image: https://source.unsplash.com/400x175/?github description: API docs for the fleet plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fleet'] --- import fleetObj from './fleet.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Fleet](https://github.com/orgs/elastic/teams/fleet) for questions regar | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 957 | 3 | 862 | 9 | +| 961 | 3 | 866 | 9 | ## Client diff --git a/api_docs/global_search.mdx b/api_docs/global_search.mdx index 8c980b9b1487a..e1d92210fda2f 100644 --- a/api_docs/global_search.mdx +++ b/api_docs/global_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/globalSearch title: "globalSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the globalSearch plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'globalSearch'] --- import globalSearchObj from './global_search.devdocs.json'; diff --git a/api_docs/home.mdx b/api_docs/home.mdx index 013c15505f037..2516ace023b1d 100644 --- a/api_docs/home.mdx +++ b/api_docs/home.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/home title: "home" image: https://source.unsplash.com/400x175/?github description: API docs for the home plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'home'] --- import homeObj from './home.devdocs.json'; diff --git a/api_docs/index_lifecycle_management.mdx b/api_docs/index_lifecycle_management.mdx index 0a2ad674489bc..265130a5a3e40 100644 --- a/api_docs/index_lifecycle_management.mdx +++ b/api_docs/index_lifecycle_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/indexLifecycleManagement title: "indexLifecycleManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the indexLifecycleManagement plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'indexLifecycleManagement'] --- import indexLifecycleManagementObj from './index_lifecycle_management.devdocs.json'; diff --git a/api_docs/index_management.mdx b/api_docs/index_management.mdx index 9ee4a784b6c61..50791c3d1b735 100644 --- a/api_docs/index_management.mdx +++ b/api_docs/index_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/indexManagement title: "indexManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the indexManagement plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'indexManagement'] --- import indexManagementObj from './index_management.devdocs.json'; diff --git a/api_docs/infra.mdx b/api_docs/infra.mdx index 9d1388b056cab..4bfe04ae84795 100644 --- a/api_docs/infra.mdx +++ b/api_docs/infra.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/infra title: "infra" image: https://source.unsplash.com/400x175/?github description: API docs for the infra plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'infra'] --- import infraObj from './infra.devdocs.json'; diff --git a/api_docs/inspector.mdx b/api_docs/inspector.mdx index 24b59fa61ecf2..fee794d32b8c7 100644 --- a/api_docs/inspector.mdx +++ b/api_docs/inspector.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/inspector title: "inspector" image: https://source.unsplash.com/400x175/?github description: API docs for the inspector plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'inspector'] --- import inspectorObj from './inspector.devdocs.json'; diff --git a/api_docs/interactive_setup.mdx b/api_docs/interactive_setup.mdx index 9b11c63613ce6..5c92316cd80c2 100644 --- a/api_docs/interactive_setup.mdx +++ b/api_docs/interactive_setup.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/interactiveSetup title: "interactiveSetup" image: https://source.unsplash.com/400x175/?github description: API docs for the interactiveSetup plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'interactiveSetup'] --- import interactiveSetupObj from './interactive_setup.devdocs.json'; diff --git a/api_docs/kbn_ace.mdx b/api_docs/kbn_ace.mdx index e510437eda12a..bca38d0a78201 100644 --- a/api_docs/kbn_ace.mdx +++ b/api_docs/kbn_ace.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ace title: "@kbn/ace" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ace plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ace'] --- import kbnAceObj from './kbn_ace.devdocs.json'; diff --git a/api_docs/kbn_aiops_components.mdx b/api_docs/kbn_aiops_components.mdx index a585502c902e4..a7bb99de9d298 100644 --- a/api_docs/kbn_aiops_components.mdx +++ b/api_docs/kbn_aiops_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-aiops-components title: "@kbn/aiops-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/aiops-components plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/aiops-components'] --- import kbnAiopsComponentsObj from './kbn_aiops_components.devdocs.json'; diff --git a/api_docs/kbn_aiops_utils.mdx b/api_docs/kbn_aiops_utils.mdx index cf3880109c7f3..fd47ee26950e4 100644 --- a/api_docs/kbn_aiops_utils.mdx +++ b/api_docs/kbn_aiops_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-aiops-utils title: "@kbn/aiops-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/aiops-utils plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/aiops-utils'] --- import kbnAiopsUtilsObj from './kbn_aiops_utils.devdocs.json'; diff --git a/api_docs/kbn_alerts.mdx b/api_docs/kbn_alerts.mdx index d70a441d20a64..4d736109e9f6a 100644 --- a/api_docs/kbn_alerts.mdx +++ b/api_docs/kbn_alerts.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerts title: "@kbn/alerts" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerts plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerts'] --- import kbnAlertsObj from './kbn_alerts.devdocs.json'; diff --git a/api_docs/kbn_analytics.mdx b/api_docs/kbn_analytics.mdx index 4ee91d6535580..27f3a4bc41abd 100644 --- a/api_docs/kbn_analytics.mdx +++ b/api_docs/kbn_analytics.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics title: "@kbn/analytics" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics'] --- import kbnAnalyticsObj from './kbn_analytics.devdocs.json'; diff --git a/api_docs/kbn_analytics_client.mdx b/api_docs/kbn_analytics_client.mdx index 0b514021a1a52..a8ba75f884b89 100644 --- a/api_docs/kbn_analytics_client.mdx +++ b/api_docs/kbn_analytics_client.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-client title: "@kbn/analytics-client" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-client plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-client'] --- import kbnAnalyticsClientObj from './kbn_analytics_client.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx b/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx index c51597e2396c8..11cd1fdc20f02 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx +++ b/api_docs/kbn_analytics_shippers_elastic_v3_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-elastic-v3-browser title: "@kbn/analytics-shippers-elastic-v3-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-elastic-v3-browser plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-elastic-v3-browser'] --- import kbnAnalyticsShippersElasticV3BrowserObj from './kbn_analytics_shippers_elastic_v3_browser.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx b/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx index 1e68519814189..7e0becc951edf 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx +++ b/api_docs/kbn_analytics_shippers_elastic_v3_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-elastic-v3-common title: "@kbn/analytics-shippers-elastic-v3-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-elastic-v3-common plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-elastic-v3-common'] --- import kbnAnalyticsShippersElasticV3CommonObj from './kbn_analytics_shippers_elastic_v3_common.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx b/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx index 4582e1f40f686..24c9fc0fddc8c 100644 --- a/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx +++ b/api_docs/kbn_analytics_shippers_elastic_v3_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-elastic-v3-server title: "@kbn/analytics-shippers-elastic-v3-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-elastic-v3-server plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-elastic-v3-server'] --- import kbnAnalyticsShippersElasticV3ServerObj from './kbn_analytics_shippers_elastic_v3_server.devdocs.json'; diff --git a/api_docs/kbn_analytics_shippers_fullstory.mdx b/api_docs/kbn_analytics_shippers_fullstory.mdx index d646b6198ed68..9bc9fe8fb51ff 100644 --- a/api_docs/kbn_analytics_shippers_fullstory.mdx +++ b/api_docs/kbn_analytics_shippers_fullstory.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-shippers-fullstory title: "@kbn/analytics-shippers-fullstory" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-shippers-fullstory plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-shippers-fullstory'] --- import kbnAnalyticsShippersFullstoryObj from './kbn_analytics_shippers_fullstory.devdocs.json'; diff --git a/api_docs/kbn_apm_config_loader.mdx b/api_docs/kbn_apm_config_loader.mdx index 43fd4a9d534ad..398fa3a6741ce 100644 --- a/api_docs/kbn_apm_config_loader.mdx +++ b/api_docs/kbn_apm_config_loader.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-config-loader title: "@kbn/apm-config-loader" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-config-loader plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-config-loader'] --- import kbnApmConfigLoaderObj from './kbn_apm_config_loader.devdocs.json'; diff --git a/api_docs/elastic_apm_synthtrace.devdocs.json b/api_docs/kbn_apm_synthtrace.devdocs.json similarity index 75% rename from api_docs/elastic_apm_synthtrace.devdocs.json rename to api_docs/kbn_apm_synthtrace.devdocs.json index 7795015f81289..4994a6ae917e2 100644 --- a/api_docs/elastic_apm_synthtrace.devdocs.json +++ b/api_docs/kbn_apm_synthtrace.devdocs.json @@ -1,5 +1,5 @@ { - "id": "@elastic/apm-synthtrace", + "id": "@kbn/apm-synthtrace", "client": { "classes": [], "functions": [], @@ -11,17 +11,17 @@ "server": { "classes": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient", "type": "Class", "tags": [], "label": "ApmSynthtraceEsClient", "description": [], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.Unnamed", "type": "Function", "tags": [], @@ -30,11 +30,11 @@ "signature": [ "any" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.Unnamed.$1", "type": "Object", "tags": [], @@ -43,12 +43,12 @@ "signature": [ "default" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "isRequired": true }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.Unnamed.$2", "type": "Object", "tags": [], @@ -57,12 +57,12 @@ "signature": [ "{ perf: (name: string, cb: () => T) => T; debug: (...args: any[]) => void; info: (...args: any[]) => void; error: (...args: any[]) => void; }" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "isRequired": true }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.Unnamed.$3", "type": "Object", "tags": [], @@ -72,7 +72,7 @@ "ApmSynthtraceEsClientOptions", " | undefined" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "isRequired": false } @@ -80,7 +80,7 @@ "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.runningVersion", "type": "Function", "tags": [], @@ -89,13 +89,13 @@ "signature": [ "() => Promise" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "children": [], "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.clean", "type": "Function", "tags": [], @@ -104,11 +104,11 @@ "signature": [ "(dataStreams?: string[] | undefined) => Promise" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.clean.$1", "type": "Array", "tags": [], @@ -117,7 +117,7 @@ "signature": [ "string[] | undefined" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "isRequired": false } @@ -125,7 +125,7 @@ "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.updateComponentTemplates", "type": "Function", "tags": [], @@ -134,11 +134,11 @@ "signature": [ "(numberOfPrimaryShards: number) => Promise" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.updateComponentTemplates.$1", "type": "number", "tags": [], @@ -147,7 +147,7 @@ "signature": [ "number" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "isRequired": true } @@ -155,7 +155,7 @@ "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.registerGcpRepository", "type": "Function", "tags": [], @@ -164,11 +164,11 @@ "signature": [ "(connectionString: string) => Promise" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.registerGcpRepository.$1", "type": "string", "tags": [], @@ -177,7 +177,7 @@ "signature": [ "string" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "isRequired": true } @@ -185,7 +185,7 @@ "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.refresh", "type": "Function", "tags": [], @@ -196,13 +196,13 @@ "ShardsOperationResponseBase", ">" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "children": [], "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.index", "type": "Function", "tags": [], @@ -211,17 +211,17 @@ "signature": [ "(events: ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.EntityIterable", "text": "EntityIterable" }, " | ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.EntityIterable", "text": "EntityIterable" }, @@ -229,9 +229,9 @@ "StreamToBulkOptions", "<", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmFields", "text": "ApmFields" }, @@ -239,19 +239,19 @@ "StreamProcessor", "<", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmFields", "text": "ApmFields" }, "> | undefined) => Promise" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.index.$1", "type": "CompoundType", "tags": [], @@ -259,28 +259,28 @@ "description": [], "signature": [ { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.EntityIterable", "text": "EntityIterable" }, " | ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.EntityIterable", "text": "EntityIterable" }, "[]" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "isRequired": true }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.index.$2", "type": "Object", "tags": [], @@ -290,20 +290,20 @@ "StreamToBulkOptions", "<", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmFields", "text": "ApmFields" }, "> | undefined" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "isRequired": false }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.index.$3", "type": "Object", "tags": [], @@ -313,15 +313,15 @@ "StreamProcessor", "<", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmFields", "text": "ApmFields" }, "> | undefined" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "isRequired": false } @@ -329,7 +329,7 @@ "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.createDataStream", "type": "Function", "tags": [], @@ -340,19 +340,19 @@ "StreamAggregator", "<", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmFields", "text": "ApmFields" }, ">) => Promise" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmSynthtraceEsClient.createDataStream.$1", "type": "Object", "tags": [], @@ -362,15 +362,15 @@ "StreamAggregator", "<", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmFields", "text": "ApmFields" }, ">" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts", "deprecated": false, "isRequired": true } @@ -381,7 +381,7 @@ "initialIsOpen": false }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityArrayIterable", "type": "Class", "tags": [], @@ -389,27 +389,27 @@ "description": [], "signature": [ { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.EntityArrayIterable", "text": "EntityArrayIterable" }, " implements ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.EntityIterable", "text": "EntityIterable" }, "" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityArrayIterable.Unnamed", "type": "Function", "tags": [], @@ -418,11 +418,11 @@ "signature": [ "any" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityArrayIterable.Unnamed.$1", "type": "Array", "tags": [], @@ -431,7 +431,7 @@ "signature": [ "TFields[]" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "isRequired": true } @@ -439,7 +439,7 @@ "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityArrayIterable.order", "type": "Function", "tags": [], @@ -448,13 +448,13 @@ "signature": [ "() => \"asc\" | \"desc\"" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "children": [], "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityArrayIterable.ratePerMinute", "type": "Function", "tags": [], @@ -463,13 +463,13 @@ "signature": [ "() => number" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "children": [], "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityArrayIterable.Symbol.asyncIterator", "type": "Function", "tags": [], @@ -478,13 +478,13 @@ "signature": [ "() => AsyncIterator" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "children": [], "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityArrayIterable.Symbol.iterator", "type": "Function", "tags": [], @@ -493,13 +493,13 @@ "signature": [ "() => Iterator" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "children": [], "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityArrayIterable.merge", "type": "Function", "tags": [], @@ -508,9 +508,9 @@ "signature": [ "(...iterables: ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.EntityIterable", "text": "EntityIterable" }, @@ -518,11 +518,11 @@ "EntityStreams", "" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityArrayIterable.merge.$1", "type": "Array", "tags": [], @@ -530,15 +530,15 @@ "description": [], "signature": [ { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.EntityIterable", "text": "EntityIterable" }, "[]" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "isRequired": true } @@ -546,7 +546,7 @@ "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityArrayIterable.toArray", "type": "Function", "tags": [], @@ -555,7 +555,7 @@ "signature": [ "() => TFields[]" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "children": [], "returnComment": [] @@ -566,7 +566,7 @@ ], "functions": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.cleanWriteTargets", "type": "Function", "tags": [], @@ -577,21 +577,21 @@ "default", "; logger: { perf: (name: string, cb: () => T) => T; debug: (...args: any[]) => void; info: (...args: any[]) => void; error: (...args: any[]) => void; }; }) => Promise" ], - "path": "packages/elastic-apm-synthtrace/src/lib/utils/clean_write_targets.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/utils/clean_write_targets.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.cleanWriteTargets.$1", "type": "Object", "tags": [], "label": "{\n targets,\n client,\n logger,\n}", "description": [], - "path": "packages/elastic-apm-synthtrace/src/lib/utils/clean_write_targets.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/utils/clean_write_targets.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.cleanWriteTargets.$1.targets", "type": "Array", "tags": [], @@ -600,11 +600,11 @@ "signature": [ "string[]" ], - "path": "packages/elastic-apm-synthtrace/src/lib/utils/clean_write_targets.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/utils/clean_write_targets.ts", "deprecated": false }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.cleanWriteTargets.$1.client", "type": "Object", "tags": [], @@ -613,11 +613,11 @@ "signature": [ "default" ], - "path": "packages/elastic-apm-synthtrace/src/lib/utils/clean_write_targets.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/utils/clean_write_targets.ts", "deprecated": false }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.cleanWriteTargets.$1.logger", "type": "Object", "tags": [], @@ -626,7 +626,7 @@ "signature": [ "{ perf: (name: string, cb: () => T) => T; debug: (...args: any[]) => void; info: (...args: any[]) => void; error: (...args: any[]) => void; }" ], - "path": "packages/elastic-apm-synthtrace/src/lib/utils/clean_write_targets.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/utils/clean_write_targets.ts", "deprecated": false } ] @@ -636,7 +636,7 @@ "initialIsOpen": false }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.createLogger", "type": "Function", "tags": [], @@ -645,19 +645,19 @@ "signature": [ "(logLevel: ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.LogLevel", "text": "LogLevel" }, ") => { perf: (name: string, cb: () => T) => T; debug: (...args: any[]) => void; info: (...args: any[]) => void; error: (...args: any[]) => void; }" ], - "path": "packages/elastic-apm-synthtrace/src/lib/utils/create_logger.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/utils/create_logger.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.createLogger.$1", "type": "Enum", "tags": [], @@ -665,14 +665,14 @@ "description": [], "signature": [ { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.LogLevel", "text": "LogLevel" } ], - "path": "packages/elastic-apm-synthtrace/src/lib/utils/create_logger.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/utils/create_logger.ts", "deprecated": false, "isRequired": true } @@ -681,7 +681,7 @@ "initialIsOpen": false }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.observer", "type": "Function", "tags": [], @@ -691,14 +691,14 @@ "() => ", "Observer" ], - "path": "packages/elastic-apm-synthtrace/src/lib/agent_config/observer.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/agent_config/observer.ts", "deprecated": false, "children": [], "returnComment": [], "initialIsOpen": false }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.timerange", "type": "Function", "tags": [], @@ -708,11 +708,11 @@ "(from: number | Date, to: number | Date) => ", "Timerange" ], - "path": "packages/elastic-apm-synthtrace/src/lib/timerange.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/timerange.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.timerange.$1", "type": "CompoundType", "tags": [], @@ -721,12 +721,12 @@ "signature": [ "number | Date" ], - "path": "packages/elastic-apm-synthtrace/src/lib/timerange.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/timerange.ts", "deprecated": false, "isRequired": true }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.timerange.$2", "type": "CompoundType", "tags": [], @@ -735,7 +735,7 @@ "signature": [ "number | Date" ], - "path": "packages/elastic-apm-synthtrace/src/lib/timerange.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/timerange.ts", "deprecated": false, "isRequired": true } @@ -746,30 +746,30 @@ ], "interfaces": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmException", "type": "Interface", "tags": [], "label": "ApmException", "description": [], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/apm_fields.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/apm_fields.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmException.message", "type": "string", "tags": [], "label": "message", "description": [], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/apm_fields.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/apm_fields.ts", "deprecated": false } ], "initialIsOpen": false }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityIterable", "type": "Interface", "tags": [], @@ -777,19 +777,19 @@ "description": [], "signature": [ { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.EntityIterable", "text": "EntityIterable" }, " extends Iterable,AsyncIterable" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityIterable.order", "type": "Function", "tags": [], @@ -798,13 +798,13 @@ "signature": [ "() => \"asc\" | \"desc\"" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "children": [], "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityIterable.ratePerMinute", "type": "Function", "tags": [], @@ -813,13 +813,13 @@ "signature": [ "() => number" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "children": [], "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityIterable.toArray", "type": "Function", "tags": [], @@ -828,21 +828,21 @@ "signature": [ "() => ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmFields", "text": "ApmFields" }, "[]" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "children": [], "returnComment": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityIterable.merge", "type": "Function", "tags": [], @@ -851,9 +851,9 @@ "signature": [ "(...iterables: ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.EntityIterable", "text": "EntityIterable" }, @@ -861,11 +861,11 @@ "EntityStreams", "" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.EntityIterable.merge.$1", "type": "Array", "tags": [], @@ -873,15 +873,15 @@ "description": [], "signature": [ { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.EntityIterable", "text": "EntityIterable" }, "[]" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts", "deprecated": false, "isRequired": true } @@ -892,17 +892,17 @@ "initialIsOpen": false }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.Fields", "type": "Interface", "tags": [], "label": "Fields", "description": [], - "path": "packages/elastic-apm-synthtrace/src/lib/entity.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.Fields.timestamp", "type": "number", "tags": [], @@ -911,7 +911,7 @@ "signature": [ "number | undefined" ], - "path": "packages/elastic-apm-synthtrace/src/lib/entity.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/entity.ts", "deprecated": false } ], @@ -920,20 +920,20 @@ ], "enums": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.LogLevel", "type": "Enum", "tags": [], "label": "LogLevel", "description": [], - "path": "packages/elastic-apm-synthtrace/src/lib/utils/create_logger.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/utils/create_logger.ts", "deprecated": false, "initialIsOpen": false } ], "misc": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.ApmFields", "type": "Type", "tags": [], @@ -941,17 +941,17 @@ "description": [], "signature": [ { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.Fields", "text": "Fields" }, " & Partial<{ 'timestamp.us'?: number | undefined; 'agent.name': string; 'agent.version': string; 'container.id': string; 'ecs.version': string; 'event.outcome': string; 'event.ingested': number; 'error.id': string; 'error.exception': ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmException", "text": "ApmException" }, @@ -959,24 +959,24 @@ "Observer", "; 'parent.id': string; 'processor.event': string; 'processor.name': string; 'trace.id': string; 'transaction.name': string; 'transaction.type': string; 'transaction.id': string; 'transaction.duration.us': number; 'transaction.duration.histogram': { values: number[]; counts: number[]; }; 'transaction.sampled': true; 'service.name': string; 'service.version': string; 'service.environment': string; 'service.node.name': string; 'service.runtime.name': string; 'service.runtime.version': string; 'service.framework.name': string; 'span.id': string; 'span.name': string; 'span.type': string; 'span.subtype': string; 'span.duration.us': number; 'span.destination.service.name': string; 'span.destination.service.resource': string; 'span.destination.service.type': string; 'span.destination.service.response_time.sum.us': number; 'span.destination.service.response_time.count': number; 'span.self_time.count': number; 'span.self_time.sum.us': number; 'span.links': { trace: { id: string; }; span: { id: string; }; }[]; 'cloud.provider': string; 'cloud.project.name': string; 'cloud.service.name': string; 'cloud.availability_zone': string; 'cloud.machine.type': string; 'cloud.region': string; 'host.os.platform': string; 'faas.id': string; 'faas.coldstart': boolean; 'faas.execution': string; 'faas.trigger.type': string; 'faas.trigger.request_id': string; }> & Partial<{ 'system.process.memory.size': number; 'system.memory.actual.free': number; 'system.memory.total': number; 'system.cpu.total.norm.pct': number; 'system.process.memory.rss.bytes': number; 'system.process.cpu.total.norm.pct': number; 'jvm.memory.heap.used': number; 'jvm.memory.non_heap.used': number; 'jvm.thread.count': number; }>" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/apm_fields.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/apm_fields.ts", "deprecated": false, "initialIsOpen": false } ], "objects": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm", "type": "Object", "tags": [], "label": "apm", "description": [], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/index.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/index.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.service", "type": "Function", "tags": [], @@ -986,44 +986,44 @@ "(name: string, environment: string, agentName: string) => ", "Service" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/index.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/index.ts", "deprecated": false, "returnComment": [], "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.service.$1", "type": "string", "tags": [], "label": "name", "description": [], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/service.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/service.ts", "deprecated": false }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.service.$2", "type": "string", "tags": [], "label": "environment", "description": [], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/service.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/service.ts", "deprecated": false }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.service.$3", "type": "string", "tags": [], "label": "agentName", "description": [], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/service.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/service.ts", "deprecated": false } ] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.browser", "type": "Function", "tags": [], @@ -1033,32 +1033,32 @@ "(serviceName: string, production: string, userAgent: Partial<{ 'user_agent.original': string; 'user_agent.os.name': string; 'user_agent.name': string; 'user_agent.device.name': string; 'user_agent.version': number; }>) => ", "Browser" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/index.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/index.ts", "deprecated": false, "returnComment": [], "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.browser.$1", "type": "string", "tags": [], "label": "serviceName", "description": [], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/browser.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/browser.ts", "deprecated": false }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.browser.$2", "type": "string", "tags": [], "label": "production", "description": [], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/browser.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/browser.ts", "deprecated": false }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.browser.$3", "type": "Object", "tags": [], @@ -1067,13 +1067,13 @@ "signature": [ "{ 'user_agent.original'?: string | undefined; 'user_agent.os.name'?: string | undefined; 'user_agent.name'?: string | undefined; 'user_agent.device.name'?: string | undefined; 'user_agent.version'?: number | undefined; }" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/browser.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/browser.ts", "deprecated": false } ] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.getTransactionMetrics", "type": "Function", "tags": [], @@ -1082,17 +1082,17 @@ "signature": [ "(events: ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmFields", "text": "ApmFields" }, "[]) => { 'metricset.name': string; 'transaction.duration.histogram': { values: number[]; counts: number[]; }; _doc_count: number; '@timestamp'?: number | undefined; 'timestamp.us'?: number | undefined; 'agent.name'?: string | undefined; 'agent.version'?: string | undefined; 'container.id'?: string | undefined; 'ecs.version'?: string | undefined; 'event.outcome'?: string | undefined; 'event.ingested'?: number | undefined; 'error.id'?: string | undefined; 'error.exception'?: ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmException", "text": "ApmException" }, @@ -1100,12 +1100,12 @@ "Observer", " | undefined; 'parent.id'?: string | undefined; 'processor.event'?: string | undefined; 'processor.name'?: string | undefined; 'trace.id'?: string | undefined; 'transaction.name'?: string | undefined; 'transaction.type'?: string | undefined; 'transaction.id'?: string | undefined; 'transaction.duration.us'?: number | undefined; 'transaction.sampled'?: true | undefined; 'service.name'?: string | undefined; 'service.version'?: string | undefined; 'service.environment'?: string | undefined; 'service.node.name'?: string | undefined; 'service.runtime.name'?: string | undefined; 'service.runtime.version'?: string | undefined; 'service.framework.name'?: string | undefined; 'span.id'?: string | undefined; 'span.name'?: string | undefined; 'span.type'?: string | undefined; 'span.subtype'?: string | undefined; 'span.duration.us'?: number | undefined; 'span.destination.service.name'?: string | undefined; 'span.destination.service.resource'?: string | undefined; 'span.destination.service.type'?: string | undefined; 'span.destination.service.response_time.sum.us'?: number | undefined; 'span.destination.service.response_time.count'?: number | undefined; 'span.self_time.count'?: number | undefined; 'span.self_time.sum.us'?: number | undefined; 'span.links'?: { trace: { id: string; }; span: { id: string; }; }[] | undefined; 'cloud.provider'?: string | undefined; 'cloud.project.name'?: string | undefined; 'cloud.service.name'?: string | undefined; 'cloud.availability_zone'?: string | undefined; 'cloud.machine.type'?: string | undefined; 'cloud.region'?: string | undefined; 'host.os.platform'?: string | undefined; 'faas.id'?: string | undefined; 'faas.coldstart'?: boolean | undefined; 'faas.execution'?: string | undefined; 'faas.trigger.type'?: string | undefined; 'faas.trigger.request_id'?: string | undefined; 'system.process.memory.size'?: number | undefined; 'system.memory.actual.free'?: number | undefined; 'system.memory.total'?: number | undefined; 'system.cpu.total.norm.pct'?: number | undefined; 'system.process.memory.rss.bytes'?: number | undefined; 'system.process.cpu.total.norm.pct'?: number | undefined; 'jvm.memory.heap.used'?: number | undefined; 'jvm.memory.non_heap.used'?: number | undefined; 'jvm.thread.count'?: number | undefined; }[]" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/index.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/index.ts", "deprecated": false, "returnComment": [], "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.getTransactionMetrics.$1", "type": "Array", "tags": [], @@ -1113,21 +1113,21 @@ "description": [], "signature": [ { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmFields", "text": "ApmFields" }, "[]" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/processors/get_transaction_metrics.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/processors/get_transaction_metrics.ts", "deprecated": false } ] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.getSpanDestinationMetrics", "type": "Function", "tags": [], @@ -1136,17 +1136,17 @@ "signature": [ "(events: ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmFields", "text": "ApmFields" }, "[]) => { \"metricset.name\": string; 'span.destination.service.response_time.sum.us': number; 'span.destination.service.response_time.count': number; '@timestamp'?: number | undefined; 'timestamp.us'?: number | undefined; 'agent.name'?: string | undefined; 'agent.version'?: string | undefined; 'container.id'?: string | undefined; 'ecs.version'?: string | undefined; 'event.outcome'?: string | undefined; 'event.ingested'?: number | undefined; 'error.id'?: string | undefined; 'error.exception'?: ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmException", "text": "ApmException" }, @@ -1154,12 +1154,12 @@ "Observer", " | undefined; 'parent.id'?: string | undefined; 'processor.event'?: string | undefined; 'processor.name'?: string | undefined; 'trace.id'?: string | undefined; 'transaction.name'?: string | undefined; 'transaction.type'?: string | undefined; 'transaction.id'?: string | undefined; 'transaction.duration.us'?: number | undefined; 'transaction.duration.histogram'?: { values: number[]; counts: number[]; } | undefined; 'transaction.sampled'?: true | undefined; 'service.name'?: string | undefined; 'service.version'?: string | undefined; 'service.environment'?: string | undefined; 'service.node.name'?: string | undefined; 'service.runtime.name'?: string | undefined; 'service.runtime.version'?: string | undefined; 'service.framework.name'?: string | undefined; 'span.id'?: string | undefined; 'span.name'?: string | undefined; 'span.type'?: string | undefined; 'span.subtype'?: string | undefined; 'span.duration.us'?: number | undefined; 'span.destination.service.name'?: string | undefined; 'span.destination.service.resource'?: string | undefined; 'span.destination.service.type'?: string | undefined; 'span.self_time.count'?: number | undefined; 'span.self_time.sum.us'?: number | undefined; 'span.links'?: { trace: { id: string; }; span: { id: string; }; }[] | undefined; 'cloud.provider'?: string | undefined; 'cloud.project.name'?: string | undefined; 'cloud.service.name'?: string | undefined; 'cloud.availability_zone'?: string | undefined; 'cloud.machine.type'?: string | undefined; 'cloud.region'?: string | undefined; 'host.os.platform'?: string | undefined; 'faas.id'?: string | undefined; 'faas.coldstart'?: boolean | undefined; 'faas.execution'?: string | undefined; 'faas.trigger.type'?: string | undefined; 'faas.trigger.request_id'?: string | undefined; 'system.process.memory.size'?: number | undefined; 'system.memory.actual.free'?: number | undefined; 'system.memory.total'?: number | undefined; 'system.cpu.total.norm.pct'?: number | undefined; 'system.process.memory.rss.bytes'?: number | undefined; 'system.process.cpu.total.norm.pct'?: number | undefined; 'jvm.memory.heap.used'?: number | undefined; 'jvm.memory.non_heap.used'?: number | undefined; 'jvm.thread.count'?: number | undefined; }[]" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/index.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/index.ts", "deprecated": false, "returnComment": [], "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.getSpanDestinationMetrics.$1", "type": "Array", "tags": [], @@ -1167,21 +1167,21 @@ "description": [], "signature": [ { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmFields", "text": "ApmFields" }, "[]" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/processors/get_span_destination_metrics.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/processors/get_span_destination_metrics.ts", "deprecated": false } ] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.getChromeUserAgentDefaults", "type": "Function", "tags": [], @@ -1190,13 +1190,13 @@ "signature": [ "() => Partial<{ 'user_agent.original': string; 'user_agent.os.name': string; 'user_agent.name': string; 'user_agent.device.name': string; 'user_agent.version': number; }>" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/index.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/index.ts", "deprecated": false, "returnComment": [], "children": [] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.getBreakdownMetrics", "type": "Function", "tags": [], @@ -1205,28 +1205,28 @@ "signature": [ "(events: ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmFields", "text": "ApmFields" }, "[]) => ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmFields", "text": "ApmFields" }, "[]" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/index.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/index.ts", "deprecated": false, "returnComment": [], "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.getBreakdownMetrics.$1", "type": "Array", "tags": [], @@ -1234,21 +1234,21 @@ "description": [], "signature": [ { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmFields", "text": "ApmFields" }, "[]" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/processors/get_breakdown_metrics.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/processors/get_breakdown_metrics.ts", "deprecated": false } ] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.getApmWriteTargets", "type": "Function", "tags": [], @@ -1261,12 +1261,12 @@ "ApmElasticsearchOutputWriteTargets", ">" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/index.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/index.ts", "deprecated": false, "returnComment": [], "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.getApmWriteTargets.$1", "type": "Object", "tags": [], @@ -1277,13 +1277,13 @@ "default", "; forceLegacyIndices?: boolean | undefined; }" ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/utils/get_apm_write_targets.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/utils/get_apm_write_targets.ts", "deprecated": false } ] }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.apm.ApmSynthtraceEsClient", "type": "Object", "tags": [], @@ -1292,31 +1292,31 @@ "signature": [ "typeof ", { - "pluginId": "@elastic/apm-synthtrace", + "pluginId": "@kbn/apm-synthtrace", "scope": "server", - "docId": "kibElasticApmSynthtracePluginApi", + "docId": "kibKbnApmSynthtracePluginApi", "section": "def-server.ApmSynthtraceEsClient", "text": "ApmSynthtraceEsClient" } ], - "path": "packages/elastic-apm-synthtrace/src/lib/apm/index.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/apm/index.ts", "deprecated": false } ], "initialIsOpen": false }, { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.stackMonitoring", "type": "Object", "tags": [], "label": "stackMonitoring", "description": [], - "path": "packages/elastic-apm-synthtrace/src/lib/stack_monitoring/index.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/stack_monitoring/index.ts", "deprecated": false, "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.stackMonitoring.cluster", "type": "Function", "tags": [], @@ -1326,18 +1326,18 @@ "(name: string) => ", "Cluster" ], - "path": "packages/elastic-apm-synthtrace/src/lib/stack_monitoring/index.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/stack_monitoring/index.ts", "deprecated": false, "returnComment": [], "children": [ { - "parentPluginId": "@elastic/apm-synthtrace", + "parentPluginId": "@kbn/apm-synthtrace", "id": "def-server.stackMonitoring.cluster.$1", "type": "string", "tags": [], "label": "name", "description": [], - "path": "packages/elastic-apm-synthtrace/src/lib/stack_monitoring/cluster.ts", + "path": "packages/kbn-apm-synthtrace/src/lib/stack_monitoring/cluster.ts", "deprecated": false } ] diff --git a/api_docs/kbn_apm_synthtrace.mdx b/api_docs/kbn_apm_synthtrace.mdx new file mode 100644 index 0000000000000..48c281f3209f0 --- /dev/null +++ b/api_docs/kbn_apm_synthtrace.mdx @@ -0,0 +1,45 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnApmSynthtracePluginApi +slug: /kibana-dev-docs/api/kbn-apm-synthtrace +title: "@kbn/apm-synthtrace" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/apm-synthtrace plugin +date: 2022-08-22 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-synthtrace'] +--- +import kbnApmSynthtraceObj from './kbn_apm_synthtrace.devdocs.json'; + +Elastic APM trace data generator + +Contact [Owner missing] for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 74 | 0 | 74 | 11 | + +## Server + +### Objects + + +### Functions + + +### Classes + + +### Interfaces + + +### Enums + + +### Consts, variables and types + + diff --git a/api_docs/kbn_apm_utils.mdx b/api_docs/kbn_apm_utils.mdx index bc47cd4d28f90..a14331bc7ab0d 100644 --- a/api_docs/kbn_apm_utils.mdx +++ b/api_docs/kbn_apm_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-utils title: "@kbn/apm-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-utils plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-utils'] --- import kbnApmUtilsObj from './kbn_apm_utils.devdocs.json'; diff --git a/api_docs/kbn_axe_config.mdx b/api_docs/kbn_axe_config.mdx index e9b647c4b14ca..fcf90f98d9f78 100644 --- a/api_docs/kbn_axe_config.mdx +++ b/api_docs/kbn_axe_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-axe-config title: "@kbn/axe-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/axe-config plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/axe-config'] --- import kbnAxeConfigObj from './kbn_axe_config.devdocs.json'; diff --git a/api_docs/kbn_bazel_packages.mdx b/api_docs/kbn_bazel_packages.mdx index 9290085ef03b2..30f02e6901cc4 100644 --- a/api_docs/kbn_bazel_packages.mdx +++ b/api_docs/kbn_bazel_packages.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-bazel-packages title: "@kbn/bazel-packages" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/bazel-packages plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/bazel-packages'] --- import kbnBazelPackagesObj from './kbn_bazel_packages.devdocs.json'; diff --git a/api_docs/kbn_chart_icons.mdx b/api_docs/kbn_chart_icons.mdx index c50bef60ef8ba..e15c84c31c26d 100644 --- a/api_docs/kbn_chart_icons.mdx +++ b/api_docs/kbn_chart_icons.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-chart-icons title: "@kbn/chart-icons" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/chart-icons plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/chart-icons'] --- import kbnChartIconsObj from './kbn_chart_icons.devdocs.json'; diff --git a/api_docs/kbn_ci_stats_core.mdx b/api_docs/kbn_ci_stats_core.mdx index dde1bcaa9dee9..254809a6d1f7d 100644 --- a/api_docs/kbn_ci_stats_core.mdx +++ b/api_docs/kbn_ci_stats_core.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-core title: "@kbn/ci-stats-core" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ci-stats-core plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ci-stats-core'] --- import kbnCiStatsCoreObj from './kbn_ci_stats_core.devdocs.json'; diff --git a/api_docs/kbn_ci_stats_performance_metrics.mdx b/api_docs/kbn_ci_stats_performance_metrics.mdx index b7b59159634c2..cfac6e2bbac2a 100644 --- a/api_docs/kbn_ci_stats_performance_metrics.mdx +++ b/api_docs/kbn_ci_stats_performance_metrics.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-performance-metrics title: "@kbn/ci-stats-performance-metrics" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ci-stats-performance-metrics plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ci-stats-performance-metrics'] --- import kbnCiStatsPerformanceMetricsObj from './kbn_ci_stats_performance_metrics.devdocs.json'; diff --git a/api_docs/kbn_ci_stats_reporter.mdx b/api_docs/kbn_ci_stats_reporter.mdx index d9bfb8667b2a6..3eac48be7b0df 100644 --- a/api_docs/kbn_ci_stats_reporter.mdx +++ b/api_docs/kbn_ci_stats_reporter.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-reporter title: "@kbn/ci-stats-reporter" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ci-stats-reporter plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ci-stats-reporter'] --- import kbnCiStatsReporterObj from './kbn_ci_stats_reporter.devdocs.json'; diff --git a/api_docs/kbn_cli_dev_mode.mdx b/api_docs/kbn_cli_dev_mode.mdx index d51e3700d16aa..4e660d395d984 100644 --- a/api_docs/kbn_cli_dev_mode.mdx +++ b/api_docs/kbn_cli_dev_mode.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cli-dev-mode title: "@kbn/cli-dev-mode" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cli-dev-mode plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cli-dev-mode'] --- import kbnCliDevModeObj from './kbn_cli_dev_mode.devdocs.json'; diff --git a/api_docs/kbn_coloring.mdx b/api_docs/kbn_coloring.mdx index 7705a2cf7972d..c552d7cdb70ee 100644 --- a/api_docs/kbn_coloring.mdx +++ b/api_docs/kbn_coloring.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-coloring title: "@kbn/coloring" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/coloring plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/coloring'] --- import kbnColoringObj from './kbn_coloring.devdocs.json'; diff --git a/api_docs/kbn_config.mdx b/api_docs/kbn_config.mdx index f39b8e20075f6..2923881891db8 100644 --- a/api_docs/kbn_config.mdx +++ b/api_docs/kbn_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-config title: "@kbn/config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/config plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config'] --- import kbnConfigObj from './kbn_config.devdocs.json'; diff --git a/api_docs/kbn_config_mocks.mdx b/api_docs/kbn_config_mocks.mdx index b6ee6ead75a68..d5e4ce5113fbc 100644 --- a/api_docs/kbn_config_mocks.mdx +++ b/api_docs/kbn_config_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-config-mocks title: "@kbn/config-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/config-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config-mocks'] --- import kbnConfigMocksObj from './kbn_config_mocks.devdocs.json'; diff --git a/api_docs/kbn_config_schema.mdx b/api_docs/kbn_config_schema.mdx index c4ae0af7c4f81..a5967a1b0201c 100644 --- a/api_docs/kbn_config_schema.mdx +++ b/api_docs/kbn_config_schema.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-config-schema title: "@kbn/config-schema" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/config-schema plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config-schema'] --- import kbnConfigSchemaObj from './kbn_config_schema.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_browser.mdx b/api_docs/kbn_core_analytics_browser.mdx index 5f6f01e888195..99a3e55b8e2e9 100644 --- a/api_docs/kbn_core_analytics_browser.mdx +++ b/api_docs/kbn_core_analytics_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser title: "@kbn/core-analytics-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-browser plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser'] --- import kbnCoreAnalyticsBrowserObj from './kbn_core_analytics_browser.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_browser_internal.mdx b/api_docs/kbn_core_analytics_browser_internal.mdx index f2498bc39e07b..7a8c720617f59 100644 --- a/api_docs/kbn_core_analytics_browser_internal.mdx +++ b/api_docs/kbn_core_analytics_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser-internal title: "@kbn/core-analytics-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-browser-internal plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser-internal'] --- import kbnCoreAnalyticsBrowserInternalObj from './kbn_core_analytics_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_browser_mocks.mdx b/api_docs/kbn_core_analytics_browser_mocks.mdx index 61425d9dca3fc..745799822d5fa 100644 --- a/api_docs/kbn_core_analytics_browser_mocks.mdx +++ b/api_docs/kbn_core_analytics_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser-mocks title: "@kbn/core-analytics-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-browser-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser-mocks'] --- import kbnCoreAnalyticsBrowserMocksObj from './kbn_core_analytics_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_server.mdx b/api_docs/kbn_core_analytics_server.mdx index 2f112706584ff..f36509f058ed9 100644 --- a/api_docs/kbn_core_analytics_server.mdx +++ b/api_docs/kbn_core_analytics_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server title: "@kbn/core-analytics-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-server plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server'] --- import kbnCoreAnalyticsServerObj from './kbn_core_analytics_server.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_server_internal.mdx b/api_docs/kbn_core_analytics_server_internal.mdx index c87d439806803..7df3a89fc7b8b 100644 --- a/api_docs/kbn_core_analytics_server_internal.mdx +++ b/api_docs/kbn_core_analytics_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server-internal title: "@kbn/core-analytics-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-server-internal plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server-internal'] --- import kbnCoreAnalyticsServerInternalObj from './kbn_core_analytics_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_server_mocks.mdx b/api_docs/kbn_core_analytics_server_mocks.mdx index e301ffa8f211f..664a3112a93aa 100644 --- a/api_docs/kbn_core_analytics_server_mocks.mdx +++ b/api_docs/kbn_core_analytics_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server-mocks title: "@kbn/core-analytics-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-server-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server-mocks'] --- import kbnCoreAnalyticsServerMocksObj from './kbn_core_analytics_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_base_browser_mocks.mdx b/api_docs/kbn_core_base_browser_mocks.mdx index ddc62c4071e39..0403ecfd608b0 100644 --- a/api_docs/kbn_core_base_browser_mocks.mdx +++ b/api_docs/kbn_core_base_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-browser-mocks title: "@kbn/core-base-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-browser-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-browser-mocks'] --- import kbnCoreBaseBrowserMocksObj from './kbn_core_base_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_base_common.mdx b/api_docs/kbn_core_base_common.mdx index a5f81385f4727..a834fb3bbdecd 100644 --- a/api_docs/kbn_core_base_common.mdx +++ b/api_docs/kbn_core_base_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-common title: "@kbn/core-base-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-common plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-common'] --- import kbnCoreBaseCommonObj from './kbn_core_base_common.devdocs.json'; diff --git a/api_docs/kbn_core_base_server_internal.mdx b/api_docs/kbn_core_base_server_internal.mdx index 20d2872052992..460b2eb0e2ad6 100644 --- a/api_docs/kbn_core_base_server_internal.mdx +++ b/api_docs/kbn_core_base_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-server-internal title: "@kbn/core-base-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-server-internal plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-server-internal'] --- import kbnCoreBaseServerInternalObj from './kbn_core_base_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_base_server_mocks.mdx b/api_docs/kbn_core_base_server_mocks.mdx index e101e6a86dfdb..62b7be0845220 100644 --- a/api_docs/kbn_core_base_server_mocks.mdx +++ b/api_docs/kbn_core_base_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-server-mocks title: "@kbn/core-base-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-server-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-server-mocks'] --- import kbnCoreBaseServerMocksObj from './kbn_core_base_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_common.mdx b/api_docs/kbn_core_capabilities_common.mdx index 1f81aa2d10cb5..88ec128e46195 100644 --- a/api_docs/kbn_core_capabilities_common.mdx +++ b/api_docs/kbn_core_capabilities_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-common title: "@kbn/core-capabilities-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-common plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-common'] --- import kbnCoreCapabilitiesCommonObj from './kbn_core_capabilities_common.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_server.mdx b/api_docs/kbn_core_capabilities_server.mdx index bed55a52ebec9..74a48d0ebd92a 100644 --- a/api_docs/kbn_core_capabilities_server.mdx +++ b/api_docs/kbn_core_capabilities_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-server title: "@kbn/core-capabilities-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-server plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-server'] --- import kbnCoreCapabilitiesServerObj from './kbn_core_capabilities_server.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_server_mocks.mdx b/api_docs/kbn_core_capabilities_server_mocks.mdx index 225de5c88817e..3d3754ac5e20d 100644 --- a/api_docs/kbn_core_capabilities_server_mocks.mdx +++ b/api_docs/kbn_core_capabilities_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-server-mocks title: "@kbn/core-capabilities-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-server-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-server-mocks'] --- import kbnCoreCapabilitiesServerMocksObj from './kbn_core_capabilities_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_config_server_internal.mdx b/api_docs/kbn_core_config_server_internal.mdx index 8d66574809afc..5a951169615a3 100644 --- a/api_docs/kbn_core_config_server_internal.mdx +++ b/api_docs/kbn_core_config_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-config-server-internal title: "@kbn/core-config-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-config-server-internal plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-config-server-internal'] --- import kbnCoreConfigServerInternalObj from './kbn_core_config_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_browser.mdx b/api_docs/kbn_core_deprecations_browser.mdx index 586f218db8cb2..5fd78381685ec 100644 --- a/api_docs/kbn_core_deprecations_browser.mdx +++ b/api_docs/kbn_core_deprecations_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-browser title: "@kbn/core-deprecations-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-browser plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-browser'] --- import kbnCoreDeprecationsBrowserObj from './kbn_core_deprecations_browser.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_browser_internal.mdx b/api_docs/kbn_core_deprecations_browser_internal.mdx index c2070bd69783c..a723eb168b4c0 100644 --- a/api_docs/kbn_core_deprecations_browser_internal.mdx +++ b/api_docs/kbn_core_deprecations_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-browser-internal title: "@kbn/core-deprecations-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-browser-internal plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-browser-internal'] --- import kbnCoreDeprecationsBrowserInternalObj from './kbn_core_deprecations_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_browser_mocks.mdx b/api_docs/kbn_core_deprecations_browser_mocks.mdx index c33996b0cd08c..fefd13b56b777 100644 --- a/api_docs/kbn_core_deprecations_browser_mocks.mdx +++ b/api_docs/kbn_core_deprecations_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-browser-mocks title: "@kbn/core-deprecations-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-browser-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-browser-mocks'] --- import kbnCoreDeprecationsBrowserMocksObj from './kbn_core_deprecations_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_common.mdx b/api_docs/kbn_core_deprecations_common.mdx index ca14a3ee03531..dabd876b8a02c 100644 --- a/api_docs/kbn_core_deprecations_common.mdx +++ b/api_docs/kbn_core_deprecations_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-common title: "@kbn/core-deprecations-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-common plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-common'] --- import kbnCoreDeprecationsCommonObj from './kbn_core_deprecations_common.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_browser.mdx b/api_docs/kbn_core_doc_links_browser.mdx index 633572d172590..fd587ebcf9743 100644 --- a/api_docs/kbn_core_doc_links_browser.mdx +++ b/api_docs/kbn_core_doc_links_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-browser title: "@kbn/core-doc-links-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-browser plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-browser'] --- import kbnCoreDocLinksBrowserObj from './kbn_core_doc_links_browser.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_browser_mocks.mdx b/api_docs/kbn_core_doc_links_browser_mocks.mdx index 35bbc3ea97f00..fc126aa7d7dde 100644 --- a/api_docs/kbn_core_doc_links_browser_mocks.mdx +++ b/api_docs/kbn_core_doc_links_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-browser-mocks title: "@kbn/core-doc-links-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-browser-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-browser-mocks'] --- import kbnCoreDocLinksBrowserMocksObj from './kbn_core_doc_links_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_server.mdx b/api_docs/kbn_core_doc_links_server.mdx index 31017f33339e8..1f95047b4792b 100644 --- a/api_docs/kbn_core_doc_links_server.mdx +++ b/api_docs/kbn_core_doc_links_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-server title: "@kbn/core-doc-links-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-server plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-server'] --- import kbnCoreDocLinksServerObj from './kbn_core_doc_links_server.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_server_mocks.mdx b/api_docs/kbn_core_doc_links_server_mocks.mdx index 45b359195c1ad..18b28851864c1 100644 --- a/api_docs/kbn_core_doc_links_server_mocks.mdx +++ b/api_docs/kbn_core_doc_links_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-server-mocks title: "@kbn/core-doc-links-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-server-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-server-mocks'] --- import kbnCoreDocLinksServerMocksObj from './kbn_core_doc_links_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_client_server_internal.mdx b/api_docs/kbn_core_elasticsearch_client_server_internal.mdx index 3c07c5a4b319f..e81db294cca91 100644 --- a/api_docs/kbn_core_elasticsearch_client_server_internal.mdx +++ b/api_docs/kbn_core_elasticsearch_client_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-client-server-internal title: "@kbn/core-elasticsearch-client-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-client-server-internal plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-client-server-internal'] --- import kbnCoreElasticsearchClientServerInternalObj from './kbn_core_elasticsearch_client_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx b/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx index 1ec4cd545d56b..a90f68dc84f87 100644 --- a/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx +++ b/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-client-server-mocks title: "@kbn/core-elasticsearch-client-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-client-server-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-client-server-mocks'] --- import kbnCoreElasticsearchClientServerMocksObj from './kbn_core_elasticsearch_client_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_server.mdx b/api_docs/kbn_core_elasticsearch_server.mdx index 3afc9a04c8629..09a5dfa1860ff 100644 --- a/api_docs/kbn_core_elasticsearch_server.mdx +++ b/api_docs/kbn_core_elasticsearch_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-server title: "@kbn/core-elasticsearch-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-server plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-server'] --- import kbnCoreElasticsearchServerObj from './kbn_core_elasticsearch_server.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_server_internal.mdx b/api_docs/kbn_core_elasticsearch_server_internal.mdx index 39dcd4303d4d7..0a45d168e696f 100644 --- a/api_docs/kbn_core_elasticsearch_server_internal.mdx +++ b/api_docs/kbn_core_elasticsearch_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-server-internal title: "@kbn/core-elasticsearch-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-server-internal plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-server-internal'] --- import kbnCoreElasticsearchServerInternalObj from './kbn_core_elasticsearch_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_server_mocks.mdx b/api_docs/kbn_core_elasticsearch_server_mocks.mdx index 774053af02777..86b8bc9c13b41 100644 --- a/api_docs/kbn_core_elasticsearch_server_mocks.mdx +++ b/api_docs/kbn_core_elasticsearch_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-server-mocks title: "@kbn/core-elasticsearch-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-server-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-server-mocks'] --- import kbnCoreElasticsearchServerMocksObj from './kbn_core_elasticsearch_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_environment_server_internal.mdx b/api_docs/kbn_core_environment_server_internal.mdx index 7240e5abd4245..c536f9c5ea0ba 100644 --- a/api_docs/kbn_core_environment_server_internal.mdx +++ b/api_docs/kbn_core_environment_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-environment-server-internal title: "@kbn/core-environment-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-environment-server-internal plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-environment-server-internal'] --- import kbnCoreEnvironmentServerInternalObj from './kbn_core_environment_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_environment_server_mocks.mdx b/api_docs/kbn_core_environment_server_mocks.mdx index 87bc881350ed0..b94917f722255 100644 --- a/api_docs/kbn_core_environment_server_mocks.mdx +++ b/api_docs/kbn_core_environment_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-environment-server-mocks title: "@kbn/core-environment-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-environment-server-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-environment-server-mocks'] --- import kbnCoreEnvironmentServerMocksObj from './kbn_core_environment_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_browser.mdx b/api_docs/kbn_core_execution_context_browser.mdx index 583d395d07768..e1d30875f4d61 100644 --- a/api_docs/kbn_core_execution_context_browser.mdx +++ b/api_docs/kbn_core_execution_context_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-browser title: "@kbn/core-execution-context-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-browser plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-browser'] --- import kbnCoreExecutionContextBrowserObj from './kbn_core_execution_context_browser.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_browser_internal.mdx b/api_docs/kbn_core_execution_context_browser_internal.mdx index 2c3098e588910..df721518ade4e 100644 --- a/api_docs/kbn_core_execution_context_browser_internal.mdx +++ b/api_docs/kbn_core_execution_context_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-browser-internal title: "@kbn/core-execution-context-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-browser-internal plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-browser-internal'] --- import kbnCoreExecutionContextBrowserInternalObj from './kbn_core_execution_context_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_browser_mocks.mdx b/api_docs/kbn_core_execution_context_browser_mocks.mdx index 04d7dd0c8c613..29f6e5f423f89 100644 --- a/api_docs/kbn_core_execution_context_browser_mocks.mdx +++ b/api_docs/kbn_core_execution_context_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-browser-mocks title: "@kbn/core-execution-context-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-browser-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-browser-mocks'] --- import kbnCoreExecutionContextBrowserMocksObj from './kbn_core_execution_context_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_common.mdx b/api_docs/kbn_core_execution_context_common.mdx index 7e019164ad89b..b81f424104cdf 100644 --- a/api_docs/kbn_core_execution_context_common.mdx +++ b/api_docs/kbn_core_execution_context_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-common title: "@kbn/core-execution-context-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-common plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-common'] --- import kbnCoreExecutionContextCommonObj from './kbn_core_execution_context_common.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_server.mdx b/api_docs/kbn_core_execution_context_server.mdx index f5049184de13b..d566a343d7593 100644 --- a/api_docs/kbn_core_execution_context_server.mdx +++ b/api_docs/kbn_core_execution_context_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-server title: "@kbn/core-execution-context-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-server plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-server'] --- import kbnCoreExecutionContextServerObj from './kbn_core_execution_context_server.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_server_internal.mdx b/api_docs/kbn_core_execution_context_server_internal.mdx index 0c75bf83ccdf7..18b7e18629e39 100644 --- a/api_docs/kbn_core_execution_context_server_internal.mdx +++ b/api_docs/kbn_core_execution_context_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-server-internal title: "@kbn/core-execution-context-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-server-internal plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-server-internal'] --- import kbnCoreExecutionContextServerInternalObj from './kbn_core_execution_context_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_server_mocks.mdx b/api_docs/kbn_core_execution_context_server_mocks.mdx index ab041fb4d9c6f..d6692a43a46c9 100644 --- a/api_docs/kbn_core_execution_context_server_mocks.mdx +++ b/api_docs/kbn_core_execution_context_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-server-mocks title: "@kbn/core-execution-context-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-server-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-server-mocks'] --- import kbnCoreExecutionContextServerMocksObj from './kbn_core_execution_context_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_fatal_errors_browser.mdx b/api_docs/kbn_core_fatal_errors_browser.mdx index 8e1ec0f65a923..d08d70027d79f 100644 --- a/api_docs/kbn_core_fatal_errors_browser.mdx +++ b/api_docs/kbn_core_fatal_errors_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-fatal-errors-browser title: "@kbn/core-fatal-errors-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-fatal-errors-browser plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-fatal-errors-browser'] --- import kbnCoreFatalErrorsBrowserObj from './kbn_core_fatal_errors_browser.devdocs.json'; diff --git a/api_docs/kbn_core_fatal_errors_browser_mocks.mdx b/api_docs/kbn_core_fatal_errors_browser_mocks.mdx index 7e5e287bbaaea..9a0599f073e53 100644 --- a/api_docs/kbn_core_fatal_errors_browser_mocks.mdx +++ b/api_docs/kbn_core_fatal_errors_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-fatal-errors-browser-mocks title: "@kbn/core-fatal-errors-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-fatal-errors-browser-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-fatal-errors-browser-mocks'] --- import kbnCoreFatalErrorsBrowserMocksObj from './kbn_core_fatal_errors_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_browser.mdx b/api_docs/kbn_core_http_browser.mdx index e554e7b5e6bb6..ae80c851095d9 100644 --- a/api_docs/kbn_core_http_browser.mdx +++ b/api_docs/kbn_core_http_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser title: "@kbn/core-http-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-browser plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser'] --- import kbnCoreHttpBrowserObj from './kbn_core_http_browser.devdocs.json'; diff --git a/api_docs/kbn_core_http_browser_internal.mdx b/api_docs/kbn_core_http_browser_internal.mdx index 7584e0edc1dfd..ee67080afb77f 100644 --- a/api_docs/kbn_core_http_browser_internal.mdx +++ b/api_docs/kbn_core_http_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser-internal title: "@kbn/core-http-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-browser-internal plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser-internal'] --- import kbnCoreHttpBrowserInternalObj from './kbn_core_http_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_browser_mocks.mdx b/api_docs/kbn_core_http_browser_mocks.mdx index daf6547d14761..1c5e6894a840f 100644 --- a/api_docs/kbn_core_http_browser_mocks.mdx +++ b/api_docs/kbn_core_http_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser-mocks title: "@kbn/core-http-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-browser-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser-mocks'] --- import kbnCoreHttpBrowserMocksObj from './kbn_core_http_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_common.mdx b/api_docs/kbn_core_http_common.mdx index f43008bd1de28..5f4c6227e0c45 100644 --- a/api_docs/kbn_core_http_common.mdx +++ b/api_docs/kbn_core_http_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-common title: "@kbn/core-http-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-common plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-common'] --- import kbnCoreHttpCommonObj from './kbn_core_http_common.devdocs.json'; diff --git a/api_docs/kbn_core_http_context_server_mocks.mdx b/api_docs/kbn_core_http_context_server_mocks.mdx index 9fa36dedf7330..0149e5a1ef736 100644 --- a/api_docs/kbn_core_http_context_server_mocks.mdx +++ b/api_docs/kbn_core_http_context_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-context-server-mocks title: "@kbn/core-http-context-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-context-server-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-context-server-mocks'] --- import kbnCoreHttpContextServerMocksObj from './kbn_core_http_context_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_router_server_internal.mdx b/api_docs/kbn_core_http_router_server_internal.mdx index b4a2ba93627b5..0c0189dec35c2 100644 --- a/api_docs/kbn_core_http_router_server_internal.mdx +++ b/api_docs/kbn_core_http_router_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-router-server-internal title: "@kbn/core-http-router-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-router-server-internal plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-router-server-internal'] --- import kbnCoreHttpRouterServerInternalObj from './kbn_core_http_router_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_router_server_mocks.mdx b/api_docs/kbn_core_http_router_server_mocks.mdx index 6cb7f42149ad2..13f6a86caed93 100644 --- a/api_docs/kbn_core_http_router_server_mocks.mdx +++ b/api_docs/kbn_core_http_router_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-router-server-mocks title: "@kbn/core-http-router-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-router-server-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-router-server-mocks'] --- import kbnCoreHttpRouterServerMocksObj from './kbn_core_http_router_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_server.mdx b/api_docs/kbn_core_http_server.mdx index 4ab4d705475c4..0bb31ce2eecea 100644 --- a/api_docs/kbn_core_http_server.mdx +++ b/api_docs/kbn_core_http_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server title: "@kbn/core-http-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-server plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server'] --- import kbnCoreHttpServerObj from './kbn_core_http_server.devdocs.json'; diff --git a/api_docs/kbn_core_http_server_internal.mdx b/api_docs/kbn_core_http_server_internal.mdx index 7466d3c931bf7..19418ae307e27 100644 --- a/api_docs/kbn_core_http_server_internal.mdx +++ b/api_docs/kbn_core_http_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server-internal title: "@kbn/core-http-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-server-internal plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server-internal'] --- import kbnCoreHttpServerInternalObj from './kbn_core_http_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_server_mocks.mdx b/api_docs/kbn_core_http_server_mocks.mdx index 5244d5c49974c..0ad1c9167d6d0 100644 --- a/api_docs/kbn_core_http_server_mocks.mdx +++ b/api_docs/kbn_core_http_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server-mocks title: "@kbn/core-http-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-server-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server-mocks'] --- import kbnCoreHttpServerMocksObj from './kbn_core_http_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_browser.mdx b/api_docs/kbn_core_i18n_browser.mdx index 90e96c6c118d8..4f748bb1eb1b4 100644 --- a/api_docs/kbn_core_i18n_browser.mdx +++ b/api_docs/kbn_core_i18n_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-browser title: "@kbn/core-i18n-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-browser plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-browser'] --- import kbnCoreI18nBrowserObj from './kbn_core_i18n_browser.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_browser_mocks.mdx b/api_docs/kbn_core_i18n_browser_mocks.mdx index 2e4ef5b542f67..47693b62e96aa 100644 --- a/api_docs/kbn_core_i18n_browser_mocks.mdx +++ b/api_docs/kbn_core_i18n_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-browser-mocks title: "@kbn/core-i18n-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-browser-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-browser-mocks'] --- import kbnCoreI18nBrowserMocksObj from './kbn_core_i18n_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_injected_metadata_browser.mdx b/api_docs/kbn_core_injected_metadata_browser.mdx index 212902d7e4e7e..00954b3bb5b9f 100644 --- a/api_docs/kbn_core_injected_metadata_browser.mdx +++ b/api_docs/kbn_core_injected_metadata_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-injected-metadata-browser title: "@kbn/core-injected-metadata-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-injected-metadata-browser plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-injected-metadata-browser'] --- import kbnCoreInjectedMetadataBrowserObj from './kbn_core_injected_metadata_browser.devdocs.json'; diff --git a/api_docs/kbn_core_injected_metadata_browser_mocks.mdx b/api_docs/kbn_core_injected_metadata_browser_mocks.mdx index 38915a3a459f3..7561f8d543fba 100644 --- a/api_docs/kbn_core_injected_metadata_browser_mocks.mdx +++ b/api_docs/kbn_core_injected_metadata_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-injected-metadata-browser-mocks title: "@kbn/core-injected-metadata-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-injected-metadata-browser-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-injected-metadata-browser-mocks'] --- import kbnCoreInjectedMetadataBrowserMocksObj from './kbn_core_injected_metadata_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_integrations_browser_internal.mdx b/api_docs/kbn_core_integrations_browser_internal.mdx index 0eedb643ab42f..7f578f29af98f 100644 --- a/api_docs/kbn_core_integrations_browser_internal.mdx +++ b/api_docs/kbn_core_integrations_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-integrations-browser-internal title: "@kbn/core-integrations-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-integrations-browser-internal plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-integrations-browser-internal'] --- import kbnCoreIntegrationsBrowserInternalObj from './kbn_core_integrations_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_integrations_browser_mocks.mdx b/api_docs/kbn_core_integrations_browser_mocks.mdx index b9b0844ea2371..6ed8ee5e8fc1b 100644 --- a/api_docs/kbn_core_integrations_browser_mocks.mdx +++ b/api_docs/kbn_core_integrations_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-integrations-browser-mocks title: "@kbn/core-integrations-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-integrations-browser-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-integrations-browser-mocks'] --- import kbnCoreIntegrationsBrowserMocksObj from './kbn_core_integrations_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_logging_server.mdx b/api_docs/kbn_core_logging_server.mdx index df61fe79dc1fd..d8218355ffb2a 100644 --- a/api_docs/kbn_core_logging_server.mdx +++ b/api_docs/kbn_core_logging_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server title: "@kbn/core-logging-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-server plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server'] --- import kbnCoreLoggingServerObj from './kbn_core_logging_server.devdocs.json'; diff --git a/api_docs/kbn_core_logging_server_internal.mdx b/api_docs/kbn_core_logging_server_internal.mdx index fad2de8fab367..4de18c9ad80bf 100644 --- a/api_docs/kbn_core_logging_server_internal.mdx +++ b/api_docs/kbn_core_logging_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server-internal title: "@kbn/core-logging-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-server-internal plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server-internal'] --- import kbnCoreLoggingServerInternalObj from './kbn_core_logging_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_logging_server_mocks.mdx b/api_docs/kbn_core_logging_server_mocks.mdx index 20caac82f206c..7888fbe99e446 100644 --- a/api_docs/kbn_core_logging_server_mocks.mdx +++ b/api_docs/kbn_core_logging_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server-mocks title: "@kbn/core-logging-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-server-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server-mocks'] --- import kbnCoreLoggingServerMocksObj from './kbn_core_logging_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_collectors_server_internal.mdx b/api_docs/kbn_core_metrics_collectors_server_internal.mdx index 49108ef5e2a0a..e02038e325924 100644 --- a/api_docs/kbn_core_metrics_collectors_server_internal.mdx +++ b/api_docs/kbn_core_metrics_collectors_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-collectors-server-internal title: "@kbn/core-metrics-collectors-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-collectors-server-internal plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-collectors-server-internal'] --- import kbnCoreMetricsCollectorsServerInternalObj from './kbn_core_metrics_collectors_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_collectors_server_mocks.mdx b/api_docs/kbn_core_metrics_collectors_server_mocks.mdx index e4b5d67a6ad1a..8678aaced144c 100644 --- a/api_docs/kbn_core_metrics_collectors_server_mocks.mdx +++ b/api_docs/kbn_core_metrics_collectors_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-collectors-server-mocks title: "@kbn/core-metrics-collectors-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-collectors-server-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-collectors-server-mocks'] --- import kbnCoreMetricsCollectorsServerMocksObj from './kbn_core_metrics_collectors_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_server.mdx b/api_docs/kbn_core_metrics_server.mdx index 34ebadec44071..9ed3a21ad56a4 100644 --- a/api_docs/kbn_core_metrics_server.mdx +++ b/api_docs/kbn_core_metrics_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-server title: "@kbn/core-metrics-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-server plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-server'] --- import kbnCoreMetricsServerObj from './kbn_core_metrics_server.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_server_internal.mdx b/api_docs/kbn_core_metrics_server_internal.mdx index 14eda75024241..9cbafa5d52179 100644 --- a/api_docs/kbn_core_metrics_server_internal.mdx +++ b/api_docs/kbn_core_metrics_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-server-internal title: "@kbn/core-metrics-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-server-internal plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-server-internal'] --- import kbnCoreMetricsServerInternalObj from './kbn_core_metrics_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_server_mocks.mdx b/api_docs/kbn_core_metrics_server_mocks.mdx index bd4d83dc07934..abe7d0b334d8c 100644 --- a/api_docs/kbn_core_metrics_server_mocks.mdx +++ b/api_docs/kbn_core_metrics_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-server-mocks title: "@kbn/core-metrics-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-server-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-server-mocks'] --- import kbnCoreMetricsServerMocksObj from './kbn_core_metrics_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_mount_utils_browser.mdx b/api_docs/kbn_core_mount_utils_browser.mdx index c857da0442363..f1f8727b9eee7 100644 --- a/api_docs/kbn_core_mount_utils_browser.mdx +++ b/api_docs/kbn_core_mount_utils_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-mount-utils-browser title: "@kbn/core-mount-utils-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-mount-utils-browser plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-mount-utils-browser'] --- import kbnCoreMountUtilsBrowserObj from './kbn_core_mount_utils_browser.devdocs.json'; diff --git a/api_docs/kbn_core_mount_utils_browser_internal.mdx b/api_docs/kbn_core_mount_utils_browser_internal.mdx index 6b1a0710d32fc..9f9061bd2db2f 100644 --- a/api_docs/kbn_core_mount_utils_browser_internal.mdx +++ b/api_docs/kbn_core_mount_utils_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-mount-utils-browser-internal title: "@kbn/core-mount-utils-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-mount-utils-browser-internal plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-mount-utils-browser-internal'] --- import kbnCoreMountUtilsBrowserInternalObj from './kbn_core_mount_utils_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_node_server.mdx b/api_docs/kbn_core_node_server.mdx index 557383657b3a1..249929402bb4c 100644 --- a/api_docs/kbn_core_node_server.mdx +++ b/api_docs/kbn_core_node_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server title: "@kbn/core-node-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-node-server plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server'] --- import kbnCoreNodeServerObj from './kbn_core_node_server.devdocs.json'; diff --git a/api_docs/kbn_core_node_server_internal.mdx b/api_docs/kbn_core_node_server_internal.mdx index b401f4bfabee6..232d8c9b6ad1b 100644 --- a/api_docs/kbn_core_node_server_internal.mdx +++ b/api_docs/kbn_core_node_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server-internal title: "@kbn/core-node-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-node-server-internal plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server-internal'] --- import kbnCoreNodeServerInternalObj from './kbn_core_node_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_node_server_mocks.mdx b/api_docs/kbn_core_node_server_mocks.mdx index 1ed4cb3d1c384..1dc7820421fc8 100644 --- a/api_docs/kbn_core_node_server_mocks.mdx +++ b/api_docs/kbn_core_node_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server-mocks title: "@kbn/core-node-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-node-server-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server-mocks'] --- import kbnCoreNodeServerMocksObj from './kbn_core_node_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_notifications_browser.mdx b/api_docs/kbn_core_notifications_browser.mdx index 31b80abeb8b2f..8b5697e29e1bc 100644 --- a/api_docs/kbn_core_notifications_browser.mdx +++ b/api_docs/kbn_core_notifications_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-notifications-browser title: "@kbn/core-notifications-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-notifications-browser plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-notifications-browser'] --- import kbnCoreNotificationsBrowserObj from './kbn_core_notifications_browser.devdocs.json'; diff --git a/api_docs/kbn_core_notifications_browser_internal.mdx b/api_docs/kbn_core_notifications_browser_internal.mdx index 123ef66517165..a670d97534b1a 100644 --- a/api_docs/kbn_core_notifications_browser_internal.mdx +++ b/api_docs/kbn_core_notifications_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-notifications-browser-internal title: "@kbn/core-notifications-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-notifications-browser-internal plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-notifications-browser-internal'] --- import kbnCoreNotificationsBrowserInternalObj from './kbn_core_notifications_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_notifications_browser_mocks.mdx b/api_docs/kbn_core_notifications_browser_mocks.mdx index c574a847485e1..489c0180a7f74 100644 --- a/api_docs/kbn_core_notifications_browser_mocks.mdx +++ b/api_docs/kbn_core_notifications_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-notifications-browser-mocks title: "@kbn/core-notifications-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-notifications-browser-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-notifications-browser-mocks'] --- import kbnCoreNotificationsBrowserMocksObj from './kbn_core_notifications_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_overlays_browser.mdx b/api_docs/kbn_core_overlays_browser.mdx index 966b72684ebf4..fc6dbb27609db 100644 --- a/api_docs/kbn_core_overlays_browser.mdx +++ b/api_docs/kbn_core_overlays_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-overlays-browser title: "@kbn/core-overlays-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-overlays-browser plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-overlays-browser'] --- import kbnCoreOverlaysBrowserObj from './kbn_core_overlays_browser.devdocs.json'; diff --git a/api_docs/kbn_core_overlays_browser_internal.mdx b/api_docs/kbn_core_overlays_browser_internal.mdx index 3138b6a75f20a..ff891d2b6cc6b 100644 --- a/api_docs/kbn_core_overlays_browser_internal.mdx +++ b/api_docs/kbn_core_overlays_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-overlays-browser-internal title: "@kbn/core-overlays-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-overlays-browser-internal plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-overlays-browser-internal'] --- import kbnCoreOverlaysBrowserInternalObj from './kbn_core_overlays_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_overlays_browser_mocks.mdx b/api_docs/kbn_core_overlays_browser_mocks.mdx index 01e1c7fd5c768..229ca743a2ce0 100644 --- a/api_docs/kbn_core_overlays_browser_mocks.mdx +++ b/api_docs/kbn_core_overlays_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-overlays-browser-mocks title: "@kbn/core-overlays-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-overlays-browser-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-overlays-browser-mocks'] --- import kbnCoreOverlaysBrowserMocksObj from './kbn_core_overlays_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_preboot_server.mdx b/api_docs/kbn_core_preboot_server.mdx index 80bf8e728fba4..7c406e1fb0af6 100644 --- a/api_docs/kbn_core_preboot_server.mdx +++ b/api_docs/kbn_core_preboot_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-preboot-server title: "@kbn/core-preboot-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-preboot-server plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-preboot-server'] --- import kbnCorePrebootServerObj from './kbn_core_preboot_server.devdocs.json'; diff --git a/api_docs/kbn_core_preboot_server_mocks.mdx b/api_docs/kbn_core_preboot_server_mocks.mdx index f9273822f0e85..546ae71d30209 100644 --- a/api_docs/kbn_core_preboot_server_mocks.mdx +++ b/api_docs/kbn_core_preboot_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-preboot-server-mocks title: "@kbn/core-preboot-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-preboot-server-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-preboot-server-mocks'] --- import kbnCorePrebootServerMocksObj from './kbn_core_preboot_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_api_browser.mdx b/api_docs/kbn_core_saved_objects_api_browser.mdx index b093ba0d04676..9a560592e3ea2 100644 --- a/api_docs/kbn_core_saved_objects_api_browser.mdx +++ b/api_docs/kbn_core_saved_objects_api_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-api-browser title: "@kbn/core-saved-objects-api-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-api-browser plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-api-browser'] --- import kbnCoreSavedObjectsApiBrowserObj from './kbn_core_saved_objects_api_browser.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_api_server.mdx b/api_docs/kbn_core_saved_objects_api_server.mdx index 9ae400347f8e6..78c00a6865fe9 100644 --- a/api_docs/kbn_core_saved_objects_api_server.mdx +++ b/api_docs/kbn_core_saved_objects_api_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-api-server title: "@kbn/core-saved-objects-api-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-api-server plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-api-server'] --- import kbnCoreSavedObjectsApiServerObj from './kbn_core_saved_objects_api_server.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_browser.mdx b/api_docs/kbn_core_saved_objects_browser.mdx index 5c885e3bafc6c..8087c874029cd 100644 --- a/api_docs/kbn_core_saved_objects_browser.mdx +++ b/api_docs/kbn_core_saved_objects_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-browser title: "@kbn/core-saved-objects-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-browser plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-browser'] --- import kbnCoreSavedObjectsBrowserObj from './kbn_core_saved_objects_browser.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_browser_internal.mdx b/api_docs/kbn_core_saved_objects_browser_internal.mdx index e438fba0fadb8..3ba8459cfe797 100644 --- a/api_docs/kbn_core_saved_objects_browser_internal.mdx +++ b/api_docs/kbn_core_saved_objects_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-browser-internal title: "@kbn/core-saved-objects-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-browser-internal plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-browser-internal'] --- import kbnCoreSavedObjectsBrowserInternalObj from './kbn_core_saved_objects_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_browser_mocks.mdx b/api_docs/kbn_core_saved_objects_browser_mocks.mdx index 369f23e5fb5ac..82bb5388e16be 100644 --- a/api_docs/kbn_core_saved_objects_browser_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-browser-mocks title: "@kbn/core-saved-objects-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-browser-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-browser-mocks'] --- import kbnCoreSavedObjectsBrowserMocksObj from './kbn_core_saved_objects_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_common.mdx b/api_docs/kbn_core_saved_objects_common.mdx index 0339d416f73ea..e83d2b7e021fc 100644 --- a/api_docs/kbn_core_saved_objects_common.mdx +++ b/api_docs/kbn_core_saved_objects_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-common title: "@kbn/core-saved-objects-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-common plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-common'] --- import kbnCoreSavedObjectsCommonObj from './kbn_core_saved_objects_common.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_server.mdx b/api_docs/kbn_core_saved_objects_server.mdx index 06b753751b9b8..c71468f34f370 100644 --- a/api_docs/kbn_core_saved_objects_server.mdx +++ b/api_docs/kbn_core_saved_objects_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-server title: "@kbn/core-saved-objects-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-server plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-server'] --- import kbnCoreSavedObjectsServerObj from './kbn_core_saved_objects_server.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_deprecations_getters.mdx b/api_docs/kbn_core_test_helpers_deprecations_getters.mdx index 3375249b36daf..6d4f10f877f04 100644 --- a/api_docs/kbn_core_test_helpers_deprecations_getters.mdx +++ b/api_docs/kbn_core_test_helpers_deprecations_getters.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-deprecations-getters title: "@kbn/core-test-helpers-deprecations-getters" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-deprecations-getters plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-deprecations-getters'] --- import kbnCoreTestHelpersDeprecationsGettersObj from './kbn_core_test_helpers_deprecations_getters.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_http_setup_browser.mdx b/api_docs/kbn_core_test_helpers_http_setup_browser.mdx index 1468cd77f9620..d4e895dcdb7c4 100644 --- a/api_docs/kbn_core_test_helpers_http_setup_browser.mdx +++ b/api_docs/kbn_core_test_helpers_http_setup_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-http-setup-browser title: "@kbn/core-test-helpers-http-setup-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-http-setup-browser plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-http-setup-browser'] --- import kbnCoreTestHelpersHttpSetupBrowserObj from './kbn_core_test_helpers_http_setup_browser.devdocs.json'; diff --git a/api_docs/kbn_core_theme_browser.mdx b/api_docs/kbn_core_theme_browser.mdx index 89410d56c3973..3ceef5f2ae980 100644 --- a/api_docs/kbn_core_theme_browser.mdx +++ b/api_docs/kbn_core_theme_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-theme-browser title: "@kbn/core-theme-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-theme-browser plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-theme-browser'] --- import kbnCoreThemeBrowserObj from './kbn_core_theme_browser.devdocs.json'; diff --git a/api_docs/kbn_core_theme_browser_internal.mdx b/api_docs/kbn_core_theme_browser_internal.mdx index 93b61d9860ce2..f129db97a0ee1 100644 --- a/api_docs/kbn_core_theme_browser_internal.mdx +++ b/api_docs/kbn_core_theme_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-theme-browser-internal title: "@kbn/core-theme-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-theme-browser-internal plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-theme-browser-internal'] --- import kbnCoreThemeBrowserInternalObj from './kbn_core_theme_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_theme_browser_mocks.mdx b/api_docs/kbn_core_theme_browser_mocks.mdx index 3892c424f0402..4ab1c0d6d197b 100644 --- a/api_docs/kbn_core_theme_browser_mocks.mdx +++ b/api_docs/kbn_core_theme_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-theme-browser-mocks title: "@kbn/core-theme-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-theme-browser-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-theme-browser-mocks'] --- import kbnCoreThemeBrowserMocksObj from './kbn_core_theme_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_browser.mdx b/api_docs/kbn_core_ui_settings_browser.mdx index 64ed23a22fbc8..ff772b30e2800 100644 --- a/api_docs/kbn_core_ui_settings_browser.mdx +++ b/api_docs/kbn_core_ui_settings_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-browser title: "@kbn/core-ui-settings-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-browser plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-browser'] --- import kbnCoreUiSettingsBrowserObj from './kbn_core_ui_settings_browser.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_browser_internal.mdx b/api_docs/kbn_core_ui_settings_browser_internal.mdx index 8b84bcd28230a..7e9505349b993 100644 --- a/api_docs/kbn_core_ui_settings_browser_internal.mdx +++ b/api_docs/kbn_core_ui_settings_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-browser-internal title: "@kbn/core-ui-settings-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-browser-internal plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-browser-internal'] --- import kbnCoreUiSettingsBrowserInternalObj from './kbn_core_ui_settings_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_browser_mocks.mdx b/api_docs/kbn_core_ui_settings_browser_mocks.mdx index a7dc51baa7a43..11e9573e6c278 100644 --- a/api_docs/kbn_core_ui_settings_browser_mocks.mdx +++ b/api_docs/kbn_core_ui_settings_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-browser-mocks title: "@kbn/core-ui-settings-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-browser-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-browser-mocks'] --- import kbnCoreUiSettingsBrowserMocksObj from './kbn_core_ui_settings_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_common.mdx b/api_docs/kbn_core_ui_settings_common.mdx index 27e5f1fb1e5e3..46254f0b1bf88 100644 --- a/api_docs/kbn_core_ui_settings_common.mdx +++ b/api_docs/kbn_core_ui_settings_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-common title: "@kbn/core-ui-settings-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-common plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-common'] --- import kbnCoreUiSettingsCommonObj from './kbn_core_ui_settings_common.devdocs.json'; diff --git a/api_docs/kbn_crypto.mdx b/api_docs/kbn_crypto.mdx index 3a7f76deb43ab..a4d25e4a8b4c8 100644 --- a/api_docs/kbn_crypto.mdx +++ b/api_docs/kbn_crypto.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-crypto title: "@kbn/crypto" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/crypto plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/crypto'] --- import kbnCryptoObj from './kbn_crypto.devdocs.json'; diff --git a/api_docs/kbn_crypto_browser.mdx b/api_docs/kbn_crypto_browser.mdx index 64984b67c9293..408632e20e955 100644 --- a/api_docs/kbn_crypto_browser.mdx +++ b/api_docs/kbn_crypto_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-crypto-browser title: "@kbn/crypto-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/crypto-browser plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/crypto-browser'] --- import kbnCryptoBrowserObj from './kbn_crypto_browser.devdocs.json'; diff --git a/api_docs/kbn_datemath.mdx b/api_docs/kbn_datemath.mdx index d440fa059f629..ee1c7e6da162d 100644 --- a/api_docs/kbn_datemath.mdx +++ b/api_docs/kbn_datemath.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-datemath title: "@kbn/datemath" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/datemath plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/datemath'] --- import kbnDatemathObj from './kbn_datemath.devdocs.json'; diff --git a/api_docs/kbn_dev_cli_errors.mdx b/api_docs/kbn_dev_cli_errors.mdx index 61e2d2a39ca14..631777f17b197 100644 --- a/api_docs/kbn_dev_cli_errors.mdx +++ b/api_docs/kbn_dev_cli_errors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-cli-errors title: "@kbn/dev-cli-errors" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-cli-errors plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-cli-errors'] --- import kbnDevCliErrorsObj from './kbn_dev_cli_errors.devdocs.json'; diff --git a/api_docs/kbn_dev_cli_runner.mdx b/api_docs/kbn_dev_cli_runner.mdx index 83964a3198a1b..5a6ad81b8429f 100644 --- a/api_docs/kbn_dev_cli_runner.mdx +++ b/api_docs/kbn_dev_cli_runner.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-cli-runner title: "@kbn/dev-cli-runner" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-cli-runner plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-cli-runner'] --- import kbnDevCliRunnerObj from './kbn_dev_cli_runner.devdocs.json'; diff --git a/api_docs/kbn_dev_proc_runner.mdx b/api_docs/kbn_dev_proc_runner.mdx index d7e0b852a94e7..11fd31b384525 100644 --- a/api_docs/kbn_dev_proc_runner.mdx +++ b/api_docs/kbn_dev_proc_runner.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-proc-runner title: "@kbn/dev-proc-runner" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-proc-runner plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-proc-runner'] --- import kbnDevProcRunnerObj from './kbn_dev_proc_runner.devdocs.json'; diff --git a/api_docs/kbn_dev_utils.mdx b/api_docs/kbn_dev_utils.mdx index 4f7a4a332b0d9..0b6849df60e53 100644 --- a/api_docs/kbn_dev_utils.mdx +++ b/api_docs/kbn_dev_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-utils title: "@kbn/dev-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-utils plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-utils'] --- import kbnDevUtilsObj from './kbn_dev_utils.devdocs.json'; diff --git a/api_docs/kbn_doc_links.mdx b/api_docs/kbn_doc_links.mdx index cdb41ca37fa3f..e74eb3586fedd 100644 --- a/api_docs/kbn_doc_links.mdx +++ b/api_docs/kbn_doc_links.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-doc-links title: "@kbn/doc-links" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/doc-links plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/doc-links'] --- import kbnDocLinksObj from './kbn_doc_links.devdocs.json'; diff --git a/api_docs/kbn_docs_utils.mdx b/api_docs/kbn_docs_utils.mdx index f40ce355eaf4b..9d1b0938ee6d6 100644 --- a/api_docs/kbn_docs_utils.mdx +++ b/api_docs/kbn_docs_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-docs-utils title: "@kbn/docs-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/docs-utils plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/docs-utils'] --- import kbnDocsUtilsObj from './kbn_docs_utils.devdocs.json'; diff --git a/api_docs/kbn_ebt_tools.mdx b/api_docs/kbn_ebt_tools.mdx index 3171efaf3386e..39e29add11f4f 100644 --- a/api_docs/kbn_ebt_tools.mdx +++ b/api_docs/kbn_ebt_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ebt-tools title: "@kbn/ebt-tools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ebt-tools plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ebt-tools'] --- import kbnEbtToolsObj from './kbn_ebt_tools.devdocs.json'; diff --git a/api_docs/kbn_es_archiver.mdx b/api_docs/kbn_es_archiver.mdx index b5d4f9edc5655..788c2df268e17 100644 --- a/api_docs/kbn_es_archiver.mdx +++ b/api_docs/kbn_es_archiver.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-archiver title: "@kbn/es-archiver" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-archiver plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-archiver'] --- import kbnEsArchiverObj from './kbn_es_archiver.devdocs.json'; diff --git a/api_docs/kbn_es_errors.mdx b/api_docs/kbn_es_errors.mdx index e6b40c8df7943..77a248212ec42 100644 --- a/api_docs/kbn_es_errors.mdx +++ b/api_docs/kbn_es_errors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-errors title: "@kbn/es-errors" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-errors plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-errors'] --- import kbnEsErrorsObj from './kbn_es_errors.devdocs.json'; diff --git a/api_docs/kbn_es_query.mdx b/api_docs/kbn_es_query.mdx index 2dd45f6fddb1c..a8fd39203679c 100644 --- a/api_docs/kbn_es_query.mdx +++ b/api_docs/kbn_es_query.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-query title: "@kbn/es-query" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-query plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-query'] --- import kbnEsQueryObj from './kbn_es_query.devdocs.json'; diff --git a/api_docs/kbn_eslint_plugin_imports.mdx b/api_docs/kbn_eslint_plugin_imports.mdx index aa4ca7533f06f..058e9ecc01944 100644 --- a/api_docs/kbn_eslint_plugin_imports.mdx +++ b/api_docs/kbn_eslint_plugin_imports.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-eslint-plugin-imports title: "@kbn/eslint-plugin-imports" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/eslint-plugin-imports plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/eslint-plugin-imports'] --- import kbnEslintPluginImportsObj from './kbn_eslint_plugin_imports.devdocs.json'; diff --git a/api_docs/kbn_field_types.mdx b/api_docs/kbn_field_types.mdx index 57ca434933edd..7ad02c8a4e21f 100644 --- a/api_docs/kbn_field_types.mdx +++ b/api_docs/kbn_field_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-field-types title: "@kbn/field-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/field-types plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/field-types'] --- import kbnFieldTypesObj from './kbn_field_types.devdocs.json'; diff --git a/api_docs/kbn_find_used_node_modules.mdx b/api_docs/kbn_find_used_node_modules.mdx index 5ea870d5ea6b9..c36a31b3f3b1b 100644 --- a/api_docs/kbn_find_used_node_modules.mdx +++ b/api_docs/kbn_find_used_node_modules.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-find-used-node-modules title: "@kbn/find-used-node-modules" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/find-used-node-modules plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/find-used-node-modules'] --- import kbnFindUsedNodeModulesObj from './kbn_find_used_node_modules.devdocs.json'; diff --git a/api_docs/kbn_generate.mdx b/api_docs/kbn_generate.mdx index a7011b1b2bd0e..3693f9483dad8 100644 --- a/api_docs/kbn_generate.mdx +++ b/api_docs/kbn_generate.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-generate title: "@kbn/generate" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/generate plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/generate'] --- import kbnGenerateObj from './kbn_generate.devdocs.json'; diff --git a/api_docs/kbn_get_repo_files.mdx b/api_docs/kbn_get_repo_files.mdx index 51b8b7608822d..30029d0ee9a86 100644 --- a/api_docs/kbn_get_repo_files.mdx +++ b/api_docs/kbn_get_repo_files.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-get-repo-files title: "@kbn/get-repo-files" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/get-repo-files plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/get-repo-files'] --- import kbnGetRepoFilesObj from './kbn_get_repo_files.devdocs.json'; diff --git a/api_docs/kbn_handlebars.mdx b/api_docs/kbn_handlebars.mdx index e559a355ec49e..72e64e4308db3 100644 --- a/api_docs/kbn_handlebars.mdx +++ b/api_docs/kbn_handlebars.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-handlebars title: "@kbn/handlebars" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/handlebars plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/handlebars'] --- import kbnHandlebarsObj from './kbn_handlebars.devdocs.json'; diff --git a/api_docs/kbn_hapi_mocks.mdx b/api_docs/kbn_hapi_mocks.mdx index d88b2684492ec..f93a8dde44505 100644 --- a/api_docs/kbn_hapi_mocks.mdx +++ b/api_docs/kbn_hapi_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-hapi-mocks title: "@kbn/hapi-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/hapi-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/hapi-mocks'] --- import kbnHapiMocksObj from './kbn_hapi_mocks.devdocs.json'; diff --git a/api_docs/kbn_home_sample_data_card.mdx b/api_docs/kbn_home_sample_data_card.mdx index d335f7dca6d4e..85c912e2ed9bb 100644 --- a/api_docs/kbn_home_sample_data_card.mdx +++ b/api_docs/kbn_home_sample_data_card.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-home-sample-data-card title: "@kbn/home-sample-data-card" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/home-sample-data-card plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/home-sample-data-card'] --- import kbnHomeSampleDataCardObj from './kbn_home_sample_data_card.devdocs.json'; diff --git a/api_docs/kbn_home_sample_data_tab.mdx b/api_docs/kbn_home_sample_data_tab.mdx index 30e0c682aff67..b2087c8fb2dec 100644 --- a/api_docs/kbn_home_sample_data_tab.mdx +++ b/api_docs/kbn_home_sample_data_tab.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-home-sample-data-tab title: "@kbn/home-sample-data-tab" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/home-sample-data-tab plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/home-sample-data-tab'] --- import kbnHomeSampleDataTabObj from './kbn_home_sample_data_tab.devdocs.json'; diff --git a/api_docs/kbn_i18n.mdx b/api_docs/kbn_i18n.mdx index fffaec03f91ef..adcf719e448d0 100644 --- a/api_docs/kbn_i18n.mdx +++ b/api_docs/kbn_i18n.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-i18n title: "@kbn/i18n" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/i18n plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/i18n'] --- import kbnI18nObj from './kbn_i18n.devdocs.json'; diff --git a/api_docs/kbn_import_resolver.mdx b/api_docs/kbn_import_resolver.mdx index 6d5c522639253..dce6cdc231d25 100644 --- a/api_docs/kbn_import_resolver.mdx +++ b/api_docs/kbn_import_resolver.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-import-resolver title: "@kbn/import-resolver" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/import-resolver plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/import-resolver'] --- import kbnImportResolverObj from './kbn_import_resolver.devdocs.json'; diff --git a/api_docs/kbn_interpreter.mdx b/api_docs/kbn_interpreter.mdx index cc744bff457b9..e9d43c221a946 100644 --- a/api_docs/kbn_interpreter.mdx +++ b/api_docs/kbn_interpreter.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-interpreter title: "@kbn/interpreter" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/interpreter plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/interpreter'] --- import kbnInterpreterObj from './kbn_interpreter.devdocs.json'; diff --git a/api_docs/kbn_io_ts_utils.mdx b/api_docs/kbn_io_ts_utils.mdx index ed7b7b135bb30..a2f38e4ff55b9 100644 --- a/api_docs/kbn_io_ts_utils.mdx +++ b/api_docs/kbn_io_ts_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-io-ts-utils title: "@kbn/io-ts-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/io-ts-utils plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/io-ts-utils'] --- import kbnIoTsUtilsObj from './kbn_io_ts_utils.devdocs.json'; diff --git a/api_docs/kbn_jest_serializers.mdx b/api_docs/kbn_jest_serializers.mdx index 587f242ef3ff8..18110d36bb618 100644 --- a/api_docs/kbn_jest_serializers.mdx +++ b/api_docs/kbn_jest_serializers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-jest-serializers title: "@kbn/jest-serializers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/jest-serializers plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/jest-serializers'] --- import kbnJestSerializersObj from './kbn_jest_serializers.devdocs.json'; diff --git a/api_docs/kbn_kibana_manifest_parser.mdx b/api_docs/kbn_kibana_manifest_parser.mdx index df3611890de4c..23a8d98b75658 100644 --- a/api_docs/kbn_kibana_manifest_parser.mdx +++ b/api_docs/kbn_kibana_manifest_parser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-kibana-manifest-parser title: "@kbn/kibana-manifest-parser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/kibana-manifest-parser plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/kibana-manifest-parser'] --- import kbnKibanaManifestParserObj from './kbn_kibana_manifest_parser.devdocs.json'; diff --git a/api_docs/kbn_kibana_manifest_schema.mdx b/api_docs/kbn_kibana_manifest_schema.mdx index 886b3d014e938..4b2c19e02107b 100644 --- a/api_docs/kbn_kibana_manifest_schema.mdx +++ b/api_docs/kbn_kibana_manifest_schema.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-kibana-manifest-schema title: "@kbn/kibana-manifest-schema" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/kibana-manifest-schema plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/kibana-manifest-schema'] --- import kbnKibanaManifestSchemaObj from './kbn_kibana_manifest_schema.devdocs.json'; diff --git a/api_docs/kbn_logging.mdx b/api_docs/kbn_logging.mdx index 46e541c754317..398abe38c8108 100644 --- a/api_docs/kbn_logging.mdx +++ b/api_docs/kbn_logging.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-logging title: "@kbn/logging" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/logging plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/logging'] --- import kbnLoggingObj from './kbn_logging.devdocs.json'; diff --git a/api_docs/kbn_logging_mocks.mdx b/api_docs/kbn_logging_mocks.mdx index 1d6bb68071c1f..e94ecfd698cd0 100644 --- a/api_docs/kbn_logging_mocks.mdx +++ b/api_docs/kbn_logging_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-logging-mocks title: "@kbn/logging-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/logging-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/logging-mocks'] --- import kbnLoggingMocksObj from './kbn_logging_mocks.devdocs.json'; diff --git a/api_docs/kbn_managed_vscode_config.mdx b/api_docs/kbn_managed_vscode_config.mdx index cd050763491cc..e3beeafc537f3 100644 --- a/api_docs/kbn_managed_vscode_config.mdx +++ b/api_docs/kbn_managed_vscode_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-managed-vscode-config title: "@kbn/managed-vscode-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/managed-vscode-config plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/managed-vscode-config'] --- import kbnManagedVscodeConfigObj from './kbn_managed_vscode_config.devdocs.json'; diff --git a/api_docs/kbn_mapbox_gl.mdx b/api_docs/kbn_mapbox_gl.mdx index 17949f9985e64..c79bec946fc29 100644 --- a/api_docs/kbn_mapbox_gl.mdx +++ b/api_docs/kbn_mapbox_gl.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-mapbox-gl title: "@kbn/mapbox-gl" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/mapbox-gl plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/mapbox-gl'] --- import kbnMapboxGlObj from './kbn_mapbox_gl.devdocs.json'; diff --git a/api_docs/kbn_ml_agg_utils.mdx b/api_docs/kbn_ml_agg_utils.mdx index e743430e9222d..c7c5da659639a 100644 --- a/api_docs/kbn_ml_agg_utils.mdx +++ b/api_docs/kbn_ml_agg_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-agg-utils title: "@kbn/ml-agg-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-agg-utils plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-agg-utils'] --- import kbnMlAggUtilsObj from './kbn_ml_agg_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_is_populated_object.mdx b/api_docs/kbn_ml_is_populated_object.mdx index 3a0dfce55f800..7401adc69b2d3 100644 --- a/api_docs/kbn_ml_is_populated_object.mdx +++ b/api_docs/kbn_ml_is_populated_object.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-is-populated-object title: "@kbn/ml-is-populated-object" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-is-populated-object plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-is-populated-object'] --- import kbnMlIsPopulatedObjectObj from './kbn_ml_is_populated_object.devdocs.json'; diff --git a/api_docs/kbn_ml_string_hash.mdx b/api_docs/kbn_ml_string_hash.mdx index 25e37391bb246..a8afb7fccc9b0 100644 --- a/api_docs/kbn_ml_string_hash.mdx +++ b/api_docs/kbn_ml_string_hash.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-string-hash title: "@kbn/ml-string-hash" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-string-hash plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-string-hash'] --- import kbnMlStringHashObj from './kbn_ml_string_hash.devdocs.json'; diff --git a/api_docs/kbn_monaco.mdx b/api_docs/kbn_monaco.mdx index 509eaf07ab9b7..14b455dacc247 100644 --- a/api_docs/kbn_monaco.mdx +++ b/api_docs/kbn_monaco.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-monaco title: "@kbn/monaco" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/monaco plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/monaco'] --- import kbnMonacoObj from './kbn_monaco.devdocs.json'; diff --git a/api_docs/kbn_optimizer.mdx b/api_docs/kbn_optimizer.mdx index cb2e8e20206bb..93f1843422007 100644 --- a/api_docs/kbn_optimizer.mdx +++ b/api_docs/kbn_optimizer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-optimizer title: "@kbn/optimizer" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/optimizer plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/optimizer'] --- import kbnOptimizerObj from './kbn_optimizer.devdocs.json'; diff --git a/api_docs/kbn_optimizer_webpack_helpers.mdx b/api_docs/kbn_optimizer_webpack_helpers.mdx index ae33d9778e5cd..a8f9f5b35d016 100644 --- a/api_docs/kbn_optimizer_webpack_helpers.mdx +++ b/api_docs/kbn_optimizer_webpack_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-optimizer-webpack-helpers title: "@kbn/optimizer-webpack-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/optimizer-webpack-helpers plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/optimizer-webpack-helpers'] --- import kbnOptimizerWebpackHelpersObj from './kbn_optimizer_webpack_helpers.devdocs.json'; diff --git a/api_docs/kbn_performance_testing_dataset_extractor.mdx b/api_docs/kbn_performance_testing_dataset_extractor.mdx index 3cfa795d74c97..a5308ba6c163b 100644 --- a/api_docs/kbn_performance_testing_dataset_extractor.mdx +++ b/api_docs/kbn_performance_testing_dataset_extractor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-performance-testing-dataset-extractor title: "@kbn/performance-testing-dataset-extractor" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/performance-testing-dataset-extractor plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/performance-testing-dataset-extractor'] --- import kbnPerformanceTestingDatasetExtractorObj from './kbn_performance_testing_dataset_extractor.devdocs.json'; diff --git a/api_docs/kbn_plugin_generator.mdx b/api_docs/kbn_plugin_generator.mdx index c52df5f692a34..28beacfc3f693 100644 --- a/api_docs/kbn_plugin_generator.mdx +++ b/api_docs/kbn_plugin_generator.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-plugin-generator title: "@kbn/plugin-generator" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/plugin-generator plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/plugin-generator'] --- import kbnPluginGeneratorObj from './kbn_plugin_generator.devdocs.json'; diff --git a/api_docs/kbn_plugin_helpers.mdx b/api_docs/kbn_plugin_helpers.mdx index cefe6b19b09d5..7beb778393c92 100644 --- a/api_docs/kbn_plugin_helpers.mdx +++ b/api_docs/kbn_plugin_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-plugin-helpers title: "@kbn/plugin-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/plugin-helpers plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/plugin-helpers'] --- import kbnPluginHelpersObj from './kbn_plugin_helpers.devdocs.json'; diff --git a/api_docs/kbn_react_field.mdx b/api_docs/kbn_react_field.mdx index 2b33a58d5db7d..9b5d69a2a3fc9 100644 --- a/api_docs/kbn_react_field.mdx +++ b/api_docs/kbn_react_field.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-field title: "@kbn/react-field" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-field plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-field'] --- import kbnReactFieldObj from './kbn_react_field.devdocs.json'; diff --git a/api_docs/kbn_repo_source_classifier.mdx b/api_docs/kbn_repo_source_classifier.mdx index ac6d045f9fc90..ab394175f6a0f 100644 --- a/api_docs/kbn_repo_source_classifier.mdx +++ b/api_docs/kbn_repo_source_classifier.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-repo-source-classifier title: "@kbn/repo-source-classifier" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/repo-source-classifier plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/repo-source-classifier'] --- import kbnRepoSourceClassifierObj from './kbn_repo_source_classifier.devdocs.json'; diff --git a/api_docs/kbn_rule_data_utils.mdx b/api_docs/kbn_rule_data_utils.mdx index d98d1e9372c08..0891519c809c3 100644 --- a/api_docs/kbn_rule_data_utils.mdx +++ b/api_docs/kbn_rule_data_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-rule-data-utils title: "@kbn/rule-data-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/rule-data-utils plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/rule-data-utils'] --- import kbnRuleDataUtilsObj from './kbn_rule_data_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_autocomplete.mdx b/api_docs/kbn_securitysolution_autocomplete.mdx index 00d5c007b886d..03a3328c1e9f0 100644 --- a/api_docs/kbn_securitysolution_autocomplete.mdx +++ b/api_docs/kbn_securitysolution_autocomplete.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-autocomplete title: "@kbn/securitysolution-autocomplete" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-autocomplete plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-autocomplete'] --- import kbnSecuritysolutionAutocompleteObj from './kbn_securitysolution_autocomplete.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_es_utils.mdx b/api_docs/kbn_securitysolution_es_utils.mdx index 9aab6bf074430..d141725ac9a0c 100644 --- a/api_docs/kbn_securitysolution_es_utils.mdx +++ b/api_docs/kbn_securitysolution_es_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-es-utils title: "@kbn/securitysolution-es-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-es-utils plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-es-utils'] --- import kbnSecuritysolutionEsUtilsObj from './kbn_securitysolution_es_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_hook_utils.mdx b/api_docs/kbn_securitysolution_hook_utils.mdx index 19bd27e714fb5..ba328a7473dce 100644 --- a/api_docs/kbn_securitysolution_hook_utils.mdx +++ b/api_docs/kbn_securitysolution_hook_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-hook-utils title: "@kbn/securitysolution-hook-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-hook-utils plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-hook-utils'] --- import kbnSecuritysolutionHookUtilsObj from './kbn_securitysolution_hook_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx b/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx index da11fe7721ba4..24e94179a47e3 100644 --- a/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-alerting-types title: "@kbn/securitysolution-io-ts-alerting-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-alerting-types plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-alerting-types'] --- import kbnSecuritysolutionIoTsAlertingTypesObj from './kbn_securitysolution_io_ts_alerting_types.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_list_types.mdx b/api_docs/kbn_securitysolution_io_ts_list_types.mdx index 248793ba8147d..3a34e61699c34 100644 --- a/api_docs/kbn_securitysolution_io_ts_list_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_list_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-list-types title: "@kbn/securitysolution-io-ts-list-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-list-types plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-list-types'] --- import kbnSecuritysolutionIoTsListTypesObj from './kbn_securitysolution_io_ts_list_types.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_types.mdx b/api_docs/kbn_securitysolution_io_ts_types.mdx index 40c9a3127d04b..4ff0ce7e6062c 100644 --- a/api_docs/kbn_securitysolution_io_ts_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-types title: "@kbn/securitysolution-io-ts-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-types plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-types'] --- import kbnSecuritysolutionIoTsTypesObj from './kbn_securitysolution_io_ts_types.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_utils.mdx b/api_docs/kbn_securitysolution_io_ts_utils.mdx index 683968fccd406..6eaadbb34e667 100644 --- a/api_docs/kbn_securitysolution_io_ts_utils.mdx +++ b/api_docs/kbn_securitysolution_io_ts_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-utils title: "@kbn/securitysolution-io-ts-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-utils plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-utils'] --- import kbnSecuritysolutionIoTsUtilsObj from './kbn_securitysolution_io_ts_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_api.mdx b/api_docs/kbn_securitysolution_list_api.mdx index 0ffa0a08cf9c5..a0b5b4884014b 100644 --- a/api_docs/kbn_securitysolution_list_api.mdx +++ b/api_docs/kbn_securitysolution_list_api.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-api title: "@kbn/securitysolution-list-api" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-api plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-api'] --- import kbnSecuritysolutionListApiObj from './kbn_securitysolution_list_api.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_constants.mdx b/api_docs/kbn_securitysolution_list_constants.mdx index 1f3274e940be4..8540740dae243 100644 --- a/api_docs/kbn_securitysolution_list_constants.mdx +++ b/api_docs/kbn_securitysolution_list_constants.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-constants title: "@kbn/securitysolution-list-constants" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-constants plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-constants'] --- import kbnSecuritysolutionListConstantsObj from './kbn_securitysolution_list_constants.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_hooks.mdx b/api_docs/kbn_securitysolution_list_hooks.mdx index 2c751817d9bf2..e618ef74ac24a 100644 --- a/api_docs/kbn_securitysolution_list_hooks.mdx +++ b/api_docs/kbn_securitysolution_list_hooks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-hooks title: "@kbn/securitysolution-list-hooks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-hooks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-hooks'] --- import kbnSecuritysolutionListHooksObj from './kbn_securitysolution_list_hooks.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_utils.mdx b/api_docs/kbn_securitysolution_list_utils.mdx index 550abeab397a4..4d23c1929544d 100644 --- a/api_docs/kbn_securitysolution_list_utils.mdx +++ b/api_docs/kbn_securitysolution_list_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-utils title: "@kbn/securitysolution-list-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-utils plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-utils'] --- import kbnSecuritysolutionListUtilsObj from './kbn_securitysolution_list_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_rules.mdx b/api_docs/kbn_securitysolution_rules.mdx index 4b0c48b7424b7..a69e09a1ec284 100644 --- a/api_docs/kbn_securitysolution_rules.mdx +++ b/api_docs/kbn_securitysolution_rules.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-rules title: "@kbn/securitysolution-rules" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-rules plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-rules'] --- import kbnSecuritysolutionRulesObj from './kbn_securitysolution_rules.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_t_grid.mdx b/api_docs/kbn_securitysolution_t_grid.mdx index dafe77c50b0a8..f3b95a89820d7 100644 --- a/api_docs/kbn_securitysolution_t_grid.mdx +++ b/api_docs/kbn_securitysolution_t_grid.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-t-grid title: "@kbn/securitysolution-t-grid" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-t-grid plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-t-grid'] --- import kbnSecuritysolutionTGridObj from './kbn_securitysolution_t_grid.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_utils.mdx b/api_docs/kbn_securitysolution_utils.mdx index e47d2bae61f7c..3e61673969d88 100644 --- a/api_docs/kbn_securitysolution_utils.mdx +++ b/api_docs/kbn_securitysolution_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-utils title: "@kbn/securitysolution-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-utils plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-utils'] --- import kbnSecuritysolutionUtilsObj from './kbn_securitysolution_utils.devdocs.json'; diff --git a/api_docs/kbn_server_http_tools.mdx b/api_docs/kbn_server_http_tools.mdx index e78c5bdf707e6..da59db637dad9 100644 --- a/api_docs/kbn_server_http_tools.mdx +++ b/api_docs/kbn_server_http_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-server-http-tools title: "@kbn/server-http-tools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/server-http-tools plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-http-tools'] --- import kbnServerHttpToolsObj from './kbn_server_http_tools.devdocs.json'; diff --git a/api_docs/kbn_server_route_repository.mdx b/api_docs/kbn_server_route_repository.mdx index 5aac51db5a81a..7ad5dbbabc86d 100644 --- a/api_docs/kbn_server_route_repository.mdx +++ b/api_docs/kbn_server_route_repository.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-server-route-repository title: "@kbn/server-route-repository" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/server-route-repository plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-route-repository'] --- import kbnServerRouteRepositoryObj from './kbn_server_route_repository.devdocs.json'; diff --git a/api_docs/kbn_shared_svg.mdx b/api_docs/kbn_shared_svg.mdx index 0011c0b234fd1..5198f1177290e 100644 --- a/api_docs/kbn_shared_svg.mdx +++ b/api_docs/kbn_shared_svg.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-svg title: "@kbn/shared-svg" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-svg plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-svg'] --- import kbnSharedSvgObj from './kbn_shared_svg.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.devdocs.json b/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.devdocs.json index cb248defc411e..7595ab6a2bc3f 100644 --- a/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.devdocs.json +++ b/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.devdocs.json @@ -9,10 +9,18 @@ "objects": [] }, "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { "classes": [ { "parentPluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "id": "def-server.StorybookMock", + "id": "def-common.StorybookMock", "type": "Class", "tags": [], "label": "StorybookMock", @@ -22,9 +30,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxButtonExitFullScreenMocksPluginApi", - "section": "def-server.StorybookMock", + "section": "def-common.StorybookMock", "text": "StorybookMock" }, " extends ", @@ -40,7 +48,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "id": "def-server.StorybookMock.propArguments", + "id": "def-common.StorybookMock.propArguments", "type": "Object", "tags": [], "label": "propArguments", @@ -50,7 +58,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "id": "def-server.StorybookMock.propArguments.toggleChrome", + "id": "def-common.StorybookMock.propArguments.toggleChrome", "type": "Object", "tags": [], "label": "toggleChrome", @@ -60,7 +68,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "id": "def-server.StorybookMock.propArguments.toggleChrome.control", + "id": "def-common.StorybookMock.propArguments.toggleChrome.control", "type": "string", "tags": [], "label": "control", @@ -70,7 +78,7 @@ }, { "parentPluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "id": "def-server.StorybookMock.propArguments.toggleChrome.defaultValue", + "id": "def-common.StorybookMock.propArguments.toggleChrome.defaultValue", "type": "boolean", "tags": [], "label": "defaultValue", @@ -84,7 +92,7 @@ }, { "parentPluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "id": "def-server.StorybookMock.serviceArguments", + "id": "def-common.StorybookMock.serviceArguments", "type": "Object", "tags": [], "label": "serviceArguments", @@ -95,7 +103,7 @@ }, { "parentPluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "id": "def-server.StorybookMock.dependencies", + "id": "def-common.StorybookMock.dependencies", "type": "Array", "tags": [], "label": "dependencies", @@ -108,7 +116,7 @@ }, { "parentPluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "id": "def-server.StorybookMock.getProps", + "id": "def-common.StorybookMock.getProps", "type": "Function", "tags": [], "label": "getProps", @@ -117,9 +125,9 @@ "(params?: ", { "pluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxButtonExitFullScreenMocksPluginApi", - "section": "def-server.Params", + "section": "def-common.Params", "text": "Params" }, " | undefined) => ", @@ -130,7 +138,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "id": "def-server.StorybookMock.getProps.$1", + "id": "def-common.StorybookMock.getProps.$1", "type": "Object", "tags": [], "label": "params", @@ -138,9 +146,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxButtonExitFullScreenMocksPluginApi", - "section": "def-server.Params", + "section": "def-common.Params", "text": "Params" }, " | undefined" @@ -154,7 +162,7 @@ }, { "parentPluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "id": "def-server.StorybookMock.getServices", + "id": "def-common.StorybookMock.getServices", "type": "Function", "tags": [], "label": "getServices", @@ -175,7 +183,7 @@ "functions": [ { "parentPluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "id": "def-server.getKibanaDependenciesMock", + "id": "def-common.getKibanaDependenciesMock", "type": "Function", "tags": [], "label": "getKibanaDependenciesMock", @@ -194,7 +202,7 @@ }, { "parentPluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "id": "def-server.getServicesMock", + "id": "def-common.getServicesMock", "type": "Function", "tags": [], "label": "getServicesMock", @@ -217,7 +225,7 @@ "misc": [ { "parentPluginId": "@kbn/shared-ux-button-exit-full-screen-mocks", - "id": "def-server.Params", + "id": "def-common.Params", "type": "Type", "tags": [], "label": "Params", @@ -233,13 +241,5 @@ } ], "objects": [] - }, - "common": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] } } \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.mdx b/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.mdx index 6ed3fe23ad4ff..87751ce4f2b75 100644 --- a/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.mdx +++ b/api_docs/kbn_shared_ux_button_exit_full_screen_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-button-exit-full-screen-mocks title: "@kbn/shared-ux-button-exit-full-screen-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-button-exit-full-screen-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-button-exit-full-screen-mocks'] --- import kbnSharedUxButtonExitFullScreenMocksObj from './kbn_shared_ux_button_exit_full_screen_mocks.devdocs.json'; @@ -23,14 +23,14 @@ Contact [Owner missing] for questions regarding this plugin. |-------------------|-----------|------------------------|-----------------| | 13 | 0 | 9 | 0 | -## Server +## Common ### Functions - + ### Classes - + ### Consts, variables and types - + diff --git a/api_docs/kbn_shared_ux_button_toolbar.mdx b/api_docs/kbn_shared_ux_button_toolbar.mdx index ddbac049d370d..5658adf14ad4c 100644 --- a/api_docs/kbn_shared_ux_button_toolbar.mdx +++ b/api_docs/kbn_shared_ux_button_toolbar.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-button-toolbar title: "@kbn/shared-ux-button-toolbar" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-button-toolbar plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-button-toolbar'] --- import kbnSharedUxButtonToolbarObj from './kbn_shared_ux_button_toolbar.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_card_no_data.mdx b/api_docs/kbn_shared_ux_card_no_data.mdx index c8fc4d7c49bcc..f3907f21f4aac 100644 --- a/api_docs/kbn_shared_ux_card_no_data.mdx +++ b/api_docs/kbn_shared_ux_card_no_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-card-no-data title: "@kbn/shared-ux-card-no-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-card-no-data plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-card-no-data'] --- import kbnSharedUxCardNoDataObj from './kbn_shared_ux_card_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_card_no_data_mocks.devdocs.json b/api_docs/kbn_shared_ux_card_no_data_mocks.devdocs.json index 9e15f43a46545..9be1d1c11795d 100644 --- a/api_docs/kbn_shared_ux_card_no_data_mocks.devdocs.json +++ b/api_docs/kbn_shared_ux_card_no_data_mocks.devdocs.json @@ -9,10 +9,18 @@ "objects": [] }, "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { "classes": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock", + "id": "def-common.StorybookMock", "type": "Class", "tags": [], "label": "StorybookMock", @@ -22,9 +30,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-card-no-data-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxCardNoDataMocksPluginApi", - "section": "def-server.StorybookMock", + "section": "def-common.StorybookMock", "text": "StorybookMock" }, " extends ", @@ -40,7 +48,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments", + "id": "def-common.StorybookMock.propArguments", "type": "Object", "tags": [], "label": "propArguments", @@ -50,7 +58,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.category", + "id": "def-common.StorybookMock.propArguments.category", "type": "Object", "tags": [], "label": "category", @@ -60,7 +68,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.category.control", + "id": "def-common.StorybookMock.propArguments.category.control", "type": "Object", "tags": [], "label": "control", @@ -70,7 +78,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.category.control.type", + "id": "def-common.StorybookMock.propArguments.category.control.type", "type": "string", "tags": [], "label": "type", @@ -82,7 +90,7 @@ }, { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.category.defaultValue", + "id": "def-common.StorybookMock.propArguments.category.defaultValue", "type": "string", "tags": [], "label": "defaultValue", @@ -94,7 +102,7 @@ }, { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.title", + "id": "def-common.StorybookMock.propArguments.title", "type": "Object", "tags": [], "label": "title", @@ -104,7 +112,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.title.control", + "id": "def-common.StorybookMock.propArguments.title.control", "type": "Object", "tags": [], "label": "control", @@ -114,7 +122,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.title.control.type", + "id": "def-common.StorybookMock.propArguments.title.control.type", "type": "string", "tags": [], "label": "type", @@ -126,7 +134,7 @@ }, { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.title.defaultValue", + "id": "def-common.StorybookMock.propArguments.title.defaultValue", "type": "string", "tags": [], "label": "defaultValue", @@ -138,7 +146,7 @@ }, { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.description", + "id": "def-common.StorybookMock.propArguments.description", "type": "Object", "tags": [], "label": "description", @@ -148,7 +156,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.description.control", + "id": "def-common.StorybookMock.propArguments.description.control", "type": "Object", "tags": [], "label": "control", @@ -158,7 +166,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.description.control.type", + "id": "def-common.StorybookMock.propArguments.description.control.type", "type": "string", "tags": [], "label": "type", @@ -170,7 +178,7 @@ }, { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.description.defaultValue", + "id": "def-common.StorybookMock.propArguments.description.defaultValue", "type": "string", "tags": [], "label": "defaultValue", @@ -182,7 +190,7 @@ }, { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.button", + "id": "def-common.StorybookMock.propArguments.button", "type": "Object", "tags": [], "label": "button", @@ -192,7 +200,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.button.control", + "id": "def-common.StorybookMock.propArguments.button.control", "type": "Object", "tags": [], "label": "control", @@ -202,7 +210,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.button.control.type", + "id": "def-common.StorybookMock.propArguments.button.control.type", "type": "string", "tags": [], "label": "type", @@ -214,7 +222,7 @@ }, { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.button.defaultValue", + "id": "def-common.StorybookMock.propArguments.button.defaultValue", "type": "string", "tags": [], "label": "defaultValue", @@ -228,7 +236,7 @@ }, { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.serviceArguments", + "id": "def-common.StorybookMock.serviceArguments", "type": "Object", "tags": [], "label": "serviceArguments", @@ -238,7 +246,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.serviceArguments.canAccessFleet", + "id": "def-common.StorybookMock.serviceArguments.canAccessFleet", "type": "Object", "tags": [], "label": "canAccessFleet", @@ -248,7 +256,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.serviceArguments.canAccessFleet.control", + "id": "def-common.StorybookMock.serviceArguments.canAccessFleet.control", "type": "string", "tags": [], "label": "control", @@ -258,7 +266,7 @@ }, { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.serviceArguments.canAccessFleet.defaultValue", + "id": "def-common.StorybookMock.serviceArguments.canAccessFleet.defaultValue", "type": "boolean", "tags": [], "label": "defaultValue", @@ -272,7 +280,7 @@ }, { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.dependencies", + "id": "def-common.StorybookMock.dependencies", "type": "Array", "tags": [], "label": "dependencies", @@ -286,7 +294,7 @@ }, { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.getProps", + "id": "def-common.StorybookMock.getProps", "type": "Function", "tags": [], "label": "getProps", @@ -295,9 +303,9 @@ "(params?: ", { "pluginId": "@kbn/shared-ux-card-no-data-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxCardNoDataMocksPluginApi", - "section": "def-server.Params", + "section": "def-common.Params", "text": "Params" }, " | undefined) => ", @@ -308,7 +316,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.getProps.$1", + "id": "def-common.StorybookMock.getProps.$1", "type": "Object", "tags": [], "label": "params", @@ -316,9 +324,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-card-no-data-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxCardNoDataMocksPluginApi", - "section": "def-server.Params", + "section": "def-common.Params", "text": "Params" }, " | undefined" @@ -332,7 +340,7 @@ }, { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.getServices", + "id": "def-common.StorybookMock.getServices", "type": "Function", "tags": [], "label": "getServices", @@ -341,9 +349,9 @@ "(params: ", { "pluginId": "@kbn/shared-ux-card-no-data-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxCardNoDataMocksPluginApi", - "section": "def-server.Params", + "section": "def-common.Params", "text": "Params" }, ") => ", @@ -354,7 +362,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.StorybookMock.getServices.$1", + "id": "def-common.StorybookMock.getServices.$1", "type": "Object", "tags": [], "label": "params", @@ -362,9 +370,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-card-no-data-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxCardNoDataMocksPluginApi", - "section": "def-server.Params", + "section": "def-common.Params", "text": "Params" } ], @@ -382,7 +390,7 @@ "functions": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.getKibanaDependenciesMock", + "id": "def-common.getKibanaDependenciesMock", "type": "Function", "tags": [], "label": "getKibanaDependenciesMock", @@ -400,7 +408,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.getKibanaDependenciesMock.$1", + "id": "def-common.getKibanaDependenciesMock.$1", "type": "Object", "tags": [], "label": "params", @@ -420,7 +428,7 @@ }, { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.getServicesMock", + "id": "def-common.getServicesMock", "type": "Function", "tags": [], "label": "getServicesMock", @@ -438,7 +446,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.getServicesMock.$1", + "id": "def-common.getServicesMock.$1", "type": "Object", "tags": [], "label": "params", @@ -462,7 +470,7 @@ "misc": [ { "parentPluginId": "@kbn/shared-ux-card-no-data-mocks", - "id": "def-server.Params", + "id": "def-common.Params", "type": "Type", "tags": [], "label": "Params", @@ -478,13 +486,5 @@ } ], "objects": [] - }, - "common": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] } } \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_card_no_data_mocks.mdx b/api_docs/kbn_shared_ux_card_no_data_mocks.mdx index 166a358c79f5f..512dd0e08412c 100644 --- a/api_docs/kbn_shared_ux_card_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_card_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-card-no-data-mocks title: "@kbn/shared-ux-card-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-card-no-data-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-card-no-data-mocks'] --- import kbnSharedUxCardNoDataMocksObj from './kbn_shared_ux_card_no_data_mocks.devdocs.json'; @@ -23,14 +23,14 @@ Contact [Owner missing] for questions regarding this plugin. |-------------------|-----------|------------------------|-----------------| | 32 | 0 | 28 | 0 | -## Server +## Common ### Functions - + ### Classes - + ### Consts, variables and types - + diff --git a/api_docs/kbn_shared_ux_components.devdocs.json b/api_docs/kbn_shared_ux_components.devdocs.json deleted file mode 100644 index 52bb9bcd5d8b0..0000000000000 --- a/api_docs/kbn_shared_ux_components.devdocs.json +++ /dev/null @@ -1,257 +0,0 @@ -{ - "id": "@kbn/shared-ux-components", - "client": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "server": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "common": { - "classes": [], - "functions": [ - { - "parentPluginId": "@kbn/shared-ux-components", - "id": "def-common.KibanaPageTemplate", - "type": "Function", - "tags": [], - "label": "KibanaPageTemplate", - "description": [], - "signature": [ - "({ template, className, children, solutionNav, noDataConfig, ...rest }: React.PropsWithChildren<", - { - "pluginId": "@kbn/shared-ux-components", - "scope": "common", - "docId": "kibKbnSharedUxComponentsPluginApi", - "section": "def-common.KibanaPageTemplateProps", - "text": "KibanaPageTemplateProps" - }, - ">) => JSX.Element" - ], - "path": "packages/kbn-shared-ux-components/src/page_template/page_template.tsx", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-components", - "id": "def-common.KibanaPageTemplate.$1", - "type": "CompoundType", - "tags": [], - "label": "{\n template,\n className,\n children,\n solutionNav,\n noDataConfig,\n ...rest\n}", - "description": [], - "signature": [ - "React.PropsWithChildren<", - { - "pluginId": "@kbn/shared-ux-components", - "scope": "common", - "docId": "kibKbnSharedUxComponentsPluginApi", - "section": "def-common.KibanaPageTemplateProps", - "text": "KibanaPageTemplateProps" - }, - ">" - ], - "path": "packages/kbn-shared-ux-components/src/page_template/page_template.tsx", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-components", - "id": "def-common.NoDataConfigPage", - "type": "Function", - "tags": [], - "label": "NoDataConfigPage", - "description": [], - "signature": [ - "(props: ", - { - "pluginId": "@kbn/shared-ux-components", - "scope": "common", - "docId": "kibKbnSharedUxComponentsPluginApi", - "section": "def-common.KibanaPageTemplateProps", - "text": "KibanaPageTemplateProps" - }, - ") => JSX.Element | null" - ], - "path": "packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/no_data_config_page.tsx", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-components", - "id": "def-common.NoDataConfigPage.$1", - "type": "CompoundType", - "tags": [], - "label": "props", - "description": [], - "signature": [ - { - "pluginId": "@kbn/shared-ux-components", - "scope": "common", - "docId": "kibKbnSharedUxComponentsPluginApi", - "section": "def-common.KibanaPageTemplateProps", - "text": "KibanaPageTemplateProps" - } - ], - "path": "packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/no_data_config_page.tsx", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - } - ], - "interfaces": [ - { - "parentPluginId": "@kbn/shared-ux-components", - "id": "def-common.NoDataPageProps", - "type": "Interface", - "tags": [], - "label": "NoDataPageProps", - "description": [], - "signature": [ - { - "pluginId": "@kbn/shared-ux-components", - "scope": "common", - "docId": "kibKbnSharedUxComponentsPluginApi", - "section": "def-common.NoDataPageProps", - "text": "NoDataPageProps" - }, - " extends ", - "CommonProps" - ], - "path": "packages/kbn-shared-ux-components/src/page_template/no_data_page/types.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-components", - "id": "def-common.NoDataPageProps.solution", - "type": "string", - "tags": [], - "label": "solution", - "description": [ - "\nSingle name for the current solution, used to auto-generate the title, logo, description, and button label" - ], - "path": "packages/kbn-shared-ux-components/src/page_template/no_data_page/types.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-components", - "id": "def-common.NoDataPageProps.logo", - "type": "string", - "tags": [], - "label": "logo", - "description": [ - "\nOptionally replace the auto-generated logo" - ], - "signature": [ - "string | undefined" - ], - "path": "packages/kbn-shared-ux-components/src/page_template/no_data_page/types.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-components", - "id": "def-common.NoDataPageProps.docsLink", - "type": "string", - "tags": [], - "label": "docsLink", - "description": [ - "\nRequired to set the docs link for the whole solution" - ], - "path": "packages/kbn-shared-ux-components/src/page_template/no_data_page/types.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-components", - "id": "def-common.NoDataPageProps.pageTitle", - "type": "string", - "tags": [], - "label": "pageTitle", - "description": [ - "\nOptionally replace the auto-generated page title (h1)" - ], - "signature": [ - "string | undefined" - ], - "path": "packages/kbn-shared-ux-components/src/page_template/no_data_page/types.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-components", - "id": "def-common.NoDataPageProps.action", - "type": "Object", - "tags": [], - "label": "action", - "description": [ - "\nAn object of `NoDataPageActions`.\nUse `elasticAgent` as the primary key for pre-configured cards of this type.\nOtherwise use a custom key that contains `EuiCard` props." - ], - "signature": [ - "{ [x: string]: ", - "NoDataCardProps", - "; }" - ], - "path": "packages/kbn-shared-ux-components/src/page_template/no_data_page/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - } - ], - "enums": [], - "misc": [ - { - "parentPluginId": "@kbn/shared-ux-components", - "id": "def-common.KibanaPageTemplateProps", - "type": "Type", - "tags": [], - "label": "KibanaPageTemplateProps", - "description": [], - "signature": [ - "Omit<", - "EuiPageProps", - ", \"paddingSize\"> & { template?: \"default\" | \"empty\" | \"centeredBody\" | \"centeredContent\" | undefined; paddingSize?: \"none\" | \"m\" | \"s\" | \"l\" | undefined; pageSideBar?: React.ReactNode; pageSideBarProps?: ", - "EuiPageSideBarProps", - " | undefined; pageHeader?: ", - "EuiPageHeaderProps", - " | undefined; pageBodyProps?: ", - "EuiPageBodyProps", - "<\"main\"> | undefined; pageContentProps?: ", - "EuiPageContentProps", - " | undefined; pageContentBodyProps?: ", - "EuiPageContentBodyProps", - " | undefined; bottomBar?: React.ReactNode; bottomBarProps?: ", - "EuiBottomBarProps", - " | undefined; fullHeight?: boolean | \"noscroll\" | undefined; minHeight?: ", - "Property", - ".MinHeight | undefined; } & { isEmptyState?: boolean | undefined; solutionNav?: ", - "SolutionNavProps", - " | undefined; noDataConfig?: ", - { - "pluginId": "@kbn/shared-ux-components", - "scope": "common", - "docId": "kibKbnSharedUxComponentsPluginApi", - "section": "def-common.NoDataPageProps", - "text": "NoDataPageProps" - }, - " | undefined; }" - ], - "path": "packages/kbn-shared-ux-components/src/page_template/types.ts", - "deprecated": false, - "initialIsOpen": false - } - ], - "objects": [] - } -} \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_link_redirect_app_mocks.devdocs.json b/api_docs/kbn_shared_ux_link_redirect_app_mocks.devdocs.json index dded2ace4c3a2..64dc76155d112 100644 --- a/api_docs/kbn_shared_ux_link_redirect_app_mocks.devdocs.json +++ b/api_docs/kbn_shared_ux_link_redirect_app_mocks.devdocs.json @@ -9,10 +9,18 @@ "objects": [] }, "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { "classes": [ { "parentPluginId": "@kbn/shared-ux-link-redirect-app-mocks", - "id": "def-server.StorybookMock", + "id": "def-common.StorybookMock", "type": "Class", "tags": [], "label": "StorybookMock", @@ -20,9 +28,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-link-redirect-app-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxLinkRedirectAppMocksPluginApi", - "section": "def-server.StorybookMock", + "section": "def-common.StorybookMock", "text": "StorybookMock" }, " extends ", @@ -36,7 +44,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-link-redirect-app-mocks", - "id": "def-server.StorybookMock.propArguments", + "id": "def-common.StorybookMock.propArguments", "type": "Object", "tags": [], "label": "propArguments", @@ -47,7 +55,7 @@ }, { "parentPluginId": "@kbn/shared-ux-link-redirect-app-mocks", - "id": "def-server.StorybookMock.serviceArguments", + "id": "def-common.StorybookMock.serviceArguments", "type": "Object", "tags": [], "label": "serviceArguments", @@ -58,7 +66,7 @@ }, { "parentPluginId": "@kbn/shared-ux-link-redirect-app-mocks", - "id": "def-server.StorybookMock.dependencies", + "id": "def-common.StorybookMock.dependencies", "type": "Array", "tags": [], "label": "dependencies", @@ -71,7 +79,7 @@ }, { "parentPluginId": "@kbn/shared-ux-link-redirect-app-mocks", - "id": "def-server.StorybookMock.getProps", + "id": "def-common.StorybookMock.getProps", "type": "Function", "tags": [], "label": "getProps", @@ -88,7 +96,7 @@ }, { "parentPluginId": "@kbn/shared-ux-link-redirect-app-mocks", - "id": "def-server.StorybookMock.getServices", + "id": "def-common.StorybookMock.getServices", "type": "Function", "tags": [], "label": "getServices", @@ -110,24 +118,39 @@ "functions": [ { "parentPluginId": "@kbn/shared-ux-link-redirect-app-mocks", - "id": "def-server.getRedirectAppLinksKibanaDependenciesMock", + "id": "def-common.getRedirectAppLinksKibanaDependenciesMock", "type": "Function", "tags": [], "label": "getRedirectAppLinksKibanaDependenciesMock", "description": [], "signature": [ - "() => ", + "(params?: Partial | undefined) => ", "RedirectAppLinksKibanaDependencies" ], "path": "packages/shared-ux/link/redirect_app/mocks/src/jest.ts", "deprecated": false, - "children": [], + "children": [ + { + "parentPluginId": "@kbn/shared-ux-link-redirect-app-mocks", + "id": "def-common.getRedirectAppLinksKibanaDependenciesMock.$1", + "type": "Object", + "tags": [], + "label": "params", + "description": [], + "signature": [ + "Partial | undefined" + ], + "path": "packages/shared-ux/link/redirect_app/mocks/src/jest.ts", + "deprecated": false, + "isRequired": false + } + ], "returnComment": [], "initialIsOpen": false }, { "parentPluginId": "@kbn/shared-ux-link-redirect-app-mocks", - "id": "def-server.getRedirectAppLinksServicesMock", + "id": "def-common.getRedirectAppLinksServicesMock", "type": "Function", "tags": [], "label": "getRedirectAppLinksServicesMock", @@ -135,12 +158,27 @@ "\nReturns the Jest-compatible service abstractions for the `NoDataCard` Provider." ], "signature": [ - "() => ", + "(params?: Partial | undefined) => ", "RedirectAppLinksServices" ], "path": "packages/shared-ux/link/redirect_app/mocks/src/jest.ts", "deprecated": false, - "children": [], + "children": [ + { + "parentPluginId": "@kbn/shared-ux-link-redirect-app-mocks", + "id": "def-common.getRedirectAppLinksServicesMock.$1", + "type": "Object", + "tags": [], + "label": "params", + "description": [], + "signature": [ + "Partial | undefined" + ], + "path": "packages/shared-ux/link/redirect_app/mocks/src/jest.ts", + "deprecated": false, + "isRequired": false + } + ], "returnComment": [], "initialIsOpen": false } @@ -149,13 +187,5 @@ "enums": [], "misc": [], "objects": [] - }, - "common": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] } } \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx b/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx index 9a97cb66c3dfd..c0f40ecf5083f 100644 --- a/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx +++ b/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-link-redirect-app-mocks title: "@kbn/shared-ux-link-redirect-app-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-link-redirect-app-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-link-redirect-app-mocks'] --- import kbnSharedUxLinkRedirectAppMocksObj from './kbn_shared_ux_link_redirect_app_mocks.devdocs.json'; @@ -21,13 +21,13 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 8 | 0 | 7 | 0 | +| 10 | 0 | 9 | 0 | -## Server +## Common ### Functions - + ### Classes - + diff --git a/api_docs/kbn_shared_ux_page_analytics_no_data.devdocs.json b/api_docs/kbn_shared_ux_page_analytics_no_data.devdocs.json index ed6fbf24bf21f..3f1e5a7afa895 100644 --- a/api_docs/kbn_shared_ux_page_analytics_no_data.devdocs.json +++ b/api_docs/kbn_shared_ux_page_analytics_no_data.devdocs.json @@ -227,7 +227,13 @@ "signature": [ "KibanaDependencies", " & ", - "KibanaNoDataPageKibanaDependencies" + "KibanaDependencies", + " & ", + "NoDataViewsPromptKibanaDependencies", + " & ", + "KibanaDependencies", + " & ", + "RedirectAppLinksKibanaDependencies" ], "path": "node_modules/@kbn/shared-ux-page-analytics-no-data-types/index.d.ts", "deprecated": false, @@ -245,7 +251,13 @@ "signature": [ "Services", " & ", - "KibanaNoDataPageServices" + "Services", + " & ", + "Services", + " & ", + "RedirectAppLinksServices", + " & ", + "NoDataViewsPromptServices" ], "path": "node_modules/@kbn/shared-ux-page-analytics-no-data-types/index.d.ts", "deprecated": false, diff --git a/api_docs/kbn_shared_ux_page_analytics_no_data.mdx b/api_docs/kbn_shared_ux_page_analytics_no_data.mdx index 760cecf99f62f..ee4897f052d57 100644 --- a/api_docs/kbn_shared_ux_page_analytics_no_data.mdx +++ b/api_docs/kbn_shared_ux_page_analytics_no_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-analytics-no-data title: "@kbn/shared-ux-page-analytics-no-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-analytics-no-data plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-analytics-no-data'] --- import kbnSharedUxPageAnalyticsNoDataObj from './kbn_shared_ux_page_analytics_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.devdocs.json b/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.devdocs.json index 79c342c488de8..0ba419e7b51a0 100644 --- a/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.devdocs.json +++ b/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.devdocs.json @@ -9,10 +9,18 @@ "objects": [] }, "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { "classes": [ { "parentPluginId": "@kbn/shared-ux-page-analytics-no-data-mocks", - "id": "def-server.StorybookMock", + "id": "def-common.StorybookMock", "type": "Class", "tags": [], "label": "StorybookMock", @@ -20,9 +28,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-page-analytics-no-data-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxPageAnalyticsNoDataMocksPluginApi", - "section": "def-server.StorybookMock", + "section": "def-common.StorybookMock", "text": "StorybookMock" }, " extends ", @@ -38,7 +46,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-page-analytics-no-data-mocks", - "id": "def-server.StorybookMock.propArguments", + "id": "def-common.StorybookMock.propArguments", "type": "Object", "tags": [], "label": "propArguments", @@ -49,7 +57,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-analytics-no-data-mocks", - "id": "def-server.StorybookMock.serviceArguments", + "id": "def-common.StorybookMock.serviceArguments", "type": "Object", "tags": [], "label": "serviceArguments", @@ -59,7 +67,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-page-analytics-no-data-mocks", - "id": "def-server.StorybookMock.serviceArguments.kibanaGuideDocLink", + "id": "def-common.StorybookMock.serviceArguments.kibanaGuideDocLink", "type": "Object", "tags": [], "label": "kibanaGuideDocLink", @@ -69,7 +77,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-page-analytics-no-data-mocks", - "id": "def-server.StorybookMock.serviceArguments.kibanaGuideDocLink.control", + "id": "def-common.StorybookMock.serviceArguments.kibanaGuideDocLink.control", "type": "string", "tags": [], "label": "control", @@ -79,7 +87,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-analytics-no-data-mocks", - "id": "def-server.StorybookMock.serviceArguments.kibanaGuideDocLink.defaultValue", + "id": "def-common.StorybookMock.serviceArguments.kibanaGuideDocLink.defaultValue", "type": "string", "tags": [], "label": "defaultValue", @@ -93,7 +101,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-analytics-no-data-mocks", - "id": "def-server.StorybookMock.dependencies", + "id": "def-common.StorybookMock.dependencies", "type": "Array", "tags": [], "label": "dependencies", @@ -107,7 +115,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-analytics-no-data-mocks", - "id": "def-server.StorybookMock.getServices", + "id": "def-common.StorybookMock.getServices", "type": "Function", "tags": [], "label": "getServices", @@ -116,9 +124,9 @@ "(params: ", { "pluginId": "@kbn/shared-ux-page-analytics-no-data-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxPageAnalyticsNoDataMocksPluginApi", - "section": "def-server.Params", + "section": "def-common.Params", "text": "Params" }, ") => ", @@ -129,7 +137,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-page-analytics-no-data-mocks", - "id": "def-server.StorybookMock.getServices.$1", + "id": "def-common.StorybookMock.getServices.$1", "type": "CompoundType", "tags": [], "label": "params", @@ -137,9 +145,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-page-analytics-no-data-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxPageAnalyticsNoDataMocksPluginApi", - "section": "def-server.Params", + "section": "def-common.Params", "text": "Params" } ], @@ -152,7 +160,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-analytics-no-data-mocks", - "id": "def-server.StorybookMock.getProps", + "id": "def-common.StorybookMock.getProps", "type": "Function", "tags": [], "label": "getProps", @@ -174,7 +182,7 @@ "functions": [ { "parentPluginId": "@kbn/shared-ux-page-analytics-no-data-mocks", - "id": "def-server.getServicesMock", + "id": "def-common.getServicesMock", "type": "Function", "tags": [], "label": "getServicesMock", @@ -195,7 +203,7 @@ "misc": [ { "parentPluginId": "@kbn/shared-ux-page-analytics-no-data-mocks", - "id": "def-server.Params", + "id": "def-common.Params", "type": "Type", "tags": [], "label": "Params", @@ -219,13 +227,5 @@ } ], "objects": [] - }, - "common": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] } } \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx b/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx index 9afae8214cfcb..eafa4b4086e5a 100644 --- a/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-analytics-no-data-mocks title: "@kbn/shared-ux-page-analytics-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-analytics-no-data-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-analytics-no-data-mocks'] --- import kbnSharedUxPageAnalyticsNoDataMocksObj from './kbn_shared_ux_page_analytics_no_data_mocks.devdocs.json'; @@ -23,14 +23,14 @@ Contact [Owner missing] for questions regarding this plugin. |-------------------|-----------|------------------------|-----------------| | 12 | 0 | 12 | 0 | -## Server +## Common ### Functions - + ### Classes - + ### Consts, variables and types - + diff --git a/api_docs/kbn_shared_ux_page_kibana_no_data.devdocs.json b/api_docs/kbn_shared_ux_page_kibana_no_data.devdocs.json index edef04f7c1f13..cd68f336f2217 100644 --- a/api_docs/kbn_shared_ux_page_kibana_no_data.devdocs.json +++ b/api_docs/kbn_shared_ux_page_kibana_no_data.devdocs.json @@ -129,316 +129,54 @@ "initialIsOpen": false } ], - "interfaces": [ + "interfaces": [], + "enums": [], + "misc": [ { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", "id": "def-common.KibanaNoDataPageKibanaDependencies", - "type": "Interface", + "type": "Type", "tags": [], "label": "KibanaNoDataPageKibanaDependencies", "description": [ "\nAn interface containing a collection of Kibana plugins and services required to\nrender this component and its dependencies." ], + "signature": [ + "KibanaDependencies", + " & ", + "NoDataViewsPromptKibanaDependencies", + " & ", + "KibanaDependencies", + " & ", + "RedirectAppLinksKibanaDependencies" + ], "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageKibanaDependencies.coreStart", - "type": "Object", - "tags": [], - "label": "coreStart", - "description": [], - "signature": [ - "{ application: { capabilities: { navLinks: Record; }; currentAppId$: ", - "Observable", - "; navigateToUrl: (url: string) => Promise; }; chrome: { setIsVisible: (isVisible: boolean) => void; }; docLinks: { links: { indexPatterns: { introduction: string; }; }; }; http: { basePath: { prepend: (url: string) => string; }; }; }" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageKibanaDependencies.dataViews", - "type": "Object", - "tags": [], - "label": "dataViews", - "description": [], - "signature": [ - "{ hasData: { hasDataView: () => Promise; hasESData: () => Promise; hasUserDataView: () => Promise; }; }" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageKibanaDependencies.dataViewEditor", - "type": "Object", - "tags": [], - "label": "dataViewEditor", - "description": [], - "signature": [ - "{ openEditor: (options: ", - "DataViewEditorOptions", - ") => () => void; userPermissions: { editDataView: () => boolean; }; }" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false - } - ], "initialIsOpen": false }, { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", "id": "def-common.KibanaNoDataPageServices", - "type": "Interface", + "type": "Type", "tags": [], "label": "KibanaNoDataPageServices", "description": [ - "\nA list of Services that are consumed by this component.\n\nThis list is temporary, a stopgap as we migrate to a package-based architecture, where\nservices are not collected in a single package. In order to make the transition, this\ninterface is intentionally \"flat\".\n\nExpect this list to dwindle to zero as `@kbn/shared-ux-components` are migrated to their\nown packages, (and `@kbn/shared-ux-services` is removed)." + "\nA list of Services that are consumed by this component.." + ], + "signature": [ + "Services", + " & ", + "Services", + " & ", + "RedirectAppLinksServices", + " & ", + "NoDataViewsPromptServices" ], "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageServices.hasESData", - "type": "Function", - "tags": [], - "label": "hasESData", - "description": [ - "True if the cluster contains data, false otherwise." - ], - "signature": [ - "() => Promise" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageServices.hasUserDataView", - "type": "Function", - "tags": [], - "label": "hasUserDataView", - "description": [ - "True if Kibana instance contains user-created data view, false otherwise." - ], - "signature": [ - "() => Promise" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageServices.addBasePath", - "type": "Function", - "tags": [], - "label": "addBasePath", - "description": [ - "Append the server base path to a relative URL." - ], - "signature": [ - "(url: string) => string" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageServices.addBasePath.$1", - "type": "string", - "tags": [], - "label": "url", - "description": [], - "signature": [ - "string" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageServices.canAccessFleet", - "type": "boolean", - "tags": [], - "label": "canAccessFleet", - "description": [ - "True if the user has permission to access Fleet, false otherwise." - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageServices.canCreateNewDataView", - "type": "boolean", - "tags": [], - "label": "canCreateNewDataView", - "description": [ - "True if the user has permission to create a new Data View, false otherwise." - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageServices.currentAppId$", - "type": "Object", - "tags": [], - "label": "currentAppId$", - "description": [ - "Observable storing the active, current application ID." - ], - "signature": [ - "Observable", - "" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageServices.dataViewsDocLink", - "type": "string", - "tags": [], - "label": "dataViewsDocLink", - "description": [ - "A link to information about Data Views in Kibana" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageServices.hasDataView", - "type": "Function", - "tags": [], - "label": "hasDataView", - "description": [ - "True if Kibana instance contains any data view, including system-created ones." - ], - "signature": [ - "() => Promise" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageServices.navigateToUrl", - "type": "Function", - "tags": [], - "label": "navigateToUrl", - "description": [ - "Use Kibana to navigate async to a different URL." - ], - "signature": [ - "(url: string) => void | Promise" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageServices.navigateToUrl.$1", - "type": "string", - "tags": [], - "label": "url", - "description": [], - "signature": [ - "string" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageServices.openDataViewEditor", - "type": "Function", - "tags": [], - "label": "openDataViewEditor", - "description": [ - "A method to open the Data View Editor flow." - ], - "signature": [ - "(options: ", - "DataViewEditorOptions", - ") => () => void" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageServices.openDataViewEditor.$1", - "type": "Object", - "tags": [], - "label": "options", - "description": [], - "signature": [ - "DataViewEditorOptions" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageServices.setIsFullscreen", - "type": "Function", - "tags": [], - "label": "setIsFullscreen", - "description": [ - "Set the Kibana chrome and browser to full screen mode." - ], - "signature": [ - "(isFullscreen: boolean) => void" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-page-kibana-no-data", - "id": "def-common.KibanaNoDataPageServices.setIsFullscreen.$1", - "type": "boolean", - "tags": [], - "label": "isFullscreen", - "description": [], - "signature": [ - "boolean" - ], - "path": "node_modules/@kbn/shared-ux-page-kibana-no-data-types/index.d.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - } - ], "initialIsOpen": false } ], - "enums": [], - "misc": [], "objects": [] } } \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_page_kibana_no_data.mdx b/api_docs/kbn_shared_ux_page_kibana_no_data.mdx index 1a3a3c7c89877..9787dd1eb9e16 100644 --- a/api_docs/kbn_shared_ux_page_kibana_no_data.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_no_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-no-data title: "@kbn/shared-ux-page-kibana-no-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-kibana-no-data plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-no-data'] --- import kbnSharedUxPageKibanaNoDataObj from './kbn_shared_ux_page_kibana_no_data.devdocs.json'; @@ -21,13 +21,13 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 26 | 0 | 3 | 0 | +| 8 | 0 | 3 | 0 | ## Common ### Functions -### Interfaces - +### Consts, variables and types + diff --git a/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.devdocs.json b/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.devdocs.json index dee03e2ae609e..e833987bc5068 100644 --- a/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.devdocs.json +++ b/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.devdocs.json @@ -9,10 +9,18 @@ "objects": [] }, "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { "classes": [ { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock", + "id": "def-common.StorybookMock", "type": "Class", "tags": [], "label": "StorybookMock", @@ -20,9 +28,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxPageKibanaNoDataMocksPluginApi", - "section": "def-server.StorybookMock", + "section": "def-common.StorybookMock", "text": "StorybookMock" }, " extends ", @@ -38,7 +46,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.propArguments", + "id": "def-common.StorybookMock.propArguments", "type": "Object", "tags": [], "label": "propArguments", @@ -48,7 +56,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.solution", + "id": "def-common.StorybookMock.propArguments.solution", "type": "Object", "tags": [], "label": "solution", @@ -58,7 +66,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.solution.control", + "id": "def-common.StorybookMock.propArguments.solution.control", "type": "string", "tags": [], "label": "control", @@ -68,7 +76,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.solution.defaultValue", + "id": "def-common.StorybookMock.propArguments.solution.defaultValue", "type": "string", "tags": [], "label": "defaultValue", @@ -80,7 +88,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.logo", + "id": "def-common.StorybookMock.propArguments.logo", "type": "Object", "tags": [], "label": "logo", @@ -90,7 +98,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.logo.control", + "id": "def-common.StorybookMock.propArguments.logo.control", "type": "Object", "tags": [], "label": "control", @@ -100,7 +108,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.logo.control.type", + "id": "def-common.StorybookMock.propArguments.logo.control.type", "type": "string", "tags": [], "label": "type", @@ -112,7 +120,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.logo.options", + "id": "def-common.StorybookMock.propArguments.logo.options", "type": "Array", "tags": [], "label": "options", @@ -125,7 +133,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.propArguments.logo.defaultValue", + "id": "def-common.StorybookMock.propArguments.logo.defaultValue", "type": "Uncategorized", "tags": [], "label": "defaultValue", @@ -142,7 +150,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.serviceArguments", + "id": "def-common.StorybookMock.serviceArguments", "type": "Object", "tags": [], "label": "serviceArguments", @@ -152,7 +160,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.serviceArguments.hasESData", + "id": "def-common.StorybookMock.serviceArguments.hasESData", "type": "Object", "tags": [], "label": "hasESData", @@ -162,7 +170,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.serviceArguments.hasESData.control", + "id": "def-common.StorybookMock.serviceArguments.hasESData.control", "type": "string", "tags": [], "label": "control", @@ -172,7 +180,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.serviceArguments.hasESData.defaultValue", + "id": "def-common.StorybookMock.serviceArguments.hasESData.defaultValue", "type": "boolean", "tags": [], "label": "defaultValue", @@ -184,7 +192,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.serviceArguments.hasUserDataView", + "id": "def-common.StorybookMock.serviceArguments.hasUserDataView", "type": "Object", "tags": [], "label": "hasUserDataView", @@ -194,7 +202,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.serviceArguments.hasUserDataView.control", + "id": "def-common.StorybookMock.serviceArguments.hasUserDataView.control", "type": "string", "tags": [], "label": "control", @@ -204,7 +212,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.serviceArguments.hasUserDataView.defaultValue", + "id": "def-common.StorybookMock.serviceArguments.hasUserDataView.defaultValue", "type": "boolean", "tags": [], "label": "defaultValue", @@ -218,7 +226,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.dependencies", + "id": "def-common.StorybookMock.dependencies", "type": "Array", "tags": [], "label": "dependencies", @@ -235,7 +243,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.getProps", + "id": "def-common.StorybookMock.getProps", "type": "Function", "tags": [], "label": "getProps", @@ -244,9 +252,9 @@ "(params: ", { "pluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxPageKibanaNoDataMocksPluginApi", - "section": "def-server.Params", + "section": "def-common.Params", "text": "Params" }, ") => { noDataConfig: { solution: any; logo: any; action: { elasticAgent: { title: string; }; }; docsLink: string; }; onDataViewCreated: ", @@ -258,7 +266,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.getProps.$1", + "id": "def-common.StorybookMock.getProps.$1", "type": "CompoundType", "tags": [], "label": "params", @@ -266,9 +274,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxPageKibanaNoDataMocksPluginApi", - "section": "def-server.Params", + "section": "def-common.Params", "text": "Params" } ], @@ -281,7 +289,7 @@ }, { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.getServices", + "id": "def-common.StorybookMock.getServices", "type": "Function", "tags": [], "label": "getServices", @@ -290,9 +298,9 @@ "(params: ", { "pluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxPageKibanaNoDataMocksPluginApi", - "section": "def-server.Params", + "section": "def-common.Params", "text": "Params" }, ") => ", @@ -303,7 +311,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.StorybookMock.getServices.$1", + "id": "def-common.StorybookMock.getServices.$1", "type": "CompoundType", "tags": [], "label": "params", @@ -311,9 +319,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxPageKibanaNoDataMocksPluginApi", - "section": "def-server.Params", + "section": "def-common.Params", "text": "Params" } ], @@ -331,7 +339,7 @@ "functions": [ { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.getServicesMock", + "id": "def-common.getServicesMock", "type": "Function", "tags": [], "label": "getServicesMock", @@ -339,9 +347,7 @@ "\nReturns the Jest-compatible service abstractions for the `KibanaNoDataPage` Provider." ], "signature": [ - "(params?: ", - "MockServicesFactoryParams", - " | undefined) => ", + "(params?: Partial | undefined) => ", "KibanaNoDataPageServices" ], "path": "packages/shared-ux/page/kibana_no_data/mocks/src/jest.ts", @@ -349,14 +355,13 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.getServicesMock.$1", + "id": "def-common.getServicesMock.$1", "type": "Object", "tags": [], "label": "params", "description": [], "signature": [ - "MockServicesFactoryParams", - " | undefined" + "Partial | undefined" ], "path": "packages/shared-ux/page/kibana_no_data/mocks/src/jest.ts", "deprecated": false, @@ -372,7 +377,7 @@ "misc": [ { "parentPluginId": "@kbn/shared-ux-page-kibana-no-data-mocks", - "id": "def-server.Params", + "id": "def-common.Params", "type": "Type", "tags": [], "label": "Params", @@ -390,13 +395,5 @@ } ], "objects": [] - }, - "common": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] } } \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx b/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx index c316e7b9d753b..c66936ac53795 100644 --- a/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-no-data-mocks title: "@kbn/shared-ux-page-kibana-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-kibana-no-data-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-no-data-mocks'] --- import kbnSharedUxPageKibanaNoDataMocksObj from './kbn_shared_ux_page_kibana_no_data_mocks.devdocs.json'; @@ -23,14 +23,14 @@ Contact [Owner missing] for questions regarding this plugin. |-------------------|-----------|------------------------|-----------------| | 25 | 0 | 24 | 0 | -## Server +## Common ### Functions - + ### Classes - + ### Consts, variables and types - + diff --git a/api_docs/kbn_shared_ux_page_kibana_template.devdocs.json b/api_docs/kbn_shared_ux_page_kibana_template.devdocs.json new file mode 100644 index 0000000000000..f8cdca8122258 --- /dev/null +++ b/api_docs/kbn_shared_ux_page_kibana_template.devdocs.json @@ -0,0 +1,218 @@ +{ + "id": "@kbn/shared-ux-page-kibana-template", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template", + "id": "def-server.KibanaPageTemplate", + "type": "Function", + "tags": [], + "label": "KibanaPageTemplate", + "description": [], + "signature": [ + "({ template, className, children, solutionNav, noDataConfig, ...rest }: React.PropsWithChildren<", + "KibanaPageTemplateProps", + ">) => JSX.Element" + ], + "path": "packages/shared-ux/page/kibana_template/impl/src/page_template.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template", + "id": "def-server.KibanaPageTemplate.$1", + "type": "CompoundType", + "tags": [], + "label": "{\n template,\n className,\n children,\n solutionNav,\n noDataConfig,\n ...rest\n}", + "description": [], + "signature": [ + "React.PropsWithChildren<", + "KibanaPageTemplateProps", + ">" + ], + "path": "packages/shared-ux/page/kibana_template/impl/src/page_template.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template", + "id": "def-server.KibanaPageTemplateKibanaProvider", + "type": "Function", + "tags": [], + "label": "KibanaPageTemplateKibanaProvider", + "description": [ + "\nKibana-specific Provider that maps dependencies to services." + ], + "signature": [ + "({ children, ...dependencies }: React.PropsWithChildren<", + "NoDataCardKibanaDependencies", + ">) => JSX.Element" + ], + "path": "packages/shared-ux/page/kibana_template/impl/src/services.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template", + "id": "def-server.KibanaPageTemplateKibanaProvider.$1", + "type": "CompoundType", + "tags": [], + "label": "{\n children,\n ...dependencies\n}", + "description": [], + "signature": [ + "React.PropsWithChildren<", + "NoDataCardKibanaDependencies", + ">" + ], + "path": "packages/shared-ux/page/kibana_template/impl/src/services.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template", + "id": "def-server.KibanaPageTemplateProvider", + "type": "Function", + "tags": [], + "label": "KibanaPageTemplateProvider", + "description": [ + "\nA Context Provider that provides services to the component and its dependencies." + ], + "signature": [ + "({ children, ...services }: React.PropsWithChildren<", + "NoDataCardServices", + ">) => JSX.Element" + ], + "path": "packages/shared-ux/page/kibana_template/impl/src/services.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template", + "id": "def-server.KibanaPageTemplateProvider.$1", + "type": "CompoundType", + "tags": [], + "label": "{\n children,\n ...services\n}", + "description": [], + "signature": [ + "React.PropsWithChildren<", + "NoDataCardServices", + ">" + ], + "path": "packages/shared-ux/page/kibana_template/impl/src/services.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template", + "id": "def-server.KibanaPageTemplateKibanaDependencies", + "type": "Type", + "tags": [], + "label": "KibanaPageTemplateKibanaDependencies", + "description": [], + "signature": [ + "KibanaDependencies", + " & ", + "RedirectAppLinksKibanaDependencies" + ], + "path": "node_modules/@kbn/shared-ux-page-kibana-template-types/index.d.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template", + "id": "def-server.KibanaPageTemplateProps", + "type": "Type", + "tags": [], + "label": "KibanaPageTemplateProps", + "description": [], + "signature": [ + "Omit<", + "EuiPageProps", + ", \"paddingSize\"> & { template?: \"default\" | \"empty\" | \"centeredBody\" | \"centeredContent\" | undefined; paddingSize?: \"none\" | \"m\" | \"s\" | \"l\" | undefined; pageSideBar?: React.ReactNode; pageSideBarProps?: ", + "EuiPageSideBarProps", + " | undefined; pageHeader?: ", + "EuiPageHeaderProps", + " | undefined; pageBodyProps?: ", + "EuiPageBodyProps", + "<\"main\"> | undefined; pageContentProps?: ", + "EuiPageContentProps", + " | undefined; pageContentBodyProps?: ", + "EuiPageContentBodyProps", + " | undefined; bottomBar?: React.ReactNode; bottomBarProps?: ", + "EuiBottomBarProps", + " | undefined; fullHeight?: boolean | \"noscroll\" | undefined; minHeight?: ", + "Property", + ".MinHeight | undefined; } & { isEmptyState?: boolean | undefined; solutionNav?: ", + "SolutionNavProps", + " | undefined; noDataConfig?: ", + "NoDataPageProps", + " | undefined; }" + ], + "path": "node_modules/@kbn/shared-ux-page-kibana-template-types/index.d.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template", + "id": "def-server.KibanaPageTemplateServices", + "type": "Type", + "tags": [], + "label": "KibanaPageTemplateServices", + "description": [], + "signature": [ + "Services", + " & ", + "RedirectAppLinksServices" + ], + "path": "node_modules/@kbn/shared-ux-page-kibana-template-types/index.d.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template", + "id": "def-server.NoDataConfig", + "type": "Type", + "tags": [], + "label": "NoDataConfig", + "description": [], + "signature": [ + "NoDataPageProps" + ], + "path": "node_modules/@kbn/shared-ux-page-no-data-config-types/index.d.ts", + "deprecated": false, + "initialIsOpen": false + } + ], + "objects": [] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_page_kibana_template.mdx b/api_docs/kbn_shared_ux_page_kibana_template.mdx new file mode 100644 index 0000000000000..9d642801a41d8 --- /dev/null +++ b/api_docs/kbn_shared_ux_page_kibana_template.mdx @@ -0,0 +1,33 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnSharedUxPageKibanaTemplatePluginApi +slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-template +title: "@kbn/shared-ux-page-kibana-template" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/shared-ux-page-kibana-template plugin +date: 2022-08-22 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-template'] +--- +import kbnSharedUxPageKibanaTemplateObj from './kbn_shared_ux_page_kibana_template.devdocs.json'; + + + +Contact [Owner missing] for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 10 | 0 | 4 | 0 | + +## Server + +### Functions + + +### Consts, variables and types + + diff --git a/api_docs/kbn_shared_ux_page_kibana_template_mocks.devdocs.json b/api_docs/kbn_shared_ux_page_kibana_template_mocks.devdocs.json new file mode 100644 index 0000000000000..5e888519540f0 --- /dev/null +++ b/api_docs/kbn_shared_ux_page_kibana_template_mocks.devdocs.json @@ -0,0 +1,860 @@ +{ + "id": "@kbn/shared-ux-page-kibana-template-mocks", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock", + "type": "Class", + "tags": [], + "label": "StorybookMock", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.StorybookMock", + "text": "StorybookMock" + }, + " extends ", + "AbstractStorybookMock", + "<", + "KibanaPageTemplateProps", + ", ", + "NoDataCardServices", + ", PropArguments, {}>" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/all.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.propArguments", + "type": "Object", + "tags": [], + "label": "propArguments", + "description": [], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/all.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.propArguments.Unnamed", + "type": "Any", + "tags": [], + "label": "Unnamed", + "description": [], + "signature": [ + "any" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/all.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.propArguments.Unnamed", + "type": "Any", + "tags": [], + "label": "Unnamed", + "description": [], + "signature": [ + "any" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/all.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.serviceArguments", + "type": "Object", + "tags": [], + "label": "serviceArguments", + "description": [], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/all.ts", + "deprecated": false, + "children": [] + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.dependencies", + "type": "Array", + "tags": [], + "label": "dependencies", + "description": [], + "signature": [ + "NoDataConfigPageStorybookMock", + "[]" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/all.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getProps", + "type": "Function", + "tags": [], + "label": "getProps", + "description": [], + "signature": [ + "(params?: ", + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + " | undefined) => ", + "KibanaPageTemplateProps" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/all.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getProps.$1", + "type": "CompoundType", + "tags": [], + "label": "params", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + " | undefined" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/all.ts", + "deprecated": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getServices", + "type": "Function", + "tags": [], + "label": "getServices", + "description": [], + "signature": [ + "(params: ", + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + ") => ", + "NoDataCardServices" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/all.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getServices.$1", + "type": "CompoundType", + "tags": [], + "label": "params", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + } + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/all.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock", + "type": "Class", + "tags": [], + "label": "StorybookMock", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.StorybookMock", + "text": "StorybookMock" + }, + " extends ", + "AbstractStorybookMock", + "<", + "KibanaPageTemplateProps", + ", ", + "NoDataCardServices", + ", ", + "NoDataConfigArguments", + ", {}>" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/no_data_config.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.propArguments", + "type": "Object", + "tags": [], + "label": "propArguments", + "description": [], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/no_data_config.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.propArguments.Unnamed", + "type": "Any", + "tags": [], + "label": "Unnamed", + "description": [], + "signature": [ + "any" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/no_data_config.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.serviceArguments", + "type": "Object", + "tags": [], + "label": "serviceArguments", + "description": [], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/no_data_config.ts", + "deprecated": false, + "children": [] + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.dependencies", + "type": "Array", + "tags": [], + "label": "dependencies", + "description": [], + "signature": [ + "NoDataConfigPageStorybookMock", + "[]" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/no_data_config.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getProps", + "type": "Function", + "tags": [], + "label": "getProps", + "description": [], + "signature": [ + "(params?: ", + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + " | undefined) => ", + "KibanaPageTemplateProps" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/no_data_config.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getProps.$1", + "type": "CompoundType", + "tags": [], + "label": "params", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + " | undefined" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/no_data_config.ts", + "deprecated": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getServices", + "type": "Function", + "tags": [], + "label": "getServices", + "description": [], + "signature": [ + "(params: ", + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + ") => ", + "NoDataCardServices" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/no_data_config.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getServices.$1", + "type": "CompoundType", + "tags": [], + "label": "params", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + } + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/no_data_config.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock", + "type": "Class", + "tags": [], + "label": "StorybookMock", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.StorybookMock", + "text": "StorybookMock" + }, + " extends ", + "AbstractStorybookMock", + "<", + "KibanaPageTemplateProps", + ", ", + "NoDataCardServices", + ", ", + "SolutionNavArguments", + ", {}>" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/solution_nav.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.propArguments", + "type": "Object", + "tags": [], + "label": "propArguments", + "description": [], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/solution_nav.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.propArguments.Unnamed", + "type": "Any", + "tags": [], + "label": "Unnamed", + "description": [], + "signature": [ + "any" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/solution_nav.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.serviceArguments", + "type": "Object", + "tags": [], + "label": "serviceArguments", + "description": [], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/solution_nav.ts", + "deprecated": false, + "children": [] + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.dependencies", + "type": "Array", + "tags": [], + "label": "dependencies", + "description": [], + "signature": [ + "NoDataConfigPageStorybookMock", + "[]" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/solution_nav.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getProps", + "type": "Function", + "tags": [], + "label": "getProps", + "description": [], + "signature": [ + "(params?: ", + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + " | undefined) => ", + "KibanaPageTemplateProps" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/solution_nav.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getProps.$1", + "type": "CompoundType", + "tags": [], + "label": "params", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + " | undefined" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/solution_nav.ts", + "deprecated": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getServices", + "type": "Function", + "tags": [], + "label": "getServices", + "description": [], + "signature": [ + "(params: ", + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + ") => ", + "NoDataCardServices" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/solution_nav.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getServices.$1", + "type": "CompoundType", + "tags": [], + "label": "params", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + } + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/solution_nav.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock", + "type": "Class", + "tags": [], + "label": "StorybookMock", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.StorybookMock", + "text": "StorybookMock" + }, + " extends ", + "AbstractStorybookMock", + "<", + "KibanaPageTemplateProps", + ", ", + "NoDataCardServices", + ", PropArguments, {}>" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/inner.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.propArguments", + "type": "Object", + "tags": [], + "label": "propArguments", + "description": [], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/inner.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.propArguments.Unnamed", + "type": "Any", + "tags": [], + "label": "Unnamed", + "description": [], + "signature": [ + "any" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/inner.tsx", + "deprecated": false + } + ] + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.serviceArguments", + "type": "Object", + "tags": [], + "label": "serviceArguments", + "description": [], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/inner.tsx", + "deprecated": false, + "children": [] + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.dependencies", + "type": "Array", + "tags": [], + "label": "dependencies", + "description": [], + "signature": [ + "never[]" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/inner.tsx", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getProps", + "type": "Function", + "tags": [], + "label": "getProps", + "description": [], + "signature": [ + "(params?: ", + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + " | undefined) => ", + "KibanaPageTemplateProps" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/inner.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getProps.$1", + "type": "CompoundType", + "tags": [], + "label": "params", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + " | undefined" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/inner.tsx", + "deprecated": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getServices", + "type": "Function", + "tags": [], + "label": "getServices", + "description": [], + "signature": [ + "(params: ", + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + ") => ", + "NoDataCardServices" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/inner.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.StorybookMock.getServices.$1", + "type": "CompoundType", + "tags": [], + "label": "params", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageKibanaTemplateMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + } + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/inner.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + } + ], + "functions": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.getKibanaDependenciesMock", + "type": "Function", + "tags": [], + "label": "getKibanaDependenciesMock", + "description": [], + "signature": [ + "() => ", + "NoDataCardKibanaDependencies" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/jest.ts", + "deprecated": false, + "children": [], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.getServicesMock", + "type": "Function", + "tags": [], + "label": "getServicesMock", + "description": [], + "signature": [ + "() => ", + "NoDataCardServices" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/jest.ts", + "deprecated": false, + "children": [], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.Params", + "type": "Type", + "tags": [], + "label": "Params", + "description": [], + "signature": [ + "ArgumentParams", + " & ", + "ArgumentParams", + "<", + "PropArguments", + ", {}> & ", + "ArgumentParams", + "<", + "PropArguments", + ", {}> & ", + "NoDataCardStorybookParams" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/all.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.Params", + "type": "Type", + "tags": [], + "label": "Params", + "description": [], + "signature": [ + "ArgumentParams", + "<", + "NoDataConfigArguments", + ", {}> & ", + "ArgumentParams", + "<", + "PropArguments", + ", {}> & ", + "ArgumentParams", + "<", + "PropArguments", + ", {}> & ", + "NoDataCardStorybookParams" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/no_data_config.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.Params", + "type": "Type", + "tags": [], + "label": "Params", + "description": [], + "signature": [ + "ArgumentParams", + "<", + "SolutionNavArguments", + ", {}> & ", + "ArgumentParams", + "<", + "PropArguments", + ", {}> & ", + "ArgumentParams", + "<", + "PropArguments", + ", {}> & ", + "NoDataCardStorybookParams" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/solution_nav.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-kibana-template-mocks", + "id": "def-common.Params", + "type": "Type", + "tags": [], + "label": "Params", + "description": [], + "signature": [ + "ArgumentParams", + " & ", + "ArgumentParams", + "<", + "PropArguments", + ", {}> & ", + "ArgumentParams", + "<", + "PropArguments", + ", {}> & ", + "NoDataCardStorybookParams" + ], + "path": "packages/shared-ux/page/kibana_template/mocks/src/storybook/inner.tsx", + "deprecated": false, + "initialIsOpen": false + } + ], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx b/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx new file mode 100644 index 0000000000000..5e33f8c616dbe --- /dev/null +++ b/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx @@ -0,0 +1,36 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnSharedUxPageKibanaTemplateMocksPluginApi +slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-template-mocks +title: "@kbn/shared-ux-page-kibana-template-mocks" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/shared-ux-page-kibana-template-mocks plugin +date: 2022-08-22 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-template-mocks'] +--- +import kbnSharedUxPageKibanaTemplateMocksObj from './kbn_shared_ux_page_kibana_template_mocks.devdocs.json'; + + + +Contact [Owner missing] for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 43 | 5 | 43 | 2 | + +## Common + +### Functions + + +### Classes + + +### Consts, variables and types + + diff --git a/api_docs/kbn_shared_ux_page_no_data.devdocs.json b/api_docs/kbn_shared_ux_page_no_data.devdocs.json new file mode 100644 index 0000000000000..b67afdf6a138c --- /dev/null +++ b/api_docs/kbn_shared_ux_page_no_data.devdocs.json @@ -0,0 +1,247 @@ +{ + "id": "@kbn/shared-ux-page-no-data", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data", + "id": "def-common.NoDataPage", + "type": "Function", + "tags": [], + "label": "NoDataPage", + "description": [], + "signature": [ + "({ solution, logo, action, docsLink, pageTitle, className, }: ", + "NoDataPageProps", + ") => JSX.Element" + ], + "path": "packages/shared-ux/page/no_data/impl/src/no_data_page.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data", + "id": "def-common.NoDataPage.$1", + "type": "Object", + "tags": [], + "label": "{\n solution,\n logo,\n action,\n docsLink,\n pageTitle,\n className,\n}", + "description": [], + "signature": [ + "NoDataPageProps" + ], + "path": "packages/shared-ux/page/no_data/impl/src/no_data_page.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data", + "id": "def-common.NoDataPageKibanaProvider", + "type": "Function", + "tags": [], + "label": "NoDataPageKibanaProvider", + "description": [ + "\nKibana-specific Provider that maps dependencies to services." + ], + "signature": [ + "({ children, ...dependencies }: React.PropsWithChildren<", + "NoDataCardKibanaDependencies", + ">) => JSX.Element" + ], + "path": "packages/shared-ux/page/no_data/impl/src/services.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data", + "id": "def-common.NoDataPageKibanaProvider.$1", + "type": "CompoundType", + "tags": [], + "label": "{\n children,\n ...dependencies\n}", + "description": [], + "signature": [ + "React.PropsWithChildren<", + "NoDataCardKibanaDependencies", + ">" + ], + "path": "packages/shared-ux/page/no_data/impl/src/services.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data", + "id": "def-common.NoDataPageProvider", + "type": "Function", + "tags": [], + "label": "NoDataPageProvider", + "description": [ + "\nA Context Provider that provides services to the component and its dependencies." + ], + "signature": [ + "({ children, ...services }: React.PropsWithChildren<", + "NoDataCardServices", + ">) => JSX.Element" + ], + "path": "packages/shared-ux/page/no_data/impl/src/services.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data", + "id": "def-common.NoDataPageProvider.$1", + "type": "CompoundType", + "tags": [], + "label": "{ children, ...services }", + "description": [], + "signature": [ + "React.PropsWithChildren<", + "NoDataCardServices", + ">" + ], + "path": "packages/shared-ux/page/no_data/impl/src/services.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data", + "id": "def-common.NoDataPageProps", + "type": "Interface", + "tags": [], + "label": "NoDataPageProps", + "description": [], + "signature": [ + "NoDataPageProps", + " extends ", + "CommonProps", + ",", + "ActionCardProps" + ], + "path": "node_modules/@kbn/shared-ux-page-no-data-types/index.d.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data", + "id": "def-common.NoDataPageProps.solution", + "type": "string", + "tags": [], + "label": "solution", + "description": [ + "\nSingle name for the current solution, used to auto-generate the title, logo, description, and button label" + ], + "path": "node_modules/@kbn/shared-ux-page-no-data-types/index.d.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data", + "id": "def-common.NoDataPageProps.docsLink", + "type": "string", + "tags": [], + "label": "docsLink", + "description": [ + "\nRequired to set the docs link for the whole solution" + ], + "path": "node_modules/@kbn/shared-ux-page-no-data-types/index.d.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data", + "id": "def-common.NoDataPageProps.logo", + "type": "string", + "tags": [], + "label": "logo", + "description": [ + "\nOptionally replace the auto-generated logo" + ], + "signature": [ + "string | undefined" + ], + "path": "node_modules/@kbn/shared-ux-page-no-data-types/index.d.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data", + "id": "def-common.NoDataPageProps.pageTitle", + "type": "string", + "tags": [], + "label": "pageTitle", + "description": [ + "\nOptionally replace the auto-generated page title (h1)" + ], + "signature": [ + "string | undefined" + ], + "path": "node_modules/@kbn/shared-ux-page-no-data-types/index.d.ts", + "deprecated": false + } + ], + "initialIsOpen": false + } + ], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data", + "id": "def-common.NoDataPageKibanaDependencies", + "type": "Type", + "tags": [], + "label": "NoDataPageKibanaDependencies", + "description": [ + "\nAn interface containing a collection of Kibana plugins and services required to\nrender this component." + ], + "signature": [ + "KibanaDependencies", + " & ", + "RedirectAppLinksKibanaDependencies" + ], + "path": "node_modules/@kbn/shared-ux-page-no-data-types/index.d.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data", + "id": "def-common.NoDataPageServices", + "type": "Type", + "tags": [], + "label": "NoDataPageServices", + "description": [ + "\nA list of services that are consumed by this component." + ], + "signature": [ + "Services", + " & ", + "RedirectAppLinksServices" + ], + "path": "node_modules/@kbn/shared-ux-page-no-data-types/index.d.ts", + "deprecated": false, + "initialIsOpen": false + } + ], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_components.mdx b/api_docs/kbn_shared_ux_page_no_data.mdx similarity index 54% rename from api_docs/kbn_shared_ux_components.mdx rename to api_docs/kbn_shared_ux_page_no_data.mdx index b98c4847a61f9..b827c909c6d39 100644 --- a/api_docs/kbn_shared_ux_components.mdx +++ b/api_docs/kbn_shared_ux_page_no_data.mdx @@ -3,15 +3,15 @@ #### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. #### Reach out in #docs-engineering for more info. #### -id: kibKbnSharedUxComponentsPluginApi -slug: /kibana-dev-docs/api/kbn-shared-ux-components -title: "@kbn/shared-ux-components" +id: kibKbnSharedUxPageNoDataPluginApi +slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data +title: "@kbn/shared-ux-page-no-data" image: https://source.unsplash.com/400x175/?github -description: API docs for the @kbn/shared-ux-components plugin -date: 2022-08-18 -tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-components'] +description: API docs for the @kbn/shared-ux-page-no-data plugin +date: 2022-08-22 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data'] --- -import kbnSharedUxComponentsObj from './kbn_shared_ux_components.devdocs.json'; +import kbnSharedUxPageNoDataObj from './kbn_shared_ux_page_no_data.devdocs.json'; @@ -21,16 +21,16 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 11 | 0 | 6 | 0 | +| 13 | 0 | 4 | 0 | ## Common ### Functions - + ### Interfaces - + ### Consts, variables and types - + diff --git a/api_docs/kbn_shared_ux_page_no_data_config.devdocs.json b/api_docs/kbn_shared_ux_page_no_data_config.devdocs.json new file mode 100644 index 0000000000000..33b90569d9d4e --- /dev/null +++ b/api_docs/kbn_shared_ux_page_no_data_config.devdocs.json @@ -0,0 +1,254 @@ +{ + "id": "@kbn/shared-ux-page-no-data-config", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config", + "id": "def-common.NoDataConfigPage", + "type": "Function", + "tags": [], + "label": "NoDataConfigPage", + "description": [], + "signature": [ + "(props: ", + "NoDataConfigPageProps", + ") => JSX.Element | null" + ], + "path": "packages/shared-ux/page/no_data_config/impl/src/no_data_config_page.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config", + "id": "def-common.NoDataConfigPage.$1", + "type": "CompoundType", + "tags": [], + "label": "props", + "description": [], + "signature": [ + "NoDataConfigPageProps" + ], + "path": "packages/shared-ux/page/no_data_config/impl/src/no_data_config_page.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config", + "id": "def-common.NoDataConfigPageKibanaProvider", + "type": "Function", + "tags": [], + "label": "NoDataConfigPageKibanaProvider", + "description": [ + "\nKibana-specific Provider that maps dependencies to services." + ], + "signature": [ + "({ children, ...dependencies }: React.PropsWithChildren<", + "NoDataCardKibanaDependencies", + ">) => JSX.Element" + ], + "path": "packages/shared-ux/page/no_data_config/impl/src/services.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config", + "id": "def-common.NoDataConfigPageKibanaProvider.$1", + "type": "CompoundType", + "tags": [], + "label": "{\n children,\n ...dependencies\n}", + "description": [], + "signature": [ + "React.PropsWithChildren<", + "NoDataCardKibanaDependencies", + ">" + ], + "path": "packages/shared-ux/page/no_data_config/impl/src/services.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config", + "id": "def-common.NoDataConfigPageProvider", + "type": "Function", + "tags": [], + "label": "NoDataConfigPageProvider", + "description": [ + "\nA Context Provider that provides services to the component and its dependencies." + ], + "signature": [ + "({ children, ...services }: React.PropsWithChildren<", + "NoDataCardServices", + ">) => JSX.Element" + ], + "path": "packages/shared-ux/page/no_data_config/impl/src/services.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config", + "id": "def-common.NoDataConfigPageProvider.$1", + "type": "CompoundType", + "tags": [], + "label": "{\n children,\n ...services\n}", + "description": [], + "signature": [ + "React.PropsWithChildren<", + "NoDataCardServices", + ">" + ], + "path": "packages/shared-ux/page/no_data_config/impl/src/services.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config", + "id": "def-common.NoDataConfigPageWithSolutionNavBar", + "type": "Function", + "tags": [], + "label": "NoDataConfigPageWithSolutionNavBar", + "description": [], + "signature": [ + "{ (props: ", + "Props", + " & { template?: \"default\" | \"empty\" | \"centeredBody\" | \"centeredContent\" | undefined; paddingSize?: \"none\" | \"m\" | \"s\" | \"l\" | undefined; pageSideBar?: React.ReactNode; pageSideBarProps?: ", + "EuiPageSideBarProps", + " | undefined; pageHeader?: ", + "EuiPageHeaderProps", + " | undefined; pageBodyProps?: ", + "EuiPageBodyProps", + "<\"main\"> | undefined; pageContentProps?: ", + "EuiPageContentProps", + " | undefined; pageContentBodyProps?: ", + "EuiPageContentBodyProps", + " | undefined; bottomBar?: React.ReactNode; bottomBarProps?: ", + "EuiBottomBarProps", + " | undefined; fullHeight?: boolean | \"noscroll\" | undefined; minHeight?: ", + "Property", + ".MinHeight | undefined; } & { noDataConfig?: ", + "NoDataPageProps", + " | undefined; }>): JSX.Element; displayName: string; }" + ], + "path": "packages/shared-ux/page/no_data_config/impl/src/no_data_config_page.tsx", + "deprecated": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config", + "id": "def-common.NoDataConfigPageWithSolutionNavBar.$1", + "type": "CompoundType", + "tags": [], + "label": "props", + "description": [], + "signature": [ + "P & ", + "TemplateProps", + " & { isEmptyState?: boolean | undefined; } & { solutionNav: ", + "SolutionNavProps", + "; }" + ], + "path": "node_modules/@types/kbn__shared-ux-page-solution-nav/index.d.ts", + "deprecated": false + } + ], + "initialIsOpen": false + } + ], + "interfaces": [], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config", + "id": "def-common.NoDataConfigPageKibanaDependencies", + "type": "Type", + "tags": [], + "label": "NoDataConfigPageKibanaDependencies", + "description": [], + "signature": [ + "KibanaDependencies", + " & ", + "RedirectAppLinksKibanaDependencies" + ], + "path": "node_modules/@kbn/shared-ux-page-no-data-config-types/index.d.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config", + "id": "def-common.NoDataConfigPageProps", + "type": "Type", + "tags": [], + "label": "NoDataConfigPageProps", + "description": [], + "signature": [ + "Omit<", + "EuiPageProps", + ", \"paddingSize\"> & { template?: \"default\" | \"empty\" | \"centeredBody\" | \"centeredContent\" | undefined; paddingSize?: \"none\" | \"m\" | \"s\" | \"l\" | undefined; pageSideBar?: React.ReactNode; pageSideBarProps?: ", + "EuiPageSideBarProps", + " | undefined; pageHeader?: ", + "EuiPageHeaderProps", + " | undefined; pageBodyProps?: ", + "EuiPageBodyProps", + "<\"main\"> | undefined; pageContentProps?: ", + "EuiPageContentProps", + " | undefined; pageContentBodyProps?: ", + "EuiPageContentBodyProps", + " | undefined; bottomBar?: React.ReactNode; bottomBarProps?: ", + "EuiBottomBarProps", + " | undefined; fullHeight?: boolean | \"noscroll\" | undefined; minHeight?: ", + "Property", + ".MinHeight | undefined; } & { noDataConfig?: ", + "NoDataPageProps", + " | undefined; }" + ], + "path": "node_modules/@kbn/shared-ux-page-no-data-config-types/index.d.ts", + "deprecated": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config", + "id": "def-common.NoDataConfigPageServices", + "type": "Type", + "tags": [], + "label": "NoDataConfigPageServices", + "description": [], + "signature": [ + "Services", + " & ", + "RedirectAppLinksServices" + ], + "path": "node_modules/@kbn/shared-ux-page-no-data-config-types/index.d.ts", + "deprecated": false, + "initialIsOpen": false + } + ], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_storybook.mdx b/api_docs/kbn_shared_ux_page_no_data_config.mdx similarity index 50% rename from api_docs/kbn_shared_ux_storybook.mdx rename to api_docs/kbn_shared_ux_page_no_data_config.mdx index 87f77aff15cd6..3c32b0e7d5672 100644 --- a/api_docs/kbn_shared_ux_storybook.mdx +++ b/api_docs/kbn_shared_ux_page_no_data_config.mdx @@ -3,15 +3,15 @@ #### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. #### Reach out in #docs-engineering for more info. #### -id: kibKbnSharedUxStorybookPluginApi -slug: /kibana-dev-docs/api/kbn-shared-ux-storybook -title: "@kbn/shared-ux-storybook" +id: kibKbnSharedUxPageNoDataConfigPluginApi +slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data-config +title: "@kbn/shared-ux-page-no-data-config" image: https://source.unsplash.com/400x175/?github -description: API docs for the @kbn/shared-ux-storybook plugin -date: 2022-08-18 -tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-storybook'] +description: API docs for the @kbn/shared-ux-page-no-data-config plugin +date: 2022-08-22 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data-config'] --- -import kbnSharedUxStorybookObj from './kbn_shared_ux_storybook.devdocs.json'; +import kbnSharedUxPageNoDataConfigObj from './kbn_shared_ux_page_no_data_config.devdocs.json'; @@ -21,13 +21,13 @@ Contact [Owner missing] for questions regarding this plugin. | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 16 | 0 | 7 | 0 | +| 11 | 0 | 5 | 0 | ## Common ### Functions - + -### Interfaces - +### Consts, variables and types + diff --git a/api_docs/kbn_shared_ux_page_no_data_config_mocks.devdocs.json b/api_docs/kbn_shared_ux_page_no_data_config_mocks.devdocs.json new file mode 100644 index 0000000000000..9cff904b1bb17 --- /dev/null +++ b/api_docs/kbn_shared_ux_page_no_data_config_mocks.devdocs.json @@ -0,0 +1,380 @@ +{ + "id": "@kbn/shared-ux-page-no-data-config-mocks", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock", + "type": "Class", + "tags": [], + "label": "NoDataConfigPageStorybookMock", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageNoDataConfigMocksPluginApi", + "section": "def-common.NoDataConfigPageStorybookMock", + "text": "NoDataConfigPageStorybookMock" + }, + " extends ", + "AbstractStorybookMock", + "<", + "NoDataConfigPageProps", + ", ", + "NoDataCardServices", + ", PropArguments, {}>" + ], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.propArguments", + "type": "Object", + "tags": [], + "label": "propArguments", + "description": [], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.propArguments.solution", + "type": "Object", + "tags": [], + "label": "solution", + "description": [], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.propArguments.solution.control", + "type": "string", + "tags": [], + "label": "control", + "description": [], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.propArguments.solution.defaultValue", + "type": "string", + "tags": [], + "label": "defaultValue", + "description": [], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.propArguments.logo", + "type": "Object", + "tags": [], + "label": "logo", + "description": [], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.propArguments.logo.control", + "type": "Object", + "tags": [], + "label": "control", + "description": [], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.propArguments.logo.control.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.propArguments.logo.options", + "type": "Array", + "tags": [], + "label": "options", + "description": [], + "signature": [ + "(string | undefined)[]" + ], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.propArguments.logo.defaultValue", + "type": "Uncategorized", + "tags": [], + "label": "defaultValue", + "description": [], + "signature": [ + "undefined" + ], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.propArguments.docsLink", + "type": "Object", + "tags": [], + "label": "docsLink", + "description": [], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.propArguments.docsLink.control", + "type": "string", + "tags": [], + "label": "control", + "description": [], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.propArguments.docsLink.defaultValue", + "type": "string", + "tags": [], + "label": "defaultValue", + "description": [], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.propArguments.pageTitle", + "type": "Object", + "tags": [], + "label": "pageTitle", + "description": [], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.propArguments.pageTitle.control", + "type": "string", + "tags": [], + "label": "control", + "description": [], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.propArguments.pageTitle.defaultValue", + "type": "string", + "tags": [], + "label": "defaultValue", + "description": [], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false + } + ] + } + ] + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.serviceArguments", + "type": "Object", + "tags": [], + "label": "serviceArguments", + "description": [], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false, + "children": [] + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.dependencies", + "type": "Array", + "tags": [], + "label": "dependencies", + "description": [], + "signature": [ + "NoDataPageStorybookMock", + "[]" + ], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.getProps", + "type": "Function", + "tags": [], + "label": "getProps", + "description": [], + "signature": [ + "(params?: ", + { + "pluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageNoDataConfigMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + " | undefined) => ", + "NoDataConfigPageProps" + ], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.getProps.$1", + "type": "CompoundType", + "tags": [], + "label": "params", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageNoDataConfigMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + " | undefined" + ], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.getServices", + "type": "Function", + "tags": [], + "label": "getServices", + "description": [], + "signature": [ + "(params: ", + { + "pluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageNoDataConfigMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + ") => ", + "NoDataCardServices" + ], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.NoDataConfigPageStorybookMock.getServices.$1", + "type": "CompoundType", + "tags": [], + "label": "params", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageNoDataConfigMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + } + ], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + } + ], + "functions": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.getServicesMock", + "type": "Function", + "tags": [], + "label": "getServicesMock", + "description": [], + "signature": [ + "() => ", + "NoDataCardServices" + ], + "path": "packages/shared-ux/page/no_data_config/mocks/src/jest.ts", + "deprecated": false, + "children": [], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-config-mocks", + "id": "def-common.Params", + "type": "Type", + "tags": [], + "label": "Params", + "description": [], + "signature": [ + "ArgumentParams", + " & ", + "ArgumentParams", + "<", + "PropArguments", + ", {}> & ", + "NoDataCardStorybookParams" + ], + "path": "packages/shared-ux/page/no_data_config/mocks/src/storybook.ts", + "deprecated": false, + "initialIsOpen": false + } + ], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx b/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx new file mode 100644 index 0000000000000..b498e172e6b32 --- /dev/null +++ b/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx @@ -0,0 +1,36 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnSharedUxPageNoDataConfigMocksPluginApi +slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data-config-mocks +title: "@kbn/shared-ux-page-no-data-config-mocks" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/shared-ux-page-no-data-config-mocks plugin +date: 2022-08-22 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data-config-mocks'] +--- +import kbnSharedUxPageNoDataConfigMocksObj from './kbn_shared_ux_page_no_data_config_mocks.devdocs.json'; + + + +Contact [Owner missing] for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 24 | 0 | 24 | 0 | + +## Common + +### Functions + + +### Classes + + +### Consts, variables and types + + diff --git a/api_docs/kbn_shared_ux_page_no_data_mocks.devdocs.json b/api_docs/kbn_shared_ux_page_no_data_mocks.devdocs.json new file mode 100644 index 0000000000000..76c026ad3a55d --- /dev/null +++ b/api_docs/kbn_shared_ux_page_no_data_mocks.devdocs.json @@ -0,0 +1,433 @@ +{ + "id": "@kbn/shared-ux-page-no-data-mocks", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock", + "type": "Class", + "tags": [], + "label": "NoDataPageStorybookMock", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-no-data-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageNoDataMocksPluginApi", + "section": "def-common.NoDataPageStorybookMock", + "text": "NoDataPageStorybookMock" + }, + " extends ", + "AbstractStorybookMock", + "<", + "NoDataPageProps", + ", ", + "NoDataCardServices", + ", PropArguments, {}>" + ], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.propArguments", + "type": "Object", + "tags": [], + "label": "propArguments", + "description": [], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.propArguments.solution", + "type": "Object", + "tags": [], + "label": "solution", + "description": [], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.propArguments.solution.control", + "type": "string", + "tags": [], + "label": "control", + "description": [], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.propArguments.solution.defaultValue", + "type": "string", + "tags": [], + "label": "defaultValue", + "description": [], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.propArguments.logo", + "type": "Object", + "tags": [], + "label": "logo", + "description": [], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.propArguments.logo.control", + "type": "Object", + "tags": [], + "label": "control", + "description": [], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.propArguments.logo.control.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.propArguments.logo.options", + "type": "Array", + "tags": [], + "label": "options", + "description": [], + "signature": [ + "(string | undefined)[]" + ], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.propArguments.logo.defaultValue", + "type": "Uncategorized", + "tags": [], + "label": "defaultValue", + "description": [], + "signature": [ + "undefined" + ], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.propArguments.docsLink", + "type": "Object", + "tags": [], + "label": "docsLink", + "description": [], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.propArguments.docsLink.control", + "type": "string", + "tags": [], + "label": "control", + "description": [], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.propArguments.docsLink.defaultValue", + "type": "string", + "tags": [], + "label": "defaultValue", + "description": [], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false + } + ] + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.propArguments.pageTitle", + "type": "Object", + "tags": [], + "label": "pageTitle", + "description": [], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.propArguments.pageTitle.control", + "type": "string", + "tags": [], + "label": "control", + "description": [], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.propArguments.pageTitle.defaultValue", + "type": "string", + "tags": [], + "label": "defaultValue", + "description": [], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false + } + ] + } + ] + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.serviceArguments", + "type": "Object", + "tags": [], + "label": "serviceArguments", + "description": [], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false, + "children": [] + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.dependencies", + "type": "Array", + "tags": [], + "label": "dependencies", + "description": [], + "signature": [ + "NoDataCardStorybookMock", + "[]" + ], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.getProps", + "type": "Function", + "tags": [], + "label": "getProps", + "description": [], + "signature": [ + "(params?: ", + { + "pluginId": "@kbn/shared-ux-page-no-data-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageNoDataMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + " | undefined) => ", + "NoDataPageProps" + ], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.getProps.$1", + "type": "CompoundType", + "tags": [], + "label": "params", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-no-data-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageNoDataMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + " | undefined" + ], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.getServices", + "type": "Function", + "tags": [], + "label": "getServices", + "description": [], + "signature": [ + "(params: ", + { + "pluginId": "@kbn/shared-ux-page-no-data-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageNoDataMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + }, + ") => ", + "NoDataCardServices" + ], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.NoDataPageStorybookMock.getServices.$1", + "type": "CompoundType", + "tags": [], + "label": "params", + "description": [], + "signature": [ + { + "pluginId": "@kbn/shared-ux-page-no-data-mocks", + "scope": "common", + "docId": "kibKbnSharedUxPageNoDataMocksPluginApi", + "section": "def-common.Params", + "text": "Params" + } + ], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + } + ], + "functions": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.getKibanaDependenciesMock", + "type": "Function", + "tags": [], + "label": "getKibanaDependenciesMock", + "description": [ + "\nReturn a Jest mock of the Kibana dependencies for the `NoDataPageKibanaProvider`." + ], + "signature": [ + "(params?: Partial<", + "NoDataCardServices", + ">) => ", + "NoDataCardKibanaDependencies" + ], + "path": "packages/shared-ux/page/no_data/mocks/src/jest.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.getKibanaDependenciesMock.$1", + "type": "Object", + "tags": [], + "label": "params", + "description": [], + "signature": [ + "Partial<", + "NoDataCardServices", + ">" + ], + "path": "packages/shared-ux/page/no_data/mocks/src/jest.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.getServicesMock", + "type": "Function", + "tags": [], + "label": "getServicesMock", + "description": [], + "signature": [ + "(params?: Partial<", + "NoDataCardServices", + ">) => ", + "NoDataCardServices" + ], + "path": "packages/shared-ux/page/no_data/mocks/src/jest.ts", + "deprecated": false, + "children": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.getServicesMock.$1", + "type": "Object", + "tags": [], + "label": "params", + "description": [], + "signature": [ + "Partial<", + "NoDataCardServices", + ">" + ], + "path": "packages/shared-ux/page/no_data/mocks/src/jest.ts", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/shared-ux-page-no-data-mocks", + "id": "def-common.Params", + "type": "Type", + "tags": [], + "label": "Params", + "description": [], + "signature": [ + "ArgumentParams", + " & ", + "NoDataCardStorybookParams" + ], + "path": "packages/shared-ux/page/no_data/mocks/src/storybook.ts", + "deprecated": false, + "initialIsOpen": false + } + ], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_page_no_data_mocks.mdx b/api_docs/kbn_shared_ux_page_no_data_mocks.mdx new file mode 100644 index 0000000000000..6254e19d57a76 --- /dev/null +++ b/api_docs/kbn_shared_ux_page_no_data_mocks.mdx @@ -0,0 +1,36 @@ +--- +#### +#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. +#### Reach out in #docs-engineering for more info. +#### +id: kibKbnSharedUxPageNoDataMocksPluginApi +slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data-mocks +title: "@kbn/shared-ux-page-no-data-mocks" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/shared-ux-page-no-data-mocks plugin +date: 2022-08-22 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data-mocks'] +--- +import kbnSharedUxPageNoDataMocksObj from './kbn_shared_ux_page_no_data_mocks.devdocs.json'; + + + +Contact [Owner missing] for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 27 | 0 | 26 | 0 | + +## Common + +### Functions + + +### Classes + + +### Consts, variables and types + + diff --git a/api_docs/kbn_shared_ux_page_solution_nav.mdx b/api_docs/kbn_shared_ux_page_solution_nav.mdx index 41361fcc40286..9057266d79f40 100644 --- a/api_docs/kbn_shared_ux_page_solution_nav.mdx +++ b/api_docs/kbn_shared_ux_page_solution_nav.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-solution-nav title: "@kbn/shared-ux-page-solution-nav" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-solution-nav plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-solution-nav'] --- import kbnSharedUxPageSolutionNavObj from './kbn_shared_ux_page_solution_nav.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_prompt_no_data_views.devdocs.json b/api_docs/kbn_shared_ux_prompt_no_data_views.devdocs.json index 2a8c4dc5623ba..6b323a41bb51d 100644 --- a/api_docs/kbn_shared_ux_prompt_no_data_views.devdocs.json +++ b/api_docs/kbn_shared_ux_prompt_no_data_views.devdocs.json @@ -100,7 +100,7 @@ ], "signature": [ "({ children, ...services }: React.PropsWithChildren<", - "NoDataViewsPromptKibanaServices", + "NoDataViewsPromptKibanaDependencies", ">) => JSX.Element" ], "path": "packages/shared-ux/prompt/no_data_views/impl/src/services.tsx", @@ -115,7 +115,7 @@ "description": [], "signature": [ "React.PropsWithChildren<", - "NoDataViewsPromptKibanaServices", + "NoDataViewsPromptKibanaDependencies", ">" ], "path": "packages/shared-ux/prompt/no_data_views/impl/src/services.tsx", @@ -239,10 +239,10 @@ }, { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views", - "id": "def-common.NoDataViewsPromptKibanaServices", + "id": "def-common.NoDataViewsPromptKibanaDependencies", "type": "Interface", "tags": [], - "label": "NoDataViewsPromptKibanaServices", + "label": "NoDataViewsPromptKibanaDependencies", "description": [ "\nKibana-specific service types." ], @@ -251,7 +251,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views", - "id": "def-common.NoDataViewsPromptKibanaServices.coreStart", + "id": "def-common.NoDataViewsPromptKibanaDependencies.coreStart", "type": "Object", "tags": [], "label": "coreStart", @@ -264,7 +264,7 @@ }, { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views", - "id": "def-common.NoDataViewsPromptKibanaServices.dataViewEditor", + "id": "def-common.NoDataViewsPromptKibanaDependencies.dataViewEditor", "type": "Object", "tags": [], "label": "dataViewEditor", diff --git a/api_docs/kbn_shared_ux_prompt_no_data_views.mdx b/api_docs/kbn_shared_ux_prompt_no_data_views.mdx index c808c5622a8ed..7385ebf756065 100644 --- a/api_docs/kbn_shared_ux_prompt_no_data_views.mdx +++ b/api_docs/kbn_shared_ux_prompt_no_data_views.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-prompt-no-data-views title: "@kbn/shared-ux-prompt-no-data-views" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-prompt-no-data-views plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-prompt-no-data-views'] --- import kbnSharedUxPromptNoDataViewsObj from './kbn_shared_ux_prompt_no_data_views.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.devdocs.json b/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.devdocs.json index 33f49ec84b7fa..6ce6b2d959557 100644 --- a/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.devdocs.json +++ b/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.devdocs.json @@ -9,10 +9,18 @@ "objects": [] }, "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { "classes": [ { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.StorybookMock", + "id": "def-common.StorybookMock", "type": "Class", "tags": [], "label": "StorybookMock", @@ -20,9 +28,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxPromptNoDataViewsMocksPluginApi", - "section": "def-server.StorybookMock", + "section": "def-common.StorybookMock", "text": "StorybookMock" }, " extends ", @@ -38,7 +46,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.StorybookMock.propArguments", + "id": "def-common.StorybookMock.propArguments", "type": "Object", "tags": [], "label": "propArguments", @@ -49,7 +57,7 @@ }, { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.StorybookMock.serviceArguments", + "id": "def-common.StorybookMock.serviceArguments", "type": "Object", "tags": [], "label": "serviceArguments", @@ -59,7 +67,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.StorybookMock.serviceArguments.canCreateNewDataView", + "id": "def-common.StorybookMock.serviceArguments.canCreateNewDataView", "type": "Object", "tags": [], "label": "canCreateNewDataView", @@ -69,7 +77,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.StorybookMock.serviceArguments.canCreateNewDataView.control", + "id": "def-common.StorybookMock.serviceArguments.canCreateNewDataView.control", "type": "string", "tags": [], "label": "control", @@ -79,7 +87,7 @@ }, { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.StorybookMock.serviceArguments.canCreateNewDataView.defaultValue", + "id": "def-common.StorybookMock.serviceArguments.canCreateNewDataView.defaultValue", "type": "boolean", "tags": [], "label": "defaultValue", @@ -91,7 +99,7 @@ }, { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.StorybookMock.serviceArguments.dataViewsDocLink", + "id": "def-common.StorybookMock.serviceArguments.dataViewsDocLink", "type": "Object", "tags": [], "label": "dataViewsDocLink", @@ -101,7 +109,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.StorybookMock.serviceArguments.dataViewsDocLink.options", + "id": "def-common.StorybookMock.serviceArguments.dataViewsDocLink.options", "type": "Array", "tags": [], "label": "options", @@ -114,7 +122,7 @@ }, { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.StorybookMock.serviceArguments.dataViewsDocLink.control", + "id": "def-common.StorybookMock.serviceArguments.dataViewsDocLink.control", "type": "Object", "tags": [], "label": "control", @@ -124,7 +132,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.StorybookMock.serviceArguments.dataViewsDocLink.control.type", + "id": "def-common.StorybookMock.serviceArguments.dataViewsDocLink.control.type", "type": "string", "tags": [], "label": "type", @@ -140,7 +148,7 @@ }, { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.StorybookMock.dependencies", + "id": "def-common.StorybookMock.dependencies", "type": "Array", "tags": [], "label": "dependencies", @@ -153,7 +161,7 @@ }, { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.StorybookMock.getProps", + "id": "def-common.StorybookMock.getProps", "type": "Function", "tags": [], "label": "getProps", @@ -170,7 +178,7 @@ }, { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.StorybookMock.getServices", + "id": "def-common.StorybookMock.getServices", "type": "Function", "tags": [], "label": "getServices", @@ -179,9 +187,9 @@ "(params: ", { "pluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxPromptNoDataViewsMocksPluginApi", - "section": "def-server.Params", + "section": "def-common.Params", "text": "Params" }, ") => ", @@ -192,7 +200,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.StorybookMock.getServices.$1", + "id": "def-common.StorybookMock.getServices.$1", "type": "Object", "tags": [], "label": "params", @@ -200,9 +208,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxPromptNoDataViewsMocksPluginApi", - "section": "def-server.Params", + "section": "def-common.Params", "text": "Params" } ], @@ -220,7 +228,7 @@ "functions": [ { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.getNoDataViewsPromptServicesMock", + "id": "def-common.getNoDataViewsPromptServicesMock", "type": "Function", "tags": [], "label": "getNoDataViewsPromptServicesMock", @@ -238,7 +246,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.getNoDataViewsPromptServicesMock.$1", + "id": "def-common.getNoDataViewsPromptServicesMock.$1", "type": "Object", "tags": [], "label": "params", @@ -262,7 +270,7 @@ "misc": [ { "parentPluginId": "@kbn/shared-ux-prompt-no-data-views-mocks", - "id": "def-server.Params", + "id": "def-common.Params", "type": "Type", "tags": [], "label": "Params", @@ -276,13 +284,5 @@ } ], "objects": [] - }, - "common": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] } } \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx b/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx index 7d07e9de1ed81..945f8088d3827 100644 --- a/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx +++ b/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-prompt-no-data-views-mocks title: "@kbn/shared-ux-prompt-no-data-views-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-prompt-no-data-views-mocks plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-prompt-no-data-views-mocks'] --- import kbnSharedUxPromptNoDataViewsMocksObj from './kbn_shared_ux_prompt_no_data_views_mocks.devdocs.json'; @@ -23,14 +23,14 @@ Contact [Owner missing] for questions regarding this plugin. |-------------------|-----------|------------------------|-----------------| | 17 | 0 | 16 | 0 | -## Server +## Common ### Functions - + ### Classes - + ### Consts, variables and types - + diff --git a/api_docs/kbn_shared_ux_services.devdocs.json b/api_docs/kbn_shared_ux_services.devdocs.json deleted file mode 100644 index b608a43ecc744..0000000000000 --- a/api_docs/kbn_shared_ux_services.devdocs.json +++ /dev/null @@ -1,1568 +0,0 @@ -{ - "id": "@kbn/shared-ux-services", - "client": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "server": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "common": { - "classes": [], - "functions": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServicesFactory", - "type": "Function", - "tags": [], - "label": "mockServicesFactory", - "description": [ - "\nA factory function for creating a Jest-based implementation of `SharedUxServices`." - ], - "signature": [ - "(params?: ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.MockServicesFactoryParams", - "text": "MockServicesFactoryParams" - }, - " | undefined) => { application: ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxApplicationService", - "text": "SharedUxApplicationService" - }, - "; docLinks: ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxDocLinksService", - "text": "SharedUxDocLinksService" - }, - "; editors: ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxEditorsService", - "text": "SharedUxEditorsService" - }, - "; http: ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxHttpService", - "text": "SharedUxHttpService" - }, - "; permissions: ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxUserPermissionsService", - "text": "SharedUxUserPermissionsService" - }, - "; platform: ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxPlatformService", - "text": "SharedUxPlatformService" - }, - "; data: ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxDataService", - "text": "SharedUxDataService" - }, - "; }" - ], - "path": "packages/kbn-shared-ux-services/src/services/mock/index.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServicesFactory.$1", - "type": "Object", - "tags": [], - "label": "params", - "description": [], - "signature": [ - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.MockServicesFactoryParams", - "text": "MockServicesFactoryParams" - }, - " | undefined" - ], - "path": "packages/kbn-shared-ux-services/src/services/mock/index.ts", - "deprecated": false, - "isRequired": false - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxServicesProvider", - "type": "Function", - "tags": [], - "label": "SharedUxServicesProvider", - "description": [ - "\nThe `React.Context` Provider component for the `SharedUxServices` context. Any\nplugin or environment that consumes SharedUX components needs to wrap their React\ntree with this provider.\n\nWithin a plugin, you can use use the Shared UX plugin and retrieve a fully-configured\ncontext from the `start` contract." - ], - "signature": [ - "({ children, ...services }: React.PropsWithChildren<", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxServices", - "text": "SharedUxServices" - }, - ">) => JSX.Element" - ], - "path": "packages/kbn-shared-ux-services/src/context.tsx", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxServicesProvider.$1", - "type": "CompoundType", - "tags": [], - "label": "{ children, ...services }", - "description": [], - "signature": [ - "React.PropsWithChildren<", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxServices", - "text": "SharedUxServices" - }, - ">" - ], - "path": "packages/kbn-shared-ux-services/src/context.tsx", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServicesFactory", - "type": "Function", - "tags": [], - "label": "stubServicesFactory", - "description": [ - "\nA factory function for creating simple stubbed implementations of all `SharedUxServices`." - ], - "signature": [ - "() => { application: ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxApplicationService", - "text": "SharedUxApplicationService" - }, - "; docLinks: ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxDocLinksService", - "text": "SharedUxDocLinksService" - }, - "; editors: ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxEditorsService", - "text": "SharedUxEditorsService" - }, - "; http: ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxHttpService", - "text": "SharedUxHttpService" - }, - "; permissions: ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxUserPermissionsService", - "text": "SharedUxUserPermissionsService" - }, - "; platform: ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxPlatformService", - "text": "SharedUxPlatformService" - }, - "; data: ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxDataService", - "text": "SharedUxDataService" - }, - "; }" - ], - "path": "packages/kbn-shared-ux-services/src/services/stub/index.ts", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.useApplication", - "type": "Function", - "tags": [], - "label": "useApplication", - "description": [], - "signature": [ - "() => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxApplicationService", - "text": "SharedUxApplicationService" - } - ], - "path": "packages/kbn-shared-ux-services/src/context.tsx", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.useData", - "type": "Function", - "tags": [], - "label": "useData", - "description": [ - "\nReact hook for accessing the pre-wired `SharedUxDataService`." - ], - "signature": [ - "() => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxDataService", - "text": "SharedUxDataService" - } - ], - "path": "packages/kbn-shared-ux-services/src/context.tsx", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.useDocLinks", - "type": "Function", - "tags": [], - "label": "useDocLinks", - "description": [ - "\nReact hook for accessing the pre-wired `SharedUxDocLinksService`." - ], - "signature": [ - "() => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxDocLinksService", - "text": "SharedUxDocLinksService" - } - ], - "path": "packages/kbn-shared-ux-services/src/context.tsx", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.useEditors", - "type": "Function", - "tags": [], - "label": "useEditors", - "description": [ - "\nReact hook for accessing the pre-wired `SharedUxEditorsService`." - ], - "signature": [ - "() => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxEditorsService", - "text": "SharedUxEditorsService" - } - ], - "path": "packages/kbn-shared-ux-services/src/context.tsx", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.useHttp", - "type": "Function", - "tags": [], - "label": "useHttp", - "description": [], - "signature": [ - "() => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxHttpService", - "text": "SharedUxHttpService" - } - ], - "path": "packages/kbn-shared-ux-services/src/context.tsx", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.usePermissions", - "type": "Function", - "tags": [], - "label": "usePermissions", - "description": [ - "\nReact hook for accessing the pre-wired `SharedUxPermissionsService`." - ], - "signature": [ - "() => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxUserPermissionsService", - "text": "SharedUxUserPermissionsService" - } - ], - "path": "packages/kbn-shared-ux-services/src/context.tsx", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.usePlatformService", - "type": "Function", - "tags": [], - "label": "usePlatformService", - "description": [ - "\nReact hook for accessing the pre-wired `SharedUxPlatformService`." - ], - "signature": [ - "() => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxPlatformService", - "text": "SharedUxPlatformService" - } - ], - "path": "packages/kbn-shared-ux-services/src/context.tsx", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.useSharedUxServices", - "type": "Function", - "tags": [], - "label": "useSharedUxServices", - "description": [ - "\nReact hook for accessing pre-wired `SharedUxServices`." - ], - "signature": [ - "() => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxServices", - "text": "SharedUxServices" - } - ], - "path": "packages/kbn-shared-ux-services/src/context.tsx", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - } - ], - "interfaces": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.MockServicesFactoryParams", - "type": "Interface", - "tags": [], - "label": "MockServicesFactoryParams", - "description": [], - "path": "packages/kbn-shared-ux-services/src/services/mock/index.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.MockServicesFactoryParams.config", - "type": "Object", - "tags": [], - "label": "config", - "description": [], - "signature": [ - "MockDataServiceFactoryConfig" - ], - "path": "packages/kbn-shared-ux-services/src/services/mock/index.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxApplicationService", - "type": "Interface", - "tags": [], - "label": "SharedUxApplicationService", - "description": [], - "path": "packages/kbn-shared-ux-services/src/services/application.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxApplicationService.navigateToUrl", - "type": "Function", - "tags": [], - "label": "navigateToUrl", - "description": [], - "signature": [ - "(url: string) => void | Promise" - ], - "path": "packages/kbn-shared-ux-services/src/services/application.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxApplicationService.navigateToUrl.$1", - "type": "string", - "tags": [], - "label": "url", - "description": [], - "signature": [ - "string" - ], - "path": "packages/kbn-shared-ux-services/src/services/application.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxApplicationService.currentAppId$", - "type": "Object", - "tags": [], - "label": "currentAppId$", - "description": [], - "signature": [ - "Observable", - "" - ], - "path": "packages/kbn-shared-ux-services/src/services/application.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxDataService", - "type": "Interface", - "tags": [], - "label": "SharedUxDataService", - "description": [ - "\nA service providing data information. Typically used for handling of empty state.." - ], - "path": "packages/kbn-shared-ux-services/src/services/data.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxDataService.hasESData", - "type": "Function", - "tags": [], - "label": "hasESData", - "description": [ - "True if the cluster contains data, false otherwise." - ], - "signature": [ - "() => Promise" - ], - "path": "packages/kbn-shared-ux-services/src/services/data.ts", - "deprecated": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxDataService.hasUserDataView", - "type": "Function", - "tags": [], - "label": "hasUserDataView", - "description": [ - "True if Kibana instance contains user-created data view, false otherwise." - ], - "signature": [ - "() => Promise" - ], - "path": "packages/kbn-shared-ux-services/src/services/data.ts", - "deprecated": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxDataService.hasDataView", - "type": "Function", - "tags": [], - "label": "hasDataView", - "description": [ - "True if Kibana instance contains any data view, including system-created ones." - ], - "signature": [ - "() => Promise" - ], - "path": "packages/kbn-shared-ux-services/src/services/data.ts", - "deprecated": false, - "children": [], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxDocLinksService", - "type": "Interface", - "tags": [], - "label": "SharedUxDocLinksService", - "description": [ - "\nA service providing links to documentation about various features in Kibana." - ], - "path": "packages/kbn-shared-ux-services/src/services/doc_links.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxDocLinksService.dataViewsDocLink", - "type": "string", - "tags": [], - "label": "dataViewsDocLink", - "description": [ - "A link to information about Data Views in Kibana" - ], - "path": "packages/kbn-shared-ux-services/src/services/doc_links.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxEditorsService", - "type": "Interface", - "tags": [], - "label": "SharedUxEditorsService", - "description": [ - "\nA service providing methods to invoke and interact with various editors provided\nin Kibana." - ], - "path": "packages/kbn-shared-ux-services/src/services/editors.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxEditorsService.openDataViewEditor", - "type": "Function", - "tags": [], - "label": "openDataViewEditor", - "description": [ - "A method to open the Data View Editor flow." - ], - "signature": [ - "(options: DataViewEditorOptions) => () => void" - ], - "path": "packages/kbn-shared-ux-services/src/services/editors.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxEditorsService.openDataViewEditor.$1", - "type": "Object", - "tags": [], - "label": "options", - "description": [], - "signature": [ - "DataViewEditorOptions" - ], - "path": "packages/kbn-shared-ux-services/src/services/editors.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxHttpService", - "type": "Interface", - "tags": [], - "label": "SharedUxHttpService", - "description": [], - "path": "packages/kbn-shared-ux-services/src/services/http.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxHttpService.addBasePath", - "type": "Function", - "tags": [], - "label": "addBasePath", - "description": [], - "signature": [ - "(url: string) => string" - ], - "path": "packages/kbn-shared-ux-services/src/services/http.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxHttpService.addBasePath.$1", - "type": "string", - "tags": [], - "label": "url", - "description": [], - "signature": [ - "string" - ], - "path": "packages/kbn-shared-ux-services/src/services/http.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxPlatformService", - "type": "Interface", - "tags": [], - "label": "SharedUxPlatformService", - "description": [ - "\nA service providing methods to interact with the platform in which this code is\nrunning, (almost always Kibana).\n\nRather than provide the entire `CoreStart` contract to components, we provide simplified\nabstractions around a use case specific to Shared UX. This way, we know exactly how the\n`CoreStart` and other plugins are used. This makes mocking and refactoring easier when\n upstream dependencies change." - ], - "path": "packages/kbn-shared-ux-services/src/services/platform.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxPlatformService.setIsFullscreen", - "type": "Function", - "tags": [], - "label": "setIsFullscreen", - "description": [ - "\nSets the fullscreen state of the chrome." - ], - "signature": [ - "(isFullscreen: boolean) => void" - ], - "path": "packages/kbn-shared-ux-services/src/services/platform.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxPlatformService.setIsFullscreen.$1", - "type": "boolean", - "tags": [], - "label": "isFullscreen", - "description": [ - "True if the chrome should be fullscreen, false otherwise." - ], - "signature": [ - "boolean" - ], - "path": "packages/kbn-shared-ux-services/src/services/platform.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxServices", - "type": "Interface", - "tags": [], - "label": "SharedUxServices", - "description": [ - "\nA collection of services utilized by SharedUX. This serves as a thin\nabstraction layer between services provided by Kibana and other plugins\nwhile allowing this plugin to be developed independently of those contracts.\n\nIt also allows us to \"swap out\" differenct implementations of these services\nfor different environments, (e.g. Jest, Storybook, etc.)" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxServices.application", - "type": "Object", - "tags": [], - "label": "application", - "description": [], - "signature": [ - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxApplicationService", - "text": "SharedUxApplicationService" - } - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxServices.docLinks", - "type": "Object", - "tags": [], - "label": "docLinks", - "description": [], - "signature": [ - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxDocLinksService", - "text": "SharedUxDocLinksService" - } - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxServices.editors", - "type": "Object", - "tags": [], - "label": "editors", - "description": [], - "signature": [ - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxEditorsService", - "text": "SharedUxEditorsService" - } - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxServices.http", - "type": "Object", - "tags": [], - "label": "http", - "description": [], - "signature": [ - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxHttpService", - "text": "SharedUxHttpService" - } - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxServices.permissions", - "type": "Object", - "tags": [], - "label": "permissions", - "description": [], - "signature": [ - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxUserPermissionsService", - "text": "SharedUxUserPermissionsService" - } - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxServices.platform", - "type": "Object", - "tags": [], - "label": "platform", - "description": [], - "signature": [ - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxPlatformService", - "text": "SharedUxPlatformService" - } - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxServices.data", - "type": "Object", - "tags": [], - "label": "data", - "description": [], - "signature": [ - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxDataService", - "text": "SharedUxDataService" - } - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxUserPermissionsService", - "type": "Interface", - "tags": [], - "label": "SharedUxUserPermissionsService", - "description": [ - "\nA service providing permissions information, typically for the current user." - ], - "path": "packages/kbn-shared-ux-services/src/services/permissions.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxUserPermissionsService.canCreateNewDataView", - "type": "boolean", - "tags": [], - "label": "canCreateNewDataView", - "description": [ - "True if the user has permission to create a new Data View, false otherwise." - ], - "path": "packages/kbn-shared-ux-services/src/services/permissions.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxUserPermissionsService.canAccessFleet", - "type": "boolean", - "tags": [], - "label": "canAccessFleet", - "description": [], - "path": "packages/kbn-shared-ux-services/src/services/permissions.ts", - "deprecated": false - } - ], - "initialIsOpen": false - } - ], - "enums": [], - "misc": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.ServiceFactory", - "type": "Type", - "tags": [], - "label": "ServiceFactory", - "description": [ - "\nA factory function for creating one or more services.\n\nThe `S` generic determines the shape of the API being produced.\nThe `Parameters` generic determines what parameters are expected to\ncreate the service." - ], - "signature": [ - "(params: Parameters) => S" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.ServiceFactory.$1", - "type": "Uncategorized", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "Parameters" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxServicesContext", - "type": "Type", - "tags": [], - "label": "SharedUxServicesContext", - "description": [ - "\nA type representing a component that provides the `SharedUxServices` through a\nReact Context." - ], - "signature": [ - "React.FunctionComponent<{}>" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxServicesContext.$1", - "type": "CompoundType", - "tags": [], - "label": "props", - "description": [], - "signature": [ - "P & { children?: React.ReactNode; }" - ], - "path": "node_modules/@types/react/index.d.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.SharedUxServicesContext.$2", - "type": "Any", - "tags": [], - "label": "context", - "description": [], - "signature": [ - "any" - ], - "path": "node_modules/@types/react/index.d.ts", - "deprecated": false - } - ], - "initialIsOpen": false - } - ], - "objects": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServiceFactories", - "type": "Object", - "tags": [], - "label": "mockServiceFactories", - "description": [ - "\nA collection of mock Service Factories." - ], - "path": "packages/kbn-shared-ux-services/src/services/mock/index.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServiceFactories.applicationServiceFactory", - "type": "Function", - "tags": [], - "label": "applicationServiceFactory", - "description": [], - "signature": [ - "(params: void) => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxApplicationService", - "text": "SharedUxApplicationService" - } - ], - "path": "packages/kbn-shared-ux-services/src/services/mock/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServiceFactories.applicationServiceFactory.$1", - "type": "Uncategorized", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "Parameters" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServiceFactories.docLinksServiceFactory", - "type": "Function", - "tags": [], - "label": "docLinksServiceFactory", - "description": [], - "signature": [ - "(params: void) => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxDocLinksService", - "text": "SharedUxDocLinksService" - } - ], - "path": "packages/kbn-shared-ux-services/src/services/mock/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServiceFactories.docLinksServiceFactory.$1", - "type": "Uncategorized", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "Parameters" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServiceFactories.editorsServiceFactory", - "type": "Function", - "tags": [], - "label": "editorsServiceFactory", - "description": [], - "signature": [ - "(params: void) => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxEditorsService", - "text": "SharedUxEditorsService" - } - ], - "path": "packages/kbn-shared-ux-services/src/services/mock/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServiceFactories.editorsServiceFactory.$1", - "type": "Uncategorized", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "Parameters" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServiceFactories.httpServiceFactory", - "type": "Function", - "tags": [], - "label": "httpServiceFactory", - "description": [], - "signature": [ - "(params: void) => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxHttpService", - "text": "SharedUxHttpService" - } - ], - "path": "packages/kbn-shared-ux-services/src/services/mock/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServiceFactories.httpServiceFactory.$1", - "type": "Uncategorized", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "Parameters" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServiceFactories.platformServiceFactory", - "type": "Function", - "tags": [], - "label": "platformServiceFactory", - "description": [], - "signature": [ - "(params: void) => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxPlatformService", - "text": "SharedUxPlatformService" - } - ], - "path": "packages/kbn-shared-ux-services/src/services/mock/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServiceFactories.platformServiceFactory.$1", - "type": "Uncategorized", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "Parameters" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServiceFactories.userPermissionsServiceFactory", - "type": "Function", - "tags": [], - "label": "userPermissionsServiceFactory", - "description": [], - "signature": [ - "(params: void) => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxUserPermissionsService", - "text": "SharedUxUserPermissionsService" - } - ], - "path": "packages/kbn-shared-ux-services/src/services/mock/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServiceFactories.userPermissionsServiceFactory.$1", - "type": "Uncategorized", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "Parameters" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServiceFactories.dataServiceFactory", - "type": "Function", - "tags": [], - "label": "dataServiceFactory", - "description": [], - "signature": [ - "(config?: ", - "MockDataServiceFactoryConfig", - " | undefined) => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxDataService", - "text": "SharedUxDataService" - } - ], - "path": "packages/kbn-shared-ux-services/src/services/mock/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.mockServiceFactories.dataServiceFactory.$1", - "type": "Object", - "tags": [], - "label": "config", - "description": [], - "signature": [ - "MockDataServiceFactoryConfig", - " | undefined" - ], - "path": "packages/kbn-shared-ux-services/src/services/mock/data.mock.ts", - "deprecated": false - } - ] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServiceFactories", - "type": "Object", - "tags": [], - "label": "stubServiceFactories", - "description": [ - "\nA collection of stubbed service factories." - ], - "path": "packages/kbn-shared-ux-services/src/services/stub/index.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServiceFactories.applicationServiceFactory", - "type": "Function", - "tags": [], - "label": "applicationServiceFactory", - "description": [], - "signature": [ - "(params: void) => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxApplicationService", - "text": "SharedUxApplicationService" - } - ], - "path": "packages/kbn-shared-ux-services/src/services/stub/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServiceFactories.applicationServiceFactory.$1", - "type": "Uncategorized", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "Parameters" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServiceFactories.docLinksServiceFactory", - "type": "Function", - "tags": [], - "label": "docLinksServiceFactory", - "description": [], - "signature": [ - "(params: void) => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxDocLinksService", - "text": "SharedUxDocLinksService" - } - ], - "path": "packages/kbn-shared-ux-services/src/services/stub/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServiceFactories.docLinksServiceFactory.$1", - "type": "Uncategorized", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "Parameters" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServiceFactories.editorsServiceFactory", - "type": "Function", - "tags": [], - "label": "editorsServiceFactory", - "description": [], - "signature": [ - "(params: void) => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxEditorsService", - "text": "SharedUxEditorsService" - } - ], - "path": "packages/kbn-shared-ux-services/src/services/stub/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServiceFactories.editorsServiceFactory.$1", - "type": "Uncategorized", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "Parameters" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServiceFactories.httpServiceFactory", - "type": "Function", - "tags": [], - "label": "httpServiceFactory", - "description": [], - "signature": [ - "(params: void) => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxHttpService", - "text": "SharedUxHttpService" - } - ], - "path": "packages/kbn-shared-ux-services/src/services/stub/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServiceFactories.httpServiceFactory.$1", - "type": "Uncategorized", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "Parameters" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServiceFactories.platformServiceFactory", - "type": "Function", - "tags": [], - "label": "platformServiceFactory", - "description": [], - "signature": [ - "(params: void) => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxPlatformService", - "text": "SharedUxPlatformService" - } - ], - "path": "packages/kbn-shared-ux-services/src/services/stub/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServiceFactories.platformServiceFactory.$1", - "type": "Uncategorized", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "Parameters" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServiceFactories.userPermissionsServiceFactory", - "type": "Function", - "tags": [], - "label": "userPermissionsServiceFactory", - "description": [], - "signature": [ - "(params: void) => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxUserPermissionsService", - "text": "SharedUxUserPermissionsService" - } - ], - "path": "packages/kbn-shared-ux-services/src/services/stub/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServiceFactories.userPermissionsServiceFactory.$1", - "type": "Uncategorized", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "Parameters" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - } - ] - }, - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServiceFactories.dataServiceFactory", - "type": "Function", - "tags": [], - "label": "dataServiceFactory", - "description": [], - "signature": [ - "(params: void) => ", - { - "pluginId": "@kbn/shared-ux-services", - "scope": "common", - "docId": "kibKbnSharedUxServicesPluginApi", - "section": "def-common.SharedUxDataService", - "text": "SharedUxDataService" - } - ], - "path": "packages/kbn-shared-ux-services/src/services/stub/index.ts", - "deprecated": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "@kbn/shared-ux-services", - "id": "def-common.stubServiceFactories.dataServiceFactory.$1", - "type": "Uncategorized", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "Parameters" - ], - "path": "packages/kbn-shared-ux-services/src/types.ts", - "deprecated": false - } - ] - } - ], - "initialIsOpen": false - } - ] - } -} \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_services.mdx b/api_docs/kbn_shared_ux_services.mdx deleted file mode 100644 index 2a20804cdf191..0000000000000 --- a/api_docs/kbn_shared_ux_services.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -#### -#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. -#### Reach out in #docs-engineering for more info. -#### -id: kibKbnSharedUxServicesPluginApi -slug: /kibana-dev-docs/api/kbn-shared-ux-services -title: "@kbn/shared-ux-services" -image: https://source.unsplash.com/400x175/?github -description: API docs for the @kbn/shared-ux-services plugin -date: 2022-08-18 -tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-services'] ---- -import kbnSharedUxServicesObj from './kbn_shared_ux_services.devdocs.json'; - - - -Contact [Owner missing] for questions regarding this plugin. - -**Code health stats** - -| Public API count | Any count | Items lacking comments | Missing exports | -|-------------------|-----------|------------------------|-----------------| -| 80 | 0 | 51 | 1 | - -## Common - -### Objects - - -### Functions - - -### Interfaces - - -### Consts, variables and types - - diff --git a/api_docs/kbn_shared_ux_storybook.devdocs.json b/api_docs/kbn_shared_ux_storybook.devdocs.json deleted file mode 100644 index 82e09aac247b9..0000000000000 --- a/api_docs/kbn_shared_ux_storybook.devdocs.json +++ /dev/null @@ -1,324 +0,0 @@ -{ - "id": "@kbn/shared-ux-storybook", - "client": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "server": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "common": { - "classes": [], - "functions": [ - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.applicationServiceFactory", - "type": "Function", - "tags": [], - "label": "applicationServiceFactory", - "description": [ - "\nA factory function for creating for creating a storybook implementation of `SharedUXApplicationService`." - ], - "signature": [ - "() => { navigateToUrl: (url: string) => Promise; currentAppId$: ", - "BehaviorSubject", - "; }" - ], - "path": "packages/kbn-shared-ux-storybook/src/services/application.ts", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.dataServiceFactory", - "type": "Function", - "tags": [], - "label": "dataServiceFactory", - "description": [ - "\nA factory function for creating a Storybook implementation of `SharedUxDataService`." - ], - "signature": [ - "(params: ", - { - "pluginId": "@kbn/shared-ux-storybook", - "scope": "common", - "docId": "kibKbnSharedUxStorybookPluginApi", - "section": "def-common.DataServiceFactoryConfig", - "text": "DataServiceFactoryConfig" - }, - ") => { hasESData: () => Promise; hasDataView: () => Promise; hasUserDataView: () => Promise; }" - ], - "path": "packages/kbn-shared-ux-storybook/src/services/data.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.dataServiceFactory.$1", - "type": "Object", - "tags": [], - "label": "params", - "description": [], - "signature": [ - { - "pluginId": "@kbn/shared-ux-storybook", - "scope": "common", - "docId": "kibKbnSharedUxStorybookPluginApi", - "section": "def-common.DataServiceFactoryConfig", - "text": "DataServiceFactoryConfig" - } - ], - "path": "packages/kbn-shared-ux-storybook/src/services/data.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.docLinksServiceFactory", - "type": "Function", - "tags": [], - "label": "docLinksServiceFactory", - "description": [ - "\nA factory function for creating a Storybook implementation of `SharedUxDocLinksService`." - ], - "signature": [ - "() => { dataViewsDocLink: string; kibanaGuideDocLink: string; }" - ], - "path": "packages/kbn-shared-ux-storybook/src/services/doc_links.ts", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.editorsServiceFactory", - "type": "Function", - "tags": [], - "label": "editorsServiceFactory", - "description": [ - "\nA factory function for creating a Storybook implementation of `SharedUxEditorsService`." - ], - "signature": [ - "() => { openDataViewEditor: (options: ", - "DataViewEditorOptions", - ") => () => void; }" - ], - "path": "packages/kbn-shared-ux-storybook/src/services/editors.ts", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.httpServiceFactory", - "type": "Function", - "tags": [], - "label": "httpServiceFactory", - "description": [ - "\nA factory function for creating a Storybook-based implementation of `SharedUXHttpService`." - ], - "signature": [ - "() => { addBasePath: (url: string) => string; }" - ], - "path": "packages/kbn-shared-ux-storybook/src/services/http.ts", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.platformServiceFactory", - "type": "Function", - "tags": [], - "label": "platformServiceFactory", - "description": [ - "\nA factory function for creating a Storybook implementation of `SharedUxPlatformService`." - ], - "signature": [ - "() => { setIsFullscreen: ", - "HandlerFunction", - "; }" - ], - "path": "packages/kbn-shared-ux-storybook/src/services/platform.ts", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.servicesDecorator", - "type": "Function", - "tags": [], - "label": "servicesDecorator", - "description": [ - "\nA Storybook decorator that provides the Shared UX `ServicesProvider` with Storybook-specific\nimplementations to stories." - ], - "signature": [ - "(storyFn: ", - "PartialStoryFn", - ", ", - "Args", - ">) => JSX.Element" - ], - "path": "packages/kbn-shared-ux-storybook/src/decorators.tsx", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.servicesDecorator.$1", - "type": "Function", - "tags": [], - "label": "storyFn", - "description": [], - "signature": [ - "PartialStoryFn", - ", ", - "Args", - ">" - ], - "path": "packages/kbn-shared-ux-storybook/src/decorators.tsx", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.servicesFactory", - "type": "Function", - "tags": [], - "label": "servicesFactory", - "description": [ - "\nA factory function for creating a Storybook implementation of `SharedUxServices`." - ], - "signature": [ - "(params: {}) => { application: ", - "SharedUxApplicationService", - "; docLinks: ", - "SharedUxDocLinksService", - "; editors: ", - "SharedUxEditorsService", - "; http: ", - "SharedUxHttpService", - "; permissions: ", - "SharedUxUserPermissionsService", - "; platform: ", - "SharedUxPlatformService", - "; data: ", - "SharedUxDataService", - "; }" - ], - "path": "packages/kbn-shared-ux-storybook/src/services/index.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.servicesFactory.$1", - "type": "Object", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "{}" - ], - "path": "packages/kbn-shared-ux-storybook/src/services/index.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.userPermissionsServiceFactory", - "type": "Function", - "tags": [], - "label": "userPermissionsServiceFactory", - "description": [ - "\nA factory function for creating a Storybook implementation of `SharedUxUserPermissionsService`." - ], - "signature": [ - "() => { canCreateNewDataView: true; canAccessFleet: true; }" - ], - "path": "packages/kbn-shared-ux-storybook/src/services/permissions.ts", - "deprecated": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - } - ], - "interfaces": [ - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.DataServiceFactoryConfig", - "type": "Interface", - "tags": [], - "label": "DataServiceFactoryConfig", - "description": [], - "path": "packages/kbn-shared-ux-storybook/src/services/data.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.DataServiceFactoryConfig.hasESData", - "type": "boolean", - "tags": [], - "label": "hasESData", - "description": [], - "path": "packages/kbn-shared-ux-storybook/src/services/data.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.DataServiceFactoryConfig.hasDataView", - "type": "boolean", - "tags": [], - "label": "hasDataView", - "description": [], - "path": "packages/kbn-shared-ux-storybook/src/services/data.ts", - "deprecated": false - }, - { - "parentPluginId": "@kbn/shared-ux-storybook", - "id": "def-common.DataServiceFactoryConfig.hasUserDataView", - "type": "boolean", - "tags": [], - "label": "hasUserDataView", - "description": [], - "path": "packages/kbn-shared-ux-storybook/src/services/data.ts", - "deprecated": false - } - ], - "initialIsOpen": false - } - ], - "enums": [], - "misc": [], - "objects": [] - } -} \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_storybook_mock.devdocs.json b/api_docs/kbn_shared_ux_storybook_mock.devdocs.json index 63551c7aca499..2db55d58a00a6 100644 --- a/api_docs/kbn_shared_ux_storybook_mock.devdocs.json +++ b/api_docs/kbn_shared_ux_storybook_mock.devdocs.json @@ -9,10 +9,18 @@ "objects": [] }, "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { "classes": [ { "parentPluginId": "@kbn/shared-ux-storybook-mock", - "id": "def-server.AbstractStorybookMock", + "id": "def-common.AbstractStorybookMock", "type": "Class", "tags": [], "label": "AbstractStorybookMock", @@ -22,9 +30,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-storybook-mock", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxStorybookMockPluginApi", - "section": "def-server.AbstractStorybookMock", + "section": "def-common.AbstractStorybookMock", "text": "AbstractStorybookMock" }, "" @@ -34,7 +42,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-storybook-mock", - "id": "def-server.AbstractStorybookMock.propArguments", + "id": "def-common.AbstractStorybookMock.propArguments", "type": "Object", "tags": [], "label": "propArguments", @@ -51,7 +59,7 @@ }, { "parentPluginId": "@kbn/shared-ux-storybook-mock", - "id": "def-server.AbstractStorybookMock.serviceArguments", + "id": "def-common.AbstractStorybookMock.serviceArguments", "type": "Object", "tags": [], "label": "serviceArguments", @@ -68,7 +76,7 @@ }, { "parentPluginId": "@kbn/shared-ux-storybook-mock", - "id": "def-server.AbstractStorybookMock.dependencies", + "id": "def-common.AbstractStorybookMock.dependencies", "type": "Array", "tags": [], "label": "dependencies", @@ -78,9 +86,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-storybook-mock", - "scope": "server", + "scope": "common", "docId": "kibKbnSharedUxStorybookMockPluginApi", - "section": "def-server.AbstractStorybookMock", + "section": "def-common.AbstractStorybookMock", "text": "AbstractStorybookMock" }, "<", @@ -92,7 +100,7 @@ }, { "parentPluginId": "@kbn/shared-ux-storybook-mock", - "id": "def-server.AbstractStorybookMock.getPropArgumentTypes", + "id": "def-common.AbstractStorybookMock.getPropArgumentTypes", "type": "Function", "tags": [], "label": "getPropArgumentTypes", @@ -111,7 +119,7 @@ }, { "parentPluginId": "@kbn/shared-ux-storybook-mock", - "id": "def-server.AbstractStorybookMock.getServiceArgumentTypes", + "id": "def-common.AbstractStorybookMock.getServiceArgumentTypes", "type": "Function", "tags": [], "label": "getServiceArgumentTypes", @@ -134,7 +142,7 @@ }, { "parentPluginId": "@kbn/shared-ux-storybook-mock", - "id": "def-server.AbstractStorybookMock.getArgumentTypes", + "id": "def-common.AbstractStorybookMock.getArgumentTypes", "type": "Function", "tags": [], "label": "getArgumentTypes", @@ -159,7 +167,7 @@ }, { "parentPluginId": "@kbn/shared-ux-storybook-mock", - "id": "def-server.AbstractStorybookMock.getArgumentValue", + "id": "def-common.AbstractStorybookMock.getArgumentValue", "type": "Function", "tags": [], "label": "getArgumentValue", @@ -176,7 +184,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-storybook-mock", - "id": "def-server.AbstractStorybookMock.getArgumentValue.$1", + "id": "def-common.AbstractStorybookMock.getArgumentValue.$1", "type": "CompoundType", "tags": [], "label": "arg", @@ -190,7 +198,7 @@ }, { "parentPluginId": "@kbn/shared-ux-storybook-mock", - "id": "def-server.AbstractStorybookMock.getArgumentValue.$2", + "id": "def-common.AbstractStorybookMock.getArgumentValue.$2", "type": "Object", "tags": [], "label": "params", @@ -208,7 +216,7 @@ }, { "parentPluginId": "@kbn/shared-ux-storybook-mock", - "id": "def-server.AbstractStorybookMock.getProps", + "id": "def-common.AbstractStorybookMock.getProps", "type": "Function", "tags": [], "label": "getProps", @@ -225,7 +233,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-storybook-mock", - "id": "def-server.AbstractStorybookMock.getProps.$1", + "id": "def-common.AbstractStorybookMock.getProps.$1", "type": "Object", "tags": [], "label": "params", @@ -243,7 +251,7 @@ }, { "parentPluginId": "@kbn/shared-ux-storybook-mock", - "id": "def-server.AbstractStorybookMock.getServices", + "id": "def-common.AbstractStorybookMock.getServices", "type": "Function", "tags": [], "label": "getServices", @@ -260,7 +268,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-storybook-mock", - "id": "def-server.AbstractStorybookMock.getServices.$1", + "id": "def-common.AbstractStorybookMock.getServices.$1", "type": "Object", "tags": [], "label": "params", @@ -285,13 +293,5 @@ "enums": [], "misc": [], "objects": [] - }, - "common": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] } } \ No newline at end of file diff --git a/api_docs/kbn_shared_ux_storybook_mock.mdx b/api_docs/kbn_shared_ux_storybook_mock.mdx index c52de3158ef53..cb8c5346408ca 100644 --- a/api_docs/kbn_shared_ux_storybook_mock.mdx +++ b/api_docs/kbn_shared_ux_storybook_mock.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-storybook-mock title: "@kbn/shared-ux-storybook-mock" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-storybook-mock plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-storybook-mock'] --- import kbnSharedUxStorybookMockObj from './kbn_shared_ux_storybook_mock.devdocs.json'; @@ -23,8 +23,8 @@ Contact [Owner missing] for questions regarding this plugin. |-------------------|-----------|------------------------|-----------------| | 14 | 0 | 4 | 1 | -## Server +## Common ### Classes - + diff --git a/api_docs/kbn_shared_ux_utility.mdx b/api_docs/kbn_shared_ux_utility.mdx index eb6d461c74a9e..6b98d28e80250 100644 --- a/api_docs/kbn_shared_ux_utility.mdx +++ b/api_docs/kbn_shared_ux_utility.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-utility title: "@kbn/shared-ux-utility" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-utility plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-utility'] --- import kbnSharedUxUtilityObj from './kbn_shared_ux_utility.devdocs.json'; diff --git a/api_docs/kbn_some_dev_log.mdx b/api_docs/kbn_some_dev_log.mdx index fb074811f062d..aa703428e586e 100644 --- a/api_docs/kbn_some_dev_log.mdx +++ b/api_docs/kbn_some_dev_log.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-some-dev-log title: "@kbn/some-dev-log" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/some-dev-log plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/some-dev-log'] --- import kbnSomeDevLogObj from './kbn_some_dev_log.devdocs.json'; diff --git a/api_docs/kbn_sort_package_json.mdx b/api_docs/kbn_sort_package_json.mdx index 274025b5e3e3d..921e9967e5435 100644 --- a/api_docs/kbn_sort_package_json.mdx +++ b/api_docs/kbn_sort_package_json.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-sort-package-json title: "@kbn/sort-package-json" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/sort-package-json plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/sort-package-json'] --- import kbnSortPackageJsonObj from './kbn_sort_package_json.devdocs.json'; diff --git a/api_docs/kbn_std.mdx b/api_docs/kbn_std.mdx index 5b1a4e4e890ad..60cb11db4c8c8 100644 --- a/api_docs/kbn_std.mdx +++ b/api_docs/kbn_std.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-std title: "@kbn/std" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/std plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/std'] --- import kbnStdObj from './kbn_std.devdocs.json'; diff --git a/api_docs/kbn_stdio_dev_helpers.mdx b/api_docs/kbn_stdio_dev_helpers.mdx index 382c256e5e024..7a459ef502e73 100644 --- a/api_docs/kbn_stdio_dev_helpers.mdx +++ b/api_docs/kbn_stdio_dev_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-stdio-dev-helpers title: "@kbn/stdio-dev-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/stdio-dev-helpers plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/stdio-dev-helpers'] --- import kbnStdioDevHelpersObj from './kbn_stdio_dev_helpers.devdocs.json'; diff --git a/api_docs/kbn_storybook.mdx b/api_docs/kbn_storybook.mdx index 3f65c4d851ae2..d2d0c0806b170 100644 --- a/api_docs/kbn_storybook.mdx +++ b/api_docs/kbn_storybook.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-storybook title: "@kbn/storybook" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/storybook plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/storybook'] --- import kbnStorybookObj from './kbn_storybook.devdocs.json'; diff --git a/api_docs/kbn_telemetry_tools.mdx b/api_docs/kbn_telemetry_tools.mdx index ef83560e77c81..77dfec7a8f9c4 100644 --- a/api_docs/kbn_telemetry_tools.mdx +++ b/api_docs/kbn_telemetry_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-telemetry-tools title: "@kbn/telemetry-tools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/telemetry-tools plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/telemetry-tools'] --- import kbnTelemetryToolsObj from './kbn_telemetry_tools.devdocs.json'; diff --git a/api_docs/kbn_test.mdx b/api_docs/kbn_test.mdx index 5ef8c29d8affa..62ed00ec41d40 100644 --- a/api_docs/kbn_test.mdx +++ b/api_docs/kbn_test.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-test title: "@kbn/test" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/test plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test'] --- import kbnTestObj from './kbn_test.devdocs.json'; diff --git a/api_docs/kbn_test_jest_helpers.mdx b/api_docs/kbn_test_jest_helpers.mdx index 884bb77c0580b..309b23b1a8322 100644 --- a/api_docs/kbn_test_jest_helpers.mdx +++ b/api_docs/kbn_test_jest_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-test-jest-helpers title: "@kbn/test-jest-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/test-jest-helpers plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test-jest-helpers'] --- import kbnTestJestHelpersObj from './kbn_test_jest_helpers.devdocs.json'; diff --git a/api_docs/kbn_tooling_log.mdx b/api_docs/kbn_tooling_log.mdx index 78ef107edb774..2620756f3699f 100644 --- a/api_docs/kbn_tooling_log.mdx +++ b/api_docs/kbn_tooling_log.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-tooling-log title: "@kbn/tooling-log" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/tooling-log plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/tooling-log'] --- import kbnToolingLogObj from './kbn_tooling_log.devdocs.json'; diff --git a/api_docs/kbn_type_summarizer.mdx b/api_docs/kbn_type_summarizer.mdx index 7e332d5da7689..a6e087586ec21 100644 --- a/api_docs/kbn_type_summarizer.mdx +++ b/api_docs/kbn_type_summarizer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-type-summarizer title: "@kbn/type-summarizer" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/type-summarizer plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/type-summarizer'] --- import kbnTypeSummarizerObj from './kbn_type_summarizer.devdocs.json'; diff --git a/api_docs/kbn_type_summarizer_core.mdx b/api_docs/kbn_type_summarizer_core.mdx index 74df26f8d9add..e0f873f4510ef 100644 --- a/api_docs/kbn_type_summarizer_core.mdx +++ b/api_docs/kbn_type_summarizer_core.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-type-summarizer-core title: "@kbn/type-summarizer-core" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/type-summarizer-core plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/type-summarizer-core'] --- import kbnTypeSummarizerCoreObj from './kbn_type_summarizer_core.devdocs.json'; diff --git a/api_docs/kbn_typed_react_router_config.mdx b/api_docs/kbn_typed_react_router_config.mdx index 451e189b0fc16..9ca9e722093a3 100644 --- a/api_docs/kbn_typed_react_router_config.mdx +++ b/api_docs/kbn_typed_react_router_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-typed-react-router-config title: "@kbn/typed-react-router-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/typed-react-router-config plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/typed-react-router-config'] --- import kbnTypedReactRouterConfigObj from './kbn_typed_react_router_config.devdocs.json'; diff --git a/api_docs/kbn_ui_theme.mdx b/api_docs/kbn_ui_theme.mdx index 832bc8a26b0df..bcfb965ffb4fa 100644 --- a/api_docs/kbn_ui_theme.mdx +++ b/api_docs/kbn_ui_theme.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ui-theme title: "@kbn/ui-theme" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ui-theme plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ui-theme'] --- import kbnUiThemeObj from './kbn_ui_theme.devdocs.json'; diff --git a/api_docs/kbn_user_profile_components.mdx b/api_docs/kbn_user_profile_components.mdx index 08dc739f77a14..5f892773f33c9 100644 --- a/api_docs/kbn_user_profile_components.mdx +++ b/api_docs/kbn_user_profile_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-user-profile-components title: "@kbn/user-profile-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/user-profile-components plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/user-profile-components'] --- import kbnUserProfileComponentsObj from './kbn_user_profile_components.devdocs.json'; diff --git a/api_docs/kbn_utility_types.mdx b/api_docs/kbn_utility_types.mdx index 88696704bddb7..b4c2e9d288602 100644 --- a/api_docs/kbn_utility_types.mdx +++ b/api_docs/kbn_utility_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-utility-types title: "@kbn/utility-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/utility-types plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utility-types'] --- import kbnUtilityTypesObj from './kbn_utility_types.devdocs.json'; diff --git a/api_docs/kbn_utility_types_jest.mdx b/api_docs/kbn_utility_types_jest.mdx index b564685326479..418ea2dd0cc68 100644 --- a/api_docs/kbn_utility_types_jest.mdx +++ b/api_docs/kbn_utility_types_jest.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-utility-types-jest title: "@kbn/utility-types-jest" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/utility-types-jest plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utility-types-jest'] --- import kbnUtilityTypesJestObj from './kbn_utility_types_jest.devdocs.json'; diff --git a/api_docs/kbn_utils.mdx b/api_docs/kbn_utils.mdx index 906b61b007483..ae11cdca1f69e 100644 --- a/api_docs/kbn_utils.mdx +++ b/api_docs/kbn_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-utils title: "@kbn/utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/utils plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utils'] --- import kbnUtilsObj from './kbn_utils.devdocs.json'; diff --git a/api_docs/kbn_yarn_lock_validator.mdx b/api_docs/kbn_yarn_lock_validator.mdx index d9202415378fe..db2638b3efe3b 100644 --- a/api_docs/kbn_yarn_lock_validator.mdx +++ b/api_docs/kbn_yarn_lock_validator.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-yarn-lock-validator title: "@kbn/yarn-lock-validator" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/yarn-lock-validator plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/yarn-lock-validator'] --- import kbnYarnLockValidatorObj from './kbn_yarn_lock_validator.devdocs.json'; diff --git a/api_docs/kibana_overview.mdx b/api_docs/kibana_overview.mdx index a66ba46c615b8..6067849d4fcdb 100644 --- a/api_docs/kibana_overview.mdx +++ b/api_docs/kibana_overview.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kibanaOverview title: "kibanaOverview" image: https://source.unsplash.com/400x175/?github description: API docs for the kibanaOverview plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaOverview'] --- import kibanaOverviewObj from './kibana_overview.devdocs.json'; diff --git a/api_docs/kibana_react.devdocs.json b/api_docs/kibana_react.devdocs.json index 986f60b1bff13..f2c484815e9b2 100644 --- a/api_docs/kibana_react.devdocs.json +++ b/api_docs/kibana_react.devdocs.json @@ -1723,8 +1723,7 @@ "id": "def-public.RedirectAppLinks", "type": "Function", "tags": [ - "deprecated", - "kbn-shared-ux-components" + "deprecated" ], "label": "RedirectAppLinks", "description": [ diff --git a/api_docs/kibana_react.mdx b/api_docs/kibana_react.mdx index dce8d8401c82e..2227c7fdaaa2c 100644 --- a/api_docs/kibana_react.mdx +++ b/api_docs/kibana_react.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kibanaReact title: "kibanaReact" image: https://source.unsplash.com/400x175/?github description: API docs for the kibanaReact plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaReact'] --- import kibanaReactObj from './kibana_react.devdocs.json'; diff --git a/api_docs/kibana_utils.mdx b/api_docs/kibana_utils.mdx index cba11c205cd12..ae889a34552e2 100644 --- a/api_docs/kibana_utils.mdx +++ b/api_docs/kibana_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kibanaUtils title: "kibanaUtils" image: https://source.unsplash.com/400x175/?github description: API docs for the kibanaUtils plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaUtils'] --- import kibanaUtilsObj from './kibana_utils.devdocs.json'; diff --git a/api_docs/kubernetes_security.mdx b/api_docs/kubernetes_security.mdx index f15b9c6bfb7c3..6a175c0a44c3e 100644 --- a/api_docs/kubernetes_security.mdx +++ b/api_docs/kubernetes_security.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kubernetesSecurity title: "kubernetesSecurity" image: https://source.unsplash.com/400x175/?github description: API docs for the kubernetesSecurity plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kubernetesSecurity'] --- import kubernetesSecurityObj from './kubernetes_security.devdocs.json'; diff --git a/api_docs/lens.mdx b/api_docs/lens.mdx index 80f60ed7d605e..ba12db930ef84 100644 --- a/api_docs/lens.mdx +++ b/api_docs/lens.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/lens title: "lens" image: https://source.unsplash.com/400x175/?github description: API docs for the lens plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'lens'] --- import lensObj from './lens.devdocs.json'; diff --git a/api_docs/license_api_guard.mdx b/api_docs/license_api_guard.mdx index 0ca74c7edafa8..c654aeabae1eb 100644 --- a/api_docs/license_api_guard.mdx +++ b/api_docs/license_api_guard.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/licenseApiGuard title: "licenseApiGuard" image: https://source.unsplash.com/400x175/?github description: API docs for the licenseApiGuard plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licenseApiGuard'] --- import licenseApiGuardObj from './license_api_guard.devdocs.json'; diff --git a/api_docs/license_management.mdx b/api_docs/license_management.mdx index 8147033607189..c7154ada6b8c7 100644 --- a/api_docs/license_management.mdx +++ b/api_docs/license_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/licenseManagement title: "licenseManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the licenseManagement plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licenseManagement'] --- import licenseManagementObj from './license_management.devdocs.json'; diff --git a/api_docs/licensing.mdx b/api_docs/licensing.mdx index dc71276bb7c66..491199d91b8f6 100644 --- a/api_docs/licensing.mdx +++ b/api_docs/licensing.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/licensing title: "licensing" image: https://source.unsplash.com/400x175/?github description: API docs for the licensing plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licensing'] --- import licensingObj from './licensing.devdocs.json'; diff --git a/api_docs/lists.mdx b/api_docs/lists.mdx index 16de39f551262..146762491ea46 100644 --- a/api_docs/lists.mdx +++ b/api_docs/lists.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/lists title: "lists" image: https://source.unsplash.com/400x175/?github description: API docs for the lists plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'lists'] --- import listsObj from './lists.devdocs.json'; diff --git a/api_docs/management.mdx b/api_docs/management.mdx index 00e18485de783..a957a28e184a4 100644 --- a/api_docs/management.mdx +++ b/api_docs/management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/management title: "management" image: https://source.unsplash.com/400x175/?github description: API docs for the management plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'management'] --- import managementObj from './management.devdocs.json'; diff --git a/api_docs/maps.devdocs.json b/api_docs/maps.devdocs.json index 3ec66d75cdeca..631f2acfb53c8 100644 --- a/api_docs/maps.devdocs.json +++ b/api_docs/maps.devdocs.json @@ -4003,7 +4003,7 @@ "AbstractSourceDescriptor", " & { id: string; indexPatternId: string; geoField?: string | undefined; applyGlobalQuery: boolean; applyGlobalTime: boolean; applyForceRefresh: boolean; } & { metrics: ", "AggDescriptor", - "[]; } & { indexPatternTitle?: string | undefined; term: string; whereQuery?: ", + "[]; } & { term: string; whereQuery?: ", "Query", " | undefined; size?: number | undefined; type: ", { diff --git a/api_docs/maps.mdx b/api_docs/maps.mdx index 62b34eb2f20e1..ebbda1c5ded50 100644 --- a/api_docs/maps.mdx +++ b/api_docs/maps.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/maps title: "maps" image: https://source.unsplash.com/400x175/?github description: API docs for the maps plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'maps'] --- import mapsObj from './maps.devdocs.json'; diff --git a/api_docs/maps_ems.mdx b/api_docs/maps_ems.mdx index 6434377f36f50..014add3958be8 100644 --- a/api_docs/maps_ems.mdx +++ b/api_docs/maps_ems.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/mapsEms title: "mapsEms" image: https://source.unsplash.com/400x175/?github description: API docs for the mapsEms plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'mapsEms'] --- import mapsEmsObj from './maps_ems.devdocs.json'; diff --git a/api_docs/ml.mdx b/api_docs/ml.mdx index 7f818d563723c..665201c0897bc 100644 --- a/api_docs/ml.mdx +++ b/api_docs/ml.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ml title: "ml" image: https://source.unsplash.com/400x175/?github description: API docs for the ml plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ml'] --- import mlObj from './ml.devdocs.json'; diff --git a/api_docs/monitoring.mdx b/api_docs/monitoring.mdx index 8d6d469746768..ac59a55daf028 100644 --- a/api_docs/monitoring.mdx +++ b/api_docs/monitoring.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/monitoring title: "monitoring" image: https://source.unsplash.com/400x175/?github description: API docs for the monitoring plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'monitoring'] --- import monitoringObj from './monitoring.devdocs.json'; diff --git a/api_docs/monitoring_collection.mdx b/api_docs/monitoring_collection.mdx index 3c7ee3e38fc86..2768ea059fdd3 100644 --- a/api_docs/monitoring_collection.mdx +++ b/api_docs/monitoring_collection.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/monitoringCollection title: "monitoringCollection" image: https://source.unsplash.com/400x175/?github description: API docs for the monitoringCollection plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'monitoringCollection'] --- import monitoringCollectionObj from './monitoring_collection.devdocs.json'; diff --git a/api_docs/navigation.mdx b/api_docs/navigation.mdx index 9c4935b2316b7..a43eeb0bba57a 100644 --- a/api_docs/navigation.mdx +++ b/api_docs/navigation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/navigation title: "navigation" image: https://source.unsplash.com/400x175/?github description: API docs for the navigation plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'navigation'] --- import navigationObj from './navigation.devdocs.json'; diff --git a/api_docs/newsfeed.mdx b/api_docs/newsfeed.mdx index 1ddeac3685504..b208b229abb87 100644 --- a/api_docs/newsfeed.mdx +++ b/api_docs/newsfeed.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/newsfeed title: "newsfeed" image: https://source.unsplash.com/400x175/?github description: API docs for the newsfeed plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'newsfeed'] --- import newsfeedObj from './newsfeed.devdocs.json'; diff --git a/api_docs/observability.devdocs.json b/api_docs/observability.devdocs.json index 6e22546cd3174..048601d55003f 100644 --- a/api_docs/observability.devdocs.json +++ b/api_docs/observability.devdocs.json @@ -698,7 +698,7 @@ "CommonProps", " & { as?: \"div\" | undefined; } & _EuiFlyoutProps & Omit, HTMLDivElement>, keyof _EuiFlyoutProps> & Omit, HTMLDivElement>, \"key\" | \"css\" | keyof React.HTMLAttributes> & { ref?: React.RefObject | ((instance: HTMLDivElement | null) => void) | null | undefined; }, \"children\" | \"onError\" | \"hidden\" | \"color\" | \"title\" | \"onChange\" | \"onKeyDown\" | \"onClick\" | \"id\" | \"security\" | \"defaultValue\" | \"lang\" | \"defaultChecked\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"as\" | keyof ", "CommonProps", - " | keyof React.ClassAttributes | keyof _EuiFlyoutProps>, \"children\" | \"onError\" | \"hidden\" | \"color\" | \"alert\" | \"title\" | \"onChange\" | \"onKeyDown\" | \"onClick\" | \"key\" | \"id\" | \"css\" | \"security\" | \"defaultValue\" | \"lang\" | \"defaultChecked\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"as\" | keyof ", + " | keyof React.ClassAttributes | keyof _EuiFlyoutProps>, \"children\" | \"onError\" | \"hidden\" | \"color\" | \"alert\" | \"title\" | \"onChange\" | \"onKeyDown\" | \"onClick\" | \"id\" | \"key\" | \"css\" | \"security\" | \"defaultValue\" | \"lang\" | \"defaultChecked\" | \"suppressContentEditableWarning\" | \"suppressHydrationWarning\" | \"accessKey\" | \"contentEditable\" | \"contextMenu\" | \"dir\" | \"draggable\" | \"placeholder\" | \"slot\" | \"spellCheck\" | \"tabIndex\" | \"translate\" | \"radioGroup\" | \"about\" | \"datatype\" | \"inlist\" | \"prefix\" | \"property\" | \"resource\" | \"typeof\" | \"vocab\" | \"autoCapitalize\" | \"autoCorrect\" | \"autoSave\" | \"itemProp\" | \"itemScope\" | \"itemType\" | \"itemID\" | \"itemRef\" | \"results\" | \"unselectable\" | \"inputMode\" | \"is\" | \"aria-activedescendant\" | \"aria-atomic\" | \"aria-autocomplete\" | \"aria-busy\" | \"aria-checked\" | \"aria-colcount\" | \"aria-colindex\" | \"aria-colspan\" | \"aria-controls\" | \"aria-current\" | \"aria-describedby\" | \"aria-details\" | \"aria-disabled\" | \"aria-dropeffect\" | \"aria-errormessage\" | \"aria-expanded\" | \"aria-flowto\" | \"aria-grabbed\" | \"aria-haspopup\" | \"aria-hidden\" | \"aria-invalid\" | \"aria-keyshortcuts\" | \"aria-labelledby\" | \"aria-level\" | \"aria-live\" | \"aria-modal\" | \"aria-multiline\" | \"aria-multiselectable\" | \"aria-orientation\" | \"aria-owns\" | \"aria-placeholder\" | \"aria-posinset\" | \"aria-pressed\" | \"aria-readonly\" | \"aria-relevant\" | \"aria-required\" | \"aria-roledescription\" | \"aria-rowcount\" | \"aria-rowindex\" | \"aria-rowspan\" | \"aria-selected\" | \"aria-setsize\" | \"aria-sort\" | \"aria-valuemax\" | \"aria-valuemin\" | \"aria-valuenow\" | \"aria-valuetext\" | \"dangerouslySetInnerHTML\" | \"onCopy\" | \"onCopyCapture\" | \"onCut\" | \"onCutCapture\" | \"onPaste\" | \"onPasteCapture\" | \"onCompositionEnd\" | \"onCompositionEndCapture\" | \"onCompositionStart\" | \"onCompositionStartCapture\" | \"onCompositionUpdate\" | \"onCompositionUpdateCapture\" | \"onFocus\" | \"onFocusCapture\" | \"onBlur\" | \"onBlurCapture\" | \"onChangeCapture\" | \"onBeforeInput\" | \"onBeforeInputCapture\" | \"onInput\" | \"onInputCapture\" | \"onReset\" | \"onResetCapture\" | \"onSubmit\" | \"onSubmitCapture\" | \"onInvalid\" | \"onInvalidCapture\" | \"onLoad\" | \"onLoadCapture\" | \"onErrorCapture\" | \"onKeyDownCapture\" | \"onKeyPress\" | \"onKeyPressCapture\" | \"onKeyUp\" | \"onKeyUpCapture\" | \"onAbort\" | \"onAbortCapture\" | \"onCanPlay\" | \"onCanPlayCapture\" | \"onCanPlayThrough\" | \"onCanPlayThroughCapture\" | \"onDurationChange\" | \"onDurationChangeCapture\" | \"onEmptied\" | \"onEmptiedCapture\" | \"onEncrypted\" | \"onEncryptedCapture\" | \"onEnded\" | \"onEndedCapture\" | \"onLoadedData\" | \"onLoadedDataCapture\" | \"onLoadedMetadata\" | \"onLoadedMetadataCapture\" | \"onLoadStart\" | \"onLoadStartCapture\" | \"onPause\" | \"onPauseCapture\" | \"onPlay\" | \"onPlayCapture\" | \"onPlaying\" | \"onPlayingCapture\" | \"onProgress\" | \"onProgressCapture\" | \"onRateChange\" | \"onRateChangeCapture\" | \"onSeeked\" | \"onSeekedCapture\" | \"onSeeking\" | \"onSeekingCapture\" | \"onStalled\" | \"onStalledCapture\" | \"onSuspend\" | \"onSuspendCapture\" | \"onTimeUpdate\" | \"onTimeUpdateCapture\" | \"onVolumeChange\" | \"onVolumeChangeCapture\" | \"onWaiting\" | \"onWaitingCapture\" | \"onAuxClick\" | \"onAuxClickCapture\" | \"onClickCapture\" | \"onContextMenu\" | \"onContextMenuCapture\" | \"onDoubleClick\" | \"onDoubleClickCapture\" | \"onDrag\" | \"onDragCapture\" | \"onDragEnd\" | \"onDragEndCapture\" | \"onDragEnter\" | \"onDragEnterCapture\" | \"onDragExit\" | \"onDragExitCapture\" | \"onDragLeave\" | \"onDragLeaveCapture\" | \"onDragOver\" | \"onDragOverCapture\" | \"onDragStart\" | \"onDragStartCapture\" | \"onDrop\" | \"onDropCapture\" | \"onMouseDown\" | \"onMouseDownCapture\" | \"onMouseEnter\" | \"onMouseLeave\" | \"onMouseMove\" | \"onMouseMoveCapture\" | \"onMouseOut\" | \"onMouseOutCapture\" | \"onMouseOver\" | \"onMouseOverCapture\" | \"onMouseUp\" | \"onMouseUpCapture\" | \"onSelect\" | \"onSelectCapture\" | \"onTouchCancel\" | \"onTouchCancelCapture\" | \"onTouchEnd\" | \"onTouchEndCapture\" | \"onTouchMove\" | \"onTouchMoveCapture\" | \"onTouchStart\" | \"onTouchStartCapture\" | \"onPointerDown\" | \"onPointerDownCapture\" | \"onPointerMove\" | \"onPointerMoveCapture\" | \"onPointerUp\" | \"onPointerUpCapture\" | \"onPointerCancel\" | \"onPointerCancelCapture\" | \"onPointerEnter\" | \"onPointerEnterCapture\" | \"onPointerLeave\" | \"onPointerLeaveCapture\" | \"onPointerOver\" | \"onPointerOverCapture\" | \"onPointerOut\" | \"onPointerOutCapture\" | \"onGotPointerCapture\" | \"onGotPointerCaptureCapture\" | \"onLostPointerCapture\" | \"onLostPointerCaptureCapture\" | \"onScroll\" | \"onScrollCapture\" | \"onWheel\" | \"onWheelCapture\" | \"onAnimationStart\" | \"onAnimationStartCapture\" | \"onAnimationEnd\" | \"onAnimationEndCapture\" | \"onAnimationIteration\" | \"onAnimationIterationCapture\" | \"onTransitionEnd\" | \"onTransitionEndCapture\" | \"as\" | keyof ", "CommonProps", " | \"alerts\" | keyof _EuiFlyoutProps | \"isInApp\" | \"observabilityRuleTypeRegistry\" | \"selectedAlertId\"> & { ref?: React.RefObject | ((instance: HTMLDivElement | null) => void) | null | undefined; }> & { readonly _result: ({ alert, alerts, isInApp, observabilityRuleTypeRegistry, onClose, selectedAlertId, }: AlertsFlyoutProps) => JSX.Element | null; }" ], @@ -3375,25 +3375,6 @@ "path": "x-pack/plugins/observability/public/plugin.ts", "deprecated": false }, - { - "parentPluginId": "observability", - "id": "def-public.ObservabilityPublicPluginsStart.sharedUX", - "type": "Object", - "tags": [], - "label": "sharedUX", - "description": [], - "signature": [ - { - "pluginId": "sharedUX", - "scope": "public", - "docId": "kibSharedUXPluginApi", - "section": "def-public.SharedUXPluginStart", - "text": "SharedUXPluginStart" - } - ], - "path": "x-pack/plugins/observability/public/plugin.ts", - "deprecated": false - }, { "parentPluginId": "observability", "id": "def-public.ObservabilityPublicPluginsStart.ruleTypeRegistry", @@ -4733,20 +4714,6 @@ "deprecated": false, "initialIsOpen": false }, - { - "parentPluginId": "observability", - "id": "def-public.enableInfrastructureView", - "type": "string", - "tags": [], - "label": "enableInfrastructureView", - "description": [], - "signature": [ - "\"observability:enableInfrastructureView\"" - ], - "path": "x-pack/plugins/observability/common/ui_settings_keys.ts", - "deprecated": false, - "initialIsOpen": false - }, { "parentPluginId": "observability", "id": "def-public.enableInspectEsQueries", @@ -7799,20 +7766,6 @@ "deprecated": false, "initialIsOpen": false }, - { - "parentPluginId": "observability", - "id": "def-common.enableInfrastructureView", - "type": "string", - "tags": [], - "label": "enableInfrastructureView", - "description": [], - "signature": [ - "\"observability:enableInfrastructureView\"" - ], - "path": "x-pack/plugins/observability/common/ui_settings_keys.ts", - "deprecated": false, - "initialIsOpen": false - }, { "parentPluginId": "observability", "id": "def-common.enableInspectEsQueries", diff --git a/api_docs/observability.mdx b/api_docs/observability.mdx index 4bc30e3b264af..1ef626b8f7fc2 100644 --- a/api_docs/observability.mdx +++ b/api_docs/observability.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observability title: "observability" image: https://source.unsplash.com/400x175/?github description: API docs for the observability plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observability'] --- import observabilityObj from './observability.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Observability UI](https://github.com/orgs/elastic/teams/observability-u | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 399 | 2 | 396 | 30 | +| 396 | 2 | 393 | 30 | ## Client diff --git a/api_docs/osquery.mdx b/api_docs/osquery.mdx index 7bc8ecfff0f9a..0fc1e5d78f97c 100644 --- a/api_docs/osquery.mdx +++ b/api_docs/osquery.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/osquery title: "osquery" image: https://source.unsplash.com/400x175/?github description: API docs for the osquery plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'osquery'] --- import osqueryObj from './osquery.devdocs.json'; diff --git a/api_docs/plugin_directory.mdx b/api_docs/plugin_directory.mdx index 78835ab2ec375..9dd9cc8c8d2e5 100644 --- a/api_docs/plugin_directory.mdx +++ b/api_docs/plugin_directory.mdx @@ -7,7 +7,7 @@ id: kibDevDocsPluginDirectory slug: /kibana-dev-docs/api-meta/plugin-api-directory title: Directory description: Directory of public APIs available through plugins or packages. -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -15,13 +15,13 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Count | Plugins or Packages with a
public API | Number of teams | |--------------|----------|------------------------| -| 404 | 338 | 37 | +| 410 | 340 | 36 | ### Public API health stats | API Count | Any Count | Missing comments | Missing exports | |--------------|----------|-----------------|--------| -| 29304 | 175 | 19745 | 910 | +| 29330 | 180 | 19815 | 917 | ## Plugin Directory @@ -36,7 +36,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [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. | 80 | 1 | 71 | 2 | | | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds Canvas application to Kibana | 9 | 0 | 8 | 3 | | | [ResponseOps](https://github.com/orgs/elastic/teams/response-ops) | The Case management system in Kibana | 82 | 0 | 66 | 29 | -| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | - | 272 | 2 | 253 | 9 | +| | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | - | 261 | 2 | 246 | 9 | | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 29 | 0 | 24 | 0 | | | [Cloud Security Posture](https://github.com/orgs/elastic/teams/cloud-posture-security) | The cloud security posture plugin | 18 | 0 | 2 | 3 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 13 | 0 | 13 | 1 | @@ -55,10 +55,10 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [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. | 90 | 0 | 73 | 5 | | | [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 | 512 | 0 | 413 | 4 | +| | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds embeddables service to Kibana | 514 | 0 | 414 | 4 | | | [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. | 51 | 0 | 42 | 0 | -| | [Enterprise Search](https://github.com/orgs/elastic/teams/enterprise-search-frontend) | Adds dashboards for discovering and managing Enterprise Search products. | 6 | 0 | 6 | 0 | +| | [Enterprise Search](https://github.com/orgs/elastic/teams/enterprise-search-frontend) | Adds dashboards for discovering and managing Enterprise Search products. | 8 | 0 | 8 | 0 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 114 | 3 | 110 | 3 | | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | The Event Annotation service contains expressions for event annotations | 95 | 0 | 95 | 6 | | | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 100 | 0 | 100 | 9 | @@ -79,8 +79,8 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 222 | 0 | 95 | 2 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Index pattern fields and ambiguous values formatters | 288 | 5 | 249 | 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. | 62 | 0 | 62 | 2 | -| | [@elastic/kibana-app-services](https://github.com/orgs/elastic/teams/team:AppServicesUx) | File upload, download, sharing, and serving over HTTP implementation in Kibana. | 236 | 0 | 3 | 2 | -| | [Fleet](https://github.com/orgs/elastic/teams/fleet) | - | 957 | 3 | 862 | 9 | +| | [@elastic/kibana-app-services](https://github.com/orgs/elastic/teams/team:AppServicesUx) | File upload, download, sharing, and serving over HTTP implementation in Kibana. | 237 | 0 | 3 | 2 | +| | [Fleet](https://github.com/orgs/elastic/teams/fleet) | - | 961 | 3 | 866 | 9 | | | [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 | @@ -113,7 +113,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [Stack Monitoring](https://github.com/orgs/elastic/teams/stack-monitoring-ui) | - | 9 | 0 | 9 | 0 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | - | 34 | 0 | 34 | 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) | - | 399 | 2 | 396 | 30 | +| | [Observability UI](https://github.com/orgs/elastic/teams/observability-ui) | - | 396 | 2 | 393 | 30 | | | [Security asset management](https://github.com/orgs/elastic/teams/security-asset-management) | - | 13 | 0 | 13 | 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). | 243 | 2 | 187 | 12 | @@ -134,7 +134,6 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [Security solution](https://github.com/orgs/elastic/teams/security-solution) | - | 54 | 0 | 53 | 22 | | | [Security Team](https://github.com/orgs/elastic/teams/security-team) | - | 3 | 0 | 3 | 1 | | | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Adds URL Service and sharing capabilities to Kibana | 114 | 0 | 55 | 10 | -| | [Shared UX](https://github.com/orgs/elastic/teams/shared-ux) | A plugin providing components and services for shared user experiences in Kibana. | 4 | 0 | 0 | 0 | | | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 22 | 1 | 22 | 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. | 260 | 0 | 64 | 0 | | | [Response Ops](https://github.com/orgs/elastic/teams/response-ops) | - | 4 | 0 | 4 | 0 | @@ -169,15 +168,14 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Registers the TSVB visualization. TSVB has its one editor, works with index patterns and index strings and contains 6 types of charts: timeseries, topN, table. markdown, metric and gauge. | 10 | 1 | 10 | 3 | | | [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. | 380 | 12 | 356 | 14 | +| | [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. | 53 | 0 | 50 | 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. | 414 | 12 | 386 | 15 | | watcher | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 0 | 0 | 0 | 0 | ## Package Directory | Package name           | Maintaining team | Description | API Cnt | Any Cnt | Missing
comments | Missing
exports | |--------------|----------------|-----------|--------------|----------|---------------|--------| -| | [Owner missing] | Elastic APM trace data generator | 74 | 0 | 74 | 11 | | | [Owner missing] | - | 11 | 5 | 11 | 0 | | | Machine Learning UI | React components for AIOps related efforts. | 6 | 0 | 6 | 0 | | | Machine Learning UI | Static utilities for AIOps related efforts. | 49 | 0 | 24 | 0 | @@ -189,6 +187,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | Kibana Core | - | 18 | 0 | 0 | 0 | | | Kibana Core | - | 20 | 0 | 0 | 0 | | | [Owner missing] | - | 16 | 0 | 16 | 0 | +| | [Owner missing] | Elastic APM trace data generator | 74 | 0 | 74 | 11 | | | [Owner missing] | - | 11 | 0 | 11 | 0 | | | [Owner missing] | - | 10 | 0 | 10 | 0 | | | [Owner missing] | - | 18 | 0 | 9 | 1 | @@ -358,17 +357,20 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [Owner missing] | - | 20 | 0 | 6 | 0 | | | [Owner missing] | - | 10 | 0 | 4 | 0 | | | [Owner missing] | - | 32 | 0 | 28 | 0 | -| | [Owner missing] | - | 11 | 0 | 6 | 0 | -| | [Owner missing] | - | 8 | 0 | 7 | 0 | +| | [Owner missing] | - | 10 | 0 | 9 | 0 | | | [Owner missing] | - | 13 | 0 | 4 | 1 | | | [Owner missing] | - | 12 | 0 | 12 | 0 | -| | [Owner missing] | - | 26 | 0 | 3 | 0 | +| | [Owner missing] | - | 8 | 0 | 3 | 0 | | | [Owner missing] | - | 25 | 0 | 24 | 0 | +| | [Owner missing] | - | 10 | 0 | 4 | 0 | +| | [Owner missing] | - | 43 | 5 | 43 | 2 | +| | [Owner missing] | - | 13 | 0 | 4 | 0 | +| | [Owner missing] | - | 11 | 0 | 5 | 0 | +| | [Owner missing] | - | 24 | 0 | 24 | 0 | +| | [Owner missing] | - | 27 | 0 | 26 | 0 | | | [Owner missing] | - | 5 | 0 | 3 | 0 | | | [Owner missing] | - | 24 | 0 | 4 | 0 | | | [Owner missing] | - | 17 | 0 | 16 | 0 | -| | [Owner missing] | - | 80 | 0 | 51 | 1 | -| | [Owner missing] | - | 16 | 0 | 7 | 0 | | | [Owner missing] | - | 14 | 0 | 4 | 1 | | | [Owner missing] | - | 9 | 0 | 3 | 0 | | | [Owner missing] | - | 20 | 0 | 12 | 0 | diff --git a/api_docs/presentation_util.mdx b/api_docs/presentation_util.mdx index a803432619749..5c7e49d043365 100644 --- a/api_docs/presentation_util.mdx +++ b/api_docs/presentation_util.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/presentationUtil title: "presentationUtil" image: https://source.unsplash.com/400x175/?github description: API docs for the presentationUtil plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'presentationUtil'] --- import presentationUtilObj from './presentation_util.devdocs.json'; diff --git a/api_docs/remote_clusters.mdx b/api_docs/remote_clusters.mdx index 5d518b2c75b0d..4e7786a4d04eb 100644 --- a/api_docs/remote_clusters.mdx +++ b/api_docs/remote_clusters.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/remoteClusters title: "remoteClusters" image: https://source.unsplash.com/400x175/?github description: API docs for the remoteClusters plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'remoteClusters'] --- import remoteClustersObj from './remote_clusters.devdocs.json'; diff --git a/api_docs/reporting.mdx b/api_docs/reporting.mdx index 442c61ad6812a..bdcbe060dfa4f 100644 --- a/api_docs/reporting.mdx +++ b/api_docs/reporting.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/reporting title: "reporting" image: https://source.unsplash.com/400x175/?github description: API docs for the reporting plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'reporting'] --- import reportingObj from './reporting.devdocs.json'; diff --git a/api_docs/rollup.mdx b/api_docs/rollup.mdx index f56a7960339b9..b73d9a6198099 100644 --- a/api_docs/rollup.mdx +++ b/api_docs/rollup.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/rollup title: "rollup" image: https://source.unsplash.com/400x175/?github description: API docs for the rollup plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'rollup'] --- import rollupObj from './rollup.devdocs.json'; diff --git a/api_docs/rule_registry.mdx b/api_docs/rule_registry.mdx index 27e30d9e49be2..817429c06f914 100644 --- a/api_docs/rule_registry.mdx +++ b/api_docs/rule_registry.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ruleRegistry title: "ruleRegistry" image: https://source.unsplash.com/400x175/?github description: API docs for the ruleRegistry plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ruleRegistry'] --- import ruleRegistryObj from './rule_registry.devdocs.json'; diff --git a/api_docs/runtime_fields.mdx b/api_docs/runtime_fields.mdx index bf3a03b0197cd..f6e14a981f176 100644 --- a/api_docs/runtime_fields.mdx +++ b/api_docs/runtime_fields.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/runtimeFields title: "runtimeFields" image: https://source.unsplash.com/400x175/?github description: API docs for the runtimeFields plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'runtimeFields'] --- import runtimeFieldsObj from './runtime_fields.devdocs.json'; diff --git a/api_docs/saved_objects.mdx b/api_docs/saved_objects.mdx index 198edc76a929d..2cc5e35127c42 100644 --- a/api_docs/saved_objects.mdx +++ b/api_docs/saved_objects.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjects title: "savedObjects" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjects plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjects'] --- import savedObjectsObj from './saved_objects.devdocs.json'; diff --git a/api_docs/saved_objects_management.mdx b/api_docs/saved_objects_management.mdx index 9af762e3cfda2..29d91d20cf02b 100644 --- a/api_docs/saved_objects_management.mdx +++ b/api_docs/saved_objects_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsManagement title: "savedObjectsManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsManagement plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsManagement'] --- import savedObjectsManagementObj from './saved_objects_management.devdocs.json'; diff --git a/api_docs/saved_objects_tagging.mdx b/api_docs/saved_objects_tagging.mdx index 97b5caa86734b..2c33fd3715fab 100644 --- a/api_docs/saved_objects_tagging.mdx +++ b/api_docs/saved_objects_tagging.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsTagging title: "savedObjectsTagging" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsTagging plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsTagging'] --- import savedObjectsTaggingObj from './saved_objects_tagging.devdocs.json'; diff --git a/api_docs/saved_objects_tagging_oss.mdx b/api_docs/saved_objects_tagging_oss.mdx index 99a6a16692913..6c061694de3e2 100644 --- a/api_docs/saved_objects_tagging_oss.mdx +++ b/api_docs/saved_objects_tagging_oss.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsTaggingOss title: "savedObjectsTaggingOss" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsTaggingOss plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsTaggingOss'] --- import savedObjectsTaggingOssObj from './saved_objects_tagging_oss.devdocs.json'; diff --git a/api_docs/saved_search.mdx b/api_docs/saved_search.mdx index b68e01356a8f1..f4c21e0a52ea2 100644 --- a/api_docs/saved_search.mdx +++ b/api_docs/saved_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedSearch title: "savedSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the savedSearch plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedSearch'] --- import savedSearchObj from './saved_search.devdocs.json'; diff --git a/api_docs/screenshot_mode.mdx b/api_docs/screenshot_mode.mdx index 13c646152f5f5..98da263297266 100644 --- a/api_docs/screenshot_mode.mdx +++ b/api_docs/screenshot_mode.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/screenshotMode title: "screenshotMode" image: https://source.unsplash.com/400x175/?github description: API docs for the screenshotMode plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'screenshotMode'] --- import screenshotModeObj from './screenshot_mode.devdocs.json'; diff --git a/api_docs/screenshotting.mdx b/api_docs/screenshotting.mdx index bbc09d7885d48..2860839da32dd 100644 --- a/api_docs/screenshotting.mdx +++ b/api_docs/screenshotting.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/screenshotting title: "screenshotting" image: https://source.unsplash.com/400x175/?github description: API docs for the screenshotting plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'screenshotting'] --- import screenshottingObj from './screenshotting.devdocs.json'; diff --git a/api_docs/security.mdx b/api_docs/security.mdx index 70bfc2aaadf3c..37faaa1366ca3 100644 --- a/api_docs/security.mdx +++ b/api_docs/security.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/security title: "security" image: https://source.unsplash.com/400x175/?github description: API docs for the security plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'security'] --- import securityObj from './security.devdocs.json'; diff --git a/api_docs/security_solution.mdx b/api_docs/security_solution.mdx index 6c7bbf1b7b79a..b9a7017fba830 100644 --- a/api_docs/security_solution.mdx +++ b/api_docs/security_solution.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/securitySolution title: "securitySolution" image: https://source.unsplash.com/400x175/?github description: API docs for the securitySolution plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'securitySolution'] --- import securitySolutionObj from './security_solution.devdocs.json'; diff --git a/api_docs/session_view.mdx b/api_docs/session_view.mdx index 3763185a95fcf..a320d389f9018 100644 --- a/api_docs/session_view.mdx +++ b/api_docs/session_view.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/sessionView title: "sessionView" image: https://source.unsplash.com/400x175/?github description: API docs for the sessionView plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'sessionView'] --- import sessionViewObj from './session_view.devdocs.json'; diff --git a/api_docs/share.mdx b/api_docs/share.mdx index a71f9aae70c57..fb374a526cb8c 100644 --- a/api_docs/share.mdx +++ b/api_docs/share.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/share title: "share" image: https://source.unsplash.com/400x175/?github description: API docs for the share plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'share'] --- import shareObj from './share.devdocs.json'; diff --git a/api_docs/shared_u_x.devdocs.json b/api_docs/shared_u_x.devdocs.json deleted file mode 100644 index 948d6b212ebf8..0000000000000 --- a/api_docs/shared_u_x.devdocs.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "id": "sharedUX", - "client": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [], - "start": { - "parentPluginId": "sharedUX", - "id": "def-public.SharedUXPluginStart", - "type": "Interface", - "tags": [], - "label": "SharedUXPluginStart", - "description": [ - "\nThe Shared UX plugin public contract, containing prewired components, services, and\nother constructs useful to consumers." - ], - "path": "src/plugins/shared_ux/public/types/index.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "sharedUX", - "id": "def-public.SharedUXPluginStart.getContextServices", - "type": "Function", - "tags": [], - "label": "getContextServices", - "description": [ - "\nA set of pre-wired services for use with `SharedUxServicesProvider`.\n\n```\nimport { SharedUxServicesProvider } from '@kbn/shared-ux-services';\n\npublic start(coreStart: CoreStart, startPlugins: MyPluginStartDeps): MyPluginStart {\n const services = startPlugins.sharedUX.getContextServices();\n return {\n ServicesContext: ({ children }) => {children},\n };\n}\n```\n\nor\n\n```\nimport { SharedUxServicesProvider } from '@kbn/shared-ux-services';\n\npublic setup(coreSetup: CoreSetup, setupPlugins: MyPluginSetupDeps): MyPluginSetup {\n const [coreStart, startPlugins] = await coreSetup.getStartServices();\n coreSetup.application.register({\n mount: async (params: AppMountParameters) => {\n ReactDOM.render(\n \n \n ,\n params.element\n );\n }\n );\n}\n```" - ], - "signature": [ - "() => ", - "SharedUxServices" - ], - "path": "src/plugins/shared_ux/public/types/index.ts", - "deprecated": false, - "children": [], - "returnComment": [] - } - ], - "lifecycle": "start", - "initialIsOpen": true - } - }, - "server": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "common": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [ - { - "parentPluginId": "sharedUX", - "id": "def-common.PLUGIN_ID", - "type": "string", - "tags": [], - "label": "PLUGIN_ID", - "description": [ - "The ID of the Shared UX plugin." - ], - "signature": [ - "\"sharedUX\"" - ], - "path": "src/plugins/shared_ux/common/index.ts", - "deprecated": false, - "initialIsOpen": false - }, - { - "parentPluginId": "sharedUX", - "id": "def-common.PLUGIN_NAME", - "type": "string", - "tags": [], - "label": "PLUGIN_NAME", - "description": [ - "The name of the Shared UX plugin." - ], - "signature": [ - "\"sharedUX\"" - ], - "path": "src/plugins/shared_ux/common/index.ts", - "deprecated": false, - "initialIsOpen": false - } - ], - "objects": [] - } -} \ No newline at end of file diff --git a/api_docs/shared_u_x.mdx b/api_docs/shared_u_x.mdx deleted file mode 100644 index ad5791ed00674..0000000000000 --- a/api_docs/shared_u_x.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -#### -#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system. -#### Reach out in #docs-engineering for more info. -#### -id: kibSharedUXPluginApi -slug: /kibana-dev-docs/api/sharedUX -title: "sharedUX" -image: https://source.unsplash.com/400x175/?github -description: API docs for the sharedUX plugin -date: 2022-08-18 -tags: ['contributor', 'dev', 'apidocs', 'kibana', 'sharedUX'] ---- -import sharedUXObj from './shared_u_x.devdocs.json'; - -A plugin providing components and services for shared user experiences in Kibana. - -Contact [Shared UX](https://github.com/orgs/elastic/teams/shared-ux) for questions regarding this plugin. - -**Code health stats** - -| Public API count | Any count | Items lacking comments | Missing exports | -|-------------------|-----------|------------------------|-----------------| -| 4 | 0 | 0 | 0 | - -## Client - -### Start - - -## Common - -### Consts, variables and types - - diff --git a/api_docs/snapshot_restore.mdx b/api_docs/snapshot_restore.mdx index 670740f05c60d..4e17deb78c52e 100644 --- a/api_docs/snapshot_restore.mdx +++ b/api_docs/snapshot_restore.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/snapshotRestore title: "snapshotRestore" image: https://source.unsplash.com/400x175/?github description: API docs for the snapshotRestore plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'snapshotRestore'] --- import snapshotRestoreObj from './snapshot_restore.devdocs.json'; diff --git a/api_docs/spaces.mdx b/api_docs/spaces.mdx index 62952da669590..946e1220ffea2 100644 --- a/api_docs/spaces.mdx +++ b/api_docs/spaces.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/spaces title: "spaces" image: https://source.unsplash.com/400x175/?github description: API docs for the spaces plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'spaces'] --- import spacesObj from './spaces.devdocs.json'; diff --git a/api_docs/stack_alerts.mdx b/api_docs/stack_alerts.mdx index ab426457b895b..55cdcac9ab284 100644 --- a/api_docs/stack_alerts.mdx +++ b/api_docs/stack_alerts.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/stackAlerts title: "stackAlerts" image: https://source.unsplash.com/400x175/?github description: API docs for the stackAlerts plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'stackAlerts'] --- import stackAlertsObj from './stack_alerts.devdocs.json'; diff --git a/api_docs/task_manager.mdx b/api_docs/task_manager.mdx index 66c7ef925b61d..94964f824327b 100644 --- a/api_docs/task_manager.mdx +++ b/api_docs/task_manager.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/taskManager title: "taskManager" image: https://source.unsplash.com/400x175/?github description: API docs for the taskManager plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'taskManager'] --- import taskManagerObj from './task_manager.devdocs.json'; diff --git a/api_docs/telemetry.mdx b/api_docs/telemetry.mdx index b3fae06483c12..4a8f0134cfcde 100644 --- a/api_docs/telemetry.mdx +++ b/api_docs/telemetry.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetry title: "telemetry" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetry plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetry'] --- import telemetryObj from './telemetry.devdocs.json'; diff --git a/api_docs/telemetry_collection_manager.mdx b/api_docs/telemetry_collection_manager.mdx index 49752eca42ae4..87dfbce21f830 100644 --- a/api_docs/telemetry_collection_manager.mdx +++ b/api_docs/telemetry_collection_manager.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetryCollectionManager title: "telemetryCollectionManager" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetryCollectionManager plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryCollectionManager'] --- import telemetryCollectionManagerObj from './telemetry_collection_manager.devdocs.json'; diff --git a/api_docs/telemetry_collection_xpack.mdx b/api_docs/telemetry_collection_xpack.mdx index 7c92a43c73b32..d7c1b6a63da36 100644 --- a/api_docs/telemetry_collection_xpack.mdx +++ b/api_docs/telemetry_collection_xpack.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetryCollectionXpack title: "telemetryCollectionXpack" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetryCollectionXpack plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryCollectionXpack'] --- import telemetryCollectionXpackObj from './telemetry_collection_xpack.devdocs.json'; diff --git a/api_docs/telemetry_management_section.mdx b/api_docs/telemetry_management_section.mdx index 4f313ef00203d..45f696e98e0d6 100644 --- a/api_docs/telemetry_management_section.mdx +++ b/api_docs/telemetry_management_section.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetryManagementSection title: "telemetryManagementSection" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetryManagementSection plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryManagementSection'] --- import telemetryManagementSectionObj from './telemetry_management_section.devdocs.json'; diff --git a/api_docs/threat_intelligence.mdx b/api_docs/threat_intelligence.mdx index 9e2202a97d276..7846b7583c6ef 100644 --- a/api_docs/threat_intelligence.mdx +++ b/api_docs/threat_intelligence.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/threatIntelligence title: "threatIntelligence" image: https://source.unsplash.com/400x175/?github description: API docs for the threatIntelligence plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'threatIntelligence'] --- import threatIntelligenceObj from './threat_intelligence.devdocs.json'; diff --git a/api_docs/timelines.mdx b/api_docs/timelines.mdx index 5a8657bacff3c..c8e373f2e9f61 100644 --- a/api_docs/timelines.mdx +++ b/api_docs/timelines.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/timelines title: "timelines" image: https://source.unsplash.com/400x175/?github description: API docs for the timelines plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'timelines'] --- import timelinesObj from './timelines.devdocs.json'; diff --git a/api_docs/transform.mdx b/api_docs/transform.mdx index e9be02b930e5a..06540db67aba9 100644 --- a/api_docs/transform.mdx +++ b/api_docs/transform.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/transform title: "transform" image: https://source.unsplash.com/400x175/?github description: API docs for the transform plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'transform'] --- import transformObj from './transform.devdocs.json'; diff --git a/api_docs/triggers_actions_ui.mdx b/api_docs/triggers_actions_ui.mdx index e764ea455f9e5..9c5644e43758a 100644 --- a/api_docs/triggers_actions_ui.mdx +++ b/api_docs/triggers_actions_ui.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/triggersActionsUi title: "triggersActionsUi" image: https://source.unsplash.com/400x175/?github description: API docs for the triggersActionsUi plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'triggersActionsUi'] --- import triggersActionsUiObj from './triggers_actions_ui.devdocs.json'; diff --git a/api_docs/ui_actions.mdx b/api_docs/ui_actions.mdx index 93584be5eb047..3344aedd4590a 100644 --- a/api_docs/ui_actions.mdx +++ b/api_docs/ui_actions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/uiActions title: "uiActions" image: https://source.unsplash.com/400x175/?github description: API docs for the uiActions plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'uiActions'] --- import uiActionsObj from './ui_actions.devdocs.json'; diff --git a/api_docs/ui_actions_enhanced.mdx b/api_docs/ui_actions_enhanced.mdx index fe876a3c404e5..503cd435c1a62 100644 --- a/api_docs/ui_actions_enhanced.mdx +++ b/api_docs/ui_actions_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/uiActionsEnhanced title: "uiActionsEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the uiActionsEnhanced plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'uiActionsEnhanced'] --- import uiActionsEnhancedObj from './ui_actions_enhanced.devdocs.json'; diff --git a/api_docs/unified_search.mdx b/api_docs/unified_search.mdx index f18746f866ef7..64f0d6ae8d7ce 100644 --- a/api_docs/unified_search.mdx +++ b/api_docs/unified_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedSearch title: "unifiedSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedSearch plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedSearch'] --- import unifiedSearchObj from './unified_search.devdocs.json'; diff --git a/api_docs/unified_search_autocomplete.mdx b/api_docs/unified_search_autocomplete.mdx index 41e29f54eab13..ba1c3c375e317 100644 --- a/api_docs/unified_search_autocomplete.mdx +++ b/api_docs/unified_search_autocomplete.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedSearch-autocomplete title: "unifiedSearch.autocomplete" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedSearch.autocomplete plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedSearch.autocomplete'] --- import unifiedSearchAutocompleteObj from './unified_search_autocomplete.devdocs.json'; diff --git a/api_docs/url_forwarding.mdx b/api_docs/url_forwarding.mdx index ff5859fc1135c..86c118c1c8db7 100644 --- a/api_docs/url_forwarding.mdx +++ b/api_docs/url_forwarding.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/urlForwarding title: "urlForwarding" image: https://source.unsplash.com/400x175/?github description: API docs for the urlForwarding plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'urlForwarding'] --- import urlForwardingObj from './url_forwarding.devdocs.json'; diff --git a/api_docs/usage_collection.mdx b/api_docs/usage_collection.mdx index 1c296f04cec00..f807def63b4a7 100644 --- a/api_docs/usage_collection.mdx +++ b/api_docs/usage_collection.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/usageCollection title: "usageCollection" image: https://source.unsplash.com/400x175/?github description: API docs for the usageCollection plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'usageCollection'] --- import usageCollectionObj from './usage_collection.devdocs.json'; diff --git a/api_docs/ux.mdx b/api_docs/ux.mdx index 1010db8d591a1..50b3264a3818d 100644 --- a/api_docs/ux.mdx +++ b/api_docs/ux.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ux title: "ux" image: https://source.unsplash.com/400x175/?github description: API docs for the ux plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ux'] --- import uxObj from './ux.devdocs.json'; diff --git a/api_docs/vis_default_editor.mdx b/api_docs/vis_default_editor.mdx index 814d30ce38dac..9b58b7dbfb92a 100644 --- a/api_docs/vis_default_editor.mdx +++ b/api_docs/vis_default_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visDefaultEditor title: "visDefaultEditor" image: https://source.unsplash.com/400x175/?github description: API docs for the visDefaultEditor plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visDefaultEditor'] --- import visDefaultEditorObj from './vis_default_editor.devdocs.json'; diff --git a/api_docs/vis_type_gauge.mdx b/api_docs/vis_type_gauge.mdx index da5640fd3cfe4..2b78f7f5bd11d 100644 --- a/api_docs/vis_type_gauge.mdx +++ b/api_docs/vis_type_gauge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeGauge title: "visTypeGauge" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeGauge plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeGauge'] --- import visTypeGaugeObj from './vis_type_gauge.devdocs.json'; diff --git a/api_docs/vis_type_heatmap.mdx b/api_docs/vis_type_heatmap.mdx index 8ebe21443b746..51a8f40a7aac4 100644 --- a/api_docs/vis_type_heatmap.mdx +++ b/api_docs/vis_type_heatmap.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeHeatmap title: "visTypeHeatmap" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeHeatmap plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeHeatmap'] --- import visTypeHeatmapObj from './vis_type_heatmap.devdocs.json'; diff --git a/api_docs/vis_type_pie.mdx b/api_docs/vis_type_pie.mdx index 5da7c25387f85..da4917cdfe030 100644 --- a/api_docs/vis_type_pie.mdx +++ b/api_docs/vis_type_pie.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypePie title: "visTypePie" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypePie plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypePie'] --- import visTypePieObj from './vis_type_pie.devdocs.json'; diff --git a/api_docs/vis_type_table.mdx b/api_docs/vis_type_table.mdx index 02bb33a478f7b..840f586427643 100644 --- a/api_docs/vis_type_table.mdx +++ b/api_docs/vis_type_table.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeTable title: "visTypeTable" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeTable plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTable'] --- import visTypeTableObj from './vis_type_table.devdocs.json'; diff --git a/api_docs/vis_type_timelion.mdx b/api_docs/vis_type_timelion.mdx index 1d0ef14ec8dff..6b73405739b4b 100644 --- a/api_docs/vis_type_timelion.mdx +++ b/api_docs/vis_type_timelion.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeTimelion title: "visTypeTimelion" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeTimelion plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTimelion'] --- import visTypeTimelionObj from './vis_type_timelion.devdocs.json'; diff --git a/api_docs/vis_type_timeseries.mdx b/api_docs/vis_type_timeseries.mdx index 9b685fc5c1bbf..3f6284c0d0c29 100644 --- a/api_docs/vis_type_timeseries.mdx +++ b/api_docs/vis_type_timeseries.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeTimeseries title: "visTypeTimeseries" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeTimeseries plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTimeseries'] --- import visTypeTimeseriesObj from './vis_type_timeseries.devdocs.json'; diff --git a/api_docs/vis_type_vega.mdx b/api_docs/vis_type_vega.mdx index af1ced42d7181..1c42f4125d7c6 100644 --- a/api_docs/vis_type_vega.mdx +++ b/api_docs/vis_type_vega.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeVega title: "visTypeVega" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeVega plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeVega'] --- import visTypeVegaObj from './vis_type_vega.devdocs.json'; diff --git a/api_docs/vis_type_vislib.mdx b/api_docs/vis_type_vislib.mdx index 3e2adba34760a..25fcfb9665a95 100644 --- a/api_docs/vis_type_vislib.mdx +++ b/api_docs/vis_type_vislib.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeVislib title: "visTypeVislib" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeVislib plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeVislib'] --- import visTypeVislibObj from './vis_type_vislib.devdocs.json'; diff --git a/api_docs/vis_type_xy.devdocs.json b/api_docs/vis_type_xy.devdocs.json index 26e0033116122..ec7c7d42c4201 100644 --- a/api_docs/vis_type_xy.devdocs.json +++ b/api_docs/vis_type_xy.devdocs.json @@ -3,39 +3,6 @@ "client": { "classes": [], "functions": [ - { - "parentPluginId": "visTypeXy", - "id": "def-public.getAggId", - "type": "Function", - "tags": [], - "label": "getAggId", - "description": [ - "\nGet agg id from accessor\n\nFor now this is determined by the esaggs column name. Could be cleaned up in the future." - ], - "signature": [ - "(accessor: string) => string" - ], - "path": "src/plugins/vis_types/xy/public/config/get_agg_id.ts", - "deprecated": false, - "children": [ - { - "parentPluginId": "visTypeXy", - "id": "def-public.getAggId.$1", - "type": "string", - "tags": [], - "label": "accessor", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/vis_types/xy/public/config/get_agg_id.ts", - "deprecated": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, { "parentPluginId": "visTypeXy", "id": "def-public.getPositions", @@ -824,29 +791,6 @@ "path": "src/plugins/vis_types/xy/public/types/param.ts", "deprecated": false, "initialIsOpen": false - }, - { - "parentPluginId": "visTypeXy", - "id": "def-public.XyVisType", - "type": "Type", - "tags": [], - "label": "XyVisType", - "description": [ - "\nType of xy visualizations" - ], - "signature": [ - { - "pluginId": "visTypeXy", - "scope": "common", - "docId": "kibVisTypeXyPluginApi", - "section": "def-common.ChartType", - "text": "ChartType" - }, - " | \"horizontal_bar\"" - ], - "path": "src/plugins/vis_types/xy/common/index.ts", - "deprecated": false, - "initialIsOpen": false } ], "objects": [], @@ -891,31 +835,7 @@ "initialIsOpen": false } ], - "misc": [ - { - "parentPluginId": "visTypeXy", - "id": "def-common.XyVisType", - "type": "Type", - "tags": [], - "label": "XyVisType", - "description": [ - "\nType of xy visualizations" - ], - "signature": [ - { - "pluginId": "visTypeXy", - "scope": "common", - "docId": "kibVisTypeXyPluginApi", - "section": "def-common.ChartType", - "text": "ChartType" - }, - " | \"horizontal_bar\"" - ], - "path": "src/plugins/vis_types/xy/common/index.ts", - "deprecated": false, - "initialIsOpen": false - } - ], + "misc": [], "objects": [] } } \ No newline at end of file diff --git a/api_docs/vis_type_xy.mdx b/api_docs/vis_type_xy.mdx index c1f5c4d6e90ac..e311b30da528e 100644 --- a/api_docs/vis_type_xy.mdx +++ b/api_docs/vis_type_xy.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeXy title: "visTypeXy" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeXy plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeXy'] --- import visTypeXyObj from './vis_type_xy.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 57 | 0 | 51 | 5 | +| 53 | 0 | 50 | 5 | ## Client @@ -45,6 +45,3 @@ Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) ### Enums -### Consts, variables and types - - diff --git a/api_docs/visualizations.devdocs.json b/api_docs/visualizations.devdocs.json index 5422e836c2845..c706825202fd6 100644 --- a/api_docs/visualizations.devdocs.json +++ b/api_docs/visualizations.devdocs.json @@ -1157,6 +1157,694 @@ } ], "initialIsOpen": false + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable", + "type": "Class", + "tags": [], + "label": "VisualizeEmbeddable", + "description": [], + "signature": [ + { + "pluginId": "visualizations", + "scope": "public", + "docId": "kibVisualizationsPluginApi", + "section": "def-public.VisualizeEmbeddable", + "text": "VisualizeEmbeddable" + }, + " extends ", + { + "pluginId": "embeddable", + "scope": "public", + "docId": "kibEmbeddablePluginApi", + "section": "def-public.Embeddable", + "text": "Embeddable" + }, + "<", + { + "pluginId": "visualizations", + "scope": "public", + "docId": "kibVisualizationsPluginApi", + "section": "def-public.VisualizeInput", + "text": "VisualizeInput" + }, + ", ", + "VisualizeOutput", + "> implements ", + { + "pluginId": "embeddable", + "scope": "public", + "docId": "kibEmbeddablePluginApi", + "section": "def-public.ReferenceOrValueEmbeddable", + "text": "ReferenceOrValueEmbeddable" + }, + "<", + "VisualizeByValueInput", + ", ", + "VisualizeByReferenceInput", + ">,", + { + "pluginId": "embeddable", + "scope": "public", + "docId": "kibEmbeddablePluginApi", + "section": "def-public.FilterableEmbeddable", + "text": "FilterableEmbeddable" + } + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "signature": [ + "\"visualization\"" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.Unnamed", + "type": "Function", + "tags": [], + "label": "Constructor", + "description": [], + "signature": [ + "any" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.Unnamed.$1", + "type": "Object", + "tags": [], + "label": "timefilter", + "description": [], + "signature": [ + { + "pluginId": "data", + "scope": "public", + "docId": "kibDataQueryPluginApi", + "section": "def-public.TimefilterContract", + "text": "TimefilterContract" + } + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.Unnamed.$2", + "type": "Object", + "tags": [], + "label": "{ vis, editPath, editUrl, indexPatterns, deps, capabilities }", + "description": [], + "signature": [ + "VisualizeEmbeddableConfiguration" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.Unnamed.$3", + "type": "Object", + "tags": [], + "label": "initialInput", + "description": [], + "signature": [ + { + "pluginId": "visualizations", + "scope": "public", + "docId": "kibVisualizationsPluginApi", + "section": "def-public.VisualizeInput", + "text": "VisualizeInput" + } + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.Unnamed.$4", + "type": "Object", + "tags": [], + "label": "attributeService", + "description": [], + "signature": [ + { + "pluginId": "embeddable", + "scope": "public", + "docId": "kibEmbeddablePluginApi", + "section": "def-public.AttributeService", + "text": "AttributeService" + }, + "<", + "VisualizeSavedObjectAttributes", + ", ", + "VisualizeByValueInput", + ", ", + "VisualizeByReferenceInput", + ", unknown> | undefined" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "isRequired": false + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.Unnamed.$5", + "type": "Object", + "tags": [], + "label": "parent", + "description": [], + "signature": [ + { + "pluginId": "embeddable", + "scope": "public", + "docId": "kibEmbeddablePluginApi", + "section": "def-public.IContainer", + "text": "IContainer" + }, + "<{}, ", + { + "pluginId": "embeddable", + "scope": "public", + "docId": "kibEmbeddablePluginApi", + "section": "def-public.ContainerInput", + "text": "ContainerInput" + }, + "<{}>, ", + { + "pluginId": "embeddable", + "scope": "public", + "docId": "kibEmbeddablePluginApi", + "section": "def-public.ContainerOutput", + "text": "ContainerOutput" + }, + "> | undefined" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.reportsEmbeddableLoad", + "type": "Function", + "tags": [], + "label": "reportsEmbeddableLoad", + "description": [], + "signature": [ + "() => boolean" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.getDescription", + "type": "Function", + "tags": [], + "label": "getDescription", + "description": [], + "signature": [ + "() => string" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.getVis", + "type": "Function", + "tags": [], + "label": "getVis", + "description": [], + "signature": [ + "() => ", + { + "pluginId": "visualizations", + "scope": "public", + "docId": "kibVisualizationsPluginApi", + "section": "def-public.Vis", + "text": "Vis" + }, + "<", + { + "pluginId": "visualizations", + "scope": "common", + "docId": "kibVisualizationsPluginApi", + "section": "def-common.VisParams", + "text": "VisParams" + }, + ">" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.getFilters", + "type": "Function", + "tags": [], + "label": "getFilters", + "description": [ + "\nGets the Visualize embeddable's local filters" + ], + "signature": [ + "() => Promise<", + "Filter", + "[]>" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [ + "Local/panel-level array of filters for Visualize embeddable" + ] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.getQuery", + "type": "Function", + "tags": [], + "label": "getQuery", + "description": [ + "\nGets the Visualize embeddable's local query" + ], + "signature": [ + "() => Promise<", + "Query", + " | ", + "AggregateQuery", + " | undefined>" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [ + "Local/panel-level query for Visualize embeddable" + ] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.getInspectorAdapters", + "type": "Function", + "tags": [], + "label": "getInspectorAdapters", + "description": [], + "signature": [ + "() => ", + { + "pluginId": "inspector", + "scope": "common", + "docId": "kibInspectorPluginApi", + "section": "def-common.Adapters", + "text": "Adapters" + }, + " | undefined" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.openInspector", + "type": "Function", + "tags": [], + "label": "openInspector", + "description": [], + "signature": [ + "() => ", + "OverlayRef", + " | undefined" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.transferCustomizationsToUiState", + "type": "Function", + "tags": [], + "label": "transferCustomizationsToUiState", + "description": [ + "\nTransfers all changes in the containerState.customization into\nthe uiState of this visualization." + ], + "signature": [ + "() => void" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.hasInspector", + "type": "Function", + "tags": [], + "label": "hasInspector", + "description": [], + "signature": [ + "() => boolean" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.onContainerLoading", + "type": "Function", + "tags": [], + "label": "onContainerLoading", + "description": [], + "signature": [ + "() => void" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.onContainerData", + "type": "Function", + "tags": [], + "label": "onContainerData", + "description": [], + "signature": [ + "() => void" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.onContainerRender", + "type": "Function", + "tags": [], + "label": "onContainerRender", + "description": [], + "signature": [ + "() => void" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.onContainerError", + "type": "Function", + "tags": [], + "label": "onContainerError", + "description": [], + "signature": [ + "(error: ", + { + "pluginId": "expressions", + "scope": "public", + "docId": "kibExpressionsPluginApi", + "section": "def-public.ExpressionRenderError", + "text": "ExpressionRenderError" + }, + ") => void" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.onContainerError.$1", + "type": "Object", + "tags": [], + "label": "error", + "description": [], + "signature": [ + { + "pluginId": "expressions", + "scope": "public", + "docId": "kibExpressionsPluginApi", + "section": "def-public.ExpressionRenderError", + "text": "ExpressionRenderError" + } + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.render", + "type": "Function", + "tags": [], + "label": "render", + "description": [ + "\n" + ], + "signature": [ + "(domNode: HTMLElement) => Promise" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.render.$1", + "type": "Object", + "tags": [], + "label": "domNode", + "description": [], + "signature": [ + "HTMLElement" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.renderError", + "type": "Function", + "tags": [], + "label": "renderError", + "description": [], + "signature": [ + "(domNode: HTMLElement, error: string | ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ErrorLike", + "text": "ErrorLike" + }, + ") => () => boolean" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.renderError.$1", + "type": "Object", + "tags": [], + "label": "domNode", + "description": [], + "signature": [ + "HTMLElement" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "isRequired": true + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.renderError.$2", + "type": "CompoundType", + "tags": [], + "label": "error", + "description": [], + "signature": [ + "string | ", + { + "pluginId": "expressions", + "scope": "common", + "docId": "kibExpressionsPluginApi", + "section": "def-common.ErrorLike", + "text": "ErrorLike" + } + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.destroy", + "type": "Function", + "tags": [], + "label": "destroy", + "description": [], + "signature": [ + "() => void" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.reload", + "type": "Function", + "tags": [], + "label": "reload", + "description": [], + "signature": [ + "() => Promise" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.supportedTriggers", + "type": "Function", + "tags": [], + "label": "supportedTriggers", + "description": [], + "signature": [ + "() => string[]" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.inputIsRefType", + "type": "Function", + "tags": [], + "label": "inputIsRefType", + "description": [], + "signature": [ + "(input: ", + { + "pluginId": "visualizations", + "scope": "public", + "docId": "kibVisualizationsPluginApi", + "section": "def-public.VisualizeInput", + "text": "VisualizeInput" + }, + ") => input is ", + "VisualizeByReferenceInput" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [ + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.inputIsRefType.$1", + "type": "Object", + "tags": [], + "label": "input", + "description": [], + "signature": [ + { + "pluginId": "visualizations", + "scope": "public", + "docId": "kibVisualizationsPluginApi", + "section": "def-public.VisualizeInput", + "text": "VisualizeInput" + } + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.getInputAsValueType", + "type": "Function", + "tags": [], + "label": "getInputAsValueType", + "description": [], + "signature": [ + "() => Promise<", + "VisualizeByValueInput", + ">" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "visualizations", + "id": "def-public.VisualizeEmbeddable.getInputAsRefType", + "type": "Function", + "tags": [], + "label": "getInputAsRefType", + "description": [], + "signature": [ + "() => Promise<", + "VisualizeByReferenceInput", + ">" + ], + "path": "src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx", + "deprecated": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false } ], "functions": [ @@ -5169,7 +5857,23 @@ "section": "def-public.VisualizeInput", "text": "VisualizeInput" }, - ">) => void; reportsEmbeddableLoad: () => boolean; getFilters: () => Promise<", + ">) => void; reportsEmbeddableLoad: () => boolean; getVis: () => ", + { + "pluginId": "visualizations", + "scope": "public", + "docId": "kibVisualizationsPluginApi", + "section": "def-public.Vis", + "text": "Vis" + }, + "<", + { + "pluginId": "visualizations", + "scope": "common", + "docId": "kibVisualizationsPluginApi", + "section": "def-common.VisParams", + "text": "VisParams" + }, + ">; getFilters: () => Promise<", "Filter", "[]>; getInspectorAdapters: () => ", { @@ -5335,7 +6039,9 @@ "section": "def-public.ContainerOutput", "text": "ContainerOutput" }, - ">; }" + ">; updateOutput: (outputChanges: Partial<", + "VisualizeOutput", + ">) => void; }" ], "path": "src/plugins/visualizations/public/index.ts", "deprecated": false, @@ -5442,7 +6148,13 @@ "text": "ErrorEmbeddable" }, " | ", - "VisualizeEmbeddable", + { + "pluginId": "visualizations", + "scope": "public", + "docId": "kibVisualizationsPluginApi", + "section": "def-public.VisualizeEmbeddable", + "text": "VisualizeEmbeddable" + }, " | ", "DisabledLabEmbeddable", " | undefined>; isEditable: () => Promise; getDisplayName: () => string; createFromSavedObject: (savedObjectId: string, input: Partial<", @@ -5486,7 +6198,13 @@ "text": "ErrorEmbeddable" }, " | ", - "VisualizeEmbeddable", + { + "pluginId": "visualizations", + "scope": "public", + "docId": "kibVisualizationsPluginApi", + "section": "def-public.VisualizeEmbeddable", + "text": "VisualizeEmbeddable" + }, " | ", "DisabledLabEmbeddable", ">; readonly savedObjectMetaData: ", diff --git a/api_docs/visualizations.mdx b/api_docs/visualizations.mdx index ae8173bcceb6c..1a28d8bd40a47 100644 --- a/api_docs/visualizations.mdx +++ b/api_docs/visualizations.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visualizations title: "visualizations" image: https://source.unsplash.com/400x175/?github description: API docs for the visualizations plugin -date: 2022-08-18 +date: 2022-08-22 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visualizations'] --- import visualizationsObj from './visualizations.devdocs.json'; @@ -21,7 +21,7 @@ Contact [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 380 | 12 | 356 | 14 | +| 414 | 12 | 386 | 15 | ## Client diff --git a/dev_docs/contributing/standards.mdx b/dev_docs/contributing/standards.mdx index 1bb54ada1509c..aba29e5fab2f2 100644 --- a/dev_docs/contributing/standards.mdx +++ b/dev_docs/contributing/standards.mdx @@ -15,6 +15,49 @@ We expect all developers to read and abide by our overarching . The majority of these items are linted against but some are not. +## Adding dependencies + +Looking for a dependency that isn't already available in Kibana? There are a few things to keep in mind before adding a new dependency. + +First, be sure you have read and are familiar with our . In particular, **Be wary of dependencies** +and **Prefer one way to do things** provide an overview of how we approach this question. + +In general, we have a bias toward **not** adding new dependencies unless there is a compelling reason to do so, as we want to +minimize Kibana's overall complexity. + +Should you find yourself evaluating a new dependency, here are some specific things to ask yourself: + +1. **Is there already another dependency that offers similar functionality?** If so, adding a new dependency may not be necessary. +Prefer one way to do things and use what's already there, unless there is an important reason not to do so. +2. **Does this dependency appear to be well-maintained?** A dependency that hasn't been updated in years is usually more of a +liability than an asset. Make sure the depedency has recent activity, that bugs and security vulnerabilities appear to be addressed +in a timely manner, and that there is active participation from the maintainers and community. +3. **How large is the dependency?** For client-side plugins, heavy dependencies can have a real impact on user experience, +especially if they are included in the initial page bundle and not loaded asynchronously. In some cases it might make more sense +to roll your own rather than include a bloated depedency, especially if you are only using a single piece of functionality. +4. **Does this dependency have a license that's compatible with Kibana's?** Most common open source licenses such as BSD, MIT, +and Apache 2.0/1.1 are okay to use with Kibana. Others may not be, or may require special attribution. +5. **Will this dependency need to be prebuilt?** Due to our build process, native module dependencies should include at least a prebuild +step so at install time it simply downloads instead of building from source. This allows us to optimize bootstrap times. +6. **Am I committed to maintaining this dependency?** Once you add a dependency to the `package.json`, someone else isn't going to +keep it updated for you. That means you will be responsible for updating it regularly, keeping an eye out for security vulnerabilities, +and dealing with any breaking changes that may arise during an upgrade. We recommend relying on the renovate bot to help keep the +dependency updated; be sure to mark your ownership of the package in the +[`renovate.json`](https://github.com/elastic/kibana/blob/main/renovate.json`) file. + +If you have any questions about whether adding a dependency is appropriate, feel free to reach out to one of the following teams +on Github: + +- **@elastic/kibana-tech-leads** +- **@elastic/kibana-core** +- **@elastic/kibana-operations** +- **@elastic/kibana-security** + + + If you are unsure of which licenses are okay to use, refer to the + [Permitted Open Source Licenses list](https://github.com/elastic/open-source/blob/main/elastic-product-policy.md#permitted-licenses-list). + + ## RESTful HTTP APIs ### Terminology diff --git a/dev_docs/key_concepts/embeddables.mdx b/dev_docs/key_concepts/embeddables.mdx index f1a2bea5b9b12..e42233a7f3f26 100644 --- a/dev_docs/key_concepts/embeddables.mdx +++ b/dev_docs/key_concepts/embeddables.mdx @@ -14,6 +14,7 @@ If you are planning to integrate with the plugin, please get in touch with the A ## Capabilities - Framework-agnostic API. - Out-of-the-box React support. +- Integration with Redux. - Integration with the [UI Actions](https://github.com/elastic/kibana/tree/HEAD/src/plugins/ui_actions) plugin. - Hierarchical structure to enclose multiple widgets. - Error handling. diff --git a/docs/canvas/canvas-tutorial.asciidoc b/docs/canvas/canvas-tutorial.asciidoc index 389cac89cde82..73d808a183920 100644 --- a/docs/canvas/canvas-tutorial.asciidoc +++ b/docs/canvas/canvas-tutorial.asciidoc @@ -9,9 +9,11 @@ To familiarize yourself with *Canvas*, add the Sample eCommerce orders data, the To create a workpad of the eCommerce store data, add the data set, then create the workpad. -. Go to the {kib} *Home* page, then click *Try our sample data*. +. On the home page, click *Try sample data*. -. On the *Sample eCommerce orders data* card, click *Add data*. +. Click *Other sample data sets*. + +. On the *Sample eCommerce orders* card, click *Add data*. . Open the main menu, then click *Canvas*. diff --git a/docs/developer/getting-started/monorepo-packages.asciidoc b/docs/developer/getting-started/monorepo-packages.asciidoc index b6524c6007b2e..a9dc912ab58e4 100644 --- a/docs/developer/getting-started/monorepo-packages.asciidoc +++ b/docs/developer/getting-started/monorepo-packages.asciidoc @@ -41,8 +41,6 @@ yarn kbn watch [discrete] === List of Already Migrated Packages to Bazel -- @elastic/eslint-config-kibana -- @elastic/safer-lodash-set - @kbn/ace - @kbn/analytics - @kbn/apm-config-loader @@ -57,6 +55,7 @@ yarn kbn watch - @kbn/docs-utils - @kbn/es - @kbn/es-archiver +- @kbn/eslint-config-kibana - @kbn/eslint-plugin-eslint - @kbn/expect - @kbn/i18n @@ -68,6 +67,7 @@ yarn kbn watch - @kbn/optimizer - @kbn/plugin-helpers - @kbn/rule-data-utils +- @kbn/safer-lodash-set - @kbn/securitysolution-autocomplete - @kbn/securitysolution-es-utils - @kbn/securitysolution-hook-utils diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index 64077b2ecc106..00f0bc517f5a5 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -259,10 +259,6 @@ oss plugins. generating deep links to other apps using locators, and creating short URLs. -|{kib-repo}blob/{branch}/src/plugins/shared_ux/README.md[sharedUX] -|Our mission is to make consistency in our user experience a product. - - |{kib-repo}blob/{branch}/src/plugins/telemetry/README.md[telemetry] |Telemetry allows Kibana features to have usage tracked in the wild. The general term "telemetry" refers to multiple things: diff --git a/docs/getting-started/images/addData_sampleDataCards_7.15.0.png b/docs/getting-started/images/addData_sampleDataCards_7.15.0.png deleted file mode 100644 index 27e10b98b9670..0000000000000 Binary files a/docs/getting-started/images/addData_sampleDataCards_7.15.0.png and /dev/null differ diff --git a/docs/getting-started/images/addData_sampleDataCards_8.4.0.png b/docs/getting-started/images/addData_sampleDataCards_8.4.0.png new file mode 100644 index 0000000000000..49a83dbbdc10b Binary files /dev/null and b/docs/getting-started/images/addData_sampleDataCards_8.4.0.png differ diff --git a/docs/getting-started/images/addFilterOptions_dashboard_8.4.0.png b/docs/getting-started/images/addFilterOptions_dashboard_8.4.0.png new file mode 100644 index 0000000000000..eb16edb2b0764 Binary files /dev/null and b/docs/getting-started/images/addFilterOptions_dashboard_8.4.0.png differ diff --git a/docs/getting-started/images/addFilter_dashboard_8.4.0.png b/docs/getting-started/images/addFilter_dashboard_8.4.0.png new file mode 100644 index 0000000000000..eeec26daad89d Binary files /dev/null and b/docs/getting-started/images/addFilter_dashboard_8.4.0.png differ diff --git a/docs/getting-started/images/availableFields_discover_8.4.0.png b/docs/getting-started/images/availableFields_discover_8.4.0.png new file mode 100644 index 0000000000000..ba3b9ecaeb4ac Binary files /dev/null and b/docs/getting-started/images/availableFields_discover_8.4.0.png differ diff --git a/docs/getting-started/images/dashboard_ecommerceRevenueDashboard_7.15.0.png b/docs/getting-started/images/dashboard_ecommerceRevenueDashboard_7.15.0.png index 5b62832b1d093..7fbc0a9bad411 100644 Binary files a/docs/getting-started/images/dashboard_ecommerceRevenueDashboard_7.15.0.png and b/docs/getting-started/images/dashboard_ecommerceRevenueDashboard_7.15.0.png differ diff --git a/docs/getting-started/images/dashboard_sampleDataAddFilter_8.4.0.png b/docs/getting-started/images/dashboard_sampleDataAddFilter_8.4.0.png new file mode 100644 index 0000000000000..4c253d3fc3ac5 Binary files /dev/null and b/docs/getting-started/images/dashboard_sampleDataAddFilter_8.4.0.png differ diff --git a/docs/getting-started/images/dashboard_sampleDataFilter_7.15.0.png b/docs/getting-started/images/dashboard_sampleDataFilter_7.15.0.png deleted file mode 100644 index f1f46ab42371a..0000000000000 Binary files a/docs/getting-started/images/dashboard_sampleDataFilter_7.15.0.png and /dev/null differ diff --git a/docs/getting-started/images/ecommerceTreemap_lens_8.4.0.png b/docs/getting-started/images/ecommerceTreemap_lens_8.4.0.png new file mode 100644 index 0000000000000..d933ce93de9d1 Binary files /dev/null and b/docs/getting-started/images/ecommerceTreemap_lens_8.4.0.png differ diff --git a/docs/getting-started/images/kql_discover_8.4.0.png b/docs/getting-started/images/kql_discover_8.4.0.png new file mode 100644 index 0000000000000..cc0398049013a Binary files /dev/null and b/docs/getting-started/images/kql_discover_8.4.0.png differ diff --git a/docs/getting-started/images/sampleDataFilter_dashboard_8.4.0.png b/docs/getting-started/images/sampleDataFilter_dashboard_8.4.0.png new file mode 100644 index 0000000000000..7b5af0ad39395 Binary files /dev/null and b/docs/getting-started/images/sampleDataFilter_dashboard_8.4.0.png differ diff --git a/docs/getting-started/images/timeFilter_discover_8.4.0.png b/docs/getting-started/images/timeFilter_discover_8.4.0.png new file mode 100644 index 0000000000000..73f13ef2b1d9c Binary files /dev/null and b/docs/getting-started/images/timeFilter_discover_8.4.0.png differ diff --git a/docs/getting-started/images/tutorial-discover-2.png b/docs/getting-started/images/tutorial-discover-2.png deleted file mode 100644 index cf217562c37fd..0000000000000 Binary files a/docs/getting-started/images/tutorial-discover-2.png and /dev/null differ diff --git a/docs/getting-started/images/tutorial-discover-3.png b/docs/getting-started/images/tutorial-discover-3.png deleted file mode 100644 index 79cf94058bb76..0000000000000 Binary files a/docs/getting-started/images/tutorial-discover-3.png and /dev/null differ diff --git a/docs/getting-started/images/tutorial-discover-4.png b/docs/getting-started/images/tutorial-discover-4.png deleted file mode 100644 index 584221e8cfd04..0000000000000 Binary files a/docs/getting-started/images/tutorial-discover-4.png and /dev/null differ diff --git a/docs/getting-started/images/tutorial-visualization-dropdown.png b/docs/getting-started/images/tutorial-visualization-dropdown.png deleted file mode 100644 index a069af95ed14a..0000000000000 Binary files a/docs/getting-started/images/tutorial-visualization-dropdown.png and /dev/null differ diff --git a/docs/getting-started/images/tutorial-visualization-treemap.png b/docs/getting-started/images/tutorial-visualization-treemap.png deleted file mode 100644 index c6e8db133cb44..0000000000000 Binary files a/docs/getting-started/images/tutorial-visualization-treemap.png and /dev/null differ diff --git a/docs/getting-started/images/visualizationTypeDropdown_lens_8.4.0.png b/docs/getting-started/images/visualizationTypeDropdown_lens_8.4.0.png new file mode 100644 index 0000000000000..731327997c59b Binary files /dev/null and b/docs/getting-started/images/visualizationTypeDropdown_lens_8.4.0.png differ diff --git a/docs/getting-started/quick-start-guide.asciidoc b/docs/getting-started/quick-start-guide.asciidoc index 2667729f4b854..bc98fbf5af737 100644 --- a/docs/getting-started/quick-start-guide.asciidoc +++ b/docs/getting-started/quick-start-guide.asciidoc @@ -1,13 +1,13 @@ [[get-started]] == Quick start -To quickly get up and running with {kib}, set up on Cloud, then add a sample data set that you can explore and analyze. +To quickly get up and running with {kib}, set up on Cloud, then add a sample data set that you can explore and visualize. -When you've finished, you'll know how to: +When you're done, you'll know how to: * <> -* <> +* <> [float] === Required privileges @@ -26,12 +26,14 @@ include::{docs-root}/shared/cloud/ess-getting-started.asciidoc[] Sample data sets come with sample visualizations, dashboards, and more to help you explore {kib} before you ingest or add your own data. -. On the home page, click *Try our sample data*. +. On the home page, click *Try sample data*. + +. Click *Other sample data sets*. . On the *Sample eCommerce orders* card, click *Add data*. + [role="screenshot"] -image::images/addData_sampleDataCards_7.15.0.png[Add data UI for the sample data sets] +image::images/addData_sampleDataCards_8.4.0.png[Add data UI for the sample data sets] [float] [[explore-the-data]] @@ -44,7 +46,7 @@ image::images/addData_sampleDataCards_7.15.0.png[Add data UI for the sample data . Change the <> to *Last 7 days*. + [role="screenshot"] -image::images/tutorial-discover-2.png[Time filter menu with Last 7 days filter configured] +image::images/timeFilter_discover_8.4.0.png[Time filter menu with Last 7 days filter configured] . To view the sales orders for women's clothing that are $60 or more, use the <> search field: + @@ -52,18 +54,18 @@ image::images/tutorial-discover-2.png[Time filter menu with Last 7 days filter c products.taxless_price >= 60 and category : Women's Clothing + [role="screenshot"] -image::images/tutorial-discover-4.png[Discover tables that displays only the orders for women's clothing that are $60 or more] +image::images/kql_discover_8.4.0.png[Discover tables that displays only the orders for women's clothing that are $60 or more] . To view only the product categories that contain sales orders, hover over the *category* field, then click *+*. + [role="screenshot"] -image::images/tutorial-discover-3.png[Discover table that displays only the product categories that contain orders] +image::images/availableFields_discover_8.4.0.png[Discover table that displays only the product categories that contain orders] [float] [[view-and-analyze-the-data]] -== View and analyze the data +== Visualize the data -A dashboard is a collection of panels that you can use to view and analyze the data. Panels contain visualizations, interactive controls, text, and more. +A dashboard is a collection of panels that you can use to visualize the data. Panels contain visualizations, interactive controls, text, and more. . Open the main menu, then click *Dashboard*. @@ -76,7 +78,7 @@ image::images/dashboard_ecommerceRevenueDashboard_7.15.0.png[The [eCommerce] Rev [[create-a-visualization]] === Create a visualization panel -Create a treemap panel that shows the top sales regions and manufacturers, then add the panel to the dashboard. +Create a treemap visualization panel that shows the top sales regions and manufacturers, then add the panel to the dashboard. . In the toolbar, click *Edit*. @@ -85,7 +87,7 @@ Create a treemap panel that shows the top sales regions and manufacturers, then . In the drag-and-drop visualization editor, open the *Visualization type* dropdown, then select *Treemap*. + [role="screenshot"] -image::getting-started/images/tutorial-visualization-dropdown.png[Chart type menu with Treemap selected] +image::getting-started/images/visualizationTypeDropdown_lens_8.4.0.png[Chart type menu with Treemap selected] . From the *Available fields* list, drag the following fields to the workspace: @@ -94,7 +96,7 @@ image::getting-started/images/tutorial-visualization-dropdown.png[Chart type men * *manufacturer.keyword* + [role="screenshot"] -image::getting-started/images/tutorial-visualization-treemap.png[Treemap that displays Top values of geoip.city_name and Top values or manufacturer.keyword fields] +image::getting-started/images/ecommerceTreemap_lens_8.4.0.png[Treemap that displays Top values of geoip.city_name and Top values or manufacturer.keyword fields] . Click *Save and return*. + @@ -113,26 +115,32 @@ You can interact with the dashboard data using controls that allow you to apply . Click *Apply changes*. + [role="screenshot"] -image::images/dashboard_sampleDataFilter_7.15.0.png[The [eCommerce] Revenue Dashboard that shows only the women's clothing data from the Gnomehouse manufacturer] +image::images/sampleDataFilter_dashboard_8.4.0.png[The [eCommerce] Revenue Dashboard that shows only the women's clothing data from the Gnomehouse manufacturer] [float] [[filter-and-query-the-data]] === Filter the data -To view a subset of the data, you can apply filters to the dashboard panels. Apply a filter to view the women's clothing data generated on Wednesday from the Gnomehouse manufacturer. +To view a subset of the data, you can apply filters to the dashboard data. Apply a filter to view the women's clothing data generated on Wednesday from the Gnomehouse manufacturer. . Click *Add filter*. ++ +[role="screenshot"] +image::images/addFilter_dashboard_8.4.0.png[The Add filter action that applies dashboard-level filters] . From the *Field* dropdown, select *day_of_week*. . From the *Operator* dropdown, select *is*. . From the *Value* dropdown, select *Wednesday*. ++ +[role="screenshot"] +image::images/addFilterOptions_dashboard_8.4.0.png[The Add filter options configured to display only the women's clothing data generated on Wednesday from the Gnomehouse manufacturer] -. Click *Save*. +. Click *Add filter*. + [role="screenshot"] -image::images/dashboard_sampleDataAddFilter_7.15.0.png[The [eCommerce] Revenue Dashboard that shows only the women's clothing data generated on Wednesday from the Gnomehouse manufacturer] +image::images/dashboard_sampleDataAddFilter_8.4.0.png[The [eCommerce] Revenue Dashboard that shows only the women's clothing data generated on Wednesday from the Gnomehouse manufacturer] [float] [[quick-start-whats-next]] @@ -142,6 +150,6 @@ image::images/dashboard_sampleDataAddFilter_7.15.0.png[The [eCommerce] Revenue D *Explore your own data in Discover.* Ready to learn more about exploring your data in *Discover*? Go to <>. -*Create a dashboard with your own data.* Ready to learn more about analyzing your data in *Dashboard*? Go to <>. +*Create a dashboard with your own data.* Ready to learn more about visualizing your data on a *Dashboard*? Go to <>. *Try out the {ml-features}.* Ready to analyze the sample data sets and generate models for its patterns of behavior? Go to {ml-docs}/ml-getting-started.html[Getting started with {ml}]. diff --git a/docs/management/advanced-options.asciidoc b/docs/management/advanced-options.asciidoc index 211e2a3dd5923..7a1eaae676906 100644 --- a/docs/management/advanced-options.asciidoc +++ b/docs/management/advanced-options.asciidoc @@ -456,9 +456,8 @@ Includes {ref}/frozen-indices.html[frozen indices] in results. Searching through frozen indices might increase the search time. This setting is off by default. Users must opt-in to include frozen indices. -[[search-timeout]]`search:timeout`:: Change the maximum timeout for a search -session or set to 0 to disable the timeout and allow queries to run to -completion. +[[search-timeout]]`search:timeout`:: Change the maximum timeout, in milliseconds (ms), for a search +session. To disable the timeout and allow queries to run to completion, set to 0. The default is 600,000 ms, or 10 minutes. [float] [[kibana-siem-settings]] diff --git a/docs/maps/images/gs-filter-icon.png b/docs/maps/images/gs-filter-icon.png new file mode 100644 index 0000000000000..aebe2d51873fd Binary files /dev/null and b/docs/maps/images/gs-filter-icon.png differ diff --git a/docs/maps/images/gs_add_cloropeth_layer.png b/docs/maps/images/gs_add_cloropeth_layer.png index 10774c69adbba..63dc1e3db2cfe 100644 Binary files a/docs/maps/images/gs_add_cloropeth_layer.png and b/docs/maps/images/gs_add_cloropeth_layer.png differ diff --git a/docs/maps/images/gs_add_es_document_layer.png b/docs/maps/images/gs_add_es_document_layer.png index 4656933552f26..35a9192634edc 100644 Binary files a/docs/maps/images/gs_add_es_document_layer.png and b/docs/maps/images/gs_add_es_document_layer.png differ diff --git a/docs/maps/images/gs_dashboard_with_map.png b/docs/maps/images/gs_dashboard_with_map.png index b7d4a7b63ed30..81fc181e698e9 100644 Binary files a/docs/maps/images/gs_dashboard_with_map.png and b/docs/maps/images/gs_dashboard_with_map.png differ diff --git a/docs/maps/images/gs_map_filtered.png b/docs/maps/images/gs_map_filtered.png new file mode 100644 index 0000000000000..f69b2e7397d57 Binary files /dev/null and b/docs/maps/images/gs_map_filtered.png differ diff --git a/docs/maps/images/gs_tooltip_filter.png b/docs/maps/images/gs_tooltip_filter.png new file mode 100644 index 0000000000000..3de04f846c8ae Binary files /dev/null and b/docs/maps/images/gs_tooltip_filter.png differ diff --git a/docs/maps/images/sample_data_web_logs.png b/docs/maps/images/sample_data_web_logs.png index 76ff9c0d16221..080824cf47687 100644 Binary files a/docs/maps/images/sample_data_web_logs.png and b/docs/maps/images/sample_data_web_logs.png differ diff --git a/docs/maps/maps-getting-started.asciidoc b/docs/maps/maps-getting-started.asciidoc index d4da7ef8aae2e..317a9657f1965 100644 --- a/docs/maps/maps-getting-started.asciidoc +++ b/docs/maps/maps-getting-started.asciidoc @@ -34,7 +34,7 @@ refer to <>. . Open the main menu, and then click *Dashboard*. . Click **Create dashboard**. . Set the time range to *Last 7 days*. -. Click the **Create new Maps** icon image:maps/images/app_gis_icon.png[] +. Click the **Create new Maps** icon image:maps/images/app_gis_icon.png[]. [float] [[maps-add-choropleth-layer]] @@ -46,7 +46,7 @@ and lighter shades will symbolize countries with less traffic. . Click **Add layer**, and then click **Choropleth**. -. From the **Layer** dropdown menu, select **World Countries**. +. From the **EMS boundaries** dropdown menu, select **World Countries**. . In **Statistics source**, set: ** **Data view** to **kibana_sample_data_logs** @@ -62,12 +62,12 @@ and lighter shades will symbolize countries with less traffic. . Add a Tooltip field: ** **ISO 3166-1 alpha-2 code** is added by default. -** Click **+ Add** to open field select. +** Click **+ Add** to open the field select. ** Select **name** and click *Add*. . In **Layer style**: -** Set **Fill color: As number** to the grey color ramp. +** Set **Fill color > As number** to the grey color ramp. ** Set **Border color** to white. ** Under **Label**, change **By value** to **Fixed**. @@ -76,7 +76,7 @@ and lighter shades will symbolize countries with less traffic. Your map now looks like this: + [role="screenshot"] -image::maps/images/gs_add_cloropeth_layer.png[] +image::maps/images/gs_add_cloropeth_layer.png[Map showing the Total Requests by Destination layer] [float] [[maps-add-elasticsearch-layer]] @@ -107,7 +107,7 @@ The layer is only visible when users zoom in. . Add a tooltip field and select **agent**, **bytes**, **clientip**, **host**, **machine.os**, **request**, **response**, and **timestamp**. -. In **Scaling**, set *Limits results to 10,000.* +. In **Scaling**, enable *Limit results to 10,000.* . In **Layer style**, set **Fill color** to **#2200FF**. @@ -116,7 +116,7 @@ The layer is only visible when users zoom in. Your map will look like this from zoom level 9 to 24: + [role="screenshot"] -image::maps/images/gs_add_es_document_layer.png[] +image::maps/images/gs_add_es_document_layer.png[Map showing what zoom level looks like a level 9] [float] ==== Add a layer for aggregated data @@ -140,14 +140,14 @@ grids with less bytes transferred. ** Click **Add metric**. ** Set **Aggregation** to **Sum** with **Field** set to **bytes**. . In **Layer style**, change **Symbol size**: -** Set the field select to *sum bytes*. +** Set *By value* to *sum bytes*. ** Set the min size to 7 and the max size to 25 px. . Click **Save & close** button. + Your map will look like this between zoom levels 0 and 9: + [role="screenshot"] -image::maps/images/sample_data_web_logs.png[] +image::maps/images/sample_data_web_logs.png[Map showing what zoom level 3 looks like] [float] [[maps-save]] @@ -164,10 +164,10 @@ View your geospatial data alongside a heat map and pie chart, and then filter th When you apply a filter in one panel, it is applied to all panels on the dashboard. . Click **Add from library** to open a list of panels that you can add to the dashboard. -. Add **[Logs] Unique Visitor Heatmap** and **[Logs] Bytes distribution** to the dashboard. +. Add **[Logs] Unique Destination Heatmap** and **[Logs] Bytes distribution** to the dashboard. + [role="screenshot"] -image::maps/images/gs_dashboard_with_map.png[] +image::maps/images/gs_dashboard_with_map.png[Map in a dashboard with 2 other panels] . To filter for documents with unusually high byte values, click and drag in the *Bytes distribution* chart. @@ -177,10 +177,15 @@ image::maps/images/gs_dashboard_with_map.png[] .. Open a tooltip by clicking anywhere in the United States vector. -.. To show only documents where **geo.src** is **US**, click the filter icon in the row for **ISO 3066-1 alpha-2**. +.. To show only documents where **geo.src** is **US**, click the filter icon image:maps/images/gs-filter-icon.png[filter icon, width=24px]in the row for **ISO 3066-1 alpha-2**. ++ +[role="screenshot"] +image::maps/images/gs_tooltip_filter.png[Tooltip on map, width=75%] ++ +Your filtered map should look similar to this: + [role="screenshot"] -image::maps/images/gs_dashboard_with_terms_filter.png[] +image::maps/images/gs_map_filtered.png[Map showing filtered data] [float] === What's next? diff --git a/docs/user/dashboard/aggregation-based.asciidoc b/docs/user/dashboard/aggregation-based.asciidoc index 842f2e93bc58e..4ca251b3a1936 100644 --- a/docs/user/dashboard/aggregation-based.asciidoc +++ b/docs/user/dashboard/aggregation-based.asciidoc @@ -140,9 +140,11 @@ a bar chart that displays the top five log traffic sources for every three hours Add the sample web logs data that you'll use to create the bar chart, then create the dashboard. -. From the *Home* page, click *Try our sample data*. +. On the home page, click *Try sample data*. -. From *Sample web logs*, click *Add data*. +. Click *Other sample data sets*. + +. On the *Sample web logs* card, click *Add data*. . Open the main menu, then click *Dashboard*. @@ -153,9 +155,9 @@ Add the sample web logs data that you'll use to create the bar chart, then creat Open the *Aggregation based* editor and change the time range. -. On the dashboard, click *All types > Aggregation based*, select *Vertical bar*, then select *kibana_sample_data_logs*. +. On the dashboard, click *All types > Aggregation based*, select *Vertical bar*, then select *Kibana Sample Data Logs*. -. Make sure the <>> is *Last 7 days*. +. Make sure the <> is *Last 7 days*. [float] [[tutorial-configure-the-bar-chart]] @@ -172,7 +174,7 @@ To create the bar chart, add a <>, then .. Click *Update*. + [role="screenshot"] -image:images/aggBased_barChartTutorial1_8.3.png[Bar chart with sample logs data] +image:images/aggBased_barChartTutorial1_8.4.png[Bar chart with sample logs data] . To show the top five log traffic sources, add a sub-bucket aggregation. @@ -187,7 +189,7 @@ TIP: Aggregation-based panels support a maximum of three *Split series*. .. Click *Update*. + [role="screenshot"] -image:images/aggBased_barChartTutorial2_8.3.png[Bar chart with sample logs data] +image:images/aggBased_barChartTutorial2_8.4.png[Bar chart with sample logs data] [float] [[save-the-aggregation-based-panel]] diff --git a/docs/user/dashboard/images/aggBased_barChartTutorial1_8.3.png b/docs/user/dashboard/images/aggBased_barChartTutorial1_8.3.png deleted file mode 100644 index a30fe3fbd1b78..0000000000000 Binary files a/docs/user/dashboard/images/aggBased_barChartTutorial1_8.3.png and /dev/null differ diff --git a/docs/user/dashboard/images/aggBased_barChartTutorial1_8.4.png b/docs/user/dashboard/images/aggBased_barChartTutorial1_8.4.png new file mode 100644 index 0000000000000..9e43d6e61a656 Binary files /dev/null and b/docs/user/dashboard/images/aggBased_barChartTutorial1_8.4.png differ diff --git a/docs/user/dashboard/images/aggBased_barChartTutorial2_8.3.png b/docs/user/dashboard/images/aggBased_barChartTutorial2_8.3.png deleted file mode 100644 index d1d7f0644db31..0000000000000 Binary files a/docs/user/dashboard/images/aggBased_barChartTutorial2_8.3.png and /dev/null differ diff --git a/docs/user/dashboard/images/aggBased_barChartTutorial2_8.4.png b/docs/user/dashboard/images/aggBased_barChartTutorial2_8.4.png new file mode 100644 index 0000000000000..ea6727c0ca47d Binary files /dev/null and b/docs/user/dashboard/images/aggBased_barChartTutorial2_8.4.png differ diff --git a/docs/user/dashboard/images/lens_dataViewDropDown_8.0.png b/docs/user/dashboard/images/lens_dataViewDropDown_8.0.png deleted file mode 100644 index 309e1be49b9db..0000000000000 Binary files a/docs/user/dashboard/images/lens_dataViewDropDown_8.0.png and /dev/null differ diff --git a/docs/user/dashboard/images/lens_dataViewDropDown_8.3.png b/docs/user/dashboard/images/lens_dataViewDropDown_8.3.png deleted file mode 100644 index 857f28303b8cb..0000000000000 Binary files a/docs/user/dashboard/images/lens_dataViewDropDown_8.3.png and /dev/null differ diff --git a/docs/user/dashboard/images/lens_dataViewDropDown_8.4.0.png b/docs/user/dashboard/images/lens_dataViewDropDown_8.4.0.png new file mode 100644 index 0000000000000..990cebfc51f6f Binary files /dev/null and b/docs/user/dashboard/images/lens_dataViewDropDown_8.4.0.png differ diff --git a/docs/user/dashboard/images/lens_lineChartMetricOverTime_8.4.0.png b/docs/user/dashboard/images/lens_lineChartMetricOverTime_8.4.0.png new file mode 100644 index 0000000000000..9ed9b4730fae4 Binary files /dev/null and b/docs/user/dashboard/images/lens_lineChartMetricOverTime_8.4.0.png differ diff --git a/docs/user/dashboard/images/lens_logsDashboard_7.16.png b/docs/user/dashboard/images/lens_logsDashboard_7.16.png deleted file mode 100644 index cdfe0accdbbb5..0000000000000 Binary files a/docs/user/dashboard/images/lens_logsDashboard_7.16.png and /dev/null differ diff --git a/docs/user/dashboard/images/lens_logsDashboard_8.3.png b/docs/user/dashboard/images/lens_logsDashboard_8.3.png deleted file mode 100644 index 089fd5dcadb0c..0000000000000 Binary files a/docs/user/dashboard/images/lens_logsDashboard_8.3.png and /dev/null differ diff --git a/docs/user/dashboard/images/lens_logsDashboard_8.4.0.png b/docs/user/dashboard/images/lens_logsDashboard_8.4.0.png new file mode 100644 index 0000000000000..1801fea4e0620 Binary files /dev/null and b/docs/user/dashboard/images/lens_logsDashboard_8.4.0.png differ diff --git a/docs/user/dashboard/images/lens_metricUniqueCountOfClientip_7.16.png b/docs/user/dashboard/images/lens_metricUniqueCountOfClientip_7.16.png deleted file mode 100644 index bed6acf501a3a..0000000000000 Binary files a/docs/user/dashboard/images/lens_metricUniqueCountOfClientip_7.16.png and /dev/null differ diff --git a/docs/user/dashboard/images/lens_metricUniqueCountOfClientip_8.4.0.png b/docs/user/dashboard/images/lens_metricUniqueCountOfClientip_8.4.0.png new file mode 100644 index 0000000000000..f3b1603b50bef Binary files /dev/null and b/docs/user/dashboard/images/lens_metricUniqueCountOfClientip_8.4.0.png differ diff --git a/docs/user/dashboard/images/lens_pieChartCompareSubsetOfDocs_7.16.png b/docs/user/dashboard/images/lens_pieChartCompareSubsetOfDocs_7.16.png index f8e8ba98f691e..fdeca77da25fb 100644 Binary files a/docs/user/dashboard/images/lens_pieChartCompareSubsetOfDocs_7.16.png and b/docs/user/dashboard/images/lens_pieChartCompareSubsetOfDocs_7.16.png differ diff --git a/docs/user/dashboard/images/lens_visualizationTypeDropdown_8.0.png b/docs/user/dashboard/images/lens_visualizationTypeDropdown_8.0.png deleted file mode 100644 index 3a7cc44b820ee..0000000000000 Binary files a/docs/user/dashboard/images/lens_visualizationTypeDropdown_8.0.png and /dev/null differ diff --git a/docs/user/dashboard/images/lens_visualizationTypeDropdown_8.4.0.png b/docs/user/dashboard/images/lens_visualizationTypeDropdown_8.4.0.png new file mode 100644 index 0000000000000..a86dbed105eff Binary files /dev/null and b/docs/user/dashboard/images/lens_visualizationTypeDropdown_8.4.0.png differ diff --git a/docs/user/dashboard/lens-advanced.asciidoc b/docs/user/dashboard/lens-advanced.asciidoc index 68516b49d2158..04822444c530e 100644 --- a/docs/user/dashboard/lens-advanced.asciidoc +++ b/docs/user/dashboard/lens-advanced.asciidoc @@ -16,7 +16,9 @@ Before you begin, you should be familiar with the <>. Add the sample ecommerce data, and create and set up the dashboard. -. Go to the *Home* page, then click *Try sample data*. +. On the home page, click *Try sample data*. + +. Click *Other sample data sets*. . On the *Sample eCommerce orders* card, click *Add data*. diff --git a/docs/user/dashboard/lens.asciidoc b/docs/user/dashboard/lens.asciidoc index 8e8ffe902a565..80e1665753c15 100644 --- a/docs/user/dashboard/lens.asciidoc +++ b/docs/user/dashboard/lens.asciidoc @@ -73,7 +73,7 @@ Change the fields list to display a different {data-source}, different time rang * To add fields, open the {data-source} dropdown, then select *Add a field to this {data-source}*. + [role="screenshot"] -image:images/lens_dataViewDropDown_8.3.png[Dropdown menu located next to {data-source} field with items for adding and managing fields] +image:images/lens_dataViewDropDown_8.4.0.png[Dropdown menu located next to {data-source} field with items for adding and managing fields] + For more information about adding fields to {data-sources} and examples, refer to <>. diff --git a/docs/user/dashboard/tutorial-create-a-dashboard-of-lens-panels.asciidoc b/docs/user/dashboard/tutorial-create-a-dashboard-of-lens-panels.asciidoc index 1d4d5d70e879e..95f937bb65443 100644 --- a/docs/user/dashboard/tutorial-create-a-dashboard-of-lens-panels.asciidoc +++ b/docs/user/dashboard/tutorial-create-a-dashboard-of-lens-panels.asciidoc @@ -8,7 +8,7 @@ at website logs, but this type of dashboard works on any type of data. When you're done, you'll have a complete overview of the sample web logs data. [role="screenshot"] -image::images/lens_logsDashboard_8.3.png[Logs dashboard] +image::images/lens_logsDashboard_8.4.0.png[Logs dashboard] Before you begin, you should be familiar with the <>. @@ -18,7 +18,9 @@ Before you begin, you should be familiar with the <>. Add the sample web logs data, and create and set up the dashboard. -. Go to the *Home* page, then click *Try sample data*. +. On the home page, click *Try sample data*. + +. Click *Other sample data sets*. . On the *Sample web logs* card, click *Add data*. @@ -38,10 +40,10 @@ Open the visualization editor, then make sure the correct fields appear. . On the dashboard, click *Create visualization*. -. Make sure the *kibana_sample_data_logs* data view appears. +. Make sure the *{kib} Sample Data Logs* {data-source} appears. + [role="screenshot"] -image::images/lens_dataViewDropDown_8.3.png[Data view dropdown] +image::images/lens_dataViewDropDown_8.4.0.png[Data view dropdown] To create the visualizations in this tutorial, you'll use the following fields: @@ -68,12 +70,12 @@ The only number function that you can use with *clientip* is *Unique count*, als . Open the *Visualization type* dropdown, then select *Metric*. + [role="screenshot"] -image::images/lens_visualizationTypeDropdown_8.0.png[Visualization type dropdown] +image::images/lens_visualizationTypeDropdown_8.4.0.png[Visualization type dropdown] . From the *Available fields* list, drag *clientip* to the workspace or layer pane. + [role="screenshot"] -image::images/lens_metricUniqueCountOfClientip_7.16.png[Metric visualization of the clientip field] +image::images/lens_metricUniqueCountOfClientip_8.4.0.png[Metric visualization of the clientip field] + In the layer pane, *Unique count of clientip* appears because the editor automatically applies the *Unique count* function to the *clientip* field. *Unique count* is the only numeric function that works with IP addresses. @@ -133,7 +135,7 @@ image::images/lens_lineChartMetricOverTimeLeftAxis_8.3.png[Left axis menu] . Open the *Bottom axis* menu, then select *None* from the *Axis title* dropdown. + [role="screenshot"] -image::images/lens_lineChartMetricOverTimeBottomAxis_8.3.png[Line chart that displays metric data over time] +image::images/lens_lineChartMetricOverTimeBottomAxis_8.3.png[Bottom axis menu] . Click *Save and return* @@ -142,6 +144,9 @@ Since you removed the axis labels, add a panel title: . Open the panel menu, then select *Edit panel title*. . In the *Panel title* field, enter `Median of bytes`, then click *Save*. ++ +[role="screenshot"] +image::images/lens_lineChartMetricOverTime_8.4.0.png[Line chart that displays metric data over time] [discrete] [[view-the-distribution-of-visitors-by-operating-system]] @@ -174,7 +179,7 @@ The chart labels are unable to display because the *request.keyword* field conta [role="screenshot"] image::images/lens_end_to_end_2_1_2.png[Table with top values of request.keyword by most unique visitors] -. In the layer pane, click *Top values of request.keyword*. +. In the layer pane, click *Top 5 values of request.keyword*. .. In the *Number of values* field, enter `10`. @@ -201,7 +206,7 @@ Create a proportional visualization that helps you determine if your users trans . In the layer pane, click *Median of bytes*. -. Click the *Sum* function, then click *Close*. +. Click the *Sum* quick function, then click *Close*. . From the *Available fields* list, drag *bytes* to the *Break down by* field in the layer pane. @@ -256,7 +261,7 @@ The distribution of a number can help you find patterns. For example, you can an . In the layer pane, click *Median of bytes*. -.. Click the *Sum* function. +.. Click the *Sum* quick function. .. In the *Name* field, enter `Transferred bytes`. @@ -293,7 +298,7 @@ Add a panel title: Create a filter for each website traffic source: -. Click the *Filters* function. +. Click *Filters*. . Click *All records*, enter the following in the query bar, then press Return: @@ -319,14 +324,14 @@ Add the user geography grouping: . From the *Available fields* list, drag *geo.srcdest* to the workspace. -. To change the *Group by* order, drag *Top values of geo.srcdest* in the layer pane so that appears first. +. To change the *Group by* order, drag *Top 3 values of geo.srcdest* in the layer pane so that appears first. + [role="screenshot"] image::images/lens_end_to_end_7_2.png[Treemap visualization] Remove the documents that do not match the filter criteria: -. In the layer pane, click *Top values of geo.srcdest*. +. In the layer pane, click *Top 3 values of geo.srcdest*. . Click *Advanced*, deselect *Group other values as "Other"*, then click *Close*. + @@ -358,7 +363,7 @@ Decrease the size of the following panels, then move the panels to the first row * *Website traffic* + [role="screenshot"] -image::images/lens_logsDashboard_8.3.png[Logs dashboard] +image::images/lens_logsDashboard_8.4.0.png[Logs dashboard] [discrete] === Save the dashboard diff --git a/docs/user/dashboard/vega.asciidoc b/docs/user/dashboard/vega.asciidoc index 9c58b9d0ecf49..371b8b949c72a 100644 --- a/docs/user/dashboard/vega.asciidoc +++ b/docs/user/dashboard/vega.asciidoc @@ -40,9 +40,11 @@ As you edit the specs, work in small steps, and frequently save your work. Small Before starting, add the eCommerce sample data that you'll use in your spec, then create the dashboard. -. From the {kib} *Home* page, click *Try our sample data*. +. On the home page, click *Try sample data*. -. From *eCommerce sample data*, click *Add data*. +. Click *Other sample data sets*. + +. On the *Sample eCommerce orders* card, click *Add data*. . Open the main menu, then click *Dashboard*. diff --git a/legacy_rfcs/text/0015_bazel.md b/legacy_rfcs/text/0015_bazel.md index 82c93c3c7e9c1..390a2d68eb7ab 100644 --- a/legacy_rfcs/text/0015_bazel.md +++ b/legacy_rfcs/text/0015_bazel.md @@ -191,9 +191,9 @@ A `BUILD.bazel` file will be added to the root of each package defining a `build The `@kbn/pm` package was updated in https://github.com/elastic/kibana/pull/89961 to run the new packages build target, invoked by calling `bazel build //packages:build`, before executing the existing legacy package builds. -The build targets will no longer reside within the package themselves and instead will be within the `bazel/bin` directory. To account for this, any defined dependency will need to be updated to reference the new directory (example: `link:bazel/bin/packages/elastic-datemath`). While also in this transition period, the build will need to copy over the packages from `bazel/bin` into the `node_modules` of the build target. +The build targets will no longer reside within the package themselves and instead will be within the `bazel/bin` directory. To account for this, any defined dependency will need to be updated to reference the new directory (example: `link:bazel/bin/packages/kbn-datemath`). While also in this transition period, the build will need to copy over the packages from `bazel/bin` into the `node_modules` of the build target. -Example package BUILD.bazel for `packages/elastic-datemath`: +Example package BUILD.bazel for `packages/kbn-datemath`: ```python load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm") diff --git a/nav-kibana-dev.docnav.json b/nav-kibana-dev.docnav.json index 75d0acdc8a9da..c1ea6f702483c 100644 --- a/nav-kibana-dev.docnav.json +++ b/nav-kibana-dev.docnav.json @@ -94,6 +94,9 @@ }, { "id": "kibDevKeyConceptsNavigation" + }, + { + "id": "kibDevDocsEmbeddables" } ] }, diff --git a/package.json b/package.json index 141cabdde9106..6390e367c9187 100644 --- a/package.json +++ b/package.json @@ -91,6 +91,9 @@ "**/refractor/prismjs": "~1.27.0", "**/trim": "1.0.1", "**/typescript": "4.6.3", + "**/use-composed-ref": "^1.3.0", + "**/use-latest": "^1.2.1", + "@tanstack/query-core": "^4.2.1", "globby/fast-glob": "3.2.7", "puppeteer/node-fetch": "^2.6.7" }, @@ -102,8 +105,7 @@ "@dnd-kit/utilities": "^2.0.0", "@elastic/apm-rum": "^5.12.0", "@elastic/apm-rum-react": "^1.4.2", - "@elastic/apm-synthtrace": "link:bazel-bin/packages/elastic-apm-synthtrace", - "@elastic/charts": "47.1.1", + "@elastic/charts": "47.2.0", "@elastic/datemath": "5.0.3", "@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@8.3.0-canary.1", "@elastic/ems-client": "8.3.3", @@ -113,7 +115,6 @@ "@elastic/numeral": "^2.5.1", "@elastic/react-search-ui": "^1.14.0", "@elastic/request-crypto": "2.0.1", - "@elastic/safer-lodash-set": "link:bazel-bin/packages/elastic-safer-lodash-set", "@elastic/search-ui-app-search-connector": "^1.14.0", "@emotion/cache": "^11.9.3", "@emotion/css": "^11.9.0", @@ -139,6 +140,7 @@ "@kbn/analytics-shippers-elastic-v3-server": "link:bazel-bin/packages/analytics/shippers/elastic_v3/server", "@kbn/analytics-shippers-fullstory": "link:bazel-bin/packages/analytics/shippers/fullstory", "@kbn/apm-config-loader": "link:bazel-bin/packages/kbn-apm-config-loader", + "@kbn/apm-synthtrace": "link:bazel-bin/packages/kbn-apm-synthtrace", "@kbn/apm-utils": "link:bazel-bin/packages/kbn-apm-utils", "@kbn/chart-icons": "link:bazel-bin/packages/kbn-chart-icons", "@kbn/coloring": "link:bazel-bin/packages/kbn-coloring", @@ -235,11 +237,14 @@ "@kbn/core-preboot-server-mocks": "link:bazel-bin/packages/core/preboot/core-preboot-server-mocks", "@kbn/core-saved-objects-api-browser": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-api-browser", "@kbn/core-saved-objects-api-server": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-api-server", + "@kbn/core-saved-objects-base-server-internal": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-base-server-internal", + "@kbn/core-saved-objects-base-server-mocks": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-base-server-mocks", "@kbn/core-saved-objects-browser": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-browser", "@kbn/core-saved-objects-browser-internal": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-browser-internal", "@kbn/core-saved-objects-browser-mocks": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-browser-mocks", "@kbn/core-saved-objects-common": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-common", "@kbn/core-saved-objects-server": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-server", + "@kbn/core-saved-objects-utils-server": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-utils-server", "@kbn/core-test-helpers-deprecations-getters": "link:bazel-bin/packages/core/test-helpers/core-test-helpers-deprecations-getters", "@kbn/core-test-helpers-http-setup-browser": "link:bazel-bin/packages/core/test-helpers/core-test-helpers-http-setup-browser", "@kbn/core-theme-browser": "link:bazel-bin/packages/core/theme/core-theme-browser", @@ -282,6 +287,7 @@ "@kbn/plugin-discovery": "link:bazel-bin/packages/kbn-plugin-discovery", "@kbn/react-field": "link:bazel-bin/packages/kbn-react-field", "@kbn/rule-data-utils": "link:bazel-bin/packages/kbn-rule-data-utils", + "@kbn/safer-lodash-set": "link:bazel-bin/packages/kbn-safer-lodash-set", "@kbn/securitysolution-autocomplete": "link:bazel-bin/packages/kbn-securitysolution-autocomplete", "@kbn/securitysolution-es-utils": "link:bazel-bin/packages/kbn-securitysolution-es-utils", "@kbn/securitysolution-hook-utils": "link:bazel-bin/packages/kbn-securitysolution-hook-utils", @@ -307,7 +313,6 @@ "@kbn/shared-ux-card-no-data": "link:bazel-bin/packages/shared-ux/card/no_data/impl", "@kbn/shared-ux-card-no-data-mocks": "link:bazel-bin/packages/shared-ux/card/no_data/mocks", "@kbn/shared-ux-card-no-data-types": "link:bazel-bin/packages/shared-ux/card/no_data/types", - "@kbn/shared-ux-components": "link:bazel-bin/packages/kbn-shared-ux-components", "@kbn/shared-ux-link-redirect-app": "link:bazel-bin/packages/shared-ux/link/redirect_app/impl", "@kbn/shared-ux-link-redirect-app-mocks": "link:bazel-bin/packages/shared-ux/link/redirect_app/mocks", "@kbn/shared-ux-link-redirect-app-types": "link:bazel-bin/packages/shared-ux/link/redirect_app/types", @@ -317,12 +322,20 @@ "@kbn/shared-ux-page-kibana-no-data": "link:bazel-bin/packages/shared-ux/page/kibana_no_data/impl", "@kbn/shared-ux-page-kibana-no-data-mocks": "link:bazel-bin/packages/shared-ux/page/kibana_no_data/mocks", "@kbn/shared-ux-page-kibana-no-data-types": "link:bazel-bin/packages/shared-ux/page/kibana_no_data/types", + "@kbn/shared-ux-page-kibana-template": "link:bazel-bin/packages/shared-ux/page/kibana_template/impl", + "@kbn/shared-ux-page-kibana-template-mocks": "link:bazel-bin/packages/shared-ux/page/kibana_template/mocks", + "@kbn/shared-ux-page-kibana-template-types": "link:bazel-bin/packages/shared-ux/page/kibana_template/types", + "@kbn/shared-ux-page-no-data": "link:bazel-bin/packages/shared-ux/page/no_data/impl", + "@kbn/shared-ux-page-no-data-config": "link:bazel-bin/packages/shared-ux/page/no_data_config/impl", + "@kbn/shared-ux-page-no-data-config-mocks": "link:bazel-bin/packages/shared-ux/page/no_data_config/mocks", + "@kbn/shared-ux-page-no-data-config-types": "link:bazel-bin/packages/shared-ux/page/no_data_config/types", + "@kbn/shared-ux-page-no-data-mocks": "link:bazel-bin/packages/shared-ux/page/no_data/mocks", + "@kbn/shared-ux-page-no-data-types": "link:bazel-bin/packages/shared-ux/page/no_data/types", "@kbn/shared-ux-page-solution-nav": "link:bazel-bin/packages/shared-ux/page/solution_nav", "@kbn/shared-ux-prompt-no-data-views": "link:bazel-bin/packages/shared-ux/prompt/no_data_views/impl", "@kbn/shared-ux-prompt-no-data-views-mocks": "link:bazel-bin/packages/shared-ux/prompt/no_data_views/mocks", "@kbn/shared-ux-prompt-no-data-views-types": "link:bazel-bin/packages/shared-ux/prompt/no_data_views/types", - "@kbn/shared-ux-services": "link:bazel-bin/packages/kbn-shared-ux-services", - "@kbn/shared-ux-storybook": "link:bazel-bin/packages/kbn-shared-ux-storybook", + "@kbn/shared-ux-storybook-config": "link:bazel-bin/packages/shared-ux/storybook/config", "@kbn/shared-ux-storybook-mock": "link:bazel-bin/packages/shared-ux/storybook/mock", "@kbn/shared-ux-utility": "link:bazel-bin/packages/kbn-shared-ux-utility", "@kbn/std": "link:bazel-bin/packages/kbn-std", @@ -353,6 +366,8 @@ "@opentelemetry/semantic-conventions": "^1.4.0", "@reduxjs/toolkit": "^1.6.1", "@slack/webhook": "^5.0.4", + "@tanstack/react-query": "^4.2.1", + "@tanstack/react-query-devtools": "^4.2.1", "@turf/along": "6.0.1", "@turf/area": "6.0.1", "@turf/bbox": "6.0.1", @@ -380,7 +395,7 @@ "color": "^4.2.3", "commander": "^4.1.1", "compare-versions": "3.5.1", - "constate": "^1.3.2", + "constate": "^3.3.2", "content-disposition": "^0.5.4", "copy-to-clipboard": "^3.0.8", "core-js": "^3.23.5", @@ -489,7 +504,7 @@ "pluralize": "3.1.0", "polished": "^3.7.2", "pretty-ms": "6.0.0", - "prop-types": "^15.7.2", + "prop-types": "^15.8.1", "proxy-from-env": "1.0.0", "puid": "1.0.7", "puppeteer": "^10.2.0", @@ -497,39 +512,38 @@ "rbush": "^3.0.1", "re-resizable": "^6.1.1", "re2": "1.17.4", - "react": "^16.14.0", + "react": "^17.0.2", "react-ace": "^7.0.5", "react-beautiful-dnd": "^13.1.0", "react-color": "^2.13.8", - "react-dom": "^16.14.0", + "react-dom": "^17.0.2", "react-dropzone": "^4.2.9", "react-fast-compare": "^2.0.4", - "react-grid-layout": "^0.16.2", + "react-focus-on": "^3.6.0", + "react-grid-layout": "^1.3.4", "react-hook-form": "^7.30.0", "react-intl": "^2.8.0", - "react-is": "^16.13.1", - "react-markdown": "^4.3.1", + "react-is": "^17.0.2", + "react-markdown": "^6.0.3", "react-moment-proptypes": "^1.7.0", "react-monaco-editor": "^0.41.2", - "react-popper-tooltip": "^2.10.1", - "react-query": "^3.39.1", - "react-redux": "^7.2.0", - "react-resizable": "^1.7.5", - "react-resize-detector": "^4.2.0", - "react-reverse-portal": "^1.0.4", + "react-popper-tooltip": "^3.1.1", + "react-redux": "^7.2.8", + "react-resizable": "^3.0.4", + "react-resize-detector": "^7.1.1", + "react-reverse-portal": "^2.1.0", "react-router": "^5.2.0", "react-router-config": "^5.1.1", "react-router-dom": "^5.2.0", - "react-router-redux": "^4.0.8", - "react-shortcuts": "^2.0.0", - "react-sizeme": "^2.6.6", + "react-shortcuts": "^2.1.0", + "react-sizeme": "^3.0.2", "react-syntax-highlighter": "^15.3.1", "react-tiny-virtual-list": "^2.2.0", "react-use": "^15.3.8", - "react-virtualized": "^9.21.2", + "react-virtualized": "^9.22.3", "react-vis": "^1.8.1", "react-visibility-sensor": "^5.1.1", - "recompose": "^0.26.0", + "recompose": "^0.30.0", "reduce-reducers": "^1.0.4", "redux": "^4.1.0", "redux-actions": "^2.6.5", @@ -685,11 +699,13 @@ "@storybook/addon-storyshots": "^6.4.22", "@storybook/addons": "^6.4.22", "@storybook/api": "^6.4.22", + "@storybook/client-api": "^6.4.22", "@storybook/components": "^6.4.22", "@storybook/core": "^6.4.22", "@storybook/core-common": "^6.4.22", "@storybook/core-events": "^6.4.22", "@storybook/node-logger": "^6.4.22", + "@storybook/preview-web": "^6.4.22", "@storybook/react": "^6.4.22", "@storybook/testing-react": "^1.2.4", "@storybook/theming": "^6.4.22", @@ -725,8 +741,7 @@ "@types/deep-freeze-strict": "^1.1.0", "@types/delete-empty": "^2.0.0", "@types/ejs": "^3.0.6", - "@types/elastic__apm-synthtrace": "link:bazel-bin/packages/elastic-apm-synthtrace/npm_module_types", - "@types/enzyme": "^3.10.8", + "@types/enzyme": "^3.10.12", "@types/eslint": "^7.28.0", "@types/express": "^4.17.13", "@types/extract-zip": "^1.6.2", @@ -753,7 +768,6 @@ "@types/intl-relativeformat": "^2.1.0", "@types/jest": "^26.0.22", "@types/jest-axe": "^3.5.3", - "@types/jest-specific-snapshot": "^0.5.5", "@types/joi": "^17.2.3", "@types/jquery": "^3.3.31", "@types/js-levenshtein": "^1.1.0", @@ -775,6 +789,7 @@ "@types/kbn__analytics-shippers-elastic-v3-server": "link:bazel-bin/packages/analytics/shippers/elastic_v3/server/npm_module_types", "@types/kbn__analytics-shippers-fullstory": "link:bazel-bin/packages/analytics/shippers/fullstory/npm_module_types", "@types/kbn__apm-config-loader": "link:bazel-bin/packages/kbn-apm-config-loader/npm_module_types", + "@types/kbn__apm-synthtrace": "link:bazel-bin/packages/kbn-apm-synthtrace/npm_module_types", "@types/kbn__apm-utils": "link:bazel-bin/packages/kbn-apm-utils/npm_module_types", "@types/kbn__axe-config": "link:bazel-bin/packages/kbn-axe-config/npm_module_types", "@types/kbn__bazel-packages": "link:bazel-bin/packages/kbn-bazel-packages/npm_module_types", @@ -882,11 +897,14 @@ "@types/kbn__core-public-internal-base": "link:bazel-bin/packages/core/public/internal-base/npm_module_types", "@types/kbn__core-saved-objects-api-browser": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-api-browser/npm_module_types", "@types/kbn__core-saved-objects-api-server": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-api-server/npm_module_types", + "@types/kbn__core-saved-objects-base-server-internal": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-base-server-internal/npm_module_types", + "@types/kbn__core-saved-objects-base-server-mocks": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-base-server-mocks/npm_module_types", "@types/kbn__core-saved-objects-browser": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-browser/npm_module_types", "@types/kbn__core-saved-objects-browser-internal": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-browser-internal/npm_module_types", "@types/kbn__core-saved-objects-browser-mocks": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-browser-mocks/npm_module_types", "@types/kbn__core-saved-objects-common": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-common/npm_module_types", "@types/kbn__core-saved-objects-server": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-server/npm_module_types", + "@types/kbn__core-saved-objects-utils-server": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-utils-server/npm_module_types", "@types/kbn__core-server-internal-base": "link:bazel-bin/packages/core/server/internal-base/npm_module_types", "@types/kbn__core-test-helpers-deprecations-getters": "link:bazel-bin/packages/core/test-helpers/core-test-helpers-deprecations-getters/npm_module_types", "@types/kbn__core-test-helpers-http-setup-browser": "link:bazel-bin/packages/core/test-helpers/core-test-helpers-http-setup-browser/npm_module_types", @@ -975,7 +993,6 @@ "@types/kbn__shared-ux-card-no-data": "link:bazel-bin/packages/shared-ux/card/no_data/impl/npm_module_types", "@types/kbn__shared-ux-card-no-data-mocks": "link:bazel-bin/packages/shared-ux/card/no_data/mocks/npm_module_types", "@types/kbn__shared-ux-card-no-data-types": "link:bazel-bin/packages/shared-ux/card/no_data/types/npm_module_types", - "@types/kbn__shared-ux-components": "link:bazel-bin/packages/kbn-shared-ux-components/npm_module_types", "@types/kbn__shared-ux-link-redirect-app": "link:bazel-bin/packages/shared-ux/link/redirect_app/impl/npm_module_types", "@types/kbn__shared-ux-link-redirect-app-mocks": "link:bazel-bin/packages/shared-ux/link/redirect_app/mocks/npm_module_types", "@types/kbn__shared-ux-link-redirect-app-types": "link:bazel-bin/packages/shared-ux/link/redirect_app/types/npm_module_types", @@ -985,12 +1002,20 @@ "@types/kbn__shared-ux-page-kibana-no-data": "link:bazel-bin/packages/shared-ux/page/kibana_no_data/impl/npm_module_types", "@types/kbn__shared-ux-page-kibana-no-data-mocks": "link:bazel-bin/packages/shared-ux/page/kibana_no_data/mocks/npm_module_types", "@types/kbn__shared-ux-page-kibana-no-data-types": "link:bazel-bin/packages/shared-ux/page/kibana_no_data/types/npm_module_types", + "@types/kbn__shared-ux-page-kibana-template": "link:bazel-bin/packages/shared-ux/page/kibana_template/impl/npm_module_types", + "@types/kbn__shared-ux-page-kibana-template-mocks": "link:bazel-bin/packages/shared-ux/page/kibana_template/mocks/npm_module_types", + "@types/kbn__shared-ux-page-kibana-template-types": "link:bazel-bin/packages/shared-ux/page/kibana_template/types/npm_module_types", + "@types/kbn__shared-ux-page-no-data": "link:bazel-bin/packages/shared-ux/page/no_data/impl/npm_module_types", + "@types/kbn__shared-ux-page-no-data-config": "link:bazel-bin/packages/shared-ux/page/no_data_config/impl/npm_module_types", + "@types/kbn__shared-ux-page-no-data-config-mocks": "link:bazel-bin/packages/shared-ux/page/no_data_config/mocks/npm_module_types", + "@types/kbn__shared-ux-page-no-data-config-types": "link:bazel-bin/packages/shared-ux/page/no_data_config/types/npm_module_types", + "@types/kbn__shared-ux-page-no-data-mocks": "link:bazel-bin/packages/shared-ux/page/no_data/mocks/npm_module_types", + "@types/kbn__shared-ux-page-no-data-types": "link:bazel-bin/packages/shared-ux/page/no_data/types/npm_module_types", "@types/kbn__shared-ux-page-solution-nav": "link:bazel-bin/packages/shared-ux/page/solution_nav/npm_module_types", "@types/kbn__shared-ux-prompt-no-data-views": "link:bazel-bin/packages/shared-ux/prompt/no_data_views/impl/npm_module_types", "@types/kbn__shared-ux-prompt-no-data-views-mocks": "link:bazel-bin/packages/shared-ux/prompt/no_data_views/mocks/npm_module_types", "@types/kbn__shared-ux-prompt-no-data-views-types": "link:bazel-bin/packages/shared-ux/prompt/no_data_views/types/npm_module_types", - "@types/kbn__shared-ux-services": "link:bazel-bin/packages/kbn-shared-ux-services/npm_module_types", - "@types/kbn__shared-ux-storybook": "link:bazel-bin/packages/kbn-shared-ux-storybook/npm_module_types", + "@types/kbn__shared-ux-storybook-config": "link:bazel-bin/packages/shared-ux/storybook/config/npm_module_types", "@types/kbn__shared-ux-storybook-mock": "link:bazel-bin/packages/shared-ux/storybook/mock/npm_module_types", "@types/kbn__shared-ux-utility": "link:bazel-bin/packages/kbn-shared-ux-utility/npm_module_types", "@types/kbn__some-dev-log": "link:bazel-bin/packages/kbn-some-dev-log/npm_module_types", @@ -1049,23 +1074,22 @@ "@types/pngjs": "^3.4.0", "@types/prettier": "^2.3.2", "@types/pretty-ms": "^5.0.0", - "@types/prop-types": "^15.7.3", + "@types/prop-types": "^15.7.5", "@types/rbush": "^3.0.0", - "@types/react": "^16.14.25", + "@types/react": "^17.0.45", "@types/react-beautiful-dnd": "^13.0.0", - "@types/react-dom": "^16.9.15", - "@types/react-grid-layout": "^0.16.7", + "@types/react-dom": "^17.0.17", + "@types/react-grid-layout": "^1.3.2", "@types/react-intl": "^2.3.15", - "@types/react-is": "^16.7.2", - "@types/react-redux": "^7.1.9", - "@types/react-resize-detector": "^4.0.1", + "@types/react-is": "^17.0.3", + "@types/react-resize-detector": "^6.1.0", "@types/react-router": "^5.1.7", "@types/react-router-config": "^5.0.2", "@types/react-router-dom": "^5.1.5", - "@types/react-test-renderer": "^16.9.1", - "@types/react-virtualized": "^9.18.7", + "@types/react-test-renderer": "^17.0.2", + "@types/react-virtualized": "^9.21.21", "@types/react-vis": "^1.11.9", - "@types/recompose": "^0.30.6", + "@types/recompose": "^0.30.10", "@types/reduce-reducers": "^1.0.0", "@types/redux-actions": "^2.6.1", "@types/redux-logger": "^3.0.8", @@ -1105,6 +1129,7 @@ "@typescript-eslint/eslint-plugin": "^5.20.0", "@typescript-eslint/parser": "^5.20.0", "@typescript-eslint/typescript-estree": "^5.20.0", + "@wojtekmaj/enzyme-adapter-react-17": "^0.6.7", "@yarnpkg/lockfile": "^1.1.0", "abab": "^2.0.4", "aggregate-error": "^3.1.0", @@ -1150,8 +1175,6 @@ "dpdm": "3.5.0", "ejs": "^3.1.8", "enzyme": "^3.11.0", - "enzyme-adapter-react-16": "^1.15.6", - "enzyme-adapter-utils": "^1.14.0", "enzyme-to-json": "^3.6.1", "eslint": "^7.32.0", "eslint-config-prettier": "^8.5.0", @@ -1199,15 +1222,15 @@ "jest-config": "^26", "jest-diff": "^26.6.2", "jest-environment-jsdom": "^26.6.2", - "jest-environment-jsdom-thirteen": "^1.0.1", + "jest-mock": "^26.6.2", "jest-raw-loader": "^1.0.1", "jest-runtime": "^26", "jest-silent-reporter": "^0.5.0", "jest-snapshot": "^26.6.2", - "jest-specific-snapshot": "2.0.0", + "jest-specific-snapshot": "^4.0.0", "jest-styled-components": "^7.0.3", "jimp": "^0.14.0", - "jsdom": "13.1.0", + "jsdom": "^16.4.0", "json-schema-typed": "^8.0.1", "json5": "^1.0.1", "jsondiffpatch": "0.4.1", @@ -1247,10 +1270,10 @@ "proxy": "^1.0.2", "q": "^1.5.1", "raw-loader": "^3.1.0", - "react-test-renderer": "^16.14.0", + "react-test-renderer": "^17.0.2", "regenerate": "^1.4.0", "resolve": "^1.22.0", - "rxjs-marbles": "^5.0.6", + "rxjs-marbles": "^7.0.1", "sass-loader": "^10.3.1", "selenium-webdriver": "^4.4.0", "simple-git": "^3.10.0", diff --git a/packages/BUILD.bazel b/packages/BUILD.bazel index 48977f7ef4fc8..b084fa8617929 100644 --- a/packages/BUILD.bazel +++ b/packages/BUILD.bazel @@ -102,11 +102,14 @@ filegroup( "//packages/core/preboot/core-preboot-server:build", "//packages/core/saved-objects/core-saved-objects-api-browser:build", "//packages/core/saved-objects/core-saved-objects-api-server:build", + "//packages/core/saved-objects/core-saved-objects-base-server-internal:build", + "//packages/core/saved-objects/core-saved-objects-base-server-mocks:build", "//packages/core/saved-objects/core-saved-objects-browser-internal:build", "//packages/core/saved-objects/core-saved-objects-browser-mocks:build", "//packages/core/saved-objects/core-saved-objects-browser:build", "//packages/core/saved-objects/core-saved-objects-common:build", "//packages/core/saved-objects/core-saved-objects-server:build", + "//packages/core/saved-objects/core-saved-objects-utils-server:build", "//packages/core/test-helpers/core-test-helpers-deprecations-getters:build", "//packages/core/test-helpers/core-test-helpers-http-setup-browser:build", "//packages/core/theme/core-theme-browser-internal:build", @@ -116,8 +119,6 @@ filegroup( "//packages/core/ui-settings/core-ui-settings-browser-mocks:build", "//packages/core/ui-settings/core-ui-settings-browser:build", "//packages/core/ui-settings/core-ui-settings-common:build", - "//packages/elastic-apm-synthtrace:build", - "//packages/elastic-safer-lodash-set:build", "//packages/home/sample_data_card:build", "//packages/home/sample_data_tab:build", "//packages/home/sample_data_types:build", @@ -127,6 +128,7 @@ filegroup( "//packages/kbn-ambient-ui-types:build", "//packages/kbn-analytics:build", "//packages/kbn-apm-config-loader:build", + "//packages/kbn-apm-synthtrace:build", "//packages/kbn-apm-utils:build", "//packages/kbn-axe-config:build", "//packages/kbn-babel-plugin-synthetic-packages:build", @@ -193,6 +195,7 @@ filegroup( "//packages/kbn-repo-source-classifier-cli:build", "//packages/kbn-repo-source-classifier:build", "//packages/kbn-rule-data-utils:build", + "//packages/kbn-safer-lodash-set:build", "//packages/kbn-securitysolution-autocomplete:build", "//packages/kbn-securitysolution-es-utils:build", "//packages/kbn-securitysolution-hook-utils:build", @@ -210,9 +213,6 @@ filegroup( "//packages/kbn-server-http-tools:build", "//packages/kbn-server-route-repository:build", "//packages/kbn-shared-svg:build", - "//packages/kbn-shared-ux-components:build", - "//packages/kbn-shared-ux-services:build", - "//packages/kbn-shared-ux-storybook:build", "//packages/kbn-shared-ux-utility:build", "//packages/kbn-some-dev-log:build", "//packages/kbn-sort-package-json:build", @@ -258,10 +258,20 @@ filegroup( "//packages/shared-ux/page/kibana_no_data/impl:build", "//packages/shared-ux/page/kibana_no_data/mocks:build", "//packages/shared-ux/page/kibana_no_data/types:build", + "//packages/shared-ux/page/kibana_template/impl:build", + "//packages/shared-ux/page/kibana_template/mocks:build", + "//packages/shared-ux/page/kibana_template/types:build", + "//packages/shared-ux/page/no_data_config/impl:build", + "//packages/shared-ux/page/no_data_config/mocks:build", + "//packages/shared-ux/page/no_data_config/types:build", + "//packages/shared-ux/page/no_data/impl:build", + "//packages/shared-ux/page/no_data/mocks:build", + "//packages/shared-ux/page/no_data/types:build", "//packages/shared-ux/page/solution_nav:build", "//packages/shared-ux/prompt/no_data_views/impl:build", "//packages/shared-ux/prompt/no_data_views/mocks:build", "//packages/shared-ux/prompt/no_data_views/types:build", + "//packages/shared-ux/storybook/config:build", "//packages/shared-ux/storybook/mock:build", "//x-pack/packages/ml/agg_utils:build", "//x-pack/packages/ml/aiops_components:build", @@ -368,11 +378,14 @@ filegroup( "//packages/core/preboot/core-preboot-server:build_types", "//packages/core/saved-objects/core-saved-objects-api-browser:build_types", "//packages/core/saved-objects/core-saved-objects-api-server:build_types", + "//packages/core/saved-objects/core-saved-objects-base-server-internal:build_types", + "//packages/core/saved-objects/core-saved-objects-base-server-mocks:build_types", "//packages/core/saved-objects/core-saved-objects-browser-internal:build_types", "//packages/core/saved-objects/core-saved-objects-browser-mocks:build_types", "//packages/core/saved-objects/core-saved-objects-browser:build_types", "//packages/core/saved-objects/core-saved-objects-common:build_types", "//packages/core/saved-objects/core-saved-objects-server:build_types", + "//packages/core/saved-objects/core-saved-objects-utils-server:build_types", "//packages/core/test-helpers/core-test-helpers-deprecations-getters:build_types", "//packages/core/test-helpers/core-test-helpers-http-setup-browser:build_types", "//packages/core/theme/core-theme-browser-internal:build_types", @@ -382,14 +395,13 @@ filegroup( "//packages/core/ui-settings/core-ui-settings-browser-mocks:build_types", "//packages/core/ui-settings/core-ui-settings-browser:build_types", "//packages/core/ui-settings/core-ui-settings-common:build_types", - "//packages/elastic-apm-synthtrace:build_types", - "//packages/elastic-safer-lodash-set:build_types", "//packages/home/sample_data_card:build_types", "//packages/home/sample_data_tab:build_types", "//packages/kbn-ace:build_types", "//packages/kbn-alerts:build_types", "//packages/kbn-analytics:build_types", "//packages/kbn-apm-config-loader:build_types", + "//packages/kbn-apm-synthtrace:build_types", "//packages/kbn-apm-utils:build_types", "//packages/kbn-axe-config:build_types", "//packages/kbn-bazel-packages:build_types", @@ -449,6 +461,7 @@ filegroup( "//packages/kbn-repo-source-classifier-cli:build_types", "//packages/kbn-repo-source-classifier:build_types", "//packages/kbn-rule-data-utils:build_types", + "//packages/kbn-safer-lodash-set:build_types", "//packages/kbn-securitysolution-autocomplete:build_types", "//packages/kbn-securitysolution-es-utils:build_types", "//packages/kbn-securitysolution-hook-utils:build_types", @@ -466,9 +479,6 @@ filegroup( "//packages/kbn-server-http-tools:build_types", "//packages/kbn-server-route-repository:build_types", "//packages/kbn-shared-svg:build_types", - "//packages/kbn-shared-ux-components:build_types", - "//packages/kbn-shared-ux-services:build_types", - "//packages/kbn-shared-ux-storybook:build_types", "//packages/kbn-shared-ux-utility:build_types", "//packages/kbn-some-dev-log:build_types", "//packages/kbn-sort-package-json:build_types", @@ -503,9 +513,16 @@ filegroup( "//packages/shared-ux/page/analytics_no_data/mocks:build_types", "//packages/shared-ux/page/kibana_no_data/impl:build_types", "//packages/shared-ux/page/kibana_no_data/mocks:build_types", + "//packages/shared-ux/page/kibana_template/impl:build_types", + "//packages/shared-ux/page/kibana_template/mocks:build_types", + "//packages/shared-ux/page/no_data_config/impl:build_types", + "//packages/shared-ux/page/no_data_config/mocks:build_types", + "//packages/shared-ux/page/no_data/impl:build_types", + "//packages/shared-ux/page/no_data/mocks:build_types", "//packages/shared-ux/page/solution_nav:build_types", "//packages/shared-ux/prompt/no_data_views/impl:build_types", "//packages/shared-ux/prompt/no_data_views/mocks:build_types", + "//packages/shared-ux/storybook/config:build_types", "//packages/shared-ux/storybook/mock:build_types", "//x-pack/packages/ml/agg_utils:build_types", "//x-pack/packages/ml/aiops_components:build_types", diff --git a/packages/core/config/core-config-server-internal/BUILD.bazel b/packages/core/config/core-config-server-internal/BUILD.bazel index d2580d6736a76..7bc32e4198ab1 100644 --- a/packages/core/config/core-config-server-internal/BUILD.bazel +++ b/packages/core/config/core-config-server-internal/BUILD.bazel @@ -26,7 +26,7 @@ NPM_MODULE_EXTRA_FILES = [ ] RUNTIME_DEPS = [ - "//packages/elastic-safer-lodash-set", + "//packages/kbn-safer-lodash-set", "//packages/kbn-config", "//packages/core/base/core-base-server-internal", "//packages/kbn-config-mocks", @@ -36,7 +36,7 @@ RUNTIME_DEPS = [ TYPES_DEPS = [ "@npm//@types/node", "@npm//@types/jest", - "//packages/elastic-safer-lodash-set:npm_module_types", + "//packages/kbn-safer-lodash-set:npm_module_types", "//packages/kbn-config:npm_module_types", "//packages/kbn-config-mocks:npm_module_types", "//packages/core/base/core-base-server-internal:npm_module_types", diff --git a/packages/core/logging/core-logging-server-internal/BUILD.bazel b/packages/core/logging/core-logging-server-internal/BUILD.bazel index 199e47161d6a0..abed6f741fc39 100644 --- a/packages/core/logging/core-logging-server-internal/BUILD.bazel +++ b/packages/core/logging/core-logging-server-internal/BUILD.bazel @@ -29,7 +29,7 @@ RUNTIME_DEPS = [ "@npm//lodash", "@npm//moment-timezone", "@npm//elastic-apm-node", - "//packages/elastic-safer-lodash-set", + "//packages/kbn-safer-lodash-set", "//packages/kbn-config-schema", "//packages/kbn-std", ] @@ -41,7 +41,7 @@ TYPES_DEPS = [ "@npm//rxjs", "@npm//@types/moment-timezone", "@npm//elastic-apm-node", - "//packages/elastic-safer-lodash-set:npm_module_types", + "//packages/kbn-safer-lodash-set:npm_module_types", "//packages/kbn-logging:npm_module_types", "//packages/kbn-config-schema:npm_module_types", "//packages/core/base/core-base-server-internal:npm_module_types", diff --git a/packages/core/logging/core-logging-server-internal/src/appenders/rewrite/policies/meta/meta_policy.ts b/packages/core/logging/core-logging-server-internal/src/appenders/rewrite/policies/meta/meta_policy.ts index 2618f0ed50587..45e62713980c0 100644 --- a/packages/core/logging/core-logging-server-internal/src/appenders/rewrite/policies/meta/meta_policy.ts +++ b/packages/core/logging/core-logging-server-internal/src/appenders/rewrite/policies/meta/meta_policy.ts @@ -8,7 +8,7 @@ import { schema } from '@kbn/config-schema'; import { LogRecord } from '@kbn/logging'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { has, unset } from 'lodash'; import { assertNever } from '@kbn/std'; import type { MetaRewritePolicyConfig } from '@kbn/core-logging-server'; diff --git a/packages/core/logging/core-logging-server-internal/src/global_context/merge_global_context.ts b/packages/core/logging/core-logging-server-internal/src/global_context/merge_global_context.ts index 64186392caa56..7e794f0731cf5 100644 --- a/packages/core/logging/core-logging-server-internal/src/global_context/merge_global_context.ts +++ b/packages/core/logging/core-logging-server-internal/src/global_context/merge_global_context.ts @@ -7,7 +7,7 @@ */ import { has } from 'lodash'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { LogMeta } from '@kbn/logging'; import { GlobalContext } from './types'; diff --git a/packages/core/overlays/core-overlays-browser-internal/src/banners/user_banner_service.tsx b/packages/core/overlays/core-overlays-browser-internal/src/banners/user_banner_service.tsx index 81ee879615b76..5fdc4439136f9 100644 --- a/packages/core/overlays/core-overlays-browser-internal/src/banners/user_banner_service.tsx +++ b/packages/core/overlays/core-overlays-browser-internal/src/banners/user_banner_service.tsx @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import React, { Fragment } from 'react'; +import React from 'react'; import ReactDOM from 'react-dom'; import { filter } from 'rxjs/operators'; import { Subscription } from 'rxjs'; @@ -72,7 +72,7 @@ export class UserBannerService { } > - + {content.trim()} banners.remove(id!)}> diff --git a/packages/core/saved-objects/core-saved-objects-base-server-internal/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-base-server-internal/BUILD.bazel new file mode 100644 index 0000000000000..d64f0bb533a0f --- /dev/null +++ b/packages/core/saved-objects/core-saved-objects-base-server-internal/BUILD.bazel @@ -0,0 +1,111 @@ +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_DIRNAME = "core-saved-objects-base-server-internal" +PKG_REQUIRE_NAME = "@kbn/core-saved-objects-base-server-internal" + +SOURCE_FILES = glob( + [ + "src/**/*.ts", + ], + exclude = [ + "**/*.test.*", + "**/*.stories.*", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +RUNTIME_DEPS = [ + "@npm//lodash", + "@npm//semver", + "//packages/kbn-config-schema", + ### test dependencies + "//packages/kbn-logging-mocks", + "@npm//@hapi/boom", +] + +TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "@npm//@types/lodash", + "@npm//@types/semver", + "//packages/kbn-logging:npm_module_types", + "//packages/kbn-config-schema:npm_module_types", + "//packages/core/base/core-base-server-internal:npm_module_types", + "//packages/core/saved-objects/core-saved-objects-server:npm_module_types", + "//packages/core/saved-objects/core-saved-objects-utils-server:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", +) + +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", + root_dir = "src", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/core/saved-objects/core-saved-objects-base-server-internal/README.md b/packages/core/saved-objects/core-saved-objects-base-server-internal/README.md new file mode 100644 index 0000000000000..0315d68aca7b0 --- /dev/null +++ b/packages/core/saved-objects/core-saved-objects-base-server-internal/README.md @@ -0,0 +1,4 @@ +# @kbn/core-saved-objects-base-server-internal + +This package contains the base parts of the server-side savedObjects internal implementation, +used by all the other internal server-side savedObjects packages. \ No newline at end of file diff --git a/packages/shared-ux/page/analytics_no_data/mocks/jest.config.js b/packages/core/saved-objects/core-saved-objects-base-server-internal/jest.config.js similarity index 77% rename from packages/shared-ux/page/analytics_no_data/mocks/jest.config.js rename to packages/core/saved-objects/core-saved-objects-base-server-internal/jest.config.js index ba5df95ec80fb..384625b895fcd 100644 --- a/packages/shared-ux/page/analytics_no_data/mocks/jest.config.js +++ b/packages/core/saved-objects/core-saved-objects-base-server-internal/jest.config.js @@ -8,6 +8,6 @@ module.exports = { preset: '@kbn/test/jest_node', - rootDir: '../../../../..', - roots: ['/packages/shared-ux/page/analytics_no_data/mocks'], + rootDir: '../../../..', + roots: ['/packages/core/saved-objects/core-saved-objects-base-server-internal'], }; diff --git a/packages/core/saved-objects/core-saved-objects-base-server-internal/package.json b/packages/core/saved-objects/core-saved-objects-base-server-internal/package.json new file mode 100644 index 0000000000000..ff4b901f49056 --- /dev/null +++ b/packages/core/saved-objects/core-saved-objects-base-server-internal/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/core-saved-objects-base-server-internal", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/packages/core/saved-objects/core-saved-objects-base-server-internal/src/index.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/index.ts new file mode 100644 index 0000000000000..5b504f43244d6 --- /dev/null +++ b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/index.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. + */ + +export { LEGACY_URL_ALIAS_TYPE, type LegacyUrlAlias } from './legacy_alias'; +export { + getProperty, + getRootProperties, + getRootPropertiesObjects, + getTypes, + type IndexMapping, + type IndexMappingMeta, + type SavedObjectsTypeMappingDefinitions, +} from './mappings'; +export { SavedObjectsSerializer } from './serialization'; +export { SavedObjectsTypeValidator } from './validation'; +export { decodeRequestVersion, decodeVersion, encodeVersion, encodeHitVersion } from './version'; +export { + savedObjectsConfig, + savedObjectsMigrationConfig, + SavedObjectConfig, + type SavedObjectsConfigType, + type SavedObjectsMigrationConfigType, +} from './saved_objects_config'; +export { SavedObjectTypeRegistry } from './saved_objects_type_registry'; diff --git a/src/core/server/saved_objects/object_types/constants.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/legacy_alias/constants.ts similarity index 100% rename from src/core/server/saved_objects/object_types/constants.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/legacy_alias/constants.ts diff --git a/packages/kbn-shared-ux-services/src/services/http.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/legacy_alias/index.ts similarity index 78% rename from packages/kbn-shared-ux-services/src/services/http.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/legacy_alias/index.ts index 024222092b7b1..f782267bd2096 100644 --- a/packages/kbn-shared-ux-services/src/services/http.ts +++ b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/legacy_alias/index.ts @@ -6,6 +6,5 @@ * Side Public License, v 1. */ -export interface SharedUxHttpService { - addBasePath: (url: string) => string; -} +export type { LegacyUrlAlias } from './types'; +export { LEGACY_URL_ALIAS_TYPE } from './constants'; diff --git a/src/core/server/saved_objects/object_types/types.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/legacy_alias/types.ts similarity index 100% rename from src/core/server/saved_objects/object_types/types.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/legacy_alias/types.ts diff --git a/src/core/server/saved_objects/mappings/index.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/mappings/index.ts similarity index 100% rename from src/core/server/saved_objects/mappings/index.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/mappings/index.ts diff --git a/src/core/server/saved_objects/mappings/lib/get_property.test.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/mappings/lib/get_property.test.ts similarity index 100% rename from src/core/server/saved_objects/mappings/lib/get_property.test.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/mappings/lib/get_property.test.ts diff --git a/src/core/server/saved_objects/mappings/lib/get_property.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/mappings/lib/get_property.ts similarity index 100% rename from src/core/server/saved_objects/mappings/lib/get_property.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/mappings/lib/get_property.ts diff --git a/src/core/server/saved_objects/mappings/lib/get_root_properties.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/mappings/lib/get_root_properties.ts similarity index 100% rename from src/core/server/saved_objects/mappings/lib/get_root_properties.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/mappings/lib/get_root_properties.ts diff --git a/src/core/server/saved_objects/mappings/lib/get_root_properties_objects.test.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/mappings/lib/get_root_properties_objects.test.ts similarity index 100% rename from src/core/server/saved_objects/mappings/lib/get_root_properties_objects.test.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/mappings/lib/get_root_properties_objects.test.ts diff --git a/src/core/server/saved_objects/mappings/lib/get_root_properties_objects.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/mappings/lib/get_root_properties_objects.ts similarity index 100% rename from src/core/server/saved_objects/mappings/lib/get_root_properties_objects.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/mappings/lib/get_root_properties_objects.ts diff --git a/src/core/server/saved_objects/mappings/lib/get_types.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/mappings/lib/get_types.ts similarity index 100% rename from src/core/server/saved_objects/mappings/lib/get_types.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/mappings/lib/get_types.ts diff --git a/src/core/server/saved_objects/mappings/lib/index.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/mappings/lib/index.ts similarity index 100% rename from src/core/server/saved_objects/mappings/lib/index.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/mappings/lib/index.ts diff --git a/src/core/server/saved_objects/mappings/types.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/mappings/types.ts similarity index 100% rename from src/core/server/saved_objects/mappings/types.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/mappings/types.ts diff --git a/src/core/server/saved_objects/saved_objects_config.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/saved_objects_config.ts similarity index 100% rename from src/core/server/saved_objects/saved_objects_config.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/saved_objects_config.ts diff --git a/src/core/server/saved_objects/saved_objects_type_registry.test.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/saved_objects_type_registry.test.ts similarity index 100% rename from src/core/server/saved_objects/saved_objects_type_registry.test.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/saved_objects_type_registry.test.ts diff --git a/src/core/server/saved_objects/saved_objects_type_registry.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/saved_objects_type_registry.ts similarity index 100% rename from src/core/server/saved_objects/saved_objects_type_registry.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/saved_objects_type_registry.ts diff --git a/src/core/server/saved_objects/serialization/index.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/serialization/index.ts similarity index 100% rename from src/core/server/saved_objects/serialization/index.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/serialization/index.ts diff --git a/src/core/server/saved_objects/serialization/serializer.test.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/serialization/serializer.test.ts similarity index 96% rename from src/core/server/saved_objects/serialization/serializer.test.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/serialization/serializer.test.ts index e0ef357c0d9be..230993bd06d29 100644 --- a/src/core/server/saved_objects/serialization/serializer.test.ts +++ b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/serialization/serializer.test.ts @@ -7,28 +7,47 @@ */ import _ from 'lodash'; -import type { SavedObjectsRawDoc } from '@kbn/core-saved-objects-server'; +import type { SavedObjectsRawDoc, ISavedObjectTypeRegistry } from '@kbn/core-saved-objects-server'; import { SavedObjectsSerializer } from './serializer'; -import { typeRegistryMock } from '../saved_objects_type_registry.mock'; import { encodeVersion } from '../version'; -import { LEGACY_URL_ALIAS_TYPE } from '../object_types'; +import { LEGACY_URL_ALIAS_TYPE } from '../legacy_alias'; + +const createMockedTypeRegistry = ({ + isNamespaceAgnostic, + isSingleNamespace, + isMultiNamespace, +}: { + isNamespaceAgnostic: boolean; + isSingleNamespace: boolean; + isMultiNamespace: boolean; +}): ISavedObjectTypeRegistry => { + const typeRegistry: Partial = { + isNamespaceAgnostic: jest.fn().mockReturnValue(isNamespaceAgnostic), + isSingleNamespace: jest.fn().mockReturnValue(isSingleNamespace), + isMultiNamespace: jest.fn().mockReturnValue(isMultiNamespace), + }; + return typeRegistry as ISavedObjectTypeRegistry; +}; -let typeRegistry = typeRegistryMock.create(); -typeRegistry.isNamespaceAgnostic.mockReturnValue(true); -typeRegistry.isSingleNamespace.mockReturnValue(false); -typeRegistry.isMultiNamespace.mockReturnValue(false); +let typeRegistry = createMockedTypeRegistry({ + isNamespaceAgnostic: true, + isSingleNamespace: false, + isMultiNamespace: false, +}); const namespaceAgnosticSerializer = new SavedObjectsSerializer(typeRegistry); -typeRegistry = typeRegistryMock.create(); -typeRegistry.isNamespaceAgnostic.mockReturnValue(false); -typeRegistry.isSingleNamespace.mockReturnValue(true); -typeRegistry.isMultiNamespace.mockReturnValue(false); +typeRegistry = typeRegistry = createMockedTypeRegistry({ + isNamespaceAgnostic: false, + isSingleNamespace: true, + isMultiNamespace: false, +}); const singleNamespaceSerializer = new SavedObjectsSerializer(typeRegistry); -typeRegistry = typeRegistryMock.create(); -typeRegistry.isNamespaceAgnostic.mockReturnValue(false); -typeRegistry.isSingleNamespace.mockReturnValue(false); -typeRegistry.isMultiNamespace.mockReturnValue(true); +typeRegistry = typeRegistry = createMockedTypeRegistry({ + isNamespaceAgnostic: false, + isSingleNamespace: false, + isMultiNamespace: true, +}); const multiNamespaceSerializer = new SavedObjectsSerializer(typeRegistry); const sampleTemplate = { diff --git a/src/core/server/saved_objects/serialization/serializer.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/serialization/serializer.ts similarity index 98% rename from src/core/server/saved_objects/serialization/serializer.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/serialization/serializer.ts index 2e13708ee2f9d..340926abd0bce 100644 --- a/src/core/server/saved_objects/serialization/serializer.ts +++ b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/serialization/serializer.ts @@ -14,9 +14,9 @@ import type { SavedObjectSanitizedDoc, SavedObjectsRawDocParseOptions, } from '@kbn/core-saved-objects-server'; -import { LEGACY_URL_ALIAS_TYPE } from '../object_types'; +import { SavedObjectsUtils } from '@kbn/core-saved-objects-utils-server'; +import { LEGACY_URL_ALIAS_TYPE } from '../legacy_alias'; import { decodeVersion, encodeVersion } from '../version'; -import { SavedObjectsUtils } from '../service'; /** * Core internal implementation of {@link ISavedObjectsSerializer} diff --git a/src/core/server/saved_objects/validation/index.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/validation/index.ts similarity index 100% rename from src/core/server/saved_objects/validation/index.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/validation/index.ts diff --git a/src/core/server/saved_objects/validation/schema.test.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/validation/schema.test.ts similarity index 100% rename from src/core/server/saved_objects/validation/schema.test.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/validation/schema.test.ts diff --git a/src/core/server/saved_objects/validation/schema.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/validation/schema.ts similarity index 97% rename from src/core/server/saved_objects/validation/schema.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/validation/schema.ts index 8e90c4aef9c70..221f21b5aa992 100644 --- a/src/core/server/saved_objects/validation/schema.ts +++ b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/validation/schema.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { schema, Type } from '@kbn/config-schema'; +import { schema, type Type } from '@kbn/config-schema'; import type { SavedObjectsValidationSpec, SavedObjectSanitizedDoc, diff --git a/src/core/server/saved_objects/validation/validator.test.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/validation/validator.test.ts similarity index 95% rename from src/core/server/saved_objects/validation/validator.test.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/validation/validator.test.ts index b059070fdf75f..96bc93be54c1a 100644 --- a/src/core/server/saved_objects/validation/validator.test.ts +++ b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/validation/validator.test.ts @@ -7,12 +7,12 @@ */ import { schema } from '@kbn/config-schema'; +import { loggerMock, type MockedLogger } from '@kbn/logging-mocks'; import type { SavedObjectSanitizedDoc, SavedObjectsValidationMap, } from '@kbn/core-saved-objects-server'; -import { SavedObjectsTypeValidator } from '.'; -import { loggerMock, MockedLogger } from '@kbn/logging-mocks'; +import { SavedObjectsTypeValidator } from './validator'; describe('Saved Objects type validator', () => { let validator: SavedObjectsTypeValidator; diff --git a/src/core/server/saved_objects/validation/validator.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/validation/validator.ts similarity index 100% rename from src/core/server/saved_objects/validation/validator.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/validation/validator.ts diff --git a/src/core/server/saved_objects/version/base64.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/version/base64.ts similarity index 100% rename from src/core/server/saved_objects/version/base64.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/version/base64.ts diff --git a/src/core/server/saved_objects/version/decode_request_version.test.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/version/decode_request_version.test.ts similarity index 100% rename from src/core/server/saved_objects/version/decode_request_version.test.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/version/decode_request_version.test.ts diff --git a/src/core/server/saved_objects/version/decode_request_version.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/version/decode_request_version.ts similarity index 100% rename from src/core/server/saved_objects/version/decode_request_version.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/version/decode_request_version.ts diff --git a/src/core/server/saved_objects/version/decode_version.test.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/version/decode_version.test.ts similarity index 100% rename from src/core/server/saved_objects/version/decode_version.test.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/version/decode_version.test.ts diff --git a/src/core/server/saved_objects/version/decode_version.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/version/decode_version.ts similarity index 93% rename from src/core/server/saved_objects/version/decode_version.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/version/decode_version.ts index 4166e7eef06c7..dd4bdcdc8186f 100644 --- a/src/core/server/saved_objects/version/decode_version.ts +++ b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/version/decode_version.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { SavedObjectsErrorHelpers } from '../service/lib/errors'; +import { SavedObjectsErrorHelpers } from '@kbn/core-saved-objects-utils-server'; import { decodeBase64 } from './base64'; /** diff --git a/src/core/server/saved_objects/version/encode_hit_version.test.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/version/encode_hit_version.test.ts similarity index 100% rename from src/core/server/saved_objects/version/encode_hit_version.test.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/version/encode_hit_version.test.ts diff --git a/src/core/server/saved_objects/version/encode_hit_version.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/version/encode_hit_version.ts similarity index 100% rename from src/core/server/saved_objects/version/encode_hit_version.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/version/encode_hit_version.ts diff --git a/src/core/server/saved_objects/version/encode_version.test.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/version/encode_version.test.ts similarity index 100% rename from src/core/server/saved_objects/version/encode_version.test.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/version/encode_version.test.ts diff --git a/src/core/server/saved_objects/version/encode_version.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/version/encode_version.ts similarity index 100% rename from src/core/server/saved_objects/version/encode_version.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/version/encode_version.ts diff --git a/src/plugins/shared_ux/public/index.ts b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/version/index.ts old mode 100755 new mode 100644 similarity index 61% rename from src/plugins/shared_ux/public/index.ts rename to packages/core/saved-objects/core-saved-objects-base-server-internal/src/version/index.ts index 1dcf84eaf4991..2fb31940d4408 --- a/src/plugins/shared_ux/public/index.ts +++ b/packages/core/saved-objects/core-saved-objects-base-server-internal/src/version/index.ts @@ -6,13 +6,7 @@ * Side Public License, v 1. */ -import { SharedUXPlugin } from './plugin'; - -/** - * Creates the Shared UX plugin. - */ -export function plugin() { - return new SharedUXPlugin(); -} - -export type { SharedUXPluginSetup, SharedUXPluginStart } from './types'; +export { encodeVersion } from './encode_version'; +export { encodeHitVersion } from './encode_hit_version'; +export { decodeVersion } from './decode_version'; +export { decodeRequestVersion } from './decode_request_version'; diff --git a/packages/kbn-shared-ux-services/tsconfig.json b/packages/core/saved-objects/core-saved-objects-base-server-internal/tsconfig.json old mode 100755 new mode 100644 similarity index 85% rename from packages/kbn-shared-ux-services/tsconfig.json rename to packages/core/saved-objects/core-saved-objects-base-server-internal/tsconfig.json index 789c6b3111115..39d3c7097814a --- a/packages/kbn-shared-ux-services/tsconfig.json +++ b/packages/core/saved-objects/core-saved-objects-base-server-internal/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, "declarationMap": true, diff --git a/packages/core/saved-objects/core-saved-objects-base-server-mocks/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-base-server-mocks/BUILD.bazel new file mode 100644 index 0000000000000..9f3538c20a752 --- /dev/null +++ b/packages/core/saved-objects/core-saved-objects-base-server-mocks/BUILD.bazel @@ -0,0 +1,100 @@ +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_DIRNAME = "core-saved-objects-base-server-mocks" +PKG_REQUIRE_NAME = "@kbn/core-saved-objects-base-server-mocks" + +SOURCE_FILES = glob( + [ + "src/**/*.ts", + ], + exclude = [ + "**/*.test.*", + "**/*.stories.*", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +RUNTIME_DEPS = [ +] + +TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "//packages/core/saved-objects/core-saved-objects-server:npm_module_types", + "//packages/core/saved-objects/core-saved-objects-base-server-internal:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", +) + +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", + root_dir = "src", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/core/saved-objects/core-saved-objects-base-server-mocks/README.md b/packages/core/saved-objects/core-saved-objects-base-server-mocks/README.md new file mode 100644 index 0000000000000..5da5264ce9eed --- /dev/null +++ b/packages/core/saved-objects/core-saved-objects-base-server-mocks/README.md @@ -0,0 +1,5 @@ +# @kbn/core-saved-objects-base-server-mocks + +This package contains the mocks for the base server-side savedObjects sub-domain: +- `SavedObjectTypeRegistry` mock +- `SavedObjectsSerializer` mock diff --git a/packages/shared-ux/button/exit_full_screen/mocks/jest.config.js b/packages/core/saved-objects/core-saved-objects-base-server-mocks/jest.config.js similarity index 78% rename from packages/shared-ux/button/exit_full_screen/mocks/jest.config.js rename to packages/core/saved-objects/core-saved-objects-base-server-mocks/jest.config.js index 3485a061a38ee..fee774e787693 100644 --- a/packages/shared-ux/button/exit_full_screen/mocks/jest.config.js +++ b/packages/core/saved-objects/core-saved-objects-base-server-mocks/jest.config.js @@ -8,6 +8,6 @@ module.exports = { preset: '@kbn/test/jest_node', - rootDir: '../../../../..', - roots: ['/packages/shared-ux/button/exit_full_screen/mocks'], + rootDir: '../../../..', + roots: ['/packages/core/saved-objects/core-saved-objects-base-server-mocks'], }; diff --git a/packages/core/saved-objects/core-saved-objects-base-server-mocks/package.json b/packages/core/saved-objects/core-saved-objects-base-server-mocks/package.json new file mode 100644 index 0000000000000..e119e704c7ace --- /dev/null +++ b/packages/core/saved-objects/core-saved-objects-base-server-mocks/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/core-saved-objects-base-server-mocks", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/index.ts b/packages/core/saved-objects/core-saved-objects-base-server-mocks/src/index.ts similarity index 74% rename from packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/index.ts rename to packages/core/saved-objects/core-saved-objects-base-server-mocks/src/index.ts index f8c272c8f9875..62657cf81ea61 100644 --- a/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/index.ts +++ b/packages/core/saved-objects/core-saved-objects-base-server-mocks/src/index.ts @@ -5,4 +5,6 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -export { NoDataConfigPage, NoDataConfigPageWithSolutionNavBar } from './no_data_config_page'; + +export { typeRegistryMock } from './saved_objects_type_registry.mock'; +export { serializerMock } from './serializer.mock'; diff --git a/src/core/server/saved_objects/saved_objects_type_registry.mock.ts b/packages/core/saved-objects/core-saved-objects-base-server-mocks/src/saved_objects_type_registry.mock.ts similarity index 94% rename from src/core/server/saved_objects/saved_objects_type_registry.mock.ts rename to packages/core/saved-objects/core-saved-objects-base-server-mocks/src/saved_objects_type_registry.mock.ts index 70d05a0f7b0ab..8f792f177b5fc 100644 --- a/src/core/server/saved_objects/saved_objects_type_registry.mock.ts +++ b/packages/core/saved-objects/core-saved-objects-base-server-mocks/src/saved_objects_type_registry.mock.ts @@ -7,7 +7,7 @@ */ import type { ISavedObjectTypeRegistry } from '@kbn/core-saved-objects-server'; -import type { SavedObjectTypeRegistry } from './saved_objects_type_registry'; +import type { SavedObjectTypeRegistry } from '@kbn/core-saved-objects-base-server-internal'; const createRegistryMock = (): jest.Mocked< ISavedObjectTypeRegistry & Pick diff --git a/packages/core/saved-objects/core-saved-objects-base-server-mocks/src/serializer.mock.ts b/packages/core/saved-objects/core-saved-objects-base-server-mocks/src/serializer.mock.ts new file mode 100644 index 0000000000000..6bdac2e20c1f9 --- /dev/null +++ b/packages/core/saved-objects/core-saved-objects-base-server-mocks/src/serializer.mock.ts @@ -0,0 +1,24 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 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 { ISavedObjectsSerializer } from '@kbn/core-saved-objects-server'; + +const createSerializerMock = () => { + const mock: jest.Mocked = { + isRawSavedObject: jest.fn(), + rawToSavedObject: jest.fn(), + savedObjectToRaw: jest.fn(), + generateRawId: jest.fn(), + generateRawLegacyUrlAliasId: jest.fn(), + }; + return mock; +}; + +export const serializerMock = { + create: createSerializerMock, +}; diff --git a/packages/core/saved-objects/core-saved-objects-base-server-mocks/tsconfig.json b/packages/core/saved-objects/core-saved-objects-base-server-mocks/tsconfig.json new file mode 100644 index 0000000000000..39d3c7097814a --- /dev/null +++ b/packages/core/saved-objects/core-saved-objects-base-server-mocks/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "rootDir": "src", + "stripInternal": false, + "types": [ + "jest", + "node" + ] + }, + "include": [ + "src/**/*" + ] +} diff --git a/packages/core/saved-objects/core-saved-objects-browser-internal/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-browser-internal/BUILD.bazel index b0d0964c54a96..40aa528d50a98 100644 --- a/packages/core/saved-objects/core-saved-objects-browser-internal/BUILD.bazel +++ b/packages/core/saved-objects/core-saved-objects-browser-internal/BUILD.bazel @@ -29,7 +29,7 @@ NPM_MODULE_EXTRA_FILES = [ RUNTIME_DEPS = [ "@npm//lodash", - "//packages/elastic-safer-lodash-set", + "//packages/kbn-safer-lodash-set", ### test dependencies "//packages/core/http/core-http-browser-mocks", ] @@ -38,7 +38,7 @@ TYPES_DEPS = [ "@npm//@types/node", "@npm//@types/jest", "@npm//lodash", - "//packages/elastic-safer-lodash-set:npm_module_types", + "//packages/kbn-safer-lodash-set:npm_module_types", "//packages/core/base/core-base-browser-internal:npm_module_types", "//packages/core/http/core-http-browser:npm_module_types", "//packages/core/saved-objects/core-saved-objects-common:npm_module_types", diff --git a/packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.ts b/packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.ts index 89501c69dcfb5..adda64d8b4ff3 100644 --- a/packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.ts +++ b/packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { get, has } from 'lodash'; import type { SavedObject as SavedObjectType } from '@kbn/core-saved-objects-common'; import type { diff --git a/packages/core/saved-objects/core-saved-objects-utils-server/BUILD.bazel b/packages/core/saved-objects/core-saved-objects-utils-server/BUILD.bazel new file mode 100644 index 0000000000000..71a61799ee46a --- /dev/null +++ b/packages/core/saved-objects/core-saved-objects-utils-server/BUILD.bazel @@ -0,0 +1,106 @@ +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_DIRNAME = "core-saved-objects-utils-server" +PKG_REQUIRE_NAME = "@kbn/core-saved-objects-utils-server" + +SOURCE_FILES = glob( + [ + "src/**/*.ts", + ], + exclude = [ + "**/*.test.*", + "**/*.stories.*", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +RUNTIME_DEPS = [ + "@npm//lodash", + "@npm//uuid", + "@npm//@hapi/boom", +] + + +TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "@npm//@types/lodash", + "@npm//@types/uuid", + "@npm//@hapi/boom", + "//packages/core/saved-objects/core-saved-objects-server:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", +) + +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", + root_dir = "src", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/core/saved-objects/core-saved-objects-utils-server/README.md b/packages/core/saved-objects/core-saved-objects-utils-server/README.md new file mode 100644 index 0000000000000..ecbfa469575ae --- /dev/null +++ b/packages/core/saved-objects/core-saved-objects-utils-server/README.md @@ -0,0 +1,5 @@ +# @kbn/core-saved-objects-utils-server + +This package contains public utilities for Core's server-side `savedObjects` domain. + + diff --git a/packages/shared-ux/storybook/mock/jest.config.js b/packages/core/saved-objects/core-saved-objects-utils-server/jest.config.js similarity index 83% rename from packages/shared-ux/storybook/mock/jest.config.js rename to packages/core/saved-objects/core-saved-objects-utils-server/jest.config.js index f29327c23ca15..5458bf05b6767 100644 --- a/packages/shared-ux/storybook/mock/jest.config.js +++ b/packages/core/saved-objects/core-saved-objects-utils-server/jest.config.js @@ -9,5 +9,5 @@ module.exports = { preset: '@kbn/test/jest_node', rootDir: '../../../..', - roots: ['/packages/shared-ux/storybook/mock'], + roots: ['/packages/core/saved-objects/core-saved-objects-utils-server'], }; diff --git a/packages/core/saved-objects/core-saved-objects-utils-server/package.json b/packages/core/saved-objects/core-saved-objects-utils-server/package.json new file mode 100644 index 0000000000000..13220da373261 --- /dev/null +++ b/packages/core/saved-objects/core-saved-objects-utils-server/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/core-saved-objects-utils-server", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/packages/kbn-shared-ux-storybook/src/index.ts b/packages/core/saved-objects/core-saved-objects-utils-server/src/index.ts old mode 100755 new mode 100644 similarity index 52% rename from packages/kbn-shared-ux-storybook/src/index.ts rename to packages/core/saved-objects/core-saved-objects-utils-server/src/index.ts index 6b310673eb00d..3704cebf08398 --- a/packages/kbn-shared-ux-storybook/src/index.ts +++ b/packages/core/saved-objects/core-saved-objects-utils-server/src/index.ts @@ -6,17 +6,12 @@ * Side Public License, v 1. */ -export { servicesDecorator } from './decorators'; - +export { mergeSavedObjectMigrationMaps } from './merge_migration_maps'; +export { SavedObjectsErrorHelpers, type DecoratedError } from './saved_objects_error_helpers'; export { - applicationServiceFactory, - docLinksServiceFactory, - editorsServiceFactory, - httpServiceFactory, - platformServiceFactory, - servicesFactory, - userPermissionsServiceFactory, - dataServiceFactory, -} from './services'; - -export type { DataServiceFactoryConfig } from './services'; + SavedObjectsUtils, + ALL_NAMESPACES_STRING, + DEFAULT_NAMESPACE_STRING, + FIND_DEFAULT_PAGE, + FIND_DEFAULT_PER_PAGE, +} from './saved_objects_utils'; diff --git a/src/core/server/saved_objects/migrations/utils.test.ts b/packages/core/saved-objects/core-saved-objects-utils-server/src/merge_migration_maps.test.ts similarity index 96% rename from src/core/server/saved_objects/migrations/utils.test.ts rename to packages/core/saved-objects/core-saved-objects-utils-server/src/merge_migration_maps.test.ts index e3378c3fb9e78..28b3ebd3735b4 100644 --- a/src/core/server/saved_objects/migrations/utils.test.ts +++ b/packages/core/saved-objects/core-saved-objects-utils-server/src/merge_migration_maps.test.ts @@ -11,7 +11,7 @@ import type { SavedObjectMigrationMap, SavedObjectUnsanitizedDoc, } from '@kbn/core-saved-objects-server'; -import { mergeSavedObjectMigrationMaps } from './utils'; +import { mergeSavedObjectMigrationMaps } from './merge_migration_maps'; describe('mergeSavedObjectMigrationMaps', () => { const obj1: SavedObjectMigrationMap = { diff --git a/src/core/server/saved_objects/migrations/utils.ts b/packages/core/saved-objects/core-saved-objects-utils-server/src/merge_migration_maps.ts similarity index 96% rename from src/core/server/saved_objects/migrations/utils.ts rename to packages/core/saved-objects/core-saved-objects-utils-server/src/merge_migration_maps.ts index 108317fc6698b..e5f2f1d74a7cf 100644 --- a/src/core/server/saved_objects/migrations/utils.ts +++ b/packages/core/saved-objects/core-saved-objects-utils-server/src/merge_migration_maps.ts @@ -7,12 +7,12 @@ */ import { mergeWith } from 'lodash'; -import { +import type { SavedObjectMigrationContext, SavedObjectMigrationFn, SavedObjectMigrationMap, SavedObjectUnsanitizedDoc, -} from '../..'; +} from '@kbn/core-saved-objects-server'; /** * Merges two saved object migration maps. diff --git a/src/core/server/saved_objects/service/lib/errors.test.ts b/packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.test.ts similarity index 99% rename from src/core/server/saved_objects/service/lib/errors.test.ts rename to packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.test.ts index 3bea693429254..6f312a09a56e9 100644 --- a/src/core/server/saved_objects/service/lib/errors.test.ts +++ b/packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.test.ts @@ -7,8 +7,7 @@ */ import Boom from '@hapi/boom'; - -import { SavedObjectsErrorHelpers } from './errors'; +import { SavedObjectsErrorHelpers } from './saved_objects_error_helpers'; describe('savedObjectsClient/errorTypes', () => { describe('BadRequest error', () => { diff --git a/src/core/server/saved_objects/service/lib/errors.ts b/packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts similarity index 100% rename from src/core/server/saved_objects/service/lib/errors.ts rename to packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_error_helpers.ts diff --git a/src/core/server/saved_objects/service/lib/utils.test.mock.ts b/packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_utils.test.mock.ts similarity index 100% rename from src/core/server/saved_objects/service/lib/utils.test.mock.ts rename to packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_utils.test.mock.ts diff --git a/src/core/server/saved_objects/service/lib/utils.test.ts b/packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_utils.test.ts similarity index 94% rename from src/core/server/saved_objects/service/lib/utils.test.ts rename to packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_utils.test.ts index 8c836afd087d3..717b52ef248ca 100644 --- a/src/core/server/saved_objects/service/lib/utils.test.ts +++ b/packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_utils.test.ts @@ -6,10 +6,10 @@ * Side Public License, v 1. */ -import { mockUuidv1, mockUuidv5 } from './utils.test.mock'; +import { mockUuidv1, mockUuidv5 } from './saved_objects_utils.test.mock'; -import { SavedObjectsFindOptions } from '@kbn/core-saved-objects-api-server'; -import { SavedObjectsUtils } from './utils'; +import type { SavedObjectsFindOptions } from '@kbn/core-saved-objects-api-server'; +import { SavedObjectsUtils } from './saved_objects_utils'; describe('SavedObjectsUtils', () => { const { diff --git a/src/core/server/saved_objects/service/lib/utils.ts b/packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_utils.ts similarity index 100% rename from src/core/server/saved_objects/service/lib/utils.ts rename to packages/core/saved-objects/core-saved-objects-utils-server/src/saved_objects_utils.ts diff --git a/packages/core/saved-objects/core-saved-objects-utils-server/tsconfig.json b/packages/core/saved-objects/core-saved-objects-utils-server/tsconfig.json new file mode 100644 index 0000000000000..39d3c7097814a --- /dev/null +++ b/packages/core/saved-objects/core-saved-objects-utils-server/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "rootDir": "src", + "stripInternal": false, + "types": [ + "jest", + "node" + ] + }, + "include": [ + "src/**/*" + ] +} diff --git a/packages/core/test-helpers/core-test-helpers-deprecations-getters/BUILD.bazel b/packages/core/test-helpers/core-test-helpers-deprecations-getters/BUILD.bazel index 19d2290d18f84..3eb0b8d9184fa 100644 --- a/packages/core/test-helpers/core-test-helpers-deprecations-getters/BUILD.bazel +++ b/packages/core/test-helpers/core-test-helpers-deprecations-getters/BUILD.bazel @@ -27,7 +27,7 @@ NPM_MODULE_EXTRA_FILES = [ ] RUNTIME_DEPS = [ - "//packages/elastic-safer-lodash-set", + "//packages/kbn-safer-lodash-set", "//packages/kbn-config", "//packages/kbn-config-mocks", ] @@ -35,7 +35,7 @@ RUNTIME_DEPS = [ TYPES_DEPS = [ "@npm//@types/node", "@npm//@types/jest", - "//packages/elastic-safer-lodash-set:npm_module_types", + "//packages/kbn-safer-lodash-set:npm_module_types", "//packages/kbn-config:npm_module_types", "//packages/kbn-config-mocks:npm_module_types", ] diff --git a/packages/core/test-helpers/core-test-helpers-deprecations-getters/src/deprecations_getters.ts b/packages/core/test-helpers/core-test-helpers-deprecations-getters/src/deprecations_getters.ts index 825649a77ac51..9bdbd9c9b3efa 100644 --- a/packages/core/test-helpers/core-test-helpers-deprecations-getters/src/deprecations_getters.ts +++ b/packages/core/test-helpers/core-test-helpers-deprecations-getters/src/deprecations_getters.ts @@ -5,7 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import type { ConfigDeprecationProvider, ConfigDeprecationContext } from '@kbn/config'; import { configDeprecationFactory, applyDeprecations } from '@kbn/config'; import { configDeprecationsMock } from '@kbn/config-mocks'; diff --git a/packages/kbn-apm-config-loader/BUILD.bazel b/packages/kbn-apm-config-loader/BUILD.bazel index 74b7fdfe52a1a..b7d9249c9f587 100644 --- a/packages/kbn-apm-config-loader/BUILD.bazel +++ b/packages/kbn-apm-config-loader/BUILD.bazel @@ -27,14 +27,14 @@ NPM_MODULE_EXTRA_FILES = [ ] RUNTIME_DEPS = [ - "//packages/elastic-safer-lodash-set", + "//packages/kbn-safer-lodash-set", "//packages/kbn-utils", "@npm//js-yaml", "@npm//lodash", ] TYPES_DEPS = [ - "//packages/elastic-safer-lodash-set:npm_module_types", + "//packages/kbn-safer-lodash-set:npm_module_types", "//packages/kbn-utils:npm_module_types", "@npm//@elastic/apm-rum", "@npm//@types/jest", diff --git a/packages/kbn-apm-config-loader/src/utils/apply_config_overrides.ts b/packages/kbn-apm-config-loader/src/utils/apply_config_overrides.ts index e2ae5a2dce3ba..54993ce0843f9 100644 --- a/packages/kbn-apm-config-loader/src/utils/apply_config_overrides.ts +++ b/packages/kbn-apm-config-loader/src/utils/apply_config_overrides.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { getArgValue } from './read_argv'; /** diff --git a/packages/kbn-apm-config-loader/src/utils/read_config.ts b/packages/kbn-apm-config-loader/src/utils/read_config.ts index 0d6fce88b0532..f41f8e66c7d5b 100644 --- a/packages/kbn-apm-config-loader/src/utils/read_config.ts +++ b/packages/kbn-apm-config-loader/src/utils/read_config.ts @@ -9,7 +9,7 @@ import { readFileSync } from 'fs'; import { safeLoad } from 'js-yaml'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { isPlainObject } from 'lodash'; import { ensureDeepObject } from './ensure_deep_object'; diff --git a/packages/elastic-apm-synthtrace/BUILD.bazel b/packages/kbn-apm-synthtrace/BUILD.bazel similarity index 96% rename from packages/elastic-apm-synthtrace/BUILD.bazel rename to packages/kbn-apm-synthtrace/BUILD.bazel index d0963f43e171b..0e759e33c0ab5 100644 --- a/packages/elastic-apm-synthtrace/BUILD.bazel +++ b/packages/kbn-apm-synthtrace/BUILD.bazel @@ -2,8 +2,8 @@ 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 = "elastic-apm-synthtrace" -PKG_REQUIRE_NAME = "@elastic/apm-synthtrace" +PKG_BASE_NAME = "kbn-apm-synthtrace" +PKG_REQUIRE_NAME = "@kbn/apm-synthtrace" SOURCE_FILES = glob( [ diff --git a/packages/elastic-apm-synthtrace/README.md b/packages/kbn-apm-synthtrace/README.md similarity index 92% rename from packages/elastic-apm-synthtrace/README.md rename to packages/kbn-apm-synthtrace/README.md index 24ce3b055abd0..3afc25fb7e9a8 100644 --- a/packages/elastic-apm-synthtrace/README.md +++ b/packages/kbn-apm-synthtrace/README.md @@ -1,6 +1,6 @@ -# @elastic/apm-synthtrace +# @kbn/apm-synthtrace -`@elastic/apm-synthtrace` is a tool in technical preview to generate synthetic APM data. It is intended to be used for development and testing of the Elastic APM app in Kibana. +`@kbn/apm-synthtrace` is a tool in technical preview to generate synthetic APM data. It is intended to be used for development and testing of the Elastic APM app in Kibana. At a high-level, the module works by modeling APM events/metricsets with [a fluent API](https://en.wikipedia.org/wiki/Fluent_interface). The models can then be serialized and converted to Elasticsearch documents. In the future we might support APM Server as an output as well. @@ -25,7 +25,7 @@ This library can currently be used in two ways: #### Example ```ts -import { service, timerange, toElasticsearchOutput } from '@elastic/apm-synthtrace'; +import { service, timerange, toElasticsearchOutput } from '@kbn/apm-synthtrace'; const instance = service('synth-go', 'production', 'go').instance('instance-a'); @@ -72,14 +72,14 @@ const esEvents = toElasticsearchOutput(traceEvents.concat(metricsets)); #### Generating metricsets -`@elastic/apm-synthtrace` can also automatically generate transaction metrics, span destination metrics and transaction breakdown metrics based on the generated trace events. If we expand on the previous example: +`@kbn/apm-synthtrace` can also automatically generate transaction metrics, span destination metrics and transaction breakdown metrics based on the generated trace events. If we expand on the previous example: ```ts import { getTransactionMetrics, getSpanDestinationMetrics, getBreakdownMetrics, -} from '@elastic/apm-synthtrace'; +} from '@kbn/apm-synthtrace'; const esEvents = toElasticsearchOutput([ ...traceEvents, @@ -91,7 +91,7 @@ const esEvents = toElasticsearchOutput([ ### CLI -Via the CLI, you can run scenarios, either using a fixed time range or continuously generating data. Scenarios are available in [`packages/elastic-apm-synthtrace/src/scenarios/`](https://github.com/elastic/kibana/blob/main/packages/elastic-apm-synthtrace/src/scenarios/). +Via the CLI, you can run scenarios, either using a fixed time range or continuously generating data. Scenarios are available in [`packages/kbn-apm-synthtrace/src/scenarios/`](https://github.com/elastic/kibana/blob/main/packages/kbn-apm-synthtrace/src/scenarios/). For live data ingestion: diff --git a/packages/elastic-apm-synthtrace/bin/synthtrace b/packages/kbn-apm-synthtrace/bin/synthtrace similarity index 100% rename from packages/elastic-apm-synthtrace/bin/synthtrace rename to packages/kbn-apm-synthtrace/bin/synthtrace diff --git a/packages/elastic-apm-synthtrace/jest.config.js b/packages/kbn-apm-synthtrace/jest.config.js similarity index 89% rename from packages/elastic-apm-synthtrace/jest.config.js rename to packages/kbn-apm-synthtrace/jest.config.js index 13d8643c5213c..e89880dc7e8df 100644 --- a/packages/elastic-apm-synthtrace/jest.config.js +++ b/packages/kbn-apm-synthtrace/jest.config.js @@ -9,7 +9,7 @@ module.exports = { preset: '@kbn/test', rootDir: '../..', - roots: ['/packages/elastic-apm-synthtrace'], + roots: ['/packages/kbn-apm-synthtrace'], setupFiles: [], setupFilesAfterEnv: [], }; diff --git a/packages/elastic-apm-synthtrace/package.json b/packages/kbn-apm-synthtrace/package.json similarity index 86% rename from packages/elastic-apm-synthtrace/package.json rename to packages/kbn-apm-synthtrace/package.json index bbfcd496c922b..17d4c9b10b75b 100644 --- a/packages/elastic-apm-synthtrace/package.json +++ b/packages/kbn-apm-synthtrace/package.json @@ -1,5 +1,5 @@ { - "name": "@elastic/apm-synthtrace", + "name": "@kbn/apm-synthtrace", "version": "0.1.0", "description": "Elastic APM trace data generator", "license": "SSPL-1.0 OR Elastic License 2.0", diff --git a/packages/elastic-apm-synthtrace/src/.eslintrc.js b/packages/kbn-apm-synthtrace/src/.eslintrc.js similarity index 100% rename from packages/elastic-apm-synthtrace/src/.eslintrc.js rename to packages/kbn-apm-synthtrace/src/.eslintrc.js diff --git a/packages/elastic-apm-synthtrace/src/cli.ts b/packages/kbn-apm-synthtrace/src/cli.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/cli.ts rename to packages/kbn-apm-synthtrace/src/cli.ts diff --git a/packages/elastic-apm-synthtrace/src/cli/run_synthtrace.ts b/packages/kbn-apm-synthtrace/src/cli/run_synthtrace.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/cli/run_synthtrace.ts rename to packages/kbn-apm-synthtrace/src/cli/run_synthtrace.ts diff --git a/packages/elastic-apm-synthtrace/src/cli/scenario.ts b/packages/kbn-apm-synthtrace/src/cli/scenario.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/cli/scenario.ts rename to packages/kbn-apm-synthtrace/src/cli/scenario.ts diff --git a/packages/elastic-apm-synthtrace/src/cli/utils/get_common_services.ts b/packages/kbn-apm-synthtrace/src/cli/utils/get_common_services.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/cli/utils/get_common_services.ts rename to packages/kbn-apm-synthtrace/src/cli/utils/get_common_services.ts diff --git a/packages/elastic-apm-synthtrace/src/cli/utils/get_scenario.ts b/packages/kbn-apm-synthtrace/src/cli/utils/get_scenario.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/cli/utils/get_scenario.ts rename to packages/kbn-apm-synthtrace/src/cli/utils/get_scenario.ts diff --git a/packages/elastic-apm-synthtrace/src/cli/utils/interval_to_ms.ts b/packages/kbn-apm-synthtrace/src/cli/utils/interval_to_ms.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/cli/utils/interval_to_ms.ts rename to packages/kbn-apm-synthtrace/src/cli/utils/interval_to_ms.ts diff --git a/packages/elastic-apm-synthtrace/src/cli/utils/parse_run_cli_flags.ts b/packages/kbn-apm-synthtrace/src/cli/utils/parse_run_cli_flags.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/cli/utils/parse_run_cli_flags.ts rename to packages/kbn-apm-synthtrace/src/cli/utils/parse_run_cli_flags.ts diff --git a/packages/elastic-apm-synthtrace/src/cli/utils/start_historical_data_upload.ts b/packages/kbn-apm-synthtrace/src/cli/utils/start_historical_data_upload.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/cli/utils/start_historical_data_upload.ts rename to packages/kbn-apm-synthtrace/src/cli/utils/start_historical_data_upload.ts diff --git a/packages/elastic-apm-synthtrace/src/cli/utils/start_live_data_upload.ts b/packages/kbn-apm-synthtrace/src/cli/utils/start_live_data_upload.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/cli/utils/start_live_data_upload.ts rename to packages/kbn-apm-synthtrace/src/cli/utils/start_live_data_upload.ts diff --git a/packages/elastic-apm-synthtrace/src/cli/utils/synthtrace_worker.ts b/packages/kbn-apm-synthtrace/src/cli/utils/synthtrace_worker.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/cli/utils/synthtrace_worker.ts rename to packages/kbn-apm-synthtrace/src/cli/utils/synthtrace_worker.ts diff --git a/packages/elastic-apm-synthtrace/src/cli/utils/worker.js b/packages/kbn-apm-synthtrace/src/cli/utils/worker.js similarity index 100% rename from packages/elastic-apm-synthtrace/src/cli/utils/worker.js rename to packages/kbn-apm-synthtrace/src/cli/utils/worker.js diff --git a/packages/elastic-apm-synthtrace/src/index.ts b/packages/kbn-apm-synthtrace/src/index.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/index.ts rename to packages/kbn-apm-synthtrace/src/index.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/agent_config/agent_config.ts b/packages/kbn-apm-synthtrace/src/lib/agent_config/agent_config.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/agent_config/agent_config.ts rename to packages/kbn-apm-synthtrace/src/lib/agent_config/agent_config.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/agent_config/agent_config_fields.ts b/packages/kbn-apm-synthtrace/src/lib/agent_config/agent_config_fields.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/agent_config/agent_config_fields.ts rename to packages/kbn-apm-synthtrace/src/lib/agent_config/agent_config_fields.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/agent_config/index.ts b/packages/kbn-apm-synthtrace/src/lib/agent_config/index.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/agent_config/index.ts rename to packages/kbn-apm-synthtrace/src/lib/agent_config/index.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/agent_config/observer.ts b/packages/kbn-apm-synthtrace/src/lib/agent_config/observer.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/agent_config/observer.ts rename to packages/kbn-apm-synthtrace/src/lib/agent_config/observer.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/aggregators/service_latency_aggregator.ts b/packages/kbn-apm-synthtrace/src/lib/apm/aggregators/service_latency_aggregator.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/aggregators/service_latency_aggregator.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/aggregators/service_latency_aggregator.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/apm_error.ts b/packages/kbn-apm-synthtrace/src/lib/apm/apm_error.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/apm_error.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/apm_error.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/apm_fields.ts b/packages/kbn-apm-synthtrace/src/lib/apm/apm_fields.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/apm_fields.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/apm_fields.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/base_span.ts b/packages/kbn-apm-synthtrace/src/lib/apm/base_span.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/base_span.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/base_span.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/browser.ts b/packages/kbn-apm-synthtrace/src/lib/apm/browser.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/browser.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/browser.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts b/packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_es_client.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_kibana_client.ts b/packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_kibana_client.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/client/apm_synthtrace_kibana_client.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/client/apm_synthtrace_kibana_client.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/defaults/get_chrome_user_agent_defaults.ts b/packages/kbn-apm-synthtrace/src/lib/apm/defaults/get_chrome_user_agent_defaults.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/defaults/get_chrome_user_agent_defaults.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/defaults/get_chrome_user_agent_defaults.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/index.ts b/packages/kbn-apm-synthtrace/src/lib/apm/index.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/index.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/index.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/instance.ts b/packages/kbn-apm-synthtrace/src/lib/apm/instance.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/instance.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/instance.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/metricset.ts b/packages/kbn-apm-synthtrace/src/lib/apm/metricset.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/metricset.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/metricset.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/processors/get_breakdown_metrics.ts b/packages/kbn-apm-synthtrace/src/lib/apm/processors/get_breakdown_metrics.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/processors/get_breakdown_metrics.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/processors/get_breakdown_metrics.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/processors/get_span_destination_metrics.ts b/packages/kbn-apm-synthtrace/src/lib/apm/processors/get_span_destination_metrics.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/processors/get_span_destination_metrics.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/processors/get_span_destination_metrics.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/processors/get_transaction_metrics.ts b/packages/kbn-apm-synthtrace/src/lib/apm/processors/get_transaction_metrics.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/processors/get_transaction_metrics.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/processors/get_transaction_metrics.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/rum_span.ts b/packages/kbn-apm-synthtrace/src/lib/apm/rum_span.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/rum_span.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/rum_span.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/rum_transaction.ts b/packages/kbn-apm-synthtrace/src/lib/apm/rum_transaction.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/rum_transaction.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/rum_transaction.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/service.ts b/packages/kbn-apm-synthtrace/src/lib/apm/service.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/service.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/service.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/span.ts b/packages/kbn-apm-synthtrace/src/lib/apm/span.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/span.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/span.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/transaction.ts b/packages/kbn-apm-synthtrace/src/lib/apm/transaction.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/transaction.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/transaction.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/utils/aggregate.ts b/packages/kbn-apm-synthtrace/src/lib/apm/utils/aggregate.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/utils/aggregate.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/utils/aggregate.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/utils/create_picker.ts b/packages/kbn-apm-synthtrace/src/lib/apm/utils/create_picker.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/utils/create_picker.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/utils/create_picker.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/apm/utils/get_apm_write_targets.ts b/packages/kbn-apm-synthtrace/src/lib/apm/utils/get_apm_write_targets.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/apm/utils/get_apm_write_targets.ts rename to packages/kbn-apm-synthtrace/src/lib/apm/utils/get_apm_write_targets.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/entity.ts b/packages/kbn-apm-synthtrace/src/lib/entity.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/entity.ts rename to packages/kbn-apm-synthtrace/src/lib/entity.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/entity_generator.ts b/packages/kbn-apm-synthtrace/src/lib/entity_generator.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/entity_generator.ts rename to packages/kbn-apm-synthtrace/src/lib/entity_generator.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts b/packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/entity_iterable.ts rename to packages/kbn-apm-synthtrace/src/lib/entity_iterable.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/entity_streams.ts b/packages/kbn-apm-synthtrace/src/lib/entity_streams.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/entity_streams.ts rename to packages/kbn-apm-synthtrace/src/lib/entity_streams.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/interval.ts b/packages/kbn-apm-synthtrace/src/lib/interval.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/interval.ts rename to packages/kbn-apm-synthtrace/src/lib/interval.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/serializable.ts b/packages/kbn-apm-synthtrace/src/lib/serializable.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/serializable.ts rename to packages/kbn-apm-synthtrace/src/lib/serializable.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/stack_monitoring/cluster.ts b/packages/kbn-apm-synthtrace/src/lib/stack_monitoring/cluster.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/stack_monitoring/cluster.ts rename to packages/kbn-apm-synthtrace/src/lib/stack_monitoring/cluster.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/stack_monitoring/cluster_stats.ts b/packages/kbn-apm-synthtrace/src/lib/stack_monitoring/cluster_stats.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/stack_monitoring/cluster_stats.ts rename to packages/kbn-apm-synthtrace/src/lib/stack_monitoring/cluster_stats.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/stack_monitoring/index.ts b/packages/kbn-apm-synthtrace/src/lib/stack_monitoring/index.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/stack_monitoring/index.ts rename to packages/kbn-apm-synthtrace/src/lib/stack_monitoring/index.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/stack_monitoring/kibana.ts b/packages/kbn-apm-synthtrace/src/lib/stack_monitoring/kibana.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/stack_monitoring/kibana.ts rename to packages/kbn-apm-synthtrace/src/lib/stack_monitoring/kibana.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/stack_monitoring/kibana_stats.ts b/packages/kbn-apm-synthtrace/src/lib/stack_monitoring/kibana_stats.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/stack_monitoring/kibana_stats.ts rename to packages/kbn-apm-synthtrace/src/lib/stack_monitoring/kibana_stats.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/stack_monitoring/stack_monitoring_fields.ts b/packages/kbn-apm-synthtrace/src/lib/stack_monitoring/stack_monitoring_fields.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/stack_monitoring/stack_monitoring_fields.ts rename to packages/kbn-apm-synthtrace/src/lib/stack_monitoring/stack_monitoring_fields.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/stream_aggregator.ts b/packages/kbn-apm-synthtrace/src/lib/stream_aggregator.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/stream_aggregator.ts rename to packages/kbn-apm-synthtrace/src/lib/stream_aggregator.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/stream_processor.ts b/packages/kbn-apm-synthtrace/src/lib/stream_processor.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/stream_processor.ts rename to packages/kbn-apm-synthtrace/src/lib/stream_processor.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/timerange.ts b/packages/kbn-apm-synthtrace/src/lib/timerange.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/timerange.ts rename to packages/kbn-apm-synthtrace/src/lib/timerange.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/utils/clean_write_targets.ts b/packages/kbn-apm-synthtrace/src/lib/utils/clean_write_targets.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/utils/clean_write_targets.ts rename to packages/kbn-apm-synthtrace/src/lib/utils/clean_write_targets.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/utils/create_logger.ts b/packages/kbn-apm-synthtrace/src/lib/utils/create_logger.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/utils/create_logger.ts rename to packages/kbn-apm-synthtrace/src/lib/utils/create_logger.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/utils/dedot.ts b/packages/kbn-apm-synthtrace/src/lib/utils/dedot.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/utils/dedot.ts rename to packages/kbn-apm-synthtrace/src/lib/utils/dedot.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/utils/generate_id.ts b/packages/kbn-apm-synthtrace/src/lib/utils/generate_id.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/utils/generate_id.ts rename to packages/kbn-apm-synthtrace/src/lib/utils/generate_id.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/utils/get_synthtrace_environment.ts b/packages/kbn-apm-synthtrace/src/lib/utils/get_synthtrace_environment.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/utils/get_synthtrace_environment.ts rename to packages/kbn-apm-synthtrace/src/lib/utils/get_synthtrace_environment.ts diff --git a/packages/elastic-apm-synthtrace/src/lib/utils/merge_iterable.ts b/packages/kbn-apm-synthtrace/src/lib/utils/merge_iterable.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/lib/utils/merge_iterable.ts rename to packages/kbn-apm-synthtrace/src/lib/utils/merge_iterable.ts diff --git a/packages/elastic-apm-synthtrace/src/scenarios/agent_config.ts b/packages/kbn-apm-synthtrace/src/scenarios/agent_config.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/scenarios/agent_config.ts rename to packages/kbn-apm-synthtrace/src/scenarios/agent_config.ts diff --git a/packages/elastic-apm-synthtrace/src/scenarios/aws_lambda.ts b/packages/kbn-apm-synthtrace/src/scenarios/aws_lambda.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/scenarios/aws_lambda.ts rename to packages/kbn-apm-synthtrace/src/scenarios/aws_lambda.ts diff --git a/packages/elastic-apm-synthtrace/src/scenarios/kibana_stats.ts b/packages/kbn-apm-synthtrace/src/scenarios/kibana_stats.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/scenarios/kibana_stats.ts rename to packages/kbn-apm-synthtrace/src/scenarios/kibana_stats.ts diff --git a/packages/elastic-apm-synthtrace/src/scenarios/low_throughput.ts b/packages/kbn-apm-synthtrace/src/scenarios/low_throughput.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/scenarios/low_throughput.ts rename to packages/kbn-apm-synthtrace/src/scenarios/low_throughput.ts diff --git a/packages/elastic-apm-synthtrace/src/scenarios/many_services.ts b/packages/kbn-apm-synthtrace/src/scenarios/many_services.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/scenarios/many_services.ts rename to packages/kbn-apm-synthtrace/src/scenarios/many_services.ts diff --git a/packages/elastic-apm-synthtrace/src/scenarios/monitoring.ts b/packages/kbn-apm-synthtrace/src/scenarios/monitoring.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/scenarios/monitoring.ts rename to packages/kbn-apm-synthtrace/src/scenarios/monitoring.ts diff --git a/packages/elastic-apm-synthtrace/src/scenarios/simple_trace.ts b/packages/kbn-apm-synthtrace/src/scenarios/simple_trace.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/scenarios/simple_trace.ts rename to packages/kbn-apm-synthtrace/src/scenarios/simple_trace.ts diff --git a/packages/elastic-apm-synthtrace/src/scenarios/span_links.ts b/packages/kbn-apm-synthtrace/src/scenarios/span_links.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/scenarios/span_links.ts rename to packages/kbn-apm-synthtrace/src/scenarios/span_links.ts diff --git a/packages/elastic-apm-synthtrace/src/test/apm_events_to_elasticsearch_output.test.ts b/packages/kbn-apm-synthtrace/src/test/apm_events_to_elasticsearch_output.test.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/test/apm_events_to_elasticsearch_output.test.ts rename to packages/kbn-apm-synthtrace/src/test/apm_events_to_elasticsearch_output.test.ts diff --git a/packages/elastic-apm-synthtrace/src/test/event_dsl_behavior.test.ts b/packages/kbn-apm-synthtrace/src/test/event_dsl_behavior.test.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/test/event_dsl_behavior.test.ts rename to packages/kbn-apm-synthtrace/src/test/event_dsl_behavior.test.ts diff --git a/packages/elastic-apm-synthtrace/src/test/rate_per_minute.test.ts b/packages/kbn-apm-synthtrace/src/test/rate_per_minute.test.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/test/rate_per_minute.test.ts rename to packages/kbn-apm-synthtrace/src/test/rate_per_minute.test.ts diff --git a/packages/elastic-apm-synthtrace/src/test/scenarios/01_simple_trace.test.ts b/packages/kbn-apm-synthtrace/src/test/scenarios/01_simple_trace.test.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/test/scenarios/01_simple_trace.test.ts rename to packages/kbn-apm-synthtrace/src/test/scenarios/01_simple_trace.test.ts diff --git a/packages/elastic-apm-synthtrace/src/test/scenarios/02_transaction_metrics.test.ts b/packages/kbn-apm-synthtrace/src/test/scenarios/02_transaction_metrics.test.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/test/scenarios/02_transaction_metrics.test.ts rename to packages/kbn-apm-synthtrace/src/test/scenarios/02_transaction_metrics.test.ts diff --git a/packages/elastic-apm-synthtrace/src/test/scenarios/03_span_destination_metrics.test.ts b/packages/kbn-apm-synthtrace/src/test/scenarios/03_span_destination_metrics.test.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/test/scenarios/03_span_destination_metrics.test.ts rename to packages/kbn-apm-synthtrace/src/test/scenarios/03_span_destination_metrics.test.ts diff --git a/packages/elastic-apm-synthtrace/src/test/scenarios/04_breakdown_metrics.test.ts b/packages/kbn-apm-synthtrace/src/test/scenarios/04_breakdown_metrics.test.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/test/scenarios/04_breakdown_metrics.test.ts rename to packages/kbn-apm-synthtrace/src/test/scenarios/04_breakdown_metrics.test.ts diff --git a/packages/elastic-apm-synthtrace/src/test/scenarios/05_transactions_with_errors.test.ts b/packages/kbn-apm-synthtrace/src/test/scenarios/05_transactions_with_errors.test.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/test/scenarios/05_transactions_with_errors.test.ts rename to packages/kbn-apm-synthtrace/src/test/scenarios/05_transactions_with_errors.test.ts diff --git a/packages/elastic-apm-synthtrace/src/test/scenarios/06_application_metrics.test.ts b/packages/kbn-apm-synthtrace/src/test/scenarios/06_application_metrics.test.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/test/scenarios/06_application_metrics.test.ts rename to packages/kbn-apm-synthtrace/src/test/scenarios/06_application_metrics.test.ts diff --git a/packages/elastic-apm-synthtrace/src/test/scenarios/__snapshots__/01_simple_trace.test.ts.snap b/packages/kbn-apm-synthtrace/src/test/scenarios/__snapshots__/01_simple_trace.test.ts.snap similarity index 100% rename from packages/elastic-apm-synthtrace/src/test/scenarios/__snapshots__/01_simple_trace.test.ts.snap rename to packages/kbn-apm-synthtrace/src/test/scenarios/__snapshots__/01_simple_trace.test.ts.snap diff --git a/packages/elastic-apm-synthtrace/src/test/streams_merge.test.ts b/packages/kbn-apm-synthtrace/src/test/streams_merge.test.ts similarity index 100% rename from packages/elastic-apm-synthtrace/src/test/streams_merge.test.ts rename to packages/kbn-apm-synthtrace/src/test/streams_merge.test.ts diff --git a/packages/elastic-apm-synthtrace/tsconfig.json b/packages/kbn-apm-synthtrace/tsconfig.json similarity index 100% rename from packages/elastic-apm-synthtrace/tsconfig.json rename to packages/kbn-apm-synthtrace/tsconfig.json diff --git a/packages/kbn-coloring/BUILD.bazel b/packages/kbn-coloring/BUILD.bazel index 4b20561e70c96..f266fe42a904d 100644 --- a/packages/kbn-coloring/BUILD.bazel +++ b/packages/kbn-coloring/BUILD.bazel @@ -41,7 +41,6 @@ NPM_MODULE_EXTRA_FILES = [ RUNTIME_DEPS = [ "//packages/kbn-i18n", "//packages/kbn-i18n-react", - "//packages/kbn-shared-ux-storybook", "//packages/kbn-interpreter", "//packages/kbn-utility-types", "//packages/kbn-shared-ux-utility", @@ -65,7 +64,6 @@ RUNTIME_DEPS = [ TYPES_DEPS = [ "//packages/kbn-i18n:npm_module_types", "//packages/kbn-i18n-react:npm_module_types", - "//packages/kbn-shared-ux-storybook:npm_module_types", "//packages/kbn-interpreter:npm_module_types", "//packages/kbn-utility-types:npm_module_types", "//packages/kbn-shared-ux-utility:npm_module_types", diff --git a/packages/kbn-config/BUILD.bazel b/packages/kbn-config/BUILD.bazel index 13cff50a1a2d7..4eeda0470542c 100644 --- a/packages/kbn-config/BUILD.bazel +++ b/packages/kbn-config/BUILD.bazel @@ -30,7 +30,7 @@ NPM_MODULE_EXTRA_FILES = [ ] RUNTIME_DEPS = [ - "//packages/elastic-safer-lodash-set", + "//packages/kbn-safer-lodash-set", "//packages/kbn-config-schema", "//packages/kbn-logging", "//packages/kbn-logging-mocks", @@ -47,7 +47,7 @@ RUNTIME_DEPS = [ ] TYPES_DEPS = [ - "//packages/elastic-safer-lodash-set:npm_module_types", + "//packages/kbn-safer-lodash-set:npm_module_types", "//packages/kbn-config-schema:npm_module_types", "//packages/kbn-logging:npm_module_types", "//packages/kbn-logging-mocks:npm_module_types", diff --git a/packages/kbn-config/src/deprecation/apply_deprecations.ts b/packages/kbn-config/src/deprecation/apply_deprecations.ts index 9b0c409204414..09e8efcdbd011 100644 --- a/packages/kbn-config/src/deprecation/apply_deprecations.ts +++ b/packages/kbn-config/src/deprecation/apply_deprecations.ts @@ -7,7 +7,7 @@ */ import { cloneDeep } from 'lodash'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import type { AddConfigDeprecation, ChangedDeprecatedPaths, diff --git a/packages/kbn-config/src/object_to_config_adapter.ts b/packages/kbn-config/src/object_to_config_adapter.ts index 6b68f71ea7399..ce186d7b02c34 100644 --- a/packages/kbn-config/src/object_to_config_adapter.ts +++ b/packages/kbn-config/src/object_to_config_adapter.ts @@ -7,7 +7,7 @@ */ import { cloneDeep, get, has } from 'lodash'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { getFlattenedObject } from '@kbn/std'; import { Config, ConfigPath } from '.'; diff --git a/packages/kbn-config/src/raw/read_config.ts b/packages/kbn-config/src/raw/read_config.ts index 307ce4e4a0f95..1c842961838f2 100644 --- a/packages/kbn-config/src/raw/read_config.ts +++ b/packages/kbn-config/src/raw/read_config.ts @@ -9,7 +9,7 @@ import { readFileSync } from 'fs'; import { safeLoad } from 'js-yaml'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { isPlainObject } from 'lodash'; import { ensureDeepObject } from './ensure_deep_object'; diff --git a/packages/kbn-eslint-config/.eslintrc.js b/packages/kbn-eslint-config/.eslintrc.js index 97100635ac0ee..f2b6e93649cdd 100644 --- a/packages/kbn-eslint-config/.eslintrc.js +++ b/packages/kbn-eslint-config/.eslintrc.js @@ -123,6 +123,14 @@ module.exports = { to: '@kbn/kibana-utils-plugin/common', exact: true, }, + { + from: '@elastic/safer-lodash-set', + to: '@kbn/safer-lodash-set', + }, + { + from: '@elastic/apm-synthtrace', + to: '@kbn/apm-synthtrace', + }, ], ], diff --git a/packages/kbn-optimizer/limits.yml b/packages/kbn-optimizer/limits.yml index 6b9e20ee7ee93..6c95efdba7330 100644 --- a/packages/kbn-optimizer/limits.yml +++ b/packages/kbn-optimizer/limits.yml @@ -119,7 +119,6 @@ pageLoadAssetSize: expressionGauge: 25000 controls: 40000 expressionPartitionVis: 26338 - sharedUX: 16225 savedSearch: 16225 ux: 20784 sessionView: 77750 diff --git a/packages/elastic-safer-lodash-set/.gitignore b/packages/kbn-safer-lodash-set/.gitignore similarity index 100% rename from packages/elastic-safer-lodash-set/.gitignore rename to packages/kbn-safer-lodash-set/.gitignore diff --git a/packages/elastic-safer-lodash-set/.npmignore b/packages/kbn-safer-lodash-set/.npmignore similarity index 100% rename from packages/elastic-safer-lodash-set/.npmignore rename to packages/kbn-safer-lodash-set/.npmignore diff --git a/packages/elastic-safer-lodash-set/BUILD.bazel b/packages/kbn-safer-lodash-set/BUILD.bazel similarity index 92% rename from packages/elastic-safer-lodash-set/BUILD.bazel rename to packages/kbn-safer-lodash-set/BUILD.bazel index 4a1c8b4290f33..893719c822859 100644 --- a/packages/elastic-safer-lodash-set/BUILD.bazel +++ b/packages/kbn-safer-lodash-set/BUILD.bazel @@ -1,7 +1,7 @@ load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm") -PKG_BASE_NAME = "elastic-safer-lodash-set" -PKG_REQUIRE_NAME = "@elastic/safer-lodash-set" +PKG_BASE_NAME = "kbn-safer-lodash-set" +PKG_REQUIRE_NAME = "@kbn/safer-lodash-set" SOURCE_FILES = glob( [ diff --git a/packages/elastic-safer-lodash-set/LICENSE b/packages/kbn-safer-lodash-set/LICENSE similarity index 95% rename from packages/elastic-safer-lodash-set/LICENSE rename to packages/kbn-safer-lodash-set/LICENSE index bae69c938a74c..8c34c9393aec7 100644 --- a/packages/elastic-safer-lodash-set/LICENSE +++ b/packages/kbn-safer-lodash-set/LICENSE @@ -31,4 +31,4 @@ individuals. For exact contribution history, see the revision history available at the following locations: - https://github.com/lodash/lodash - https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/lodash - - https://github.com/elastic/kibana/tree/main/packages/elastic-safer-lodash-set + - https://github.com/elastic/kibana/tree/main/packages/kbn-safer-lodash-set diff --git a/packages/elastic-safer-lodash-set/README.md b/packages/kbn-safer-lodash-set/README.md similarity index 86% rename from packages/elastic-safer-lodash-set/README.md rename to packages/kbn-safer-lodash-set/README.md index aae17b35ac130..08df12ff01ec3 100644 --- a/packages/elastic-safer-lodash-set/README.md +++ b/packages/kbn-safer-lodash-set/README.md @@ -1,4 +1,4 @@ -# @elastic/safer-lodash-set +# @kbn/safer-lodash-set This module adds protection against prototype pollution to the [`set`] and [`setWith`] functions from [Lodash] and are API compatible with @@ -23,15 +23,15 @@ console.log(object.x[0].y.z); // => 5 The main module exposes two functions, `set` and `setWith`: ```js -const { set, setWith } = require('@elastic/safer-lodash-set'); +const { set, setWith } = require('@kbn/safer-lodash-set'); ``` Besides the main module, it's also possible to require each function individually: ```js -const set = require('@elastic/safer-lodash-set/set'); -const setWith = require('@elastic/safer-lodash-set/setWith'); +const set = require('@kbn/safer-lodash-set/set'); +const setWith = require('@kbn/safer-lodash-set/setWith'); ``` The APIs of these functions are identical to the equivalent Lodash @@ -44,15 +44,15 @@ This module also supports the `lodash/fp` api and hence exposes the following fp compatible functions: ```js -const { set, setWith } = require('@elastic/safer-lodash-set/fp'); +const { set, setWith } = require('@kbn/safer-lodash-set/fp'); ``` Besides the main fp module, it's also possible to require each function individually: ```js -const set = require('@elastic/safer-lodash-set/fp/set'); -const setWith = require('@elastic/safer-lodash-set/fp/setWith'); +const set = require('@kbn/safer-lodash-set/fp/set'); +const setWith = require('@kbn/safer-lodash-set/fp/setWith'); ``` ## Limitations diff --git a/packages/elastic-safer-lodash-set/fp/assoc.d.ts b/packages/kbn-safer-lodash-set/fp/assoc.d.ts similarity index 80% rename from packages/elastic-safer-lodash-set/fp/assoc.d.ts rename to packages/kbn-safer-lodash-set/fp/assoc.d.ts index c04c85f63a870..45e5800a3a33b 100644 --- a/packages/elastic-safer-lodash-set/fp/assoc.d.ts +++ b/packages/kbn-safer-lodash-set/fp/assoc.d.ts @@ -2,7 +2,7 @@ * This file is forked from the DefinitelyTyped project (https://github.com/DefinitelyTyped/DefinitelyTyped), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ import { assoc } from '.'; diff --git a/packages/elastic-safer-lodash-set/fp/assoc.js b/packages/kbn-safer-lodash-set/fp/assoc.js similarity index 76% rename from packages/elastic-safer-lodash-set/fp/assoc.js rename to packages/kbn-safer-lodash-set/fp/assoc.js index 851e11690ea35..d6ea0c9c74b77 100644 --- a/packages/elastic-safer-lodash-set/fp/assoc.js +++ b/packages/kbn-safer-lodash-set/fp/assoc.js @@ -2,7 +2,7 @@ * This file is forked from the lodash project (https://lodash.com/), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ module.exports = require('./set'); diff --git a/packages/elastic-safer-lodash-set/fp/assocPath.d.ts b/packages/kbn-safer-lodash-set/fp/assocPath.d.ts similarity index 80% rename from packages/elastic-safer-lodash-set/fp/assocPath.d.ts rename to packages/kbn-safer-lodash-set/fp/assocPath.d.ts index 534128331f142..334c21ca7e707 100644 --- a/packages/elastic-safer-lodash-set/fp/assocPath.d.ts +++ b/packages/kbn-safer-lodash-set/fp/assocPath.d.ts @@ -2,7 +2,7 @@ * This file is forked from the DefinitelyTyped project (https://github.com/DefinitelyTyped/DefinitelyTyped), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ import { assocPath } from '.'; diff --git a/packages/elastic-safer-lodash-set/fp/assocPath.js b/packages/kbn-safer-lodash-set/fp/assocPath.js similarity index 76% rename from packages/elastic-safer-lodash-set/fp/assocPath.js rename to packages/kbn-safer-lodash-set/fp/assocPath.js index 851e11690ea35..d6ea0c9c74b77 100644 --- a/packages/elastic-safer-lodash-set/fp/assocPath.js +++ b/packages/kbn-safer-lodash-set/fp/assocPath.js @@ -2,7 +2,7 @@ * This file is forked from the lodash project (https://lodash.com/), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ module.exports = require('./set'); diff --git a/packages/elastic-safer-lodash-set/fp/index.d.ts b/packages/kbn-safer-lodash-set/fp/index.d.ts similarity index 99% rename from packages/elastic-safer-lodash-set/fp/index.d.ts rename to packages/kbn-safer-lodash-set/fp/index.d.ts index fcd7ff01e3cc8..777c7c0df980a 100644 --- a/packages/elastic-safer-lodash-set/fp/index.d.ts +++ b/packages/kbn-safer-lodash-set/fp/index.d.ts @@ -2,7 +2,7 @@ * This file is forked from the DefinitelyTyped project (https://github.com/DefinitelyTyped/DefinitelyTyped), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ import lodash = require('lodash'); diff --git a/packages/elastic-safer-lodash-set/fp/index.js b/packages/kbn-safer-lodash-set/fp/index.js similarity index 81% rename from packages/elastic-safer-lodash-set/fp/index.js rename to packages/kbn-safer-lodash-set/fp/index.js index 7d9cdb099dfd7..aea3e4600d7c6 100644 --- a/packages/elastic-safer-lodash-set/fp/index.js +++ b/packages/kbn-safer-lodash-set/fp/index.js @@ -2,7 +2,7 @@ * This file is forked from the lodash project (https://lodash.com/), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ exports.set = exports.assoc = exports.assocPath = require('./set'); diff --git a/packages/elastic-safer-lodash-set/fp/set.d.ts b/packages/kbn-safer-lodash-set/fp/set.d.ts similarity index 79% rename from packages/elastic-safer-lodash-set/fp/set.d.ts rename to packages/kbn-safer-lodash-set/fp/set.d.ts index b676d271e0556..3e5730bb1ec42 100644 --- a/packages/elastic-safer-lodash-set/fp/set.d.ts +++ b/packages/kbn-safer-lodash-set/fp/set.d.ts @@ -2,7 +2,7 @@ * This file is forked from the DefinitelyTyped project (https://github.com/DefinitelyTyped/DefinitelyTyped), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ import { set } from '.'; diff --git a/packages/elastic-safer-lodash-set/fp/set.js b/packages/kbn-safer-lodash-set/fp/set.js similarity index 84% rename from packages/elastic-safer-lodash-set/fp/set.js rename to packages/kbn-safer-lodash-set/fp/set.js index 0fb48694d736d..3a54fcacec959 100644 --- a/packages/elastic-safer-lodash-set/fp/set.js +++ b/packages/kbn-safer-lodash-set/fp/set.js @@ -2,7 +2,7 @@ * This file is forked from the lodash project (https://lodash.com/), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ /*eslint no-var:0 */ diff --git a/packages/elastic-safer-lodash-set/fp/setWith.d.ts b/packages/kbn-safer-lodash-set/fp/setWith.d.ts similarity index 80% rename from packages/elastic-safer-lodash-set/fp/setWith.d.ts rename to packages/kbn-safer-lodash-set/fp/setWith.d.ts index 812437adc165a..20eadd898fa52 100644 --- a/packages/elastic-safer-lodash-set/fp/setWith.d.ts +++ b/packages/kbn-safer-lodash-set/fp/setWith.d.ts @@ -2,7 +2,7 @@ * This file is forked from the DefinitelyTyped project (https://github.com/DefinitelyTyped/DefinitelyTyped), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ import { setWith } from '.'; diff --git a/packages/elastic-safer-lodash-set/fp/setWith.js b/packages/kbn-safer-lodash-set/fp/setWith.js similarity index 84% rename from packages/elastic-safer-lodash-set/fp/setWith.js rename to packages/kbn-safer-lodash-set/fp/setWith.js index e477d4b4bc7ba..9842e1ecf93b2 100644 --- a/packages/elastic-safer-lodash-set/fp/setWith.js +++ b/packages/kbn-safer-lodash-set/fp/setWith.js @@ -2,7 +2,7 @@ * This file is forked from the lodash project (https://lodash.com/), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ /*eslint no-var:0 */ diff --git a/packages/elastic-safer-lodash-set/index.d.ts b/packages/kbn-safer-lodash-set/index.d.ts similarity index 96% rename from packages/elastic-safer-lodash-set/index.d.ts rename to packages/kbn-safer-lodash-set/index.d.ts index aaff01f11a7af..198df549e0704 100644 --- a/packages/elastic-safer-lodash-set/index.d.ts +++ b/packages/kbn-safer-lodash-set/index.d.ts @@ -2,7 +2,7 @@ * This file is forked from the DefinitelyTyped project (https://github.com/DefinitelyTyped/DefinitelyTyped), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ export = SaferLodashSet; diff --git a/packages/elastic-safer-lodash-set/index.js b/packages/kbn-safer-lodash-set/index.js similarity index 80% rename from packages/elastic-safer-lodash-set/index.js rename to packages/kbn-safer-lodash-set/index.js index d9edb25476c12..9ed12a77aa163 100644 --- a/packages/elastic-safer-lodash-set/index.js +++ b/packages/kbn-safer-lodash-set/index.js @@ -2,7 +2,7 @@ * This file is forked from the lodash project (https://lodash.com/), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ exports.set = require('./lodash/set'); diff --git a/packages/elastic-safer-lodash-set/lodash/_baseSet.js b/packages/kbn-safer-lodash-set/lodash/_baseSet.js similarity index 96% rename from packages/elastic-safer-lodash-set/lodash/_baseSet.js rename to packages/kbn-safer-lodash-set/lodash/_baseSet.js index f2ac3351b5afa..be037ecc344b9 100644 --- a/packages/elastic-safer-lodash-set/lodash/_baseSet.js +++ b/packages/kbn-safer-lodash-set/lodash/_baseSet.js @@ -2,7 +2,7 @@ * This file is forked from the lodash project (https://lodash.com/), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ /* eslint-disable one-var,prettier/prettier,no-var,eqeqeq,no-nested-ternary */ diff --git a/packages/elastic-safer-lodash-set/lodash/set.js b/packages/kbn-safer-lodash-set/lodash/set.js similarity index 94% rename from packages/elastic-safer-lodash-set/lodash/set.js rename to packages/kbn-safer-lodash-set/lodash/set.js index e911e853d64fb..aacd1edf0f50f 100644 --- a/packages/elastic-safer-lodash-set/lodash/set.js +++ b/packages/kbn-safer-lodash-set/lodash/set.js @@ -2,7 +2,7 @@ * This file is forked from the lodash project (https://lodash.com/), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ /* eslint-disable no-var */ diff --git a/packages/elastic-safer-lodash-set/lodash/setWith.js b/packages/kbn-safer-lodash-set/lodash/setWith.js similarity index 94% rename from packages/elastic-safer-lodash-set/lodash/setWith.js rename to packages/kbn-safer-lodash-set/lodash/setWith.js index 0295c9ae137d6..2bfd9dd354fde 100644 --- a/packages/elastic-safer-lodash-set/lodash/setWith.js +++ b/packages/kbn-safer-lodash-set/lodash/setWith.js @@ -2,7 +2,7 @@ * This file is forked from the lodash project (https://lodash.com/), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ /* eslint-disable no-var,eqeqeq */ diff --git a/packages/elastic-safer-lodash-set/package.json b/packages/kbn-safer-lodash-set/package.json similarity index 83% rename from packages/elastic-safer-lodash-set/package.json rename to packages/kbn-safer-lodash-set/package.json index 72b908911000d..f850b5fe0fc48 100644 --- a/packages/elastic-safer-lodash-set/package.json +++ b/packages/kbn-safer-lodash-set/package.json @@ -1,11 +1,11 @@ { - "name": "@elastic/safer-lodash-set", + "name": "@kbn/safer-lodash-set", "version": "0.0.0", "description": "A safer version of the lodash set and setWith functions", "main": "index.js", "types": "index.d.ts", "scripts": { - "lint": "../../node_modules/.bin/dependency-check --missing ../../package.json ./packages/elastic-safer-lodash-set/set.js ./packages/elastic-safer-lodash-set/setWith.js ./packages/elastic-safer-lodash-set/fp/*.js", + "lint": "../../node_modules/.bin/dependency-check --missing ../../package.json ./packages/kbn-safer-lodash-set/set.js ./packages/kbn-safer-lodash-set/setWith.js ./packages/kbn-safer-lodash-set/fp/*.js", "test": "npm run lint && ../../node_modules/.bin/tape test/*.js && npm run test:types", "test:types": "../../node_modules/.bin/tsc --noEmit", "update": "./scripts/update.sh", diff --git a/packages/elastic-safer-lodash-set/scripts/_get_lodash.sh b/packages/kbn-safer-lodash-set/scripts/_get_lodash.sh similarity index 82% rename from packages/elastic-safer-lodash-set/scripts/_get_lodash.sh rename to packages/kbn-safer-lodash-set/scripts/_get_lodash.sh index 50d3edaf34717..7fd3a056cf1f9 100755 --- a/packages/elastic-safer-lodash-set/scripts/_get_lodash.sh +++ b/packages/kbn-safer-lodash-set/scripts/_get_lodash.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Elasticsearch B.V licenses this file to you under the MIT License. -# See `packages/elastic-safer-lodash-set/LICENSE` for more information. +# See `packages/kbn-safer-lodash-set/LICENSE` for more information. clean_up () { exit_code=$? diff --git a/packages/elastic-safer-lodash-set/scripts/license-header.txt b/packages/kbn-safer-lodash-set/scripts/license-header.txt similarity index 74% rename from packages/elastic-safer-lodash-set/scripts/license-header.txt rename to packages/kbn-safer-lodash-set/scripts/license-header.txt index 4d0aedf74bb0f..e546841be3a2b 100644 --- a/packages/elastic-safer-lodash-set/scripts/license-header.txt +++ b/packages/kbn-safer-lodash-set/scripts/license-header.txt @@ -2,6 +2,6 @@ * This file is forked from the lodash project (https://lodash.com/), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ diff --git a/packages/elastic-safer-lodash-set/scripts/patches/_baseSet.js.patch b/packages/kbn-safer-lodash-set/scripts/patches/_baseSet.js.patch similarity index 93% rename from packages/elastic-safer-lodash-set/scripts/patches/_baseSet.js.patch rename to packages/kbn-safer-lodash-set/scripts/patches/_baseSet.js.patch index c7cf2041355d0..9a1ed2892d0d7 100644 --- a/packages/elastic-safer-lodash-set/scripts/patches/_baseSet.js.patch +++ b/packages/kbn-safer-lodash-set/scripts/patches/_baseSet.js.patch @@ -9,7 +9,7 @@ > * This file is forked from the lodash project (https://lodash.com/), > * and may include modifications made by Elasticsearch B.V. > * Elasticsearch B.V. licenses this file to you under the MIT License. -> * See `packages/elastic-safer-lodash-set/LICENSE` for more information. +> * See `packages/kbn-safer-lodash-set/LICENSE` for more information. > */ > > /* eslint-disable */ diff --git a/packages/elastic-safer-lodash-set/scripts/save_state.sh b/packages/kbn-safer-lodash-set/scripts/save_state.sh similarity index 84% rename from packages/elastic-safer-lodash-set/scripts/save_state.sh rename to packages/kbn-safer-lodash-set/scripts/save_state.sh index ead99c3d1de48..72bca0288f506 100755 --- a/packages/elastic-safer-lodash-set/scripts/save_state.sh +++ b/packages/kbn-safer-lodash-set/scripts/save_state.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Elasticsearch B.V licenses this file to you under the MIT License. -# See `packages/elastic-safer-lodash-set/LICENSE` for more information. +# See `packages/kbn-safer-lodash-set/LICENSE` for more information. set -e diff --git a/packages/elastic-safer-lodash-set/scripts/update.sh b/packages/kbn-safer-lodash-set/scripts/update.sh similarity index 94% rename from packages/elastic-safer-lodash-set/scripts/update.sh rename to packages/kbn-safer-lodash-set/scripts/update.sh index 58fd89eb43e33..e16b03edbe13b 100755 --- a/packages/elastic-safer-lodash-set/scripts/update.sh +++ b/packages/kbn-safer-lodash-set/scripts/update.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Elasticsearch B.V licenses this file to you under the MIT License. -# See `packages/elastic-safer-lodash-set/LICENSE` for more information. +# See `packages/kbn-safer-lodash-set/LICENSE` for more information. set -e diff --git a/packages/elastic-safer-lodash-set/set.d.ts b/packages/kbn-safer-lodash-set/set.d.ts similarity index 79% rename from packages/elastic-safer-lodash-set/set.d.ts rename to packages/kbn-safer-lodash-set/set.d.ts index b676d271e0556..3e5730bb1ec42 100644 --- a/packages/elastic-safer-lodash-set/set.d.ts +++ b/packages/kbn-safer-lodash-set/set.d.ts @@ -2,7 +2,7 @@ * This file is forked from the DefinitelyTyped project (https://github.com/DefinitelyTyped/DefinitelyTyped), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ import { set } from '.'; diff --git a/packages/elastic-safer-lodash-set/set.js b/packages/kbn-safer-lodash-set/set.js similarity index 77% rename from packages/elastic-safer-lodash-set/set.js rename to packages/kbn-safer-lodash-set/set.js index 6977062908549..a02607a433efb 100644 --- a/packages/elastic-safer-lodash-set/set.js +++ b/packages/kbn-safer-lodash-set/set.js @@ -2,7 +2,7 @@ * This file is forked from the lodash project (https://lodash.com/), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ module.exports = require('./lodash/set'); diff --git a/packages/elastic-safer-lodash-set/setWith.d.ts b/packages/kbn-safer-lodash-set/setWith.d.ts similarity index 80% rename from packages/elastic-safer-lodash-set/setWith.d.ts rename to packages/kbn-safer-lodash-set/setWith.d.ts index 812437adc165a..20eadd898fa52 100644 --- a/packages/elastic-safer-lodash-set/setWith.d.ts +++ b/packages/kbn-safer-lodash-set/setWith.d.ts @@ -2,7 +2,7 @@ * This file is forked from the DefinitelyTyped project (https://github.com/DefinitelyTyped/DefinitelyTyped), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ import { setWith } from '.'; diff --git a/packages/elastic-safer-lodash-set/setWith.js b/packages/kbn-safer-lodash-set/setWith.js similarity index 77% rename from packages/elastic-safer-lodash-set/setWith.js rename to packages/kbn-safer-lodash-set/setWith.js index aafa8a4db4be6..c957b03e349e0 100644 --- a/packages/elastic-safer-lodash-set/setWith.js +++ b/packages/kbn-safer-lodash-set/setWith.js @@ -2,7 +2,7 @@ * This file is forked from the lodash project (https://lodash.com/), * and may include modifications made by Elasticsearch B.V. * Elasticsearch B.V. licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ module.exports = require('./lodash/setWith'); diff --git a/packages/elastic-safer-lodash-set/test/fp.ts b/packages/kbn-safer-lodash-set/test/fp.ts similarity index 98% rename from packages/elastic-safer-lodash-set/test/fp.ts rename to packages/kbn-safer-lodash-set/test/fp.ts index 7a1d6601b5e26..79fda77cbd148 100644 --- a/packages/elastic-safer-lodash-set/test/fp.ts +++ b/packages/kbn-safer-lodash-set/test/fp.ts @@ -1,6 +1,6 @@ /* * Elasticsearch B.V licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ import { expectType } from 'tsd'; diff --git a/packages/elastic-safer-lodash-set/test/fp_assoc.ts b/packages/kbn-safer-lodash-set/test/fp_assoc.ts similarity index 92% rename from packages/elastic-safer-lodash-set/test/fp_assoc.ts rename to packages/kbn-safer-lodash-set/test/fp_assoc.ts index 8244458cd1180..edc57bc29e8e6 100644 --- a/packages/elastic-safer-lodash-set/test/fp_assoc.ts +++ b/packages/kbn-safer-lodash-set/test/fp_assoc.ts @@ -1,6 +1,6 @@ /* * Elasticsearch B.V licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ import { expectType } from 'tsd'; diff --git a/packages/elastic-safer-lodash-set/test/fp_assocPath.ts b/packages/kbn-safer-lodash-set/test/fp_assocPath.ts similarity index 93% rename from packages/elastic-safer-lodash-set/test/fp_assocPath.ts rename to packages/kbn-safer-lodash-set/test/fp_assocPath.ts index abbfa57eeb963..1dfb667fd6611 100644 --- a/packages/elastic-safer-lodash-set/test/fp_assocPath.ts +++ b/packages/kbn-safer-lodash-set/test/fp_assocPath.ts @@ -1,6 +1,6 @@ /* * Elasticsearch B.V licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ import { expectType } from 'tsd'; diff --git a/packages/elastic-safer-lodash-set/test/fp_patch_test.js b/packages/kbn-safer-lodash-set/test/fp_patch_test.js similarity index 99% rename from packages/elastic-safer-lodash-set/test/fp_patch_test.js rename to packages/kbn-safer-lodash-set/test/fp_patch_test.js index 362ecf6f9d866..a7a900bd7601f 100644 --- a/packages/elastic-safer-lodash-set/test/fp_patch_test.js +++ b/packages/kbn-safer-lodash-set/test/fp_patch_test.js @@ -1,6 +1,6 @@ /* * Elasticsearch B.V licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ const test = require('tape'); diff --git a/packages/elastic-safer-lodash-set/test/fp_set.ts b/packages/kbn-safer-lodash-set/test/fp_set.ts similarity index 92% rename from packages/elastic-safer-lodash-set/test/fp_set.ts rename to packages/kbn-safer-lodash-set/test/fp_set.ts index a5dbb24d33a05..b530314b561d9 100644 --- a/packages/elastic-safer-lodash-set/test/fp_set.ts +++ b/packages/kbn-safer-lodash-set/test/fp_set.ts @@ -1,6 +1,6 @@ /* * Elasticsearch B.V licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ import { expectType } from 'tsd'; diff --git a/packages/elastic-safer-lodash-set/test/fp_setWith.ts b/packages/kbn-safer-lodash-set/test/fp_setWith.ts similarity index 96% rename from packages/elastic-safer-lodash-set/test/fp_setWith.ts rename to packages/kbn-safer-lodash-set/test/fp_setWith.ts index 70a5197f72176..c86c9267e07ec 100644 --- a/packages/elastic-safer-lodash-set/test/fp_setWith.ts +++ b/packages/kbn-safer-lodash-set/test/fp_setWith.ts @@ -1,6 +1,6 @@ /* * Elasticsearch B.V licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ import { expectType } from 'tsd'; diff --git a/packages/elastic-safer-lodash-set/test/index.ts b/packages/kbn-safer-lodash-set/test/index.ts similarity index 92% rename from packages/elastic-safer-lodash-set/test/index.ts rename to packages/kbn-safer-lodash-set/test/index.ts index 2090c1adcfce1..cbaefb250598c 100644 --- a/packages/elastic-safer-lodash-set/test/index.ts +++ b/packages/kbn-safer-lodash-set/test/index.ts @@ -1,6 +1,6 @@ /* * Elasticsearch B.V licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ import { expectType } from 'tsd'; diff --git a/packages/elastic-safer-lodash-set/test/patch_test.js b/packages/kbn-safer-lodash-set/test/patch_test.js similarity index 98% rename from packages/elastic-safer-lodash-set/test/patch_test.js rename to packages/kbn-safer-lodash-set/test/patch_test.js index 80a44eb0c5b6b..f83cbe1e40b85 100644 --- a/packages/elastic-safer-lodash-set/test/patch_test.js +++ b/packages/kbn-safer-lodash-set/test/patch_test.js @@ -1,6 +1,6 @@ /* * Elasticsearch B.V licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ const test = require('tape'); diff --git a/packages/elastic-safer-lodash-set/test/set.ts b/packages/kbn-safer-lodash-set/test/set.ts similarity index 84% rename from packages/elastic-safer-lodash-set/test/set.ts rename to packages/kbn-safer-lodash-set/test/set.ts index 9829ac3f04ce5..b07bc407d6a8c 100644 --- a/packages/elastic-safer-lodash-set/test/set.ts +++ b/packages/kbn-safer-lodash-set/test/set.ts @@ -1,6 +1,6 @@ /* * Elasticsearch B.V licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ import { expectType } from 'tsd'; diff --git a/packages/elastic-safer-lodash-set/test/setWith.ts b/packages/kbn-safer-lodash-set/test/setWith.ts similarity index 91% rename from packages/elastic-safer-lodash-set/test/setWith.ts rename to packages/kbn-safer-lodash-set/test/setWith.ts index b3ed93443c4fb..c61aa2d8ec2b1 100644 --- a/packages/elastic-safer-lodash-set/test/setWith.ts +++ b/packages/kbn-safer-lodash-set/test/setWith.ts @@ -1,6 +1,6 @@ /* * Elasticsearch B.V licenses this file to you under the MIT License. - * See `packages/elastic-safer-lodash-set/LICENSE` for more information. + * See `packages/kbn-safer-lodash-set/LICENSE` for more information. */ import { expectType } from 'tsd'; diff --git a/packages/elastic-safer-lodash-set/tsconfig.json b/packages/kbn-safer-lodash-set/tsconfig.json similarity index 100% rename from packages/elastic-safer-lodash-set/tsconfig.json rename to packages/kbn-safer-lodash-set/tsconfig.json diff --git a/packages/kbn-shared-ux-components/README.mdx b/packages/kbn-shared-ux-components/README.mdx deleted file mode 100644 index f4673a0804f31..0000000000000 --- a/packages/kbn-shared-ux-components/README.mdx +++ /dev/null @@ -1,10 +0,0 @@ ---- -id: kibSharedUXComponents -slug: /kibana-dev-docs/shared-ux/packages/kbn-shared-ux-components -title: Shared UX Components -description: -date: 2022-03-11 -tags: ['kibana', 'dev', 'sharedUX'] ---- - -> TODO diff --git a/packages/kbn-shared-ux-components/src/index.ts b/packages/kbn-shared-ux-components/src/index.ts deleted file mode 100644 index 9e11d9341fe59..0000000000000 --- a/packages/kbn-shared-ux-components/src/index.ts +++ /dev/null @@ -1,13 +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. - */ - -// TODO: clintandrewhall - NoDataPageProps is a temporary addition until it is split into its own package -export type { KibanaPageTemplateProps, NoDataPageProps } from './page_template'; - -// TODO: clintandrewhall - NoDataConfigPage is a temporary addition until it is split into its own package -export { KibanaPageTemplate, NoDataConfigPage } from './page_template'; diff --git a/packages/kbn-shared-ux-components/src/page_template/assets/kibana_template_no_data_config.png b/packages/kbn-shared-ux-components/src/page_template/assets/kibana_template_no_data_config.png deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/__snapshots__/no_data_config_page.test.tsx.snap b/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/__snapshots__/no_data_config_page.test.tsx.snap deleted file mode 100644 index 047f44e0d319c..0000000000000 --- a/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/__snapshots__/no_data_config_page.test.tsx.snap +++ /dev/null @@ -1,31 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`NoDataConfigPage renders 1`] = ` - - - -`; diff --git a/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_page.tsx b/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_page.tsx deleted file mode 100644 index 724570d4baccd..0000000000000 --- a/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_page.tsx +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import React, { useMemo, FunctionComponent } from 'react'; -import useObservable from 'react-use/lib/useObservable'; -import classNames from 'classnames'; - -import { EuiLink, EuiSpacer, EuiText, EuiTextColor } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n-react'; -import { KibanaSolutionAvatar } from '@kbn/shared-ux-avatar-solution'; - -import { useSharedUxServices } from '@kbn/shared-ux-services'; -import { NoDataCard, NoDataCardProvider } from '@kbn/shared-ux-card-no-data'; -import { NoDataPageProps } from './types'; - -export const NoDataPage: FunctionComponent = ({ - solution, - logo, - action, - docsLink, - pageTitle, - ...rest -}) => { - const services = useSharedUxServices(); - - // TODO: clintandrewhall - including the `NoDataCardProvider` here is a temporary solution - // to consumers using this context to populate the NoDataPage. This will likely be removed soon, - // when NoDataPage is moved to its own package. - const currentAppId = useObservable(services.application.currentAppId$); - const noDataCardServices = { - currentAppId, - addBasePath: services.http.addBasePath, - canAccessFleet: services.permissions.canAccessFleet, - navigateToUrl: services.application.navigateToUrl, - }; - - const actionKeys = Object.keys(action); - - const actionCard = useMemo(() => { - if (actionKeys.length !== 1) { - return null; - } - const actionKey = actionKeys[0]; - const key = - actionKey === 'elasticAgent' ? 'empty-page-agent-action' : `empty-page-${actionKey}-action`; - return ; - }, [action, actionKeys]); - - const title = - pageTitle || - i18n.translate('sharedUXComponents.noDataPage.welcomeTitle', { - defaultMessage: 'Welcome to Elastic {solution}!', - values: { solution }, - }); - - return ( -
- - - -

{title}

- -

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

-
-
- - {actionCard} -
- ); -}; diff --git a/packages/kbn-shared-ux-components/src/page_template/page_template.stories.tsx b/packages/kbn-shared-ux-components/src/page_template/page_template.stories.tsx deleted file mode 100644 index ae6be1297f018..0000000000000 --- a/packages/kbn-shared-ux-components/src/page_template/page_template.stories.tsx +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import React from 'react'; -import { EuiButton, EuiText } from '@elastic/eui'; -import { SolutionNavProps } from '@kbn/shared-ux-page-solution-nav'; - -import { KibanaPageTemplate } from './page_template'; -import mdx from './page_template.mdx'; -import { KibanaPageTemplateProps } from './types'; - -export default { - title: 'Page Template/Page Template', - description: - 'A thin wrapper around `EuiTemplate`. Takes care of styling, empty state and no data config', - parameters: { - docs: { - page: mdx, - }, - }, -}; - -type Params = Pick & { - canBeCollapsed: boolean; -}; - -const noDataConfig = { - solution: 'Kibana', - action: { - elasticAgent: {}, - }, - docsLink: 'http://wwww.docs.elastic.co', -}; - -const items: SolutionNavProps['items'] = [ - { - name: 'Ingest', - id: '1', - items: [ - { - name: 'Ingest Node Pipelines', - id: '1.1', - }, - { - name: 'Logstash Pipelines', - id: '1.2', - }, - { - name: 'Beats Central Management', - id: '1.3', - }, - ], - }, - { - name: 'Data', - id: '2', - items: [ - { - name: 'Index Management', - id: '2.1', - }, - { - name: 'Index Lifecycle Policies', - id: '2.2', - }, - { - name: 'Snapshot and Restore', - id: '2.3', - }, - ], - }, -]; - -const solutionNavBar = { - items, - logo: 'logoKibana', - name: 'Kibana', - action: { elasticAgent: {} }, -}; - -const content = ( - -

- Page Content goes here -

-
-); - -const header = { - iconType: 'logoKibana', - pageTitle: 'Kibana', - description: 'Welcome to Kibana!', - rightSideItems: [Add something, Do something], -}; - -export const WithNoDataConfig = () => { - return ; -}; - -export const WithNoDataConfigAndSolutionNav = () => { - return ; -}; - -export const PureComponent = (params: Params) => { - return ( - - {content} - - ); -}; - -PureComponent.argTypes = { - isEmptyState: { - control: 'boolean', - defaultValue: false, - }, - pageHeader: { - control: 'boolean', - defaultValue: true, - }, - solutionNav: { - control: 'boolean', - defaultValue: true, - }, - canBeCollapsed: { - control: 'boolean', - defaultValue: true, - }, -}; - -PureComponent.parameters = { - layout: 'fullscreen', -}; - -WithNoDataConfig.parameters = { - layout: 'fullscreen', -}; - -WithNoDataConfigAndSolutionNav.parameters = { - layout: 'fullscreen', -}; diff --git a/packages/kbn-shared-ux-services/README.mdx b/packages/kbn-shared-ux-services/README.mdx deleted file mode 100755 index 589aae4cc7ed2..0000000000000 --- a/packages/kbn-shared-ux-services/README.mdx +++ /dev/null @@ -1,203 +0,0 @@ ---- -id: kibSharedUXServices -slug: /kibana-dev-docs/shared-ux/packages/kbn-shared-ux-services -title: Shared UX Services -description: The `@kbn/shared-ux-services` package provides a thin service abstraction for components and solutions created by the Shared UX team. -date: 2022-03-11 -tags: ['kibana', 'dev', 'sharedUX'] ---- - -## About Shared UX Services - -This package contains a set of services that are used by Shared UX components and solutions. This package serves as a thin abstraction layer between Kibana dependencies and the components in Shared UX that use them. It also allows us to "swap out" different implementations of the interfaces for different environments, (e.g. Storybook, Jest, etc). This decouples the components from what could be complicated or heavily-dependent logic that is difficult to mock. - -## Implementations - -Several implementations of these interfaces exist: - -- `@kbn/shared-ux-services/src/services/stub`: A stub implementation free of dependencies, (and functionality). -- `@kbn/shared-ux-services/src/services/mock`: A Jest mock implementation used in `jest` tests. -- `@kbn/shared-ux-storybook/src/services/`: A Storybook implementation used in Storybook decorators and stories. -- `src/plugins/shared_ux/src/services/`: A Kibana implementation used in Kibana plugins. - -Other implementations could easily be written to support other environments. - -## Architecture - -Lots of components require access to the services provided by other plugins. When we identify a routine that relies on these dependencies, we can write a new method and add it to a namespace, (e.g. `platform`, `user`, etc). These namespaces become interfaces of simple methods stored in `@kbn/shared-ux-services`. From there, we can create implementations for each environment we support. - -Suppose we're creating a new service, `SharedUxFooService`: - -```ts -interface SharedUxFooService { - getFoo(): string; - setBar(bar: string): void; - isBaz(): boolean; -} -``` - -Once defined, we create factories to create those services. - -### Creating a `ServiceFactory` - -A `ServiceFactory` is a simple type that describes 1/ what service is being created, and 2/ what parameters are required to create that service for a given environment. - -### Stub and Mock Factories - -Given the service definition above, we can create a `ServiceFactory` for a stubbed service that gives the bare minimum of functionality: - -```ts -/** - * A factory function for creating a stubbed implementation of `SharedUxFooService`. - */ -export type FooServiceFactory = ServiceFactory; - -/** - * A factory function for creating a stubbed implementation of `SharedUxFooService`. - */ -export const fooServiceFactory: FooServiceFactory = () => ({ - getFoo: () => 'foo', - setBar: () => {}, - isBaz: () => false, -}); -``` - -We can also create a mock for Jest: - -```ts -/** - * A factory function for creating a mock implementation of `SharedUxFooService`. - */ -export type FooServiceFactory = ServiceFactory; - -/** - * A factory function for creating a stubbed implementation of `SharedUxFooService`. - */ -export const fooServiceFactory: FooServiceFactory = () => ({ - getFoo: () => jest.fn(), - setBar: () => jest.fn(), - isBaz: () => jest.fn(), -}); -``` - -### Storybook Factories - -Storybook is where we can begin to take advantage of `Parameters` for a given service. Since stories can use controls to provide parameters, we can create a `ServiceFactory` that uses the `Parameters` generic and returns a `SharedUxFooService` that uses their values. - -```ts -import { action } from '@storybook/addon-actions'; - -interface FooServiceStorybookParameters { - foo: string; - baz: boolean; -} - -/** - * A factory function for creating a Storybook implementation of `SharedUxFooService`. - */ -export type FooServiceFactory = ServiceFactory; - -/** - * A factory function for creating a stubbed implementation of `SharedUxFooService`. - */ -export const fooServiceFactory: FooServiceFactory = ({ foo, baz }) => ({ - getFoo: () => foo, - setBar: () => action('setBar'), - isBaz: () => baz, -}); -``` - -A story can then optionally provide values for those parameters as part of its controls. - -```ts -type Params = Pick; - -export const ComponentStory = ({ foo }: Params) => { - const service = fooServiceFactory({ foo, baz: false }); - - return ( - ; -}; - -PureComponent.argTypes = { - foo: { - options: ['alpha', 'beta', 'gamma', 'delta'], - control: { type: 'radio' }, - }, -}; -``` - -### Kibana Factories - -Using these services in Kibana is a bit more complex, but is still relatively simple. First, we define what dependencies we'll need, (we use this interface in `src/plugins/shared_ux` as it relies on types found only in plugins, where packages cannot use them): - -```ts -/** - * Parameters necessary to create a Kibana-based service, (e.g. during Plugin - * startup or setup). - * - * The `Start` generic refers to the specific Plugin `TPluginsStart`. - */ -export interface KibanaPluginServiceParams { - coreStart: CoreStart; - startPlugins: Start; - appUpdater?: BehaviorSubject; - initContext?: PluginInitializerContext; -} - -/** - * A factory function for creating a Kibana-based service. - * - * The `Service` generic determines the shape of the Service being produced. - * The `Start` generic refers to the specific Plugin `TPluginsStart`. - */ -export type KibanaPluginServiceFactory = ( - params: KibanaPluginServiceParams -) => Service; -``` - -From there, a plugin might have a collection of dependencies on core or other plugins: - -```ts -export interface MyPluginStartDeps { - bar: BarPluginStart; - baz: BazPluginStart; -} -``` - -We'd then use this dependency interface to create a `ServiceFactory` for our service in Kibana: - -```ts -export type FooServiceFactory = KibanaPluginServiceFactory< - SharedUxFooService, - MyPluginStartDeps ->; - -/** - * A factory function for creating a Kibana-based implementation of `SharedUxFooService`. - */ -export const fooServiceFactory: FooServiceFactory = ({ coreStart, startPlugins }) => ({ - getFoo: startPlugins.bar.getSomeOtherFoo, - setBar: startPlugins.baz.setHappyPathBar, - isBaz: () => { - return coreStart.uiSettings.get('someSetting') === 'expectedValue'; - } -}); -``` - -From there, the pattern is the same: invoke the service factory with the required dependencies and provide them to the `SharedUxServicesContext` Provider: - -```ts - -// plugin.tsx -public start(coreStart: CoreStart, startPlugins: SharedUXPluginStartDeps): SharedUXPluginStart { - const fooService = fooServiceFactory({ coreStart, startPlugins }); - const Context = {children}; - - // ...wrap React content with the context.. -} -``` - -## Use in Kibana plugins - -In order to make consumption of these services easy by Kibana plugins, `src/plugins/shared_ux` provides a pre-wired set of services as part of the `start` lifecycle. Plugins can simply make `sharedUX` a dependency, import `SharedUxServicesProvider` and wrap their solution root (or any component). See the documentation for `sharedUX` for more details. diff --git a/packages/kbn-shared-ux-services/src/context.tsx b/packages/kbn-shared-ux-services/src/context.tsx deleted file mode 100644 index 6131c23e27370..0000000000000 --- a/packages/kbn-shared-ux-services/src/context.tsx +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import React, { FC, createContext, useContext } from 'react'; - -import type { SharedUxServices } from './types'; - -// The React Context used to provide the services to the SharedUX components. -const SharedUxServicesContext = createContext(null); - -/** - * The `React.Context` Provider component for the `SharedUxServices` context. Any - * plugin or environment that consumes SharedUX components needs to wrap their React - * tree with this provider. - * - * Within a plugin, you can use use the Shared UX plugin and retrieve a fully-configured - * context from the `start` contract. - */ -export const SharedUxServicesProvider: FC = ({ children, ...services }) => ( - {children} -); - -/** - * React hook for accessing pre-wired `SharedUxServices`. - */ -export function useSharedUxServices() { - const context = useContext(SharedUxServicesContext); - - if (!context) { - throw new Error( - 'SharedUxServicesContext missing. Ensure your component or React root is wrapped with SharedUxServicesProvider.' - ); - } - - return context; -} - -/** - * React hook for accessing the pre-wired `SharedUxPlatformService`. - */ -export const usePlatformService = () => useSharedUxServices().platform; - -/** - * React hook for accessing the pre-wired `SharedUxPermissionsService`. - */ -export const usePermissions = () => useSharedUxServices().permissions; - -/** - * React hook for accessing the pre-wired `SharedUxEditorsService`. - */ -export const useEditors = () => useSharedUxServices().editors; - -/** - * React hook for accessing the pre-wired `SharedUxDocLinksService`. - */ -export const useDocLinks = () => useSharedUxServices().docLinks; - -export const useHttp = () => useSharedUxServices().http; - -export const useApplication = () => useSharedUxServices().application; - -/** - * React hook for accessing the pre-wired `SharedUxDataService`. - */ -export const useData = () => useSharedUxServices().data; diff --git a/packages/kbn-shared-ux-services/src/index.ts b/packages/kbn-shared-ux-services/src/index.ts deleted file mode 100755 index 47f9d61ff88ac..0000000000000 --- a/packages/kbn-shared-ux-services/src/index.ts +++ /dev/null @@ -1,38 +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. - */ - -export type { ServiceFactory, SharedUxServices, SharedUxServicesContext } from './types'; -export type { - MockServicesFactoryParams, - SharedUxApplicationService, - SharedUxDocLinksService, - SharedUxEditorsService, - SharedUxHttpService, - SharedUxPlatformService, - SharedUxUserPermissionsService, - SharedUxDataService, -} from './services'; - -export { - SharedUxServicesProvider, - useApplication, - useDocLinks, - useEditors, - useHttp, - usePermissions, - usePlatformService, - useData, - useSharedUxServices, -} from './context'; - -export { - mockServiceFactories, - mockServicesFactory, - stubServiceFactories, - stubServicesFactory, -} from './services'; diff --git a/packages/kbn-shared-ux-services/src/services/application.ts b/packages/kbn-shared-ux-services/src/services/application.ts deleted file mode 100644 index 89a7fa91fadc5..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/application.ts +++ /dev/null @@ -1,14 +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 { Observable } from 'rxjs'; - -export interface SharedUxApplicationService { - navigateToUrl: (url: string) => Promise | void; - currentAppId$: Observable; -} diff --git a/packages/kbn-shared-ux-services/src/services/data.ts b/packages/kbn-shared-ux-services/src/services/data.ts deleted file mode 100644 index 2750c9bd32085..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/data.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 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. - */ - -/** - * A service providing data information. Typically used for handling of empty state.. - */ -export interface SharedUxDataService { - /** True if the cluster contains data, false otherwise. */ - hasESData: () => Promise; - /** True if Kibana instance contains user-created data view, false otherwise. */ - hasUserDataView: () => Promise; - /** True if Kibana instance contains any data view, including system-created ones. */ - hasDataView: () => Promise; -} diff --git a/packages/kbn-shared-ux-services/src/services/doc_links.ts b/packages/kbn-shared-ux-services/src/services/doc_links.ts deleted file mode 100644 index 3b8eb4748d76f..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/doc_links.ts +++ /dev/null @@ -1,15 +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. - */ - -/** - * A service providing links to documentation about various features in Kibana. - */ -export interface SharedUxDocLinksService { - /** A link to information about Data Views in Kibana */ - dataViewsDocLink: string; -} diff --git a/packages/kbn-shared-ux-services/src/services/editors.ts b/packages/kbn-shared-ux-services/src/services/editors.ts deleted file mode 100644 index 4dc5b7d9bc269..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/editors.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 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. - */ - -/** - * TODO: `DataView` is a class exported by `src/plugins/data_views/public`. Since this service - * is contained in this package-- and packages can only depend on other packages and never on - * plugins-- we have to set this to `unknown`. If and when `DataView` is exported from a - * stateless package, we can remove this. - * - * @see: https://github.com/elastic/kibana/issues/127695 - */ -type DataView = unknown; - -/** - * A subset of the `DataViewEditorOptions` interface relevant to our service and components. - * - * @see: src/plugins/data_view_editor/public/types.ts - */ -interface DataViewEditorOptions { - /** Handler to be invoked when the Data View Editor completes a save operation. */ - onSave: (dataView: DataView) => void; -} - -/** - * A service providing methods to invoke and interact with various editors provided - * in Kibana. - */ -export interface SharedUxEditorsService { - /** A method to open the Data View Editor flow. */ - openDataViewEditor: (options: DataViewEditorOptions) => () => void; -} diff --git a/packages/kbn-shared-ux-services/src/services/index.ts b/packages/kbn-shared-ux-services/src/services/index.ts deleted file mode 100644 index 0e4e4e473028d..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/index.ts +++ /dev/null @@ -1,21 +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. - */ - -export type { SharedUxApplicationService } from './application'; -export type { SharedUxDocLinksService } from './doc_links'; -export type { SharedUxEditorsService } from './editors'; -export type { SharedUxHttpService } from './http'; -export type { SharedUxUserPermissionsService } from './permissions'; -export type { SharedUxPlatformService } from './platform'; -export type { SharedUxDataService } from './data'; -export type { MockServicesFactoryParams } from './mock'; - -// eslint-disable-next-line @kbn/imports/no_boundary_crossing -export { mockServicesFactory, mockServiceFactories } from './mock'; -// eslint-disable-next-line @kbn/imports/no_boundary_crossing -export { stubServicesFactory, stubServiceFactories } from './stub'; diff --git a/packages/kbn-shared-ux-services/src/services/mock/application.mock.ts b/packages/kbn-shared-ux-services/src/services/mock/application.mock.ts deleted file mode 100644 index 947113c4a3168..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/mock/application.mock.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 { Observable } from 'rxjs'; -import { ServiceFactory } from '../../types'; -import { SharedUxApplicationService } from '../application'; - -export type MockApplicationServiceFactory = ServiceFactory; - -/** - * A factory function for creating a Jest-based implementation of `SharedUXApplicationService`. - */ -export const applicationServiceFactory: MockApplicationServiceFactory = () => ({ - navigateToUrl: () => Promise.resolve(), - currentAppId$: new Observable((subscriber) => { - subscriber.next('abc123'); - }), -}); diff --git a/packages/kbn-shared-ux-services/src/services/mock/data.mock.ts b/packages/kbn-shared-ux-services/src/services/mock/data.mock.ts deleted file mode 100644 index bb9d59643348d..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/mock/data.mock.ts +++ /dev/null @@ -1,32 +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 { ServiceFactory } from '../../types'; -import { SharedUxDataService } from '../data'; - -/** - * A factory function for creating a Jest-based implementation of `SharedUxDataService`. - */ -export type MockDataServiceFactory = ServiceFactory; - -export interface MockDataServiceFactoryConfig { - hasESData: boolean; - hasDataView: boolean; - hasUserDataView: boolean; -} - -/** - * A factory function for creating a Jest-based implementation of `SharedUxDataService`. - */ -export const dataServiceFactory: (config?: MockDataServiceFactoryConfig) => SharedUxDataService = ( - config?: MockDataServiceFactoryConfig -) => ({ - hasESData: () => Promise.resolve(config?.hasESData || false), - hasDataView: () => Promise.resolve(config?.hasDataView || false), - hasUserDataView: () => Promise.resolve(config?.hasUserDataView || false), -}); diff --git a/packages/kbn-shared-ux-services/src/services/mock/doc_links.mock.ts b/packages/kbn-shared-ux-services/src/services/mock/doc_links.mock.ts deleted file mode 100644 index 2ee0985d0a413..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/mock/doc_links.mock.ts +++ /dev/null @@ -1,22 +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 { ServiceFactory } from '../../types'; -import type { SharedUxDocLinksService } from '../doc_links'; - -/** - * A factory function for creating a Jest implementation of `SharedUxDocLinksService`. - */ -export type MockDocLinksServiceFactory = ServiceFactory; - -/** - * A factory function for creating a Jest-based implementation of `SharedUxDocLinksService`. - */ -export const docLinksServiceFactory: MockDocLinksServiceFactory = () => ({ - dataViewsDocLink: 'dummy link', -}); diff --git a/packages/kbn-shared-ux-services/src/services/mock/editors.mock.ts b/packages/kbn-shared-ux-services/src/services/mock/editors.mock.ts deleted file mode 100644 index 80742f15d93cd..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/mock/editors.mock.ts +++ /dev/null @@ -1,22 +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 { ServiceFactory } from '../../types'; -import type { SharedUxEditorsService } from '../editors'; - -/** - * A factory function for creating a Jest-based implementation of `SharedUxEditorsService`. - */ -export type MockEditorsServiceFactory = ServiceFactory; - -/** - * A factory function for creating a Jest-based implementation of `SharedUxEditorsService`. - */ -export const editorsServiceFactory: MockEditorsServiceFactory = () => ({ - openDataViewEditor: jest.fn(), -}); diff --git a/packages/kbn-shared-ux-services/src/services/mock/http.mock.ts b/packages/kbn-shared-ux-services/src/services/mock/http.mock.ts deleted file mode 100644 index 0ef07526e5116..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/mock/http.mock.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 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 { ServiceFactory } from '../../types'; -import { SharedUxHttpService } from '../http'; - -export type MockHttpServiceFactory = ServiceFactory; - -/** - * A factory function for creating a Jest-based implementation of `SharedUXHttpService`. - */ -export const httpServiceFactory: MockHttpServiceFactory = () => ({ - addBasePath: jest.fn((path: string) => (path ? path : 'path')), -}); diff --git a/packages/kbn-shared-ux-services/src/services/mock/index.ts b/packages/kbn-shared-ux-services/src/services/mock/index.ts deleted file mode 100644 index 604a8ae677b9d..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/mock/index.ts +++ /dev/null @@ -1,64 +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 { SharedUxServices } from '../../types'; - -import { applicationServiceFactory } from './application.mock'; -import { docLinksServiceFactory } from './doc_links.mock'; -import { editorsServiceFactory } from './editors.mock'; -import { httpServiceFactory } from './http.mock'; -import { userPermissionsServiceFactory } from './permissions.mock'; -import { platformServiceFactory } from './platform.mock'; -import { dataServiceFactory, MockDataServiceFactoryConfig } from './data.mock'; - -export type { MockApplicationServiceFactory } from './application.mock'; -export type { MockDocLinksServiceFactory } from './doc_links.mock'; -export type { MockEditorsServiceFactory } from './editors.mock'; -export type { MockHttpServiceFactory } from './http.mock'; -export type { MockUserPermissionsServiceFactory } from './permissions.mock'; -export type { MockPlatformServiceFactory } from './platform.mock'; - -export { applicationServiceFactory } from './application.mock'; -export { docLinksServiceFactory } from './doc_links.mock'; -export { editorsServiceFactory } from './editors.mock'; -export { httpServiceFactory } from './http.mock'; -export { userPermissionsServiceFactory } from './permissions.mock'; -export { platformServiceFactory } from './platform.mock'; -export { dataServiceFactory } from './data.mock'; - -export interface MockServicesFactoryParams { - config: MockDataServiceFactoryConfig; -} - -/** - * A factory function for creating a Jest-based implementation of `SharedUxServices`. - */ -export const mockServicesFactory: (params?: MockServicesFactoryParams) => SharedUxServices = ( - params?: MockServicesFactoryParams -) => ({ - application: applicationServiceFactory(), - docLinks: docLinksServiceFactory(), - editors: editorsServiceFactory(), - http: httpServiceFactory(), - permissions: userPermissionsServiceFactory(), - platform: platformServiceFactory(), - data: dataServiceFactory(params?.config), -}); - -/** - * A collection of mock Service Factories. - */ -export const mockServiceFactories = { - applicationServiceFactory, - docLinksServiceFactory, - editorsServiceFactory, - httpServiceFactory, - platformServiceFactory, - userPermissionsServiceFactory, - dataServiceFactory, -}; diff --git a/packages/kbn-shared-ux-services/src/services/mock/permissions.mock.ts b/packages/kbn-shared-ux-services/src/services/mock/permissions.mock.ts deleted file mode 100644 index 3fb5e78a5b839..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/mock/permissions.mock.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 type { ServiceFactory } from '../../types'; -import type { SharedUxUserPermissionsService } from '../permissions'; - -/** - * A factory function for creating a Jest-based implementation of `SharedUxUserPermissionsService`. - */ -export type MockUserPermissionsServiceFactory = ServiceFactory; - -/** - * A factory function for creating a Jest-based implementation of `SharedUxUserPermissionsService`. - */ -export const userPermissionsServiceFactory: MockUserPermissionsServiceFactory = () => ({ - canCreateNewDataView: true, - canAccessFleet: true, -}); diff --git a/packages/kbn-shared-ux-services/src/services/mock/platform.mock.ts b/packages/kbn-shared-ux-services/src/services/mock/platform.mock.ts deleted file mode 100644 index 8e6ec205d2856..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/mock/platform.mock.ts +++ /dev/null @@ -1,22 +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 { ServiceFactory } from '../../types'; -import type { SharedUxPlatformService } from '../platform'; - -/** - * A factory function for creating a Jest-based implementation of `SharedUxPlatformService`. - */ -export type MockPlatformServiceFactory = ServiceFactory; - -/** - * A factory function for creating a Jest-based implementation of `SharedUxPlatformService`. - */ -export const platformServiceFactory: MockPlatformServiceFactory = () => ({ - setIsFullscreen: jest.fn(), -}); diff --git a/packages/kbn-shared-ux-services/src/services/permissions.ts b/packages/kbn-shared-ux-services/src/services/permissions.ts deleted file mode 100644 index d6fcabd8ccedf..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/permissions.ts +++ /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. - */ - -/** - * A service providing permissions information, typically for the current user. - */ -export interface SharedUxUserPermissionsService { - /** True if the user has permission to create a new Data View, false otherwise. */ - canCreateNewDataView: boolean; - canAccessFleet: boolean; -} diff --git a/packages/kbn-shared-ux-services/src/services/platform.ts b/packages/kbn-shared-ux-services/src/services/platform.ts deleted file mode 100644 index 83148abac8643..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/platform.ts +++ /dev/null @@ -1,24 +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. - */ - -/** - * A service providing methods to interact with the platform in which this code is - * running, (almost always Kibana). - * - * Rather than provide the entire `CoreStart` contract to components, we provide simplified - * abstractions around a use case specific to Shared UX. This way, we know exactly how the - * `CoreStart` and other plugins are used. This makes mocking and refactoring easier when - * upstream dependencies change. - */ -export interface SharedUxPlatformService { - /** - * Sets the fullscreen state of the chrome. - * @param isFullscreen True if the chrome should be fullscreen, false otherwise. - */ - setIsFullscreen: (isFullscreen: boolean) => void; -} diff --git a/packages/kbn-shared-ux-services/src/services/stub/application.ts b/packages/kbn-shared-ux-services/src/services/stub/application.ts deleted file mode 100644 index 72c1f3db30089..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/stub/application.ts +++ /dev/null @@ -1,27 +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 { Observable } from 'rxjs'; -import { ServiceFactory } from '../../types'; -import { SharedUxApplicationService } from '../application'; - -export type ApplicationServiceFactory = ServiceFactory; - -/** - * A factory function for creating for creating a simple stubbed implementation of `SharedUXApplicationService`. - */ -export const applicationServiceFactory: ApplicationServiceFactory = () => ({ - navigateToUrl: (url) => { - // eslint-disable-next-line no-console - console.log(url); - return Promise.resolve(); - }, - currentAppId$: new Observable((subscriber) => { - subscriber.next('123'); - }), -}); diff --git a/packages/kbn-shared-ux-services/src/services/stub/data.ts b/packages/kbn-shared-ux-services/src/services/stub/data.ts deleted file mode 100644 index 833c64e1f9d8d..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/stub/data.ts +++ /dev/null @@ -1,24 +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 { ServiceFactory } from '../../types'; -import { SharedUxDataService } from '../data'; - -/** - * A factory function for creating a simple stubbed implementation of `SharedUxDataSevice`. - */ -export type DataServiceFactory = ServiceFactory; - -/** - * A factory function for creating a simple stubbed implementation of `SharedUxDataSevice`. - */ -export const dataServiceFactory: DataServiceFactory = () => ({ - hasESData: () => Promise.resolve(true), - hasDataView: () => Promise.resolve(false), - hasUserDataView: () => Promise.resolve(false), -}); diff --git a/packages/kbn-shared-ux-services/src/services/stub/doc_links.ts b/packages/kbn-shared-ux-services/src/services/stub/doc_links.ts deleted file mode 100644 index 9bcfd7db78cfa..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/stub/doc_links.ts +++ /dev/null @@ -1,22 +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 { ServiceFactory } from '../../types'; -import type { SharedUxDocLinksService } from '../doc_links'; - -/** - * A factory function for creating a stubbed implementation of `SharedUxDocLinksService`. - */ -export type DocLinksServiceFactory = ServiceFactory; - -/** - * A factory function for creating a stubbed implementation of `SharedUxDocLinksService`. - */ -export const docLinksServiceFactory: DocLinksServiceFactory = () => ({ - dataViewsDocLink: 'docs', -}); diff --git a/packages/kbn-shared-ux-services/src/services/stub/editors.ts b/packages/kbn-shared-ux-services/src/services/stub/editors.ts deleted file mode 100644 index 545539d873941..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/stub/editors.ts +++ /dev/null @@ -1,22 +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 { ServiceFactory } from '../../types'; -import type { SharedUxEditorsService } from '../editors'; - -/** - * A factory function for creating a simple stubbed implementation of `SharedUxEditorsService`. - */ -export type EditorsServiceFactory = ServiceFactory; - -/** - * A factory function for creating a simple stubbed implementation of `SharedUxEditorsService`. - */ -export const editorsServiceFactory: EditorsServiceFactory = () => ({ - openDataViewEditor: () => () => {}, -}); diff --git a/packages/kbn-shared-ux-services/src/services/stub/http.ts b/packages/kbn-shared-ux-services/src/services/stub/http.ts deleted file mode 100644 index 08dae62ecdb7f..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/stub/http.ts +++ /dev/null @@ -1,24 +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 { ServiceFactory } from '../../types'; -import { SharedUxHttpService } from '../http'; - -/** - * A factory function for creating a simple stubbed implementation of `SharedUXHttpService`. - */ -export type HttpServiceFactory = ServiceFactory; - -/** - * A factory function for creating a simple stubbed implementation of `SharedUXHttpService`. - */ -export const httpServiceFactory: HttpServiceFactory = () => ({ - addBasePath: (url: string) => { - return url; - }, -}); diff --git a/packages/kbn-shared-ux-services/src/services/stub/index.ts b/packages/kbn-shared-ux-services/src/services/stub/index.ts deleted file mode 100644 index ab8b0ca3f4d9c..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/stub/index.ts +++ /dev/null @@ -1,43 +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 { SharedUxServices, ServiceFactory } from '../../types'; - -import { applicationServiceFactory } from './application'; -import { docLinksServiceFactory } from './doc_links'; -import { editorsServiceFactory } from './editors'; -import { httpServiceFactory } from './http'; -import { platformServiceFactory } from './platform'; -import { userPermissionsServiceFactory } from './permissions'; -import { dataServiceFactory } from './data'; - -/** - * A factory function for creating simple stubbed implementations of all `SharedUxServices`. - */ -export const stubServicesFactory: ServiceFactory = () => ({ - application: applicationServiceFactory(), - docLinks: docLinksServiceFactory(), - editors: editorsServiceFactory(), - http: httpServiceFactory(), - permissions: userPermissionsServiceFactory(), - platform: platformServiceFactory(), - data: dataServiceFactory(), -}); - -/** - * A collection of stubbed service factories. - */ -export const stubServiceFactories = { - applicationServiceFactory, - docLinksServiceFactory, - editorsServiceFactory, - httpServiceFactory, - platformServiceFactory, - userPermissionsServiceFactory, - dataServiceFactory, -}; diff --git a/packages/kbn-shared-ux-services/src/services/stub/permissions.ts b/packages/kbn-shared-ux-services/src/services/stub/permissions.ts deleted file mode 100644 index e5588f818f82a..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/stub/permissions.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 type { ServiceFactory } from '../../types'; -import type { SharedUxUserPermissionsService } from '../permissions'; - -/** - * A factory function for creating a simple stubbed implementation of `SharedUxUserPermissionsService`. - */ -export type UserPermissionsServiceFactory = ServiceFactory; - -/** - * A factory function for creating a simple stubbed implementation of `SharedUxUserPermissionsService`. - */ -export const userPermissionsServiceFactory: UserPermissionsServiceFactory = () => ({ - canCreateNewDataView: true, - canAccessFleet: true, -}); diff --git a/packages/kbn-shared-ux-services/src/services/stub/platform.ts b/packages/kbn-shared-ux-services/src/services/stub/platform.ts deleted file mode 100644 index 2e31238347307..0000000000000 --- a/packages/kbn-shared-ux-services/src/services/stub/platform.ts +++ /dev/null @@ -1,22 +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 { ServiceFactory } from '../../types'; -import type { SharedUxPlatformService } from '../platform'; - -/** - * A factory function for creating a simple stubbed implementation of `SharedUxPlatformService`. - */ -export type PlatformServiceFactory = ServiceFactory; - -/** - * A factory function for creating a simple stubbed implementation of `SharedUxPlatformService`. - */ -export const platformServiceFactory: PlatformServiceFactory = () => ({ - setIsFullscreen: (_isFullscreen) => {}, -}); diff --git a/packages/kbn-shared-ux-services/src/types.ts b/packages/kbn-shared-ux-services/src/types.ts deleted file mode 100755 index a0a4ec32c0e75..0000000000000 --- a/packages/kbn-shared-ux-services/src/types.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { FC } from 'react'; - -import { - SharedUxApplicationService, - SharedUxDataService, - SharedUxDocLinksService, - SharedUxEditorsService, - SharedUxHttpService, - SharedUxPlatformService, - SharedUxUserPermissionsService, -} from './services'; - -/** - * A collection of services utilized by SharedUX. This serves as a thin - * abstraction layer between services provided by Kibana and other plugins - * while allowing this plugin to be developed independently of those contracts. - * - * It also allows us to "swap out" differenct implementations of these services - * for different environments, (e.g. Jest, Storybook, etc.) - */ -export interface SharedUxServices { - application: SharedUxApplicationService; - docLinks: SharedUxDocLinksService; - editors: SharedUxEditorsService; - http: SharedUxHttpService; - permissions: SharedUxUserPermissionsService; - platform: SharedUxPlatformService; - data: SharedUxDataService; -} - -/** - * A type representing a component that provides the `SharedUxServices` through a - * React Context. - */ -export type SharedUxServicesContext = FC<{}>; - -/** - * A factory function for creating one or more services. - * - * The `S` generic determines the shape of the API being produced. - * The `Parameters` generic determines what parameters are expected to - * create the service. - */ -export type ServiceFactory = (params: Parameters) => S; diff --git a/packages/kbn-shared-ux-storybook/README.mdx b/packages/kbn-shared-ux-storybook/README.mdx deleted file mode 100644 index 11992e336e627..0000000000000 --- a/packages/kbn-shared-ux-storybook/README.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -id: kibSharedUXStorybook -slug: /kibana-dev-docs/shared-ux/packages/kbn-shared-ux-storybook -title: Shared UX Storybook -description: The `@kbn/shared-ux-storybook` package provides Storybook assets for Shared UX and other teams. -date: 2022-03-11 -tags: ['kibana', 'dev', 'sharedUX'] ---- - -## About Shared UX Storybook - -This package provides the Storybook implementation of `@kbn/shared-ux-services` as well as the configuration for the Shared UX Storybook site. - -- `/src/services` The `@kbn/shared-ux-services` implementation. -- `src/config` The Storybook site configuration. - -## Storybook site - -Run `yarn storybook shared_ux` from `/kibana` to view the site. It pulls in `*.stories.tsx` from all Shared UX packages and plugins and combines them into a single configuration. - -## Decorator - -If you're writing stories for your own components that compose Shared UX components, you can use a pre-configured [Storybook Decorator](https://storybook.js.org/docs/react/writing-stories/decorators) in your Storybook configuration: - -```ts -// preview.ts - -import { addDecorator } from '@storybook/react'; -import { servicesDecorator } from '@kbn/shared-ux-storybook'; - -addDecorator(servicesDecorator); -``` - -This will not only expose parameters, but also wrap your story in a pre-wired `SharedUxServicesProvider`. \ No newline at end of file diff --git a/packages/kbn-shared-ux-storybook/src/decorators.tsx b/packages/kbn-shared-ux-storybook/src/decorators.tsx deleted file mode 100644 index cae87a15b54dd..0000000000000 --- a/packages/kbn-shared-ux-storybook/src/decorators.tsx +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import React from 'react'; -import { DecoratorFn } from '@storybook/react'; - -import { SharedUxServicesProvider } from '@kbn/shared-ux-services'; - -import { servicesFactory } from './services'; - -/** - * A Storybook decorator that provides the Shared UX `ServicesProvider` with Storybook-specific - * implementations to stories. - */ -export const servicesDecorator: DecoratorFn = (storyFn) => ( - {storyFn()} -); diff --git a/packages/kbn-shared-ux-storybook/src/services/application.ts b/packages/kbn-shared-ux-storybook/src/services/application.ts deleted file mode 100644 index 1b16526bc8be8..0000000000000 --- a/packages/kbn-shared-ux-storybook/src/services/application.ts +++ /dev/null @@ -1,24 +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 { BehaviorSubject } from 'rxjs'; -import { action } from '@storybook/addon-actions'; -import { ServiceFactory, SharedUxApplicationService } from '@kbn/shared-ux-services'; - -export type ApplicationServiceFactory = ServiceFactory; - -/** - * A factory function for creating for creating a storybook implementation of `SharedUXApplicationService`. - */ -export const applicationServiceFactory: ApplicationServiceFactory = () => ({ - navigateToUrl: (url) => { - action('navigateToUrl')(url); - return Promise.resolve(); - }, - currentAppId$: new BehaviorSubject('123'), -}); diff --git a/packages/kbn-shared-ux-storybook/src/services/data.ts b/packages/kbn-shared-ux-storybook/src/services/data.ts deleted file mode 100644 index dbfd2fceb4210..0000000000000 --- a/packages/kbn-shared-ux-storybook/src/services/data.ts +++ /dev/null @@ -1,34 +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 { ServiceFactory, SharedUxDataService } from '@kbn/shared-ux-services'; - -export interface DataServiceFactoryConfig { - hasESData: boolean; - hasDataView: boolean; - hasUserDataView: boolean; -} - -/** - * A factory function for creating a Storybook implementation of `SharedUxDataService`. - */ -export type SharedUxDataServiceFactory = ServiceFactory< - SharedUxDataService, - DataServiceFactoryConfig ->; - -/** - * A factory function for creating a Storybook implementation of `SharedUxDataService`. - */ -export const dataServiceFactory: SharedUxDataServiceFactory = (params) => { - return { - hasESData: () => Promise.resolve(params.hasESData || false), - hasDataView: () => Promise.resolve(params.hasDataView || false), - hasUserDataView: () => Promise.resolve(params.hasUserDataView || false), - }; -}; diff --git a/packages/kbn-shared-ux-storybook/src/services/doc_links.ts b/packages/kbn-shared-ux-storybook/src/services/doc_links.ts deleted file mode 100644 index eff942989956f..0000000000000 --- a/packages/kbn-shared-ux-storybook/src/services/doc_links.ts +++ /dev/null @@ -1,22 +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 { ServiceFactory, SharedUxDocLinksService } from '@kbn/shared-ux-services'; - -/** - * A factory function for creating a Storybook implementation of `SharedUxDocLinksService`. - */ -export type SharedUxDocLinksServiceFactory = ServiceFactory; - -/** - * A factory function for creating a Storybook implementation of `SharedUxDocLinksService`. - */ -export const docLinksServiceFactory: SharedUxDocLinksServiceFactory = () => ({ - dataViewsDocLink: 'https://www.elastic.co/guide/en/kibana/master/data-views.html', - kibanaGuideDocLink: 'https://www.elastic.co/guide/en/kibana/master/index.html', -}); diff --git a/packages/kbn-shared-ux-storybook/src/services/editors.ts b/packages/kbn-shared-ux-storybook/src/services/editors.ts deleted file mode 100644 index 69b9d7062da94..0000000000000 --- a/packages/kbn-shared-ux-storybook/src/services/editors.ts +++ /dev/null @@ -1,22 +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 { action } from '@storybook/addon-actions'; -import { ServiceFactory, SharedUxEditorsService } from '@kbn/shared-ux-services'; - -/** - * A factory function for creating a Storybook implementation of `SharedUxEditorsService`. - */ -export type SharedUxEditorsServiceFactory = ServiceFactory; - -/** - * A factory function for creating a Storybook implementation of `SharedUxEditorsService`. - */ -export const editorsServiceFactory: SharedUxEditorsServiceFactory = () => ({ - openDataViewEditor: action('openEditor') as SharedUxEditorsService['openDataViewEditor'], -}); diff --git a/packages/kbn-shared-ux-storybook/src/services/http.ts b/packages/kbn-shared-ux-storybook/src/services/http.ts deleted file mode 100644 index f44fb10566dc3..0000000000000 --- a/packages/kbn-shared-ux-storybook/src/services/http.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 { action } from '@storybook/addon-actions'; - -import { ServiceFactory, SharedUxHttpService } from '@kbn/shared-ux-services'; - -/** - * A factory function for creating a Storybook-based implementation of `SharedUXHttpService`. - */ -export type HttpServiceFactory = ServiceFactory; - -/** - * A factory function for creating a Storybook-based implementation of `SharedUXHttpService`. - */ -export const httpServiceFactory: HttpServiceFactory = () => ({ - addBasePath: action('addBasePath') as SharedUxHttpService['addBasePath'], -}); diff --git a/packages/kbn-shared-ux-storybook/src/services/index.ts b/packages/kbn-shared-ux-storybook/src/services/index.ts deleted file mode 100644 index ff6ad1f1f2913..0000000000000 --- a/packages/kbn-shared-ux-storybook/src/services/index.ts +++ /dev/null @@ -1,40 +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 { ServiceFactory, SharedUxServices } from '@kbn/shared-ux-services'; - -import { applicationServiceFactory } from './application'; -import { docLinksServiceFactory } from './doc_links'; -import { editorsServiceFactory } from './editors'; -import { httpServiceFactory } from './http'; -import { platformServiceFactory } from './platform'; -import { userPermissionsServiceFactory } from './permissions'; -import { dataServiceFactory, DataServiceFactoryConfig } from './data'; - -export { applicationServiceFactory } from './application'; -export { docLinksServiceFactory } from './doc_links'; -export { editorsServiceFactory } from './editors'; -export { httpServiceFactory } from './http'; -export { platformServiceFactory } from './platform'; -export { userPermissionsServiceFactory } from './permissions'; -export { dataServiceFactory } from './data'; - -/** - * A factory function for creating a Storybook implementation of `SharedUxServices`. - */ -export const servicesFactory: ServiceFactory = (params) => ({ - application: applicationServiceFactory(), - docLinks: docLinksServiceFactory(), - editors: editorsServiceFactory(), - http: httpServiceFactory(params), - permissions: userPermissionsServiceFactory(), - platform: platformServiceFactory(params), - data: dataServiceFactory(params as DataServiceFactoryConfig), -}); - -export type { DataServiceFactoryConfig } from './data'; diff --git a/packages/kbn-shared-ux-storybook/src/services/permissions.ts b/packages/kbn-shared-ux-storybook/src/services/permissions.ts deleted file mode 100644 index 5d00ac3ee1cb2..0000000000000 --- a/packages/kbn-shared-ux-storybook/src/services/permissions.ts +++ /dev/null @@ -1,22 +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 { ServiceFactory, SharedUxUserPermissionsService } from '@kbn/shared-ux-services'; - -/** - * A factory function for creating a Storybook implementation of `SharedUxUserPermissionsService`. - */ -export type SharedUxUserPermissionsServiceFactory = ServiceFactory; - -/** - * A factory function for creating a Storybook implementation of `SharedUxUserPermissionsService`. - */ -export const userPermissionsServiceFactory: SharedUxUserPermissionsServiceFactory = () => ({ - canCreateNewDataView: true, - canAccessFleet: true, -}); diff --git a/packages/kbn-shared-ux-storybook/src/services/platform.ts b/packages/kbn-shared-ux-storybook/src/services/platform.ts deleted file mode 100644 index 2a1cb6c3ff42b..0000000000000 --- a/packages/kbn-shared-ux-storybook/src/services/platform.ts +++ /dev/null @@ -1,22 +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 { action } from '@storybook/addon-actions'; -import { ServiceFactory, SharedUxPlatformService } from '@kbn/shared-ux-services'; - -/** - * A factory function for creating a Storybook implementation of `SharedUxPlatformService`. - */ -export type PlatformServiceFactory = ServiceFactory; - -/** - * A factory function for creating a Storybook implementation of `SharedUxPlatformService`. - */ -export const platformServiceFactory: PlatformServiceFactory = () => ({ - setIsFullscreen: action('setIsChromeVisible'), -}); diff --git a/packages/kbn-test/src/jest/setup/enzyme.js b/packages/kbn-test/src/jest/setup/enzyme.js index c0ebcb93fc4a2..bf759523cfe7a 100644 --- a/packages/kbn-test/src/jest/setup/enzyme.js +++ b/packages/kbn-test/src/jest/setup/enzyme.js @@ -7,6 +7,6 @@ */ import { configure } from 'enzyme'; -import Adapter from 'enzyme-adapter-react-16'; +import Adapter from '@wojtekmaj/enzyme-adapter-react-17'; configure({ adapter: new Adapter() }); diff --git a/packages/kbn-ui-shared-deps-src/BUILD.bazel b/packages/kbn-ui-shared-deps-src/BUILD.bazel index 18d50fdc05e63..db8d6c64fb6db 100644 --- a/packages/kbn-ui-shared-deps-src/BUILD.bazel +++ b/packages/kbn-ui-shared-deps-src/BUILD.bazel @@ -27,7 +27,7 @@ NPM_MODULE_EXTRA_FILES = [ ] RUNTIME_DEPS = [ - "//packages/elastic-safer-lodash-set", + "//packages/kbn-safer-lodash-set", "//packages/kbn-analytics", "//packages/kbn-babel-preset", "//packages/kbn-datemath", @@ -41,7 +41,7 @@ RUNTIME_DEPS = [ ] TYPES_DEPS = [ - "//packages/elastic-safer-lodash-set:npm_module_types", + "//packages/kbn-safer-lodash-set:npm_module_types", "//packages/kbn-analytics:npm_module_types", "//packages/kbn-datemath:npm_module_types", "//packages/kbn-i18n:npm_module_types", diff --git a/packages/kbn-ui-shared-deps-src/src/definitions.js b/packages/kbn-ui-shared-deps-src/src/definitions.js index 3e783d99b62cf..759b1bee856d2 100644 --- a/packages/kbn-ui-shared-deps-src/src/definitions.js +++ b/packages/kbn-ui-shared-deps-src/src/definitions.js @@ -75,7 +75,7 @@ const externals = { tslib: '__kbnSharedDeps__.TsLib', '@kbn/analytics': '__kbnSharedDeps__.KbnAnalytics', '@kbn/std': '__kbnSharedDeps__.KbnStd', - '@elastic/safer-lodash-set': '__kbnSharedDeps__.SaferLodashSet', + '@kbn/safer-lodash-set': '__kbnSharedDeps__.SaferLodashSet', 'rison-node': '__kbnSharedDeps__.RisonNode', history: '__kbnSharedDeps__.History', classnames: '__kbnSharedDeps__.Classnames', diff --git a/packages/kbn-ui-shared-deps-src/src/entry.js b/packages/kbn-ui-shared-deps-src/src/entry.js index 9114a472ba53e..233872bacff58 100644 --- a/packages/kbn-ui-shared-deps-src/src/entry.js +++ b/packages/kbn-ui-shared-deps-src/src/entry.js @@ -55,7 +55,7 @@ export const Fflate = { unzlibSync, strFromU8 }; export const TsLib = require('tslib'); export const KbnAnalytics = require('@kbn/analytics'); export const KbnStd = require('@kbn/std'); -export const SaferLodashSet = require('@elastic/safer-lodash-set'); +export const SaferLodashSet = require('@kbn/safer-lodash-set'); export const RisonNode = require('rison-node'); export const History = require('history'); export const Classnames = require('classnames'); diff --git a/packages/shared-ux/avatar/solution/src/solution_avatar.stories.tsx b/packages/shared-ux/avatar/solution/src/solution_avatar.stories.tsx index b47ff7c837f24..f7dca09fc8b1f 100644 --- a/packages/shared-ux/avatar/solution/src/solution_avatar.stories.tsx +++ b/packages/shared-ux/avatar/solution/src/solution_avatar.stories.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { KibanaSolutionAvatar, IconTypeProps, KnownSolutionProps } from './solution_avatar'; export default { - title: 'Solution Avatar', + title: 'Avatar/Solution', description: 'A wrapper around EuiAvatar, specifically to stylize Elastic Solutions', }; @@ -24,11 +24,11 @@ const argTypes = { type KnownSolutionParams = Pick; -export const SolutionAvatar = (params: KnownSolutionParams) => { +export const SolutionType = (params: KnownSolutionParams) => { return ; }; -SolutionAvatar.argTypes = { +SolutionType.argTypes = { name: { control: 'select', options: ['Cloud', 'Elastic', 'Kibana', 'Observability', 'Security', 'Enterprise Search'], @@ -39,11 +39,11 @@ SolutionAvatar.argTypes = { type IconTypeParams = Pick; -export const IconTypeAvatar = (params: IconTypeParams) => { +export const IconType = (params: IconTypeParams) => { return ; }; -IconTypeAvatar.argTypes = { +IconType.argTypes = { iconType: { control: 'select', options: [ diff --git a/packages/shared-ux/button/exit_full_screen/mocks/BUILD.bazel b/packages/shared-ux/button/exit_full_screen/mocks/BUILD.bazel index cd88ae0f1fe27..50a3e109546cd 100644 --- a/packages/shared-ux/button/exit_full_screen/mocks/BUILD.bazel +++ b/packages/shared-ux/button/exit_full_screen/mocks/BUILD.bazel @@ -10,8 +10,17 @@ SOURCE_FILES = glob( "src/**/*.ts", ], exclude = [ + "**/*.config.js", + "**/*.mock.*", "**/*.test.*", "**/*.stories.*", + "**/__snapshots__", + "**/integration_tests", + "**/mocks", + "**/scripts", + "**/storybook", + "**/test_fixtures", + "**/test_helpers", ], ) @@ -38,6 +47,7 @@ NPM_MODULE_EXTRA_FILES = [ # eg. "@npm//lodash" RUNTIME_DEPS = [ "@npm//@storybook/addon-actions", + "@npm//react", "//packages/shared-ux/storybook/mock", ] @@ -53,6 +63,7 @@ RUNTIME_DEPS = [ TYPES_DEPS = [ "@npm//@types/node", "@npm//@types/jest", + "@npm//@types/react", "@npm//@storybook/addon-actions", "//packages/shared-ux/button/exit_full_screen/types:npm_module_types", "//packages/shared-ux/storybook/mock:npm_module_types", @@ -65,6 +76,14 @@ jsts_transpiler( root_input_dir = "src", ) +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", + web = True, +) + ts_config( name = "tsconfig", src = "tsconfig.json", @@ -90,7 +109,7 @@ ts_project( js_library( name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], + deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/button/exit_full_screen/mocks/package.json b/packages/shared-ux/button/exit_full_screen/mocks/package.json index 490d136049e1a..1ce5731e7bee3 100644 --- a/packages/shared-ux/button/exit_full_screen/mocks/package.json +++ b/packages/shared-ux/button/exit_full_screen/mocks/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", + "browser": "./target_web/index.js", "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/shared-ux/button/exit_full_screen/mocks/tsconfig.json b/packages/shared-ux/button/exit_full_screen/mocks/tsconfig.json index 894f01d3220e9..dc96ec41f9035 100644 --- a/packages/shared-ux/button/exit_full_screen/mocks/tsconfig.json +++ b/packages/shared-ux/button/exit_full_screen/mocks/tsconfig.json @@ -9,10 +9,12 @@ "stripInternal": false, "types": [ "jest", - "node" + "node", + "react" ] }, "include": [ - "src/**/*" + "**/*.ts", + "**/*.tsx", ] } diff --git a/packages/shared-ux/card/no_data/impl/src/no_data_card.stories.tsx b/packages/shared-ux/card/no_data/impl/src/no_data_card.stories.tsx index 5c7b1a57c11f2..8574b31da792a 100644 --- a/packages/shared-ux/card/no_data/impl/src/no_data_card.stories.tsx +++ b/packages/shared-ux/card/no_data/impl/src/no_data_card.stories.tsx @@ -11,8 +11,7 @@ import React from 'react'; import { NoDataCardStorybookMock } from '@kbn/shared-ux-card-no-data-mocks'; import type { NoDataCardStorybookParams } from '@kbn/shared-ux-card-no-data-mocks'; -import { NoDataCard as Component } from './no_data_card.component'; -import { NoDataCard as ConnectedComponent } from './no_data_card'; +import { NoDataCard } from './no_data_card'; import { NoDataCardProvider } from './services'; import mdx from '../README.mdx'; @@ -28,21 +27,14 @@ export default { }; const mock = new NoDataCardStorybookMock(); - const argTypes = mock.getArgumentTypes(); -export const NoDataCard = (params: NoDataCardStorybookParams) => { +export const Card = (params: NoDataCardStorybookParams) => { return ( - + ); }; -NoDataCard.argTypes = argTypes; - -export const NoDataCardComponent = (params: NoDataCardStorybookParams) => { - return ; -}; - -NoDataCardComponent.argTypes = argTypes; +Card.argTypes = argTypes; diff --git a/packages/shared-ux/card/no_data/mocks/BUILD.bazel b/packages/shared-ux/card/no_data/mocks/BUILD.bazel index dbfc44a31b864..3aec9c86207c9 100644 --- a/packages/shared-ux/card/no_data/mocks/BUILD.bazel +++ b/packages/shared-ux/card/no_data/mocks/BUILD.bazel @@ -10,8 +10,17 @@ SOURCE_FILES = glob( "src/**/*.ts", ], exclude = [ + "**/*.config.js", + "**/*.mock.*", "**/*.test.*", "**/*.stories.*", + "**/__snapshots__", + "**/integration_tests", + "**/mocks", + "**/scripts", + "**/storybook", + "**/test_fixtures", + "**/test_helpers", ], ) @@ -39,6 +48,8 @@ NPM_MODULE_EXTRA_FILES = [ RUNTIME_DEPS = [ "@npm//@storybook/addon-actions", "@npm//deepmerge", + "@npm//lodash", + "@npm//react", "//packages/shared-ux/link/redirect_app/mocks", "//packages/shared-ux/storybook/mock", ] @@ -53,13 +64,15 @@ RUNTIME_DEPS = [ # # References to NPM packages work the same as RUNTIME_DEPS TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", "@npm//@storybook/addon-actions", + "@npm//@types/jest", + "@npm//@types/lodash", + "@npm//@types/node", + "@npm//@types/react", "@npm//deepmerge", - "//packages/shared-ux/storybook/mock:npm_module_types", - "//packages/shared-ux/link/redirect_app/mocks:npm_module_types", "//packages/shared-ux/card/no_data/types:npm_module_types", + "//packages/shared-ux/link/redirect_app/mocks:npm_module_types", + "//packages/shared-ux/storybook/mock:npm_module_types", ] jsts_transpiler( @@ -69,6 +82,14 @@ jsts_transpiler( root_input_dir = "src", ) +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", + web = True, +) + ts_config( name = "tsconfig", src = "tsconfig.json", @@ -94,7 +115,7 @@ ts_project( js_library( name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], + deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/card/no_data/mocks/package.json b/packages/shared-ux/card/no_data/mocks/package.json index d9f12c7e81fcd..10380b879954c 100644 --- a/packages/shared-ux/card/no_data/mocks/package.json +++ b/packages/shared-ux/card/no_data/mocks/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", + "browser": "./target_web/index.js", "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/shared-ux/card/no_data/mocks/src/jest.ts b/packages/shared-ux/card/no_data/mocks/src/jest.ts index bf8ac47239bcf..9a89d0cd3b747 100644 --- a/packages/shared-ux/card/no_data/mocks/src/jest.ts +++ b/packages/shared-ux/card/no_data/mocks/src/jest.ts @@ -5,7 +5,10 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ + import deepmerge from 'deepmerge'; +import { isPlainObject } from 'lodash'; + import type { NoDataCardServices, NoDataCardKibanaDependencies, @@ -43,7 +46,7 @@ export const getKibanaDependenciesMock = ( const integrations = params.canAccessFleet !== undefined ? params.canAccessFleet : defaultParams.canAccessFleet; - return deepmerge( + const result = deepmerge( { coreStart: { http: { @@ -60,6 +63,11 @@ export const getKibanaDependenciesMock = ( }, }, }, - getRedirectAppLinksKibanaDependenciesMock() + getRedirectAppLinksKibanaDependenciesMock(), + { + isMergeableObject: isPlainObject, + } ); + + return result; }; diff --git a/packages/shared-ux/card/no_data/mocks/tsconfig.json b/packages/shared-ux/card/no_data/mocks/tsconfig.json index 894f01d3220e9..dc96ec41f9035 100644 --- a/packages/shared-ux/card/no_data/mocks/tsconfig.json +++ b/packages/shared-ux/card/no_data/mocks/tsconfig.json @@ -9,10 +9,12 @@ "stripInternal": false, "types": [ "jest", - "node" + "node", + "react" ] }, "include": [ - "src/**/*" + "**/*.ts", + "**/*.tsx", ] } diff --git a/packages/shared-ux/link/redirect_app/impl/src/redirect_app_links.test.tsx b/packages/shared-ux/link/redirect_app/impl/src/redirect_app_links.test.tsx index 6342f9f6e1f6a..56a6e1b4f7494 100644 --- a/packages/shared-ux/link/redirect_app/impl/src/redirect_app_links.test.tsx +++ b/packages/shared-ux/link/redirect_app/impl/src/redirect_app_links.test.tsx @@ -10,10 +10,14 @@ import React, { MouseEvent } from 'react'; import { mount as enzymeMount, ReactWrapper } from 'enzyme'; +import { + getRedirectAppLinksKibanaDependenciesMock, + getRedirectAppLinksServicesMock, +} from '@kbn/shared-ux-link-redirect-app-mocks'; + import { RedirectAppLinksKibanaProvider, RedirectAppLinksProvider } from './services'; import { RedirectAppLinks } from './redirect_app_links.container'; import { RedirectAppLinks as ComposedWrapper } from './redirect_app_links'; -import { Observable } from 'rxjs'; export type UnmountCallback = () => void; export type MountPoint = (element: T) => UnmountCallback; @@ -251,21 +255,8 @@ describe('RedirectAppLinks', () => { navigateToUrl.mockReset(); }); - const kibana = { - coreStart: { - application: { - currentAppId$: new Observable((subscriber) => { - subscriber.next('123'); - }), - navigateToUrl, - }, - }, - }; - - const services = { - currentAppId: 'abc123', - navigateToUrl, - }; + const kibana = getRedirectAppLinksKibanaDependenciesMock({ navigateToUrl }); + const services = getRedirectAppLinksServicesMock({ navigateToUrl }); const provider = (node: React.ReactElement) => enzymeMount({node}); diff --git a/packages/shared-ux/link/redirect_app/mocks/BUILD.bazel b/packages/shared-ux/link/redirect_app/mocks/BUILD.bazel index f0607a798c833..2b28f97f2f639 100644 --- a/packages/shared-ux/link/redirect_app/mocks/BUILD.bazel +++ b/packages/shared-ux/link/redirect_app/mocks/BUILD.bazel @@ -8,10 +8,20 @@ PKG_REQUIRE_NAME = "@kbn/shared-ux-link-redirect-app-mocks" SOURCE_FILES = glob( [ "src/**/*.ts", + "src/**/*.tsx", ], exclude = [ + "**/*.config.js", + "**/*.mock.*", "**/*.test.*", "**/*.stories.*", + "**/__snapshots__", + "**/integration_tests", + "**/mocks", + "**/scripts", + "**/storybook", + "**/test_fixtures", + "**/test_helpers", ], ) @@ -37,6 +47,7 @@ NPM_MODULE_EXTRA_FILES = [ # "@npm//name-of-package" # eg. "@npm//lodash" RUNTIME_DEPS = [ + "@npm//react", "@npm//@storybook/addon-actions", "@npm//rxjs", "//packages/shared-ux/storybook/mock", @@ -52,6 +63,9 @@ RUNTIME_DEPS = [ # # References to NPM packages work the same as RUNTIME_DEPS TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "@npm//@types/react", "@npm//@storybook/addon-actions", "@npm//rxjs", "//packages/shared-ux/link/redirect_app/types", @@ -65,6 +79,14 @@ jsts_transpiler( root_input_dir = "src", ) +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", + web = True, +) + ts_config( name = "tsconfig", src = "tsconfig.json", @@ -90,7 +112,7 @@ ts_project( js_library( name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], + deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/link/redirect_app/mocks/jest.config.js b/packages/shared-ux/link/redirect_app/mocks/jest.config.js index 6f1b6fd89f35e..ac5f8e5dcf92f 100644 --- a/packages/shared-ux/link/redirect_app/mocks/jest.config.js +++ b/packages/shared-ux/link/redirect_app/mocks/jest.config.js @@ -7,7 +7,7 @@ */ module.exports = { - preset: '@kbn/test/jest_node', + preset: '@kbn/test', rootDir: '../../../../..', roots: ['/packages/shared-ux/link/redirect_app/mocks'], }; diff --git a/packages/shared-ux/link/redirect_app/mocks/package.json b/packages/shared-ux/link/redirect_app/mocks/package.json index 2281680755a9c..adf441fb3d134 100644 --- a/packages/shared-ux/link/redirect_app/mocks/package.json +++ b/packages/shared-ux/link/redirect_app/mocks/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", + "browser": "./target_web/index.js", "license": "SSPL-1.0 OR Elastic License 2.0" -} \ No newline at end of file +} diff --git a/packages/shared-ux/link/redirect_app/mocks/src/jest.ts b/packages/shared-ux/link/redirect_app/mocks/src/jest.ts index 57e6650d17752..1af5aa6e72a11 100644 --- a/packages/shared-ux/link/redirect_app/mocks/src/jest.ts +++ b/packages/shared-ux/link/redirect_app/mocks/src/jest.ts @@ -6,31 +6,53 @@ * Side Public License, v 1. */ -import { Subject } from 'rxjs'; +import { Observable } from 'rxjs'; import { RedirectAppLinksServices, RedirectAppLinksKibanaDependencies, } from '@kbn/shared-ux-link-redirect-app-types'; +type Params = Pick; + +const defaultParams: Params = { + navigateToUrl: jest.fn(), +}; + /** * Returns the Jest-compatible service abstractions for the `NoDataCard` Provider. */ -export const getRedirectAppLinksServicesMock = () => { +export const getRedirectAppLinksServicesMock = ( + params?: Partial +): RedirectAppLinksServices => { + const navigateToUrl = + params && params.navigateToUrl !== undefined + ? params.navigateToUrl + : defaultParams.navigateToUrl; + const services: RedirectAppLinksServices = { - navigateToUrl: jest.fn(), + navigateToUrl, currentAppId: 'currentAppId', }; return services; }; -export const getRedirectAppLinksKibanaDependenciesMock = (): RedirectAppLinksKibanaDependencies => { +export const getRedirectAppLinksKibanaDependenciesMock = ( + params?: Partial +): RedirectAppLinksKibanaDependencies => { + const navigateToUrl = + params && params.navigateToUrl !== undefined + ? params.navigateToUrl + : defaultParams.navigateToUrl; + return { coreStart: { application: { - currentAppId$: new Subject(), - navigateToUrl: jest.fn(), + currentAppId$: new Observable((subscriber) => { + subscriber.next('currentAppId'); + }), + navigateToUrl, }, }, }; diff --git a/packages/shared-ux/link/redirect_app/mocks/tsconfig.json b/packages/shared-ux/link/redirect_app/mocks/tsconfig.json index 041c59b490ec0..dc96ec41f9035 100644 --- a/packages/shared-ux/link/redirect_app/mocks/tsconfig.json +++ b/packages/shared-ux/link/redirect_app/mocks/tsconfig.json @@ -10,9 +10,11 @@ "types": [ "jest", "node", + "react" ] }, "include": [ - "src/**/*" + "**/*.ts", + "**/*.tsx", ] } diff --git a/packages/shared-ux/page/analytics_no_data/impl/src/analytics_no_data_page.stories.tsx b/packages/shared-ux/page/analytics_no_data/impl/src/analytics_no_data_page.stories.tsx index 0e6a4261c8c2d..5c9c5923bfdc6 100644 --- a/packages/shared-ux/page/analytics_no_data/impl/src/analytics_no_data_page.stories.tsx +++ b/packages/shared-ux/page/analytics_no_data/impl/src/analytics_no_data_page.stories.tsx @@ -7,7 +7,6 @@ */ import React from 'react'; -import { action } from '@storybook/addon-actions'; import { AnalyticsNoDataPageStorybookMock } from '@kbn/shared-ux-page-analytics-no-data-mocks'; import type { AnalyticsNoDataPageStorybookParams } from '@kbn/shared-ux-page-analytics-no-data-mocks'; @@ -18,7 +17,7 @@ import mdx from '../README.mdx'; const mock = new AnalyticsNoDataPageStorybookMock(); export default { - title: 'No Data/Analytics Page', + title: 'No Data/Page/Kibana', description: 'An Analytics-specific version of KibanaNoDataPage.', parameters: { docs: { @@ -27,7 +26,7 @@ export default { }, }; -export const AnalyticsNoDataPage = (params: AnalyticsNoDataPageStorybookParams) => { +export const Analytics = (params: AnalyticsNoDataPageStorybookParams) => { return ( @@ -35,22 +34,4 @@ export const AnalyticsNoDataPage = (params: AnalyticsNoDataPageStorybookParams) ); }; -AnalyticsNoDataPage.argTypes = mock.getArgumentTypes(); - -export const LoadingState = (params: AnalyticsNoDataPageStorybookParams) => { - // Simulate loading with a Promise that doesn't resolve. - const dataCheck = () => new Promise((_reject, _resolve) => {}); - - const services = { - ...mock.getServices(params), - hasESData: dataCheck, - hasUserDataView: dataCheck, - hasDataView: dataCheck, - }; - - return ( - - - - ); -}; +Analytics.argTypes = mock.getArgumentTypes(); diff --git a/packages/shared-ux/page/analytics_no_data/mocks/BUILD.bazel b/packages/shared-ux/page/analytics_no_data/mocks/BUILD.bazel index 6d78e72892bfc..1600004860f88 100644 --- a/packages/shared-ux/page/analytics_no_data/mocks/BUILD.bazel +++ b/packages/shared-ux/page/analytics_no_data/mocks/BUILD.bazel @@ -10,8 +10,17 @@ SOURCE_FILES = glob( "src/**/*.ts", ], exclude = [ + "**/*.config.js", + "**/*.mock.*", "**/*.test.*", "**/*.stories.*", + "**/__snapshots__", + "**/integration_tests", + "**/mocks", + "**/scripts", + "**/storybook", + "**/test_fixtures", + "**/test_helpers", ], ) @@ -37,7 +46,9 @@ NPM_MODULE_EXTRA_FILES = [ # "@npm//name-of-package" # eg. "@npm//lodash" RUNTIME_DEPS = [ + "@npm//react", "//packages/shared-ux/page/kibana_no_data/mocks", + "//packages/shared-ux/storybook/mock", ] # In this array place dependencies necessary to build the types, which will include the @@ -50,10 +61,12 @@ RUNTIME_DEPS = [ # # References to NPM packages work the same as RUNTIME_DEPS TYPES_DEPS = [ - "@npm//@types/node", "@npm//@types/jest", + "@npm//@types/node", + "@npm//@types/react", "//packages/shared-ux/page/analytics_no_data/types:npm_module_types", "//packages/shared-ux/page/kibana_no_data/mocks:npm_module_types", + "//packages/shared-ux/storybook/mock:npm_module_types", ] jsts_transpiler( @@ -63,6 +76,14 @@ jsts_transpiler( root_input_dir = "src", ) +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", + web = True, +) + ts_config( name = "tsconfig", src = "tsconfig.json", @@ -88,7 +109,7 @@ ts_project( js_library( name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], + deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/page/analytics_no_data/mocks/package.json b/packages/shared-ux/page/analytics_no_data/mocks/package.json index 30850ab7355ab..6fc9704e831f1 100644 --- a/packages/shared-ux/page/analytics_no_data/mocks/package.json +++ b/packages/shared-ux/page/analytics_no_data/mocks/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", + "browser": "./target_web/index.js", "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/shared-ux/page/analytics_no_data/mocks/tsconfig.json b/packages/shared-ux/page/analytics_no_data/mocks/tsconfig.json index 894f01d3220e9..dc96ec41f9035 100644 --- a/packages/shared-ux/page/analytics_no_data/mocks/tsconfig.json +++ b/packages/shared-ux/page/analytics_no_data/mocks/tsconfig.json @@ -9,10 +9,12 @@ "stripInternal": false, "types": [ "jest", - "node" + "node", + "react" ] }, "include": [ - "src/**/*" + "**/*.ts", + "**/*.tsx", ] } diff --git a/packages/shared-ux/page/kibana_no_data/impl/BUILD.bazel b/packages/shared-ux/page/kibana_no_data/impl/BUILD.bazel index 2fc986d65c1a4..7b1e16f9db829 100644 --- a/packages/shared-ux/page/kibana_no_data/impl/BUILD.bazel +++ b/packages/shared-ux/page/kibana_no_data/impl/BUILD.bazel @@ -44,9 +44,8 @@ RUNTIME_DEPS = [ "@npm//@emotion/react", "@npm//react", "//packages/kbn-i18n", - "//packages/kbn-shared-ux-components", - "//packages/kbn-shared-ux-services", "//packages/shared-ux/prompt/no_data_views/impl", + "//packages/shared-ux/page/no_data_config/impl", ] # In this array place dependencies necessary to build the types, which will include the @@ -67,10 +66,10 @@ TYPES_DEPS = [ "@npm//@types/react", "//packages/kbn-ambient-ui-types", "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-shared-ux-components:npm_module_types", - "//packages/kbn-shared-ux-services:npm_module_types", "//packages/shared-ux/prompt/no_data_views/impl:npm_module_types", - "//packages/shared-ux/page/kibana_no_data/types:npm_module_types", + "//packages/shared-ux/page/no_data_config/impl:npm_module_types", + "//packages/shared-ux/page/no_data_config/types", + "//packages/shared-ux/page/kibana_no_data/types", ] jsts_transpiler( diff --git a/packages/shared-ux/page/kibana_no_data/impl/README.mdx b/packages/shared-ux/page/kibana_no_data/impl/README.mdx index bc5dc37ac679a..f74adf2465e3b 100644 --- a/packages/shared-ux/page/kibana_no_data/impl/README.mdx +++ b/packages/shared-ux/page/kibana_no_data/impl/README.mdx @@ -14,7 +14,7 @@ The `KibanaNoDataPage` connected component uses: - `hasUserDataView` and `hasData` API from the `HasData` service in the `data_views` plugin to check for existence of data an data views. - `onDataViewCreated` callback once a data view has been created. -- (noDataConfig)[https://github.com/elastic/kibana/blob/main/packages/kbn-shared-ux-components/src/page_template/no_data_page/types.ts] as configuration for the page in case of no data. +- (noDataConfig)[https://github.com/elastic/kibana/blob/main/packages/shared-ux/page/no_data/types/index.d.ts] as configuration for the page in case of no data. ## API diff --git a/packages/shared-ux/page/kibana_no_data/impl/src/kibana_no_data_page.stories.tsx b/packages/shared-ux/page/kibana_no_data/impl/src/kibana_no_data_page.stories.tsx index f38b079dffec7..60cc78d95215c 100644 --- a/packages/shared-ux/page/kibana_no_data/impl/src/kibana_no_data_page.stories.tsx +++ b/packages/shared-ux/page/kibana_no_data/impl/src/kibana_no_data_page.stories.tsx @@ -17,7 +17,7 @@ import { KibanaNoDataPageProvider } from './services'; import mdx from '../README.mdx'; export default { - title: 'No Data/Kibana Page', + title: 'No Data/Page/Kibana', description: 'A component to display when there is no data available', parameters: { docs: { @@ -28,7 +28,7 @@ export default { const mock = new KibanaNoDataPageStorybookMock(); -export const KibanaNoDataPage = (params: KibanaNoDataPageStorybookParams) => { +export const Kibana = (params: KibanaNoDataPageStorybookParams) => { return ( @@ -36,7 +36,7 @@ export const KibanaNoDataPage = (params: KibanaNoDataPageStorybookParams) => { ); }; -KibanaNoDataPage.argTypes = mock.getArgumentTypes(); +Kibana.argTypes = mock.getArgumentTypes(); export const LoadingState = (params: KibanaNoDataPageStorybookParams) => { // Simulate loading with a Promise that doesn't resolve. diff --git a/packages/shared-ux/page/kibana_no_data/impl/src/kibana_no_data_page.test.tsx b/packages/shared-ux/page/kibana_no_data/impl/src/kibana_no_data_page.test.tsx index 7a0e0cd7e4f00..c15a5c061dd1b 100644 --- a/packages/shared-ux/page/kibana_no_data/impl/src/kibana_no_data_page.test.tsx +++ b/packages/shared-ux/page/kibana_no_data/impl/src/kibana_no_data_page.test.tsx @@ -12,7 +12,7 @@ import { act } from 'react-dom/test-utils'; import { EuiLoadingElastic } from '@elastic/eui'; import { mountWithIntl } from '@kbn/test-jest-helpers'; import { NoDataViewsPrompt } from '@kbn/shared-ux-prompt-no-data-views'; -import { NoDataConfigPage } from '@kbn/shared-ux-components'; +import { NoDataConfigPage } from '@kbn/shared-ux-page-no-data-config'; import { getKibanaNoDataPageServicesMock } from '@kbn/shared-ux-page-kibana-no-data-mocks'; import { KibanaNoDataPage } from './kibana_no_data_page'; @@ -43,7 +43,7 @@ describe('Kibana No Data Page', () => { }); test('renders NoDataConfigPage', async () => { - const services = getKibanaNoDataPageServicesMock({ config: { ...config, hasESData: false } }); + const services = getKibanaNoDataPageServicesMock(config); const component = mountWithIntl( @@ -58,7 +58,7 @@ describe('Kibana No Data Page', () => { }); test('renders NoDataViews', async () => { - const services = getKibanaNoDataPageServicesMock({ config: { ...config, hasESData: true } }); + const services = getKibanaNoDataPageServicesMock({ ...config, hasESData: true }); const component = mountWithIntl( diff --git a/packages/shared-ux/page/kibana_no_data/impl/src/kibana_no_data_page.tsx b/packages/shared-ux/page/kibana_no_data/impl/src/kibana_no_data_page.tsx index f2ac573232f34..73726d7b82eaa 100644 --- a/packages/shared-ux/page/kibana_no_data/impl/src/kibana_no_data_page.tsx +++ b/packages/shared-ux/page/kibana_no_data/impl/src/kibana_no_data_page.tsx @@ -7,7 +7,7 @@ */ import React, { useEffect, useState } from 'react'; import { EuiLoadingElastic } from '@elastic/eui'; -import { NoDataConfigPage } from '@kbn/shared-ux-components'; +import { NoDataConfigPage } from '@kbn/shared-ux-page-no-data-config'; import { NoDataViewsPrompt } from '@kbn/shared-ux-prompt-no-data-views'; import { KibanaNoDataPageProps } from '@kbn/shared-ux-page-kibana-no-data-types'; diff --git a/packages/shared-ux/page/kibana_no_data/impl/src/legacy_services.tsx b/packages/shared-ux/page/kibana_no_data/impl/src/legacy_services.tsx deleted file mode 100644 index 2a9580bb74684..0000000000000 --- a/packages/shared-ux/page/kibana_no_data/impl/src/legacy_services.tsx +++ /dev/null @@ -1,49 +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. - */ - -export { SharedUxServicesProvider as LegacyServicesProvider } from '@kbn/shared-ux-services'; -export type { SharedUxServices as LegacyServices } from '@kbn/shared-ux-services'; - -import { SharedUxServices as LegacyServices } from '@kbn/shared-ux-services'; -import type { KibanaNoDataPageServices } from '@kbn/shared-ux-page-kibana-no-data-types'; - -/** - * This list is temporary, a stop-gap as we migrate to a package-based architecture, where - * services are not collected in a single package. In order to make the transition, this - * interface is intentionally "flat". - * - * Expect this list to dwindle to zero as `@kbn/shared-ux-components` are migrated to their - * own packages, (and `@kbn/shared-ux-services` is removed). - */ -export const getLegacyServices = (services: KibanaNoDataPageServices): LegacyServices => ({ - application: { - currentAppId$: services.currentAppId$, - navigateToUrl: services.navigateToUrl, - }, - data: { - hasESData: services.hasESData, - hasDataView: services.hasDataView, - hasUserDataView: services.hasUserDataView, - }, - docLinks: { - dataViewsDocLink: services.dataViewsDocLink, - }, - editors: { - openDataViewEditor: services.openDataViewEditor, - }, - http: { - addBasePath: services.addBasePath, - }, - permissions: { - canAccessFleet: services.canAccessFleet, - canCreateNewDataView: services.canCreateNewDataView, - }, - platform: { - setIsFullscreen: services.setIsFullscreen, - }, -}); diff --git a/packages/shared-ux/page/kibana_no_data/impl/src/services.tsx b/packages/shared-ux/page/kibana_no_data/impl/src/services.tsx index 0aab90ce9f504..3ebab02d63790 100644 --- a/packages/shared-ux/page/kibana_no_data/impl/src/services.tsx +++ b/packages/shared-ux/page/kibana_no_data/impl/src/services.tsx @@ -15,13 +15,12 @@ import { import { NoDataCardProvider, NoDataCardKibanaProvider } from '@kbn/shared-ux-card-no-data'; import { + Services, KibanaNoDataPageServices, KibanaNoDataPageKibanaDependencies, } from '@kbn/shared-ux-page-kibana-no-data-types'; -import { LegacyServicesProvider, getLegacyServices } from './legacy_services'; - -const KibanaNoDataPageContext = React.createContext(null); +const KibanaNoDataPageContext = React.createContext(null); /** * A Context Provider that provides services to the component. @@ -29,15 +28,17 @@ const KibanaNoDataPageContext = React.createContext = ({ children, ...services -}) => ( - - - - {children} - - - -); +}) => { + const { hasESData, hasUserDataView } = services; + + return ( + + + {children} + + + ); +}; /** * Kibana-specific Provider that maps dependencies to services. @@ -46,27 +47,16 @@ export const KibanaNoDataPageKibanaProvider: FC { - const { coreStart, dataViewEditor, dataViews } = dependencies; - const value: KibanaNoDataPageServices = { - addBasePath: coreStart.http.basePath.prepend, - canAccessFleet: coreStart.application.capabilities.navLinks.integrations, - canCreateNewDataView: dataViewEditor.userPermissions.editDataView(), - currentAppId$: coreStart.application.currentAppId$, - dataViewsDocLink: coreStart.docLinks.links.indexPatterns?.introduction, - hasDataView: dataViews.hasData.hasDataView, + const { dataViews } = dependencies; + const value: Services = { hasESData: dataViews.hasData.hasESData, hasUserDataView: dataViews.hasData.hasUserDataView, - navigateToUrl: coreStart.application.navigateToUrl, - openDataViewEditor: dataViewEditor.openEditor, - setIsFullscreen: (isVisible: boolean) => coreStart.chrome.setIsVisible(isVisible), }; return ( - - {children} - + {children} ); diff --git a/packages/shared-ux/page/kibana_no_data/mocks/BUILD.bazel b/packages/shared-ux/page/kibana_no_data/mocks/BUILD.bazel index 2c195edb6de03..7f8c4c03fc92d 100644 --- a/packages/shared-ux/page/kibana_no_data/mocks/BUILD.bazel +++ b/packages/shared-ux/page/kibana_no_data/mocks/BUILD.bazel @@ -10,8 +10,17 @@ SOURCE_FILES = glob( "src/**/*.ts", ], exclude = [ + "**/*.config.js", + "**/*.mock.*", "**/*.test.*", "**/*.stories.*", + "**/__snapshots__", + "**/integration_tests", + "**/mocks", + "**/scripts", + "**/storybook", + "**/test_fixtures", + "**/test_helpers", ], ) @@ -37,8 +46,10 @@ NPM_MODULE_EXTRA_FILES = [ # "@npm//name-of-package" # eg. "@npm//lodash" RUNTIME_DEPS = [ - "//packages/shared-ux/prompt/no_data_views/mocks", + "@npm//react", "//packages/shared-ux/card/no_data/mocks", + "//packages/shared-ux/prompt/no_data_views/mocks", + "//packages/shared-ux/storybook/mock", ] # In this array place dependencies necessary to build the types, which will include the @@ -51,12 +62,14 @@ RUNTIME_DEPS = [ # # References to NPM packages work the same as RUNTIME_DEPS TYPES_DEPS = [ - "@npm//@types/node", "@npm//@types/jest", + "@npm//@types/node", + "@npm//@types/react", + "//packages/shared-ux/card/no_data/mocks:npm_module_types", "//packages/shared-ux/page/kibana_no_data/types:npm_module_types", - "//packages/kbn-shared-ux-components:npm_module_types", + "//packages/shared-ux/page/no_data/types", "//packages/shared-ux/prompt/no_data_views/mocks:npm_module_types", - "//packages/shared-ux/card/no_data/mocks:npm_module_types", + "//packages/shared-ux/storybook/mock:npm_module_types", ] jsts_transpiler( @@ -66,6 +79,14 @@ jsts_transpiler( root_input_dir = "src", ) +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", + web = True, +) + ts_config( name = "tsconfig", src = "tsconfig.json", @@ -91,7 +112,7 @@ ts_project( js_library( name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], + deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/page/kibana_no_data/mocks/jest.config.js b/packages/shared-ux/page/kibana_no_data/mocks/jest.config.js deleted file mode 100644 index 4c71cbdc32e91..0000000000000 --- a/packages/shared-ux/page/kibana_no_data/mocks/jest.config.js +++ /dev/null @@ -1,13 +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/jest_node', - rootDir: '../../../../..', - roots: ['/packages/shared-ux/page/kibana_no_data/mocks'], -}; diff --git a/packages/shared-ux/page/kibana_no_data/mocks/package.json b/packages/shared-ux/page/kibana_no_data/mocks/package.json index 988bdc1d33aca..f134da02e430f 100644 --- a/packages/shared-ux/page/kibana_no_data/mocks/package.json +++ b/packages/shared-ux/page/kibana_no_data/mocks/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", + "browser": "./target_web/index.js", "license": "SSPL-1.0 OR Elastic License 2.0" -} +} \ No newline at end of file diff --git a/packages/shared-ux/page/kibana_no_data/mocks/src/jest.ts b/packages/shared-ux/page/kibana_no_data/mocks/src/jest.ts index 33f26bafbd33d..5f2f6b309e56c 100644 --- a/packages/shared-ux/page/kibana_no_data/mocks/src/jest.ts +++ b/packages/shared-ux/page/kibana_no_data/mocks/src/jest.ts @@ -9,33 +9,34 @@ import { getNoDataCardServicesMock } from '@kbn/shared-ux-card-no-data-mocks'; import { KibanaNoDataPageServices } from '@kbn/shared-ux-page-kibana-no-data-types'; import { getNoDataViewsPromptServicesMock } from '@kbn/shared-ux-prompt-no-data-views-mocks'; -import { mockServicesFactory, MockServicesFactoryParams } from '@kbn/shared-ux-services'; + +interface Params { + hasESData: boolean; + hasUserDataView: boolean; +} + +const defaultParams = { + hasESData: true, + hasUserDataView: true, +}; /** * Returns the Jest-compatible service abstractions for the `KibanaNoDataPage` Provider. */ -export const getServicesMock = (params?: MockServicesFactoryParams) => { - const { canCreateNewDataView, dataViewsDocLink, openDataViewEditor } = - getNoDataViewsPromptServicesMock(); - - const { addBasePath, canAccessFleet } = getNoDataCardServicesMock(); +export const getServicesMock = (params?: Partial) => { + const hasESData = + params && params.hasESData !== undefined ? params.hasESData : defaultParams.hasESData; - const { application, data, docLinks, editors, http, permissions, platform } = - mockServicesFactory(params); + const hasUserDataView = + params && params.hasUserDataView !== undefined + ? params.hasUserDataView + : defaultParams.hasUserDataView; const services: KibanaNoDataPageServices = { - ...application, - ...data, - ...docLinks, - ...editors, - ...http, - ...permissions, - ...platform, - canCreateNewDataView, - dataViewsDocLink, - openDataViewEditor, - addBasePath, - canAccessFleet, + ...getNoDataCardServicesMock(), + ...getNoDataViewsPromptServicesMock(), + hasESData: async () => hasESData, + hasUserDataView: async () => hasUserDataView, }; return services; diff --git a/packages/shared-ux/page/kibana_no_data/mocks/src/storybook.ts b/packages/shared-ux/page/kibana_no_data/mocks/src/storybook.ts index 32dcdfe486580..1f4a7453e59b6 100644 --- a/packages/shared-ux/page/kibana_no_data/mocks/src/storybook.ts +++ b/packages/shared-ux/page/kibana_no_data/mocks/src/storybook.ts @@ -6,13 +6,14 @@ * Side Public License, v 1. */ -import { servicesFactory } from '@kbn/shared-ux-storybook'; +import { action } from '@storybook/addon-actions'; + import { AbstractStorybookMock, ArgumentParams } from '@kbn/shared-ux-storybook-mock'; import type { KibanaNoDataPageServices, KibanaNoDataPageProps, } from '@kbn/shared-ux-page-kibana-no-data-types'; -import type { NoDataPageProps } from '@kbn/shared-ux-components'; +import type { NoDataPageProps } from '@kbn/shared-ux-page-no-data-types'; import { NoDataViewsPromptStorybookMock, @@ -23,7 +24,6 @@ import { NoDataCardStorybookMock, NoDataCardStorybookParams, } from '@kbn/shared-ux-card-no-data-mocks'; -import { action } from '@storybook/addon-actions'; type PropArguments = Pick; type ServiceArguments = Pick; @@ -83,22 +83,11 @@ export class StorybookMock extends AbstractStorybookMock< } getServices(params: Params): KibanaNoDataPageServices { - // Workaround to leverage the services package. - const { application, data, docLinks, editors, http, permissions, platform } = - servicesFactory(params); - return { - ...application, - ...data, - ...docLinks, - ...editors, - ...http, - ...permissions, - ...platform, - hasESData: () => params.hasESData, - hasUserDataView: () => params.hasUserDataView, ...noDataCardMock.getServices(params), ...noDataViewsMock.getServices(params), + hasESData: () => params.hasESData, + hasUserDataView: () => params.hasUserDataView, }; } } diff --git a/packages/shared-ux/page/kibana_no_data/mocks/tsconfig.json b/packages/shared-ux/page/kibana_no_data/mocks/tsconfig.json index 894f01d3220e9..dc96ec41f9035 100644 --- a/packages/shared-ux/page/kibana_no_data/mocks/tsconfig.json +++ b/packages/shared-ux/page/kibana_no_data/mocks/tsconfig.json @@ -9,10 +9,12 @@ "stripInternal": false, "types": [ "jest", - "node" + "node", + "react" ] }, "include": [ - "src/**/*" + "**/*.ts", + "**/*.tsx", ] } diff --git a/packages/shared-ux/page/kibana_no_data/types/index.d.ts b/packages/shared-ux/page/kibana_no_data/types/index.d.ts index cfa1da12ccedf..18fe5499e93c3 100644 --- a/packages/shared-ux/page/kibana_no_data/types/index.d.ts +++ b/packages/shared-ux/page/kibana_no_data/types/index.d.ts @@ -6,109 +6,44 @@ * Side Public License, v 1. */ -import { Observable } from 'rxjs'; -import { NoDataPageProps } from '@kbn/shared-ux-components'; +import { NoDataPageProps } from '@kbn/shared-ux-page-no-data-types'; -/** - * TODO: `DataView` is a class exported by `src/plugins/data_views/public`. Since this service - * is contained in this package-- and packages can only depend on other packages and never on - * plugins-- we have to set this to `unknown`. If and when `DataView` is exported from a - * stateless package, we can remove this. - * - * @see: https://github.com/elastic/kibana/issues/127695 - */ -type DataView = unknown; - -/** - * A subset of the `DataViewEditorOptions` interface relevant to this component. - * - * @see: src/plugins/data_view_editor/public/types.ts - */ -interface DataViewEditorOptions { - /** Handler to be invoked when the Data View Editor completes a save operation. */ - onSave: (dataView: DataView) => void; -} +import { + NoDataViewsPromptServices, + NoDataViewsPromptKibanaDependencies, +} from '@kbn/shared-ux-prompt-no-data-views-types'; +import { + NoDataCardServices, + NoDataCardKibanaDependencies, +} from '@kbn/shared-ux-card-no-data-types'; -/** - * A list of Services that are consumed by this component. - * - * This list is temporary, a stopgap as we migrate to a package-based architecture, where - * services are not collected in a single package. In order to make the transition, this - * interface is intentionally "flat". - * - * Expect this list to dwindle to zero as `@kbn/shared-ux-components` are migrated to their - * own packages, (and `@kbn/shared-ux-services` is removed). - */ -export interface KibanaNoDataPageServices { +export interface Services { /** True if the cluster contains data, false otherwise. */ hasESData: () => Promise; /** True if Kibana instance contains user-created data view, false otherwise. */ hasUserDataView: () => Promise; - - // Provided to Legacy Services, not relevant to this component. Will be removed. - /** Append the server base path to a relative URL. */ - addBasePath: (url: string) => string; - /** True if the user has permission to access Fleet, false otherwise. */ - canAccessFleet: boolean; - /** True if the user has permission to create a new Data View, false otherwise. */ - canCreateNewDataView: boolean; - /** Observable storing the active, current application ID. */ - currentAppId$: Observable; - /** A link to information about Data Views in Kibana */ - dataViewsDocLink: string; - /** True if Kibana instance contains any data view, including system-created ones. */ - hasDataView: () => Promise; - /** Use Kibana to navigate async to a different URL. */ - navigateToUrl: (url: string) => Promise | void; - /** A method to open the Data View Editor flow. */ - openDataViewEditor: (options: DataViewEditorOptions) => () => void; - /** Set the Kibana chrome and browser to full screen mode. */ - setIsFullscreen: (isFullscreen: boolean) => void; } /** - * An interface containing a collection of Kibana plugins and services required to - * render this component and its dependencies. + * A list of Services that are consumed by this component.. */ -export interface KibanaNoDataPageKibanaDependencies { - coreStart: { - application: { - capabilities: { - navLinks: Record; - }; - currentAppId$: Observable; - navigateToUrl: (url: string) => Promise; - }; - chrome: { - setIsVisible: (isVisible: boolean) => void; - }; - docLinks: { - links: { - indexPatterns: { - introduction: string; - }; - }; - }; - http: { - basePath: { - prepend: (url: string) => string; - }; - }; - }; +export type KibanaNoDataPageServices = Services & NoDataCardServices & NoDataViewsPromptServices; + +export interface KibanaDependencies { dataViews: { hasData: { - hasDataView: () => Promise; hasESData: () => Promise; hasUserDataView: () => Promise; }; }; - dataViewEditor: { - openEditor: (options: DataViewEditorOptions) => () => void; - userPermissions: { - editDataView: () => boolean; - }; - }; } +/** + * An interface containing a collection of Kibana plugins and services required to + * render this component and its dependencies. + */ +export type KibanaNoDataPageKibanaDependencies = KibanaDependencies & + NoDataViewsPromptKibanaDependencies & + NoDataCardKibanaDependencies; /** * Props for `KibanaNoDataPage`. diff --git a/packages/kbn-shared-ux-services/BUILD.bazel b/packages/shared-ux/page/kibana_template/impl/BUILD.bazel old mode 100755 new mode 100644 similarity index 86% rename from packages/kbn-shared-ux-services/BUILD.bazel rename to packages/shared-ux/page/kibana_template/impl/BUILD.bazel index 1ed65b979a3e3..8e27df56eadf2 --- a/packages/kbn-shared-ux-services/BUILD.bazel +++ b/packages/shared-ux/page/kibana_template/impl/BUILD.bazel @@ -2,16 +2,18 @@ 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_DIRNAME = "kbn-shared-ux-services" -PKG_REQUIRE_NAME = "@kbn/shared-ux-services" +PKG_DIRNAME = "impl" +PKG_REQUIRE_NAME = "@kbn/shared-ux-page-kibana-template" SOURCE_FILES = glob( [ "src/**/*.ts", "src/**/*.tsx", + "src/**/*.mdx", ], exclude = [ "**/*.test.*", + "**/*.stories.*", ], ) @@ -38,7 +40,7 @@ NPM_MODULE_EXTRA_FILES = [ # eg. "@npm//lodash" RUNTIME_DEPS = [ "@npm//react", - "@npm//rxjs", + "//packages/shared-ux/page/no_data_config/impl", ] # In this array place dependencies necessary to build the types, which will include the @@ -54,7 +56,9 @@ TYPES_DEPS = [ "@npm//@types/node", "@npm//@types/jest", "@npm//@types/react", - "@npm//rxjs", + "//packages/shared-ux/page/no_data_config/impl:npm_module_types", + "//packages/shared-ux/page/kibana_template/types", + "//packages/kbn-ambient-ui-types", ] jsts_transpiler( @@ -70,6 +74,10 @@ jsts_transpiler( build_pkg_name = package_name(), root_input_dir = "src", web = True, + additional_args = [ + "--copy-files", + "--quiet" + ], ) ts_config( diff --git a/packages/kbn-shared-ux-components/src/page_template/page_template.mdx b/packages/shared-ux/page/kibana_template/impl/README.mdx similarity index 97% rename from packages/kbn-shared-ux-components/src/page_template/page_template.mdx rename to packages/shared-ux/page/kibana_template/impl/README.mdx index fbaada158e277..6d8151cbe882c 100644 --- a/packages/kbn-shared-ux-components/src/page_template/page_template.mdx +++ b/packages/shared-ux/page/kibana_template/impl/README.mdx @@ -1,6 +1,6 @@ --- id: sharedUX/Components/PageTemplate -slug: /shared-ux-components/page_template/page_template +slug: /shared-ux/page_template title: Page Template description: A Kibana-specific wrapper around `EuiTemplate` tags: ['shared-ux', 'component'] @@ -124,7 +124,7 @@ Increases the consistency in messaging across all the solutions during the getti This is a built-in configuration that displays a very specific UI and requires very specific keys. It will also ignore all other configurations of the template including `pageHeader` and `children`, with the exception of continuing to show `solutionNav`. -The `noDataConfig` is of type [`NoDataPageProps`](https://github.com/elastic/kibana/blob/main/packages/kbn-shared-ux-components/src/page_template/no_data_page/types.ts#L14): +The `noDataConfig` is of type [`NoDataPageProps`](https://github.com/elastic/kibana/blob/main/packages/shared-ux/page/no_data/types/index.d.ts): 1. `solution: string`: Single name for the current solution, used to auto-generate the title, logo, and description *(required)* 2. `docsLink: string`: Required to set the docs link for the whole solution *(required)* diff --git a/packages/shared-ux/card/no_data/mocks/jest.config.js b/packages/shared-ux/page/kibana_template/impl/jest.config.js similarity index 81% rename from packages/shared-ux/card/no_data/mocks/jest.config.js rename to packages/shared-ux/page/kibana_template/impl/jest.config.js index 2c7697ab74eb8..103defe0f0ca6 100644 --- a/packages/shared-ux/card/no_data/mocks/jest.config.js +++ b/packages/shared-ux/page/kibana_template/impl/jest.config.js @@ -7,7 +7,7 @@ */ module.exports = { - preset: '@kbn/test/jest_node', + preset: '@kbn/test', rootDir: '../../../../..', - roots: ['/packages/shared-ux/card/no_data/mocks'], + roots: ['/packages/shared-ux/page/kibana_template/impl'], }; diff --git a/packages/shared-ux/page/kibana_template/impl/package.json b/packages/shared-ux/page/kibana_template/impl/package.json new file mode 100644 index 0000000000000..a089481047999 --- /dev/null +++ b/packages/shared-ux/page/kibana_template/impl/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/shared-ux-page-kibana-template", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-shared-ux-components/src/page_template/__snapshots__/page_template.test.tsx.snap b/packages/shared-ux/page/kibana_template/impl/src/__snapshots__/page_template.test.tsx.snap similarity index 100% rename from packages/kbn-shared-ux-components/src/page_template/__snapshots__/page_template.test.tsx.snap rename to packages/shared-ux/page/kibana_template/impl/src/__snapshots__/page_template.test.tsx.snap diff --git a/packages/kbn-shared-ux-components/src/page_template/__snapshots__/page_template_inner.test.tsx.snap b/packages/shared-ux/page/kibana_template/impl/src/__snapshots__/page_template_inner.test.tsx.snap similarity index 100% rename from packages/kbn-shared-ux-components/src/page_template/__snapshots__/page_template_inner.test.tsx.snap rename to packages/shared-ux/page/kibana_template/impl/src/__snapshots__/page_template_inner.test.tsx.snap diff --git a/packages/kbn-shared-ux-components/src/page_template/index.ts b/packages/shared-ux/page/kibana_template/impl/src/index.ts similarity index 60% rename from packages/kbn-shared-ux-components/src/page_template/index.ts rename to packages/shared-ux/page/kibana_template/impl/src/index.ts index cd7d6232d9a8b..9a890cafe49aa 100644 --- a/packages/kbn-shared-ux-components/src/page_template/index.ts +++ b/packages/shared-ux/page/kibana_template/impl/src/index.ts @@ -5,7 +5,12 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -export { NoDataPage, NoDataConfigPage } from './no_data_page'; + export { KibanaPageTemplate } from './page_template'; -export type { KibanaPageTemplateProps } from './types'; -export type { NoDataPageProps } from './no_data_page'; +export { KibanaPageTemplateProvider, KibanaPageTemplateKibanaProvider } from './services'; +export type { + NoDataConfig, + KibanaPageTemplateProps, + KibanaPageTemplateServices, + KibanaPageTemplateKibanaDependencies, +} from '@kbn/shared-ux-page-kibana-template-types'; diff --git a/packages/shared-ux/page/kibana_template/impl/src/page_template.stories.tsx b/packages/shared-ux/page/kibana_template/impl/src/page_template.stories.tsx new file mode 100644 index 0000000000000..91f46f4f89faa --- /dev/null +++ b/packages/shared-ux/page/kibana_template/impl/src/page_template.stories.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { + KibanaPageTemplateStorybookMock, + NoDataConfigStorybookMock, + SolutionNavStorybookMock, + InnerPageTemplateStorybookMock, +} from '@kbn/shared-ux-page-kibana-template-mocks'; +import type { + KibanaPageTemplateStorybookParams, + NoDataConfigStorybookParams, + SolutionNavStorybookParams, + InnerPageTemplateStorybookParams, +} from '@kbn/shared-ux-page-kibana-template-mocks'; + +import { KibanaPageTemplateProvider } from './services'; + +import { KibanaPageTemplate as Component } from './page_template'; +import mdx from '../README.mdx'; + +export default { + title: 'Page/Page Template', + description: + 'A thin wrapper around `EuiTemplate`. Takes care of styling, empty state and no data config', + parameters: { + docs: { + page: mdx, + }, + }, +}; + +const templateMock = new KibanaPageTemplateStorybookMock(); +const solutionNavMock = new SolutionNavStorybookMock(); +const noDataConfigMock = new NoDataConfigStorybookMock(); +const innerMock = new InnerPageTemplateStorybookMock(); + +export const WithNoDataConfig = (params: NoDataConfigStorybookParams) => { + return ( + + + + ); +}; + +WithNoDataConfig.argTypes = noDataConfigMock.getArgumentTypes(); + +export const WithSolutionNav = (params: SolutionNavStorybookParams) => { + return ( + + + + ); +}; + +WithSolutionNav.argTypes = solutionNavMock.getArgumentTypes(); + +export const WithBoth = (params: KibanaPageTemplateStorybookParams) => { + return ( + + + + ); +}; + +WithBoth.argTypes = templateMock.getArgumentTypes(); + +export const WithNeither = (params: InnerPageTemplateStorybookParams) => { + return ( + + + + ); +}; + +WithNeither.argTypes = innerMock.getArgumentTypes(); diff --git a/packages/kbn-shared-ux-components/src/page_template/page_template.test.tsx b/packages/shared-ux/page/kibana_template/impl/src/page_template.test.tsx similarity index 97% rename from packages/kbn-shared-ux-components/src/page_template/page_template.test.tsx rename to packages/shared-ux/page/kibana_template/impl/src/page_template.test.tsx index 1324b60b92870..0e9df4b6c2394 100644 --- a/packages/kbn-shared-ux-components/src/page_template/page_template.test.tsx +++ b/packages/shared-ux/page/kibana_template/impl/src/page_template.test.tsx @@ -9,9 +9,9 @@ import React from 'react'; import { shallow, render } from 'enzyme'; import { SolutionNavProps } from '@kbn/shared-ux-page-solution-nav'; +import type { NoDataPageProps } from '@kbn/shared-ux-page-no-data-types'; import { KibanaPageTemplate } from './page_template'; -import { NoDataPageProps } from './no_data_page'; const items: SolutionNavProps['items'] = [ { diff --git a/packages/kbn-shared-ux-components/src/page_template/page_template.tsx b/packages/shared-ux/page/kibana_template/impl/src/page_template.tsx similarity index 82% rename from packages/kbn-shared-ux-components/src/page_template/page_template.tsx rename to packages/shared-ux/page/kibana_template/impl/src/page_template.tsx index 467f02224b0de..5a05315d395a7 100644 --- a/packages/kbn-shared-ux-components/src/page_template/page_template.tsx +++ b/packages/shared-ux/page/kibana_template/impl/src/page_template.tsx @@ -6,13 +6,17 @@ * Side Public License, v 1. */ -import React, { FunctionComponent } from 'react'; +import React, { FC } from 'react'; + +import { + NoDataConfigPage, + NoDataConfigPageWithSolutionNavBar, +} from '@kbn/shared-ux-page-no-data-config'; +import { KibanaPageTemplateProps } from '@kbn/shared-ux-page-kibana-template-types'; -import { NoDataConfigPage, NoDataConfigPageWithSolutionNavBar } from './no_data_page'; import { KibanaPageTemplateInner, KibanaPageTemplateWithSolutionNav } from './page_template_inner'; -import { KibanaPageTemplateProps } from './types'; -export const KibanaPageTemplate: FunctionComponent = ({ +export const KibanaPageTemplate: FC = ({ template, className, children, diff --git a/packages/kbn-shared-ux-components/src/page_template/page_template_inner.test.tsx b/packages/shared-ux/page/kibana_template/impl/src/page_template_inner.test.tsx similarity index 100% rename from packages/kbn-shared-ux-components/src/page_template/page_template_inner.test.tsx rename to packages/shared-ux/page/kibana_template/impl/src/page_template_inner.test.tsx diff --git a/packages/kbn-shared-ux-components/src/page_template/page_template_inner.tsx b/packages/shared-ux/page/kibana_template/impl/src/page_template_inner.tsx similarity index 81% rename from packages/kbn-shared-ux-components/src/page_template/page_template_inner.tsx rename to packages/shared-ux/page/kibana_template/impl/src/page_template_inner.tsx index 46424348f2ff3..6d836a3c66d7f 100644 --- a/packages/kbn-shared-ux-components/src/page_template/page_template_inner.tsx +++ b/packages/shared-ux/page/kibana_template/impl/src/page_template_inner.tsx @@ -6,20 +6,25 @@ * Side Public License, v 1. */ -import React, { FunctionComponent } from 'react'; - +import React, { FC } from 'react'; +import classNames from 'classnames'; import { EuiEmptyPrompt, EuiPageTemplate } from '@elastic/eui'; -import { withSolutionNav } from '@kbn/shared-ux-page-solution-nav'; -import { KibanaPageTemplateProps } from './types'; -import { getClasses } from './util'; +import { withSolutionNav } from '@kbn/shared-ux-page-solution-nav'; +import { KibanaPageTemplateProps as Props } from '@kbn/shared-ux-page-kibana-template-types'; -type Props = KibanaPageTemplateProps; +const getClasses = (template?: string, className?: string) => { + return classNames( + 'kbnPageTemplate', + template ? { [`kbnPageTemplate--${template}`]: template } : '', + className || '' + ); +}; /** * A thin wrapper around EuiPageTemplate with a few Kibana specific additions */ -export const KibanaPageTemplateInner: FunctionComponent = ({ +export const KibanaPageTemplateInner: FC = ({ template, className, pageHeader, diff --git a/packages/shared-ux/page/kibana_template/impl/src/services.tsx b/packages/shared-ux/page/kibana_template/impl/src/services.tsx new file mode 100644 index 0000000000000..328d3e8a6f9c8 --- /dev/null +++ b/packages/shared-ux/page/kibana_template/impl/src/services.tsx @@ -0,0 +1,41 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React, { FC } from 'react'; + +import { + NoDataConfigPageProvider, + NoDataConfigPageKibanaProvider, +} from '@kbn/shared-ux-page-no-data-config'; + +import { + KibanaPageTemplateServices, + KibanaPageTemplateKibanaDependencies, +} from '@kbn/shared-ux-page-kibana-template-types'; + +/** + * A Context Provider that provides services to the component and its dependencies. + */ +export const KibanaPageTemplateProvider: FC = ({ + children, + ...services +}) => { + return {children}; +}; + +/** + * Kibana-specific Provider that maps dependencies to services. + */ +export const KibanaPageTemplateKibanaProvider: FC = ({ + children, + ...dependencies +}) => { + return ( + {children} + ); +}; diff --git a/packages/shared-ux/page/kibana_template/impl/tsconfig.json b/packages/shared-ux/page/kibana_template/impl/tsconfig.json new file mode 100644 index 0000000000000..6b965878dca79 --- /dev/null +++ b/packages/shared-ux/page/kibana_template/impl/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "../../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "rootDir": ".", + "stripInternal": false, + "types": [ + "jest", + "node", + "@kbn/ambient-ui-types", + ] + }, + "include": [ + "src/**/*" + ] +} diff --git a/packages/shared-ux/page/kibana_template/mocks/BUILD.bazel b/packages/shared-ux/page/kibana_template/mocks/BUILD.bazel new file mode 100644 index 0000000000000..0680dd91e867f --- /dev/null +++ b/packages/shared-ux/page/kibana_template/mocks/BUILD.bazel @@ -0,0 +1,144 @@ +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_DIRNAME = "mocks" +PKG_REQUIRE_NAME = "@kbn/shared-ux-page-kibana-template-mocks" + +SOURCE_FILES = glob( + [ + "src/**/*.ts", + "src/**/*.tsx", + ], + exclude = [ + "**/*.config.js", + "**/*.mock.*", + "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__", + "**/integration_tests", + "**/mocks", + "**/scripts", + "**/storybook", + "**/test_fixtures", + "**/test_helpers", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +# In this array place runtime dependencies, including other packages and NPM packages +# which must be available for this code to run. +# +# To reference other packages use: +# "//repo/relative/path/to/package" +# eg. "//packages/kbn-utils" +# +# To reference a NPM package use: +# "@npm//name-of-package" +# eg. "@npm//lodash" +RUNTIME_DEPS = [ + "@npm//lodash", + "@npm//react", + "//packages/shared-ux/page/no_data_config/mocks", + "//packages/shared-ux/storybook/mock", +] + +# In this array place dependencies necessary to build the types, which will include the +# :npm_module_types target of other packages and packages from NPM, including @types/* +# packages. +# +# To reference the types for another package use: +# "//repo/relative/path/to/package:npm_module_types" +# eg. "//packages/kbn-utils:npm_module_types" +# +# References to NPM packages work the same as RUNTIME_DEPS +TYPES_DEPS = [ + "@npm//@types/jest", + "@npm//@types/lodash", + "@npm//@types/node", + "@npm//@types/react", + "//packages/shared-ux/page/kibana_template/types", + "//packages/shared-ux/page/no_data_config/mocks:npm_module_types", + "//packages/shared-ux/storybook/mock:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", +) + +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", + 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", + root_dir = "src", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + 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 = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/shared-ux/page/kibana_template/mocks/README.mdx b/packages/shared-ux/page/kibana_template/mocks/README.mdx new file mode 100644 index 0000000000000..7515ff010ac90 --- /dev/null +++ b/packages/shared-ux/page/kibana_template/mocks/README.mdx @@ -0,0 +1,3 @@ +# @kbn/shared-ux-page-kibana-template-mocks + +Empty package generated by @kbn/generate diff --git a/packages/shared-ux/page/kibana_template/mocks/package.json b/packages/shared-ux/page/kibana_template/mocks/package.json new file mode 100644 index 0000000000000..c6dc7b5671d7e --- /dev/null +++ b/packages/shared-ux/page/kibana_template/mocks/package.json @@ -0,0 +1,8 @@ +{ + "name": "@kbn/shared-ux-page-kibana-template-mocks", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "browser": "./target_web/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/shared-ux/page/kibana_template/mocks/src/index.ts b/packages/shared-ux/page/kibana_template/mocks/src/index.ts new file mode 100644 index 0000000000000..c2193c9c89e61 --- /dev/null +++ b/packages/shared-ux/page/kibana_template/mocks/src/index.ts @@ -0,0 +1,26 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { + getServicesMock as getKibanaPageTemplateServicesMock, + getKibanaDependenciesMock as getKibanaPageTemplateKibanaDependenciesMock, +} from './jest'; + +export { + KibanaPageTemplateStorybookMock, + NoDataConfigStorybookMock, + SolutionNavStorybookMock, + InnerPageTemplateStorybookMock, +} from './storybook'; + +export type { + KibanaPageTemplateStorybookParams, + NoDataConfigStorybookParams, + SolutionNavStorybookParams, + InnerPageTemplateStorybookParams, +} from './storybook'; diff --git a/packages/shared-ux/page/kibana_template/mocks/src/jest.ts b/packages/shared-ux/page/kibana_template/mocks/src/jest.ts new file mode 100644 index 0000000000000..5f260e194f6d8 --- /dev/null +++ b/packages/shared-ux/page/kibana_template/mocks/src/jest.ts @@ -0,0 +1,30 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { getNoDataCardKibanaDependenciesMock } from '@kbn/shared-ux-card-no-data-mocks'; +import type { + KibanaPageTemplateServices, + KibanaPageTemplateKibanaDependencies, +} from '@kbn/shared-ux-page-kibana-template-types'; +import { getNoDataConfigPageServicesMock } from '@kbn/shared-ux-page-no-data-config-mocks'; + +export const getServicesMock = () => { + const services: KibanaPageTemplateServices = { + ...getNoDataConfigPageServicesMock(), + }; + + return services; +}; + +export const getKibanaDependenciesMock = () => { + const dependencies: KibanaPageTemplateKibanaDependencies = { + ...getNoDataCardKibanaDependenciesMock(), + }; + + return dependencies; +}; diff --git a/packages/shared-ux/page/kibana_template/mocks/src/storybook/all.ts b/packages/shared-ux/page/kibana_template/mocks/src/storybook/all.ts new file mode 100644 index 0000000000000..6a5754ba1862b --- /dev/null +++ b/packages/shared-ux/page/kibana_template/mocks/src/storybook/all.ts @@ -0,0 +1,72 @@ +/* + * Copyright 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 { AbstractStorybookMock } from '@kbn/shared-ux-storybook-mock'; +import type { ArgumentParams } from '@kbn/shared-ux-storybook-mock'; + +import { NoDataConfigPageStorybookMock } from '@kbn/shared-ux-page-no-data-config-mocks'; +import type { NoDataConfigPageStorybookParams } from '@kbn/shared-ux-page-no-data-config-mocks'; + +import type { + KibanaPageTemplateProps, + KibanaPageTemplateServices, +} from '@kbn/shared-ux-page-kibana-template-types'; + +import { noDataConfigArguments } from './no_data_config'; +import type { NoDataConfigArguments } from './no_data_config'; +import { solutionNavArguments, solutionNavProps } from './solution_nav'; +import type { SolutionNavArguments } from './solution_nav'; + +type PropArguments = NoDataConfigArguments & SolutionNavArguments; + +export type Params = ArgumentParams & NoDataConfigPageStorybookParams; + +const noDataConfigMock = new NoDataConfigPageStorybookMock(); + +export class StorybookMock extends AbstractStorybookMock< + KibanaPageTemplateProps, + KibanaPageTemplateServices, + PropArguments +> { + propArguments = { + ...noDataConfigArguments, + ...solutionNavArguments, + }; + + serviceArguments = {}; + + dependencies = [noDataConfigMock]; + + getProps(params?: Params): KibanaPageTemplateProps { + const result: KibanaPageTemplateProps = { + noDataConfig: { + action: { + elasticAgent: { + title: 'Add Integrations', + }, + }, + solution: this.getArgumentValue('solution', params), + logo: this.getArgumentValue('logo', params), + docsLink: this.getArgumentValue('docsLink', params), + pageTitle: this.getArgumentValue('pageTitle', params), + }, + solutionNav: { + name: this.getArgumentValue('name', params), + icon: this.getArgumentValue('icon', params), + canBeCollapsed: this.getArgumentValue('canBeCollapsed', params), + ...solutionNavProps, + }, + }; + + return result; + } + + getServices(params: Params): KibanaPageTemplateServices { + return { ...noDataConfigMock.getServices(params) }; + } +} diff --git a/packages/shared-ux/page/kibana_template/mocks/src/storybook/index.ts b/packages/shared-ux/page/kibana_template/mocks/src/storybook/index.ts new file mode 100644 index 0000000000000..ecbc26c20a095 --- /dev/null +++ b/packages/shared-ux/page/kibana_template/mocks/src/storybook/index.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. + */ + +export { StorybookMock as NoDataConfigStorybookMock } from './no_data_config'; +export type { Params as NoDataConfigStorybookParams } from './no_data_config'; + +export { StorybookMock as SolutionNavStorybookMock } from './solution_nav'; +export type { Params as SolutionNavStorybookParams } from './solution_nav'; + +export { StorybookMock as KibanaPageTemplateStorybookMock } from './all'; +export type { Params as KibanaPageTemplateStorybookParams } from './all'; + +export { StorybookMock as InnerPageTemplateStorybookMock } from './inner'; +export type { Params as InnerPageTemplateStorybookParams } from './inner'; diff --git a/packages/shared-ux/page/kibana_template/mocks/src/storybook/inner.tsx b/packages/shared-ux/page/kibana_template/mocks/src/storybook/inner.tsx new file mode 100644 index 0000000000000..7794aea021b89 --- /dev/null +++ b/packages/shared-ux/page/kibana_template/mocks/src/storybook/inner.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { AbstractStorybookMock } from '@kbn/shared-ux-storybook-mock'; +import type { ArgumentParams } from '@kbn/shared-ux-storybook-mock'; + +import { NoDataConfigPageStorybookMock } from '@kbn/shared-ux-page-no-data-config-mocks'; +import type { NoDataConfigPageStorybookParams } from '@kbn/shared-ux-page-no-data-config-mocks'; + +import type { + KibanaPageTemplateProps, + KibanaPageTemplateServices, +} from '@kbn/shared-ux-page-kibana-template-types'; + +type PageHeader = NonNullable; +export type PageHeaderArguments = Pick< + PageHeader, + 'iconType' | 'pageTitle' | 'description' | 'rightSideItems' +>; + +type PropArguments = Pick & PageHeaderArguments; + +export type Params = ArgumentParams & NoDataConfigPageStorybookParams; + +const noDataConfigMock = new NoDataConfigPageStorybookMock(); + +export const pageHeaderArguments: ArgumentParams = { + isEmptyState: { + control: 'boolean', + defaultValue: false, + }, + iconType: { + control: { type: 'radio' }, + options: ['logoElastic', 'logoKibana', 'logoCloud', undefined], + defaultValue: undefined, + }, + pageTitle: { + control: 'text', + defaultValue: 'Page title', + }, + description: { + control: 'text', + defaultValue: 'Page description', + }, + rightSideItems: { + control: 'boolean', + defaultValue: true, + }, +}; + +const rightSideItems: PageHeaderArguments['rightSideItems'] = [ + First Item, + Second Item, +]; + +export class StorybookMock extends AbstractStorybookMock< + KibanaPageTemplateProps, + KibanaPageTemplateServices, + PropArguments +> { + propArguments = { + ...pageHeaderArguments, + }; + + serviceArguments = {}; + + dependencies = []; + + getProps(params?: Params): KibanaPageTemplateProps { + const result: KibanaPageTemplateProps = { + isEmptyState: this.getArgumentValue('isEmptyState', params), + pageHeader: { + iconType: this.getArgumentValue('iconType', params), + pageTitle: this.getArgumentValue('pageTitle', params), + description: this.getArgumentValue('description', params), + rightSideItems: this.getArgumentValue('rightSideItems', params) + ? rightSideItems + : undefined, + }, + }; + + return result; + } + + getServices(params: Params): KibanaPageTemplateServices { + return { ...noDataConfigMock.getServices(params) }; + } +} diff --git a/packages/shared-ux/page/kibana_template/mocks/src/storybook/no_data_config.ts b/packages/shared-ux/page/kibana_template/mocks/src/storybook/no_data_config.ts new file mode 100644 index 0000000000000..92e7f0da52e62 --- /dev/null +++ b/packages/shared-ux/page/kibana_template/mocks/src/storybook/no_data_config.ts @@ -0,0 +1,86 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { AbstractStorybookMock } from '@kbn/shared-ux-storybook-mock'; +import type { ArgumentParams } from '@kbn/shared-ux-storybook-mock'; + +import { NoDataConfigPageStorybookMock } from '@kbn/shared-ux-page-no-data-config-mocks'; +import type { NoDataConfigPageStorybookParams } from '@kbn/shared-ux-page-no-data-config-mocks'; + +import type { + NoDataConfig, + KibanaPageTemplateProps, + KibanaPageTemplateServices, +} from '@kbn/shared-ux-page-kibana-template-types'; + +export type NoDataConfigArguments = Pick< + NoDataConfig, + 'solution' | 'logo' | 'docsLink' | 'pageTitle' +>; + +type PropArguments = NoDataConfigArguments; + +export type Params = ArgumentParams & NoDataConfigPageStorybookParams; + +const noDataConfigMock = new NoDataConfigPageStorybookMock(); + +export const noDataConfigArguments: ArgumentParams = { + solution: { + control: 'text', + defaultValue: 'Observability', + }, + logo: { + control: { type: 'radio' }, + options: ['logoElastic', 'logoKibana', 'logoCloud', undefined], + defaultValue: undefined, + }, + docsLink: { + control: 'text', + defaultValue: 'docs/link', + }, + pageTitle: { + control: 'text', + defaultValue: '', + }, +}; + +export class StorybookMock extends AbstractStorybookMock< + KibanaPageTemplateProps, + KibanaPageTemplateServices, + PropArguments +> { + propArguments = { + ...noDataConfigArguments, + }; + + serviceArguments = {}; + + dependencies = [noDataConfigMock]; + + getProps(params?: Params): KibanaPageTemplateProps { + const result: KibanaPageTemplateProps = { + noDataConfig: { + action: { + elasticAgent: { + title: 'Add Integrations', + }, + }, + solution: this.getArgumentValue('solution', params), + logo: this.getArgumentValue('logo', params), + docsLink: this.getArgumentValue('docsLink', params), + pageTitle: this.getArgumentValue('pageTitle', params), + }, + }; + + return result; + } + + getServices(params: Params): KibanaPageTemplateServices { + return { ...noDataConfigMock.getServices(params) }; + } +} diff --git a/packages/shared-ux/page/kibana_template/mocks/src/storybook/solution_nav.ts b/packages/shared-ux/page/kibana_template/mocks/src/storybook/solution_nav.ts new file mode 100644 index 0000000000000..3590a3e896a2e --- /dev/null +++ b/packages/shared-ux/page/kibana_template/mocks/src/storybook/solution_nav.ts @@ -0,0 +1,115 @@ +/* + * Copyright 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 { AbstractStorybookMock } from '@kbn/shared-ux-storybook-mock'; +import type { ArgumentParams } from '@kbn/shared-ux-storybook-mock'; + +import { NoDataConfigPageStorybookMock } from '@kbn/shared-ux-page-no-data-config-mocks'; +import type { NoDataConfigPageStorybookParams } from '@kbn/shared-ux-page-no-data-config-mocks'; + +import type { + KibanaPageTemplateProps, + KibanaPageTemplateServices, +} from '@kbn/shared-ux-page-kibana-template-types'; + +type SolutionNav = NonNullable; +export type SolutionNavArguments = Pick; + +type PropArguments = SolutionNavArguments; + +export type Params = ArgumentParams & NoDataConfigPageStorybookParams; + +const noDataConfigMock = new NoDataConfigPageStorybookMock(); + +export const solutionNavArguments: ArgumentParams = { + name: { + control: 'text', + defaultValue: 'Kibana', + }, + icon: { + control: { type: 'radio' }, + options: ['logoKibana', 'logoObservability', 'logoSecurity'], + defaultValue: 'logoKibana', + }, + canBeCollapsed: { + control: 'boolean', + defaultValue: true, + }, +}; + +export const solutionNavProps = { + items: [ + { + name: 'Ingest', + id: '1', + items: [ + { + name: 'Ingest Node Pipelines', + id: '1.1', + }, + { + name: 'Logstash Pipelines', + id: '1.2', + }, + { + name: 'Beats Central Management', + id: '1.3', + }, + ], + }, + { + name: 'Data', + id: '2', + items: [ + { + name: 'Index Management', + id: '2.1', + }, + { + name: 'Index Lifecycle Policies', + id: '2.2', + }, + { + name: 'Snapshot and Restore', + id: '2.3', + }, + ], + }, + ], +}; + +export class StorybookMock extends AbstractStorybookMock< + KibanaPageTemplateProps, + KibanaPageTemplateServices, + PropArguments +> { + propArguments = { + ...solutionNavArguments, + }; + + serviceArguments = {}; + + dependencies = [noDataConfigMock]; + + getProps(params?: Params): KibanaPageTemplateProps { + const result: KibanaPageTemplateProps = { + solutionNav: { + name: this.getArgumentValue('name', params), + icon: this.getArgumentValue('icon', params), + canBeCollapsed: this.getArgumentValue('canBeCollapsed', params), + ...solutionNavProps, + }, + }; + + return result; + } + + getServices(params: Params): KibanaPageTemplateServices { + return { ...noDataConfigMock.getServices(params) }; + } +} diff --git a/packages/shared-ux/page/kibana_template/mocks/tsconfig.json b/packages/shared-ux/page/kibana_template/mocks/tsconfig.json new file mode 100644 index 0000000000000..dc96ec41f9035 --- /dev/null +++ b/packages/shared-ux/page/kibana_template/mocks/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "rootDir": "src", + "stripInternal": false, + "types": [ + "jest", + "node", + "react" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ] +} diff --git a/packages/shared-ux/page/kibana_template/types/BUILD.bazel b/packages/shared-ux/page/kibana_template/types/BUILD.bazel new file mode 100644 index 0000000000000..45cbd0fd4cc42 --- /dev/null +++ b/packages/shared-ux/page/kibana_template/types/BUILD.bazel @@ -0,0 +1,59 @@ +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_DIRNAME = "types" +PKG_REQUIRE_NAME = "@kbn/shared-ux-page-kibana-template-types" + +SRCS = glob( + [ + "*.d.ts", + ] +) + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +# In this array place runtime dependencies, including other packages and NPM packages +# which must be available for this code to run. +# +# To reference other packages use: +# "//repo/relative/path/to/package" +# eg. "//packages/kbn-utils" +# +# To reference a NPM package use: +# "@npm//name-of-package" +# eg. "@npm//lodash" +RUNTIME_DEPS = [ +] + +js_library( + name = PKG_DIRNAME, + srcs = SRCS + NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS, + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +alias( + name = "npm_module_types", + actual = ":" + PKG_DIRNAME, + visibility = ["//visibility:public"], +) diff --git a/packages/shared-ux/page/kibana_template/types/README.mdx b/packages/shared-ux/page/kibana_template/types/README.mdx new file mode 100644 index 0000000000000..8245f7d8d8c21 --- /dev/null +++ b/packages/shared-ux/page/kibana_template/types/README.mdx @@ -0,0 +1,3 @@ +# @kbn/shared-ux-page-kibana-template-types + +Empty package generated by @kbn/generate diff --git a/packages/kbn-shared-ux-components/src/page_template/types.ts b/packages/shared-ux/page/kibana_template/types/index.d.ts similarity index 74% rename from packages/kbn-shared-ux-components/src/page_template/types.ts rename to packages/shared-ux/page/kibana_template/types/index.d.ts index 6a8b0d583ed18..8f3129c31817d 100644 --- a/packages/kbn-shared-ux-components/src/page_template/types.ts +++ b/packages/shared-ux/page/kibana_template/types/index.d.ts @@ -9,7 +9,15 @@ import { EuiPageTemplateProps } from '@elastic/eui'; import { SolutionNavProps } from '@kbn/shared-ux-page-solution-nav'; -import { NoDataPageProps } from './no_data_page'; +import { + NoDataConfig, + NoDataConfigPageServices, + NoDataConfigPageKibanaDependencies, +} from '@kbn/shared-ux-page-no-data-config-types'; + +export type KibanaPageTemplateKibanaDependencies = NoDataConfigPageKibanaDependencies; +export type KibanaPageTemplateServices = NoDataConfigPageServices; +export type { NoDataConfig } from '@kbn/shared-ux-page-no-data-config-types'; export type KibanaPageTemplateProps = EuiPageTemplateProps & { /** @@ -27,5 +35,5 @@ export type KibanaPageTemplateProps = EuiPageTemplateProps & { * Accepts a configuration object, that when provided, ignores pageHeader and children and instead * displays Agent, Beats, and custom cards to direct users to the right ingest location */ - noDataConfig?: NoDataPageProps; + noDataConfig?: NoDataConfig; }; diff --git a/packages/shared-ux/page/kibana_template/types/package.json b/packages/shared-ux/page/kibana_template/types/package.json new file mode 100644 index 0000000000000..4562e9a1becdd --- /dev/null +++ b/packages/shared-ux/page/kibana_template/types/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/shared-ux-page-kibana-template-types", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/shared-ux/page/kibana_template/types/tsconfig.json b/packages/shared-ux/page/kibana_template/types/tsconfig.json new file mode 100644 index 0000000000000..7a4adfcdbecff --- /dev/null +++ b/packages/shared-ux/page/kibana_template/types/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "stripInternal": false, + "types": [] + }, + "include": [ + "*.d.ts" + ] +} diff --git a/packages/kbn-shared-ux-components/BUILD.bazel b/packages/shared-ux/page/no_data/impl/BUILD.bazel similarity index 75% rename from packages/kbn-shared-ux-components/BUILD.bazel rename to packages/shared-ux/page/no_data/impl/BUILD.bazel index 74924f4c6519d..13ffd0694bdd2 100644 --- a/packages/kbn-shared-ux-components/BUILD.bazel +++ b/packages/shared-ux/page/no_data/impl/BUILD.bazel @@ -2,19 +2,17 @@ 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_DIRNAME = "kbn-shared-ux-components" -PKG_REQUIRE_NAME = "@kbn/shared-ux-components" +PKG_DIRNAME = "impl" +PKG_REQUIRE_NAME = "@kbn/shared-ux-page-no-data" SOURCE_FILES = glob( [ "src/**/*.ts", "src/**/*.tsx", - "src/**/*.scss", - "src/**/*.mdx", - "src/**/*.svg", ], exclude = [ "**/*.test.*", + "**/*.stories.*", ], ) @@ -41,22 +39,10 @@ NPM_MODULE_EXTRA_FILES = [ # eg. "@npm//lodash" RUNTIME_DEPS = [ "@npm//@elastic/eui", - "@npm//@emotion/css", - "@npm//@emotion/react", "@npm//classnames", - "@npm//react-use", "@npm//react", - "@npm//rxjs", - "@npm//url-loader", - "//packages/kbn-i18n-react", - "//packages/kbn-i18n", - "//packages/kbn-shared-ux-services", - "//packages/kbn-shared-ux-storybook", - "//packages/kbn-shared-ux-utility", "//packages/shared-ux/avatar/solution", "//packages/shared-ux/card/no_data/impl", - "//packages/shared-ux/link/redirect_app/impl", - "//packages/shared-ux/page/solution_nav", "//packages/shared-ux/prompt/no_data_views/impl", ] @@ -71,24 +57,14 @@ RUNTIME_DEPS = [ # References to NPM packages work the same as RUNTIME_DEPS TYPES_DEPS = [ "@npm//@elastic/eui", - "@npm//@emotion/css", - "@npm//@emotion/react", "@npm//@types/classnames", "@npm//@types/jest", "@npm//@types/node", "@npm//@types/react", - "@npm//react-use", - "@npm//rxjs", "//packages/kbn-ambient-ui-types", - "//packages/kbn-i18n-react:npm_module_types", - "//packages/kbn-i18n:npm_module_types", - "//packages/kbn-shared-ux-services:npm_module_types", - "//packages/kbn-shared-ux-storybook:npm_module_types", - "//packages/kbn-shared-ux-utility:npm_module_types", "//packages/shared-ux/avatar/solution:npm_module_types", "//packages/shared-ux/card/no_data/impl:npm_module_types", - "//packages/shared-ux/link/redirect_app/impl:npm_module_types", - "//packages/shared-ux/page/solution_nav:npm_module_types", + "//packages/shared-ux/page/no_data/types:npm_module_types", "//packages/shared-ux/prompt/no_data_views/impl:npm_module_types", ] diff --git a/packages/shared-ux/page/no_data/impl/README.mdx b/packages/shared-ux/page/no_data/impl/README.mdx new file mode 100644 index 0000000000000..e5dd8c235c4ce --- /dev/null +++ b/packages/shared-ux/page/no_data/impl/README.mdx @@ -0,0 +1,3 @@ +# @kbn/shared-ux-page-no-data + +Empty package generated by @kbn/generate diff --git a/packages/kbn-shared-ux-components/jest.config.js b/packages/shared-ux/page/no_data/impl/jest.config.js similarity index 81% rename from packages/kbn-shared-ux-components/jest.config.js rename to packages/shared-ux/page/no_data/impl/jest.config.js index c2ac8c3a57106..1b7ff2aafe740 100644 --- a/packages/kbn-shared-ux-components/jest.config.js +++ b/packages/shared-ux/page/no_data/impl/jest.config.js @@ -8,6 +8,6 @@ module.exports = { preset: '@kbn/test', - rootDir: '../..', - roots: ['/packages/kbn-shared-ux-components'], + rootDir: '../../../../..', + roots: ['/packages/shared-ux/page/no_data/impl'], }; diff --git a/packages/kbn-shared-ux-services/package.json b/packages/shared-ux/page/no_data/impl/package.json old mode 100755 new mode 100644 similarity index 80% rename from packages/kbn-shared-ux-services/package.json rename to packages/shared-ux/page/no_data/impl/package.json index 7d7d999bf6961..1f09f616a765f --- a/packages/kbn-shared-ux-services/package.json +++ b/packages/shared-ux/page/no_data/impl/package.json @@ -1,5 +1,5 @@ { - "name": "@kbn/shared-ux-services", + "name": "@kbn/shared-ux-page-no-data", "private": true, "version": "1.0.0", "main": "./target_node/index.js", diff --git a/packages/shared-ux/page/no_data/impl/src/action_card.tsx b/packages/shared-ux/page/no_data/impl/src/action_card.tsx new file mode 100644 index 0000000000000..0dec8c677b12c --- /dev/null +++ b/packages/shared-ux/page/no_data/impl/src/action_card.tsx @@ -0,0 +1,30 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; + +import { NoDataCard, NoDataCardProps } from '@kbn/shared-ux-card-no-data'; +import { ActionCardProps } from '@kbn/shared-ux-page-no-data-types'; + +export type NoDataPageActions = NoDataCardProps; + +export const KEY_ELASTIC_AGENT = 'elasticAgent'; + +export const ActionCard = ({ action }: ActionCardProps) => { + const actionKeys = Object.keys(action); + + if (actionKeys.length !== 1) { + return null; + } + + const actionKey = actionKeys[0]; + const key = + actionKey === KEY_ELASTIC_AGENT ? 'empty-page-agent-action' : `empty-page-${actionKey}-action`; + + return ; +}; diff --git a/packages/kbn-shared-ux-components/src/page_template/no_data_page/index.ts b/packages/shared-ux/page/no_data/impl/src/index.ts similarity index 65% rename from packages/kbn-shared-ux-components/src/page_template/no_data_page/index.ts rename to packages/shared-ux/page/no_data/impl/src/index.ts index a6f8c91f7614c..5438612b541bd 100644 --- a/packages/kbn-shared-ux-components/src/page_template/no_data_page/index.ts +++ b/packages/shared-ux/page/no_data/impl/src/index.ts @@ -7,5 +7,10 @@ */ export { NoDataPage } from './no_data_page'; -export type { NoDataPageProps } from './types'; -export { NoDataConfigPage, NoDataConfigPageWithSolutionNavBar } from './no_data_config_page'; +export type { + NoDataPageProps, + NoDataPageServices, + NoDataPageKibanaDependencies, +} from '@kbn/shared-ux-page-no-data-types'; + +export { NoDataPageKibanaProvider, NoDataPageProvider } from './services'; diff --git a/packages/shared-ux/page/no_data/impl/src/no_data_page.stories.tsx b/packages/shared-ux/page/no_data/impl/src/no_data_page.stories.tsx new file mode 100644 index 0000000000000..6b56a44638358 --- /dev/null +++ b/packages/shared-ux/page/no_data/impl/src/no_data_page.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; + +import { NoDataPageStorybookMock } from '@kbn/shared-ux-page-no-data-mocks'; +import type { NoDataPageStorybookParams } from '@kbn/shared-ux-page-no-data-mocks'; + +import { NoDataPage as Component } from './no_data_page'; + +import { NoDataPageProvider } from './services'; +import mdx from '../README.mdx'; + +const mock = new NoDataPageStorybookMock(); + +export default { + title: 'No Data/Page/No Data Page', + description: 'A component to display when there is no data available', + parameters: { + docs: { + page: mdx, + }, + }, +}; + +export const NoDataPage = (params: NoDataPageStorybookParams) => { + return ( + + + + ); +}; + +NoDataPage.argTypes = mock.getArgumentTypes(); diff --git a/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_page.test.tsx b/packages/shared-ux/page/no_data/impl/src/no_data_page.test.tsx similarity index 81% rename from packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_page.test.tsx rename to packages/shared-ux/page/no_data/impl/src/no_data_page.test.tsx index b9474285469e1..576cf4f3b7230 100644 --- a/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_page.test.tsx +++ b/packages/shared-ux/page/no_data/impl/src/no_data_page.test.tsx @@ -9,14 +9,15 @@ import React from 'react'; import { mountWithIntl } from '@kbn/test-jest-helpers'; import { NoDataCard } from '@kbn/shared-ux-card-no-data'; -import { SharedUxServicesProvider, mockServicesFactory } from '@kbn/shared-ux-services'; +import { getNoDataPageServicesMock } from '@kbn/shared-ux-page-no-data-mocks'; import { NoDataPage } from './no_data_page'; +import { NoDataPageProvider } from './services'; describe('NoDataPage', () => { test('render', () => { const component = mountWithIntl( - + { logo={'logoKibana'} docsLink="test" /> - + ); expect(component.find('h1').html()).toContain('Welcome to Elastic Analytics!'); expect(component.find(NoDataCard).length).toBe(1); diff --git a/packages/shared-ux/page/no_data/impl/src/no_data_page.tsx b/packages/shared-ux/page/no_data/impl/src/no_data_page.tsx new file mode 100644 index 0000000000000..1bc93123aea95 --- /dev/null +++ b/packages/shared-ux/page/no_data/impl/src/no_data_page.tsx @@ -0,0 +1,67 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import classNames from 'classnames'; + +import { EuiLink, EuiSpacer, EuiText, EuiTextColor } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; + +import { KibanaSolutionAvatar } from '@kbn/shared-ux-avatar-solution'; +import type { NoDataPageProps } from '@kbn/shared-ux-page-no-data-types'; + +import { ActionCard } from './action_card'; + +export const NoDataPage = ({ + solution, + logo, + action, + docsLink, + pageTitle, + className, +}: NoDataPageProps) => { + const title = + pageTitle || + i18n.translate('sharedUXPackages.noDataPage.welcomeTitle', { + defaultMessage: 'Welcome to Elastic {solution}!', + values: { solution }, + }); + + const link = ( + + + + ); + + const message = ( + + ); + + return ( +
+ + + +

{title}

+ +

{message}

+
+
+ + +
+ ); +}; diff --git a/packages/shared-ux/page/no_data/impl/src/services.tsx b/packages/shared-ux/page/no_data/impl/src/services.tsx new file mode 100644 index 0000000000000..3d10cc5547c92 --- /dev/null +++ b/packages/shared-ux/page/no_data/impl/src/services.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 React, { FC } from 'react'; + +import { NoDataCardKibanaProvider, NoDataCardProvider } from '@kbn/shared-ux-card-no-data'; + +import type { + NoDataPageServices, + NoDataPageKibanaDependencies, +} from '@kbn/shared-ux-page-no-data-types'; + +/** + * A Context Provider that provides services to the component and its dependencies. + */ +export const NoDataPageProvider: FC = ({ children, ...services }) => { + return {children}; +}; + +/** + * Kibana-specific Provider that maps dependencies to services. + */ +export const NoDataPageKibanaProvider: FC = ({ + children, + ...dependencies +}) => { + return {children}; +}; diff --git a/packages/kbn-shared-ux-components/tsconfig.json b/packages/shared-ux/page/no_data/impl/tsconfig.json similarity index 79% rename from packages/kbn-shared-ux-components/tsconfig.json rename to packages/shared-ux/page/no_data/impl/tsconfig.json index dd55bdb28a632..40ed24ecac4d2 100644 --- a/packages/kbn-shared-ux-components/tsconfig.json +++ b/packages/shared-ux/page/no_data/impl/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, "declarationMap": true, @@ -10,7 +10,7 @@ "types": [ "jest", "node", - "@emotion/react/types/css-prop", + "react", "@kbn/ambient-ui-types", ] }, diff --git a/packages/shared-ux/page/no_data/mocks/BUILD.bazel b/packages/shared-ux/page/no_data/mocks/BUILD.bazel new file mode 100644 index 0000000000000..9296b28ed96f1 --- /dev/null +++ b/packages/shared-ux/page/no_data/mocks/BUILD.bazel @@ -0,0 +1,141 @@ +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_DIRNAME = "mocks" +PKG_REQUIRE_NAME = "@kbn/shared-ux-page-no-data-mocks" + +SOURCE_FILES = glob( + [ + "src/**/*.ts", + ], + exclude = [ + "**/*.config.js", + "**/*.mock.*", + "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__", + "**/integration_tests", + "**/mocks", + "**/scripts", + "**/storybook", + "**/test_fixtures", + "**/test_helpers", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +# In this array place runtime dependencies, including other packages and NPM packages +# which must be available for this code to run. +# +# To reference other packages use: +# "//repo/relative/path/to/package" +# eg. "//packages/kbn-utils" +# +# To reference a NPM package use: +# "@npm//name-of-package" +# eg. "@npm//lodash" +RUNTIME_DEPS = [ + "@npm//react", + "//packages/shared-ux/card/no_data/mocks", + "//packages/shared-ux/storybook/mock", +] + +# In this array place dependencies necessary to build the types, which will include the +# :npm_module_types target of other packages and packages from NPM, including @types/* +# packages. +# +# To reference the types for another package use: +# "//repo/relative/path/to/package:npm_module_types" +# eg. "//packages/kbn-utils:npm_module_types" +# +# References to NPM packages work the same as RUNTIME_DEPS +TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "@npm//@types/react", + "//packages/shared-ux/page/no_data/types", + "//packages/shared-ux/card/no_data/mocks:npm_module_types", + "//packages/shared-ux/storybook/mock:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", +) + +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", + 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", + root_dir = "src", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + 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 = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/shared-ux/page/no_data/mocks/README.md b/packages/shared-ux/page/no_data/mocks/README.md new file mode 100644 index 0000000000000..5714e473d1f0c --- /dev/null +++ b/packages/shared-ux/page/no_data/mocks/README.md @@ -0,0 +1,3 @@ +# @kbn/shared-ux-page-no-data-mocks + +Empty package generated by @kbn/generate diff --git a/packages/shared-ux/page/no_data/mocks/package.json b/packages/shared-ux/page/no_data/mocks/package.json new file mode 100644 index 0000000000000..d6051a988cdc4 --- /dev/null +++ b/packages/shared-ux/page/no_data/mocks/package.json @@ -0,0 +1,8 @@ +{ + "name": "@kbn/shared-ux-page-no-data-mocks", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "browser": "./target_web/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-shared-ux-storybook/src/config/preview.ts b/packages/shared-ux/page/no_data/mocks/src/index.ts similarity index 56% rename from packages/kbn-shared-ux-storybook/src/config/preview.ts rename to packages/shared-ux/page/no_data/mocks/src/index.ts index 194a16474af2c..a17ff47a67775 100644 --- a/packages/kbn-shared-ux-storybook/src/config/preview.ts +++ b/packages/shared-ux/page/no_data/mocks/src/index.ts @@ -6,7 +6,10 @@ * Side Public License, v 1. */ -import { addDecorator } from '@storybook/react'; -import { servicesDecorator } from '../decorators'; +export { + getServicesMock as getNoDataPageServicesMock, + getKibanaDependenciesMock as getNoDataPageKibanaDependenciesMock, +} from './jest'; -addDecorator(servicesDecorator); +export { NoDataPageStorybookMock } from './storybook'; +export type { Params as NoDataPageStorybookParams } from './storybook'; diff --git a/packages/shared-ux/page/no_data/mocks/src/jest.ts b/packages/shared-ux/page/no_data/mocks/src/jest.ts new file mode 100644 index 0000000000000..fd44142c2f597 --- /dev/null +++ b/packages/shared-ux/page/no_data/mocks/src/jest.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 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 deepmerge from 'deepmerge'; +import { isPlainObject } from 'lodash'; + +import type { + NoDataPageServices, + NoDataPageKibanaDependencies, +} from '@kbn/shared-ux-page-no-data-types'; + +import { + getNoDataCardServicesMock, + getNoDataCardKibanaDependenciesMock, +} from '@kbn/shared-ux-card-no-data-mocks'; + +const defaultParams = { + canAccessFleet: true, +}; + +export const getServicesMock = (params: Partial = defaultParams) => { + const canAccessFleet = + params.canAccessFleet !== undefined ? params.canAccessFleet : defaultParams.canAccessFleet; + + const services: NoDataPageServices = { + ...getNoDataCardServicesMock(), + canAccessFleet, + }; + + return services; +}; + +/** + * Return a Jest mock of the Kibana dependencies for the `NoDataPageKibanaProvider`. + */ +export const getKibanaDependenciesMock = ( + params: Partial = defaultParams +): NoDataPageKibanaDependencies => { + const integrations = + params.canAccessFleet !== undefined ? params.canAccessFleet : defaultParams.canAccessFleet; + + return deepmerge( + { + coreStart: { + application: { + capabilities: { + navLinks: { + integrations, + }, + }, + }, + }, + }, + getNoDataCardKibanaDependenciesMock(), + { + isMergeableObject: isPlainObject, + } + ); +}; diff --git a/packages/shared-ux/page/no_data/mocks/src/storybook.ts b/packages/shared-ux/page/no_data/mocks/src/storybook.ts new file mode 100644 index 0000000000000..899ddf819a7d6 --- /dev/null +++ b/packages/shared-ux/page/no_data/mocks/src/storybook.ts @@ -0,0 +1,67 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { AbstractStorybookMock } from '@kbn/shared-ux-storybook-mock'; +import type { ArgumentParams } from '@kbn/shared-ux-storybook-mock'; +import type { NoDataPageProps, NoDataPageServices } from '@kbn/shared-ux-page-no-data-types'; +import { NoDataCardStorybookMock } from '@kbn/shared-ux-card-no-data-mocks'; +import type { NoDataCardStorybookParams } from '@kbn/shared-ux-card-no-data-mocks'; + +type PropArguments = Pick; + +export type Params = ArgumentParams & NoDataCardStorybookParams; + +const dataCardMock = new NoDataCardStorybookMock(); + +export class NoDataPageStorybookMock extends AbstractStorybookMock< + NoDataPageProps, + NoDataPageServices, + PropArguments +> { + propArguments = { + solution: { + control: 'text', + defaultValue: 'Observability', + }, + logo: { + control: { type: 'radio' }, + options: ['logoElastic', 'logoKibana', 'logoCloud', undefined], + defaultValue: undefined, + }, + docsLink: { + control: 'text', + defaultValue: 'docs/link', + }, + pageTitle: { + control: 'text', + defaultValue: '', + }, + }; + + serviceArguments = {}; + + dependencies = [dataCardMock]; + + getProps(params?: Params): NoDataPageProps { + return { + action: { + elasticAgent: { + title: 'Add Integrations', + }, + }, + solution: this.getArgumentValue('solution', params), + logo: this.getArgumentValue('logo', params), + docsLink: this.getArgumentValue('docsLink', params), + pageTitle: this.getArgumentValue('pageTitle', params), + }; + } + + getServices(params: Params): NoDataPageServices { + return { ...dataCardMock.getServices(params) }; + } +} diff --git a/packages/shared-ux/page/no_data/mocks/tsconfig.json b/packages/shared-ux/page/no_data/mocks/tsconfig.json new file mode 100644 index 0000000000000..dc96ec41f9035 --- /dev/null +++ b/packages/shared-ux/page/no_data/mocks/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "rootDir": "src", + "stripInternal": false, + "types": [ + "jest", + "node", + "react" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ] +} diff --git a/packages/shared-ux/page/no_data/types/BUILD.bazel b/packages/shared-ux/page/no_data/types/BUILD.bazel new file mode 100644 index 0000000000000..618a82a8f6a98 --- /dev/null +++ b/packages/shared-ux/page/no_data/types/BUILD.bazel @@ -0,0 +1,59 @@ +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_DIRNAME = "types" +PKG_REQUIRE_NAME = "@kbn/shared-ux-page-no-data-types" + +SRCS = glob( + [ + "*.d.ts", + ] +) + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +# In this array place runtime dependencies, including other packages and NPM packages +# which must be available for this code to run. +# +# To reference other packages use: +# "//repo/relative/path/to/package" +# eg. "//packages/kbn-utils" +# +# To reference a NPM package use: +# "@npm//name-of-package" +# eg. "@npm//lodash" +RUNTIME_DEPS = [ +] + +js_library( + name = PKG_DIRNAME, + srcs = SRCS + NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS, + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +alias( + name = "npm_module_types", + actual = ":" + PKG_DIRNAME, + visibility = ["//visibility:public"], +) diff --git a/packages/shared-ux/page/no_data/types/README.mdx b/packages/shared-ux/page/no_data/types/README.mdx new file mode 100644 index 0000000000000..7890d0ef8a3c4 --- /dev/null +++ b/packages/shared-ux/page/no_data/types/README.mdx @@ -0,0 +1,3 @@ +# @kbn/shared-ux-page-no-data-types + +Empty package generated by @kbn/generate diff --git a/packages/kbn-shared-ux-components/src/page_template/no_data_page/types.ts b/packages/shared-ux/page/no_data/types/index.d.ts similarity index 66% rename from packages/kbn-shared-ux-components/src/page_template/no_data_page/types.ts rename to packages/shared-ux/page/no_data/types/index.d.ts index e22f7a7b81a77..3db9e80c950c9 100644 --- a/packages/kbn-shared-ux-components/src/page_template/no_data_page/types.ts +++ b/packages/shared-ux/page/no_data/types/index.d.ts @@ -7,31 +7,50 @@ */ import { CommonProps } from '@elastic/eui'; -import { NoDataCardProps } from '@kbn/shared-ux-card-no-data'; +import { + NoDataCardProps, + NoDataCardServices, + NoDataCardKibanaDependencies, +} from '@kbn/shared-ux-card-no-data-types'; export type NoDataPageActions = NoDataCardProps; -export interface NoDataPageProps extends CommonProps { +export interface ActionCardProps { /** - * Single name for the current solution, used to auto-generate the title, logo, description, and button label + * An object of `NoDataPageActions`. + * + * Use `elasticAgent` as the primary key for pre-configured cards of this type. + * Otherwise use a custom key that contains `EuiCard` props. */ - solution: string; + action: Record; +} + +export interface NoDataPageProps extends CommonProps, ActionCardProps { /** - * Optionally replace the auto-generated logo + * Single name for the current solution, used to auto-generate the title, logo, description, and button label */ - logo?: string; + solution: string; /** * Required to set the docs link for the whole solution */ docsLink: string; /** - * Optionally replace the auto-generated page title (h1) + * Optionally replace the auto-generated logo */ - pageTitle?: string; + logo?: string; /** - * An object of `NoDataPageActions`. - * Use `elasticAgent` as the primary key for pre-configured cards of this type. - * Otherwise use a custom key that contains `EuiCard` props. + * Optionally replace the auto-generated page title (h1) */ - action: Record; + pageTitle?: string; } + +/** + * A list of services that are consumed by this component. + */ +export type NoDataPageServices = NoDataCardServices; + +/** + * An interface containing a collection of Kibana plugins and services required to + * render this component. + */ +export type NoDataPageKibanaDependencies = NoDataCardKibanaDependencies; diff --git a/packages/shared-ux/page/no_data/types/package.json b/packages/shared-ux/page/no_data/types/package.json new file mode 100644 index 0000000000000..8e9dce1b11f45 --- /dev/null +++ b/packages/shared-ux/page/no_data/types/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/shared-ux-page-no-data-types", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/packages/shared-ux/page/no_data/types/tsconfig.json b/packages/shared-ux/page/no_data/types/tsconfig.json new file mode 100644 index 0000000000000..7a4adfcdbecff --- /dev/null +++ b/packages/shared-ux/page/no_data/types/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "stripInternal": false, + "types": [] + }, + "include": [ + "*.d.ts" + ] +} diff --git a/packages/shared-ux/page/no_data_config/impl/BUILD.bazel b/packages/shared-ux/page/no_data_config/impl/BUILD.bazel new file mode 100644 index 0000000000000..73c069342a5a0 --- /dev/null +++ b/packages/shared-ux/page/no_data_config/impl/BUILD.bazel @@ -0,0 +1,138 @@ +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_DIRNAME = "impl" +PKG_REQUIRE_NAME = "@kbn/shared-ux-page-no-data-config" + +SOURCE_FILES = glob( + [ + "src/**/*.ts", + "src/**/*.tsx", + "src/**/*.mdx", + ], + exclude = [ + "**/*.test.*", + "**/*.stories.*", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +# In this array place runtime dependencies, including other packages and NPM packages +# which must be available for this code to run. +# +# To reference other packages use: +# "//repo/relative/path/to/package" +# eg. "//packages/kbn-utils" +# +# To reference a NPM package use: +# "@npm//name-of-package" +# eg. "@npm//lodash" +RUNTIME_DEPS = [ + "@npm//react", + "@npm//classnames", + "@npm//@elastic/eui", + "//packages/shared-ux/page/solution_nav", + "//packages/shared-ux/page/no_data/impl", +] + +# In this array place dependencies necessary to build the types, which will include the +# :npm_module_types target of other packages and packages from NPM, including @types/* +# packages. +# +# To reference the types for another package use: +# "//repo/relative/path/to/package:npm_module_types" +# eg. "//packages/kbn-utils:npm_module_types" +# +# References to NPM packages work the same as RUNTIME_DEPS +TYPES_DEPS = [ + "@npm//@types/node", + "@npm//@types/jest", + "@npm//@types/react", + "@npm//classnames", + "@npm//@elastic/eui", + "//packages/shared-ux/page/solution_nav:npm_module_types", + "//packages/shared-ux/page/no_data/impl:npm_module_types", + "//packages/shared-ux/page/no_data_config/types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", +) + +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", + 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", + root_dir = "src", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + 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 = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/shared-ux/page/no_data_config/impl/README.mdx b/packages/shared-ux/page/no_data_config/impl/README.mdx new file mode 100644 index 0000000000000..a7f73534bbd09 --- /dev/null +++ b/packages/shared-ux/page/no_data_config/impl/README.mdx @@ -0,0 +1,3 @@ +# @kbn/shared-ux-page-no-data-config + +Empty package generated by @kbn/generate diff --git a/packages/shared-ux/link/redirect_app/types/jest.config.js b/packages/shared-ux/page/no_data_config/impl/jest.config.js similarity index 80% rename from packages/shared-ux/link/redirect_app/types/jest.config.js rename to packages/shared-ux/page/no_data_config/impl/jest.config.js index 53269ab395d09..09a8f39000c1d 100644 --- a/packages/shared-ux/link/redirect_app/types/jest.config.js +++ b/packages/shared-ux/page/no_data_config/impl/jest.config.js @@ -7,7 +7,7 @@ */ module.exports = { - preset: '@kbn/test/jest_node', + preset: '@kbn/test', rootDir: '../../../../..', - roots: ['/packages/shared-ux/link/redirect_app/types'], + roots: ['/packages/shared-ux/page/no_data_config/impl'], }; diff --git a/packages/kbn-shared-ux-storybook/package.json b/packages/shared-ux/page/no_data_config/impl/package.json similarity index 77% rename from packages/kbn-shared-ux-storybook/package.json rename to packages/shared-ux/page/no_data_config/impl/package.json index c5f22bb151431..216bba70b5d50 100644 --- a/packages/kbn-shared-ux-storybook/package.json +++ b/packages/shared-ux/page/no_data_config/impl/package.json @@ -1,5 +1,5 @@ { - "name": "@kbn/shared-ux-storybook", + "name": "@kbn/shared-ux-page-no-data-config", "private": true, "version": "1.0.0", "main": "./target_node/index.js", diff --git a/packages/kbn-shared-ux-components/src/page_template/util/constants.ts b/packages/shared-ux/page/no_data_config/impl/src/constants.ts similarity index 78% rename from packages/kbn-shared-ux-components/src/page_template/util/constants.ts rename to packages/shared-ux/page/no_data_config/impl/src/constants.ts index 92dbe1cb16279..1c4c2685433d4 100644 --- a/packages/kbn-shared-ux-components/src/page_template/util/constants.ts +++ b/packages/shared-ux/page/no_data_config/impl/src/constants.ts @@ -6,11 +6,11 @@ * Side Public License, v 1. */ -import { KibanaPageTemplateProps } from '../types'; +import type { NoDataConfigPageProps } from '@kbn/shared-ux-page-no-data-config-types'; export const NO_DATA_PAGE_MAX_WIDTH = 950; -export const NO_DATA_PAGE_TEMPLATE_PROPS: KibanaPageTemplateProps = { +export const NO_DATA_PAGE_TEMPLATE_PROPS: NoDataConfigPageProps = { restrictWidth: NO_DATA_PAGE_MAX_WIDTH, template: 'centeredBody', pageContentProps: { diff --git a/src/core/server/saved_objects/version/index.ts b/packages/shared-ux/page/no_data_config/impl/src/index.ts similarity index 51% rename from src/core/server/saved_objects/version/index.ts rename to packages/shared-ux/page/no_data_config/impl/src/index.ts index 715073fb98e7d..baf373726144d 100644 --- a/src/core/server/saved_objects/version/index.ts +++ b/packages/shared-ux/page/no_data_config/impl/src/index.ts @@ -6,7 +6,10 @@ * Side Public License, v 1. */ -export * from './encode_version'; -export * from './encode_hit_version'; -export * from './decode_version'; -export * from './decode_request_version'; +export { NoDataConfigPage, NoDataConfigPageWithSolutionNavBar } from './no_data_config_page'; +export { NoDataConfigPageKibanaProvider, NoDataConfigPageProvider } from './services'; +export type { + NoDataConfigPageProps, + NoDataConfigPageServices, + NoDataConfigPageKibanaDependencies, +} from '@kbn/shared-ux-page-no-data-config-types'; diff --git a/packages/shared-ux/page/no_data_config/impl/src/no_data_config_page.stories.tsx b/packages/shared-ux/page/no_data_config/impl/src/no_data_config_page.stories.tsx new file mode 100644 index 0000000000000..3106a5b41416d --- /dev/null +++ b/packages/shared-ux/page/no_data_config/impl/src/no_data_config_page.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; + +import { NoDataConfigPageStorybookMock } from '@kbn/shared-ux-page-no-data-config-mocks'; +import type { NoDataConfigPageStorybookParams } from '@kbn/shared-ux-page-no-data-config-mocks'; + +import { NoDataConfigPage as Component } from './no_data_config_page'; + +import { NoDataConfigPageProvider } from './services'; +import mdx from '../README.mdx'; + +const mock = new NoDataConfigPageStorybookMock(); + +export default { + title: 'No Data/Page/No Data Config Page', + description: 'A component to display when there is no data available', + parameters: { + docs: { + page: mdx, + }, + }, +}; + +export const NoDataConfigPage = (params: NoDataConfigPageStorybookParams) => { + return ( + + + + ); +}; + +NoDataConfigPage.argTypes = mock.getArgumentTypes(); diff --git a/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/no_data_config_page.test.tsx b/packages/shared-ux/page/no_data_config/impl/src/no_data_config_page.test.tsx similarity index 55% rename from packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/no_data_config_page.test.tsx rename to packages/shared-ux/page/no_data_config/impl/src/no_data_config_page.test.tsx index dc618a068e120..fbd897314eceb 100644 --- a/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/no_data_config_page.test.tsx +++ b/packages/shared-ux/page/no_data_config/impl/src/no_data_config_page.test.tsx @@ -6,13 +6,17 @@ * Side Public License, v 1. */ -import { shallow } from 'enzyme'; import React from 'react'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; + +import { getNoDataConfigPageServicesMock } from '@kbn/shared-ux-page-no-data-config-mocks'; + import { NoDataConfigPage } from './no_data_config_page'; +import { NoDataConfigPageProvider } from './services'; describe('NoDataConfigPage', () => { const noDataConfig = { - solution: 'Kibana', + solution: 'Solution', logo: 'logoKibana', docsLink: 'test-link', action: { @@ -24,7 +28,12 @@ describe('NoDataConfigPage', () => { }, }; test('renders', () => { - const component = shallow(); - expect(component).toMatchSnapshot(); + const component = mountWithIntl( + + + + ); + expect(component.find('h1').html()).toContain('Welcome to Elastic Solution!'); + expect(component.find('button').html()).toContain('Click me'); }); }); diff --git a/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/no_data_config_page.tsx b/packages/shared-ux/page/no_data_config/impl/src/no_data_config_page.tsx similarity index 54% rename from packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/no_data_config_page.tsx rename to packages/shared-ux/page/no_data_config/impl/src/no_data_config_page.tsx index c21431a8107fe..f5153aa25686e 100644 --- a/packages/kbn-shared-ux-components/src/page_template/no_data_page/no_data_config_page/no_data_config_page.tsx +++ b/packages/shared-ux/page/no_data_config/impl/src/no_data_config_page.tsx @@ -7,29 +7,36 @@ */ import React from 'react'; +import classNames from 'classnames'; import { EuiPageTemplate } from '@elastic/eui'; + import { withSolutionNav } from '@kbn/shared-ux-page-solution-nav'; +import { NoDataPage } from '@kbn/shared-ux-page-no-data'; +import type { NoDataConfigPageProps } from '@kbn/shared-ux-page-no-data-config-types'; + +import { NO_DATA_PAGE_TEMPLATE_PROPS } from './constants'; -import { NoDataPage } from '../no_data_page'; -import { KibanaPageTemplateProps } from '../../types'; -import { getClasses, NO_DATA_PAGE_TEMPLATE_PROPS } from '../../util'; +const getClasses = (template?: string, className?: string) => { + return classNames( + 'kbnPageTemplate', + template ? { [`kbnPageTemplate--${template}`]: template } : '', + className || '' + ); +}; -export const NoDataConfigPage = (props: KibanaPageTemplateProps) => { - const { className, noDataConfig, ...rest } = props; +export const NoDataConfigPage = (props: NoDataConfigPageProps) => { + const { className: classNameProp, noDataConfig, ...rest } = props; if (!noDataConfig) { return null; } - const template = NO_DATA_PAGE_TEMPLATE_PROPS.template; - const classes = getClasses(template, className); + const className = getClasses(NO_DATA_PAGE_TEMPLATE_PROPS.template, classNameProp); return ( diff --git a/packages/shared-ux/page/no_data_config/impl/src/services.tsx b/packages/shared-ux/page/no_data_config/impl/src/services.tsx new file mode 100644 index 0000000000000..a7d0d118c053d --- /dev/null +++ b/packages/shared-ux/page/no_data_config/impl/src/services.tsx @@ -0,0 +1,35 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React, { FC } from 'react'; + +import { NoDataPageProvider, NoDataPageKibanaProvider } from '@kbn/shared-ux-page-no-data'; +import type { + NoDataConfigPageServices, + NoDataConfigPageKibanaDependencies, +} from '@kbn/shared-ux-page-no-data-config-types'; + +/** + * A Context Provider that provides services to the component and its dependencies. + */ +export const NoDataConfigPageProvider: FC = ({ + children, + ...services +}) => { + return {children}; +}; + +/** + * Kibana-specific Provider that maps dependencies to services. + */ +export const NoDataConfigPageKibanaProvider: FC = ({ + children, + ...dependencies +}) => { + return {children}; +}; diff --git a/packages/shared-ux/page/no_data_config/impl/tsconfig.json b/packages/shared-ux/page/no_data_config/impl/tsconfig.json new file mode 100644 index 0000000000000..40ed24ecac4d2 --- /dev/null +++ b/packages/shared-ux/page/no_data_config/impl/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "rootDir": "src", + "stripInternal": false, + "types": [ + "jest", + "node", + "react", + "@kbn/ambient-ui-types", + ] + }, + "include": [ + "src/**/*" + ] +} diff --git a/packages/shared-ux/page/no_data_config/mocks/BUILD.bazel b/packages/shared-ux/page/no_data_config/mocks/BUILD.bazel new file mode 100644 index 0000000000000..0a797fd6de629 --- /dev/null +++ b/packages/shared-ux/page/no_data_config/mocks/BUILD.bazel @@ -0,0 +1,140 @@ +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_DIRNAME = "mocks" +PKG_REQUIRE_NAME = "@kbn/shared-ux-page-no-data-config-mocks" + +SOURCE_FILES = glob( + [ + "src/**/*.ts", + ], + exclude = [ + "**/*.config.js", + "**/*.mock.*", + "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__", + "**/integration_tests", + "**/mocks", + "**/scripts", + "**/storybook", + "**/test_fixtures", + "**/test_helpers", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +# In this array place runtime dependencies, including other packages and NPM packages +# which must be available for this code to run. +# +# To reference other packages use: +# "//repo/relative/path/to/package" +# eg. "//packages/kbn-utils" +# +# To reference a NPM package use: +# "@npm//name-of-package" +# eg. "@npm//lodash" +RUNTIME_DEPS = [ + "@npm//react", + "//packages/shared-ux/page/no_data/mocks", +] + +# In this array place dependencies necessary to build the types, which will include the +# :npm_module_types target of other packages and packages from NPM, including @types/* +# packages. +# +# To reference the types for another package use: +# "//repo/relative/path/to/package:npm_module_types" +# eg. "//packages/kbn-utils:npm_module_types" +# +# References to NPM packages work the same as RUNTIME_DEPS +TYPES_DEPS = [ + "@npm//@types/jest", + "@npm//@types/node", + "@npm//@types/react", + "//packages/shared-ux/page/no_data_config/types", + "//packages/shared-ux/page/no_data/mocks:npm_module_types", + "//packages/shared-ux/storybook/mock:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", +) + +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", + 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", + root_dir = "src", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + 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 = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/shared-ux/page/no_data_config/mocks/README.md b/packages/shared-ux/page/no_data_config/mocks/README.md new file mode 100644 index 0000000000000..bcf739e2d9658 --- /dev/null +++ b/packages/shared-ux/page/no_data_config/mocks/README.md @@ -0,0 +1,3 @@ +# @kbn/shared-ux-page-no-data-config-mocks + +Empty package generated by @kbn/generate diff --git a/packages/shared-ux/page/no_data_config/mocks/package.json b/packages/shared-ux/page/no_data_config/mocks/package.json new file mode 100644 index 0000000000000..32245715f2b1b --- /dev/null +++ b/packages/shared-ux/page/no_data_config/mocks/package.json @@ -0,0 +1,8 @@ +{ + "name": "@kbn/shared-ux-page-no-data-config-mocks", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "browser": "./target_web/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/src/plugins/shared_ux/common/index.ts b/packages/shared-ux/page/no_data_config/mocks/src/index.ts old mode 100755 new mode 100644 similarity index 62% rename from src/plugins/shared_ux/common/index.ts rename to packages/shared-ux/page/no_data_config/mocks/src/index.ts index 92dee001d9012..4e6911f89e37b --- a/src/plugins/shared_ux/common/index.ts +++ b/packages/shared-ux/page/no_data_config/mocks/src/index.ts @@ -6,8 +6,7 @@ * Side Public License, v 1. */ -/** The ID of the Shared UX plugin. */ -export const PLUGIN_ID = 'sharedUX'; +export { getServicesMock as getNoDataConfigPageServicesMock } from './jest'; -/** The name of the Shared UX plugin. */ -export const PLUGIN_NAME = 'sharedUX'; +export { NoDataConfigPageStorybookMock } from './storybook'; +export type { Params as NoDataConfigPageStorybookParams } from './storybook'; diff --git a/packages/shared-ux/page/no_data_config/mocks/src/jest.ts b/packages/shared-ux/page/no_data_config/mocks/src/jest.ts new file mode 100644 index 0000000000000..f4f2c48e4ce03 --- /dev/null +++ b/packages/shared-ux/page/no_data_config/mocks/src/jest.ts @@ -0,0 +1,33 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { + NoDataConfigPageServices, + NoDataConfigPageKibanaDependencies, +} from '@kbn/shared-ux-page-no-data-config-types'; + +import { + getNoDataPageServicesMock, + getNoDataPageKibanaDependenciesMock, +} from '@kbn/shared-ux-page-no-data-mocks'; + +export const getServicesMock = () => { + const services: NoDataConfigPageServices = { + ...getNoDataPageServicesMock(), + }; + + return services; +}; + +export const getKibanaDependenciesMock = () => { + const dependencies: NoDataConfigPageKibanaDependencies = { + ...getNoDataPageKibanaDependenciesMock(), + }; + + return dependencies; +}; diff --git a/packages/shared-ux/page/no_data_config/mocks/src/storybook.ts b/packages/shared-ux/page/no_data_config/mocks/src/storybook.ts new file mode 100644 index 0000000000000..5c36fc79f90a7 --- /dev/null +++ b/packages/shared-ux/page/no_data_config/mocks/src/storybook.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 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 { AbstractStorybookMock } from '@kbn/shared-ux-storybook-mock'; +import type { ArgumentParams } from '@kbn/shared-ux-storybook-mock'; + +import type { + NoDataConfig, + NoDataConfigPageProps, + NoDataConfigPageServices, +} from '@kbn/shared-ux-page-no-data-config-types'; +import { NoDataPageStorybookMock } from '@kbn/shared-ux-page-no-data-mocks'; +import type { NoDataPageStorybookParams } from '@kbn/shared-ux-page-no-data-mocks'; + +type PropArguments = Pick; + +export type Params = ArgumentParams & NoDataPageStorybookParams; + +const dataPageMock = new NoDataPageStorybookMock(); + +export class NoDataConfigPageStorybookMock extends AbstractStorybookMock< + NoDataConfigPageProps, + NoDataConfigPageServices, + PropArguments +> { + propArguments = { + solution: { + control: 'text', + defaultValue: 'Observability', + }, + logo: { + control: { type: 'radio' }, + options: ['logoElastic', 'logoKibana', 'logoCloud', undefined], + defaultValue: undefined, + }, + docsLink: { + control: 'text', + defaultValue: 'docs/link', + }, + pageTitle: { + control: 'text', + defaultValue: '', + }, + }; + + serviceArguments = {}; + + dependencies = [dataPageMock]; + + getProps(params?: Params): NoDataConfigPageProps { + return { + noDataConfig: { + action: { + elasticAgent: { + title: 'Add Integrations', + }, + }, + solution: this.getArgumentValue('solution', params), + logo: this.getArgumentValue('logo', params), + docsLink: this.getArgumentValue('docsLink', params), + pageTitle: this.getArgumentValue('pageTitle', params), + }, + }; + } + + getServices(params: Params): NoDataConfigPageServices { + return { ...dataPageMock.getServices(params) }; + } +} diff --git a/packages/shared-ux/page/no_data_config/mocks/tsconfig.json b/packages/shared-ux/page/no_data_config/mocks/tsconfig.json new file mode 100644 index 0000000000000..dc96ec41f9035 --- /dev/null +++ b/packages/shared-ux/page/no_data_config/mocks/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "rootDir": "src", + "stripInternal": false, + "types": [ + "jest", + "node", + "react" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ] +} diff --git a/packages/shared-ux/page/no_data_config/types/BUILD.bazel b/packages/shared-ux/page/no_data_config/types/BUILD.bazel new file mode 100644 index 0000000000000..6fa1669fcc176 --- /dev/null +++ b/packages/shared-ux/page/no_data_config/types/BUILD.bazel @@ -0,0 +1,59 @@ +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_DIRNAME = "types" +PKG_REQUIRE_NAME = "@kbn/shared-ux-page-no-data-config-types" + +SRCS = glob( + [ + "*.d.ts", + ] +) + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +# In this array place runtime dependencies, including other packages and NPM packages +# which must be available for this code to run. +# +# To reference other packages use: +# "//repo/relative/path/to/package" +# eg. "//packages/kbn-utils" +# +# To reference a NPM package use: +# "@npm//name-of-package" +# eg. "@npm//lodash" +RUNTIME_DEPS = [ +] + +js_library( + name = PKG_DIRNAME, + srcs = SRCS + NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS, + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +alias( + name = "npm_module_types", + actual = ":" + PKG_DIRNAME, + visibility = ["//visibility:public"], +) diff --git a/packages/shared-ux/page/no_data_config/types/README.md b/packages/shared-ux/page/no_data_config/types/README.md new file mode 100644 index 0000000000000..dd146f60dcf4b --- /dev/null +++ b/packages/shared-ux/page/no_data_config/types/README.md @@ -0,0 +1,3 @@ +# @kbn/shared-ux-page-no-data-config-types + +Empty package generated by @kbn/generate diff --git a/packages/shared-ux/page/no_data_config/types/index.d.ts b/packages/shared-ux/page/no_data_config/types/index.d.ts new file mode 100644 index 0000000000000..10950bcf296c8 --- /dev/null +++ b/packages/shared-ux/page/no_data_config/types/index.d.ts @@ -0,0 +1,27 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { EuiPageTemplateProps } from '@elastic/eui'; + +import type { + NoDataPageProps, + NoDataPageServices, + NoDataPageKibanaDependencies, +} from '@kbn/shared-ux-page-no-data-types'; + +export type NoDataConfigPageKibanaDependencies = NoDataPageKibanaDependencies; +export type NoDataConfigPageServices = NoDataPageServices; +export type NoDataConfig = NoDataPageProps; + +export type NoDataConfigPageProps = EuiPageTemplateProps & { + /** + * Accepts a configuration object, that when provided, ignores pageHeader and children and instead + * displays Agent, Beats, and custom cards to direct users to the right ingest location + */ + noDataConfig?: NoDataConfig; +}; diff --git a/packages/shared-ux/page/no_data_config/types/package.json b/packages/shared-ux/page/no_data_config/types/package.json new file mode 100644 index 0000000000000..1af47fb4c5028 --- /dev/null +++ b/packages/shared-ux/page/no_data_config/types/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/shared-ux-page-no-data-config-types", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} diff --git a/packages/shared-ux/page/no_data_config/types/tsconfig.json b/packages/shared-ux/page/no_data_config/types/tsconfig.json new file mode 100644 index 0000000000000..7a4adfcdbecff --- /dev/null +++ b/packages/shared-ux/page/no_data_config/types/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../../../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "stripInternal": false, + "types": [] + }, + "include": [ + "*.d.ts" + ] +} diff --git a/packages/shared-ux/page/solution_nav/src/solution_nav.stories.tsx b/packages/shared-ux/page/solution_nav/src/solution_nav.stories.tsx index 9613fbac42f6e..2f22aad173771 100644 --- a/packages/shared-ux/page/solution_nav/src/solution_nav.stories.tsx +++ b/packages/shared-ux/page/solution_nav/src/solution_nav.stories.tsx @@ -11,7 +11,7 @@ import { action } from '@storybook/addon-actions'; import { SolutionNav as Component, SolutionNavProps } from './solution_nav'; export default { - title: 'Page Template', + title: 'Page/Solution Nav', description: 'Solution-specific navigation for the sidebar', }; diff --git a/packages/shared-ux/prompt/no_data_views/impl/src/index.ts b/packages/shared-ux/prompt/no_data_views/impl/src/index.ts index 9483e5406da4c..48afcb7936997 100644 --- a/packages/shared-ux/prompt/no_data_views/impl/src/index.ts +++ b/packages/shared-ux/prompt/no_data_views/impl/src/index.ts @@ -8,7 +8,7 @@ export type { NoDataViewsPromptComponentProps, - NoDataViewsPromptKibanaServices, + NoDataViewsPromptKibanaDependencies, NoDataViewsPromptProps, NoDataViewsPromptServices, } from '@kbn/shared-ux-prompt-no-data-views-types'; diff --git a/packages/shared-ux/prompt/no_data_views/impl/src/no_data_views.stories.tsx b/packages/shared-ux/prompt/no_data_views/impl/src/no_data_views.stories.tsx index 56d4ec63d2eaa..748687fbda5e8 100644 --- a/packages/shared-ux/prompt/no_data_views/impl/src/no_data_views.stories.tsx +++ b/packages/shared-ux/prompt/no_data_views/impl/src/no_data_views.stories.tsx @@ -29,7 +29,7 @@ export default { const mock = new NoDataViewsPromptStorybookMock(); -export const NoDataViews = (params: NoDataViewsPromptStorybookParams) => { +export const Prompt = (params: NoDataViewsPromptStorybookParams) => { return ( @@ -37,4 +37,4 @@ export const NoDataViews = (params: NoDataViewsPromptStorybookParams) => { ); }; -NoDataViews.argTypes = mock.getArgumentTypes(); +Prompt.argTypes = mock.getArgumentTypes(); diff --git a/packages/shared-ux/prompt/no_data_views/impl/src/services.tsx b/packages/shared-ux/prompt/no_data_views/impl/src/services.tsx index cf6236429441f..b8fe90e1ef135 100644 --- a/packages/shared-ux/prompt/no_data_views/impl/src/services.tsx +++ b/packages/shared-ux/prompt/no_data_views/impl/src/services.tsx @@ -9,7 +9,7 @@ import React, { FC, useContext } from 'react'; import type { NoDataViewsPromptServices, - NoDataViewsPromptKibanaServices, + NoDataViewsPromptKibanaDependencies, } from '@kbn/shared-ux-prompt-no-data-views-types'; const NoDataViewsPromptContext = React.createContext(null); @@ -37,7 +37,7 @@ export const NoDataViewsPromptProvider: FC = ({ /** * Kibana-specific Provider that maps to known dependency types. */ -export const NoDataViewsPromptKibanaProvider: FC = ({ +export const NoDataViewsPromptKibanaProvider: FC = ({ children, ...services }) => { diff --git a/packages/shared-ux/prompt/no_data_views/mocks/BUILD.bazel b/packages/shared-ux/prompt/no_data_views/mocks/BUILD.bazel index 21099840dc91e..6f725e99b6147 100644 --- a/packages/shared-ux/prompt/no_data_views/mocks/BUILD.bazel +++ b/packages/shared-ux/prompt/no_data_views/mocks/BUILD.bazel @@ -10,8 +10,17 @@ SOURCE_FILES = glob( "src/**/*.ts", ], exclude = [ + "**/*.config.js", + "**/*.mock.*", "**/*.test.*", "**/*.stories.*", + "**/__snapshots__", + "**/integration_tests", + "**/mocks", + "**/scripts", + "**/storybook", + "**/test_fixtures", + "**/test_helpers", ], ) @@ -38,6 +47,7 @@ NPM_MODULE_EXTRA_FILES = [ # eg. "@npm//lodash" RUNTIME_DEPS = [ "@npm//@storybook/addon-actions", + "@npm//react", "//packages/shared-ux/storybook/mock", ] @@ -51,9 +61,10 @@ RUNTIME_DEPS = [ # # References to NPM packages work the same as RUNTIME_DEPS TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", "@npm//@storybook/addon-actions", + "@npm//@types/jest", + "@npm//@types/node", + "@npm//@types/react", "//packages/shared-ux/prompt/no_data_views/types:npm_module_types", "//packages/shared-ux/storybook/mock:npm_module_types", ] @@ -65,6 +76,14 @@ jsts_transpiler( root_input_dir = "src", ) +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", + web = True, +) + ts_config( name = "tsconfig", src = "tsconfig.json", @@ -90,7 +109,7 @@ ts_project( js_library( name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], + deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/prompt/no_data_views/mocks/jest.config.js b/packages/shared-ux/prompt/no_data_views/mocks/jest.config.js deleted file mode 100644 index 1efd78b09a8b1..0000000000000 --- a/packages/shared-ux/prompt/no_data_views/mocks/jest.config.js +++ /dev/null @@ -1,13 +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/jest_node', - rootDir: '../../../../..', - roots: ['/packages/shared-ux/prompt/no_data_views/mocks'], -}; diff --git a/packages/shared-ux/prompt/no_data_views/mocks/package.json b/packages/shared-ux/prompt/no_data_views/mocks/package.json index b00c829ace8e5..2478bd3e76dd4 100644 --- a/packages/shared-ux/prompt/no_data_views/mocks/package.json +++ b/packages/shared-ux/prompt/no_data_views/mocks/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", + "browser": "./target_web/index.js", "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/shared-ux/prompt/no_data_views/mocks/tsconfig.json b/packages/shared-ux/prompt/no_data_views/mocks/tsconfig.json index 894f01d3220e9..dc96ec41f9035 100644 --- a/packages/shared-ux/prompt/no_data_views/mocks/tsconfig.json +++ b/packages/shared-ux/prompt/no_data_views/mocks/tsconfig.json @@ -9,10 +9,12 @@ "stripInternal": false, "types": [ "jest", - "node" + "node", + "react" ] }, "include": [ - "src/**/*" + "**/*.ts", + "**/*.tsx", ] } diff --git a/packages/shared-ux/prompt/no_data_views/types/index.d.ts b/packages/shared-ux/prompt/no_data_views/types/index.d.ts index e143e4e6d035c..4b428cc64ad3d 100644 --- a/packages/shared-ux/prompt/no_data_views/types/index.d.ts +++ b/packages/shared-ux/prompt/no_data_views/types/index.d.ts @@ -42,7 +42,7 @@ export interface NoDataViewsPromptServices { /** * Kibana-specific service types. */ -export interface NoDataViewsPromptKibanaServices { +export interface NoDataViewsPromptKibanaDependencies { coreStart: { docLinks: { links: { diff --git a/packages/kbn-shared-ux-storybook/BUILD.bazel b/packages/shared-ux/storybook/config/BUILD.bazel similarity index 88% rename from packages/kbn-shared-ux-storybook/BUILD.bazel rename to packages/shared-ux/storybook/config/BUILD.bazel index 4f710f2dbe120..1f35734bb2147 100644 --- a/packages/kbn-shared-ux-storybook/BUILD.bazel +++ b/packages/shared-ux/storybook/config/BUILD.bazel @@ -2,16 +2,25 @@ 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_DIRNAME = "kbn-shared-ux-storybook" -PKG_REQUIRE_NAME = "@kbn/shared-ux-storybook" +PKG_DIRNAME = "config" +PKG_REQUIRE_NAME = "@kbn/shared-ux-storybook-config" SOURCE_FILES = glob( [ - "src/**/*.ts", - "src/**/*.tsx", + "**/*.ts", ], exclude = [ + "**/*.config.js", + "**/*.mock.*", "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__", + "**/integration_tests", + "**/mocks", + "**/scripts", + "**/storybook", + "**/test_fixtures", + "**/test_helpers", ], ) @@ -37,10 +46,10 @@ NPM_MODULE_EXTRA_FILES = [ # "@npm//name-of-package" # eg. "@npm//lodash" RUNTIME_DEPS = [ - "//packages/kbn-shared-ux-services", "//packages/kbn-storybook", "@npm//@storybook/react", "@npm//@storybook/addon-actions", + "@npm//jest-mock", ] # In this array place dependencies necessary to build the types, which will include the @@ -53,7 +62,7 @@ RUNTIME_DEPS = [ # # References to NPM packages work the same as RUNTIME_DEPS TYPES_DEPS = [ - "//packages/kbn-shared-ux-services:npm_module_types", + "@npm//jest-mock", "//packages/kbn-storybook:npm_module_types", "//packages/kbn-ambient-ui-types:npm_module_types", "//packages/kbn-ambient-storybook-types:npm_module_types", @@ -67,14 +76,12 @@ jsts_transpiler( name = "target_node", srcs = SRCS, build_pkg_name = package_name(), - root_input_dir = "src", ) jsts_transpiler( name = "target_web", srcs = SRCS, build_pkg_name = package_name(), - root_input_dir = "src", web = True, ) @@ -96,7 +103,7 @@ ts_project( declaration_map = True, emit_declaration_only = True, out_dir = "target_types", - root_dir = "src", + root_dir = ".", tsconfig = ":tsconfig", ) diff --git a/packages/shared-ux/storybook/config/README.mdx b/packages/shared-ux/storybook/config/README.mdx new file mode 100644 index 0000000000000..eeab8f1f4c987 --- /dev/null +++ b/packages/shared-ux/storybook/config/README.mdx @@ -0,0 +1,3 @@ +# @kbn/shared-ux-storybook-config + +Storybook configuration used by `yarn storybook`. Refer to `@kbn/storybook` for more information. diff --git a/packages/kbn-shared-ux-components/src/page_template/util/presentation.ts b/packages/shared-ux/storybook/config/constants.ts similarity index 58% rename from packages/kbn-shared-ux-components/src/page_template/util/presentation.ts rename to packages/shared-ux/storybook/config/constants.ts index ab7144ee37b57..8efe045ad57a1 100644 --- a/packages/kbn-shared-ux-components/src/page_template/util/presentation.ts +++ b/packages/shared-ux/storybook/config/constants.ts @@ -6,8 +6,8 @@ * Side Public License, v 1. */ -import classNames from 'classnames'; +/** The title of the Storybook. */ +export const TITLE = 'Shared UX Storybook'; -export const getClasses = (template: string | undefined, className: string | undefined) => { - return classNames('kbnPageTemplate', { [`kbnPageTemplate--${template}`]: template }, className); -}; +/** The remote URL of the root from which Storybook loads stories for Shared UX. */ +export const URL = 'https://github.com/elastic/kibana/tree/main/packages/shared_ux'; diff --git a/packages/kbn-shared-ux-components/src/page_template/util/index.ts b/packages/shared-ux/storybook/config/index.ts similarity index 82% rename from packages/kbn-shared-ux-components/src/page_template/util/index.ts rename to packages/shared-ux/storybook/config/index.ts index adfefdf834566..5a73da614bf27 100644 --- a/packages/kbn-shared-ux-components/src/page_template/util/index.ts +++ b/packages/shared-ux/storybook/config/index.ts @@ -6,5 +6,4 @@ * Side Public License, v 1. */ -export { getClasses } from './presentation'; -export * from './constants'; +export { TITLE, URL } from './constants'; diff --git a/packages/kbn-shared-ux-storybook/src/config/main.ts b/packages/shared-ux/storybook/config/main.ts similarity index 72% rename from packages/kbn-shared-ux-storybook/src/config/main.ts rename to packages/shared-ux/storybook/config/main.ts index 6e57ca8ad5e72..47a47a5a802b3 100644 --- a/packages/kbn-shared-ux-storybook/src/config/main.ts +++ b/packages/shared-ux/storybook/config/main.ts @@ -10,11 +10,7 @@ import { defaultConfig } from '@kbn/storybook'; module.exports = { ...defaultConfig, - stories: [ - '../../../shared-ux/**/*.stories.+(tsx|mdx)', - '../../../kbn-shared-ux*/**/*.stories.+(tsx|mdx)', - '../../../../src/plugins/shared_ux/**/*.stories.+(tsx|mdx)', - ], + stories: ['../../**/*.stories.+(tsx|mdx)'], reactOptions: { strictMode: true, }, diff --git a/packages/kbn-shared-ux-storybook/src/config/manager.ts b/packages/shared-ux/storybook/config/manager.ts similarity index 72% rename from packages/kbn-shared-ux-storybook/src/config/manager.ts rename to packages/shared-ux/storybook/config/manager.ts index 64284fb46f36f..fb973258b9053 100644 --- a/packages/kbn-shared-ux-storybook/src/config/manager.ts +++ b/packages/shared-ux/storybook/config/manager.ts @@ -8,14 +8,16 @@ import { addons } from '@storybook/addons'; import { create } from '@storybook/theming'; -import { PANEL_ID } from '@storybook/addon-actions'; +import { PANEL_ID as selectedPanel } from '@storybook/addon-actions'; + +import { TITLE as brandTitle, URL as brandUrl } from './constants'; addons.setConfig({ theme: create({ base: 'light', - brandTitle: 'Shared UX Storybook', - brandUrl: 'https://github.com/elastic/kibana/tree/main/src/plugins/shared_ux', + brandTitle, + brandUrl, }), + selectedPanel, showPanel: true.valueOf, - selectedPanel: PANEL_ID, }); diff --git a/packages/kbn-shared-ux-components/package.json b/packages/shared-ux/storybook/config/package.json similarity index 78% rename from packages/kbn-shared-ux-components/package.json rename to packages/shared-ux/storybook/config/package.json index 948df7fadd712..ee7206b2d87df 100644 --- a/packages/kbn-shared-ux-components/package.json +++ b/packages/shared-ux/storybook/config/package.json @@ -1,8 +1,8 @@ { - "name": "@kbn/shared-ux-components", + "name": "@kbn/shared-ux-storybook-config", "private": true, "version": "1.0.0", "main": "./target_node/index.js", "browser": "./target_web/index.js", "license": "SSPL-1.0 OR Elastic License 2.0" -} +} \ No newline at end of file diff --git a/packages/shared-ux/storybook/config/preview.ts b/packages/shared-ux/storybook/config/preview.ts new file mode 100644 index 0000000000000..5a53e48a916d8 --- /dev/null +++ b/packages/shared-ux/storybook/config/preview.ts @@ -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 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. + */ + +/* eslint-disable @typescript-eslint/no-namespace,@typescript-eslint/no-empty-interface */ +declare global { + namespace NodeJS { + interface Global {} + interface InspectOptions {} + type ConsoleConstructor = console.ConsoleConstructor; + } +} +/* eslint-enable */ + +import jest from 'jest-mock'; +/* @ts-expect-error TS doesn't see jest as a property of window, and I don't want to edit our global config. */ +window.jest = jest; diff --git a/packages/kbn-shared-ux-storybook/tsconfig.json b/packages/shared-ux/storybook/config/tsconfig.json similarity index 78% rename from packages/kbn-shared-ux-storybook/tsconfig.json rename to packages/shared-ux/storybook/config/tsconfig.json index b26c95a01dfd8..835b78a44758d 100644 --- a/packages/kbn-shared-ux-storybook/tsconfig.json +++ b/packages/shared-ux/storybook/config/tsconfig.json @@ -1,11 +1,11 @@ { - "extends": "../../tsconfig.bazel.json", + "extends": "../../../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, "declarationMap": true, "emitDeclarationOnly": true, "outDir": "target_types", - "rootDir": "src", + "rootDir": ".", "stripInternal": false, "types": [ "jest", @@ -14,6 +14,6 @@ ] }, "include": [ - "src/**/*" + "*.ts" ] } diff --git a/packages/shared-ux/storybook/mock/BUILD.bazel b/packages/shared-ux/storybook/mock/BUILD.bazel index 71b1a263ea0af..c77d05261bc1d 100644 --- a/packages/shared-ux/storybook/mock/BUILD.bazel +++ b/packages/shared-ux/storybook/mock/BUILD.bazel @@ -10,8 +10,17 @@ SOURCE_FILES = glob( "src/**/*.ts", ], exclude = [ + "**/*.config.js", + "**/*.mock.*", "**/*.test.*", "**/*.stories.*", + "**/__snapshots__", + "**/integration_tests", + "**/mocks", + "**/scripts", + "**/storybook", + "**/test_fixtures", + "**/test_helpers", ], ) @@ -37,6 +46,8 @@ NPM_MODULE_EXTRA_FILES = [ # "@npm//name-of-package" # eg. "@npm//lodash" RUNTIME_DEPS = [ + "@npm//@storybook/react", + "@npm//react", ] # In this array place dependencies necessary to build the types, which will include the @@ -49,9 +60,10 @@ RUNTIME_DEPS = [ # # References to NPM packages work the same as RUNTIME_DEPS TYPES_DEPS = [ - "@npm//@types/node", - "@npm//@types/jest", "@npm//@storybook/react", + "@npm//@types/jest", + "@npm//@types/node", + "@npm//@types/react", ] jsts_transpiler( @@ -61,6 +73,14 @@ jsts_transpiler( root_input_dir = "src", ) +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + root_input_dir = "src", + web = True, +) + ts_config( name = "tsconfig", src = "tsconfig.json", @@ -86,7 +106,7 @@ ts_project( js_library( name = PKG_DIRNAME, srcs = NPM_MODULE_EXTRA_FILES, - deps = RUNTIME_DEPS + [":target_node"], + deps = RUNTIME_DEPS + [":target_node", ":target_web"], package_name = PKG_REQUIRE_NAME, visibility = ["//visibility:public"], ) diff --git a/packages/shared-ux/storybook/mock/package.json b/packages/shared-ux/storybook/mock/package.json index 18761aab4c92c..0baee9437cac0 100644 --- a/packages/shared-ux/storybook/mock/package.json +++ b/packages/shared-ux/storybook/mock/package.json @@ -3,5 +3,6 @@ "private": true, "version": "1.0.0", "main": "./target_node/index.js", + "browser": "./target_web/index.js", "license": "SSPL-1.0 OR Elastic License 2.0" } \ No newline at end of file diff --git a/packages/shared-ux/storybook/mock/tsconfig.json b/packages/shared-ux/storybook/mock/tsconfig.json index 39d3c7097814a..7b7386979c9a8 100644 --- a/packages/shared-ux/storybook/mock/tsconfig.json +++ b/packages/shared-ux/storybook/mock/tsconfig.json @@ -9,10 +9,12 @@ "stripInternal": false, "types": [ "jest", - "node" + "node", + "react" ] }, "include": [ - "src/**/*" + "**/*.ts", + "**/*.tsx", ] } diff --git a/renovate.json b/renovate.json index 49337a00d7246..5668714d4271c 100644 --- a/renovate.json +++ b/renovate.json @@ -168,7 +168,7 @@ }, { "groupName": "react-query", - "packageNames": ["react-query"], + "packageNames": ["@tanstack/react-query", "@tanstack/react-query-devtools"], "reviewers": [ "team:response-ops", "team:kibana-cloud-security-posture", diff --git a/scripts/synthtrace.js b/scripts/synthtrace.js index 5e551acf84769..bffa55065a17f 100644 --- a/scripts/synthtrace.js +++ b/scripts/synthtrace.js @@ -9,8 +9,8 @@ require('../src/setup_node_env'); // We have to import directly from package since scenarios and worker.js are imported dynamically, -// If we import the package (require('@elastic/apm-synthtrace')) the program will be executed on the compiled files, and thus we need to +// If we import the package (require('@kbn/apm-synthtrace')) the program will be executed on the compiled files, and thus we need to // compile scenarios with `yarn kbn bootstrap` every time scenario changes. // eslint-disable-next-line @kbn/imports/uniform_imports -require('../packages/elastic-apm-synthtrace/src/cli').runSynthtrace(); +require('../packages/kbn-apm-synthtrace/src/cli').runSynthtrace(); diff --git a/src/cli/command.js b/src/cli/command.js index 6174cab85dec3..b85037330027b 100644 --- a/src/cli/command.js +++ b/src/cli/command.js @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import _ from 'lodash'; import Chalk from 'chalk'; diff --git a/src/cli/keystore/read_keystore.js b/src/cli/keystore/read_keystore.js index d3629c32671f7..a4f007690a661 100644 --- a/src/cli/keystore/read_keystore.js +++ b/src/cli/keystore/read_keystore.js @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { Keystore } from '.'; import { getKeystore } from '../../cli_keystore/get_keystore'; diff --git a/src/cli/serve/serve.js b/src/cli/serve/serve.js index 6425b0d6c8005..d5c1f844c4d1c 100644 --- a/src/cli/serve/serve.js +++ b/src/cli/serve/serve.js @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { set as lodashSet } from '@elastic/safer-lodash-set'; +import { set as lodashSet } from '@kbn/safer-lodash-set'; import _ from 'lodash'; import { statSync } from 'fs'; import { resolve } from 'path'; diff --git a/src/core/server/core_usage_data/core_usage_data_service.test.ts b/src/core/server/core_usage_data/core_usage_data_service.test.ts index c45b3fdb0a125..5ac2863745ee7 100644 --- a/src/core/server/core_usage_data/core_usage_data_service.test.ts +++ b/src/core/server/core_usage_data/core_usage_data_service.test.ts @@ -18,14 +18,14 @@ import { mockCoreContext } from '@kbn/core-base-server-mocks'; import { config as RawLoggingConfig } from '@kbn/core-logging-server-internal'; import { config as RawElasticsearchConfig } from '@kbn/core-elasticsearch-server-internal'; import { config as RawHttpConfig } from '@kbn/core-http-server-internal'; -import { savedObjectsConfig as RawSavedObjectsConfig } from '../saved_objects/saved_objects_config'; +import { savedObjectsConfig as RawSavedObjectsConfig } from '@kbn/core-saved-objects-base-server-internal'; import { httpServiceMock } from '@kbn/core-http-server-mocks'; import { metricsServiceMock } from '@kbn/core-metrics-server-mocks'; import { savedObjectsServiceMock } from '../saved_objects/saved_objects_service.mock'; import { CoreUsageDataService } from './core_usage_data_service'; import { elasticsearchServiceMock } from '@kbn/core-elasticsearch-server-mocks'; -import { typeRegistryMock } from '../saved_objects/saved_objects_type_registry.mock'; +import { typeRegistryMock } from '@kbn/core-saved-objects-base-server-mocks'; import { CORE_USAGE_STATS_TYPE } from './constants'; import { CoreUsageStatsClient } from './core_usage_stats_client'; diff --git a/src/core/server/core_usage_data/core_usage_data_service.ts b/src/core/server/core_usage_data/core_usage_data_service.ts index f1e51a7e5f5aa..c5f2335e333e4 100644 --- a/src/core/server/core_usage_data/core_usage_data_service.ts +++ b/src/core/server/core_usage_data/core_usage_data_service.ts @@ -23,9 +23,12 @@ import type { HttpConfigType, InternalHttpServiceSetup } from '@kbn/core-http-se import type { ElasticsearchServiceStart } from '@kbn/core-elasticsearch-server'; import type { ElasticsearchConfigType } from '@kbn/core-elasticsearch-server-internal'; import type { MetricsServiceSetup, OpsMetrics } from '@kbn/core-metrics-server'; -import { SavedObjectsServiceStart, SavedObjectTypeRegistry } from '..'; +import { + LEGACY_URL_ALIAS_TYPE, + type SavedObjectsConfigType, +} from '@kbn/core-saved-objects-base-server-internal'; -import { SavedObjectsConfigType } from '../saved_objects/saved_objects_config'; +import { SavedObjectsServiceStart, SavedObjectTypeRegistry } from '..'; import type { CoreServicesUsageData, CoreUsageData, @@ -36,7 +39,6 @@ import type { } from './types'; import { isConfigured } from './is_configured'; import { coreUsageStatsType } from './core_usage_stats'; -import { LEGACY_URL_ALIAS_TYPE } from '../saved_objects/object_types'; import { CORE_USAGE_STATS_TYPE } from './constants'; import { CoreUsageStatsClient } from './core_usage_stats_client'; import { CoreIncrementUsageCounter } from './types'; diff --git a/src/core/server/core_usage_data/core_usage_stats_client.test.ts b/src/core/server/core_usage_data/core_usage_stats_client.test.ts index 6bcaa38bd0062..9a6984f6b5785 100644 --- a/src/core/server/core_usage_data/core_usage_stats_client.test.ts +++ b/src/core/server/core_usage_data/core_usage_stats_client.test.ts @@ -29,8 +29,8 @@ import { LEGACY_DASHBOARDS_EXPORT_STATS_PREFIX, BULK_RESOLVE_STATS_PREFIX, } from './core_usage_stats_client'; +import { DEFAULT_NAMESPACE_STRING } from '@kbn/core-saved-objects-utils-server'; import { CoreUsageStatsClient } from '.'; -import { DEFAULT_NAMESPACE_STRING } from '../saved_objects/service/lib/utils'; describe('CoreUsageStatsClient', () => { const setup = (namespace?: string) => { diff --git a/src/core/server/core_usage_data/core_usage_stats_client.ts b/src/core/server/core_usage_data/core_usage_stats_client.ts index 2dd8c77fd1876..c14776ff7ed81 100644 --- a/src/core/server/core_usage_data/core_usage_stats_client.ts +++ b/src/core/server/core_usage_data/core_usage_stats_client.ts @@ -6,9 +6,9 @@ * Side Public License, v 1. */ +import { DEFAULT_NAMESPACE_STRING } from '@kbn/core-saved-objects-utils-server'; import { CORE_USAGE_STATS_TYPE, CORE_USAGE_STATS_ID } from './constants'; import { CoreUsageStats } from './types'; -import { DEFAULT_NAMESPACE_STRING } from '../saved_objects/service/lib/utils'; import { ISavedObjectsRepository, SavedObjectsImportOptions, diff --git a/src/core/server/index.ts b/src/core/server/index.ts index 0f365366206d2..3327340c91a8c 100644 --- a/src/core/server/index.ts +++ b/src/core/server/index.ts @@ -388,6 +388,12 @@ export type { ISavedObjectsSerializer, SavedObjectsRequestHandlerContext, } from '@kbn/core-saved-objects-server'; +export { + SavedObjectsErrorHelpers, + SavedObjectsUtils, + mergeSavedObjectMigrationMaps, +} from '@kbn/core-saved-objects-utils-server'; +export { SavedObjectTypeRegistry } from '@kbn/core-saved-objects-base-server-internal'; export type { SavedObjectsRepository, @@ -396,14 +402,7 @@ export type { SavedObjectsImporter, SavedObjectsImportError, } from './saved_objects'; -export { - SavedObjectsClient, - SavedObjectsErrorHelpers, - SavedObjectsSerializer, - SavedObjectTypeRegistry, - SavedObjectsUtils, - mergeSavedObjectMigrationMaps, -} from './saved_objects'; +export { SavedObjectsClient } from './saved_objects'; export type { IUiSettingsClient, diff --git a/src/core/server/integration_tests/saved_objects/routes/delete_unknown_types.test.ts b/src/core/server/integration_tests/saved_objects/routes/delete_unknown_types.test.ts index 4a13921750d1f..b4a215169a376 100644 --- a/src/core/server/integration_tests/saved_objects/routes/delete_unknown_types.test.ts +++ b/src/core/server/integration_tests/saved_objects/routes/delete_unknown_types.test.ts @@ -8,8 +8,8 @@ import supertest from 'supertest'; import { elasticsearchServiceMock } from '@kbn/core-elasticsearch-server-mocks'; +import { typeRegistryMock } from '@kbn/core-saved-objects-base-server-mocks'; import { registerDeleteUnknownTypesRoute } from '../../../saved_objects/routes/deprecations'; -import { typeRegistryMock } from '../../../saved_objects/saved_objects_type_registry.mock'; import { setupServer } from '../../../saved_objects/routes/test_utils'; import { SavedObjectsType } from '../../..'; import type { InternalSavedObjectsRequestHandlerContext } from '../../../saved_objects/internal_types'; diff --git a/src/core/server/integration_tests/saved_objects/routes/export.test.ts b/src/core/server/integration_tests/saved_objects/routes/export.test.ts index 358a23902d5e1..b107d1266fe3c 100644 --- a/src/core/server/integration_tests/saved_objects/routes/export.test.ts +++ b/src/core/server/integration_tests/saved_objects/routes/export.test.ts @@ -16,7 +16,7 @@ import { CoreUsageStatsClient } from '../../../core_usage_data'; import { coreUsageStatsClientMock } from '../../../core_usage_data/core_usage_stats_client.mock'; import { coreUsageDataServiceMock } from '../../../core_usage_data/core_usage_data_service.mock'; import { savedObjectsExporterMock } from '../../../saved_objects/export/saved_objects_exporter.mock'; -import { SavedObjectConfig } from '../../../saved_objects/saved_objects_config'; +import type { SavedObjectConfig } from '@kbn/core-saved-objects-base-server-internal'; import { registerExportRoute } from '../../../saved_objects/routes/export'; import { setupServer, createExportableType } from '../../../saved_objects/routes/test_utils'; import type { InternalSavedObjectsRequestHandlerContext } from '../../../saved_objects/internal_types'; diff --git a/src/core/server/integration_tests/saved_objects/routes/import.test.ts b/src/core/server/integration_tests/saved_objects/routes/import.test.ts index a9062b8d07919..ec6a483e8ae1f 100644 --- a/src/core/server/integration_tests/saved_objects/routes/import.test.ts +++ b/src/core/server/integration_tests/saved_objects/routes/import.test.ts @@ -9,14 +9,15 @@ jest.mock('uuid'); import supertest from 'supertest'; +import { SavedObjectsErrorHelpers } from '@kbn/core-saved-objects-utils-server'; import { registerImportRoute } from '../../../saved_objects/routes/import'; import { savedObjectsClientMock } from '../../../mocks'; import { CoreUsageStatsClient } from '../../../core_usage_data'; import { coreUsageStatsClientMock } from '../../../core_usage_data/core_usage_stats_client.mock'; import { coreUsageDataServiceMock } from '../../../core_usage_data/core_usage_data_service.mock'; -import { SavedObjectConfig } from '../../../saved_objects/saved_objects_config'; +import { SavedObjectConfig } from '@kbn/core-saved-objects-base-server-internal'; import { setupServer, createExportableType } from '../../../saved_objects/routes/test_utils'; -import { SavedObjectsErrorHelpers, SavedObjectsImporter } from '../../../saved_objects'; +import { SavedObjectsImporter } from '../../../saved_objects'; import type { InternalSavedObjectsRequestHandlerContext } from '../../../saved_objects/internal_types'; type SetupServerReturn = Awaited>; diff --git a/src/core/server/integration_tests/saved_objects/routes/resolve_import_errors.test.ts b/src/core/server/integration_tests/saved_objects/routes/resolve_import_errors.test.ts index defdbc5cfc1d6..5d26fde36fae4 100644 --- a/src/core/server/integration_tests/saved_objects/routes/resolve_import_errors.test.ts +++ b/src/core/server/integration_tests/saved_objects/routes/resolve_import_errors.test.ts @@ -15,7 +15,7 @@ import { CoreUsageStatsClient } from '../../../core_usage_data'; import { coreUsageStatsClientMock } from '../../../core_usage_data/core_usage_stats_client.mock'; import { coreUsageDataServiceMock } from '../../../core_usage_data/core_usage_data_service.mock'; import { setupServer, createExportableType } from '../../../saved_objects/routes/test_utils'; -import { SavedObjectConfig } from '../../../saved_objects/saved_objects_config'; +import { SavedObjectConfig } from '@kbn/core-saved-objects-base-server-internal'; import { SavedObjectsImporter } from '../../../saved_objects/import'; import type { InternalSavedObjectsRequestHandlerContext } from '../../../saved_objects/internal_types'; diff --git a/src/core/server/mocks.ts b/src/core/server/mocks.ts index a98eaf50554f2..e2ae9a96b716d 100644 --- a/src/core/server/mocks.ts +++ b/src/core/server/mocks.ts @@ -23,6 +23,7 @@ import { httpServiceMock } from '@kbn/core-http-server-mocks'; import { elasticsearchServiceMock } from '@kbn/core-elasticsearch-server-mocks'; import { metricsServiceMock } from '@kbn/core-metrics-server-mocks'; import { capabilitiesServiceMock } from '@kbn/core-capabilities-server-mocks'; +import { typeRegistryMock as savedObjectsTypeRegistryMock } from '@kbn/core-saved-objects-base-server-mocks'; import type { PluginInitializerContext, CoreSetup, @@ -34,7 +35,6 @@ import type { import { httpResourcesMock } from './http_resources/http_resources_service.mock'; import { savedObjectsServiceMock } from './saved_objects/saved_objects_service.mock'; import { savedObjectsClientMock } from './saved_objects/service/saved_objects_client.mock'; -import { typeRegistryMock as savedObjectsTypeRegistryMock } from './saved_objects/saved_objects_type_registry.mock'; import { renderingMock } from './rendering/rendering_service.mock'; import { uiSettingsServiceMock } from './ui_settings/ui_settings_service.mock'; import { SharedGlobalConfig } from './plugins'; @@ -47,12 +47,12 @@ export { configServiceMock, configDeprecationsMock } from '@kbn/config-mocks'; export { loggingSystemMock } from '@kbn/core-logging-server-mocks'; export { httpServerMock, sessionStorageMock, httpServiceMock } from '@kbn/core-http-server-mocks'; export { elasticsearchServiceMock } from '@kbn/core-elasticsearch-server-mocks'; +export { typeRegistryMock as savedObjectsTypeRegistryMock } from '@kbn/core-saved-objects-base-server-mocks'; export { httpResourcesMock } from './http_resources/http_resources_service.mock'; export { savedObjectsRepositoryMock } from './saved_objects/service/lib/repository.mock'; export { savedObjectsServiceMock } from './saved_objects/saved_objects_service.mock'; export { savedObjectsClientMock } from './saved_objects/service/saved_objects_client.mock'; export { migrationMocks } from './saved_objects/migrations/mocks'; -export { typeRegistryMock as savedObjectsTypeRegistryMock } from './saved_objects/saved_objects_type_registry.mock'; export { uiSettingsServiceMock } from './ui_settings/ui_settings_service.mock'; export { metricsServiceMock } from '@kbn/core-metrics-server-mocks'; export { renderingMock } from './rendering/rendering_service.mock'; diff --git a/src/core/server/plugins/legacy_config.ts b/src/core/server/plugins/legacy_config.ts index 4bee00d615748..de86345c5b7ba 100644 --- a/src/core/server/plugins/legacy_config.ts +++ b/src/core/server/plugins/legacy_config.ts @@ -16,8 +16,11 @@ import { ElasticsearchConfigType, config as elasticsearchConfig, } from '@kbn/core-elasticsearch-server-internal'; +import { + type SavedObjectsConfigType, + savedObjectsConfig, +} from '@kbn/core-saved-objects-base-server-internal'; import { SharedGlobalConfig, SharedGlobalConfigKeys } from './types'; -import { SavedObjectsConfigType, savedObjectsConfig } from '../saved_objects/saved_objects_config'; const createGlobalConfig = ({ elasticsearch, diff --git a/src/core/server/plugins/types.ts b/src/core/server/plugins/types.ts index d41be740018a7..f8b20b66f5069 100644 --- a/src/core/server/plugins/types.ts +++ b/src/core/server/plugins/types.ts @@ -20,8 +20,7 @@ import type { import type { PluginName, PluginOpaqueId, PluginType } from '@kbn/core-base-common'; import type { NodeInfo } from '@kbn/core-node-server'; import type { ElasticsearchConfigType } from '@kbn/core-elasticsearch-server-internal'; - -import { SavedObjectsConfigType } from '../saved_objects/saved_objects_config'; +import type { SavedObjectsConfigType } from '@kbn/core-saved-objects-base-server-internal'; import { CorePreboot, CoreSetup, CoreStart } from '..'; type Maybe = T | undefined; diff --git a/src/core/server/saved_objects/deprecations/deprecation_factory.ts b/src/core/server/saved_objects/deprecations/deprecation_factory.ts index dea29cb7690ec..d330577151a52 100644 --- a/src/core/server/saved_objects/deprecations/deprecation_factory.ts +++ b/src/core/server/saved_objects/deprecations/deprecation_factory.ts @@ -7,8 +7,8 @@ */ import type { ISavedObjectTypeRegistry } from '@kbn/core-saved-objects-server'; +import type { SavedObjectConfig } from '@kbn/core-saved-objects-base-server-internal'; import type { RegisterDeprecationsConfig } from '../../deprecations'; -import type { SavedObjectConfig } from '../saved_objects_config'; import { getUnknownTypesDeprecations } from './unknown_object_types'; interface GetDeprecationProviderOptions { diff --git a/src/core/server/saved_objects/deprecations/unknown_object_types.test.ts b/src/core/server/saved_objects/deprecations/unknown_object_types.test.ts index 51f228f46438b..7e02f3343050d 100644 --- a/src/core/server/saved_objects/deprecations/unknown_object_types.test.ts +++ b/src/core/server/saved_objects/deprecations/unknown_object_types.test.ts @@ -9,7 +9,7 @@ import { getIndexForTypeMock } from './unknown_object_types.test.mocks'; import { deleteUnknownTypeObjects, getUnknownTypesDeprecations } from './unknown_object_types'; -import { typeRegistryMock } from '../saved_objects_type_registry.mock'; +import { typeRegistryMock } from '@kbn/core-saved-objects-base-server-mocks'; import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { SavedObjectsType } from '../..'; import { createAggregateTypesSearchResponse } from '../migrations/actions/check_for_unknown_docs.mocks'; diff --git a/src/core/server/saved_objects/export/collect_exported_objects.test.ts b/src/core/server/saved_objects/export/collect_exported_objects.test.ts index 8aedffdd3745b..480a80e23cc97 100644 --- a/src/core/server/saved_objects/export/collect_exported_objects.test.ts +++ b/src/core/server/saved_objects/export/collect_exported_objects.test.ts @@ -15,7 +15,7 @@ import type { import { applyExportTransformsMock } from './collect_exported_objects.test.mocks'; import { savedObjectsClientMock } from '../../mocks'; import { loggerMock } from '@kbn/logging-mocks'; -import { SavedObjectTypeRegistry } from '../saved_objects_type_registry'; +import { SavedObjectTypeRegistry } from '@kbn/core-saved-objects-base-server-internal'; import { collectExportedObjects, ExclusionReason } from './collect_exported_objects'; const createObject = (parts: Partial): SavedObject => ({ diff --git a/src/core/server/saved_objects/export/saved_objects_exporter.test.ts b/src/core/server/saved_objects/export/saved_objects_exporter.test.ts index 8b4604087141c..55ee7642388ba 100644 --- a/src/core/server/saved_objects/export/saved_objects_exporter.test.ts +++ b/src/core/server/saved_objects/export/saved_objects_exporter.test.ts @@ -8,9 +8,9 @@ import { httpServerMock } from '@kbn/core-http-server-mocks'; import type { SavedObject } from '@kbn/core-saved-objects-common'; +import { SavedObjectTypeRegistry } from '@kbn/core-saved-objects-base-server-internal'; import { SavedObjectsExporter } from './saved_objects_exporter'; import { savedObjectsClientMock } from '../service/saved_objects_client.mock'; -import { SavedObjectTypeRegistry } from '../saved_objects_type_registry'; import { loggerMock, MockedLogger } from '@kbn/logging-mocks'; import { Readable } from 'stream'; import { createPromiseFromStreams, createConcatStream } from '@kbn/utils'; diff --git a/src/core/server/saved_objects/import/import_saved_objects.test.ts b/src/core/server/saved_objects/import/import_saved_objects.test.ts index 71990a8438ef3..9a086537c4761 100644 --- a/src/core/server/saved_objects/import/import_saved_objects.test.ts +++ b/src/core/server/saved_objects/import/import_saved_objects.test.ts @@ -30,8 +30,8 @@ import type { ISavedObjectTypeRegistry, SavedObjectsImportHook, } from '@kbn/core-saved-objects-server'; +import { typeRegistryMock } from '@kbn/core-saved-objects-base-server-mocks'; import { savedObjectsClientMock } from '../../mocks'; -import { typeRegistryMock } from '../saved_objects_type_registry.mock'; import { importSavedObjectsFromStream, ImportSavedObjectsOptions } from './import_saved_objects'; import type { ImportStateMap } from './lib'; diff --git a/src/core/server/saved_objects/import/lib/check_conflicts.test.ts b/src/core/server/saved_objects/import/lib/check_conflicts.test.ts index 3dcbeacae1a2d..35be4e245086c 100644 --- a/src/core/server/saved_objects/import/lib/check_conflicts.test.ts +++ b/src/core/server/saved_objects/import/lib/check_conflicts.test.ts @@ -13,7 +13,7 @@ import type { SavedObjectsImportRetry, } from '@kbn/core-saved-objects-common'; import type { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; -import { SavedObjectsErrorHelpers } from '../../service'; +import { SavedObjectsErrorHelpers } from '@kbn/core-saved-objects-utils-server'; import { checkConflicts } from './check_conflicts'; jest.mock('uuid', () => ({ diff --git a/src/core/server/saved_objects/import/lib/check_origin_conflicts.test.ts b/src/core/server/saved_objects/import/lib/check_origin_conflicts.test.ts index ed80c7cdf0751..756214e2ddc03 100644 --- a/src/core/server/saved_objects/import/lib/check_origin_conflicts.test.ts +++ b/src/core/server/saved_objects/import/lib/check_origin_conflicts.test.ts @@ -16,9 +16,9 @@ import type { } from '@kbn/core-saved-objects-common'; import type { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; import type { ISavedObjectTypeRegistry } from '@kbn/core-saved-objects-server'; +import { typeRegistryMock } from '@kbn/core-saved-objects-base-server-mocks'; import { checkOriginConflicts } from './check_origin_conflicts'; import { savedObjectsClientMock } from '../../../mocks'; -import { typeRegistryMock } from '../../saved_objects_type_registry.mock'; import type { ImportStateMap } from './types'; jest.mock('uuid', () => ({ diff --git a/src/core/server/saved_objects/import/lib/check_reference_origins.test.ts b/src/core/server/saved_objects/import/lib/check_reference_origins.test.ts index cff3a4d5540a0..fce677ec6ea46 100644 --- a/src/core/server/saved_objects/import/lib/check_reference_origins.test.ts +++ b/src/core/server/saved_objects/import/lib/check_reference_origins.test.ts @@ -15,7 +15,7 @@ import type { import type { ISavedObjectTypeRegistry } from '@kbn/core-saved-objects-server'; import { checkReferenceOrigins, CheckReferenceOriginsParams } from './check_reference_origins'; import { savedObjectsClientMock } from '../../../mocks'; -import { typeRegistryMock } from '../../saved_objects_type_registry.mock'; +import { typeRegistryMock } from '@kbn/core-saved-objects-base-server-mocks'; import type { ImportStateMap } from './types'; const MULTI_NS_TYPE = 'multi'; diff --git a/src/core/server/saved_objects/import/lib/create_saved_objects.test.ts b/src/core/server/saved_objects/import/lib/create_saved_objects.test.ts index a29765849c364..363d2bee5899e 100644 --- a/src/core/server/saved_objects/import/lib/create_saved_objects.test.ts +++ b/src/core/server/saved_objects/import/lib/create_saved_objects.test.ts @@ -9,8 +9,8 @@ import { savedObjectsClientMock } from '../../../mocks'; import type { SavedObject, SavedObjectsImportFailure } from '@kbn/core-saved-objects-common'; import { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; +import { SavedObjectsErrorHelpers } from '@kbn/core-saved-objects-utils-server'; import { createSavedObjects } from './create_saved_objects'; -import { SavedObjectsErrorHelpers } from '../../service'; import { extractErrors } from './extract_errors'; type CreateSavedObjectsParams = Parameters[0]; diff --git a/src/core/server/saved_objects/import/lib/extract_errors.test.ts b/src/core/server/saved_objects/import/lib/extract_errors.test.ts index 20a8d40b62a70..c4d3d0e4c2722 100644 --- a/src/core/server/saved_objects/import/lib/extract_errors.test.ts +++ b/src/core/server/saved_objects/import/lib/extract_errors.test.ts @@ -8,8 +8,8 @@ import type { SavedObject } from '@kbn/core-saved-objects-common'; import type { CreatedObject } from '@kbn/core-saved-objects-server'; +import { SavedObjectsErrorHelpers } from '@kbn/core-saved-objects-utils-server'; import { extractErrors } from './extract_errors'; -import { SavedObjectsErrorHelpers } from '../../service'; describe('extractErrors()', () => { test('returns empty array when no errors exist', () => { diff --git a/src/core/server/saved_objects/import/lib/validate_references.test.ts b/src/core/server/saved_objects/import/lib/validate_references.test.ts index 2e6f1a5e0a9a2..2a8095ef78ce8 100644 --- a/src/core/server/saved_objects/import/lib/validate_references.test.ts +++ b/src/core/server/saved_objects/import/lib/validate_references.test.ts @@ -6,10 +6,10 @@ * Side Public License, v 1. */ +import { SavedObjectsErrorHelpers } from '@kbn/core-saved-objects-utils-server'; import type { ValidateReferencesParams } from './validate_references'; import { validateReferences } from './validate_references'; import { savedObjectsClientMock } from '../../../mocks'; -import { SavedObjectsErrorHelpers } from '../../service'; function setup({ objects = [], diff --git a/src/core/server/saved_objects/import/resolve_import_errors.test.ts b/src/core/server/saved_objects/import/resolve_import_errors.test.ts index bc297182b281d..288e58aabb4c2 100644 --- a/src/core/server/saved_objects/import/resolve_import_errors.test.ts +++ b/src/core/server/saved_objects/import/resolve_import_errors.test.ts @@ -36,8 +36,8 @@ import type { ISavedObjectTypeRegistry, SavedObjectsImportHook, } from '@kbn/core-saved-objects-server'; +import { typeRegistryMock } from '@kbn/core-saved-objects-base-server-mocks'; import { savedObjectsClientMock } from '../../mocks'; -import { typeRegistryMock } from '../saved_objects_type_registry.mock'; import { resolveSavedObjectsImportErrors, ResolveSavedObjectsImportErrorsOptions, diff --git a/src/core/server/saved_objects/index.ts b/src/core/server/saved_objects/index.ts index 4a7a14b45b665..4ccc4f1bcdb30 100644 --- a/src/core/server/saved_objects/index.ts +++ b/src/core/server/saved_objects/index.ts @@ -14,8 +14,6 @@ export type { SavedObjectsImportError } from './import'; export type { SavedObjectsExporter, SavedObjectsExportError } from './export'; -export { SavedObjectsSerializer } from './serialization'; - export { SavedObjectsService } from './saved_objects_service'; export type { @@ -23,10 +21,4 @@ export type { InternalSavedObjectsServiceSetup, } from './saved_objects_service'; -export type { SavedObjectsTypeMappingDefinitions } from './mappings'; - -export { mergeSavedObjectMigrationMaps } from './migrations'; - -export { savedObjectsConfig, savedObjectsMigrationConfig } from './saved_objects_config'; -export { SavedObjectTypeRegistry } from './saved_objects_type_registry'; export { CoreSavedObjectsRouteHandlerContext } from './saved_objects_route_handler_context'; diff --git a/src/core/server/saved_objects/migrations/actions/create_index.ts b/src/core/server/saved_objects/migrations/actions/create_index.ts index 0f6b062a42163..f48918d679624 100644 --- a/src/core/server/saved_objects/migrations/actions/create_index.ts +++ b/src/core/server/saved_objects/migrations/actions/create_index.ts @@ -11,8 +11,8 @@ import * as TaskEither from 'fp-ts/lib/TaskEither'; import { pipe } from 'fp-ts/lib/pipeable'; import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; +import type { IndexMapping } from '@kbn/core-saved-objects-base-server-internal'; import { AcknowledgeResponse } from '.'; -import { IndexMapping } from '../../mappings'; import { catchRetryableEsClientErrors, RetryableEsClientError, diff --git a/src/core/server/saved_objects/migrations/actions/fetch_indices.ts b/src/core/server/saved_objects/migrations/actions/fetch_indices.ts index 922797f2ba268..0eb43380a6990 100644 --- a/src/core/server/saved_objects/migrations/actions/fetch_indices.ts +++ b/src/core/server/saved_objects/migrations/actions/fetch_indices.ts @@ -5,10 +5,11 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ + import * as TaskEither from 'fp-ts/lib/TaskEither'; import * as Either from 'fp-ts/lib/Either'; import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; -import { IndexMapping } from '../../mappings'; +import type { IndexMapping } from '@kbn/core-saved-objects-base-server-internal'; import { catchRetryableEsClientErrors, RetryableEsClientError, diff --git a/src/core/server/saved_objects/migrations/actions/update_and_pickup_mappings.ts b/src/core/server/saved_objects/migrations/actions/update_and_pickup_mappings.ts index bd1c2d6ff7614..a5fe33e9bbcf5 100644 --- a/src/core/server/saved_objects/migrations/actions/update_and_pickup_mappings.ts +++ b/src/core/server/saved_objects/migrations/actions/update_and_pickup_mappings.ts @@ -10,7 +10,7 @@ import * as Either from 'fp-ts/lib/Either'; import * as TaskEither from 'fp-ts/lib/TaskEither'; import { pipe } from 'fp-ts/lib/pipeable'; import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; -import { IndexMapping } from '../../mappings'; +import type { IndexMapping } from '@kbn/core-saved-objects-base-server-internal'; import { catchRetryableEsClientErrors, RetryableEsClientError, diff --git a/src/core/server/saved_objects/migrations/core/build_active_mappings.test.ts b/src/core/server/saved_objects/migrations/core/build_active_mappings.test.ts index 7a57a7a8a08d3..7f1542ffc6008 100644 --- a/src/core/server/saved_objects/migrations/core/build_active_mappings.test.ts +++ b/src/core/server/saved_objects/migrations/core/build_active_mappings.test.ts @@ -6,7 +6,10 @@ * Side Public License, v 1. */ -import { IndexMapping, SavedObjectsTypeMappingDefinitions } from '../../mappings'; +import type { + IndexMapping, + SavedObjectsTypeMappingDefinitions, +} from '@kbn/core-saved-objects-base-server-internal'; import { buildActiveMappings, diffMappings } from './build_active_mappings'; describe('buildActiveMappings', () => { diff --git a/src/core/server/saved_objects/migrations/core/build_active_mappings.ts b/src/core/server/saved_objects/migrations/core/build_active_mappings.ts index 62f5bd1454419..1a0a502f655bd 100644 --- a/src/core/server/saved_objects/migrations/core/build_active_mappings.ts +++ b/src/core/server/saved_objects/migrations/core/build_active_mappings.ts @@ -13,7 +13,10 @@ import crypto from 'crypto'; import { cloneDeep, mapValues } from 'lodash'; import type { SavedObjectsMappingProperties } from '@kbn/core-saved-objects-server'; -import { IndexMapping, SavedObjectsTypeMappingDefinitions } from '../../mappings'; +import type { + IndexMapping, + SavedObjectsTypeMappingDefinitions, +} from '@kbn/core-saved-objects-base-server-internal'; /** * Creates an index mapping with the core properties required by saved object diff --git a/src/core/server/saved_objects/migrations/core/build_index_map.test.ts b/src/core/server/saved_objects/migrations/core/build_index_map.test.ts index 5f5d587eec359..ec82b0ac2c92f 100644 --- a/src/core/server/saved_objects/migrations/core/build_index_map.test.ts +++ b/src/core/server/saved_objects/migrations/core/build_index_map.test.ts @@ -7,8 +7,8 @@ */ import type { SavedObjectsType } from '@kbn/core-saved-objects-server'; +import { SavedObjectTypeRegistry } from '@kbn/core-saved-objects-base-server-internal'; import { createIndexMap } from './build_index_map'; -import { SavedObjectTypeRegistry } from '../../saved_objects_type_registry'; const createRegistry = (...types: Array>) => { const registry = new SavedObjectTypeRegistry(); diff --git a/src/core/server/saved_objects/migrations/core/build_index_map.ts b/src/core/server/saved_objects/migrations/core/build_index_map.ts index 1e1adcf0dcbc8..225b3bb422925 100644 --- a/src/core/server/saved_objects/migrations/core/build_index_map.ts +++ b/src/core/server/saved_objects/migrations/core/build_index_map.ts @@ -7,7 +7,7 @@ */ import type { ISavedObjectTypeRegistry } from '@kbn/core-saved-objects-server'; -import type { SavedObjectsTypeMappingDefinitions } from '../../mappings'; +import type { SavedObjectsTypeMappingDefinitions } from '@kbn/core-saved-objects-base-server-internal'; export interface CreateIndexMapOptions { kibanaIndexName: string; diff --git a/src/core/server/saved_objects/migrations/core/disable_unknown_type_mapping_fields.ts b/src/core/server/saved_objects/migrations/core/disable_unknown_type_mapping_fields.ts index b1e25e6e024fb..8b1eccbe09d78 100644 --- a/src/core/server/saved_objects/migrations/core/disable_unknown_type_mapping_fields.ts +++ b/src/core/server/saved_objects/migrations/core/disable_unknown_type_mapping_fields.ts @@ -7,7 +7,7 @@ */ import type { SavedObjectsMappingProperties } from '@kbn/core-saved-objects-server'; -import { IndexMapping } from '../../mappings'; +import type { IndexMapping } from '@kbn/core-saved-objects-base-server-internal'; /** * Merges the active mappings and the source mappings while disabling the diff --git a/src/core/server/saved_objects/migrations/core/document_migrator.test.mock.ts b/src/core/server/saved_objects/migrations/core/document_migrator.test.mock.ts index ee0b18af5ac0d..df7914a55876f 100644 --- a/src/core/server/saved_objects/migrations/core/document_migrator.test.mock.ts +++ b/src/core/server/saved_objects/migrations/core/document_migrator.test.mock.ts @@ -7,8 +7,9 @@ */ const mockGetConvertedObjectId = jest.fn().mockReturnValue('uuidv5'); -jest.mock('../../service/lib/utils', () => { - const actual = jest.requireActual('../../service/lib/utils'); + +jest.mock('@kbn/core-saved-objects-utils-server', () => { + const actual = jest.requireActual('@kbn/core-saved-objects-utils-server'); return { ...actual, SavedObjectsUtils: { diff --git a/src/core/server/saved_objects/migrations/core/document_migrator.test.ts b/src/core/server/saved_objects/migrations/core/document_migrator.test.ts index d126cdce88253..a0dd1cfddc3a4 100644 --- a/src/core/server/saved_objects/migrations/core/document_migrator.test.ts +++ b/src/core/server/saved_objects/migrations/core/document_migrator.test.ts @@ -7,14 +7,16 @@ */ import { mockGetConvertedObjectId } from './document_migrator.test.mock'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import _ from 'lodash'; import type { SavedObjectUnsanitizedDoc, SavedObjectsType } from '@kbn/core-saved-objects-server'; +import { + SavedObjectTypeRegistry, + LEGACY_URL_ALIAS_TYPE, +} from '@kbn/core-saved-objects-base-server-internal'; import { DocumentMigrator } from './document_migrator'; import { TransformSavedObjectDocumentError } from './transform_saved_object_document_error'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; -import { SavedObjectTypeRegistry } from '../../saved_objects_type_registry'; -import { LEGACY_URL_ALIAS_TYPE } from '../../object_types'; const mockLoggerFactory = loggingSystemMock.create(); const mockLogger = mockLoggerFactory.get('mock logger'); diff --git a/src/core/server/saved_objects/migrations/core/document_migrator.ts b/src/core/server/saved_objects/migrations/core/document_migrator.ts index 3782a74936b6e..1040699a99e9d 100644 --- a/src/core/server/saved_objects/migrations/core/document_migrator.ts +++ b/src/core/server/saved_objects/migrations/core/document_migrator.ts @@ -43,7 +43,7 @@ import Boom from '@hapi/boom'; import uuidv5 from 'uuid/v5'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import _ from 'lodash'; import Semver from 'semver'; import type { Logger } from '@kbn/logging'; @@ -58,10 +58,13 @@ import type { SavedObjectMigrationFn, SavedObjectMigrationMap, } from '@kbn/core-saved-objects-server'; +import { DEFAULT_NAMESPACE_STRING, SavedObjectsUtils } from '@kbn/core-saved-objects-utils-server'; +import { + type LegacyUrlAlias, + LEGACY_URL_ALIAS_TYPE, +} from '@kbn/core-saved-objects-base-server-internal'; import { MigrationLogger } from './migration_logger'; import { TransformSavedObjectDocumentError } from '.'; -import { DEFAULT_NAMESPACE_STRING, SavedObjectsUtils } from '../../service/lib/utils'; -import { LegacyUrlAlias, LEGACY_URL_ALIAS_TYPE } from '../../object_types'; const DEFAULT_MINIMUM_CONVERT_VERSION = '8.0.0'; diff --git a/src/core/server/saved_objects/migrations/core/migrate_raw_docs.test.ts b/src/core/server/saved_objects/migrations/core/migrate_raw_docs.test.ts index 03124f6e7fde7..c9d7b78953e28 100644 --- a/src/core/server/saved_objects/migrations/core/migrate_raw_docs.test.ts +++ b/src/core/server/saved_objects/migrations/core/migrate_raw_docs.test.ts @@ -6,11 +6,13 @@ * Side Public License, v 1. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import * as Either from 'fp-ts/lib/Either'; import _ from 'lodash'; -import { SavedObjectTypeRegistry } from '../../saved_objects_type_registry'; -import { SavedObjectsSerializer } from '../../serialization'; +import { + SavedObjectTypeRegistry, + SavedObjectsSerializer, +} from '@kbn/core-saved-objects-base-server-internal'; import { DocumentsTransformFailed, DocumentsTransformSuccess, diff --git a/src/core/server/saved_objects/migrations/core/migrate_raw_docs.ts b/src/core/server/saved_objects/migrations/core/migrate_raw_docs.ts index 8534d7e497be0..d1ca65f1dd103 100644 --- a/src/core/server/saved_objects/migrations/core/migrate_raw_docs.ts +++ b/src/core/server/saved_objects/migrations/core/migrate_raw_docs.ts @@ -16,7 +16,7 @@ import type { SavedObjectsRawDoc, SavedObjectUnsanitizedDoc, } from '@kbn/core-saved-objects-server'; -import { SavedObjectsSerializer } from '../../serialization'; +import { SavedObjectsSerializer } from '@kbn/core-saved-objects-base-server-internal'; import { MigrateAndConvertFn } from './document_migrator'; import { TransformSavedObjectDocumentError } from '.'; diff --git a/src/core/server/saved_objects/migrations/index.ts b/src/core/server/saved_objects/migrations/index.ts index 54416f423a79a..707b777330ec3 100644 --- a/src/core/server/saved_objects/migrations/index.ts +++ b/src/core/server/saved_objects/migrations/index.ts @@ -9,4 +9,3 @@ export type { MigrationResult } from './core'; export { KibanaMigrator } from './kibana_migrator'; export type { IKibanaMigrator, KibanaMigratorStatus } from './kibana_migrator'; -export { mergeSavedObjectMigrationMaps } from './utils'; diff --git a/src/core/server/saved_objects/migrations/initial_state.test.ts b/src/core/server/saved_objects/migrations/initial_state.test.ts index 32e3b9f50f4a3..6d49b17d4fa80 100644 --- a/src/core/server/saved_objects/migrations/initial_state.test.ts +++ b/src/core/server/saved_objects/migrations/initial_state.test.ts @@ -10,9 +10,11 @@ import { ByteSizeValue } from '@kbn/config-schema'; import * as Option from 'fp-ts/Option'; import type { DocLinksServiceSetup } from '@kbn/core-doc-links-server'; import { docLinksServiceMock } from '@kbn/core-doc-links-server-mocks'; +import { + type SavedObjectsMigrationConfigType, + SavedObjectTypeRegistry, +} from '@kbn/core-saved-objects-base-server-internal'; import { loggingSystemMock } from '../../mocks'; -import { SavedObjectsMigrationConfigType } from '../saved_objects_config'; -import { SavedObjectTypeRegistry } from '../saved_objects_type_registry'; import { createInitialState } from './initial_state'; const mockLogger = loggingSystemMock.create(); diff --git a/src/core/server/saved_objects/migrations/initial_state.ts b/src/core/server/saved_objects/migrations/initial_state.ts index 861ec75e2d875..1843227934bcd 100644 --- a/src/core/server/saved_objects/migrations/initial_state.ts +++ b/src/core/server/saved_objects/migrations/initial_state.ts @@ -11,8 +11,10 @@ import type { DocLinksServiceStart } from '@kbn/core-doc-links-server'; import type { Logger } from '@kbn/logging'; import type { SavedObjectsMigrationVersion } from '@kbn/core-saved-objects-common'; import type { ISavedObjectTypeRegistry } from '@kbn/core-saved-objects-server'; -import type { IndexMapping } from '../mappings'; -import type { SavedObjectsMigrationConfigType } from '../saved_objects_config'; +import type { + IndexMapping, + SavedObjectsMigrationConfigType, +} from '@kbn/core-saved-objects-base-server-internal'; import type { InitState } from './state'; import { excludeUnusedTypesQuery } from './core'; diff --git a/src/core/server/saved_objects/migrations/kibana_migrator.test.ts b/src/core/server/saved_objects/migrations/kibana_migrator.test.ts index 6806e5a9c80a1..5d1cb32eca6d2 100644 --- a/src/core/server/saved_objects/migrations/kibana_migrator.test.ts +++ b/src/core/server/saved_objects/migrations/kibana_migrator.test.ts @@ -12,8 +12,8 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import type { SavedObjectsType } from '@kbn/core-saved-objects-server'; +import { SavedObjectTypeRegistry } from '@kbn/core-saved-objects-base-server-internal'; import { KibanaMigratorOptions, KibanaMigrator } from './kibana_migrator'; -import { SavedObjectTypeRegistry } from '../saved_objects_type_registry'; import { DocumentMigrator } from './core/document_migrator'; import { ByteSizeValue } from '@kbn/config-schema'; import { docLinksServiceMock } from '@kbn/core-doc-links-server-mocks'; diff --git a/src/core/server/saved_objects/migrations/kibana_migrator.ts b/src/core/server/saved_objects/migrations/kibana_migrator.ts index 146dd600ab4d0..2a8f9a9c3ee0f 100644 --- a/src/core/server/saved_objects/migrations/kibana_migrator.ts +++ b/src/core/server/saved_objects/migrations/kibana_migrator.ts @@ -22,12 +22,15 @@ import type { SavedObjectsRawDoc, ISavedObjectTypeRegistry, } from '@kbn/core-saved-objects-server'; -import { IndexMapping, SavedObjectsTypeMappingDefinitions } from '../mappings'; -import { SavedObjectsSerializer } from '../serialization'; +import { + SavedObjectsSerializer, + type IndexMapping, + type SavedObjectsTypeMappingDefinitions, + type SavedObjectsMigrationConfigType, +} from '@kbn/core-saved-objects-base-server-internal'; import { buildActiveMappings, MigrationResult, MigrationStatus } from './core'; import { DocumentMigrator, VersionedTransformer } from './core/document_migrator'; import { createIndexMap } from './core/build_index_map'; -import { SavedObjectsMigrationConfigType } from '../saved_objects_config'; import { runResilientMigrator } from './run_resilient_migrator'; import { migrateRawDocsSafely } from './core/migrate_raw_docs'; diff --git a/src/core/server/saved_objects/migrations/migrations_state_action_machine.test.ts b/src/core/server/saved_objects/migrations/migrations_state_action_machine.test.ts index db319c63e216f..1c4644fb43325 100644 --- a/src/core/server/saved_objects/migrations/migrations_state_action_machine.test.ts +++ b/src/core/server/saved_objects/migrations/migrations_state_action_machine.test.ts @@ -11,8 +11,8 @@ import { migrationStateActionMachine } from './migrations_state_action_machine'; import { docLinksServiceMock } from '@kbn/core-doc-links-server-mocks'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; import { LoggerAdapter } from '@kbn/core-logging-server-internal'; +import { typeRegistryMock } from '@kbn/core-saved-objects-base-server-mocks'; import { elasticsearchServiceMock } from '../../mocks'; -import { typeRegistryMock } from '../saved_objects_type_registry.mock'; import * as Either from 'fp-ts/lib/Either'; import * as Option from 'fp-ts/lib/Option'; import { errors } from '@elastic/elasticsearch'; diff --git a/src/core/server/saved_objects/migrations/model/helpers.ts b/src/core/server/saved_objects/migrations/model/helpers.ts index ea28c14f9a5f0..5f84dc01af008 100644 --- a/src/core/server/saved_objects/migrations/model/helpers.ts +++ b/src/core/server/saved_objects/migrations/model/helpers.ts @@ -12,8 +12,8 @@ import type { QueryDslQueryContainer, } from '@elastic/elasticsearch/lib/api/types'; import * as Either from 'fp-ts/lib/Either'; +import type { IndexMapping } from '@kbn/core-saved-objects-base-server-internal'; import type { State } from '../state'; -import type { IndexMapping } from '../../mappings'; import type { FetchIndexResponse } from '../actions'; /** diff --git a/src/core/server/saved_objects/migrations/run_resilient_migrator.ts b/src/core/server/saved_objects/migrations/run_resilient_migrator.ts index 9ca3d3dbaaa60..6a6153b997146 100644 --- a/src/core/server/saved_objects/migrations/run_resilient_migrator.ts +++ b/src/core/server/saved_objects/migrations/run_resilient_migrator.ts @@ -11,14 +11,16 @@ import type { DocLinksServiceStart } from '@kbn/core-doc-links-server'; import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import type { SavedObjectsMigrationVersion } from '@kbn/core-saved-objects-common'; import type { ISavedObjectTypeRegistry } from '@kbn/core-saved-objects-server'; -import { IndexMapping } from '../mappings'; +import type { + IndexMapping, + SavedObjectsMigrationConfigType, +} from '@kbn/core-saved-objects-base-server-internal'; import type { TransformRawDocs } from './types'; import { MigrationResult } from './core'; import { next } from './next'; import { model } from './model'; import { createInitialState } from './initial_state'; import { migrationStateActionMachine } from './migrations_state_action_machine'; -import { SavedObjectsMigrationConfigType } from '../saved_objects_config'; /** * To avoid the Elasticsearch-js client aborting our requests before we diff --git a/src/core/server/saved_objects/migrations/state.ts b/src/core/server/saved_objects/migrations/state.ts index d94d49ecec7aa..eb8d2e2fbb05b 100644 --- a/src/core/server/saved_objects/migrations/state.ts +++ b/src/core/server/saved_objects/migrations/state.ts @@ -13,9 +13,9 @@ import type { SavedObjectsRawDoc, SavedObjectTypeExcludeFromUpgradeFilterHook, } from '@kbn/core-saved-objects-server'; +import type { IndexMapping } from '@kbn/core-saved-objects-base-server-internal'; import type { ControlState } from './state_action_machine'; import type { AliasAction } from './actions'; -import type { IndexMapping } from '../mappings'; import type { TransformErrorObjects } from './core'; import type { MigrationLog, Progress } from './types'; diff --git a/src/core/server/saved_objects/object_types/index.ts b/src/core/server/saved_objects/object_types/index.ts index 11a2c1973b09a..55c0db7ffcdbc 100644 --- a/src/core/server/saved_objects/object_types/index.ts +++ b/src/core/server/saved_objects/object_types/index.ts @@ -6,6 +6,4 @@ * Side Public License, v 1. */ -export { LEGACY_URL_ALIAS_TYPE } from './constants'; -export type { LegacyUrlAlias } from './types'; export { registerCoreObjectTypes } from './registration'; diff --git a/src/core/server/saved_objects/object_types/registration.test.ts b/src/core/server/saved_objects/object_types/registration.test.ts index 724b9baababef..2c8a467e32842 100644 --- a/src/core/server/saved_objects/object_types/registration.test.ts +++ b/src/core/server/saved_objects/object_types/registration.test.ts @@ -6,8 +6,8 @@ * Side Public License, v 1. */ -import { typeRegistryMock } from '../saved_objects_type_registry.mock'; -import { LEGACY_URL_ALIAS_TYPE } from './constants'; +import { typeRegistryMock } from '@kbn/core-saved-objects-base-server-mocks'; +import { LEGACY_URL_ALIAS_TYPE } from '@kbn/core-saved-objects-base-server-internal'; import { registerCoreObjectTypes } from './registration'; describe('Core saved object types registration', () => { diff --git a/src/core/server/saved_objects/object_types/registration.ts b/src/core/server/saved_objects/object_types/registration.ts index d93b1cc2e2a23..5d31cb1e03077 100644 --- a/src/core/server/saved_objects/object_types/registration.ts +++ b/src/core/server/saved_objects/object_types/registration.ts @@ -7,9 +7,11 @@ */ import type { ISavedObjectTypeRegistry, SavedObjectsType } from '@kbn/core-saved-objects-server'; -import { LEGACY_URL_ALIAS_TYPE } from './constants'; -import { SavedObjectTypeRegistry } from '..'; -import type { LegacyUrlAlias } from './types'; +import { + SavedObjectTypeRegistry, + LEGACY_URL_ALIAS_TYPE, + type LegacyUrlAlias, +} from '@kbn/core-saved-objects-base-server-internal'; const legacyUrlAliasType: SavedObjectsType = { name: LEGACY_URL_ALIAS_TYPE, diff --git a/src/core/server/saved_objects/routes/export.ts b/src/core/server/saved_objects/routes/export.ts index bd89a2845626a..0ab75a3c7101d 100644 --- a/src/core/server/saved_objects/routes/export.ts +++ b/src/core/server/saved_objects/routes/export.ts @@ -15,8 +15,8 @@ import type { SavedObjectsExportByTypeOptions, SavedObjectsExportByObjectOptions, } from '@kbn/core-saved-objects-server'; +import type { SavedObjectConfig } from '@kbn/core-saved-objects-base-server-internal'; import { InternalCoreUsageDataSetup } from '../../core_usage_data'; -import { SavedObjectConfig } from '../saved_objects_config'; import { SavedObjectsExportError } from '../export'; import type { InternalSavedObjectRouter } from '../internal_types'; import { validateTypes, validateObjects, catchAndReturnBoomErrors } from './utils'; diff --git a/src/core/server/saved_objects/routes/import.ts b/src/core/server/saved_objects/routes/import.ts index 0c56acf9e2d68..717cc50a13e60 100644 --- a/src/core/server/saved_objects/routes/import.ts +++ b/src/core/server/saved_objects/routes/import.ts @@ -9,8 +9,8 @@ import { Readable } from 'stream'; import { extname } from 'path'; import { schema } from '@kbn/config-schema'; +import type { SavedObjectConfig } from '@kbn/core-saved-objects-base-server-internal'; import { InternalCoreUsageDataSetup } from '../../core_usage_data'; -import { SavedObjectConfig } from '../saved_objects_config'; import { SavedObjectsImportError } from '../import'; import type { InternalSavedObjectRouter } from '../internal_types'; import { catchAndReturnBoomErrors, createSavedObjectsStreamFromNdJson } from './utils'; diff --git a/src/core/server/saved_objects/routes/index.ts b/src/core/server/saved_objects/routes/index.ts index edc52efdeaef8..f49c604a37c0c 100644 --- a/src/core/server/saved_objects/routes/index.ts +++ b/src/core/server/saved_objects/routes/index.ts @@ -8,8 +8,8 @@ import type { Logger } from '@kbn/logging'; import type { InternalHttpServiceSetup } from '@kbn/core-http-server-internal'; +import type { SavedObjectConfig } from '@kbn/core-saved-objects-base-server-internal'; import { InternalCoreUsageDataSetup } from '../../core_usage_data'; -import { SavedObjectConfig } from '../saved_objects_config'; import { IKibanaMigrator } from '../migrations'; import type { InternalSavedObjectsRequestHandlerContext } from '../internal_types'; import { registerGetRoute } from './get'; diff --git a/src/core/server/saved_objects/routes/resolve_import_errors.ts b/src/core/server/saved_objects/routes/resolve_import_errors.ts index 4bedec1715a4f..ed919693e1b86 100644 --- a/src/core/server/saved_objects/routes/resolve_import_errors.ts +++ b/src/core/server/saved_objects/routes/resolve_import_errors.ts @@ -8,10 +8,10 @@ import { extname } from 'path'; import { Readable } from 'stream'; -import { schema } from '@kbn/config-schema'; import { chain } from 'lodash'; +import { schema } from '@kbn/config-schema'; +import type { SavedObjectConfig } from '@kbn/core-saved-objects-base-server-internal'; import { InternalCoreUsageDataSetup } from '../../core_usage_data'; -import { SavedObjectConfig } from '../saved_objects_config'; import { SavedObjectsImportError } from '../import'; import type { InternalSavedObjectRouter } from '../internal_types'; import { catchAndReturnBoomErrors, createSavedObjectsStreamFromNdJson } from './utils'; diff --git a/src/core/server/saved_objects/saved_objects_service.mock.ts b/src/core/server/saved_objects/saved_objects_service.mock.ts index 292e39b0c199d..f1a1ce6c091b6 100644 --- a/src/core/server/saved_objects/saved_objects_service.mock.ts +++ b/src/core/server/saved_objects/saved_objects_service.mock.ts @@ -21,7 +21,7 @@ import type { import { savedObjectsRepositoryMock } from './service/lib/repository.mock'; import { savedObjectsClientMock } from './service/saved_objects_client.mock'; -import { typeRegistryMock } from './saved_objects_type_registry.mock'; +import { typeRegistryMock, serializerMock } from '@kbn/core-saved-objects-base-server-mocks'; import { savedObjectsExporterMock } from './export/saved_objects_exporter.mock'; import { savedObjectsImporterMock } from './import/saved_objects_importer.mock'; import { migrationMocks } from './migrations/mocks'; @@ -105,4 +105,5 @@ export const savedObjectsServiceMock = { createTypeRegistryMock: typeRegistryMock.create, createExporter: savedObjectsExporterMock.create, createImporter: savedObjectsImporterMock.create, + createSerializer: serializerMock.create, }; diff --git a/src/core/server/saved_objects/saved_objects_service.test.mocks.ts b/src/core/server/saved_objects/saved_objects_service.test.mocks.ts index f4b58fd12d8ba..4b66f5865def5 100644 --- a/src/core/server/saved_objects/saved_objects_service.test.mocks.ts +++ b/src/core/server/saved_objects/saved_objects_service.test.mocks.ts @@ -8,7 +8,7 @@ import { mockKibanaMigrator } from './migrations/kibana_migrator.mock'; import { savedObjectsClientProviderMock } from './service/lib/scoped_client_provider.mock'; -import { typeRegistryMock } from './saved_objects_type_registry.mock'; +import { typeRegistryMock } from '@kbn/core-saved-objects-base-server-mocks'; export const migratorInstanceMock = mockKibanaMigrator.create(); export const KibanaMigratorMock = jest.fn().mockImplementation(() => migratorInstanceMock); @@ -22,15 +22,15 @@ jest.doMock('./service/lib/scoped_client_provider', () => ({ })); export const typeRegistryInstanceMock = typeRegistryMock.create(); -jest.doMock('./saved_objects_type_registry', () => ({ - SavedObjectTypeRegistry: jest.fn().mockImplementation(() => typeRegistryInstanceMock), -})); +jest.doMock('@kbn/core-saved-objects-base-server-internal', () => { + const actual = jest.requireActual('@kbn/core-saved-objects-base-server-internal'); + return { + ...actual, + SavedObjectTypeRegistry: jest.fn().mockImplementation(() => typeRegistryInstanceMock), + }; +}); export const registerRoutesMock = jest.fn(); jest.doMock('./routes', () => ({ registerRoutes: registerRoutesMock, })); - -// The SavedObjectsSerializer imports SavedObjectUtils from the '../service' module, and that somehow breaks unit tests for the -// SavedObjectsService. To avoid this, we mock the entire './serialization' module, since we don't need it for these tests. -jest.mock('./serialization'); diff --git a/src/core/server/saved_objects/saved_objects_service.ts b/src/core/server/saved_objects/saved_objects_service.ts index 53eb376cc37b7..542a13e3a4cc0 100644 --- a/src/core/server/saved_objects/saved_objects_service.ts +++ b/src/core/server/saved_objects/saved_objects_service.ts @@ -27,18 +27,18 @@ import type { SavedObjectsClientWrapperFactory, ISavedObjectTypeRegistry, } from '@kbn/core-saved-objects-server'; +import { + SavedObjectConfig, + SavedObjectsSerializer, + SavedObjectTypeRegistry, + type SavedObjectsConfigType, + type SavedObjectsMigrationConfigType, +} from '@kbn/core-saved-objects-base-server-internal'; import { SavedObjectsClient, SavedObjectsClientProvider } from './service'; import { KibanaMigrator, IKibanaMigrator } from './migrations'; import { InternalCoreUsageDataSetup } from '../core_usage_data'; import { InternalDeprecationsServiceSetup } from '../deprecations'; -import { - SavedObjectsConfigType, - SavedObjectsMigrationConfigType, - SavedObjectConfig, -} from './saved_objects_config'; import { SavedObjectsRepository } from './service/lib/repository'; -import { SavedObjectTypeRegistry } from './saved_objects_type_registry'; -import { SavedObjectsSerializer } from './serialization'; import { SavedObjectsExporter } from './export'; import { SavedObjectsImporter } from './import'; import { registerRoutes } from './routes'; diff --git a/src/core/server/saved_objects/service/index.ts b/src/core/server/saved_objects/service/index.ts index 1ce638c4c0188..0737fc725d1a4 100644 --- a/src/core/server/saved_objects/service/index.ts +++ b/src/core/server/saved_objects/service/index.ts @@ -5,6 +5,7 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -export { SavedObjectsErrorHelpers, SavedObjectsClientProvider, SavedObjectsUtils } from './lib'; + +export { SavedObjectsClientProvider } from './lib'; export type { SavedObjectsRepository, ISavedObjectsClientProvider } from './lib'; export { SavedObjectsClient } from './saved_objects_client'; diff --git a/src/core/server/saved_objects/service/lib/aggregations/validation.ts b/src/core/server/saved_objects/service/lib/aggregations/validation.ts index 76098d73306af..b3a6bbae5e956 100644 --- a/src/core/server/saved_objects/service/lib/aggregations/validation.ts +++ b/src/core/server/saved_objects/service/lib/aggregations/validation.ts @@ -10,7 +10,7 @@ import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { ObjectType } from '@kbn/config-schema'; import { isPlainObject, isArray } from 'lodash'; -import { IndexMapping } from '../../../mappings'; +import type { IndexMapping } from '@kbn/core-saved-objects-base-server-internal'; import { isObjectTypeAttribute, rewriteObjectTypeAttribute, diff --git a/src/core/server/saved_objects/service/lib/aggregations/validation_utils.ts b/src/core/server/saved_objects/service/lib/aggregations/validation_utils.ts index 0b2cc8e235c9c..5548ad4d57a5d 100644 --- a/src/core/server/saved_objects/service/lib/aggregations/validation_utils.ts +++ b/src/core/server/saved_objects/service/lib/aggregations/validation_utils.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { IndexMapping } from '../../../mappings'; +import type { IndexMapping } from '@kbn/core-saved-objects-base-server-internal'; import { fieldDefined, hasFilterKeyError } from '../filter_utils'; /** diff --git a/src/core/server/saved_objects/service/lib/collect_multi_namespace_references.test.ts b/src/core/server/saved_objects/service/lib/collect_multi_namespace_references.test.ts index d3cf76716e598..86e1e82d12a6f 100644 --- a/src/core/server/saved_objects/service/lib/collect_multi_namespace_references.test.ts +++ b/src/core/server/saved_objects/service/lib/collect_multi_namespace_references.test.ts @@ -17,15 +17,15 @@ import type { SavedObjectsCollectMultiNamespaceReferencesObject, SavedObjectsCollectMultiNamespaceReferencesOptions, } from '@kbn/core-saved-objects-api-server'; -import { typeRegistryMock } from '../../saved_objects_type_registry.mock'; -import { SavedObjectsSerializer } from '../../serialization'; +import { SavedObjectsErrorHelpers } from '@kbn/core-saved-objects-utils-server'; +import { SavedObjectsSerializer } from '@kbn/core-saved-objects-base-server-internal'; +import { typeRegistryMock } from '@kbn/core-saved-objects-base-server-mocks'; import { ALIAS_OR_SHARED_ORIGIN_SEARCH_PER_PAGE, CollectMultiNamespaceReferencesParams, } from './collect_multi_namespace_references'; import { collectMultiNamespaceReferences } from './collect_multi_namespace_references'; import type { CreatePointInTimeFinderFn } from './point_in_time_finder'; -import { SavedObjectsErrorHelpers } from './errors'; const SPACES = ['default', 'another-space']; const VERSION_PROPS = { _seq_no: 1, _primary_term: 1 }; diff --git a/src/core/server/saved_objects/service/lib/collect_multi_namespace_references.ts b/src/core/server/saved_objects/service/lib/collect_multi_namespace_references.ts index b31f817e4c4d2..222b58d3a03e0 100644 --- a/src/core/server/saved_objects/service/lib/collect_multi_namespace_references.ts +++ b/src/core/server/saved_objects/service/lib/collect_multi_namespace_references.ts @@ -15,8 +15,8 @@ import type { SavedObjectReferenceWithContext, } from '@kbn/core-saved-objects-api-server'; import type { ISavedObjectTypeRegistry } from '@kbn/core-saved-objects-server'; -import type { SavedObjectsSerializer } from '../../serialization'; -import { SavedObjectsErrorHelpers } from './errors'; +import { SavedObjectsErrorHelpers } from '@kbn/core-saved-objects-utils-server'; +import type { SavedObjectsSerializer } from '@kbn/core-saved-objects-base-server-internal'; import { findLegacyUrlAliases } from './legacy_url_aliases'; import { getRootFields } from './included_fields'; import { diff --git a/src/core/server/saved_objects/service/lib/decorate_es_error.test.ts b/src/core/server/saved_objects/service/lib/decorate_es_error.test.ts index a7aa52f7a0f5a..8290f7345190d 100644 --- a/src/core/server/saved_objects/service/lib/decorate_es_error.test.ts +++ b/src/core/server/saved_objects/service/lib/decorate_es_error.test.ts @@ -8,8 +8,8 @@ import { errors as esErrors } from '@elastic/elasticsearch'; import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; +import { SavedObjectsErrorHelpers } from '@kbn/core-saved-objects-utils-server'; import { decorateEsError } from './decorate_es_error'; -import { SavedObjectsErrorHelpers } from './errors'; describe('savedObjectsClient/decorateEsError', () => { it('always returns the same error it receives', () => { diff --git a/src/core/server/saved_objects/service/lib/decorate_es_error.ts b/src/core/server/saved_objects/service/lib/decorate_es_error.ts index 40eda7a854a25..9cfdffc13a5dd 100644 --- a/src/core/server/saved_objects/service/lib/decorate_es_error.ts +++ b/src/core/server/saved_objects/service/lib/decorate_es_error.ts @@ -10,6 +10,7 @@ import { get } from 'lodash'; import { errors as esErrors } from '@elastic/elasticsearch'; import type { ElasticsearchErrorDetails } from '@kbn/es-errors'; import { isSupportedEsServer } from '@kbn/core-elasticsearch-server-internal'; +import { SavedObjectsErrorHelpers } from '@kbn/core-saved-objects-utils-server'; const responseErrors = { isServiceUnavailable: (statusCode?: number) => statusCode === 503, @@ -25,8 +26,6 @@ const { ConnectionError, NoLivingConnectionsError, TimeoutError } = esErrors; const SCRIPT_CONTEXT_DISABLED_REGEX = /(?:cannot execute scripts using \[)([a-z]*)(?:\] context)/; const INLINE_SCRIPTS_DISABLED_MESSAGE = 'cannot execute [inline] scripts'; -import { SavedObjectsErrorHelpers } from './errors'; - type EsErrors = | esErrors.ConnectionError | esErrors.NoLivingConnectionsError diff --git a/src/core/server/saved_objects/service/lib/filter_utils.ts b/src/core/server/saved_objects/service/lib/filter_utils.ts index 27ff1c201cbdd..ae7bb08039850 100644 --- a/src/core/server/saved_objects/service/lib/filter_utils.ts +++ b/src/core/server/saved_objects/service/lib/filter_utils.ts @@ -6,11 +6,11 @@ * Side Public License, v 1. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { get, cloneDeep } from 'lodash'; import * as esKuery from '@kbn/es-query'; -import { SavedObjectsErrorHelpers } from './errors'; -import { IndexMapping } from '../../mappings'; +import { SavedObjectsErrorHelpers } from '@kbn/core-saved-objects-utils-server'; +import type { IndexMapping } from '@kbn/core-saved-objects-base-server-internal'; type KueryNode = any; diff --git a/src/core/server/saved_objects/service/lib/find_shared_origin_objects.ts b/src/core/server/saved_objects/service/lib/find_shared_origin_objects.ts index 229e0c6f90a66..34aff0b11d6d0 100644 --- a/src/core/server/saved_objects/service/lib/find_shared_origin_objects.ts +++ b/src/core/server/saved_objects/service/lib/find_shared_origin_objects.ts @@ -7,9 +7,9 @@ */ import * as esKuery from '@kbn/es-query'; +import { ALL_NAMESPACES_STRING } from '@kbn/core-saved-objects-utils-server'; import { getObjectKey } from './internal_utils'; import type { CreatePointInTimeFinderFn } from './point_in_time_finder'; -import { ALL_NAMESPACES_STRING } from './utils'; interface ObjectOrigin { /** The object's type. */ diff --git a/src/core/server/saved_objects/service/lib/get_index_for_type.test.ts b/src/core/server/saved_objects/service/lib/get_index_for_type.test.ts index 16e3ba9495f04..01bb3174cc56b 100644 --- a/src/core/server/saved_objects/service/lib/get_index_for_type.test.ts +++ b/src/core/server/saved_objects/service/lib/get_index_for_type.test.ts @@ -6,8 +6,8 @@ * Side Public License, v 1. */ +import { typeRegistryMock } from '@kbn/core-saved-objects-base-server-mocks'; import { getIndexForType } from './get_index_for_type'; -import { typeRegistryMock } from '../../saved_objects_type_registry.mock'; describe('getIndexForType', () => { const kibanaVersion = '8.0.0'; diff --git a/src/core/server/saved_objects/service/lib/index.ts b/src/core/server/saved_objects/service/lib/index.ts index 8fdb8301ce101..a43750608bf95 100644 --- a/src/core/server/saved_objects/service/lib/index.ts +++ b/src/core/server/saved_objects/service/lib/index.ts @@ -11,8 +11,4 @@ export { SavedObjectsClientProvider } from './scoped_client_provider'; export type { ISavedObjectsClientProvider } from './scoped_client_provider'; -export { SavedObjectsErrorHelpers } from './errors'; - -export { SavedObjectsUtils } from './utils'; - export { getIndexForType } from './get_index_for_type'; diff --git a/src/core/server/saved_objects/service/lib/internal_bulk_resolve.test.ts b/src/core/server/saved_objects/service/lib/internal_bulk_resolve.test.ts index ec55ea7725718..119b3ac85b698 100644 --- a/src/core/server/saved_objects/service/lib/internal_bulk_resolve.test.ts +++ b/src/core/server/saved_objects/service/lib/internal_bulk_resolve.test.ts @@ -18,12 +18,13 @@ import type { SavedObjectsBulkResolveObject, SavedObjectsBaseOptions, } from '@kbn/core-saved-objects-api-server'; -import { LEGACY_URL_ALIAS_TYPE } from '../../object_types'; -import { typeRegistryMock } from '../../saved_objects_type_registry.mock'; -import { SavedObjectsSerializer } from '../../serialization'; -import { SavedObjectsErrorHelpers } from './errors'; +import { SavedObjectsErrorHelpers, SavedObjectsUtils } from '@kbn/core-saved-objects-utils-server'; +import { + SavedObjectsSerializer, + LEGACY_URL_ALIAS_TYPE, +} from '@kbn/core-saved-objects-base-server-internal'; +import { typeRegistryMock } from '@kbn/core-saved-objects-base-server-mocks'; import { internalBulkResolve, InternalBulkResolveParams } from './internal_bulk_resolve'; -import { SavedObjectsUtils } from './utils'; import { normalizeNamespace } from './internal_utils'; const VERSION_PROPS = { _seq_no: 1, _primary_term: 1 }; diff --git a/src/core/server/saved_objects/service/lib/internal_bulk_resolve.ts b/src/core/server/saved_objects/service/lib/internal_bulk_resolve.ts index ebe94e4e95b4d..b15fc56e2f3c0 100644 --- a/src/core/server/saved_objects/service/lib/internal_bulk_resolve.ts +++ b/src/core/server/saved_objects/service/lib/internal_bulk_resolve.ts @@ -21,14 +21,20 @@ import type { ISavedObjectTypeRegistry, SavedObjectsRawDocSource, } from '@kbn/core-saved-objects-server'; +import { + SavedObjectsErrorHelpers, + type DecoratedError, +} from '@kbn/core-saved-objects-utils-server'; +import { + LEGACY_URL_ALIAS_TYPE, + type LegacyUrlAlias, + type SavedObjectsSerializer, +} from '@kbn/core-saved-objects-base-server-internal'; import { CORE_USAGE_STATS_ID, CORE_USAGE_STATS_TYPE, REPOSITORY_RESOLVE_OUTCOME_STATS, } from '../../../core_usage_data'; -import { LegacyUrlAlias, LEGACY_URL_ALIAS_TYPE } from '../../object_types'; -import type { SavedObjectsSerializer } from '../../serialization'; -import { DecoratedError, SavedObjectsErrorHelpers } from './errors'; import { getCurrentTime, getSavedObjectFromSource, diff --git a/src/core/server/saved_objects/service/lib/internal_utils.test.ts b/src/core/server/saved_objects/service/lib/internal_utils.test.ts index 65cb83d3e8a77..96ca3949a4775 100644 --- a/src/core/server/saved_objects/service/lib/internal_utils.test.ts +++ b/src/core/server/saved_objects/service/lib/internal_utils.test.ts @@ -7,8 +7,9 @@ */ import type { SavedObjectsRawDoc } from '@kbn/core-saved-objects-server'; -import { typeRegistryMock } from '../../saved_objects_type_registry.mock'; -import { encodeHitVersion } from '../../version'; +import { ALL_NAMESPACES_STRING } from '@kbn/core-saved-objects-utils-server'; +import { encodeHitVersion } from '@kbn/core-saved-objects-base-server-internal'; +import { typeRegistryMock } from '@kbn/core-saved-objects-base-server-mocks'; import { getBulkOperationError, getCurrentTime, @@ -19,7 +20,6 @@ import { rawDocExistsInNamespace, rawDocExistsInNamespaces, } from './internal_utils'; -import { ALL_NAMESPACES_STRING } from './utils'; describe('#getBulkOperationError', () => { const type = 'obj-type'; diff --git a/src/core/server/saved_objects/service/lib/internal_utils.ts b/src/core/server/saved_objects/service/lib/internal_utils.ts index 5f20a2bc3c842..84539510504a2 100644 --- a/src/core/server/saved_objects/service/lib/internal_utils.ts +++ b/src/core/server/saved_objects/service/lib/internal_utils.ts @@ -13,9 +13,15 @@ import type { SavedObjectsRawDoc, SavedObjectsRawDocSource, } from '@kbn/core-saved-objects-server'; -import { decodeRequestVersion, encodeHitVersion } from '../../version'; -import { SavedObjectsErrorHelpers } from './errors'; -import { ALL_NAMESPACES_STRING, SavedObjectsUtils } from './utils'; +import { + SavedObjectsErrorHelpers, + SavedObjectsUtils, + ALL_NAMESPACES_STRING, +} from '@kbn/core-saved-objects-utils-server'; +import { + decodeRequestVersion, + encodeHitVersion, +} from '@kbn/core-saved-objects-base-server-internal'; /** * Discriminated union (TypeScript approximation of an algebraic data type); this design pattern is used for internal repository operations. diff --git a/src/core/server/saved_objects/service/lib/legacy_url_aliases/delete_legacy_url_aliases.test.ts b/src/core/server/saved_objects/service/lib/legacy_url_aliases/delete_legacy_url_aliases.test.ts index dc261ee23aafb..77a538672ff19 100644 --- a/src/core/server/saved_objects/service/lib/legacy_url_aliases/delete_legacy_url_aliases.test.ts +++ b/src/core/server/saved_objects/service/lib/legacy_url_aliases/delete_legacy_url_aliases.test.ts @@ -11,8 +11,8 @@ import { mockGetEsErrorMessage } from './delete_legacy_url_aliases.test.mock'; / import { errors as EsErrors } from '@elastic/elasticsearch'; import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; -import { typeRegistryMock } from '../../../saved_objects_type_registry.mock'; -import { ALL_NAMESPACES_STRING } from '../utils'; +import { ALL_NAMESPACES_STRING } from '@kbn/core-saved-objects-utils-server'; +import { typeRegistryMock } from '@kbn/core-saved-objects-base-server-mocks'; import { deleteLegacyUrlAliases } from './delete_legacy_url_aliases'; import type { DeleteLegacyUrlAliasesParams } from './delete_legacy_url_aliases'; diff --git a/src/core/server/saved_objects/service/lib/legacy_url_aliases/delete_legacy_url_aliases.ts b/src/core/server/saved_objects/service/lib/legacy_url_aliases/delete_legacy_url_aliases.ts index 873f4ab9b6c9c..73489308f59af 100644 --- a/src/core/server/saved_objects/service/lib/legacy_url_aliases/delete_legacy_url_aliases.ts +++ b/src/core/server/saved_objects/service/lib/legacy_url_aliases/delete_legacy_url_aliases.ts @@ -10,11 +10,13 @@ import * as esKuery from '@kbn/es-query'; import { getErrorMessage as getEsErrorMessage } from '@kbn/core-elasticsearch-client-server-internal'; import type { ISavedObjectTypeRegistry } from '@kbn/core-saved-objects-server'; -import type { IndexMapping } from '../../../mappings'; -import { LEGACY_URL_ALIAS_TYPE } from '../../../object_types'; +import { ALL_NAMESPACES_STRING } from '@kbn/core-saved-objects-utils-server'; +import { + LEGACY_URL_ALIAS_TYPE, + type IndexMapping, +} from '@kbn/core-saved-objects-base-server-internal'; import type { RepositoryEsClient } from '../repository_es_client'; import { getSearchDsl } from '../search_dsl'; -import { ALL_NAMESPACES_STRING } from '../utils'; /** @internal */ export interface DeleteLegacyUrlAliasesParams { diff --git a/src/core/server/saved_objects/service/lib/legacy_url_aliases/find_legacy_url_aliases.test.ts b/src/core/server/saved_objects/service/lib/legacy_url_aliases/find_legacy_url_aliases.test.ts index 8200c7502fec6..36435b9828be4 100644 --- a/src/core/server/saved_objects/service/lib/legacy_url_aliases/find_legacy_url_aliases.test.ts +++ b/src/core/server/saved_objects/service/lib/legacy_url_aliases/find_legacy_url_aliases.test.ts @@ -9,7 +9,10 @@ import type { DeeplyMockedKeys } from '@kbn/utility-types-jest'; import type { ISavedObjectsRepository } from '@kbn/core-saved-objects-api-server'; -import { LegacyUrlAlias, LEGACY_URL_ALIAS_TYPE } from '../../../object_types'; +import { + type LegacyUrlAlias, + LEGACY_URL_ALIAS_TYPE, +} from '@kbn/core-saved-objects-base-server-internal'; import type { CreatePointInTimeFinderFn, PointInTimeFinder } from '../point_in_time_finder'; import { savedObjectsPointInTimeFinderMock } from '../point_in_time_finder.mock'; import { savedObjectsRepositoryMock } from '../repository.mock'; diff --git a/src/core/server/saved_objects/service/lib/legacy_url_aliases/find_legacy_url_aliases.ts b/src/core/server/saved_objects/service/lib/legacy_url_aliases/find_legacy_url_aliases.ts index 70b1730ec8f48..5a90a2e70d073 100644 --- a/src/core/server/saved_objects/service/lib/legacy_url_aliases/find_legacy_url_aliases.ts +++ b/src/core/server/saved_objects/service/lib/legacy_url_aliases/find_legacy_url_aliases.ts @@ -7,7 +7,10 @@ */ import * as esKuery from '@kbn/es-query'; -import { LegacyUrlAlias, LEGACY_URL_ALIAS_TYPE } from '../../../object_types'; +import { + type LegacyUrlAlias, + LEGACY_URL_ALIAS_TYPE, +} from '@kbn/core-saved-objects-base-server-internal'; import { getObjectKey } from '../internal_utils'; import type { CreatePointInTimeFinderFn } from '../point_in_time_finder'; diff --git a/src/core/server/saved_objects/service/lib/preflight_check_for_create.test.ts b/src/core/server/saved_objects/service/lib/preflight_check_for_create.test.ts index 9563ebd51344f..d23d2cf5e804e 100644 --- a/src/core/server/saved_objects/service/lib/preflight_check_for_create.test.ts +++ b/src/core/server/saved_objects/service/lib/preflight_check_for_create.test.ts @@ -15,9 +15,11 @@ import type { DeeplyMockedKeys } from '@kbn/utility-types-jest'; import type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; -import { LEGACY_URL_ALIAS_TYPE } from '../../object_types'; -import { typeRegistryMock } from '../../saved_objects_type_registry.mock'; -import { SavedObjectsSerializer } from '../../serialization'; +import { + SavedObjectsSerializer, + LEGACY_URL_ALIAS_TYPE, +} from '@kbn/core-saved-objects-base-server-internal'; +import { typeRegistryMock } from '@kbn/core-saved-objects-base-server-mocks'; import type { CreatePointInTimeFinderFn } from './point_in_time_finder'; import { ALIAS_SEARCH_PER_PAGE, diff --git a/src/core/server/saved_objects/service/lib/preflight_check_for_create.ts b/src/core/server/saved_objects/service/lib/preflight_check_for_create.ts index b94302b2b990f..a3fd4218c3eeb 100644 --- a/src/core/server/saved_objects/service/lib/preflight_check_for_create.ts +++ b/src/core/server/saved_objects/service/lib/preflight_check_for_create.ts @@ -13,15 +13,20 @@ import type { SavedObjectsRawDoc, SavedObjectsRawDocSource, } from '@kbn/core-saved-objects-server'; -import { LegacyUrlAlias, LEGACY_URL_ALIAS_TYPE } from '../../object_types'; -import type { SavedObjectsSerializer } from '../../serialization'; +import { + SavedObjectsErrorHelpers, + ALL_NAMESPACES_STRING, +} from '@kbn/core-saved-objects-utils-server'; +import { + LEGACY_URL_ALIAS_TYPE, + type LegacyUrlAlias, + type SavedObjectsSerializer, +} from '@kbn/core-saved-objects-base-server-internal'; import { findLegacyUrlAliases } from './legacy_url_aliases'; import { Either, rawDocExistsInNamespaces } from './internal_utils'; import { getObjectKey, isLeft, isRight } from './internal_utils'; import type { CreatePointInTimeFinderFn } from './point_in_time_finder'; import type { RepositoryEsClient } from './repository_es_client'; -import { ALL_NAMESPACES_STRING } from './utils'; -import { SavedObjectsErrorHelpers } from './errors'; /** * If the object will be created in this many spaces (or "*" all current and future spaces), we use find to fetch all aliases. diff --git a/src/core/server/saved_objects/service/lib/repository.test.ts b/src/core/server/saved_objects/service/lib/repository.test.ts index 9af620101ab94..30a6b1ab36151 100644 --- a/src/core/server/saved_objects/service/lib/repository.test.ts +++ b/src/core/server/saved_objects/service/lib/repository.test.ts @@ -55,17 +55,21 @@ import type { SavedObjectsMappingProperties, SavedObjectsTypeMappingDefinition, } from '@kbn/core-saved-objects-server'; +import { + SavedObjectsErrorHelpers, + ALL_NAMESPACES_STRING, +} from '@kbn/core-saved-objects-utils-server'; import { SavedObjectsRepository } from './repository'; -import { SavedObjectsErrorHelpers } from './errors'; import { PointInTimeFinder } from './point_in_time_finder'; -import { ALL_NAMESPACES_STRING } from './utils'; import { loggerMock } from '@kbn/logging-mocks'; -import { SavedObjectsSerializer } from '../../serialization'; -import { encodeHitVersion } from '../../version'; -import { SavedObjectTypeRegistry } from '../../saved_objects_type_registry'; +import { + SavedObjectTypeRegistry, + SavedObjectsSerializer, + encodeHitVersion, + LEGACY_URL_ALIAS_TYPE, +} from '@kbn/core-saved-objects-base-server-internal'; import { DocumentMigrator } from '../../migrations/core/document_migrator'; import { mockKibanaMigrator } from '../../migrations/kibana_migrator.mock'; -import { LEGACY_URL_ALIAS_TYPE } from '../../object_types'; import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import * as esKuery from '@kbn/es-query'; import { errors as EsErrors } from '@elastic/elasticsearch'; diff --git a/src/core/server/saved_objects/service/lib/repository.ts b/src/core/server/saved_objects/service/lib/repository.ts index 1ede13e1142b2..524fe5f7eb966 100644 --- a/src/core/server/saved_objects/service/lib/repository.ts +++ b/src/core/server/saved_objects/service/lib/repository.ts @@ -60,17 +60,31 @@ import type { SavedObjectsRawDocSource, ISavedObjectTypeRegistry, } from '@kbn/core-saved-objects-server'; -import { getRootPropertiesObjects, IndexMapping } from '../../mappings'; +import { + SavedObjectsErrorHelpers, + type DecoratedError, +} from '@kbn/core-saved-objects-utils-server'; +import { + ALL_NAMESPACES_STRING, + FIND_DEFAULT_PAGE, + FIND_DEFAULT_PER_PAGE, + SavedObjectsUtils, +} from '@kbn/core-saved-objects-utils-server'; +import { + SavedObjectsSerializer, + SavedObjectsTypeValidator, + decodeRequestVersion, + encodeVersion, + encodeHitVersion, + getRootPropertiesObjects, + LEGACY_URL_ALIAS_TYPE, + type IndexMapping, +} from '@kbn/core-saved-objects-base-server-internal'; import { PointInTimeFinder } from './point_in_time_finder'; import { createRepositoryEsClient, RepositoryEsClient } from './repository_es_client'; import { getSearchDsl } from './search_dsl'; import { includedFields } from './included_fields'; -import { SavedObjectsErrorHelpers, DecoratedError } from './errors'; -import { decodeRequestVersion, encodeVersion, encodeHitVersion } from '../../version'; import { IKibanaMigrator } from '../../migrations'; -import { SavedObjectsSerializer } from '../../serialization'; -import { LEGACY_URL_ALIAS_TYPE } from '../../object_types'; -import { SavedObjectsTypeValidator } from '../../validation'; import { internalBulkResolve, InternalBulkResolveError } from './internal_bulk_resolve'; import { validateConvertFilterToKueryNode } from './filter_utils'; import { validateAndConvertAggregations } from './aggregations'; @@ -86,12 +100,6 @@ import { isLeft, isRight, } from './internal_utils'; -import { - ALL_NAMESPACES_STRING, - FIND_DEFAULT_PAGE, - FIND_DEFAULT_PER_PAGE, - SavedObjectsUtils, -} from './utils'; import { collectMultiNamespaceReferences } from './collect_multi_namespace_references'; import { updateObjectsSpaces } from './update_objects_spaces'; import { getIndexForType } from './get_index_for_type'; diff --git a/src/core/server/saved_objects/service/lib/repository_create_repository.test.ts b/src/core/server/saved_objects/service/lib/repository_create_repository.test.ts index b1033012a4beb..9a2d56cdaaa89 100644 --- a/src/core/server/saved_objects/service/lib/repository_create_repository.test.ts +++ b/src/core/server/saved_objects/service/lib/repository_create_repository.test.ts @@ -6,10 +6,10 @@ * Side Public License, v 1. */ +import { SavedObjectTypeRegistry } from '@kbn/core-saved-objects-base-server-internal'; import { SavedObjectsRepository } from './repository'; import { mockKibanaMigrator } from '../../migrations/kibana_migrator.mock'; import { KibanaMigrator } from '../../migrations'; -import { SavedObjectTypeRegistry } from '../../saved_objects_type_registry'; import { loggerMock, MockedLogger } from '@kbn/logging-mocks'; jest.mock('./repository'); diff --git a/src/core/server/saved_objects/service/lib/repository_es_client.test.ts b/src/core/server/saved_objects/service/lib/repository_es_client.test.ts index f465ffb6a3dab..cbd8f81bfc0f5 100644 --- a/src/core/server/saved_objects/service/lib/repository_es_client.test.ts +++ b/src/core/server/saved_objects/service/lib/repository_es_client.test.ts @@ -10,7 +10,7 @@ import { retryCallClusterMock } from './repository_es_client.test.mock'; import { createRepositoryEsClient, RepositoryEsClient } from './repository_es_client'; import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; -import { SavedObjectsErrorHelpers } from './errors'; +import { SavedObjectsErrorHelpers } from '@kbn/core-saved-objects-utils-server'; describe('RepositoryEsClient', () => { let client: ReturnType; diff --git a/src/core/server/saved_objects/service/lib/scoped_client_provider.test.ts b/src/core/server/saved_objects/service/lib/scoped_client_provider.test.ts index efc04f69e6ecf..2641ecfb1cec6 100644 --- a/src/core/server/saved_objects/service/lib/scoped_client_provider.test.ts +++ b/src/core/server/saved_objects/service/lib/scoped_client_provider.test.ts @@ -7,8 +7,8 @@ */ import { httpServerMock } from '@kbn/core-http-server-mocks'; +import { typeRegistryMock } from '@kbn/core-saved-objects-base-server-mocks'; import { SavedObjectsClientProvider } from './scoped_client_provider'; -import { typeRegistryMock } from '../../saved_objects_type_registry.mock'; test(`uses default client factory when one isn't set`, () => { const returnValue = Symbol(); diff --git a/src/core/server/saved_objects/service/lib/search_dsl/query_params.test.ts b/src/core/server/saved_objects/service/lib/search_dsl/query_params.test.ts index 3f27bef5c68af..c502665468e6c 100644 --- a/src/core/server/saved_objects/service/lib/search_dsl/query_params.test.ts +++ b/src/core/server/saved_objects/service/lib/search_dsl/query_params.test.ts @@ -12,8 +12,11 @@ import * as esKuery from '@kbn/es-query'; type KueryNode = any; -import { ALL_NAMESPACES_STRING, DEFAULT_NAMESPACE_STRING } from '../utils'; -import { SavedObjectTypeRegistry } from '../../../saved_objects_type_registry'; +import { + ALL_NAMESPACES_STRING, + DEFAULT_NAMESPACE_STRING, +} from '@kbn/core-saved-objects-utils-server'; +import { SavedObjectTypeRegistry } from '@kbn/core-saved-objects-base-server-internal'; import { getQueryParams } from './query_params'; const registerTypes = (registry: SavedObjectTypeRegistry) => { diff --git a/src/core/server/saved_objects/service/lib/search_dsl/query_params.ts b/src/core/server/saved_objects/service/lib/search_dsl/query_params.ts index 1c21a7177faf4..669f2a273569b 100644 --- a/src/core/server/saved_objects/service/lib/search_dsl/query_params.ts +++ b/src/core/server/saved_objects/service/lib/search_dsl/query_params.ts @@ -11,7 +11,10 @@ import * as esKuery from '@kbn/es-query'; type KueryNode = any; import type { ISavedObjectTypeRegistry } from '@kbn/core-saved-objects-server'; -import { ALL_NAMESPACES_STRING, DEFAULT_NAMESPACE_STRING } from '../utils'; +import { + ALL_NAMESPACES_STRING, + DEFAULT_NAMESPACE_STRING, +} from '@kbn/core-saved-objects-utils-server'; import { getReferencesFilter } from './references_filter'; /** diff --git a/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.test.ts b/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.test.ts index b15560b82ab31..d1ed7251b2414 100644 --- a/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.test.ts +++ b/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.test.ts @@ -10,7 +10,7 @@ jest.mock('./pit_params'); jest.mock('./query_params'); jest.mock('./sorting_params'); -import { typeRegistryMock } from '../../../saved_objects_type_registry.mock'; +import { typeRegistryMock } from '@kbn/core-saved-objects-base-server-mocks'; import * as pitParamsNS from './pit_params'; import * as queryParamsNS from './query_params'; import { getSearchDsl } from './search_dsl'; diff --git a/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.ts b/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.ts index 7d6d31949739c..980bf800755b9 100644 --- a/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.ts +++ b/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.ts @@ -11,7 +11,7 @@ import Boom from '@hapi/boom'; import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import type { SavedObjectsPitParams } from '@kbn/core-saved-objects-api-server'; import type { ISavedObjectTypeRegistry } from '@kbn/core-saved-objects-server'; -import { IndexMapping } from '../../../mappings'; +import type { IndexMapping } from '@kbn/core-saved-objects-base-server-internal'; import { getQueryParams, HasReferenceQueryParams, SearchOperator } from './query_params'; import { getPitParams } from './pit_params'; import { getSortingParams } from './sorting_params'; diff --git a/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.ts b/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.ts index 030219b4ba5b1..d2308736b5dc2 100644 --- a/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.ts +++ b/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.ts @@ -8,7 +8,7 @@ import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import Boom from '@hapi/boom'; -import { getProperty, IndexMapping } from '../../../mappings'; +import { getProperty, type IndexMapping } from '@kbn/core-saved-objects-base-server-internal'; const TOP_LEVEL_FIELDS = ['_id', '_score']; diff --git a/src/core/server/saved_objects/service/lib/update_objects_spaces.test.ts b/src/core/server/saved_objects/service/lib/update_objects_spaces.test.ts index dfd1600e6d218..6e6c241965056 100644 --- a/src/core/server/saved_objects/service/lib/update_objects_spaces.test.ts +++ b/src/core/server/saved_objects/service/lib/update_objects_spaces.test.ts @@ -17,12 +17,14 @@ import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-m import { loggerMock } from '@kbn/logging-mocks'; import type { SavedObjectsUpdateObjectsSpacesObject } from '@kbn/core-saved-objects-api-server'; -import { typeRegistryMock } from '../../saved_objects_type_registry.mock'; -import { SavedObjectsSerializer } from '../../serialization'; +import { + SavedObjectsErrorHelpers, + ALL_NAMESPACES_STRING, +} from '@kbn/core-saved-objects-utils-server'; +import { SavedObjectsSerializer } from '@kbn/core-saved-objects-base-server-internal'; +import { typeRegistryMock } from '@kbn/core-saved-objects-base-server-mocks'; import type { UpdateObjectsSpacesParams } from './update_objects_spaces'; import { updateObjectsSpaces } from './update_objects_spaces'; -import { ALL_NAMESPACES_STRING } from './utils'; -import { SavedObjectsErrorHelpers } from './errors'; type SetupParams = Partial< Pick diff --git a/src/core/server/saved_objects/service/lib/update_objects_spaces.ts b/src/core/server/saved_objects/service/lib/update_objects_spaces.ts index a92f9a952af18..4053fcff4a8ea 100644 --- a/src/core/server/saved_objects/service/lib/update_objects_spaces.ts +++ b/src/core/server/saved_objects/service/lib/update_objects_spaces.ts @@ -22,10 +22,15 @@ import type { ISavedObjectTypeRegistry, SavedObjectsRawDocSource, } from '@kbn/core-saved-objects-server'; -import type { IndexMapping } from '../../mappings'; -import type { SavedObjectsSerializer } from '../../serialization'; -import type { DecoratedError } from './errors'; -import { SavedObjectsErrorHelpers } from './errors'; +import { + SavedObjectsErrorHelpers, + ALL_NAMESPACES_STRING, + type DecoratedError, +} from '@kbn/core-saved-objects-utils-server'; +import type { + IndexMapping, + SavedObjectsSerializer, +} from '@kbn/core-saved-objects-base-server-internal'; import { getBulkOperationError, getExpectedVersionProperties, @@ -36,7 +41,6 @@ import { } from './internal_utils'; import { DEFAULT_REFRESH_SETTING } from './repository'; import type { RepositoryEsClient } from './repository_es_client'; -import { ALL_NAMESPACES_STRING } from './utils'; import type { DeleteLegacyUrlAliasesParams } from './legacy_url_aliases'; import { deleteLegacyUrlAliases } from './legacy_url_aliases'; diff --git a/src/core/server/saved_objects/service/saved_objects_client.mock.ts b/src/core/server/saved_objects/service/saved_objects_client.mock.ts index fe5ea92ed0766..55a96ea3cecfc 100644 --- a/src/core/server/saved_objects/service/saved_objects_client.mock.ts +++ b/src/core/server/saved_objects/service/saved_objects_client.mock.ts @@ -7,7 +7,7 @@ */ import type { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; -import { SavedObjectsErrorHelpers } from './lib/errors'; +import { SavedObjectsErrorHelpers } from '@kbn/core-saved-objects-utils-server'; import { savedObjectsPointInTimeFinderMock } from './lib/point_in_time_finder.mock'; const create = () => { diff --git a/src/core/server/saved_objects/service/saved_objects_client.ts b/src/core/server/saved_objects/service/saved_objects_client.ts index c9cfd9e720056..7c2b3a205b76d 100644 --- a/src/core/server/saved_objects/service/saved_objects_client.ts +++ b/src/core/server/saved_objects/service/saved_objects_client.ts @@ -40,7 +40,7 @@ import type { SavedObjectsCreatePointInTimeFinderOptions, SavedObjectsFindOptions, } from '@kbn/core-saved-objects-api-server'; -import { SavedObjectsErrorHelpers } from './lib/errors'; +import { SavedObjectsErrorHelpers } from '@kbn/core-saved-objects-utils-server'; /** * Core internal implementation of {@link SavedObjectsClientContract} diff --git a/src/core/server/server.ts b/src/core/server/server.ts index 42878ca66e614..82705f2428e5c 100644 --- a/src/core/server/server.ts +++ b/src/core/server/server.ts @@ -45,6 +45,10 @@ import { import { MetricsService, opsConfig } from '@kbn/core-metrics-server-internal'; import { CapabilitiesService } from '@kbn/core-capabilities-server-internal'; import type { SavedObjectsServiceStart } from '@kbn/core-saved-objects-server'; +import { + savedObjectsConfig, + savedObjectsMigrationConfig, +} from '@kbn/core-saved-objects-base-server-internal'; import { CoreApp } from './core_app'; import { I18nService } from './i18n'; import { HttpResourcesService } from './http_resources'; @@ -53,9 +57,8 @@ import { UiSettingsService } from './ui_settings'; import { PluginsService, config as pluginsConfig } from './plugins'; import { SavedObjectsService } from './saved_objects'; // do not try to shorten the import to `./status`, it will break server test mocking -import { StatusService } from './status/status_service'; -import { savedObjectsConfig, savedObjectsMigrationConfig } from './saved_objects'; +import { StatusService } from './status/status_service'; import { config as uiSettingsConfig } from './ui_settings'; import { config as statusConfig } from './status'; import { config as i18nConfig } from './i18n'; diff --git a/src/core/server/ui_settings/create_or_upgrade_saved_config/create_or_upgrade_saved_config.test.ts b/src/core/server/ui_settings/create_or_upgrade_saved_config/create_or_upgrade_saved_config.test.ts index c5a9c9729b78a..6102ff6f7b1be 100644 --- a/src/core/server/ui_settings/create_or_upgrade_saved_config/create_or_upgrade_saved_config.test.ts +++ b/src/core/server/ui_settings/create_or_upgrade_saved_config/create_or_upgrade_saved_config.test.ts @@ -10,7 +10,7 @@ import { mockTransform, mockGetUpgradeableConfig, } from './create_or_upgrade_saved_config.test.mock'; -import { SavedObjectsErrorHelpers } from '../../saved_objects'; +import { SavedObjectsErrorHelpers } from '@kbn/core-saved-objects-utils-server'; import { savedObjectsClientMock } from '../../saved_objects/service/saved_objects_client.mock'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; diff --git a/src/core/server/ui_settings/create_or_upgrade_saved_config/create_or_upgrade_saved_config.ts b/src/core/server/ui_settings/create_or_upgrade_saved_config/create_or_upgrade_saved_config.ts index def1b58784174..e453c9cf46f31 100644 --- a/src/core/server/ui_settings/create_or_upgrade_saved_config/create_or_upgrade_saved_config.ts +++ b/src/core/server/ui_settings/create_or_upgrade_saved_config/create_or_upgrade_saved_config.ts @@ -11,7 +11,7 @@ import { defaults } from 'lodash'; import type { Logger, LogMeta } from '@kbn/logging'; import { asyncForEach } from '@kbn/std'; import type { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; -import { SavedObjectsErrorHelpers } from '../../saved_objects'; +import { SavedObjectsErrorHelpers } from '@kbn/core-saved-objects-utils-server'; import { getUpgradeableConfig } from './get_upgradeable_config'; import { transforms } from '../saved_objects'; diff --git a/src/core/server/ui_settings/routes/delete.ts b/src/core/server/ui_settings/routes/delete.ts index 705a5319c1cf5..4147358d4e1ee 100644 --- a/src/core/server/ui_settings/routes/delete.ts +++ b/src/core/server/ui_settings/routes/delete.ts @@ -8,7 +8,7 @@ import { schema } from '@kbn/config-schema'; -import { SavedObjectsErrorHelpers } from '../../saved_objects'; +import { SavedObjectsErrorHelpers } from '@kbn/core-saved-objects-utils-server'; import type { InternalUiSettingsRouter } from '../internal_types'; import { CannotOverrideError } from '../ui_settings_errors'; diff --git a/src/core/server/ui_settings/routes/get.ts b/src/core/server/ui_settings/routes/get.ts index c940c2e1fe71e..2603526c37503 100644 --- a/src/core/server/ui_settings/routes/get.ts +++ b/src/core/server/ui_settings/routes/get.ts @@ -6,8 +6,8 @@ * Side Public License, v 1. */ +import { SavedObjectsErrorHelpers } from '@kbn/core-saved-objects-utils-server'; import type { InternalUiSettingsRouter } from '../internal_types'; -import { SavedObjectsErrorHelpers } from '../../saved_objects'; export function registerGetRoute(router: InternalUiSettingsRouter) { router.get( diff --git a/src/core/server/ui_settings/routes/set.ts b/src/core/server/ui_settings/routes/set.ts index af62fda0144b6..61493be876ad7 100644 --- a/src/core/server/ui_settings/routes/set.ts +++ b/src/core/server/ui_settings/routes/set.ts @@ -8,7 +8,7 @@ import { schema, ValidationError } from '@kbn/config-schema'; -import { SavedObjectsErrorHelpers } from '../../saved_objects'; +import { SavedObjectsErrorHelpers } from '@kbn/core-saved-objects-utils-server'; import type { InternalUiSettingsRouter } from '../internal_types'; import { CannotOverrideError } from '../ui_settings_errors'; diff --git a/src/core/server/ui_settings/routes/set_many.ts b/src/core/server/ui_settings/routes/set_many.ts index fe0ee1a0a721f..3bbe14c4a0076 100644 --- a/src/core/server/ui_settings/routes/set_many.ts +++ b/src/core/server/ui_settings/routes/set_many.ts @@ -8,7 +8,7 @@ import { schema, ValidationError } from '@kbn/config-schema'; -import { SavedObjectsErrorHelpers } from '../../saved_objects'; +import { SavedObjectsErrorHelpers } from '@kbn/core-saved-objects-utils-server'; import type { InternalUiSettingsRouter } from '../internal_types'; import { CannotOverrideError } from '../ui_settings_errors'; diff --git a/src/core/server/ui_settings/saved_objects/migrations.test.ts b/src/core/server/ui_settings/saved_objects/migrations.test.ts index df561ef4152f6..c08f75ad9d184 100644 --- a/src/core/server/ui_settings/saved_objects/migrations.test.ts +++ b/src/core/server/ui_settings/saved_objects/migrations.test.ts @@ -310,3 +310,38 @@ describe('ui_settings 8.1.0 migrations', () => { }); }); }); + +describe('ui_settings 8.5.0 migrations', () => { + const migration = migrations['8.5.0']; + + test('returns doc on empty object', () => { + expect(migration({} as SavedObjectUnsanitizedDoc)).toEqual({ + references: [], + }); + }); + + test('removes "observability:enableInfrastructureView" setting', () => { + const doc = { + type: 'config', + id: '8.5.0', + attributes: { + buildNum: 9007199254740991, + 'observability:enableInfrastructureView': true, + }, + references: [], + updated_at: '2020-06-09T20:18:20.349Z', + migrationVersion: {}, + }; + + expect(migration(doc)).toEqual({ + type: 'config', + id: '8.5.0', + attributes: { + buildNum: 9007199254740991, + }, + references: [], + updated_at: '2020-06-09T20:18:20.349Z', + migrationVersion: {}, + }); + }); +}); diff --git a/src/core/server/ui_settings/saved_objects/migrations.ts b/src/core/server/ui_settings/saved_objects/migrations.ts index 7ed65cfe61894..73b51254d1869 100644 --- a/src/core/server/ui_settings/saved_objects/migrations.ts +++ b/src/core/server/ui_settings/saved_objects/migrations.ts @@ -138,4 +138,25 @@ export const migrations = { }), references: doc.references || [], }), + '8.5.0': (doc: SavedObjectUnsanitizedDoc): SavedObjectSanitizedDoc => ({ + ...doc, + ...(doc.attributes && { + attributes: Object.keys(doc.attributes).reduce( + (acc, key) => + [ + // owner: Team:Apm + 'observability:enableInfrastructureView', + ].includes(key) + ? { + ...acc, + } + : { + ...acc, + [key]: doc.attributes[key], + }, + {} + ), + }), + references: doc.references || [], + }), }; diff --git a/src/core/server/ui_settings/saved_objects/transforms.test.ts b/src/core/server/ui_settings/saved_objects/transforms.test.ts index afcd525673aa0..279dfd637b9e2 100644 --- a/src/core/server/ui_settings/saved_objects/transforms.test.ts +++ b/src/core/server/ui_settings/saved_objects/transforms.test.ts @@ -7,7 +7,7 @@ */ import { savedObjectsClientMock } from '../../mocks'; -import { SavedObjectsErrorHelpers } from '../../saved_objects'; +import { SavedObjectsErrorHelpers } from '@kbn/core-saved-objects-utils-server'; import { SavedObject } from '../../types'; import type { UpgradeableConfigAttributes } from '../create_or_upgrade_saved_config'; import { transformDefaultIndex } from './transforms'; diff --git a/src/core/server/ui_settings/saved_objects/transforms.ts b/src/core/server/ui_settings/saved_objects/transforms.ts index cabf14a2e6469..797b895f91556 100644 --- a/src/core/server/ui_settings/saved_objects/transforms.ts +++ b/src/core/server/ui_settings/saved_objects/transforms.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { SavedObjectsErrorHelpers } from '../../saved_objects'; +import { SavedObjectsErrorHelpers } from '@kbn/core-saved-objects-utils-server'; import type { SavedObjectsClientContract } from '../../types'; import type { UpgradeableConfigAttributes } from '../create_or_upgrade_saved_config'; diff --git a/src/core/server/ui_settings/ui_settings_client.ts b/src/core/server/ui_settings/ui_settings_client.ts index 5175af54ffe3e..aa7d344881cf6 100644 --- a/src/core/server/ui_settings/ui_settings_client.ts +++ b/src/core/server/ui_settings/ui_settings_client.ts @@ -8,7 +8,7 @@ import type { Logger } from '@kbn/logging'; import type { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; -import { SavedObjectsErrorHelpers } from '../saved_objects'; +import { SavedObjectsErrorHelpers } from '@kbn/core-saved-objects-utils-server'; import { createOrUpgradeSavedConfig } from './create_or_upgrade_saved_config'; import { UiSettingsParams } from './types'; import { CannotOverrideError } from './ui_settings_errors'; diff --git a/src/dev/license_checker/config.ts b/src/dev/license_checker/config.ts index 02649c2fc5b88..fea4d101c64ea 100644 --- a/src/dev/license_checker/config.ts +++ b/src/dev/license_checker/config.ts @@ -67,6 +67,7 @@ export const LICENSE_ALLOWED = [ 'WTFPL', 'Nuclide software', 'Python-2.0', + '(Apache-2.0 AND MIT)', ]; // The following list only applies to licenses that diff --git a/src/dev/precommit_hook/casing_check_config.js b/src/dev/precommit_hook/casing_check_config.js index 0c65b924f14b1..418a8f448b2c8 100644 --- a/src/dev/precommit_hook/casing_check_config.js +++ b/src/dev/precommit_hook/casing_check_config.js @@ -54,7 +54,7 @@ export const IGNORE_FILE_GLOBS = [ '**/preview-head.html', // filename must match upstream filenames from lodash - 'packages/elastic-safer-lodash-set/**/*', + 'packages/kbn-safer-lodash-set/**/*', // filename must match upstream filenames from handlebars 'packages/kbn-handlebars/src/upstream/**/*', diff --git a/src/dev/storybook/aliases.ts b/src/dev/storybook/aliases.ts index 65035c0c95f72..7bb26e526be3d 100644 --- a/src/dev/storybook/aliases.ts +++ b/src/dev/storybook/aliases.ts @@ -39,7 +39,7 @@ export const storybookAliases = { observability: 'x-pack/plugins/observability/.storybook', presentation: 'src/plugins/presentation_util/storybook', security_solution: 'x-pack/plugins/security_solution/.storybook', - shared_ux: 'packages/kbn-shared-ux-storybook/src/config', + shared_ux: 'packages/shared-ux/storybook/config', threat_intelligence: 'x-pack/plugins/threat_intelligence/.storybook', ui_actions_enhanced: 'src/plugins/ui_actions_enhanced/.storybook', unified_search: 'src/plugins/unified_search/.storybook', diff --git a/src/plugins/chart_expressions/expression_metric/common/expression_functions/metric_vis_function.ts b/src/plugins/chart_expressions/expression_metric/common/expression_functions/metric_vis_function.ts index d01a2400e038a..10067f702d906 100644 --- a/src/plugins/chart_expressions/expression_metric/common/expression_functions/metric_vis_function.ts +++ b/src/plugins/chart_expressions/expression_metric/common/expression_functions/metric_vis_function.ts @@ -102,6 +102,7 @@ export const metricVisFunction = (): MetricVisExpressionFunctionDefinition => ({ fn(input, args, handlers) { validateAccessor(args.metric, input.columns); validateAccessor(args.secondaryMetric, input.columns); + validateAccessor(args.max, input.columns); validateAccessor(args.breakdownBy, input.columns); if (handlers?.inspectorAdapters?.tables) { diff --git a/src/plugins/chart_expressions/expression_metric/public/components/metric_vis.test.tsx b/src/plugins/chart_expressions/expression_metric/public/components/metric_vis.test.tsx index fd0fbac29ae91..c94a0688588a1 100644 --- a/src/plugins/chart_expressions/expression_metric/public/components/metric_vis.test.tsx +++ b/src/plugins/chart_expressions/expression_metric/public/components/metric_vis.test.tsx @@ -1216,5 +1216,16 @@ describe('MetricVisComponent', function () { }, }); }); + + it('ignores suffix formatting', () => { + const { primary, secondary } = getFormattedMetrics(0.23939, 11.2, { + id: 'suffix', + params: { + id: 'percent', + }, + }); + expect(primary).toBe('23.94%'); + expect(secondary).toBe('1.12K%'); + }); }); }); diff --git a/src/plugins/chart_expressions/expression_metric/public/components/metric_vis.tsx b/src/plugins/chart_expressions/expression_metric/public/components/metric_vis.tsx index ef091c5245901..05a0266e676d0 100644 --- a/src/plugins/chart_expressions/expression_metric/public/components/metric_vis.tsx +++ b/src/plugins/chart_expressions/expression_metric/public/components/metric_vis.tsx @@ -80,7 +80,10 @@ const getMetricFormatter = ( columns: Datatable['columns'] ) => { const serializedFieldFormat = getFormatByAccessor(accessor, columns); - const formatId = serializedFieldFormat?.id ?? 'number'; + const formatId = + (serializedFieldFormat?.id === 'suffix' + ? serializedFieldFormat.params?.id + : serializedFieldFormat?.id) ?? 'number'; if ( !['number', 'currency', 'percent', 'bytes', 'duration', 'string', 'null'].includes(formatId) @@ -160,16 +163,11 @@ const getColor = ( data: Datatable, rowNumber: number ) => { - let minBound = paletteParams.rangeMin; - let maxBound = paletteParams.rangeMax; - const { min, max } = getDataBoundsForPalette(accessors, data, rowNumber); - minBound = min; - maxBound = max; return getPaletteService().get(CUSTOM_PALETTE)?.getColorForValue?.(value, paletteParams, { - min: minBound, - max: maxBound, + min, + max, }); }; diff --git a/src/plugins/dashboard/public/application/lib/dashboard_session_storage.ts b/src/plugins/dashboard/public/application/lib/dashboard_session_storage.ts index a696c8bc15b83..0c6aaba99b9ee 100644 --- a/src/plugins/dashboard/public/application/lib/dashboard_session_storage.ts +++ b/src/plugins/dashboard/public/application/lib/dashboard_session_storage.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { Storage } from '../../services/kibana_utils'; import { NotificationsStart } from '../../services/core'; import { panelStorageErrorStrings } from '../../dashboard_strings'; diff --git a/src/plugins/data/common/search/search_source/search_source.ts b/src/plugins/data/common/search/search_source/search_source.ts index 9f16795efa37a..5f4ce4be637a8 100644 --- a/src/plugins/data/common/search/search_source/search_source.ts +++ b/src/plugins/data/common/search/search_source/search_source.ts @@ -58,7 +58,7 @@ * `appSearchSource`. */ -import { setWith } from '@elastic/safer-lodash-set'; +import { setWith } from '@kbn/safer-lodash-set'; import { difference, isEqual, isFunction, isObject, keyBy, pick, uniqueId, uniqWith } from 'lodash'; import { catchError, diff --git a/src/plugins/data_view_editor/public/components/form_fields/title_field.tsx b/src/plugins/data_view_editor/public/components/form_fields/title_field.tsx index 6c41700ead531..822de9506500a 100644 --- a/src/plugins/data_view_editor/public/components/form_fields/title_field.tsx +++ b/src/plugins/data_view_editor/public/components/form_fields/title_field.tsx @@ -182,7 +182,6 @@ export const TitleField = ({ isInvalid={isInvalid} value={field.value} onChange={(e: ChangeEvent) => { - e.persist(); let query = e.target.value; if (query.length === 1 && !appendedWildcard && canAppendWildcard(query)) { query += '*'; diff --git a/src/plugins/discover/public/application/main/discover_main_route.test.tsx b/src/plugins/discover/public/application/main/discover_main_route.test.tsx index 6734864210ee6..aead62c038e47 100644 --- a/src/plugins/discover/public/application/main/discover_main_route.test.tsx +++ b/src/plugins/discover/public/application/main/discover_main_route.test.tsx @@ -22,7 +22,7 @@ import { searchSourceInstanceMock } from '@kbn/data-plugin/common/search/search_ import { findTestSubject } from '@elastic/eui/lib/test'; jest.mock('./discover_main_app', () => { return { - DiscoverMainApp: jest.fn(), + DiscoverMainApp: jest.fn().mockReturnValue(<>), }; }); diff --git a/src/plugins/embeddable/README.md b/src/plugins/embeddable/README.md index fc6632252bb01..14fab2f8412f3 100644 --- a/src/plugins/embeddable/README.md +++ b/src/plugins/embeddable/README.md @@ -4,6 +4,7 @@ The Embeddables Plugin provides an opportunity to expose reusable interactive wi ## Capabilities - Framework-agnostic API. - Out-of-the-box React support. +- Integration with Redux. - Integration with the [UI Actions](https://github.com/elastic/kibana/tree/HEAD/src/plugins/ui_actions) plugin. - Hierarchical structure to enclose multiple widgets. - Error handling. @@ -354,6 +355,251 @@ The plugin provides a set of ready-to-use React components that abstract renderi Apart from the React components, there is also a way to construct an embeddable object using `useEmbeddableFactory` hook. This React hook takes care of producing an embeddable and updating its input state if passed state changes. +### Redux +The plugin provides an adapter for Redux over the embeddable state. +It uses the Redux Toolkit library underneath and works as a decorator on top of the [`configureStore`](https://redux-toolkit.js.org/api/configureStore) function. +In other words, it provides a way to use the full power of the library together with the embeddable plugin features. + +The adapter implements a bi-directional sync mechanism between the embeddable instance and the Redux state. +To perform state mutations, the plugin also exposes a pre-defined state of the actions that can be extended by an additional reducer. + +Here is an example of initializing a Redux store: +```tsx +import React from 'react'; +import { render } from 'react-dom'; +import { connect, Provider } from 'react-redux'; +import { Embeddable, IEmbeddable } from '@kbn/embeddable-plugin/public'; +import { createStore, State } from '@kbn/embeddable-plugin/public/store'; +import { HelloWorldComponent } from './hello_world_component'; + +export const HELLO_WORLD = 'HELLO_WORLD'; + +export class HelloWorld extends Embeddable { + readonly type = HELLO_WORLD; + + readonly store = createStore(this); + + reload() {} + + render(node: HTMLElement) { + const Component = connect((state: State) => ({ title: state.input.title }))( + HelloWorldComponent + ); + + render( + + + , + node + ); + } +} +``` + +Then inside the embedded component, it is possible to use the [`useSelector`](https://react-redux.js.org/api/hooks#useselector) and [`useDispatch`](https://react-redux.js.org/api/hooks#usedispatch) hooks. +```tsx +import React from 'react'; +import { useDispatch, useSelector } from 'react-redux'; +import { actions, State } from '@kbn/embeddable-plugin/public/store'; +import { ViewMode } from '@kbn/embeddable-plugin/public'; +import type { HelloWorld } from './hello_world'; + +interface HelloWorldComponentProps { + title?: string; +} + +export function HelloWorldComponent({ title }: HelloWorldComponentProps) { + const viewMode = useSelector>(({ input }) => input.viewMode); + const dispatch = useDispatch(); + + return ( +
+

{title}

+ {viewMode === ViewMode.EDIT && ( + dispatch(actions.input.setTitle(target.value))} + /> + )} +
+ ); +} +``` + +#### Custom Properties +The `createStore` function provides an option to pass a custom reducer in the second argument. +That reducer will be merged with the one the embeddable plugin provides. +That means there is no need to reimplement already existing actions. + +```tsx +import React from 'react'; +import { render } from 'react-dom'; +import { createSlice } from '@reduxjs/toolkit'; +import { + Embeddable, + EmbeddableInput, + EmbeddableOutput, + IEmbeddable +} from '@kbn/embeddable-plugin/public'; +import { createStore, State } from '@kbn/embeddable-plugin/public/store'; + +interface HelloWorldInput extends EmbeddableInput { + greeting?: string; +} + +interface HelloWorldOutput extends EmbeddableOutput { + message?: string; +} + +const input = createSlice({ + name: 'hello-world-input', + initialState: {} as HelloWorldInput, + reducers: { + setGreeting(state, action: PayloadAction) { + state.greeting = action.payload; + }, + }, +}); + +const output = createSlice({ + name: 'hello-world-input', + initialState: {} as HelloWorldOutput, + reducers: { + setMessage(state, action: PayloadAction) { + state.message = action.payload; + }, + }, +}); + +export const actions = { + ...input.actions, + ...output.actions, +}; + +export class HelloWorld extends Embeddable { + readonly store = createStore(this, { + reducer: { + input: input.reducer, + output: output.reducer, + } + }); + + // ... +} +``` + +There is a way to provide a custom reducer that will manipulate the root state: +```typescript +// ... + +import { createAction, createRducer } from '@reduxjs/toolkit'; + +// ... + +const setGreeting = createAction('greeting'); +const setMessage = createAction('message'); +const reducer = createReducer({} as State, (builder) => + builder + .addCase(setGreeting, (state, action) => ({ ...state, input: { ...state.input, greeting: action.payload } })) + .addCase(setMessage, (state, action) => ({ ...state, output: { ...state.output, message: action.payload } })) +); + +export const actions = { + setGreeting, + setMessage, +}; + +export class HelloWorld extends Embeddable { + readonly store = createStore(this, { reducer }); + + // ... +} +``` + +#### Custom State +Sometimes, there is a need to store a custom state next to the embeddable state. +This can be achieved by passing a custom reducer. + +```tsx +import React from 'react'; +import { render } from 'react-dom'; +import { createSlice } from '@reduxjs/toolkit'; +import { Embeddable, IEmbeddable } from '@kbn/embeddable-plugin/public'; +import { createStore, State } from '@kbn/embeddable-plugin/public/store'; + +interface ComponentState { + foo?: string; + bar?: string; +} + +export interface HelloWorldState extends State { + component: ComponentState; +} + +const component = createSlice({ + name: 'hello-world-component', + initialState: {} as ComponentState, + reducers: { + setFoo(state, action: PayloadAction) { + state.foo = action.payload; + }, + setBar(state, action: PayloadAction) { + state.bar = action.payload; + }, + }, +}); + +export const { actions } = component; + +export class HelloWorld extends Embeddable { + readonly store = createStore(this, { + preloadedState: { + component: { + foo: 'bar', + bar: 'foo', + } + }, + reducer: { component: component.reducer } + }); + + // ... +} +``` + +#### Typings +When using the `useSelector` hook, it is convenient to have a `State` type to guarantee type safety and determine types implicitly. + +For the state containing input and output substates only, it is enough to use a utility type `State`: +```typescript +import { useSelector } from 'react-redux'; +import type { State } from '@kbn/embeddable-plugin/public/store'; +import type { Embeddable } from './some_embeddable'; + +// ... +const title = useSelector>((state) => state.input.title); +``` + +For the more complex case, the best way would be to define a state type separately: +```typescript +import { useSelector } from 'react-redux'; +import type { State } from '@kbn/embeddable-plugin/public/store'; +import type { Embeddable } from './some_embeddable'; + +interface EmbeddableState extends State { + foo?: string; + bar?: Bar; +} + +// ... +const foo = useSelector((state) => state.foo); +``` + +#### Advanced Usage +In case when there is a need to enhance the produced store in some way (e.g., perform custom serialization or debugging), it is possible to use [parameters](https://redux-toolkit.js.org/api/configureStore#parameters) supported by the `configureStore` function. + +In case when custom serialization is needed, that should be done using middleware. The embeddable plugin's `createStore` function does not apply any middleware, so all the synchronization job is done outside the store. + ## API Please use automatically generated API reference or generated TypeDoc comments to find the complete documentation. diff --git a/src/plugins/embeddable/public/__stories__/embeddable_panel.stories.tsx b/src/plugins/embeddable/public/__stories__/embeddable_panel.stories.tsx index 1f15b942fb589..97e8b83b9f7b1 100644 --- a/src/plugins/embeddable/public/__stories__/embeddable_panel.stories.tsx +++ b/src/plugins/embeddable/public/__stories__/embeddable_panel.stories.tsx @@ -25,6 +25,7 @@ import { CoreTheme } from '@kbn/core-theme-browser'; import type { Action } from '@kbn/ui-actions-plugin/public'; import { CONTEXT_MENU_TRIGGER, EmbeddablePanel, PANEL_BADGE_TRIGGER, ViewMode } from '..'; +import { actions } from '../store'; import { HelloWorldEmbeddable } from './hello_world_embeddable'; const layout: DecoratorFn = (story) => { @@ -93,20 +94,16 @@ const HelloWorldEmbeddablePanel = forwardRef< const theme = useContext(ThemeContext) as CoreTheme; useEffect(() => theme$.next(theme), [theme$, theme]); + useEffect(() => { + embeddable.store.dispatch(actions.input.setTitle(title)); + }, [embeddable.store, title]); + useEffect(() => { + embeddable.store.dispatch( + actions.input.setViewMode(viewMode ? ViewMode.VIEW : ViewMode.EDIT) + ); + }, [embeddable.store, viewMode]); useEffect( - () => - embeddable.updateInput({ - title, - viewMode: viewMode ? ViewMode.VIEW : ViewMode.EDIT, - lastReloadRequestTime: new Date().getMilliseconds(), - }), - [embeddable, title, viewMode] - ); - useEffect( - () => - embeddable.updateOutput({ - loading, - }), + () => void embeddable.store.dispatch(actions.output.setLoading(loading)), [embeddable, loading] ); useImperativeHandle(ref, () => ({ embeddable })); @@ -162,7 +159,9 @@ export function DefaultWithBadges({ badges, ...props }: DefaultWithBadgesProps) useEffect( () => - ref.current?.embeddable.updateInput({ lastReloadRequestTime: new Date().getMilliseconds() }), + void ref.current?.embeddable.store.dispatch( + actions.input.setLastReloadRequestTime(new Date().getMilliseconds()) + ), [getActions] ); @@ -207,7 +206,9 @@ export function DefaultWithContextMenu({ items, ...props }: DefaultWithContextMe useEffect( () => - ref.current?.embeddable.updateInput({ lastReloadRequestTime: new Date().getMilliseconds() }), + void ref.current?.embeddable.store.dispatch( + actions.input.setLastReloadRequestTime(new Date().getMilliseconds()) + ), [getActions] ); @@ -230,7 +231,10 @@ interface DefaultWithErrorProps extends HelloWorldEmbeddablePanelProps { export function DefaultWithError({ message, ...props }: DefaultWithErrorProps) { const ref = useRef>(null); - useEffect(() => ref.current?.embeddable.updateOutput({ error: new Error(message) }), [message]); + useEffect( + () => void ref.current?.embeddable.store.dispatch(actions.output.setError(new Error(message))), + [message] + ); return ; } @@ -256,7 +260,10 @@ export function DefaultWithCustomError({ message, ...props }: DefaultWithErrorPr }), [] ); - useEffect(() => ref.current?.embeddable.updateOutput({ error: new Error(message) }), [message]); + useEffect( + () => void ref.current?.embeddable.store.dispatch(actions.output.setError(new Error(message))), + [message] + ); return ; } diff --git a/src/plugins/embeddable/public/__stories__/hello_world_embeddable.tsx b/src/plugins/embeddable/public/__stories__/hello_world_embeddable.tsx index 2ea923704be77..5cf2c5fdc46e8 100644 --- a/src/plugins/embeddable/public/__stories__/hello_world_embeddable.tsx +++ b/src/plugins/embeddable/public/__stories__/hello_world_embeddable.tsx @@ -8,10 +8,15 @@ import React from 'react'; import { render } from 'react-dom'; +import { connect, Provider } from 'react-redux'; import { EuiEmptyPrompt } from '@elastic/eui'; import { Embeddable, IEmbeddable } from '..'; +import { createStore, State } from '../store'; export class HelloWorldEmbeddable extends Embeddable { + // eslint-disable-next-line @kbn/eslint/no_this_in_property_initializers + readonly store = createStore(this); + readonly type = 'hello-world'; renderError: IEmbeddable['renderError']; @@ -19,16 +24,17 @@ export class HelloWorldEmbeddable extends Embeddable { reload() {} render(node: HTMLElement) { - render(, node); - - this.reload = this.render.bind(this, node); + const App = connect((state: State) => ({ body: state.input.title }))(EuiEmptyPrompt); + + render( + + + , + node + ); } setErrorRenderer(renderer: IEmbeddable['renderError']) { this.renderError = renderer; } - - updateOutput(...args: Parameters): void { - return super.updateOutput(...args); - } } diff --git a/src/plugins/embeddable/public/lib/embeddables/embeddable.tsx b/src/plugins/embeddable/public/lib/embeddables/embeddable.tsx index 001cb98afa6c1..94025320ec86d 100644 --- a/src/plugins/embeddable/public/lib/embeddables/embeddable.tsx +++ b/src/plugins/embeddable/public/lib/embeddables/embeddable.tsx @@ -41,8 +41,10 @@ export abstract class Embeddable< protected output: TEmbeddableOutput; protected input: TEmbeddableInput; - private readonly input$: Rx.BehaviorSubject; - private readonly output$: Rx.BehaviorSubject; + private readonly inputSubject = new Rx.ReplaySubject(1); + private readonly outputSubject = new Rx.ReplaySubject(1); + private readonly input$ = this.inputSubject.asObservable(); + private readonly output$ = this.outputSubject.asObservable(); protected renderComplete = new RenderCompleteDispatcher(); @@ -71,8 +73,8 @@ export abstract class Embeddable< }; this.parent = parent; - this.input$ = new Rx.BehaviorSubject(this.input); - this.output$ = new Rx.BehaviorSubject(this.output); + this.inputSubject.next(this.input); + this.outputSubject.next(this.output); if (parent) { this.parentSubscription = Rx.merge(parent.getInput$(), parent.getOutput$()).subscribe(() => { @@ -89,12 +91,7 @@ export abstract class Embeddable< map(({ title }) => title || ''), distinctUntilChanged() ) - .subscribe( - (title) => { - this.renderComplete.setTitle(title); - }, - () => {} - ); + .subscribe((title) => this.renderComplete.setTitle(title)); } public reportsEmbeddableLoad() { @@ -142,11 +139,11 @@ export abstract class Embeddable< } public getInput$(): Readonly> { - return this.input$.asObservable(); + return this.input$; } public getOutput$(): Readonly> { - return this.output$.asObservable(); + return this.output$; } public getOutput(): Readonly { @@ -238,8 +235,8 @@ export abstract class Embeddable< public destroy(): void { this.destroyed = true; - this.input$.complete(); - this.output$.complete(); + this.inputSubject.complete(); + this.outputSubject.complete(); if (this.parentSubscription) { this.parentSubscription.unsubscribe(); @@ -257,20 +254,20 @@ export abstract class Embeddable< } } - protected updateOutput(outputChanges: Partial): void { + public updateOutput(outputChanges: Partial): void { const newOutput = { ...this.output, ...outputChanges, }; if (!fastIsEqual(this.output, newOutput)) { this.output = newOutput; - this.output$.next(this.output); + this.outputSubject.next(this.output); } } protected onFatalError(e: Error) { this.fatalError = e; - this.output$.error(e); + this.outputSubject.error(e); // if the container is waiting for this embeddable to complete loading, // a fatal error counts as complete. if (this.deferEmbeddableLoad && this.parent?.isContainer) { @@ -282,7 +279,7 @@ export abstract class Embeddable< if (!fastIsEqual(this.input, newInput)) { const oldLastReloadRequestTime = this.input.lastReloadRequestTime; this.input = newInput; - this.input$.next(newInput); + this.inputSubject.next(newInput); this.updateOutput({ title: getPanelTitle(this.input, this.output), } as Partial); diff --git a/src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts b/src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts index 9037de1a10075..1c9bdebcefc9b 100644 --- a/src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts +++ b/src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts @@ -142,6 +142,12 @@ export interface IEmbeddable< */ updateInput(changes: Partial): void; + /** + * Updates output state with the given changes. + * @param changes + */ + updateOutput(changes: Partial): void; + /** * Returns an observable which will be notified when input state changes. */ diff --git a/src/plugins/embeddable/public/store/create_store.test.ts b/src/plugins/embeddable/public/store/create_store.test.ts new file mode 100644 index 0000000000000..52ac1eb32c8dc --- /dev/null +++ b/src/plugins/embeddable/public/store/create_store.test.ts @@ -0,0 +1,245 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 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. + */ + +// eslint-disable-next-line max-classes-per-file +import { createAction, createReducer, createSlice, PayloadAction } from '@reduxjs/toolkit'; +import type { Store } from 'redux'; +import { + defaultEmbeddableFactoryProvider, + Container, + ContainerInput, + Embeddable, + EmbeddableInput, + EmbeddableOutput, +} from '../lib'; +import { createStore, State } from './create_store'; +import { input } from './input_slice'; +import { output } from './output_slice'; + +interface TestEmbeddableInput extends EmbeddableInput { + custom?: string; +} + +interface TestEmbeddableOutput extends EmbeddableOutput { + custom?: string; +} + +interface TestContainerInput extends ContainerInput { + custom?: string; +} + +class TestEmbeddable extends Embeddable { + type = 'test'; + reload = jest.fn(); + render = jest.fn(); +} + +class TestContainer extends Container, TestContainerInput> { + type = 'test'; + + getInheritedInput() { + return { + custom: this.input.custom, + }; + } +} + +describe('createStore', () => { + let embeddable: TestEmbeddable; + let store: Store>; + + beforeEach(() => { + embeddable = new TestEmbeddable({ id: '12345' }, { title: 'Test' }); + store = createStore(embeddable); + }); + + it('should populate the state with the embeddable input', () => { + expect(store.getState()).toHaveProperty('input', expect.objectContaining({ id: '12345' })); + }); + + it('should populate the state with the embeddable output', () => { + expect(store.getState()).toHaveProperty('output', expect.objectContaining({ title: 'Test' })); + }); + + it('should update the embeddable input on action dispatch', () => { + store.dispatch(input.actions.setTitle('Something')); + + expect(store.getState()).toHaveProperty('input.title', 'Something'); + }); + + it('should update the embeddable output on action dispatch', () => { + store.dispatch(output.actions.setTitle('Something')); + + expect(store.getState()).toHaveProperty('output.title', 'Something'); + }); + + it('should group input updates on multiple dispatch calls', async () => { + jest.spyOn(embeddable, 'updateInput'); + store.dispatch(input.actions.setTitle('Something')); + store.dispatch(input.actions.setHidePanelTitles(true)); + await new Promise((resolve) => setTimeout(resolve)); + + expect(embeddable.updateInput).toHaveBeenCalledTimes(1); + expect(embeddable.updateInput).nthCalledWith( + 1, + expect.objectContaining({ title: 'Something', hidePanelTitles: true }) + ); + }); + + it('should group output updates on multiple dispatch calls', async () => { + jest.spyOn(embeddable, 'updateOutput'); + store.dispatch(output.actions.setTitle('Something')); + store.dispatch(output.actions.setLoading(true)); + await new Promise((resolve) => setTimeout(resolve)); + + expect(embeddable.updateOutput).toHaveBeenCalledTimes(1); + expect(embeddable.updateOutput).nthCalledWith( + 1, + expect.objectContaining({ title: 'Something', loading: true }) + ); + }); + + it('should not update input on output changes', async () => { + jest.spyOn(embeddable, 'updateInput'); + store.dispatch(output.actions.setTitle('Something')); + await new Promise((resolve) => setTimeout(resolve)); + + expect(embeddable.updateInput).not.toHaveBeenCalled(); + }); + + it('should sync input changes', () => { + jest.spyOn(embeddable, 'updateInput'); + embeddable.updateInput({ title: 'Something' }); + + expect(embeddable.updateInput).toHaveBeenCalledTimes(1); + expect(store.getState()).toHaveProperty('input.title', 'Something'); + }); + + it('should sync output changes', () => { + jest.spyOn(embeddable, 'updateOutput'); + embeddable.updateOutput({ title: 'Something' }); + + expect(embeddable.updateOutput).toHaveBeenCalledTimes(1); + expect(store.getState()).toHaveProperty('output.title', 'Something'); + }); + + it('should provide a way to use a custom reducer', async () => { + const setCustom = createAction('custom'); + const customStore = createStore(embeddable, { + reducer: { + input: createReducer({} as TestEmbeddableInput, (builder) => + builder.addCase(setCustom, (state, action) => ({ ...state, custom: action.payload })) + ), + }, + }); + + jest.spyOn(embeddable, 'updateInput'); + customStore.dispatch(input.actions.setTitle('Something')); + customStore.dispatch(setCustom('Something else')); + await new Promise((resolve) => setTimeout(resolve)); + + expect(embeddable.updateInput).toHaveBeenCalledWith( + expect.objectContaining({ custom: 'Something else', title: 'Something' }) + ); + }); + + it('should provide a way to use a custom slice', async () => { + const slice = createSlice({ + name: 'test', + initialState: {} as State, + reducers: { + setCustom(state, action: PayloadAction) { + state.input.custom = action.payload; + state.output.custom = action.payload; + }, + }, + }); + const customStore = createStore(embeddable, { reducer: slice.reducer }); + + jest.spyOn(embeddable, 'updateInput'); + jest.spyOn(embeddable, 'updateOutput'); + customStore.dispatch(input.actions.setTitle('Something')); + customStore.dispatch(slice.actions.setCustom('Something else')); + await new Promise((resolve) => setTimeout(resolve)); + + expect(embeddable.updateInput).toHaveBeenCalledWith( + expect.objectContaining({ custom: 'Something else', title: 'Something' }) + ); + expect(embeddable.updateOutput).toHaveBeenCalledWith( + expect.objectContaining({ custom: 'Something else' }) + ); + }); + + describe('of a nested embeddable', () => { + const factory = defaultEmbeddableFactoryProvider< + TestEmbeddableInput, + TestEmbeddableOutput, + TestEmbeddable + >({ + type: 'test', + getDisplayName: () => 'Test', + isEditable: async () => true, + create: async (data, parent) => new TestEmbeddable(data, {}, parent), + }); + const getFactory = jest.fn().mockReturnValue(factory); + + let container: TestContainer; + + beforeEach(async () => { + container = new TestContainer( + { custom: 'something', id: 'id', panels: {} }, + { embeddableLoaded: {} }, + getFactory + ); + embeddable = (await container.addNewEmbeddable('test', { id: '12345' })) as TestEmbeddable; + store = createStore(embeddable); + }); + + it('should populate inherited input', () => { + expect(store.getState()).toHaveProperty('input.custom', 'something'); + }); + + it('should override inherited input on dispatch', async () => { + store.dispatch( + input.actions.update({ custom: 'something else' } as Partial) + ); + await new Promise((resolve) => setTimeout(resolve)); + + expect(store.getState()).toHaveProperty('input.custom', 'something else'); + expect(container.getInput()).toHaveProperty( + 'input.custom', + expect.not.stringMatching('something else') + ); + }); + + it('should restore value from the inherited input', async () => { + store.dispatch( + input.actions.update({ custom: 'something else' } as Partial) + ); + await new Promise((resolve) => setTimeout(resolve)); + store.dispatch(input.actions.update({ custom: undefined } as Partial)); + await new Promise((resolve) => setTimeout(resolve)); + + expect(store.getState()).toHaveProperty('input.custom', 'something'); + }); + + it('should not override inherited input on dispatch', async () => { + store.dispatch(input.actions.setTitle('Something')); + await new Promise((resolve) => setTimeout(resolve)); + container.updateInput({ custom: 'something else' }); + + expect(store.getState()).toHaveProperty( + 'input', + expect.objectContaining({ + title: 'Something', + custom: 'something else', + }) + ); + }); + }); +}); diff --git a/src/plugins/embeddable/public/store/create_store.ts b/src/plugins/embeddable/public/store/create_store.ts new file mode 100644 index 0000000000000..135f793c079dd --- /dev/null +++ b/src/plugins/embeddable/public/store/create_store.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 { chain, isEmpty, keys } from 'lodash'; +import { combineReducers, Reducer, Store, ReducersMapObject } from 'redux'; +import { configureStore, ConfigureStoreOptions } from '@reduxjs/toolkit'; +import { + debounceTime, + distinctUntilChanged, + filter, + last, + map, + pluck, + share, + takeUntil, + Observable, +} from 'rxjs'; +import reduceReducers from 'reduce-reducers'; +import type { Optional } from 'utility-types'; +import type { IEmbeddable } from '../lib'; +import { input } from './input_slice'; +import { output } from './output_slice'; + +export interface State { + input: E extends IEmbeddable ? I : never; + output: E extends IEmbeddable ? O : never; +} + +export interface CreateStoreOptions + extends Omit, 'reducer'> { + reducer?: Reducer | Optional, keyof State>; +} + +function createReducer( + reducer?: CreateStoreOptions['reducer'] +): Reducer | ReducersMapObject { + if (reducer instanceof Function) { + const generic = combineReducers>({ + input: input.reducer, + output: output.reducer, + }) as Reducer; + + return reduceReducers(generic, reducer) as Reducer; + } + + return { + ...(reducer ?? {}), + input: reducer?.input ? reduceReducers(input.reducer, reducer.input) : input.reducer, + output: reducer?.output ? reduceReducers(output.reducer, reducer.output) : output.reducer, + } as ReducersMapObject; +} + +function diff>(previous: T, current: T) { + return chain(current) + .keys() + .concat(keys(previous)) + .uniq() + .filter((key) => previous[key] !== current[key]) + .map((key) => [key, current[key]]) + .fromPairs() + .value() as Partial; +} + +/** + * Creates a Redux store for the given embeddable. + * @param embeddable The embeddable instance. + * @param options The custom options to pass to the `configureStore` call. + * @returns The Redux store. + */ +export function createStore = State>( + embeddable: E, + { preloadedState, reducer, ...options }: CreateStoreOptions = {} +): Store { + const store = configureStore({ + ...options, + preloadedState: { + input: embeddable.getInput(), + output: embeddable.getOutput(), + ...(preloadedState ?? {}), + } as NonNullable, + reducer: createReducer(reducer), + }); + + const state$ = new Observable((subscriber) => { + subscriber.add(store.subscribe(() => subscriber.next(store.getState()))); + }).pipe(share()); + const input$ = embeddable.getInput$(); + const output$ = embeddable.getOutput$(); + + state$ + .pipe( + takeUntil(input$.pipe(last())), + pluck('input'), + distinctUntilChanged(), + map((value) => diff(embeddable.getInput(), value)), + filter((patch) => !isEmpty(patch)), + debounceTime(0) + ) + .subscribe((patch) => embeddable.updateInput(patch)); + + state$ + .pipe( + takeUntil(output$.pipe(last())), + pluck('output'), + distinctUntilChanged(), + map((value) => diff(embeddable.getOutput(), value)), + filter((patch) => !isEmpty(patch)), + debounceTime(0) + ) + .subscribe((patch) => embeddable.updateOutput(patch)); + + input$ + .pipe( + map((value) => diff(store.getState().input, value)), + filter((patch) => !isEmpty(patch)) + ) + .subscribe((patch) => store.dispatch(input.actions.update(patch))); + + output$ + .pipe( + map((value) => diff(store.getState().output, value)), + filter((patch) => !isEmpty(patch)) + ) + .subscribe((patch) => store.dispatch(output.actions.update(patch))); + + return store; +} diff --git a/src/plugins/embeddable/public/store/index.ts b/src/plugins/embeddable/public/store/index.ts new file mode 100644 index 0000000000000..05567e0215589 --- /dev/null +++ b/src/plugins/embeddable/public/store/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { input } from './input_slice'; +import { output } from './output_slice'; + +export type { CreateStoreOptions, State } from './create_store'; +export { createStore } from './create_store'; +export const actions = { + input: input.actions, + output: output.actions, +}; diff --git a/src/plugins/embeddable/public/store/input_slice.ts b/src/plugins/embeddable/public/store/input_slice.ts new file mode 100644 index 0000000000000..da4bc6618ae11 --- /dev/null +++ b/src/plugins/embeddable/public/store/input_slice.ts @@ -0,0 +1,56 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { createSlice, PayloadAction } from '@reduxjs/toolkit'; +import type { EmbeddableInput } from '../lib'; + +export const input = createSlice({ + name: 'input', + initialState: {} as EmbeddableInput, + reducers: { + setDisabledActions(state, action: PayloadAction) { + state.disabledActions = action.payload; + }, + setDisableTriggers(state, action: PayloadAction) { + state.disableTriggers = action.payload; + }, + setEnhancements(state, action: PayloadAction) { + state.enhancements = action.payload; + }, + setExecutionContext(state, action: PayloadAction) { + state.executionContext = action.payload; + }, + setHidePanelTitles(state, action: PayloadAction) { + state.hidePanelTitles = action.payload; + }, + setLastReloadRequestTime( + state, + action: PayloadAction + ) { + state.lastReloadRequestTime = action.payload; + }, + setSearchSessionId(state, action: PayloadAction) { + state.searchSessionId = action.payload; + }, + setSyncColors(state, action: PayloadAction) { + state.syncColors = action.payload; + }, + setSyncTooltips(state, action: PayloadAction) { + state.syncTooltips = action.payload; + }, + setTitle(state, action: PayloadAction) { + state.title = action.payload; + }, + setViewMode(state, action: PayloadAction) { + state.viewMode = action.payload; + }, + update(state, action: PayloadAction>) { + return { ...state, ...action.payload }; + }, + }, +}); diff --git a/src/plugins/embeddable/public/store/output_slice.ts b/src/plugins/embeddable/public/store/output_slice.ts new file mode 100644 index 0000000000000..c3cbaf6875893 --- /dev/null +++ b/src/plugins/embeddable/public/store/output_slice.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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { createSlice, PayloadAction } from '@reduxjs/toolkit'; +import type { EmbeddableOutput } from '../lib'; + +export const output = createSlice({ + name: 'output', + initialState: {} as EmbeddableOutput, + reducers: { + setLoading(state, action: PayloadAction) { + state.loading = action.payload; + }, + setRendered(state, action: PayloadAction) { + state.rendered = action.payload; + }, + setError(state, action: PayloadAction) { + state.error = action.payload; + }, + setEditUrl(state, action: PayloadAction) { + state.editUrl = action.payload; + }, + setEditApp(state, action: PayloadAction) { + state.editApp = action.payload; + }, + setEditPath(state, action: PayloadAction) { + state.editPath = action.payload; + }, + setDefaultTitle(state, action: PayloadAction) { + state.defaultTitle = action.payload; + }, + setTitle(state, action: PayloadAction) { + state.title = action.payload; + }, + setEditable(state, action: PayloadAction) { + state.editable = action.payload; + }, + setSavedObjectId(state, action: PayloadAction) { + state.savedObjectId = action.payload; + }, + update(state, action: PayloadAction>) { + return { ...state, ...action.payload }; + }, + }, +}); diff --git a/src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_form.ts b/src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_form.ts index b6b45c76e7115..95ed985bf1a2f 100644 --- a/src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_form.ts +++ b/src/plugins/es_ui_shared/static/forms/hook_form_lib/hooks/use_form.ts @@ -8,7 +8,7 @@ import { useState, useRef, useEffect, useMemo, useCallback } from 'react'; import { get, mergeWith } from 'lodash'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { FormHook, FieldHook, FormData, FieldsMap, FormConfig } from '../types'; import { diff --git a/src/plugins/es_ui_shared/static/forms/hook_form_lib/lib/utils.ts b/src/plugins/es_ui_shared/static/forms/hook_form_lib/lib/utils.ts index 54f6726abb115..fe41de2947795 100644 --- a/src/plugins/es_ui_shared/static/forms/hook_form_lib/lib/utils.ts +++ b/src/plugins/es_ui_shared/static/forms/hook_form_lib/lib/utils.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { FieldHook } from '../types'; interface GenericObject { diff --git a/src/plugins/home/public/application/components/guided_onboarding/getting_started.tsx b/src/plugins/home/public/application/components/guided_onboarding/getting_started.tsx index b5415064eea17..9f27a0194a3ca 100644 --- a/src/plugins/home/public/application/components/guided_onboarding/getting_started.tsx +++ b/src/plugins/home/public/application/components/guided_onboarding/getting_started.tsx @@ -21,7 +21,7 @@ import { import { css } from '@emotion/react'; import { METRIC_TYPE } from '@kbn/analytics'; import { i18n } from '@kbn/i18n'; -import { KibanaPageTemplate } from '@kbn/shared-ux-components'; +import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; import { getServices } from '../../kibana_services'; import { KEY_ENABLE_WELCOME } from '../home'; diff --git a/src/plugins/interactive_setup/public/use_form.ts b/src/plugins/interactive_setup/public/use_form.ts index abd00edee6750..47768400dd775 100644 --- a/src/plugins/interactive_setup/public/use_form.ts +++ b/src/plugins/interactive_setup/public/use_form.ts @@ -6,12 +6,13 @@ * Side Public License, v 1. */ -import { set } from '@elastic/safer-lodash-set'; import { cloneDeep, cloneDeepWith, get } from 'lodash'; import type { ChangeEventHandler, FocusEventHandler, ReactEventHandler } from 'react'; import { useState } from 'react'; import useAsyncFn from 'react-use/lib/useAsyncFn'; +import { set } from '@kbn/safer-lodash-set'; + export type FormReturnTuple = [FormState, FormProps]; export interface FormProps { diff --git a/src/plugins/kibana_overview/public/components/overview/overview.test.tsx b/src/plugins/kibana_overview/public/components/overview/overview.test.tsx index 99d8b45cdf27b..0fbedc5c3367e 100644 --- a/src/plugins/kibana_overview/public/components/overview/overview.test.tsx +++ b/src/plugins/kibana_overview/public/components/overview/overview.test.tsx @@ -13,16 +13,16 @@ import { act } from 'react-dom/test-utils'; import { ReactWrapper } from 'enzyme'; import { EuiLoadingSpinner } from '@elastic/eui'; import { mountWithIntl } from '@kbn/test-jest-helpers'; -import { KibanaPageTemplate } from '@kbn/shared-ux-components'; +import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; import type { FeatureCatalogueCategory } from '@kbn/home-plugin/public'; import { AnalyticsNoDataPageKibanaProvider } from '@kbn/shared-ux-page-analytics-no-data'; import { hasESData, hasUserDataView } from './overview.test.mocks'; import { Overview } from './overview'; -jest.mock('@kbn/shared-ux-components', () => { +jest.mock('@kbn/shared-ux-page-kibana-template', () => { const MockedComponent: string = 'MockedKibanaPageTemplate'; const mockedModule = { - ...jest.requireActual('@kbn/shared-ux-components'), + ...jest.requireActual('@kbn/shared-ux-page-kibana-template'), KibanaPageTemplate: () => { return ; }, diff --git a/src/plugins/kibana_overview/public/components/overview/overview.tsx b/src/plugins/kibana_overview/public/components/overview/overview.tsx index 738b278b17b36..245fcb12c7afd 100644 --- a/src/plugins/kibana_overview/public/components/overview/overview.tsx +++ b/src/plugins/kibana_overview/public/components/overview/overview.tsx @@ -25,7 +25,7 @@ import { overviewPageActions, OverviewPageFooter, } from '@kbn/kibana-react-plugin/public'; -import { KibanaPageTemplate } from '@kbn/shared-ux-components'; +import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; import { KibanaSolutionAvatar } from '@kbn/shared-ux-avatar-solution'; import { AnalyticsNoDataPageKibanaProvider, diff --git a/src/plugins/kibana_react/public/app_links/index.ts b/src/plugins/kibana_react/public/app_links/index.ts index ca09b2a3bfe36..3bfd7baca0c02 100644 --- a/src/plugins/kibana_react/public/app_links/index.ts +++ b/src/plugins/kibana_react/public/app_links/index.ts @@ -5,5 +5,5 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -/** @deprecated Use `RedirectAppLinks` from `@kbn/shared-ux-components */ +/** @deprecated Use `RedirectAppLinks` from `@kbn/shared-ux-link-redirect-app` */ export { RedirectAppLinks } from './redirect_app_link'; diff --git a/src/plugins/kibana_react/public/app_links/redirect_app_link.test.tsx b/src/plugins/kibana_react/public/app_links/redirect_app_link.test.tsx index 133cab06e6b6f..f4ce0d3ff80d3 100644 --- a/src/plugins/kibana_react/public/app_links/redirect_app_link.test.tsx +++ b/src/plugins/kibana_react/public/app_links/redirect_app_link.test.tsx @@ -9,7 +9,7 @@ import React, { MouseEvent } from 'react'; import { mount } from 'enzyme'; import { applicationServiceMock } from '@kbn/core/public/mocks'; -/** @deprecated Use `RedirectAppLinks` from `@kbn/shared-ux-components */ +/** @deprecated Use `RedirectAppLinks` from `@kbn/shared-ux-link-redirect-app` */ import { RedirectAppLinks } from './redirect_app_link'; import { BehaviorSubject } from 'rxjs'; diff --git a/src/plugins/kibana_react/public/app_links/redirect_app_link.tsx b/src/plugins/kibana_react/public/app_links/redirect_app_link.tsx index 339055c3e1da5..6df1c43dbc5c6 100644 --- a/src/plugins/kibana_react/public/app_links/redirect_app_link.tsx +++ b/src/plugins/kibana_react/public/app_links/redirect_app_link.tsx @@ -35,7 +35,7 @@ interface RedirectCrossAppLinksProps extends React.HTMLAttributes = ({ diff --git a/src/plugins/kibana_react/public/code_editor/__snapshots__/code_editor.test.tsx.snap b/src/plugins/kibana_react/public/code_editor/__snapshots__/code_editor.test.tsx.snap index 9a4511f8b03f5..6d077e6e174e5 100644 --- a/src/plugins/kibana_react/public/code_editor/__snapshots__/code_editor.test.tsx.snap +++ b/src/plugins/kibana_react/public/code_editor/__snapshots__/code_editor.test.tsx.snap @@ -226,21 +226,6 @@ exports[` is rendered 1`] = `
- - -
- -
`; diff --git a/src/plugins/kibana_react/public/code_editor/code_editor.test.tsx b/src/plugins/kibana_react/public/code_editor/code_editor.test.tsx index b66d136c50710..97a8d8a849083 100644 --- a/src/plugins/kibana_react/public/code_editor/code_editor.test.tsx +++ b/src/plugins/kibana_react/public/code_editor/code_editor.test.tsx @@ -43,7 +43,15 @@ const logs = ` [Sun Mar 7 21:16:17 2004] [error] [client xx.xx.xx.xx] File does not exist: /home/httpd/twiki/view/Main/WebHome `; +class ResizeObserver { + observe() {} + unobserve() {} + disconnect() {} +} + describe('', () => { + window.ResizeObserver = ResizeObserver; + test('is rendered', () => { const component = mountWithIntl( {}} /> 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 239208e6752fc..93a2c6333f9cc 100644 --- a/src/plugins/kibana_react/public/code_editor/code_editor.tsx +++ b/src/plugins/kibana_react/public/code_editor/code_editor.tsx @@ -7,7 +7,7 @@ */ import React, { useState, useRef, useCallback, useMemo, useEffect, KeyboardEvent } from 'react'; -import ReactResizeDetector from 'react-resize-detector'; +import { useResizeDetector } from 'react-resize-detector'; import ReactMonacoEditor from 'react-monaco-editor'; import { htmlIdGenerator, @@ -186,6 +186,13 @@ export const CodeEditor: React.FC = ({ _editor.current?.layout(); }, []); + useResizeDetector({ + handleWidth: true, + handleHeight: true, + onResize: _updateDimensions, + refreshMode: 'debounce', + }); + const startEditing = useCallback(() => { setIsHintActive(false); _editor.current?.focus(); @@ -469,12 +476,6 @@ export const CodeEditor: React.FC = ({ }} /> - ); }; 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 33871742acbb3..f611c391a20a2 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 @@ -101,5 +101,5 @@ class ExitFullScreenButtonUi extends PureComponent { } } -/** @deprecated Use `ExitFullScreenButton` from `src/plugins/shared_ux/public`. */ +/** @deprecated Use `ExitFullScreenButton` from `@kbn/shared-ux-button-exit-full-screen`. */ export const ExitFullScreenButton = ExitFullScreenButtonUi; diff --git a/src/plugins/kibana_react/public/index.ts b/src/plugins/kibana_react/public/index.ts index 4b4c0b6e5ab20..2244d3d5503e0 100644 --- a/src/plugins/kibana_react/public/index.ts +++ b/src/plugins/kibana_react/public/index.ts @@ -82,7 +82,7 @@ export { reactToUiComponent, uiToReactComponent } from './adapters'; export { toMountPoint, MountPointPortal } from './util'; export type { ToMountPointOptions } from './util'; -/** @deprecated Use `RedirectAppLinks` from `@kbn/shared-ux-components */ +/** @deprecated Use `RedirectAppLinks` from `@kbn/shared-ux-link-redirect-app` */ export { RedirectAppLinks } from './app_links'; export { wrapWithTheme, KibanaThemeProvider } from './theme'; diff --git a/src/plugins/kibana_react/public/markdown/markdown_simple.tsx b/src/plugins/kibana_react/public/markdown/markdown_simple.tsx index 23a00fdec038b..24b9eee7b1ca5 100644 --- a/src/plugins/kibana_react/public/markdown/markdown_simple.tsx +++ b/src/plugins/kibana_react/public/markdown/markdown_simple.tsx @@ -6,20 +6,16 @@ * Side Public License, v 1. */ -import React, { Fragment } from 'react'; +import React from 'react'; import ReactMarkdown from 'react-markdown'; -const markdownRenderers = { - root: Fragment, -}; - export interface MarkdownSimpleProps { children: string; } // Render markdown string into JSX inside of a Fragment. export const MarkdownSimple = ({ children }: MarkdownSimpleProps) => ( - {children} + {children} ); // Needed for React.lazy diff --git a/src/plugins/kibana_react/public/page_template/page_template.tsx b/src/plugins/kibana_react/public/page_template/page_template.tsx index bd5213c9a2608..44edccd8ea49b 100644 --- a/src/plugins/kibana_react/public/page_template/page_template.tsx +++ b/src/plugins/kibana_react/public/page_template/page_template.tsx @@ -21,7 +21,7 @@ import { KibanaPageTemplateInner, KibanaPageTemplateWithSolutionNav } from './pa /** * A thin wrapper around EuiPageTemplate with a few Kibana specific additions - * @deprecated Use `KibanaPageTemplateProps` from `kbn-shared-ux-components`. + * @deprecated Use `KibanaPageTemplateProps` from `@kbn/shared-ux-page-kibana-template-types`. */ export type KibanaPageTemplateProps = EuiPageTemplateProps & { /** @@ -42,7 +42,7 @@ export type KibanaPageTemplateProps = EuiPageTemplateProps & { noDataConfig?: NoDataPageProps; }; -/** @deprecated Use `KibanaPageTemplate` from `kbn-shared-ux-components`. */ +/** @deprecated Use `KibanaPageTemplate` from `@kbn/shared-ux-page-kibana-template`. */ export const KibanaPageTemplate: FunctionComponent = ({ template, className, diff --git a/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts b/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts index f1b230b72c337..97431c638273d 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/management/schema.ts @@ -430,10 +430,6 @@ export const stackManagementSchema: MakeSchemaFrom = { type: 'boolean', _meta: { description: 'Non-default value of setting.' }, }, - 'observability:enableInfrastructureView': { - type: 'boolean', - _meta: { description: 'Non-default value of setting.' }, - }, 'observability:enableServiceGroups': { type: 'boolean', _meta: { description: 'Non-default value of setting.' }, diff --git a/src/plugins/kibana_usage_collection/server/collectors/management/types.ts b/src/plugins/kibana_usage_collection/server/collectors/management/types.ts index 1a946e99f29bd..1b7a64d0cc590 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/management/types.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/management/types.ts @@ -41,7 +41,6 @@ export interface UsageStats { 'observability:enableNewSyntheticsView': boolean; 'observability:maxSuggestions': number; 'observability:enableComparisonByDefault': boolean; - 'observability:enableInfrastructureView': boolean; 'observability:enableServiceGroups': boolean; 'visualize:enableLabs': boolean; 'visualization:heatmap:maxBuckets': number; diff --git a/src/plugins/kibana_utils/public/history/redirect_when_missing.tsx b/src/plugins/kibana_utils/public/history/redirect_when_missing.tsx index b5e81707a7a79..452ef49881578 100644 --- a/src/plugins/kibana_utils/public/history/redirect_when_missing.tsx +++ b/src/plugins/kibana_utils/public/history/redirect_when_missing.tsx @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import React, { Fragment } from 'react'; +import React from 'react'; import { History } from 'history'; import { i18n } from '@kbn/i18n'; import { EuiLoadingSpinner } from '@elastic/eui'; @@ -20,7 +20,7 @@ import { KibanaThemeProvider } from '../theme'; const ReactMarkdown = React.lazy(() => import('react-markdown')); const ErrorRenderer = (props: { children: string }) => ( }> - + ); diff --git a/src/plugins/presentation_util/public/components/solution_toolbar/index.ts b/src/plugins/presentation_util/public/components/solution_toolbar/index.ts index 5828abda1107f..ee60678af5d87 100644 --- a/src/plugins/presentation_util/public/components/solution_toolbar/index.ts +++ b/src/plugins/presentation_util/public/components/solution_toolbar/index.ts @@ -7,5 +7,5 @@ */ export { SolutionToolbar } from './solution_toolbar'; -/** @deprecated QuickButtonGroup - use `IconButtonGroup` from `@kbn/shared-ux-components */ +/** @deprecated QuickButtonGroup - use `IconButtonGroup` from `@kbn/shared-ux-button-toolbar` */ export * from './items'; diff --git a/src/plugins/shared_ux/.i18nrc.json b/src/plugins/shared_ux/.i18nrc.json deleted file mode 100755 index cd7ac5b866df2..0000000000000 --- a/src/plugins/shared_ux/.i18nrc.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "prefix": "sharedUX", - "paths": { - "sharedUX": "." - }, - "translations": [ - "translations/ja-JP.json" - ] -} diff --git a/src/plugins/shared_ux/README.md b/src/plugins/shared_ux/README.md deleted file mode 100755 index 748414c356e9b..0000000000000 --- a/src/plugins/shared_ux/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# sharedUX - -Our mission is to make consistency in our user experience a product. - -## Areas of Focus - -### UX Infrastructure - -- Create and maintain a discoverable home for shared UX code. -- Encourage contribution and usage. - -### UX Patterns - -- Work with design specialists to understand and communicate new and existing designs. -- Foster adoption of design principles by codifying them in shared resources. - -### UX Solutions - -- Drive common projects. -- Build and support common plugins. -- Help teams to create consistent user experiences. - -## The sharedUX Plugin - -This plugin contains common code that is shared among other plugins. - -## Contribution - -Contributions are welcome and encouraged! \ No newline at end of file diff --git a/src/plugins/shared_ux/docs/about.mdx b/src/plugins/shared_ux/docs/about.mdx deleted file mode 100644 index 213ce774be217..0000000000000 --- a/src/plugins/shared_ux/docs/about.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: sharedUX/About -slug: /shared-ux/about -title: About Shared UX -description: . -date: 2021-01-05 -tags: ['shared-ux'] ---- - -Our mission is to make consistency in our user experience a product. - -## Areas of Focus - -### UX Infrastructure - -- Create and maintain a discoverable home for shared UX code. -- Encourage contribution and usage. - -### UX Patterns - -- Work with design specialists to understand and communicate new and existing designs. -- Foster adoption of design principles by codifying them in shared resources. - -### UX Solutions - -- Drive common projects. -- Build and support common plugins. -- Help teams to create consistent user experiences. - -## The sharedUX Plugin - -This plugin contains common code that is shared among other plugins. - -## Contribution - -Contributions are welcome and encouraged! diff --git a/src/plugins/shared_ux/kibana.json b/src/plugins/shared_ux/kibana.json deleted file mode 100755 index 308a252f70b54..0000000000000 --- a/src/plugins/shared_ux/kibana.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "id": "sharedUX", - "version": "1.0.0", - "kibanaVersion": "kibana", - "owner": { - "name": "Shared UX", - "githubTeam": "shared-ux" - }, - "description": "A plugin providing components and services for shared user experiences in Kibana.", - "server": true, - "ui": true, - "requiredPlugins": ["dataViewEditor", "dataViews"], - "optionalPlugins": [] -} diff --git a/src/plugins/shared_ux/nav_shared_ux.docnav.json b/src/plugins/shared_ux/nav_shared_ux.docnav.json deleted file mode 100644 index 8f6ad010a49cb..0000000000000 --- a/src/plugins/shared_ux/nav_shared_ux.docnav.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "mission": "Shared UX", - "id": "sharedUX", - "landingPageId": "sharedUX/About", - "icon": "globe", - "description": "Developer documentation for Shared UX.", - "items": [ - { - "label": "About", - "items": [ - { - "id": "sharedUX/About" - } - ] - } - ] -} diff --git a/src/plugins/shared_ux/public/mocks.ts b/src/plugins/shared_ux/public/mocks.ts deleted file mode 100644 index c77236d503ca9..0000000000000 --- a/src/plugins/shared_ux/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 { SharedUXPlugin } from './plugin'; - -export type Setup = jest.Mocked>; -export type Start = jest.Mocked>; - -const createStartContract = (): jest.Mocked => { - const startContract = { - getContextServices: jest.fn(), - }; - return startContract; -}; - -export const sharedUXPluginMock = { - createStartContract, -}; diff --git a/src/plugins/shared_ux/public/plugin.ts b/src/plugins/shared_ux/public/plugin.ts deleted file mode 100755 index 8806de85b9304..0000000000000 --- a/src/plugins/shared_ux/public/plugin.ts +++ /dev/null @@ -1,39 +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 { CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; -import { - SharedUXPluginSetup, - SharedUXPluginStart, - SharedUXPluginStartDeps, - SharedUXPluginSetupDeps, -} from './types'; - -import { servicesFactory } from './services'; - -/** - * The Kibana plugin for Shared User Experience (Shared UX). - */ -export class SharedUXPlugin implements Plugin { - public setup( - _coreSetup: CoreSetup, - _setupPlugins: SharedUXPluginSetupDeps - ): SharedUXPluginSetup { - return {}; - } - - public start(coreStart: CoreStart, startPlugins: SharedUXPluginStartDeps): SharedUXPluginStart { - const services = servicesFactory({ coreStart, startPlugins }); - - return { - getContextServices: () => services, - }; - } - - public stop() {} -} diff --git a/src/plugins/shared_ux/public/services/application.ts b/src/plugins/shared_ux/public/services/application.ts deleted file mode 100644 index 95d6d4b4d72d9..0000000000000 --- a/src/plugins/shared_ux/public/services/application.ts +++ /dev/null @@ -1,25 +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 { SharedUxApplicationService } from '@kbn/shared-ux-services'; - -import { KibanaPluginServiceFactory } from './types'; -import { SharedUXPluginStartDeps } from '../types'; - -export type ApplicationServiceFactory = KibanaPluginServiceFactory< - SharedUxApplicationService, - SharedUXPluginStartDeps ->; - -/** - * A factory function for creating a Kibana-based implementation of `SharedUXEditorsService`. - */ -export const applicationServiceFactory: ApplicationServiceFactory = ({ coreStart }) => ({ - navigateToUrl: coreStart.application.navigateToUrl, - currentAppId$: coreStart.application.currentAppId$, -}); diff --git a/src/plugins/shared_ux/public/services/data.ts b/src/plugins/shared_ux/public/services/data.ts deleted file mode 100644 index d68d35848e812..0000000000000 --- a/src/plugins/shared_ux/public/services/data.ts +++ /dev/null @@ -1,25 +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 { SharedUxDataService } from '@kbn/shared-ux-services'; -import { KibanaPluginServiceFactory } from './types'; -import { SharedUXPluginStartDeps } from '../types'; - -export type DataServiceFactory = KibanaPluginServiceFactory< - SharedUxDataService, - SharedUXPluginStartDeps ->; - -/** - * A factory function for creating a Kibana-based implementation of `SharedUXDataService`. - */ -export const dataServiceFactory: DataServiceFactory = ({ coreStart, startPlugins }) => ({ - hasDataView: startPlugins.dataViews.hasData.hasDataView, - hasESData: startPlugins.dataViews.hasData.hasESData, - hasUserDataView: startPlugins.dataViews.hasData.hasUserDataView, -}); diff --git a/src/plugins/shared_ux/public/services/doc_links.ts b/src/plugins/shared_ux/public/services/doc_links.ts deleted file mode 100644 index b457cddb7c3bc..0000000000000 --- a/src/plugins/shared_ux/public/services/doc_links.ts +++ /dev/null @@ -1,24 +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 { SharedUxDocLinksService } from '@kbn/shared-ux-services'; - -import { KibanaPluginServiceFactory } from './types'; -import { SharedUXPluginStartDeps } from '../types'; - -export type DocLinksServiceFactory = KibanaPluginServiceFactory< - SharedUxDocLinksService, - SharedUXPluginStartDeps ->; - -/** - * A factory function for creating a Kibana-based implementation of `SharedUXEditorsService`. - */ -export const docLinksServiceFactory: DocLinksServiceFactory = ({ coreStart }) => ({ - dataViewsDocLink: coreStart.docLinks.links.indexPatterns?.introduction, -}); diff --git a/src/plugins/shared_ux/public/services/editors.ts b/src/plugins/shared_ux/public/services/editors.ts deleted file mode 100644 index 498b42954091c..0000000000000 --- a/src/plugins/shared_ux/public/services/editors.ts +++ /dev/null @@ -1,24 +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 { SharedUxEditorsService } from '@kbn/shared-ux-services'; - -import { KibanaPluginServiceFactory } from './types'; -import { SharedUXPluginStartDeps } from '../types'; - -export type EditorsServiceFactory = KibanaPluginServiceFactory< - SharedUxEditorsService, - SharedUXPluginStartDeps ->; - -/** - * A factory function for creating a Kibana-based implementation of `SharedUXEditorsService`. - */ -export const editorsServiceFactory: EditorsServiceFactory = ({ startPlugins }) => ({ - openDataViewEditor: startPlugins.dataViewEditor.openEditor, -}); diff --git a/src/plugins/shared_ux/public/services/http.ts b/src/plugins/shared_ux/public/services/http.ts deleted file mode 100644 index afc2f00713988..0000000000000 --- a/src/plugins/shared_ux/public/services/http.ts +++ /dev/null @@ -1,24 +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 { SharedUxHttpService } from '@kbn/shared-ux-services'; - -import { KibanaPluginServiceFactory } from './types'; -import { SharedUXPluginStartDeps } from '../types'; - -export type HttpServiceFactory = KibanaPluginServiceFactory< - SharedUxHttpService, - SharedUXPluginStartDeps ->; - -/** - * A factory function for creating a Kibana-based implementation of `SharedUXEditorsService`. - */ -export const httpServiceFactory: HttpServiceFactory = ({ coreStart }) => ({ - addBasePath: coreStart.http.basePath.prepend, -}); diff --git a/src/plugins/shared_ux/public/services/index.ts b/src/plugins/shared_ux/public/services/index.ts deleted file mode 100644 index c8a572c262518..0000000000000 --- a/src/plugins/shared_ux/public/services/index.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 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 { SharedUxServices } from '@kbn/shared-ux-services'; - -import type { SharedUXPluginStartDeps } from '../types'; -import type { KibanaPluginServiceFactory } from './types'; - -import { platformServiceFactory } from './platform'; -import { userPermissionsServiceFactory } from './permissions'; -import { editorsServiceFactory } from './editors'; -import { docLinksServiceFactory } from './doc_links'; -import { httpServiceFactory } from './http'; -import { applicationServiceFactory } from './application'; -import { dataServiceFactory } from './data'; - -/** - * A factory function for creating a Kibana-based implementation of `SharedUXServices`. - */ -export const servicesFactory: KibanaPluginServiceFactory< - SharedUxServices, - SharedUXPluginStartDeps -> = (params) => ({ - platform: platformServiceFactory(params), - permissions: userPermissionsServiceFactory(params), - editors: editorsServiceFactory(params), - docLinks: docLinksServiceFactory(params), - http: httpServiceFactory(params), - application: applicationServiceFactory(params), - data: dataServiceFactory(params), -}); diff --git a/src/plugins/shared_ux/public/services/permissions.ts b/src/plugins/shared_ux/public/services/permissions.ts deleted file mode 100644 index 694405b5c6610..0000000000000 --- a/src/plugins/shared_ux/public/services/permissions.ts +++ /dev/null @@ -1,27 +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 { SharedUxUserPermissionsService } from '@kbn/shared-ux-services'; -import { KibanaPluginServiceFactory } from './types'; -import { SharedUXPluginStartDeps } from '../types'; - -export type UserPermissionsServiceFactory = KibanaPluginServiceFactory< - SharedUxUserPermissionsService, - SharedUXPluginStartDeps ->; - -/** - * A factory function for creating a Kibana-based implementation of `SharedUXPermissionsService`. - */ -export const userPermissionsServiceFactory: UserPermissionsServiceFactory = ({ - coreStart, - startPlugins, -}) => ({ - canCreateNewDataView: startPlugins.dataViewEditor.userPermissions.editDataView(), - canAccessFleet: coreStart.application.capabilities.navLinks.integrations, -}); diff --git a/src/plugins/shared_ux/public/services/platform.ts b/src/plugins/shared_ux/public/services/platform.ts deleted file mode 100644 index b0ee61583dd8d..0000000000000 --- a/src/plugins/shared_ux/public/services/platform.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 { SharedUxPlatformService } from '@kbn/shared-ux-services'; -import { SharedUXPluginStartDeps } from '../types'; -import { KibanaPluginServiceFactory } from './types'; - -/** - * A factory function for creating a Kibana-based implementation of `SharedUXPlatformService`. - */ -export type PlatformServiceFactory = KibanaPluginServiceFactory< - SharedUxPlatformService, - SharedUXPluginStartDeps ->; - -/** - * A factory function for creating a Kibana-based implementation of `SharedUXPlatformService`. - */ -export const platformServiceFactory: PlatformServiceFactory = ({ coreStart }) => ({ - setIsFullscreen: (isVisible: boolean) => coreStart.chrome.setIsVisible(isVisible), -}); diff --git a/src/plugins/shared_ux/public/services/types.ts b/src/plugins/shared_ux/public/services/types.ts deleted file mode 100644 index 895b2fb231a37..0000000000000 --- a/src/plugins/shared_ux/public/services/types.ts +++ /dev/null @@ -1,33 +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 { BehaviorSubject } from 'rxjs'; -import { CoreStart, AppUpdater, PluginInitializerContext } from '@kbn/core/public'; - -/** - * Parameters necessary to create a Kibana-based service, (e.g. during Plugin - * startup or setup). - * - * The `Start` generic refers to the specific Plugin `TPluginsStart`. - */ -export interface KibanaPluginServiceParams { - coreStart: CoreStart; - startPlugins: Start; - appUpdater?: BehaviorSubject; - initContext?: PluginInitializerContext; -} - -/** - * A factory function for creating a Kibana-based service. - * - * The `Service` generic determines the shape of the Service being produced. - * The `Start` generic refers to the specific Plugin `TPluginsStart`. - */ -export type KibanaPluginServiceFactory = ( - params: KibanaPluginServiceParams -) => Service; diff --git a/src/plugins/shared_ux/public/types/index.ts b/src/plugins/shared_ux/public/types/index.ts deleted file mode 100644 index e3e7cb760268f..0000000000000 --- a/src/plugins/shared_ux/public/types/index.ts +++ /dev/null @@ -1,67 +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. - */ - -/* eslint-disable @typescript-eslint/no-empty-interface */ - -import { SharedUxServices } from '@kbn/shared-ux-services'; -import { DataViewEditorStart } from '@kbn/data-view-editor-plugin/public'; -import { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; - -/** @internal */ -export interface SharedUXPluginSetup {} - -/** - * The Shared UX plugin public contract, containing prewired components, services, and - * other constructs useful to consumers. - */ -export interface SharedUXPluginStart { - /** - * A set of pre-wired services for use with `SharedUxServicesProvider`. - * - * ``` - * import { SharedUxServicesProvider } from '@kbn/shared-ux-services'; - * - * public start(coreStart: CoreStart, startPlugins: MyPluginStartDeps): MyPluginStart { - * const services = startPlugins.sharedUX.getContextServices(); - * return { - * ServicesContext: ({ children }) => {children}, - * }; - * } - * ``` - * - * or - * - * ``` - * import { SharedUxServicesProvider } from '@kbn/shared-ux-services'; - * - * public setup(coreSetup: CoreSetup, setupPlugins: MyPluginSetupDeps): MyPluginSetup { - * const [coreStart, startPlugins] = await coreSetup.getStartServices(); - * coreSetup.application.register({ - * mount: async (params: AppMountParameters) => { - * ReactDOM.render( - * - * - * , - * params.element - * ); - * } - * ); - * } - * ``` - */ - getContextServices: () => SharedUxServices; -} - -/** @internal */ -export interface SharedUXPluginSetupDeps {} - -/** @internal */ -export interface SharedUXPluginStartDeps { - dataViewEditor: DataViewEditorStart; - dataViews: DataViewsPublicPluginStart; -} diff --git a/src/plugins/shared_ux/server/index.ts b/src/plugins/shared_ux/server/index.ts deleted file mode 100755 index 44c72b244aaf9..0000000000000 --- a/src/plugins/shared_ux/server/index.ts +++ /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. - */ - -import { PluginInitializerContext } from '@kbn/core/server'; -import { SharedUXPlugin } from './plugin'; - -export function plugin(initializerContext: PluginInitializerContext) { - return new SharedUXPlugin(initializerContext); -} - -export type { SharedUXPluginSetup, SharedUXPluginStart } from './types'; diff --git a/src/plugins/shared_ux/server/plugin.ts b/src/plugins/shared_ux/server/plugin.ts deleted file mode 100755 index f0ea504884610..0000000000000 --- a/src/plugins/shared_ux/server/plugin.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import { PluginInitializerContext, CoreSetup, CoreStart, Plugin, Logger } from '@kbn/core/server'; - -import { SharedUXPluginSetup, SharedUXPluginStart } from './types'; - -export class SharedUXPlugin implements Plugin { - private readonly logger: Logger; - - constructor(initializerContext: PluginInitializerContext) { - this.logger = initializerContext.logger.get(); - } - - public setup(_core: CoreSetup) { - this.logger.debug('sharedUX: Setup'); - return {}; - } - - public start(_core: CoreStart) { - this.logger.debug('sharedUX: Started'); - return {}; - } - - public stop() {} -} diff --git a/src/plugins/shared_ux/server/types.ts b/src/plugins/shared_ux/server/types.ts deleted file mode 100755 index b16a18467d309..0000000000000 --- a/src/plugins/shared_ux/server/types.ts +++ /dev/null @@ -1,15 +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. - */ - -/* eslint-disable @typescript-eslint/no-empty-interface */ - -/** @internal */ -export interface SharedUXPluginSetup {} - -/** @internal */ -export interface SharedUXPluginStart {} diff --git a/src/plugins/shared_ux/tsconfig.json b/src/plugins/shared_ux/tsconfig.json deleted file mode 100644 index 3a287353a5341..0000000000000 --- a/src/plugins/shared_ux/tsconfig.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, - "declarationMap": true - }, - "include": [ - "common/**/*", - "public/**/*", - "server/**/*", - "../../../typings/**/*" - ], - "references": [ - { - "path": "../../core/tsconfig.json" - }, - { - "path": "../data_view_editor/tsconfig.json" - }, - { - "path": "../data_views/tsconfig.json" - } - ] -} diff --git a/src/plugins/telemetry/schema/oss_plugins.json b/src/plugins/telemetry/schema/oss_plugins.json index cacd8067e4e03..e59b192442133 100644 --- a/src/plugins/telemetry/schema/oss_plugins.json +++ b/src/plugins/telemetry/schema/oss_plugins.json @@ -8282,12 +8282,6 @@ "description": "Non-default value of setting." } }, - "observability:enableInfrastructureView": { - "type": "boolean", - "_meta": { - "description": "Non-default value of setting." - } - }, "observability:enableServiceGroups": { "type": "boolean", "_meta": { diff --git a/src/plugins/unified_search/public/index_pattern_select/index_pattern_select.tsx b/src/plugins/unified_search/public/index_pattern_select/index_pattern_select.tsx index 81534575d10b1..7cd8b9d0251d8 100644 --- a/src/plugins/unified_search/public/index_pattern_select/index_pattern_select.tsx +++ b/src/plugins/unified_search/public/index_pattern_select/index_pattern_select.tsx @@ -78,10 +78,10 @@ export default class IndexPatternSelect extends Component { - const idsAndTitles = await this.props.indexPatternService.getIdsWithTitle(); + const dataViews = await this.props.indexPatternService.getIdsWithTitle(); if (!this.isMounted || searchValue !== this.state.searchValue) { return; } const options = []; - for (let i = 0; i < idsAndTitles.length; i++) { - if (idsAndTitles[i].title.toLowerCase().includes(searchValue.toLowerCase())) { + for (let i = 0; i < dataViews.length; i++) { + const label = dataViews[i].name ? dataViews[i].name : dataViews[i].title; + if (label && label.toLowerCase().includes(searchValue.toLowerCase())) { options.push({ - label: idsAndTitles[i].title, - value: idsAndTitles[i].id, + label, + value: dataViews[i].id, }); } } diff --git a/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_vars.js b/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_vars.js index 4ac63bd8704bc..cccc21e7cbdb1 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_vars.js +++ b/src/plugins/vis_types/timeseries/public/application/components/lib/convert_series_to_vars.js @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { startsWith, snakeCase } from 'lodash'; import { BUCKET_TYPES, DATA_FORMATTERS } from '../../../../common/enums'; import { getLastValue } from '../../../../common/last_value_utils'; diff --git a/src/plugins/vis_types/timeseries/server/lib/vis_data/helpers/bucket_transform.js b/src/plugins/vis_types/timeseries/server/lib/vis_data/helpers/bucket_transform.js index bd96e95edd15b..f6e032a35fd40 100644 --- a/src/plugins/vis_types/timeseries/server/lib/vis_data/helpers/bucket_transform.js +++ b/src/plugins/vis_types/timeseries/server/lib/vis_data/helpers/bucket_transform.js @@ -7,7 +7,7 @@ */ import { getBucketsPath } from './get_buckets_path'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { isEmpty } from 'lodash'; import { i18n } from '@kbn/i18n'; import { MODEL_SCRIPTS } from './moving_fn_scripts'; diff --git a/src/plugins/vis_types/vislib/public/vislib/lib/axis/axis_config.js b/src/plugins/vis_types/vislib/public/vislib/lib/axis/axis_config.js index 18958b6439a8c..2a5ab819c00ac 100644 --- a/src/plugins/vis_types/vislib/public/vislib/lib/axis/axis_config.js +++ b/src/plugins/vis_types/vislib/public/vislib/lib/axis/axis_config.js @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import _ from 'lodash'; import d3 from 'd3'; import { SCALE_MODES } from './scale_modes'; diff --git a/src/plugins/vis_types/vislib/public/vislib/lib/chart_grid.js b/src/plugins/vis_types/vislib/public/vislib/lib/chart_grid.js index 32a41ec5ed489..a9ffe384ee78f 100644 --- a/src/plugins/vis_types/vislib/public/vislib/lib/chart_grid.js +++ b/src/plugins/vis_types/vislib/public/vislib/lib/chart_grid.js @@ -7,7 +7,7 @@ */ import d3 from 'd3'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import _ from 'lodash'; const defaults = { diff --git a/src/plugins/vis_types/vislib/public/vislib/lib/vis_config.js b/src/plugins/vis_types/vislib/public/vislib/lib/vis_config.js index cc9e48897d053..3b60481c0affe 100644 --- a/src/plugins/vis_types/vislib/public/vislib/lib/vis_config.js +++ b/src/plugins/vis_types/vislib/public/vislib/lib/vis_config.js @@ -9,7 +9,7 @@ /** * Provides vislib configuration, throws error if invalid property is accessed without providing defaults */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import _ from 'lodash'; import { vislibTypesConfig as visTypes } from './types'; import { Data } from './data'; diff --git a/src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx b/src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx index f0aab3b880ae3..3af553fdd56b7 100644 --- a/src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx +++ b/src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx @@ -192,6 +192,10 @@ export class VisualizeEmbeddable return this.vis.description; } + public getVis() { + return this.vis; + } + /** * Gets the Visualize embeddable's local filters * @returns Local/panel-level array of filters for Visualize embeddable diff --git a/src/plugins/visualizations/public/index.ts b/src/plugins/visualizations/public/index.ts index 67b13c8236708..78ba1d19a982f 100644 --- a/src/plugins/visualizations/public/index.ts +++ b/src/plugins/visualizations/public/index.ts @@ -37,6 +37,7 @@ export type { Vis, SerializedVis, SerializedVisData, VisData } from './vis'; export type VisualizeEmbeddableFactoryContract = PublicContract; export type VisualizeEmbeddableContract = PublicContract; export type { VisualizeInput } from './embeddable'; +export type { VisualizeEmbeddable } from './embeddable'; export type { SchemaConfig } from './vis_schemas'; export { updateOldState } from './legacy/vis_update_state'; export type { PersistedState } from './persisted_state'; diff --git a/src/plugins/visualizations/public/legacy/vis_update_state.js b/src/plugins/visualizations/public/legacy/vis_update_state.js index db6a9f2beb776..00853a2af8c6e 100644 --- a/src/plugins/visualizations/public/legacy/vis_update_state.js +++ b/src/plugins/visualizations/public/legacy/vis_update_state.js @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import _ from 'lodash'; /** diff --git a/src/plugins/visualizations/public/persisted_state/persisted_state.ts b/src/plugins/visualizations/public/persisted_state/persisted_state.ts index dcc86228031fa..74b23081c4ace 100644 --- a/src/plugins/visualizations/public/persisted_state/persisted_state.ts +++ b/src/plugins/visualizations/public/persisted_state/persisted_state.ts @@ -8,7 +8,7 @@ import { EventEmitter } from 'events'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { isPlainObject, cloneDeep, get, isEqual, isString, merge, mergeWith, toPath } from 'lodash'; function prepSetParams(key: PersistedStateKey, value: any, path: PersistedStatePath) { diff --git a/test/api_integration/apis/telemetry/utils/schema_to_config_schema.ts b/test/api_integration/apis/telemetry/utils/schema_to_config_schema.ts index deb6218e145af..b80a42e101284 100644 --- a/test/api_integration/apis/telemetry/utils/schema_to_config_schema.ts +++ b/test/api_integration/apis/telemetry/utils/schema_to_config_schema.ts @@ -8,7 +8,7 @@ import type { ObjectType, Type } from '@kbn/config-schema'; import { schema } from '@kbn/config-schema'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { get, merge } from 'lodash'; import type { AllowedSchemaTypes } from '@kbn/usage-collection-plugin/server'; diff --git a/test/functional/page_objects/discover_page.ts b/test/functional/page_objects/discover_page.ts index 8700cc734d809..ab453fc2378ed 100644 --- a/test/functional/page_objects/discover_page.ts +++ b/test/functional/page_objects/discover_page.ts @@ -505,6 +505,15 @@ export class DiscoverPageObject extends FtrService { await this.header.waitUntilLoadingHasFinished(); } + public async getIndexPatterns() { + await this.testSubjects.click('discover-dataView-switch-link'); + const indexPatternSwitcher = await this.testSubjects.find('indexPattern-switcher'); + const li = await indexPatternSwitcher.findAllByTagName('li'); + const items = await Promise.all(li.map((lis) => lis.getVisibleText())); + await this.testSubjects.click('discover-dataView-switch-link'); + return items; + } + public async selectTextBaseLang(lang: 'SQL') { await this.testSubjects.click('discover-dataView-switch-link'); await this.find.clickByCssSelector( diff --git a/test/functional/services/filter_bar.ts b/test/functional/services/filter_bar.ts index ab020a1ae943d..16ce34d446d1c 100644 --- a/test/functional/services/filter_bar.ts +++ b/test/functional/services/filter_bar.ts @@ -56,8 +56,10 @@ export class FilterBarService extends FtrService { * @param key field name */ public async removeFilter(key: string): Promise { - await this.testSubjects.click(`~filter & ~filter-key-${key}`); - await this.testSubjects.click(`deleteFilter`); + await this.retry.try(async () => { + await this.testSubjects.click(`~filter & ~filter-key-${key}`); + await this.testSubjects.click(`deleteFilter`); + }); await this.header.awaitGlobalLoadingIndicatorHidden(); } diff --git a/tsconfig.base.json b/tsconfig.base.json index 36988b9e4e9f0..68882faec661a 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -151,8 +151,6 @@ "@kbn/screenshot-mode-plugin/*": ["src/plugins/screenshot_mode/*"], "@kbn/share-plugin": ["src/plugins/share"], "@kbn/share-plugin/*": ["src/plugins/share/*"], - "@kbn/shared-ux-plugin": ["src/plugins/shared_ux"], - "@kbn/shared-ux-plugin/*": ["src/plugins/shared_ux/*"], "@kbn/telemetry-collection-manager-plugin": ["src/plugins/telemetry_collection_manager"], "@kbn/telemetry-collection-manager-plugin/*": ["src/plugins/telemetry_collection_manager/*"], "@kbn/telemetry-management-section-plugin": ["src/plugins/telemetry_management_section"], diff --git a/x-pack/plugins/actions/server/actions_client.test.ts b/x-pack/plugins/actions/server/actions_client.test.ts index 4576a301a5f2f..44276a604896f 100644 --- a/x-pack/plugins/actions/server/actions_client.test.ts +++ b/x-pack/plugins/actions/server/actions_client.test.ts @@ -45,11 +45,15 @@ import { getOAuthJwtAccessToken } from './builtin_action_types/lib/get_oauth_jwt import { getOAuthClientCredentialsAccessToken } from './builtin_action_types/lib/get_oauth_client_credentials_access_token'; import { OAuthParams } from './routes/get_oauth_access_token'; -jest.mock('@kbn/core/server/saved_objects/service/lib/utils', () => ({ - SavedObjectsUtils: { - generateId: () => 'mock-saved-object-id', - }, -})); +jest.mock('@kbn/core-saved-objects-utils-server', () => { + const actual = jest.requireActual('@kbn/core-saved-objects-utils-server'); + return { + ...actual, + SavedObjectsUtils: { + generateId: () => 'mock-saved-object-id', + }, + }; +}); jest.mock('./lib/track_legacy_rbac_exemption', () => ({ trackLegacyRBACExemption: jest.fn(), diff --git a/x-pack/plugins/actions/server/builtin_action_types/lib/connector_token_client.test.ts b/x-pack/plugins/actions/server/builtin_action_types/lib/connector_token_client.test.ts index dfa307ca3cd91..1aa8bbb3da9a7 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/lib/connector_token_client.test.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/lib/connector_token_client.test.ts @@ -13,11 +13,15 @@ import { Logger } from '@kbn/core/server'; import { ConnectorToken } from '../../types'; const logger = loggingSystemMock.create().get() as jest.Mocked; -jest.mock('@kbn/core/server/saved_objects/service/lib/utils', () => ({ - SavedObjectsUtils: { - generateId: () => 'mock-saved-object-id', - }, -})); +jest.mock('@kbn/core-saved-objects-utils-server', () => { + const actual = jest.requireActual('@kbn/core-saved-objects-utils-server'); + return { + ...actual, + SavedObjectsUtils: { + generateId: () => 'mock-saved-object-id', + }, + }; +}); const unsecuredSavedObjectsClient = savedObjectsClientMock.create(); const encryptedSavedObjectsClient = encryptedSavedObjectsMock.createClient(); diff --git a/x-pack/plugins/alerting/server/rules_client/tests/create.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/create.test.ts index 53f9c59545526..b29d41f183b73 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/create.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/create.test.ts @@ -26,11 +26,15 @@ jest.mock('../../invalidate_pending_api_keys/bulk_mark_api_keys_for_invalidation bulkMarkApiKeysForInvalidation: jest.fn(), })); -jest.mock('@kbn/core/server/saved_objects/service/lib/utils', () => ({ - SavedObjectsUtils: { - generateId: () => 'mock-saved-object-id', - }, -})); +jest.mock('@kbn/core-saved-objects-utils-server', () => { + const actual = jest.requireActual('@kbn/core-saved-objects-utils-server'); + return { + ...actual, + SavedObjectsUtils: { + generateId: () => 'mock-saved-object-id', + }, + }; +}); const taskManager = taskManagerMock.createStart(); const ruleTypeRegistry = ruleTypeRegistryMock.create(); diff --git a/x-pack/plugins/alerting/server/rules_client/tests/update.test.ts b/x-pack/plugins/alerting/server/rules_client/tests/update.test.ts index 219ee35756f07..9071099ed3aaf 100644 --- a/x-pack/plugins/alerting/server/rules_client/tests/update.test.ts +++ b/x-pack/plugins/alerting/server/rules_client/tests/update.test.ts @@ -23,11 +23,15 @@ import { auditLoggerMock } from '@kbn/security-plugin/server/audit/mocks'; import { getBeforeSetup, setGlobalDate } from './lib'; import { bulkMarkApiKeysForInvalidation } from '../../invalidate_pending_api_keys/bulk_mark_api_keys_for_invalidation'; -jest.mock('@kbn/core/server/saved_objects/service/lib/utils', () => ({ - SavedObjectsUtils: { - generateId: () => 'mock-saved-object-id', - }, -})); +jest.mock('@kbn/core-saved-objects-utils-server', () => { + const actual = jest.requireActual('@kbn/core-saved-objects-utils-server'); + return { + ...actual, + SavedObjectsUtils: { + generateId: () => 'mock-saved-object-id', + }, + }; +}); jest.mock('../../invalidate_pending_api_keys/bulk_mark_api_keys_for_invalidation', () => ({ bulkMarkApiKeysForInvalidation: jest.fn(), diff --git a/x-pack/plugins/apm/dev_docs/local_setup.md b/x-pack/plugins/apm/dev_docs/local_setup.md index 24a8db44a3cce..9f3553f3c680c 100644 --- a/x-pack/plugins/apm/dev_docs/local_setup.md +++ b/x-pack/plugins/apm/dev_docs/local_setup.md @@ -44,7 +44,7 @@ elasticsearch.username: kibana_system elasticsearch.password: changeme ``` -Documentation for [Synthtrace](https://github.com/elastic/kibana/blob/main/packages/elastic-apm-synthtrace/README.md) +Documentation for [Synthtrace](https://github.com/elastic/kibana/blob/main/packages/kbn-apm-synthtrace/README.md) ## 2. Cloud-based ES Cluster (internal devs only) diff --git a/x-pack/plugins/apm/dev_docs/testing.md b/x-pack/plugins/apm/dev_docs/testing.md index b3eabc27a515b..c204a3922139f 100644 --- a/x-pack/plugins/apm/dev_docs/testing.md +++ b/x-pack/plugins/apm/dev_docs/testing.md @@ -63,7 +63,7 @@ node scripts/test/api --runner --basic --updateSnapshots **API Test tips** -- For data generation in API tests have a look at the [elastic-apm-synthtrace](../../../../packages/elastic-apm-synthtrace/README.md) package +- For data generation in API tests have a look at the [kbn-apm-synthtrace](../../../../packages/kbn-apm-synthtrace/README.md) package - For debugging access Elasticsearch on http://localhost:9220 and Kibana on http://localhost:5620 (`elastic` / `changeme`) --- @@ -124,4 +124,4 @@ All files with a .stories.tsx extension will be loaded. You can access the devel For end-to-end (e.g. agent -> apm server -> elasticsearch <- kibana) development and testing of Elastic APM please check the the [APM Integration Testing repository](https://github.com/elastic/apm-integration-testing). -Data can also be generated using the [elastic-apm-synthtrace](../../../../packages/elastic-apm-synthtrace/README.md) CLI. +Data can also be generated using the [kbn-apm-synthtrace](../../../../packages/kbn-apm-synthtrace/README.md) CLI. diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/fixtures/synthtrace/opbeans.ts b/x-pack/plugins/apm/ftr_e2e/cypress/fixtures/synthtrace/opbeans.ts index 1d0155bf9b434..1be9873d25c4f 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/fixtures/synthtrace/opbeans.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/fixtures/synthtrace/opbeans.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { apm, timerange } from '@elastic/apm-synthtrace'; +import { apm, timerange } from '@kbn/apm-synthtrace'; export function opbeans({ from, to }: { from: number; to: number }) { const range = timerange(from, to); diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/feature_flag/infrastructure.spec.ts b/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/feature_flag/infrastructure.spec.ts deleted file mode 100644 index 99178c810067e..0000000000000 --- a/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/feature_flag/infrastructure.spec.ts +++ /dev/null @@ -1,61 +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 { synthtrace } from '../../../../synthtrace'; -import { opbeans } from '../../../fixtures/synthtrace/opbeans'; - -const serviceOverviewPath = '/app/apm/services/opbeans-python/overview'; - -const start = '2021-10-10T00:00:00.000Z'; -const end = '2021-10-10T00:15:00.000Z'; - -describe('Infrastracture feature flag', () => { - before(async () => { - await synthtrace.index( - opbeans({ - from: new Date(start).getTime(), - to: new Date(end).getTime(), - }) - ); - }); - - after(async () => { - await synthtrace.clean(); - }); - - describe('when infrastracture feature is enabled', () => { - beforeEach(() => { - cy.loginAsEditorUser().then(() => { - // enables infrastructure view feature on advanced settings - cy.updateAdvancedSettings({ - 'observability:enableInfrastructureView': true, - }); - }); - }); - - it('shows infrastructure tab in service overview page', () => { - cy.visit(serviceOverviewPath); - cy.contains('a[role="tab"]', 'Infrastructure'); - }); - }); - - describe('when infrastracture feature is disabled', () => { - beforeEach(() => { - cy.loginAsEditorUser().then(() => { - // enables infrastructure view feature on advanced settings - cy.updateAdvancedSettings({ - 'observability:enableInfrastructureView': false, - }); - }); - }); - - it('hides infrastructure tab in service overview page', () => { - cy.visit(serviceOverviewPath); - cy.contains('a[role="tab"]', 'Infrastructure').should('not.exist'); - }); - }); -}); diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/infrastructure/generate_data.ts b/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/infrastructure/generate_data.ts index 1399875791417..52cf6b988f1a1 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/infrastructure/generate_data.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/infrastructure/generate_data.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { apm, timerange } from '@elastic/apm-synthtrace'; +import { apm, timerange } from '@kbn/apm-synthtrace'; export function generateData({ from, to }: { from: number; to: number }) { const range = timerange(from, to); diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/settings/agent_configurations.spec.ts b/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/settings/agent_configurations.spec.ts index 4661ea67ae2ab..a2f5e055e80a8 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/settings/agent_configurations.spec.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/settings/agent_configurations.spec.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { apm, timerange } from '@elastic/apm-synthtrace'; +import { apm, timerange } from '@kbn/apm-synthtrace'; import url from 'url'; import { synthtrace } from '../../../../synthtrace'; diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/errors/generate_data.ts b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/errors/generate_data.ts index 66a70428b2275..56978f03123a8 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/errors/generate_data.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/errors/generate_data.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { apm, timerange } from '@elastic/apm-synthtrace'; +import { apm, timerange } from '@kbn/apm-synthtrace'; export function generateData({ from, to }: { from: number; to: number }) { const range = timerange(from, to); diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_inventory/generate_data.ts b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_inventory/generate_data.ts index 4fc94d2305b57..e3cdf7e8bbce8 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_inventory/generate_data.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_inventory/generate_data.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { apm, timerange } from '@elastic/apm-synthtrace'; +import { apm, timerange } from '@kbn/apm-synthtrace'; export function generateMultipleServicesData({ from, diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_inventory/header_filters/generate_data.ts b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_inventory/header_filters/generate_data.ts index 94b7ab52f6f70..243f1df257a4f 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_inventory/header_filters/generate_data.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_inventory/header_filters/generate_data.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { apm, timerange } from '@elastic/apm-synthtrace'; +import { apm, timerange } from '@kbn/apm-synthtrace'; export function generateData({ from, diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_overview/aws_lambda/generate_data.ts b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_overview/aws_lambda/generate_data.ts index 68dc3f62b5c12..bbd7553d1fa33 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_overview/aws_lambda/generate_data.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/service_overview/aws_lambda/generate_data.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { apm, timerange } from '@elastic/apm-synthtrace'; +import { apm, timerange } from '@kbn/apm-synthtrace'; const dataConfig = { serviceName: 'synth-python', diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/transaction_details/generate_span_links_data.ts b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/transaction_details/generate_span_links_data.ts index 3905cf324c44a..0ced34d8a1b7c 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/transaction_details/generate_span_links_data.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/integration/read_only_user/transaction_details/generate_span_links_data.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { apm, EntityArrayIterable, timerange } from '@elastic/apm-synthtrace'; +import { apm, EntityArrayIterable, timerange } from '@kbn/apm-synthtrace'; import { synthtrace } from '../../../../synthtrace'; import { SpanLink } from '../../../../../typings/es_schemas/raw/fields/span_links'; diff --git a/x-pack/plugins/apm/ftr_e2e/cypress/plugins/index.ts b/x-pack/plugins/apm/ftr_e2e/cypress/plugins/index.ts index 25b29e080b2c2..54622cb59bd5e 100644 --- a/x-pack/plugins/apm/ftr_e2e/cypress/plugins/index.ts +++ b/x-pack/plugins/apm/ftr_e2e/cypress/plugins/index.ts @@ -9,7 +9,7 @@ import { createLogger, EntityArrayIterable, LogLevel, -} from '@elastic/apm-synthtrace'; +} from '@kbn/apm-synthtrace'; import { createEsClientForTesting } from '@kbn/test'; // *********************************************************** diff --git a/x-pack/plugins/apm/ftr_e2e/synthtrace.ts b/x-pack/plugins/apm/ftr_e2e/synthtrace.ts index de113c6c44c4d..6fb880c40b0cc 100644 --- a/x-pack/plugins/apm/ftr_e2e/synthtrace.ts +++ b/x-pack/plugins/apm/ftr_e2e/synthtrace.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import type { EntityIterable } from '@elastic/apm-synthtrace'; +import type { EntityIterable } from '@kbn/apm-synthtrace'; export const synthtrace = { index: (events: EntityIterable) => diff --git a/x-pack/plugins/apm/public/application/application.test.tsx b/x-pack/plugins/apm/public/application/application.test.tsx index 62adf0b2cb355..3c2d46ef3a107 100644 --- a/x-pack/plugins/apm/public/application/application.test.tsx +++ b/x-pack/plugins/apm/public/application/application.test.tsx @@ -122,7 +122,8 @@ describe('renderApp (APM)', () => { }; }; - it('renders the app', () => { + it('renders the app', async () => { + const promise = Promise.resolve(); const mountProps = getApmMountProps(); let unmount: () => void; @@ -131,6 +132,11 @@ describe('renderApp (APM)', () => { unmount = renderApmApp(mountProps); }); + // fake promise to wait for to ensure the app is mounted + await act(async () => { + await promise; + }); + expect(() => { unmount(); }).not.toThrowError(); diff --git a/x-pack/plugins/apm/public/components/routing/templates/apm_main_template.tsx b/x-pack/plugins/apm/public/components/routing/templates/apm_main_template.tsx index 55b486f5ae366..ff8442016adc5 100644 --- a/x-pack/plugins/apm/public/components/routing/templates/apm_main_template.tsx +++ b/x-pack/plugins/apm/public/components/routing/templates/apm_main_template.tsx @@ -9,7 +9,7 @@ import { EuiPageHeaderProps } from '@elastic/eui'; import React from 'react'; import { useLocation } from 'react-router-dom'; import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { KibanaPageTemplateProps } from '@kbn/shared-ux-components'; +import type { KibanaPageTemplateProps } from '@kbn/shared-ux-page-kibana-template'; import { enableServiceGroups } from '@kbn/observability-plugin/public'; import { EnvironmentsContextProvider } from '../../../context/environments_context/environments_context'; import { useFetcher, FETCH_STATUS } from '../../../hooks/use_fetcher'; diff --git a/x-pack/plugins/apm/public/components/routing/templates/apm_service_template/index.tsx b/x-pack/plugins/apm/public/components/routing/templates/apm_service_template/index.tsx index 7acf14fc0bf01..c6c4c405d11af 100644 --- a/x-pack/plugins/apm/public/components/routing/templates/apm_service_template/index.tsx +++ b/x-pack/plugins/apm/public/components/routing/templates/apm_service_template/index.tsx @@ -14,7 +14,6 @@ import { import { i18n } from '@kbn/i18n'; import { omit } from 'lodash'; import React from 'react'; -import { enableInfrastructureView } from '@kbn/observability-plugin/public'; import { isMobileAgentName, isJavaAgentName, @@ -177,8 +176,6 @@ function useTabs({ selectedTab }: { selectedTab: Tab['key'] }) { capabilities ); - const showInfraTab = core.uiSettings.get(enableInfrastructureView); - const router = useApmRouter(); const { @@ -269,8 +266,6 @@ function useTabs({ selectedTab }: { selectedTab: Tab['key'] }) { label: i18n.translate('xpack.apm.home.infraTabLabel', { defaultMessage: 'Infrastructure', }), - - hidden: !showInfraTab, }, { key: 'service-map', diff --git a/x-pack/plugins/apm/public/components/routing/templates/no_data_config.ts b/x-pack/plugins/apm/public/components/routing/templates/no_data_config.ts index 4e4c90b4cfeac..9a36431b1f825 100644 --- a/x-pack/plugins/apm/public/components/routing/templates/no_data_config.ts +++ b/x-pack/plugins/apm/public/components/routing/templates/no_data_config.ts @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { KibanaPageTemplateProps } from '@kbn/shared-ux-components'; +import type { NoDataConfig } from '@kbn/shared-ux-page-kibana-template'; export function getNoDataConfig({ docsLink, @@ -22,7 +22,7 @@ export function getNoDataConfig({ basePath?: string; hasApmData?: boolean; hasApmIntegrations?: boolean; -}): KibanaPageTemplateProps['noDataConfig'] { +}): NoDataConfig | undefined { // don't show "no data screen" when there is APM data or it should be bypassed if (hasApmData || shouldBypassNoDataScreen || loading) { return; diff --git a/x-pack/plugins/apm/public/components/routing/templates/service_group_template.tsx b/x-pack/plugins/apm/public/components/routing/templates/service_group_template.tsx index a891ab9bdcdce..1eece05eb8843 100644 --- a/x-pack/plugins/apm/public/components/routing/templates/service_group_template.tsx +++ b/x-pack/plugins/apm/public/components/routing/templates/service_group_template.tsx @@ -16,7 +16,7 @@ import { import React from 'react'; import { i18n } from '@kbn/i18n'; import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { KibanaPageTemplateProps } from '@kbn/shared-ux-components'; +import type { KibanaPageTemplateProps } from '@kbn/shared-ux-page-kibana-template'; import { enableServiceGroups } from '@kbn/observability-plugin/public'; import { useFetcher, FETCH_STATUS } from '../../../hooks/use_fetcher'; import { ApmPluginStartDeps } from '../../../plugin'; diff --git a/x-pack/plugins/apm/readme.md b/x-pack/plugins/apm/readme.md index df7b641fbb231..fb7cf20732bf3 100644 --- a/x-pack/plugins/apm/readme.md +++ b/x-pack/plugins/apm/readme.md @@ -13,7 +13,7 @@ ## Tooling - [VSCode setup instructions](./dev_docs/vscode_setup.md) - [Github PR commands](./dev_docs/github_commands.md) -- [Synthtrace (data generation)](https://github.com/elastic/kibana/blob/main/packages/elastic-apm-synthtrace/README.md) +- [Synthtrace (data generation)](https://github.com/elastic/kibana/blob/main/packages/kbn-apm-synthtrace/README.md) - [Query debugging in development and production](./dev_docs/query_debugging_in_development_and_production.md) ## Other resources diff --git a/x-pack/plugins/apm/scripts/aggregate_latency_metrics/index.ts b/x-pack/plugins/apm/scripts/aggregate_latency_metrics/index.ts index f9aa943b5eceb..a48da0f4577cc 100644 --- a/x-pack/plugins/apm/scripts/aggregate_latency_metrics/index.ts +++ b/x-pack/plugins/apm/scripts/aggregate_latency_metrics/index.ts @@ -8,7 +8,7 @@ import { argv } from 'yargs'; import pLimit from 'p-limit'; import pRetry from 'p-retry'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { uniq, without, merge, flatten } from 'lodash'; import * as histogram from 'hdr-histogram-js'; import { diff --git a/x-pack/plugins/canvas/public/components/asset_manager/asset.tsx b/x-pack/plugins/canvas/public/components/asset_manager/asset.tsx index 9150b78f6000a..256d33a8e7a78 100644 --- a/x-pack/plugins/canvas/public/components/asset_manager/asset.tsx +++ b/x-pack/plugins/canvas/public/components/asset_manager/asset.tsx @@ -7,7 +7,7 @@ import { Dispatch } from 'redux'; import { connect } from 'react-redux'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { fromExpression, toExpression } from '@kbn/interpreter'; diff --git a/x-pack/plugins/canvas/public/components/workpad_app/workpad_app.component.tsx b/x-pack/plugins/canvas/public/components/workpad_app/workpad_app.component.tsx index d7eafc93ff1a2..5301c00f1f82b 100644 --- a/x-pack/plugins/canvas/public/components/workpad_app/workpad_app.component.tsx +++ b/x-pack/plugins/canvas/public/components/workpad_app/workpad_app.component.tsx @@ -67,7 +67,6 @@ export const WorkpadApp: FC = ({ deselectElement, isWriteable, workpad })
{/* NOTE: canvasWorkpadContainer is used for exporting */}
({ - deselectElement: (ev) => { - ev.stopPropagation(); - dispatch(selectToplevelNodes([])); - }, -}); - -export const WorkpadApp = connect( - (state: State) => ({ - isWriteable: isWriteable(state) && canUserWrite(state), - workpad: getWorkpad(state), - }), - mapDispatchToProps -)(WorkpadAppComponent); +export const WorkpadApp = connect((state: State) => ({ + isWriteable: isWriteable(state) && canUserWrite(state), + workpad: getWorkpad(state), +}))(WorkpadAppComponent); diff --git a/x-pack/plugins/canvas/public/components/workpad_color_picker/workpad_color_picker.component.tsx b/x-pack/plugins/canvas/public/components/workpad_color_picker/workpad_color_picker.component.tsx index 0561ac005519b..c14e54d8e8549 100644 --- a/x-pack/plugins/canvas/public/components/workpad_color_picker/workpad_color_picker.component.tsx +++ b/x-pack/plugins/canvas/public/components/workpad_color_picker/workpad_color_picker.component.tsx @@ -5,8 +5,11 @@ * 2.0. */ -import React from 'react'; +import React, { useCallback } from 'react'; +import { useDispatch, useSelector } from 'react-redux'; import { i18n } from '@kbn/i18n'; +import { addColor, removeColor } from '../../state/actions/workpad'; +import { getWorkpadColors } from '../../state/selectors/workpad'; import { ColorPickerPopover, Props } from '../color_picker_popover'; const strings = { @@ -17,9 +20,17 @@ const strings = { }; export const WorkpadColorPicker = (props: Props) => { + const dispatch = useDispatch(); + const onAddColor = useCallback((payload) => dispatch(addColor(payload)), [dispatch]); + const onRemoveColor = useCallback((payload) => dispatch(removeColor(payload)), [dispatch]); + const colors = useSelector(getWorkpadColors); + return ( diff --git a/x-pack/plugins/canvas/public/components/workpad_color_picker/workpad_color_picker.ts b/x-pack/plugins/canvas/public/components/workpad_color_picker/workpad_color_picker.ts index 140de2b73ddf0..fe029c88c8cf1 100644 --- a/x-pack/plugins/canvas/public/components/workpad_color_picker/workpad_color_picker.ts +++ b/x-pack/plugins/canvas/public/components/workpad_color_picker/workpad_color_picker.ts @@ -5,20 +5,4 @@ * 2.0. */ -import { connect } from 'react-redux'; -import { addColor, removeColor } from '../../state/actions/workpad'; -import { getWorkpadColors } from '../../state/selectors/workpad'; - -import { WorkpadColorPicker as Component } from './workpad_color_picker.component'; -import { State } from '../../../types'; - -const mapStateToProps = (state: State) => ({ - colors: getWorkpadColors(state), -}); - -const mapDispatchToProps = { - onAddColor: addColor, - onRemoveColor: removeColor, -}; - -export const WorkpadColorPicker = connect(mapStateToProps, mapDispatchToProps)(Component); +export { WorkpadColorPicker } from './workpad_color_picker.component'; diff --git a/x-pack/plugins/canvas/public/components/workpad_header/refresh_control/refresh_control.component.tsx b/x-pack/plugins/canvas/public/components/workpad_header/refresh_control/refresh_control.component.tsx index 7b1df158087b4..ce93c370aa0f6 100644 --- a/x-pack/plugins/canvas/public/components/workpad_header/refresh_control/refresh_control.component.tsx +++ b/x-pack/plugins/canvas/public/components/workpad_header/refresh_control/refresh_control.component.tsx @@ -5,11 +5,15 @@ * 2.0. */ -import React, { MouseEventHandler } from 'react'; +import React, { useCallback } from 'react'; import PropTypes from 'prop-types'; import { EuiButtonIcon, EuiToolTip } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { useDispatch, useSelector } from 'react-redux'; +// @ts-expect-error untyped local +import { fetchAllRenderables } from '../../../state/actions/elements'; +import { getInFlight } from '../../../state/selectors/resolved_args'; import { ToolTipShortcut } from '../../tool_tip_shortcut'; const strings = { @@ -23,30 +27,31 @@ const strings = { }), }; -export interface Props { - doRefresh: MouseEventHandler; - inFlight: boolean; -} +export const RefreshControl = () => { + const dispatch = useDispatch(); + const inFlight = useSelector(getInFlight); + const doRefresh = useCallback(() => dispatch(fetchAllRenderables()), [dispatch]); -export const RefreshControl = ({ doRefresh, inFlight }: Props) => ( - - {strings.getRefreshTooltip()} - - - } - > - - -); + return ( + + {strings.getRefreshTooltip()} + + + } + > + + + ); +}; RefreshControl.propTypes = { doRefresh: PropTypes.func.isRequired, diff --git a/x-pack/plugins/canvas/public/components/workpad_header/refresh_control/refresh_control.ts b/x-pack/plugins/canvas/public/components/workpad_header/refresh_control/refresh_control.ts index c9182eea7ff4d..ef620ee897dc3 100644 --- a/x-pack/plugins/canvas/public/components/workpad_header/refresh_control/refresh_control.ts +++ b/x-pack/plugins/canvas/public/components/workpad_header/refresh_control/refresh_control.ts @@ -5,19 +5,4 @@ * 2.0. */ -import { connect } from 'react-redux'; -// @ts-expect-error untyped local -import { fetchAllRenderables } from '../../../state/actions/elements'; -import { getInFlight } from '../../../state/selectors/resolved_args'; -import { State } from '../../../../types'; -import { RefreshControl as Component } from './refresh_control.component'; - -const mapStateToProps = (state: State) => ({ - inFlight: getInFlight(state), -}); - -const mapDispatchToProps = { - doRefresh: fetchAllRenderables, -}; - -export const RefreshControl = connect(mapStateToProps, mapDispatchToProps)(Component); +export { RefreshControl } from './refresh_control.component'; diff --git a/x-pack/plugins/canvas/public/components/workpad_page/workpad_interactive_page/event_handlers.ts b/x-pack/plugins/canvas/public/components/workpad_page/workpad_interactive_page/event_handlers.ts index e8527089c9ac4..bb06444c0c8f6 100644 --- a/x-pack/plugins/canvas/public/components/workpad_page/workpad_interactive_page/event_handlers.ts +++ b/x-pack/plugins/canvas/public/components/workpad_page/workpad_interactive_page/event_handlers.ts @@ -76,7 +76,6 @@ const setupHandler = (commit: CommitFn, canvasOrigin: CanvasOriginFn, zoomScale? return; } - e.stopPropagation(); const { x, y } = localMousePosition(canvasOrigin, clientX, clientY, zoomScale); commit('mouseEvent', { event: 'mouseUp', x, y, altKey, metaKey, shiftKey, ctrlKey }); resetHandler(); @@ -123,7 +122,6 @@ const handleMouseDown = ( return; } - e.stopPropagation(); if (buttons !== 1 || !commit) { resetHandler(); return; // left-click only diff --git a/x-pack/plugins/canvas/public/expression_types/arg_types/font.js b/x-pack/plugins/canvas/public/expression_types/arg_types/font.js index 1ec6ba77685ef..d1e71fb59bf4d 100644 --- a/x-pack/plugins/canvas/public/expression_types/arg_types/font.js +++ b/x-pack/plugins/canvas/public/expression_types/arg_types/font.js @@ -8,7 +8,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { get, mapValues } from 'lodash'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { openSans } from '../../../common/lib/fonts'; import { templateFromReactComponent } from '../../lib/template_from_react_component'; import { TextStylePicker } from '../../components/text_style_picker'; diff --git a/x-pack/plugins/canvas/public/functions/plot/index.ts b/x-pack/plugins/canvas/public/functions/plot/index.ts index 5880d833c5be1..cc2a893777c2e 100644 --- a/x-pack/plugins/canvas/public/functions/plot/index.ts +++ b/x-pack/plugins/canvas/public/functions/plot/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { groupBy, get, keyBy, map, sortBy } from 'lodash'; import { ExpressionFunctionDefinition, Style } from '@kbn/expressions-plugin/common'; import type { PaletteRegistry, PaletteOutput } from '@kbn/coloring'; diff --git a/x-pack/plugins/canvas/storybook/decorators/redux_decorator.tsx b/x-pack/plugins/canvas/storybook/decorators/redux_decorator.tsx index 22dd3fcbd711e..e3864086a85dd 100644 --- a/x-pack/plugins/canvas/storybook/decorators/redux_decorator.tsx +++ b/x-pack/plugins/canvas/storybook/decorators/redux_decorator.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { createStore } from 'redux'; import { Provider as ReduxProvider } from 'react-redux'; import { cloneDeep } from 'lodash'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { CanvasWorkpad, CanvasElement, CanvasAsset, CanvasPage } from '../../types'; 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 46dda67c23f7f..dceb8fd0f30a7 100644 --- a/x-pack/plugins/cases/public/common/mock/test_providers.tsx +++ b/x-pack/plugins/cases/public/common/mock/test_providers.tsx @@ -12,7 +12,7 @@ import { ThemeProvider } from 'styled-components'; import { render as reactRender, RenderOptions, RenderResult } from '@testing-library/react'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; -import { QueryClient, QueryClientProvider } from 'react-query'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { SECURITY_SOLUTION_OWNER } from '../../../common/constants'; import { CasesCapabilities, CasesFeatures, CasesPermissions } from '../../../common/ui/types'; import { CasesProvider } from '../../components/cases_context'; diff --git a/x-pack/plugins/cases/public/components/all_cases/selector_modal/all_cases_selector_modal.test.tsx b/x-pack/plugins/cases/public/components/all_cases/selector_modal/all_cases_selector_modal.test.tsx index eba8888f3367a..98c89215aac21 100644 --- a/x-pack/plugins/cases/public/components/all_cases/selector_modal/all_cases_selector_modal.test.tsx +++ b/x-pack/plugins/cases/public/components/all_cases/selector_modal/all_cases_selector_modal.test.tsx @@ -12,7 +12,7 @@ import { AllCasesSelectorModal } from '.'; import { TestProviders } from '../../../common/mock'; import { AllCasesList } from '../all_cases_list'; -jest.mock('../all_cases_list'); +jest.mock('../all_cases_list', () => ({ AllCasesList: jest.fn().mockReturnValue(<>) })); const onRowClick = jest.fn(); const defaultProps = { @@ -57,8 +57,7 @@ describe('AllCasesSelectorModal', () => { ); - // @ts-ignore idk what this mock style is but it works ¯\_(ツ)_/¯ - expect(AllCasesList.type.mock.calls[0][0]).toEqual( + expect((AllCasesList as unknown as jest.Mock).mock.calls[0][0]).toEqual( expect.objectContaining({ hiddenStatuses: fullProps.hiddenStatuses, isSelectorView: true, diff --git a/x-pack/plugins/cases/public/components/all_cases/selector_modal/all_cases_selector_modal.tsx b/x-pack/plugins/cases/public/components/all_cases/selector_modal/all_cases_selector_modal.tsx index 173d4ec76b230..fccdf76abd2c4 100644 --- a/x-pack/plugins/cases/public/components/all_cases/selector_modal/all_cases_selector_modal.tsx +++ b/x-pack/plugins/cases/public/components/all_cases/selector_modal/all_cases_selector_modal.tsx @@ -15,7 +15,7 @@ import { EuiModalHeaderTitle, } from '@elastic/eui'; import styled from 'styled-components'; -import { QueryClientProvider } from 'react-query'; +import { QueryClientProvider } from '@tanstack/react-query'; import { Case, CaseStatusWithAllStatus } from '../../../../common/ui/types'; import * as i18n from '../../../common/translations'; import { AllCasesList } from '../all_cases_list'; diff --git a/x-pack/plugins/cases/public/components/app/routes.tsx b/x-pack/plugins/cases/public/components/app/routes.tsx index 6e952ce84ba1e..062007f3341e6 100644 --- a/x-pack/plugins/cases/public/components/app/routes.tsx +++ b/x-pack/plugins/cases/public/components/app/routes.tsx @@ -8,7 +8,7 @@ import React, { lazy, Suspense, useCallback } from 'react'; import { Redirect, Switch } from 'react-router-dom'; import { Route } from '@kbn/kibana-react-plugin/public'; -import { QueryClientProvider } from 'react-query'; +import { QueryClientProvider } from '@tanstack/react-query'; import { EuiLoadingSpinner } from '@elastic/eui'; import { AllCases } from '../all_cases'; import { CreateCase } from '../create'; diff --git a/x-pack/plugins/cases/public/components/case_view/case_view_page.test.tsx b/x-pack/plugins/cases/public/components/case_view/case_view_page.test.tsx index ea9ce12828938..284785b33d720 100644 --- a/x-pack/plugins/cases/public/components/case_view/case_view_page.test.tsx +++ b/x-pack/plugins/cases/public/components/case_view/case_view_page.test.tsx @@ -40,7 +40,9 @@ jest.mock('../../containers/use_get_tags'); jest.mock('../../containers/use_get_case'); jest.mock('../../containers/configure/use_connectors'); jest.mock('../../containers/use_post_push_to_service'); -jest.mock('../user_actions/timestamp'); +jest.mock('../user_actions/timestamp', () => ({ + UserActionTimestamp: () => <>, +})); jest.mock('../../common/navigation/hooks'); jest.mock('../../common/hooks'); jest.mock('../connectors/resilient/api'); diff --git a/x-pack/plugins/cases/public/components/case_view/components/case_view_activity.test.tsx b/x-pack/plugins/cases/public/components/case_view/components/case_view_activity.test.tsx index 8a3a457bcfd00..db5411525290b 100644 --- a/x-pack/plugins/cases/public/components/case_view/components/case_view_activity.test.tsx +++ b/x-pack/plugins/cases/public/components/case_view/components/case_view_activity.test.tsx @@ -30,7 +30,9 @@ import { useGetTags } from '../../../containers/use_get_tags'; jest.mock('../../../containers/use_get_case_user_actions'); jest.mock('../../../containers/configure/use_connectors'); jest.mock('../../../containers/use_post_push_to_service'); -jest.mock('../../user_actions/timestamp'); +jest.mock('../../user_actions/timestamp', () => ({ + UserActionTimestamp: () => <>, +})); jest.mock('../../../common/navigation/hooks'); jest.mock('../../../containers/use_get_action_license'); jest.mock('../../../containers/use_get_tags'); diff --git a/x-pack/plugins/cases/public/components/case_view/index.test.tsx b/x-pack/plugins/cases/public/components/case_view/index.test.tsx index b9213a8eb887f..20cf2c8d0d9b4 100644 --- a/x-pack/plugins/cases/public/components/case_view/index.test.tsx +++ b/x-pack/plugins/cases/public/components/case_view/index.test.tsx @@ -49,7 +49,9 @@ jest.mock('../../containers/use_get_case'); jest.mock('../../containers/use_get_case_metrics'); jest.mock('../../containers/configure/use_connectors'); jest.mock('../../containers/use_post_push_to_service'); -jest.mock('../user_actions/timestamp'); +jest.mock('../user_actions/timestamp', () => ({ + UserActionTimestamp: () => <>, +})); jest.mock('../../common/lib/kibana'); jest.mock('../../common/navigation/hooks'); jest.mock('../../containers/api'); @@ -171,7 +173,7 @@ describe('CaseView', () => { const queryClientSpy = jest.spyOn(appMockRenderer.queryClient, 'invalidateQueries'); const result = appMockRenderer.render(); userEvent.click(result.getByTestId('case-refresh')); - expect(queryClientSpy).toHaveBeenCalledWith('case'); + expect(queryClientSpy).toHaveBeenCalledWith(['case']); }); describe('when a `refreshRef` prop is provided', () => { @@ -203,7 +205,7 @@ describe('CaseView', () => { it('should refresh actions and comments', async () => { refreshRef!.current!.refreshCase(); await waitFor(() => { - expect(queryClientSpy).toHaveBeenCalledWith(CASE_VIEW_CACHE_KEY); + expect(queryClientSpy).toHaveBeenCalledWith([CASE_VIEW_CACHE_KEY]); }); }); }); diff --git a/x-pack/plugins/cases/public/components/case_view/use_on_refresh_case_view_page.tsx b/x-pack/plugins/cases/public/components/case_view/use_on_refresh_case_view_page.tsx index a4c36deabef80..396f180a074a0 100644 --- a/x-pack/plugins/cases/public/components/case_view/use_on_refresh_case_view_page.tsx +++ b/x-pack/plugins/cases/public/components/case_view/use_on_refresh_case_view_page.tsx @@ -6,7 +6,7 @@ */ import { useCallback } from 'react'; -import { useQueryClient } from 'react-query'; +import { useQueryClient } from '@tanstack/react-query'; import { CASE_TAGS_CACHE_KEY, CASE_VIEW_CACHE_KEY } from '../../containers/constants'; /** @@ -20,7 +20,7 @@ import { CASE_TAGS_CACHE_KEY, CASE_VIEW_CACHE_KEY } from '../../containers/const export const useRefreshCaseViewPage = () => { const queryClient = useQueryClient(); return useCallback(() => { - queryClient.invalidateQueries(CASE_VIEW_CACHE_KEY); - queryClient.invalidateQueries(CASE_TAGS_CACHE_KEY); + queryClient.invalidateQueries([CASE_VIEW_CACHE_KEY]); + queryClient.invalidateQueries([CASE_TAGS_CACHE_KEY]); }, [queryClient]); }; diff --git a/x-pack/plugins/cases/public/components/cases_context/query_client.ts b/x-pack/plugins/cases/public/components/cases_context/query_client.ts index 08a135f5f9395..3f27e7b550adf 100644 --- a/x-pack/plugins/cases/public/components/cases_context/query_client.ts +++ b/x-pack/plugins/cases/public/components/cases_context/query_client.ts @@ -5,6 +5,6 @@ * 2.0. */ -import { QueryClient } from 'react-query'; +import { QueryClient } from '@tanstack/react-query'; export const casesQueryClient = new QueryClient(); diff --git a/x-pack/plugins/cases/public/components/create/flyout/create_case_flyout.tsx b/x-pack/plugins/cases/public/components/create/flyout/create_case_flyout.tsx index be758e1718451..c7bcb9b0828c6 100644 --- a/x-pack/plugins/cases/public/components/create/flyout/create_case_flyout.tsx +++ b/x-pack/plugins/cases/public/components/create/flyout/create_case_flyout.tsx @@ -9,7 +9,7 @@ import React from 'react'; import styled, { createGlobalStyle } from 'styled-components'; import { EuiFlyout, EuiFlyoutHeader, EuiTitle, EuiFlyoutBody } from '@elastic/eui'; -import { QueryClientProvider } from 'react-query'; +import { QueryClientProvider } from '@tanstack/react-query'; import * as i18n from '../translations'; import { Case } from '../../../../common/ui/types'; import { CreateCaseForm } from '../form'; diff --git a/x-pack/plugins/cases/public/components/header_page/__snapshots__/editable_title.test.tsx.snap b/x-pack/plugins/cases/public/components/header_page/__snapshots__/editable_title.test.tsx.snap index bc4dba5843e62..73f466aeec771 100644 --- a/x-pack/plugins/cases/public/components/header_page/__snapshots__/editable_title.test.tsx.snap +++ b/x-pack/plugins/cases/public/components/header_page/__snapshots__/editable_title.test.tsx.snap @@ -14,11 +14,38 @@ exports[`EditableTitle renders 1`] = ` "retry": false, }, }, + "logger": BufferedConsole { + "Console": [Function], + "_buffer": Array [], + "_counters": Object {}, + "_groupDepth": 0, + "_timers": Object {}, + "assert": [Function], + "clear": [Function], + "count": [Function], + "countReset": [Function], + "debug": [Function], + "dir": [Function], + "dirxml": [Function], + "error": [Function], + "group": [Function], + "groupCollapsed": [Function], + "groupEnd": [Function], + "info": [Function], + "log": [Function], + "table": [Function], + "time": [Function], + "timeEnd": [Function], + "timeLog": [Function], + "trace": [Function], + "warn": [Function], + }, "mutationCache": MutationCache { "config": Object {}, "listeners": Array [], "mutationId": 0, "mutations": Array [], + "subscribe": [Function], }, "mutationDefaults": Array [], "queryCache": QueryCache { @@ -26,6 +53,7 @@ exports[`EditableTitle renders 1`] = ` "listeners": Array [], "queries": Array [], "queriesMap": Object {}, + "subscribe": [Function], }, "queryDefaults": Array [], } diff --git a/x-pack/plugins/cases/public/components/header_page/__snapshots__/index.test.tsx.snap b/x-pack/plugins/cases/public/components/header_page/__snapshots__/index.test.tsx.snap index 083975a40330e..7e6d9e2b05d94 100644 --- a/x-pack/plugins/cases/public/components/header_page/__snapshots__/index.test.tsx.snap +++ b/x-pack/plugins/cases/public/components/header_page/__snapshots__/index.test.tsx.snap @@ -14,11 +14,38 @@ exports[`HeaderPage it renders 1`] = ` "retry": false, }, }, + "logger": BufferedConsole { + "Console": [Function], + "_buffer": Array [], + "_counters": Object {}, + "_groupDepth": 0, + "_timers": Object {}, + "assert": [Function], + "clear": [Function], + "count": [Function], + "countReset": [Function], + "debug": [Function], + "dir": [Function], + "dirxml": [Function], + "error": [Function], + "group": [Function], + "groupCollapsed": [Function], + "groupEnd": [Function], + "info": [Function], + "log": [Function], + "table": [Function], + "time": [Function], + "timeEnd": [Function], + "timeLog": [Function], + "trace": [Function], + "warn": [Function], + }, "mutationCache": MutationCache { "config": Object {}, "listeners": Array [], "mutationId": 0, "mutations": Array [], + "subscribe": [Function], }, "mutationDefaults": Array [], "queryCache": QueryCache { @@ -26,6 +53,7 @@ exports[`HeaderPage it renders 1`] = ` "listeners": Array [], "queries": Array [], "queriesMap": Object {}, + "subscribe": [Function], }, "queryDefaults": Array [], } diff --git a/x-pack/plugins/cases/public/components/recent_cases/index.tsx b/x-pack/plugins/cases/public/components/recent_cases/index.tsx index 4cc070e77b76a..c8b7581e53107 100644 --- a/x-pack/plugins/cases/public/components/recent_cases/index.tsx +++ b/x-pack/plugins/cases/public/components/recent_cases/index.tsx @@ -8,7 +8,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiHorizontalRule, EuiText, EuiTitle } from '@elastic/eui'; import React, { useCallback, useMemo, useState } from 'react'; -import { QueryClientProvider } from 'react-query'; +import { QueryClientProvider } from '@tanstack/react-query'; import * as i18n from './translations'; import { LinkAnchor } from '../links'; import { RecentCasesFilters } from './filters'; diff --git a/x-pack/plugins/cases/public/components/user_actions/index.test.tsx b/x-pack/plugins/cases/public/components/user_actions/index.test.tsx index 9a971552f5ec3..60fc0e92d024b 100644 --- a/x-pack/plugins/cases/public/components/user_actions/index.test.tsx +++ b/x-pack/plugins/cases/public/components/user_actions/index.test.tsx @@ -53,7 +53,9 @@ const defaultProps = { }; jest.mock('../../containers/use_update_comment'); -jest.mock('./timestamp'); +jest.mock('./timestamp', () => ({ + UserActionTimestamp: () => <>, +})); jest.mock('../../common/lib/kibana'); const useUpdateCommentMock = useUpdateComment as jest.Mock; diff --git a/x-pack/plugins/cases/public/containers/configure/use_action_types.tsx b/x-pack/plugins/cases/public/containers/configure/use_action_types.tsx index caca1de7afcec..76a48e5d09ca3 100644 --- a/x-pack/plugins/cases/public/containers/configure/use_action_types.tsx +++ b/x-pack/plugins/cases/public/containers/configure/use_action_types.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import * as i18n from '../translations'; import { fetchActionTypes } from './api'; import { useToasts } from '../../common/lib/kibana'; diff --git a/x-pack/plugins/cases/public/containers/configure/use_connectors.tsx b/x-pack/plugins/cases/public/containers/configure/use_connectors.tsx index 9f1d3f38655ae..95124af988fb6 100644 --- a/x-pack/plugins/cases/public/containers/configure/use_connectors.tsx +++ b/x-pack/plugins/cases/public/containers/configure/use_connectors.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { fetchConnectors } from './api'; import { useApplicationCapabilities, useToasts } from '../../common/lib/kibana'; import * as i18n from './translations'; diff --git a/x-pack/plugins/cases/public/containers/use_get_action_license.tsx b/x-pack/plugins/cases/public/containers/use_get_action_license.tsx index a64a449783ba9..8e9aa28de440a 100644 --- a/x-pack/plugins/cases/public/containers/use_get_action_license.tsx +++ b/x-pack/plugins/cases/public/containers/use_get_action_license.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { useToasts } from '../common/lib/kibana'; import { getActionLicense } from './api'; import * as i18n from './translations'; diff --git a/x-pack/plugins/cases/public/containers/use_get_case.test.tsx b/x-pack/plugins/cases/public/containers/use_get_case.test.tsx index 8a3d7263b78de..7b07d44bdda78 100644 --- a/x-pack/plugins/cases/public/containers/use_get_case.test.tsx +++ b/x-pack/plugins/cases/public/containers/use_get_case.test.tsx @@ -10,7 +10,7 @@ import { useGetCase } from './use_get_case'; import * as api from './api'; import { waitFor } from '@testing-library/dom'; import React from 'react'; -import { QueryClient, QueryClientProvider } from 'react-query'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { useToasts } from '../common/lib/kibana'; jest.mock('./api'); diff --git a/x-pack/plugins/cases/public/containers/use_get_case.tsx b/x-pack/plugins/cases/public/containers/use_get_case.tsx index ff0cce344b87f..ded91240239a1 100644 --- a/x-pack/plugins/cases/public/containers/use_get_case.tsx +++ b/x-pack/plugins/cases/public/containers/use_get_case.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { ResolvedCase } from './types'; import * as i18n from './translations'; import { useToasts } from '../common/lib/kibana'; diff --git a/x-pack/plugins/cases/public/containers/use_get_case_metrics.test.tsx b/x-pack/plugins/cases/public/containers/use_get_case_metrics.test.tsx index 3cd3904a24072..7f61397728170 100644 --- a/x-pack/plugins/cases/public/containers/use_get_case_metrics.test.tsx +++ b/x-pack/plugins/cases/public/containers/use_get_case_metrics.test.tsx @@ -48,13 +48,11 @@ describe('useGetCaseMetrics', () => { throw new Error('Something went wrong'); }); - await act(async () => { - const { waitForNextUpdate } = renderHook(() => useGetCaseMetrics(basicCase.id, features), { - wrapper, - }); - await waitForNextUpdate(); - expect(spyOnGetCaseMetrics).toBeCalledWith(basicCase.id, features, abortCtrl.signal); - expect(addError).toHaveBeenCalled(); + const { waitForNextUpdate } = renderHook(() => useGetCaseMetrics(basicCase.id, features), { + wrapper, }); + await waitForNextUpdate(); + expect(spyOnGetCaseMetrics).toBeCalledWith(basicCase.id, features, abortCtrl.signal); + expect(addError).toHaveBeenCalled(); }); }); diff --git a/x-pack/plugins/cases/public/containers/use_get_case_metrics.tsx b/x-pack/plugins/cases/public/containers/use_get_case_metrics.tsx index 359bd6b7eeae9..1e294c4a5ba6e 100644 --- a/x-pack/plugins/cases/public/containers/use_get_case_metrics.tsx +++ b/x-pack/plugins/cases/public/containers/use_get_case_metrics.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { SingleCaseMetrics, SingleCaseMetricsFeature } from './types'; import { useToasts } from '../common/lib/kibana'; import { getSingleCaseMetrics } from './api'; diff --git a/x-pack/plugins/cases/public/containers/use_get_case_user_actions.test.tsx b/x-pack/plugins/cases/public/containers/use_get_case_user_actions.test.tsx index 3d231a9660ba2..c5dbf017da8c9 100644 --- a/x-pack/plugins/cases/public/containers/use_get_case_user_actions.test.tsx +++ b/x-pack/plugins/cases/public/containers/use_get_case_user_actions.test.tsx @@ -22,7 +22,7 @@ import { } from './mock'; import { Actions } from '../../common/api'; import React from 'react'; -import { QueryClientProvider } from 'react-query'; +import { QueryClientProvider } from '@tanstack/react-query'; import { testQueryClient } from '../common/mock'; import { waitFor } from '@testing-library/dom'; import * as api from './api'; diff --git a/x-pack/plugins/cases/public/containers/use_get_case_user_actions.tsx b/x-pack/plugins/cases/public/containers/use_get_case_user_actions.tsx index 9376598b1fdf4..da695201d6d76 100644 --- a/x-pack/plugins/cases/public/containers/use_get_case_user_actions.tsx +++ b/x-pack/plugins/cases/public/containers/use_get_case_user_actions.tsx @@ -8,7 +8,7 @@ import { isEmpty, uniqBy } from 'lodash/fp'; import deepEqual from 'fast-deep-equal'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { CaseUserActions, CaseExternalService } from '../../common/ui/types'; import { ActionTypes, CaseConnector, NONE_CONNECTOR_ID } from '../../common/api'; import { getCaseUserActions } from './api'; diff --git a/x-pack/plugins/cases/public/containers/use_get_cases.tsx b/x-pack/plugins/cases/public/containers/use_get_cases.tsx index 6274ac863200f..ce19e68fa1798 100644 --- a/x-pack/plugins/cases/public/containers/use_get_cases.tsx +++ b/x-pack/plugins/cases/public/containers/use_get_cases.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery, UseQueryResult } from 'react-query'; +import { useQuery, UseQueryResult } from '@tanstack/react-query'; import { CASE_LIST_CACHE_KEY, DEFAULT_TABLE_ACTIVE_PAGE, DEFAULT_TABLE_LIMIT } from './constants'; import { Cases, FilterOptions, QueryParams, SortFieldCase, StatusAll, SeverityAll } from './types'; import { useToasts } from '../common/lib/kibana'; diff --git a/x-pack/plugins/cases/public/containers/use_get_tags.tsx b/x-pack/plugins/cases/public/containers/use_get_tags.tsx index 3e18ac0a01315..1696a9d1413a5 100644 --- a/x-pack/plugins/cases/public/containers/use_get_tags.tsx +++ b/x-pack/plugins/cases/public/containers/use_get_tags.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { useToasts } from '../common/lib/kibana'; import { useCasesContext } from '../components/cases_context/use_cases_context'; import { ServerError } from '../types'; diff --git a/x-pack/plugins/cases/public/containers/user_profiles/use_bulk_get_user_profiles.ts b/x-pack/plugins/cases/public/containers/user_profiles/use_bulk_get_user_profiles.ts index cdaee1848613c..78c310462f77e 100644 --- a/x-pack/plugins/cases/public/containers/user_profiles/use_bulk_get_user_profiles.ts +++ b/x-pack/plugins/cases/public/containers/user_profiles/use_bulk_get_user_profiles.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery, UseQueryResult } from 'react-query'; +import { useQuery, UseQueryResult } from '@tanstack/react-query'; import { UserProfile } from '@kbn/security-plugin/common'; import * as i18n from '../translations'; import { useKibana, useToasts } from '../../common/lib/kibana'; diff --git a/x-pack/plugins/cases/public/containers/user_profiles/use_suggest_user_profiles.test.ts b/x-pack/plugins/cases/public/containers/user_profiles/use_suggest_user_profiles.test.ts index 5ae16c8fa6e00..ef5fe32a23dff 100644 --- a/x-pack/plugins/cases/public/containers/user_profiles/use_suggest_user_profiles.test.ts +++ b/x-pack/plugins/cases/public/containers/user_profiles/use_suggest_user_profiles.test.ts @@ -26,21 +26,8 @@ describe('useSuggestUserProfiles', () => { let appMockRender: AppMockRenderer; - beforeAll(() => { - jest.useFakeTimers(); - }); - beforeEach(() => { appMockRender = createAppMockRenderer(); - jest.clearAllMocks(); - }); - - afterEach(() => { - jest.clearAllTimers(); - }); - - afterAll(() => { - jest.useRealTimers(); }); it('calls suggestUserProfiles with correct arguments', async () => { @@ -50,7 +37,6 @@ describe('useSuggestUserProfiles', () => { wrapper: appMockRender.AppWrapper, }); - jest.advanceTimersByTime(500); await waitFor(() => result.current.isSuccess); expect(spyOnSuggestUserProfiles).toBeCalledWith({ @@ -75,7 +61,6 @@ describe('useSuggestUserProfiles', () => { wrapper: appMockRender.AppWrapper, }); - jest.advanceTimersByTime(500); await waitFor(() => result.current.isError); expect(addError).toHaveBeenCalled(); diff --git a/x-pack/plugins/cases/public/containers/user_profiles/use_suggest_user_profiles.ts b/x-pack/plugins/cases/public/containers/user_profiles/use_suggest_user_profiles.ts index 3705224e1d0c8..6c83f853b2624 100644 --- a/x-pack/plugins/cases/public/containers/user_profiles/use_suggest_user_profiles.ts +++ b/x-pack/plugins/cases/public/containers/user_profiles/use_suggest_user_profiles.ts @@ -6,7 +6,7 @@ */ import { useState } from 'react'; -import { useQuery, UseQueryResult } from 'react-query'; +import { useQuery, UseQueryResult } from '@tanstack/react-query'; import useDebounce from 'react-use/lib/useDebounce'; import { UserProfile } from '@kbn/security-plugin/common'; import { DEFAULT_USER_SIZE } from '../../../common/constants'; diff --git a/x-pack/plugins/cases/server/services/so_reference_extractor.ts b/x-pack/plugins/cases/server/services/so_reference_extractor.ts index 622cce373e755..27fdf17b5f727 100644 --- a/x-pack/plugins/cases/server/services/so_reference_extractor.ts +++ b/x-pack/plugins/cases/server/services/so_reference_extractor.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import _ from 'lodash'; import { SavedObject, SavedObjectReference, SavedObjectsUpdateResponse } from '@kbn/core/server'; diff --git a/x-pack/plugins/cloud_security_posture/public/application/csp_router.tsx b/x-pack/plugins/cloud_security_posture/public/application/csp_router.tsx index 2fd84c5967e29..9f17ae174dd67 100644 --- a/x-pack/plugins/cloud_security_posture/public/application/csp_router.tsx +++ b/x-pack/plugins/cloud_security_posture/public/application/csp_router.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { QueryClient, QueryClientProvider } from 'react-query'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { Redirect, Route, RouteComponentProps, type RouteProps, Switch } from 'react-router-dom'; import { CLOUD_SECURITY_POSTURE_BASE_PATH, type CspSecuritySolutionContext } from '..'; import { cloudPosturePages } from '../common/navigation/constants'; diff --git a/x-pack/plugins/cloud_security_posture/public/common/api/use_cis_kubernetes_integration.tsx b/x-pack/plugins/cloud_security_posture/public/common/api/use_cis_kubernetes_integration.tsx index 5660080cb0a43..26b885ad44344 100644 --- a/x-pack/plugins/cloud_security_posture/public/common/api/use_cis_kubernetes_integration.tsx +++ b/x-pack/plugins/cloud_security_posture/public/common/api/use_cis_kubernetes_integration.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { epmRouteService, type GetInfoResponse, diff --git a/x-pack/plugins/cloud_security_posture/public/common/api/use_compliance_dashboard_data_api.ts b/x-pack/plugins/cloud_security_posture/public/common/api/use_compliance_dashboard_data_api.ts index feb9cf50ad120..c1b108bb5f98a 100644 --- a/x-pack/plugins/cloud_security_posture/public/common/api/use_compliance_dashboard_data_api.ts +++ b/x-pack/plugins/cloud_security_posture/public/common/api/use_compliance_dashboard_data_api.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { type QueryObserverOptions, useQuery } from 'react-query'; +import { type QueryObserverOptions, useQuery } from '@tanstack/react-query'; import { useKibana } from '../hooks/use_kibana'; import { ComplianceDashboardData } from '../../../common/types'; import { STATS_ROUTE_PATH } from '../../../common/constants'; diff --git a/x-pack/plugins/cloud_security_posture/public/common/api/use_latest_findings_data_view.ts b/x-pack/plugins/cloud_security_posture/public/common/api/use_latest_findings_data_view.ts index 8f7a9c9b59d5e..e40a4c5a8e8c2 100644 --- a/x-pack/plugins/cloud_security_posture/public/common/api/use_latest_findings_data_view.ts +++ b/x-pack/plugins/cloud_security_posture/public/common/api/use_latest_findings_data_view.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import type { DataView } from '@kbn/data-plugin/common'; import { CSP_LATEST_FINDINGS_DATA_VIEW } from '../../../common/constants'; diff --git a/x-pack/plugins/cloud_security_posture/public/common/api/use_setup_status_api.ts b/x-pack/plugins/cloud_security_posture/public/common/api/use_setup_status_api.ts index fce0b9c2d7790..7c5d4eb8dc31b 100644 --- a/x-pack/plugins/cloud_security_posture/public/common/api/use_setup_status_api.ts +++ b/x-pack/plugins/cloud_security_posture/public/common/api/use_setup_status_api.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery, type UseQueryOptions } from 'react-query'; +import { useQuery, type UseQueryOptions } from '@tanstack/react-query'; import { useKibana } from '../hooks/use_kibana'; import { CspSetupStatus } from '../../../common/types'; import { STATUS_ROUTE_PATH } from '../../../common/constants'; diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx b/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx index 3de37af1d7a65..c3cec5ca27774 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx @@ -18,7 +18,7 @@ import { TestProvider } from '../test/test_provider'; import { coreMock } from '@kbn/core/public/mocks'; import { render, screen } from '@testing-library/react'; import React, { ComponentProps } from 'react'; -import { UseQueryResult } from 'react-query'; +import { UseQueryResult } from '@tanstack/react-query'; import { CloudPosturePage } from './cloud_posture_page'; import { NoDataPage } from '@kbn/kibana-react-plugin/public'; import { useCspSetupStatusApi } from '../common/api/use_setup_status_api'; diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.tsx b/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.tsx index dfa1c51f5226a..4ded9cb9060bb 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; import { i18n } from '@kbn/i18n'; -import type { UseQueryResult } from 'react-query'; +import type { UseQueryResult } from '@tanstack/react-query'; import { EuiEmptyPrompt } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { NoDataPage } from '@kbn/kibana-react-plugin/public'; @@ -166,7 +166,7 @@ export const CloudPosturePage = ({ return defaultErrorRenderer(getSetupStatus.error); } - if (getSetupStatus.isLoading || getSetupStatus.isIdle) { + if (getSetupStatus.isLoading) { return defaultLoadingRenderer(); } @@ -182,7 +182,7 @@ export const CloudPosturePage = ({ return errorRender(query.error); } - if (query.isLoading || query.isIdle) { + if (query.isLoading) { return loadingRender(); } diff --git a/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.test.tsx b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.test.tsx index 12ba2e9db3885..af10c55f19ea9 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.test.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import Chance from 'chance'; import { render, screen } from '@testing-library/react'; -import type { UseQueryResult } from 'react-query/types/react/types'; +import type { UseQueryResult } from '@tanstack/react-query'; import { createCspBenchmarkIntegrationFixture } from '../../test/fixtures/csp_benchmark_integration'; import { createReactQueryResponse } from '../../test/fixtures/react_query'; import { TestProvider } from '../../test/test_provider'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/use_csp_benchmark_integrations.ts b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/use_csp_benchmark_integrations.ts index 0315893ef4cc2..ccdc3650b2596 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/use_csp_benchmark_integrations.ts +++ b/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/use_csp_benchmark_integrations.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import type { ListResult } from '@kbn/fleet-plugin/common'; import { BENCHMARKS_ROUTE_PATH } from '../../../common/constants'; import type { BenchmarksQueryParams } from '../../../common/schemas/benchmark'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/es_pit/findings_es_pit_context.ts b/x-pack/plugins/cloud_security_posture/public/pages/findings/es_pit/findings_es_pit_context.ts index 54105ad21495f..aa1d660229d75 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/findings/es_pit/findings_es_pit_context.ts +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/es_pit/findings_es_pit_context.ts @@ -6,7 +6,7 @@ */ import { createContext, type MutableRefObject } from 'react'; -import type { UseQueryResult } from 'react-query'; +import type { UseQueryResult } from '@tanstack/react-query'; interface FindingsEsPitContextValue { setPitId(newPitId: string): void; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/es_pit/use_findings_es_pit.ts b/x-pack/plugins/cloud_security_posture/public/pages/findings/es_pit/use_findings_es_pit.ts index d7d7d6cbe3415..d8f2b22f501d4 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/findings/es_pit/use_findings_es_pit.ts +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/es_pit/use_findings_es_pit.ts @@ -6,7 +6,7 @@ */ import { useCallback, useRef, useState } from 'react'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { CSP_LATEST_FINDINGS_DATA_VIEW, ES_PIT_ROUTE_PATH } from '../../../../common/constants'; import { useKibana } from '../../../common/hooks/use_kibana'; import { FINDINGS_PIT_KEEP_ALIVE } from '../constants'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/findings.test.tsx b/x-pack/plugins/cloud_security_posture/public/pages/findings/findings.test.tsx index 7cc01358b17d5..2ee05a2565adc 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/findings/findings.test.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/findings.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; import Chance from 'chance'; -import type { UseQueryResult } from 'react-query'; +import type { UseQueryResult } from '@tanstack/react-query'; import { of } from 'rxjs'; import { useLatestFindingsDataView } from '../../common/api/use_latest_findings_data_view'; import { Findings } from './findings'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/findings.tsx b/x-pack/plugins/cloud_security_posture/public/pages/findings/findings.tsx index baf4391eb2cc8..873b2c3c5cd76 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/findings/findings.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/findings.tsx @@ -5,7 +5,7 @@ * 2.0. */ import React from 'react'; -import type { UseQueryResult } from 'react-query'; +import type { UseQueryResult } from '@tanstack/react-query'; import { Redirect, Switch, Route, useLocation } from 'react-router-dom'; import { useCspSetupStatusApi } from '../../common/api/use_setup_status_api'; import { NoFindingsStates } from '../../components/no_findings_states'; @@ -28,7 +28,7 @@ export const Findings = () => { if (!hasFindings) return ; let queryForCloudPosturePage: UseQueryResult = dataViewQuery; - if (pitQuery.isError || pitQuery.isLoading || pitQuery.isIdle) { + if (pitQuery.isError || pitQuery.isLoading) { queryForCloudPosturePage = pitQuery; } diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings/latest_findings_container.test.tsx b/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings/latest_findings_container.test.tsx index 9dc42b2e4413c..4090f80435b46 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings/latest_findings_container.test.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings/latest_findings_container.test.tsx @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import type { UseQueryResult } from 'react-query'; +import type { UseQueryResult } from '@tanstack/react-query'; import { createReactQueryResponse } from '../../../test/fixtures/react_query'; import React from 'react'; import { render } from '@testing-library/react'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings/use_latest_findings.ts b/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings/use_latest_findings.ts index 2766ddbebb047..720d21cea2012 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings/use_latest_findings.ts +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings/use_latest_findings.ts @@ -5,7 +5,7 @@ * 2.0. */ import { useContext } from 'react'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { number } from 'io-ts'; import { lastValueFrom } from 'rxjs'; import type { IKibanaSearchRequest, IKibanaSearchResponse } from '@kbn/data-plugin/common'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings_by_resource/resource_findings/use_resource_findings.ts b/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings_by_resource/resource_findings/use_resource_findings.ts index 44be336f1c041..53748c54eae0a 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings_by_resource/resource_findings/use_resource_findings.ts +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings_by_resource/resource_findings/use_resource_findings.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { lastValueFrom } from 'rxjs'; import { IKibanaSearchRequest, IKibanaSearchResponse } from '@kbn/data-plugin/common'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings_by_resource/use_findings_by_resource.ts b/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings_by_resource/use_findings_by_resource.ts index ebb8f56c84e40..6def567d64ddd 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings_by_resource/use_findings_by_resource.ts +++ b/x-pack/plugins/cloud_security_posture/public/pages/findings/latest_findings_by_resource/use_findings_by_resource.ts @@ -5,7 +5,7 @@ * 2.0. */ import { useContext } from 'react'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { lastValueFrom } from 'rxjs'; import { IKibanaSearchRequest, IKibanaSearchResponse } from '@kbn/data-plugin/common'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules.test.tsx b/x-pack/plugins/cloud_security_posture/public/pages/rules/rules.test.tsx index 32fb45c9fe025..82238c2d7c4d0 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules.test.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/rules/rules.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import Chance from 'chance'; import { Rules } from '.'; import { render, screen } from '@testing-library/react'; -import { QueryClient } from 'react-query'; +import { QueryClient } from '@tanstack/react-query'; import { TestProvider } from '../../test/test_provider'; import { useCspIntegrationInfo } from './use_csp_integration'; import { type RouteComponentProps } from 'react-router-dom'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.test.tsx b/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.test.tsx index 64488f27d1353..bd22be3fab482 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.test.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { RulesContainer } from './rules_container'; import { render, screen, fireEvent, within } from '@testing-library/react'; -import { QueryClient } from 'react-query'; +import { QueryClient } from '@tanstack/react-query'; import { useFindCspRules, useBulkUpdateCspRules, type RuleSavedObject } from './use_csp_rules'; import * as TEST_SUBJECTS from './test_subjects'; import { Chance } from 'chance'; diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_integration.tsx b/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_integration.tsx index d28f63769a615..3743127e9b9bd 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_integration.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_integration.tsx @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { type CopyAgentPolicyResponse, type GetOnePackagePolicyResponse, diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_rules.ts b/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_rules.ts index 8e9b74429b4a3..01ca13870964b 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_rules.ts +++ b/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_rules.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { useQuery, useMutation, useQueryClient } from 'react-query'; +import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'; import { FunctionKeys } from 'utility-types'; import type { SavedObjectsFindOptions, SimpleSavedObject } from '@kbn/core/public'; import { i18n } from '@kbn/i18n'; @@ -74,10 +74,7 @@ export const useBulkUpdateCspRules = () => { }, onSettled: () => // Invalidate all queries for simplicity - queryClient.invalidateQueries({ - queryKey: CSP_RULE_SAVED_OBJECT_TYPE, - exact: false, - }), + queryClient.invalidateQueries([CSP_RULE_SAVED_OBJECT_TYPE]), } ); }; diff --git a/x-pack/plugins/cloud_security_posture/public/test/fixtures/react_query.ts b/x-pack/plugins/cloud_security_posture/public/test/fixtures/react_query.ts index 0169c359b26eb..9605515618882 100644 --- a/x-pack/plugins/cloud_security_posture/public/test/fixtures/react_query.ts +++ b/x-pack/plugins/cloud_security_posture/public/test/fixtures/react_query.ts @@ -5,10 +5,10 @@ * 2.0. */ -import type { UseQueryResult } from 'react-query/types/react/types'; +import type { UseQueryResult } from '@tanstack/react-query'; interface CreateReactQueryResponseInput { - status?: UseQueryResult['status']; + status?: UseQueryResult['status'] | 'idle'; data?: TData; error?: TError; } @@ -35,12 +35,12 @@ export const createReactQueryResponse = ({ if (status === 'idle') { return { - status, + status: 'loading', data: undefined, isSuccess: false, - isLoading: false, + isLoading: true, isError: false, - isIdle: true, + fetchStatus: 'idle', }; } diff --git a/x-pack/plugins/cloud_security_posture/public/test/test_provider.tsx b/x-pack/plugins/cloud_security_posture/public/test/test_provider.tsx index 758cdb8ca3f60..09c03c29750a7 100755 --- a/x-pack/plugins/cloud_security_posture/public/test/test_provider.tsx +++ b/x-pack/plugins/cloud_security_posture/public/test/test_provider.tsx @@ -9,7 +9,7 @@ import type { AppMountParameters, CoreStart } from '@kbn/core/public'; import React, { useMemo } from 'react'; import { I18nProvider } from '@kbn/i18n-react'; import { Router, Switch, Route } from 'react-router-dom'; -import { QueryClient, QueryClientProvider } from 'react-query'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { coreMock } from '@kbn/core/public/mocks'; import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; diff --git a/x-pack/plugins/cloud_security_posture/server/routes/configuration/update_rules_configuration.ts b/x-pack/plugins/cloud_security_posture/server/routes/configuration/update_rules_configuration.ts index 463bdab0cdb6e..6c6358e772e6a 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/configuration/update_rules_configuration.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/configuration/update_rules_configuration.ts @@ -24,8 +24,8 @@ import { createCspRuleSearchFilterByPackagePolicy } from '../../../common/utils/ import type { CspRule, CspRulesConfiguration } from '../../../common/schemas'; import { CLOUD_SECURITY_POSTURE_PACKAGE_NAME, - UPDATE_RULES_CONFIG_ROUTE_PATH, CSP_RULE_SAVED_OBJECT_TYPE, + UPDATE_RULES_CONFIG_ROUTE_PATH, } from '../../../common/constants'; import { CspRouter } from '../../types'; @@ -38,7 +38,7 @@ export const getPackagePolicy = async ( // PackagePolicies always contains one element, even when package does not exist if (!packagePolicies || !packagePolicies[0].version) { - throw new Error(`package policy Id '${packagePolicyId}' is not exist`); + throw new Error(`Package policy Id '${packagePolicyId}' does not exist`); } if (packagePolicies[0].package?.name !== CLOUD_SECURITY_POSTURE_PACKAGE_NAME) { throw new Error( diff --git a/x-pack/plugins/encrypted_saved_objects/server/saved_objects/encrypted_saved_objects_client_wrapper.test.ts b/x-pack/plugins/encrypted_saved_objects/server/saved_objects/encrypted_saved_objects_client_wrapper.test.ts index 724178f9b7088..75dd3fdfe8dce 100644 --- a/x-pack/plugins/encrypted_saved_objects/server/saved_objects/encrypted_saved_objects_client_wrapper.test.ts +++ b/x-pack/plugins/encrypted_saved_objects/server/saved_objects/encrypted_saved_objects_client_wrapper.test.ts @@ -15,11 +15,12 @@ import { EncryptionErrorOperation } from '../crypto/encryption_error'; import { encryptedSavedObjectsServiceMock } from '../crypto/index.mock'; import { EncryptedSavedObjectsClientWrapper } from './encrypted_saved_objects_client_wrapper'; -jest.mock('@kbn/core/server/saved_objects/service/lib/utils', () => { - const { SavedObjectsUtils } = jest.requireActual( - '@kbn/core/server/saved_objects/service/lib/utils' +jest.mock('@kbn/core-saved-objects-utils-server', () => { + const { SavedObjectsUtils, ...actual } = jest.requireActual( + '@kbn/core-saved-objects-utils-server' ); return { + ...actual, SavedObjectsUtils: { namespaceStringToId: SavedObjectsUtils.namespaceStringToId, isRandomId: SavedObjectsUtils.isRandomId, @@ -699,6 +700,7 @@ describe('#bulkUpdate', () => { expectOptionsNamespaceInDescriptor: boolean; expectObjectNamespaceInDescriptor: boolean; } + const doTest = async ({ optionsNamespace, objectNamespace, diff --git a/x-pack/plugins/enterprise_search/common/types/analytics.ts b/x-pack/plugins/enterprise_search/common/types/analytics.ts new file mode 100644 index 0000000000000..e75617645a139 --- /dev/null +++ b/x-pack/plugins/enterprise_search/common/types/analytics.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 interface AnalyticsCollection { + id: string; + name: string; + event_retention_day_length: number; +} + +export type AnalyticsCollectionDocument = Omit; diff --git a/x-pack/plugins/enterprise_search/common/types/error_codes.ts b/x-pack/plugins/enterprise_search/common/types/error_codes.ts index 327d000003f9b..46a787ae257ec 100644 --- a/x-pack/plugins/enterprise_search/common/types/error_codes.ts +++ b/x-pack/plugins/enterprise_search/common/types/error_codes.ts @@ -6,6 +6,7 @@ */ export enum ErrorCode { + ANALYTICS_COLLECTION_ALREADY_EXISTS = 'analytics_collection_already_exists', CONNECTOR_DOCUMENT_ALREADY_EXISTS = 'connector_document_already_exists', CRAWLER_ALREADY_EXISTS = 'crawler_already_exists', INDEX_ALREADY_EXISTS = 'index_already_exists', diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/index/delete_index_api_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/index/delete_index_api_logic.test.ts new file mode 100644 index 0000000000000..6eaa5b3e95cf2 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/index/delete_index_api_logic.test.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 { mockHttpValues } from '../../../__mocks__/kea_logic'; + +import { nextTick } from '@kbn/test-jest-helpers'; + +import { deleteIndex } from './delete_index_api_logic'; + +describe('deleteIndexApiLogic', () => { + const { http } = mockHttpValues; + beforeEach(() => { + jest.clearAllMocks(); + }); + describe('deleteIndex', () => { + it('calls correct api', async () => { + const promise = Promise.resolve(); + http.post.mockReturnValue(promise); + const result = deleteIndex({ indexName: 'deleteIndex' }); + await nextTick(); + expect(http.delete).toHaveBeenCalledWith('/internal/enterprise_search/indices/deleteIndex'); + await expect(result).resolves; + }); + }); +}); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/index/delete_index_api_logic.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/index/delete_index_api_logic.ts new file mode 100644 index 0000000000000..ff92e4ecef6bc --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/index/delete_index_api_logic.ts @@ -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 { createApiLogic } from '../../../shared/api_logic/create_api_logic'; +import { HttpLogic } from '../../../shared/http'; + +export interface DeleteIndexApiLogicArgs { + indexName: string; +} + +export const deleteIndex = async ({ indexName }: DeleteIndexApiLogicArgs): Promise => { + const route = `/internal/enterprise_search/indices/${indexName}`; + await HttpLogic.values.http.delete(route); + return; +}; + +export const DeleteIndexApiLogic = createApiLogic(['delete_index_api_logic'], deleteIndex); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/index/fetch_indices_api_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/index/fetch_indices_api_logic.test.ts index 13b75e7c534be..42d78b65df449 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/index/fetch_indices_api_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/index/fetch_indices_api_logic.test.ts @@ -28,7 +28,12 @@ describe('FetchIndicesApiLogic', () => { expect(http.get).toHaveBeenCalledWith('/internal/enterprise_search/indices', { query: { page: 1, return_hidden_indices: false, search_query: null, size: 20 }, }); - await expect(result).resolves.toEqual({ isInitialRequest: true, result: 'result' }); + await expect(result).resolves.toEqual({ + isInitialRequest: true, + result: 'result', + returnHiddenIndices: false, + searchQuery: undefined, + }); }); it('sets initialRequest to false if page is not the first page', async () => { const promise = Promise.resolve({ result: 'result' }); @@ -41,7 +46,12 @@ describe('FetchIndicesApiLogic', () => { expect(http.get).toHaveBeenCalledWith('/internal/enterprise_search/indices', { query: { page: 2, return_hidden_indices: false, search_query: null, size: 20 }, }); - await expect(result).resolves.toEqual({ isInitialRequest: false, result: 'result' }); + await expect(result).resolves.toEqual({ + isInitialRequest: false, + result: 'result', + returnHiddenIndices: false, + searchQuery: undefined, + }); }); it('sets initialRequest to false if searchQuery is not empty', async () => { const promise = Promise.resolve({ result: 'result' }); @@ -55,7 +65,12 @@ describe('FetchIndicesApiLogic', () => { expect(http.get).toHaveBeenCalledWith('/internal/enterprise_search/indices', { query: { page: 1, return_hidden_indices: false, search_query: 'a', size: 20 }, }); - await expect(result).resolves.toEqual({ isInitialRequest: false, result: 'result' }); + await expect(result).resolves.toEqual({ + isInitialRequest: false, + result: 'result', + returnHiddenIndices: false, + searchQuery: 'a', + }); }); }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/index/fetch_indices_api_logic.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/index/fetch_indices_api_logic.ts index a1ca3a9c3141f..709c47ed919c0 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/index/fetch_indices_api_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/index/fetch_indices_api_logic.ts @@ -38,7 +38,7 @@ export const fetchIndices = async ({ // We need this to determine whether to show the empty state on the indices page const isInitialRequest = meta.page.current === 1 && !searchQuery; - return { ...response, isInitialRequest }; + return { ...response, isInitialRequest, returnHiddenIndices, searchQuery }; }; export const FetchIndicesAPILogic = createApiLogic(['content', 'indices_api_logic'], fetchIndices); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/client_libraries_popover/popover.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/client_libraries_popover/popover.tsx index b89f489952ab8..3ec4cab0a6ff6 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/client_libraries_popover/popover.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/components/client_libraries_popover/popover.tsx @@ -14,10 +14,14 @@ import { EuiContextMenuPanel, EuiContextMenuItem, EuiText, + EuiIcon, + EuiFlexItem, + EuiFlexGroup, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { icons } from '../../../../../../assets/client_libraries'; import { docLinks } from '../../../../../shared/doc_links'; import { OverviewLogic } from '../../overview.logic'; @@ -25,6 +29,7 @@ import { OverviewLogic } from '../../overview.logic'; const libraries = [ { href: docLinks.clientsJavaIntroduction, + icon: icons.java, key: 'java', text: i18n.translate( 'xpack.enterpriseSearch.content.overview.documentExample.clientLibraries.java', @@ -33,6 +38,7 @@ const libraries = [ }, { href: docLinks.clientsJsIntro, + icon: icons.javascript, key: 'javascript', text: i18n.translate( 'xpack.enterpriseSearch.content.overview.documentExample.clientLibraries.javascript', @@ -41,6 +47,7 @@ const libraries = [ }, { href: docLinks.clientsRubyOverview, + icon: icons.ruby, key: 'ruby', text: i18n.translate( 'xpack.enterpriseSearch.content.overview.documentExample.clientLibraries.ruby', @@ -49,6 +56,7 @@ const libraries = [ }, { href: docLinks.clientsGoIndex, + icon: icons.go, key: 'go', text: i18n.translate( 'xpack.enterpriseSearch.content.overview.documentExample.clientLibraries.go', @@ -57,6 +65,7 @@ const libraries = [ }, { href: docLinks.clientsNetIntroduction, + icon: icons.dotnet, key: 'dotnet', text: i18n.translate( 'xpack.enterpriseSearch.content.overview.documentExample.clientLibraries.dotnet', @@ -65,6 +74,7 @@ const libraries = [ }, { href: docLinks.clientsPhpGuide, + icon: icons.php, key: 'php', text: i18n.translate( 'xpack.enterpriseSearch.content.overview.documentExample.clientLibraries.php', @@ -73,6 +83,7 @@ const libraries = [ }, { href: docLinks.clientsPerlGuide, + icon: icons.perl, key: 'perl', text: i18n.translate( 'xpack.enterpriseSearch.content.overview.documentExample.clientLibraries.perl', @@ -81,6 +92,7 @@ const libraries = [ }, { href: docLinks.clientsPythonOverview, + icon: icons.python, key: 'python', text: i18n.translate( 'xpack.enterpriseSearch.content.overview.documentExample.clientLibraries.python', @@ -89,6 +101,7 @@ const libraries = [ }, { href: docLinks.clientsRustOverview, + icon: icons.rust, key: 'rust', text: i18n.translate( 'xpack.enterpriseSearch.content.overview.documentExample.clientLibraries.rust', @@ -116,15 +129,25 @@ export const ClientLibrariesPopover: React.FC = () => { > { - return ( - - -

{item.text}

-
-
- ); - })} + items={libraries.map((item) => ( + : undefined} + > + + + +

{item.text}

+
+
+ + + +
+
+ ))} /> ); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/delete_index_modal.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/delete_index_modal.tsx new file mode 100644 index 0000000000000..99f0e35c352e1 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/delete_index_modal.tsx @@ -0,0 +1,80 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; 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 { EuiConfirmModal } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; + +import { IndicesLogic } from './indices_logic'; + +export const DeleteIndexModal: React.FC = () => { + const { closeDeleteModal, deleteIndex } = useActions(IndicesLogic); + const { deleteModalIndexName: indexName, isDeleteModalVisible } = useValues(IndicesLogic); + return isDeleteModalVisible ? ( + { + closeDeleteModal(); + }} + onConfirm={() => { + deleteIndex({ indexName }); + }} + cancelButtonText={i18n.translate( + 'xpack.enterpriseSearch.content.searchIndices.deleteModal.cancelButton.title', + { + defaultMessage: 'Cancel', + } + )} + confirmButtonText={i18n.translate( + 'xpack.enterpriseSearch.content.searchIndices.deleteModal.confirmButton.title', + { + defaultMessage: 'Delete index', + } + )} + defaultFocusedButton="confirm" + buttonColor="danger" + > +

+ {i18n.translate( + 'xpack.enterpriseSearch.content.searchIndices.deleteModal.delete.description', + { + defaultMessage: + 'You are about to delete the index {indexName}. This will also delete any associated connector documents or crawlers.', + values: { + indexName, + }, + } + )} +

+

+ {i18n.translate( + 'xpack.enterpriseSearch.content.searchIndices.deleteModal.searchEngine.description', + { + defaultMessage: + 'Any associated search engines will no longer be able to access any data stored in this index.', + } + )} +

+

+ {i18n.translate( + 'xpack.enterpriseSearch.content.searchIndices.deleteModal.irrevokable.description', + { + defaultMessage: + "You can't recover a deleted index, connector or crawler configuration. Make sure you have appropriate backups.", + } + )} +

+
+ ) : ( + <> + ); +}; diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/indices_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/indices_logic.test.ts index 36157301d3bae..2574af68ce50c 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/indices_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/indices_logic.test.ts @@ -28,11 +28,14 @@ import { IndicesLogic } from './indices_logic'; const DEFAULT_VALUES = { data: undefined, + deleteModalIndexName: '', hasNoIndices: false, indices: [], + isDeleteModalVisible: false, isFirstRequest: true, isLoading: true, meta: DEFAULT_META, + searchParams: { meta: DEFAULT_META, returnHiddenIndices: false }, status: Status.IDLE, }; @@ -64,11 +67,75 @@ describe('IndicesLogic', () => { current: 3, }, }, + searchParams: { + ...DEFAULT_VALUES.searchParams, + meta: { page: { ...DEFAULT_META.page, current: 3 } }, + }, }); }); }); + describe('openDeleteModal', () => { + it('should set deleteIndexName and set isDeleteModalVisible to true', () => { + IndicesLogic.actions.openDeleteModal('delete'); + expect(IndicesLogic.values).toEqual({ + ...DEFAULT_VALUES, + deleteModalIndexName: 'delete', + isDeleteModalVisible: true, + }); + }); + }); + describe('closeDeleteModal', () => { + it('should set deleteIndexName to empty and set isDeleteModalVisible to false', () => { + IndicesLogic.actions.openDeleteModal('delete'); + IndicesLogic.actions.closeDeleteModal(); + expect(IndicesLogic.values).toEqual(DEFAULT_VALUES); + }); + }); }); describe('reducers', () => { + describe('isFirstRequest', () => { + it('should update to true on setIsFirstRequest', () => { + IndicesLogic.actions.setIsFirstRequest(); + expect(IndicesLogic.values).toEqual({ ...DEFAULT_VALUES, isFirstRequest: true }); + }); + it('should update to false on apiError', () => { + IndicesLogic.actions.setIsFirstRequest(); + IndicesLogic.actions.apiError({} as HttpError); + + expect(IndicesLogic.values).toEqual({ + ...DEFAULT_VALUES, + hasNoIndices: false, + indices: [], + isFirstRequest: false, + isLoading: false, + status: Status.ERROR, + }); + }); + it('should update to false on apiSuccess', () => { + IndicesLogic.actions.setIsFirstRequest(); + IndicesLogic.actions.apiSuccess({ + indices: [], + isInitialRequest: false, + meta: DEFAULT_VALUES.meta, + returnHiddenIndices: false, + }); + + expect(IndicesLogic.values).toEqual({ + ...DEFAULT_VALUES, + data: { + indices: [], + isInitialRequest: false, + meta: DEFAULT_VALUES.meta, + returnHiddenIndices: false, + }, + hasNoIndices: false, + indices: [], + isFirstRequest: false, + isLoading: false, + status: Status.SUCCESS, + }); + }); + }); describe('meta', () => { it('updates when apiSuccess listener triggered', () => { const newMeta = { @@ -84,18 +151,28 @@ describe('IndicesLogic', () => { indices, isInitialRequest: true, meta: newMeta, + returnHiddenIndices: true, + searchQuery: 'a', }); expect(IndicesLogic.values).toEqual({ + ...DEFAULT_VALUES, data: { indices, isInitialRequest: true, meta: newMeta, + returnHiddenIndices: true, + searchQuery: 'a', }, hasNoIndices: false, indices: elasticsearchViewIndices, isFirstRequest: false, isLoading: false, meta: newMeta, + searchParams: { + meta: newMeta, + returnHiddenIndices: true, + searchQuery: 'a', + }, status: Status.SUCCESS, }); }); @@ -115,18 +192,25 @@ describe('IndicesLogic', () => { indices: [], isInitialRequest: true, meta, + returnHiddenIndices: false, }); expect(IndicesLogic.values).toEqual({ + ...DEFAULT_VALUES, data: { indices: [], isInitialRequest: true, meta, + returnHiddenIndices: false, }, hasNoIndices: true, indices: [], isFirstRequest: false, isLoading: false, meta, + searchParams: { + ...DEFAULT_VALUES.searchParams, + meta, + }, status: Status.SUCCESS, }); }); @@ -144,18 +228,25 @@ describe('IndicesLogic', () => { indices: [], isInitialRequest: false, meta, + returnHiddenIndices: false, }); expect(IndicesLogic.values).toEqual({ + ...DEFAULT_VALUES, data: { indices: [], isInitialRequest: false, meta, + returnHiddenIndices: false, }, hasNoIndices: false, indices: [], isFirstRequest: false, isLoading: false, meta, + searchParams: { + ...DEFAULT_VALUES.searchParams, + meta, + }, status: Status.SUCCESS, }); }); @@ -172,6 +263,21 @@ describe('IndicesLogic', () => { expect(mockFlashMessageHelpers.flashAPIErrors).toHaveBeenCalledTimes(1); expect(mockFlashMessageHelpers.flashAPIErrors).toHaveBeenCalledWith({}); }); + it('calls flashAPIErrors on deleteError', () => { + IndicesLogic.actions.deleteError({} as HttpError); + expect(mockFlashMessageHelpers.flashAPIErrors).toHaveBeenCalledTimes(1); + expect(mockFlashMessageHelpers.flashAPIErrors).toHaveBeenCalledWith({}); + }); + it('calls flashSuccessToast, closeDeleteModal and fetchIndices on deleteSuccess', () => { + IndicesLogic.actions.fetchIndices = jest.fn(); + IndicesLogic.actions.closeDeleteModal = jest.fn(); + IndicesLogic.actions.deleteSuccess(); + expect(mockFlashMessageHelpers.flashSuccessToast).toHaveBeenCalledTimes(1); + expect(IndicesLogic.actions.fetchIndices).toHaveBeenCalledWith( + IndicesLogic.values.searchParams + ); + expect(IndicesLogic.actions.closeDeleteModal).toHaveBeenCalled(); + }); it('calls makeRequest on fetchIndices', async () => { jest.useFakeTimers(); IndicesLogic.actions.makeRequest = jest.fn(); @@ -223,13 +329,16 @@ describe('IndicesLogic', () => { indices: elasticsearchViewIndices, isInitialRequest: true, meta: DEFAULT_META, + returnHiddenIndices: false, }); expect(IndicesLogic.values).toEqual({ + ...DEFAULT_VALUES, data: { indices: elasticsearchViewIndices, isInitialRequest: true, meta: DEFAULT_META, + returnHiddenIndices: false, }, hasNoIndices: false, indices: elasticsearchViewIndices, @@ -256,9 +365,11 @@ describe('IndicesLogic', () => { ], isInitialRequest: true, meta: DEFAULT_META, + returnHiddenIndices: false, }); expect(IndicesLogic.values).toEqual({ + ...DEFAULT_VALUES, data: { indices: [ { @@ -272,6 +383,7 @@ describe('IndicesLogic', () => { ], isInitialRequest: true, meta: DEFAULT_META, + returnHiddenIndices: false, }, hasNoIndices: false, indices: [ @@ -302,9 +414,11 @@ describe('IndicesLogic', () => { ], isInitialRequest: true, meta: DEFAULT_META, + returnHiddenIndices: false, }); expect(IndicesLogic.values).toEqual({ + ...DEFAULT_VALUES, data: { indices: [ { @@ -314,6 +428,7 @@ describe('IndicesLogic', () => { ], isInitialRequest: true, meta: DEFAULT_META, + returnHiddenIndices: false, }, hasNoIndices: false, indices: [ @@ -343,9 +458,11 @@ describe('IndicesLogic', () => { ], isInitialRequest: true, meta: DEFAULT_META, + returnHiddenIndices: false, }); expect(IndicesLogic.values).toEqual({ + ...DEFAULT_VALUES, data: { indices: [ { @@ -355,6 +472,7 @@ describe('IndicesLogic', () => { ], isInitialRequest: true, meta: DEFAULT_META, + returnHiddenIndices: false, }, hasNoIndices: false, indices: [ @@ -385,9 +503,11 @@ describe('IndicesLogic', () => { ], isInitialRequest: true, meta: DEFAULT_META, + returnHiddenIndices: false, }); expect(IndicesLogic.values).toEqual({ + ...DEFAULT_VALUES, data: { indices: [ { @@ -401,6 +521,7 @@ describe('IndicesLogic', () => { ], isInitialRequest: true, meta: DEFAULT_META, + returnHiddenIndices: false, }, hasNoIndices: false, indices: [ diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/indices_logic.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/indices_logic.ts index 59640a948ddbc..eb09425c1faca 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/indices_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/indices_logic.ts @@ -7,12 +7,23 @@ import { kea, MakeLogicType } from 'kea'; +import { i18n } from '@kbn/i18n'; + import { Meta } from '../../../../../common/types'; import { HttpError, Status } from '../../../../../common/types/api'; import { ElasticsearchIndexWithIngestion } from '../../../../../common/types/indices'; +import { Actions } from '../../../shared/api_logic/create_api_logic'; import { DEFAULT_META } from '../../../shared/constants'; -import { flashAPIErrors, clearFlashMessages } from '../../../shared/flash_messages'; +import { + flashAPIErrors, + clearFlashMessages, + flashSuccessToast, +} from '../../../shared/flash_messages'; import { updateMetaPageIndex } from '../../../shared/table_pagination'; +import { + DeleteIndexApiLogic, + DeleteIndexApiLogicArgs, +} from '../../api/index/delete_index_api_logic'; import { FetchIndicesAPILogic } from '../../api/index/fetch_indices_api_logic'; import { ElasticsearchViewIndex } from '../../types'; import { indexToViewIndex } from '../../utils/indices'; @@ -23,15 +34,25 @@ export interface IndicesActions { indices, isInitialRequest, meta, + returnHiddenIndices, + searchQuery, }: { indices: ElasticsearchIndexWithIngestion[]; isInitialRequest: boolean; meta: Meta; + returnHiddenIndices: boolean; + searchQuery?: string; }): { indices: ElasticsearchIndexWithIngestion[]; isInitialRequest: boolean; meta: Meta; + returnHiddenIndices: boolean; + searchQuery?: string; }; + closeDeleteModal(): void; + deleteError: Actions['apiError']; + deleteIndex: Actions['makeRequest']; + deleteSuccess: Actions['apiSuccess']; fetchIndices({ meta, returnHiddenIndices, @@ -43,34 +64,59 @@ export interface IndicesActions { }): { meta: Meta; returnHiddenIndices: boolean; searchQuery?: string }; makeRequest: typeof FetchIndicesAPILogic.actions.makeRequest; onPaginate(newPageIndex: number): { newPageIndex: number }; - setIsFirstRequest(): boolean; + openDeleteModal(indexName: string): { indexName: string }; + setIsFirstRequest(): void; } export interface IndicesValues { data: typeof FetchIndicesAPILogic.values.data; + deleteModalIndexName: string; hasNoIndices: boolean; indices: ElasticsearchViewIndex[]; + isDeleteModalVisible: boolean; isFirstRequest: boolean; isLoading: boolean; meta: Meta; + searchParams: { meta: Meta; returnHiddenIndices: boolean; searchQuery?: string }; status: typeof FetchIndicesAPILogic.values.status; } export const IndicesLogic = kea>({ actions: { + closeDeleteModal: true, fetchIndices: ({ meta, returnHiddenIndices, searchQuery }) => ({ meta, returnHiddenIndices, searchQuery, }), onPaginate: (newPageIndex) => ({ newPageIndex }), - setIsFirstRequest: () => true, + openDeleteModal: (indexName) => ({ indexName }), + setIsFirstRequest: true, }, connect: { - actions: [FetchIndicesAPILogic, ['makeRequest', 'apiSuccess', 'apiError']], + actions: [ + FetchIndicesAPILogic, + ['makeRequest', 'apiSuccess', 'apiError'], + DeleteIndexApiLogic, + ['apiError as deleteError', 'apiSuccess as deleteSuccess', 'makeRequest as deleteIndex'], + ], values: [FetchIndicesAPILogic, ['data', 'status']], }, - listeners: ({ actions }) => ({ + listeners: ({ actions, values }) => ({ apiError: (e) => flashAPIErrors(e), + deleteError: (e) => flashAPIErrors(e), + deleteSuccess: () => { + flashSuccessToast( + i18n.translate('xpack.enterpriseSearch.content.indices.deleteIndex.successToast.title', { + defaultMessage: + 'Your index {indexName} and any associated connectors or crawlers were successfully deleted', + values: { + indexName: values.deleteModalIndexName, + }, + }) + ); + actions.closeDeleteModal(); + actions.fetchIndices(values.searchParams); + }, fetchIndices: async (input, breakpoint) => { await breakpoint(150); actions.makeRequest(input); @@ -79,6 +125,20 @@ export const IndicesLogic = kea>({ }), path: ['enterprise_search', 'content', 'indices_logic'], reducers: () => ({ + deleteModalIndexName: [ + '', + { + closeDeleteModal: () => '', + openDeleteModal: (_, { indexName }) => indexName, + }, + ], + isDeleteModalVisible: [ + false, + { + closeDeleteModal: () => false, + openDeleteModal: () => true, + }, + ], isFirstRequest: [ true, { @@ -87,11 +147,18 @@ export const IndicesLogic = kea>({ setIsFirstRequest: () => true, }, ], - meta: [ - DEFAULT_META, + searchParams: [ + { meta: DEFAULT_META, returnHiddenIndices: false }, { - apiSuccess: (_, { meta }) => meta, - onPaginate: (state, { newPageIndex }) => updateMetaPageIndex(state, newPageIndex), + apiSuccess: (_, { meta, returnHiddenIndices, searchQuery }) => ({ + meta, + returnHiddenIndices, + searchQuery, + }), + onPaginate: (state, { newPageIndex }) => ({ + ...state, + meta: updateMetaPageIndex(state.meta, newPageIndex), + }), }, ], }), @@ -110,5 +177,6 @@ export const IndicesLogic = kea>({ () => [selectors.status, selectors.isFirstRequest], (status, isFirstRequest) => [Status.LOADING, Status.IDLE].includes(status) && isFirstRequest, ], + meta: [() => [selectors.searchParams], (searchParams) => searchParams.meta], }), }); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/indices_table.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/indices_table.tsx index d68ce14b1b183..0462613b247d8 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/indices_table.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/indices_table.tsx @@ -11,6 +11,7 @@ import { CriteriaWithPagination, EuiBasicTable, EuiBasicTableColumn, + EuiButtonIcon, EuiIcon, EuiText, } from '@elastic/eui'; @@ -37,122 +38,12 @@ const healthColorsMap = { yellow: 'warning', }; -const columns: Array> = [ - { - field: 'name', - name: i18n.translate('xpack.enterpriseSearch.content.searchIndices.name.columnTitle', { - defaultMessage: 'Index name', - }), - render: (name: string) => ( - - {name} - - ), - sortable: true, - truncateText: true, - width: '40%', - }, - { - field: 'health', - name: i18n.translate('xpack.enterpriseSearch.content.searchIndices.health.columnTitle', { - defaultMessage: 'Index health', - }), - render: (health: 'red' | 'green' | 'yellow' | 'unavailable') => ( - - -  {health ?? '-'} - - ), - sortable: true, - truncateText: true, - width: '10%', - }, - { - field: 'count', - name: i18n.translate('xpack.enterpriseSearch.content.searchIndices.docsCount.columnTitle', { - defaultMessage: 'Docs count', - }), - sortable: true, - truncateText: true, - width: '10%', - }, - { - field: 'ingestionMethod', - name: i18n.translate( - 'xpack.enterpriseSearch.content.searchIndices.ingestionMethod.columnTitle', - { - defaultMessage: 'Ingestion method', - } - ), - render: (ingestionMethod: IngestionMethod) => ( - {ingestionMethodToText(ingestionMethod)} - ), - truncateText: true, - width: '10%', - }, - { - name: i18n.translate( - 'xpack.enterpriseSearch.content.searchIndices.ingestionStatus.columnTitle', - { - defaultMessage: 'Ingestion status', - } - ), - render: (index: ElasticsearchViewIndex) => { - const overviewPath = generateEncodedPath(SEARCH_INDEX_PATH, { indexName: index.name }); - if (isCrawlerIndex(index)) { - const label = crawlerStatusToText(index.crawler?.most_recent_crawl_request_status); - - return ( - - ); - } else { - const label = ingestionStatusToText(index.ingestionStatus); - return ( - - ); - } - }, - truncateText: true, - width: '10%', - }, - { - actions: [ - { - render: ({ name }) => ( - - ), - }, - ], - name: i18n.translate('xpack.enterpriseSearch.content.searchIndices.actions.columnTitle', { - defaultMessage: 'Actions', - }), - width: '5%', - }, -]; - interface IndicesTableProps { indices: ElasticsearchViewIndex[]; isLoading?: boolean; meta: Meta; onChange: (criteria: CriteriaWithPagination) => void; + onDelete: (indexName: string) => void; } export const IndicesTable: React.FC = ({ @@ -160,13 +51,141 @@ export const IndicesTable: React.FC = ({ isLoading, meta, onChange, -}) => ( - -); + onDelete, +}) => { + const columns: Array> = [ + { + field: 'name', + name: i18n.translate('xpack.enterpriseSearch.content.searchIndices.name.columnTitle', { + defaultMessage: 'Index name', + }), + render: (name: string) => ( + + {name} + + ), + sortable: true, + truncateText: true, + width: '40%', + }, + { + field: 'health', + name: i18n.translate('xpack.enterpriseSearch.content.searchIndices.health.columnTitle', { + defaultMessage: 'Index health', + }), + render: (health: 'red' | 'green' | 'yellow' | 'unavailable') => ( + + +  {health ?? '-'} + + ), + sortable: true, + truncateText: true, + width: '10%', + }, + { + field: 'count', + name: i18n.translate('xpack.enterpriseSearch.content.searchIndices.docsCount.columnTitle', { + defaultMessage: 'Docs count', + }), + sortable: true, + truncateText: true, + width: '10%', + }, + { + field: 'ingestionMethod', + name: i18n.translate( + 'xpack.enterpriseSearch.content.searchIndices.ingestionMethod.columnTitle', + { + defaultMessage: 'Ingestion method', + } + ), + render: (ingestionMethod: IngestionMethod) => ( + {ingestionMethodToText(ingestionMethod)} + ), + truncateText: true, + width: '10%', + }, + { + name: i18n.translate( + 'xpack.enterpriseSearch.content.searchIndices.ingestionStatus.columnTitle', + { + defaultMessage: 'Ingestion status', + } + ), + render: (index: ElasticsearchViewIndex) => { + const overviewPath = generateEncodedPath(SEARCH_INDEX_PATH, { indexName: index.name }); + if (isCrawlerIndex(index)) { + const label = crawlerStatusToText(index.crawler?.most_recent_crawl_request_status); + + return ( + + ); + } else { + const label = ingestionStatusToText(index.ingestionStatus); + return ( + + ); + } + }, + truncateText: true, + width: '10%', + }, + { + actions: [ + { + render: ({ name }) => ( + + ), + }, + { + render: (index) => + // We don't have a way to delete crawlers yet + isCrawlerIndex(index) ? ( + <> + ) : ( + onDelete(index.name)} + /> + ), + }, + ], + name: i18n.translate('xpack.enterpriseSearch.content.searchIndices.actions.columnTitle', { + defaultMessage: 'Actions', + }), + width: '5%', + }, + ]; + return ( + + ); +}; diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/search_indices.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/search_indices.tsx index 96019c8139c97..bc9aa175e1c71 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/search_indices.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_indices/search_indices.tsx @@ -34,6 +34,7 @@ import { useLocalStorage } from '../../../shared/use_local_storage'; import { NEW_INDEX_PATH } from '../../routes'; import { EnterpriseSearchContentPageTemplate } from '../layout/page_template'; +import { DeleteIndexModal } from './delete_index_modal'; import { IndicesLogic } from './indices_logic'; import { IndicesTable } from './indices_table'; @@ -49,7 +50,7 @@ export const baseBreadcrumbs = [ ]; export const SearchIndices: React.FC = () => { - const { fetchIndices, onPaginate, setIsFirstRequest } = useActions(IndicesLogic); + const { fetchIndices, onPaginate, openDeleteModal, setIsFirstRequest } = useActions(IndicesLogic); const { meta, indices, hasNoIndices, isLoading } = useValues(IndicesLogic); const [showHiddenIndices, setShowHiddenIndices] = useState(false); const [searchQuery, setSearchValue] = useState(''); @@ -85,6 +86,7 @@ export const SearchIndices: React.FC = () => { return ( <> + { - + ) : ( diff --git a/x-pack/plugins/enterprise_search/public/applications/index.test.tsx b/x-pack/plugins/enterprise_search/public/applications/index.test.tsx index c8722adfebbd2..455707779e739 100644 --- a/x-pack/plugins/enterprise_search/public/applications/index.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/index.test.tsx @@ -7,6 +7,7 @@ import React from 'react'; +import { act } from '@testing-library/react'; import { getContext } from 'kea'; import { chartPluginMock } from '@kbn/charts-plugin/public/mocks'; @@ -47,7 +48,7 @@ describe('renderApp', () => { const unmount = renderApp(MockApp, kibanaDeps, pluginData); expect(mockContainer.querySelector('.hello-world')).not.toBeNull(); - unmount(); + act(() => unmount()); expect(mockContainer.innerHTML).toEqual(''); }); @@ -60,20 +61,30 @@ describe('renderApp', () => { }; describe('Enterprise Search apps', () => { - afterEach(() => unmount()); + afterEach(() => { + act(() => { + unmount(); + }); + }); it('renders EnterpriseSearchOverview', () => { - mount(EnterpriseSearchOverview); + act(() => { + mount(EnterpriseSearchOverview); + }); expect(mockContainer.querySelector('.kbnPageTemplate')).not.toBeNull(); }); it('renders AppSearch', () => { - mount(AppSearch); + act(() => { + mount(AppSearch); + }); expect(mockContainer.querySelector('.setupGuide')).not.toBeNull(); }); it('renders WorkplaceSearch', () => { - mount(WorkplaceSearch); + act(() => { + mount(WorkplaceSearch); + }); expect(mockContainer.querySelector('.setupGuide')).not.toBeNull(); }); }); diff --git a/x-pack/plugins/enterprise_search/public/assets/client_libraries/dotnet.svg b/x-pack/plugins/enterprise_search/public/assets/client_libraries/dotnet.svg new file mode 100644 index 0000000000000..30fa56d08bffc --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/assets/client_libraries/dotnet.svg @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/x-pack/plugins/enterprise_search/public/assets/client_libraries/go.svg b/x-pack/plugins/enterprise_search/public/assets/client_libraries/go.svg new file mode 100644 index 0000000000000..5b5fd6e7698af --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/assets/client_libraries/go.svg @@ -0,0 +1,4 @@ + + + + diff --git a/x-pack/plugins/enterprise_search/public/assets/client_libraries/index.ts b/x-pack/plugins/enterprise_search/public/assets/client_libraries/index.ts new file mode 100644 index 0000000000000..0e0e774aa5bba --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/assets/client_libraries/index.ts @@ -0,0 +1,28 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import dotnet from './dotnet.svg'; +import go from './go.svg'; +import java from './java.svg'; +import javascript from './javascript.svg'; +import perl from './perl.svg'; +import php from './php.svg'; +import python from './python.svg'; +import ruby from './ruby.svg'; +import rust from './rust.svg'; + +export const icons = { + dotnet, + go, + java, + javascript, + perl, + php, + python, + ruby, + rust, +}; diff --git a/x-pack/plugins/enterprise_search/public/assets/client_libraries/java.svg b/x-pack/plugins/enterprise_search/public/assets/client_libraries/java.svg new file mode 100644 index 0000000000000..dbe654cdd99cf --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/assets/client_libraries/java.svg @@ -0,0 +1,3 @@ + + + diff --git a/x-pack/plugins/enterprise_search/public/assets/client_libraries/javascript.svg b/x-pack/plugins/enterprise_search/public/assets/client_libraries/javascript.svg new file mode 100644 index 0000000000000..cdb7bd1a03848 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/assets/client_libraries/javascript.svg @@ -0,0 +1,4 @@ + + + + diff --git a/x-pack/plugins/enterprise_search/public/assets/client_libraries/perl.svg b/x-pack/plugins/enterprise_search/public/assets/client_libraries/perl.svg new file mode 100644 index 0000000000000..72a2d21cc297a --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/assets/client_libraries/perl.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/x-pack/plugins/enterprise_search/public/assets/client_libraries/php.svg b/x-pack/plugins/enterprise_search/public/assets/client_libraries/php.svg new file mode 100644 index 0000000000000..b80e9a92c9d5f --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/assets/client_libraries/php.svg @@ -0,0 +1,3 @@ + + + diff --git a/x-pack/plugins/enterprise_search/public/assets/client_libraries/python.svg b/x-pack/plugins/enterprise_search/public/assets/client_libraries/python.svg new file mode 100644 index 0000000000000..b2c778e6355c5 --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/assets/client_libraries/python.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/x-pack/plugins/enterprise_search/public/assets/client_libraries/ruby.svg b/x-pack/plugins/enterprise_search/public/assets/client_libraries/ruby.svg new file mode 100644 index 0000000000000..0af569f1ee7ae --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/assets/client_libraries/ruby.svg @@ -0,0 +1,3 @@ + + + diff --git a/x-pack/plugins/enterprise_search/public/assets/client_libraries/rust.svg b/x-pack/plugins/enterprise_search/public/assets/client_libraries/rust.svg new file mode 100644 index 0000000000000..9cbccb35b2baf --- /dev/null +++ b/x-pack/plugins/enterprise_search/public/assets/client_libraries/rust.svg @@ -0,0 +1,3 @@ + + + diff --git a/x-pack/plugins/enterprise_search/server/index.ts b/x-pack/plugins/enterprise_search/server/index.ts index 41cd17181b68b..3c409c09ff642 100644 --- a/x-pack/plugins/enterprise_search/server/index.ts +++ b/x-pack/plugins/enterprise_search/server/index.ts @@ -42,3 +42,5 @@ export const CONNECTORS_INDEX = '.elastic-connectors'; export const CONNECTORS_JOBS_INDEX = '.elastic-connectors-sync-jobs'; export const CONNECTORS_VERSION = '1'; export const CRAWLERS_INDEX = '.ent-search-actastic-crawler2_configurations'; +export const ANALYTICS_COLLECTIONS_INDEX = '.elastic-analytics-collections'; +export const ANALYTICS_VERSION = '1'; diff --git a/x-pack/plugins/enterprise_search/server/lib/analytics/add_analytics_collection.test.ts b/x-pack/plugins/enterprise_search/server/lib/analytics/add_analytics_collection.test.ts new file mode 100644 index 0000000000000..7f8e8401a37d9 --- /dev/null +++ b/x-pack/plugins/enterprise_search/server/lib/analytics/add_analytics_collection.test.ts @@ -0,0 +1,108 @@ +/* + * Copyright 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 { IScopedClusterClient } from '@kbn/core-elasticsearch-server'; + +import { ANALYTICS_COLLECTIONS_INDEX } from '../..'; +import { ErrorCode } from '../../../common/types/error_codes'; + +import { addAnalyticsCollection } from './add_analytics_collection'; +import { fetchAnalyticsCollectionByName } from './fetch_analytics_collection'; +import { setupAnalyticsCollectionIndex } from './setup_indices'; + +jest.mock('./fetch_analytics_collection', () => ({ fetchAnalyticsCollectionByName: jest.fn() })); +jest.mock('./setup_indices', () => ({ + setupAnalyticsCollectionIndex: jest.fn(), +})); + +describe('add analytics collection lib function', () => { + const mockClient = { + asCurrentUser: { + index: jest.fn(), + indices: { + create: jest.fn(), + exists: jest.fn(), + refresh: jest.fn(), + }, + }, + asInternalUser: {}, + }; + + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('should add analytics collection', async () => { + mockClient.asCurrentUser.index.mockImplementation(() => ({ _id: 'fakeId' })); + mockClient.asCurrentUser.indices.exists.mockImplementation(() => false); + + await expect( + addAnalyticsCollection(mockClient as unknown as IScopedClusterClient, { + name: 'example', + }) + ).resolves.toEqual({ event_retention_day_length: 180, id: 'fakeId', name: 'example' }); + + expect(mockClient.asCurrentUser.index).toHaveBeenCalledWith({ + document: { + event_retention_day_length: 180, + name: 'example', + }, + index: ANALYTICS_COLLECTIONS_INDEX, + }); + }); + + it('should reject if index already exists', async () => { + mockClient.asCurrentUser.index.mockImplementation(() => ({ _id: 'fakeId' })); + (fetchAnalyticsCollectionByName as jest.Mock).mockImplementation(() => true); + + await expect( + addAnalyticsCollection(mockClient as unknown as IScopedClusterClient, { + name: 'index_name', + }) + ).rejects.toEqual(new Error(ErrorCode.ANALYTICS_COLLECTION_ALREADY_EXISTS)); + expect(mockClient.asCurrentUser.index).not.toHaveBeenCalled(); + }); + + it('should create index if no analytics collection index exists', async () => { + mockClient.asCurrentUser.indices.exists.mockImplementation(() => false); + + (fetchAnalyticsCollectionByName as jest.Mock).mockImplementation(() => undefined); + + mockClient.asCurrentUser.index.mockImplementation(() => ({ _id: 'fakeId' })); + + await expect( + addAnalyticsCollection(mockClient as unknown as IScopedClusterClient, { + name: 'example', + }) + ).resolves.toEqual({ event_retention_day_length: 180, id: 'fakeId', name: 'example' }); + + expect(mockClient.asCurrentUser.index).toHaveBeenCalledWith({ + document: { + event_retention_day_length: 180, + name: 'example', + }, + index: ANALYTICS_COLLECTIONS_INDEX, + }); + + expect(setupAnalyticsCollectionIndex).toHaveBeenCalledWith(mockClient.asCurrentUser); + }); + + it('should not create index if status code is not 404', async () => { + mockClient.asCurrentUser.index.mockImplementationOnce(() => { + return Promise.reject({ statusCode: 500 }); + }); + mockClient.asCurrentUser.indices.exists.mockImplementation(() => true); + (fetchAnalyticsCollectionByName as jest.Mock).mockImplementation(() => false); + await expect( + addAnalyticsCollection(mockClient as unknown as IScopedClusterClient, { + name: 'example', + }) + ).rejects.toEqual({ statusCode: 500 }); + expect(setupAnalyticsCollectionIndex).not.toHaveBeenCalled(); + expect(mockClient.asCurrentUser.index).toHaveBeenCalledTimes(1); + }); +}); diff --git a/x-pack/plugins/enterprise_search/server/lib/analytics/add_analytics_collection.ts b/x-pack/plugins/enterprise_search/server/lib/analytics/add_analytics_collection.ts new file mode 100644 index 0000000000000..1cad55a3e884c --- /dev/null +++ b/x-pack/plugins/enterprise_search/server/lib/analytics/add_analytics_collection.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 { IScopedClusterClient } from '@kbn/core/server'; + +import { ANALYTICS_COLLECTIONS_INDEX } from '../..'; +import { AnalyticsCollectionDocument, AnalyticsCollection } from '../../../common/types/analytics'; + +import { ErrorCode } from '../../../common/types/error_codes'; + +import { fetchAnalyticsCollectionByName } from './fetch_analytics_collection'; +import { setupAnalyticsCollectionIndex } from './setup_indices'; + +const createAnalyticsCollection = async ( + client: IScopedClusterClient, + document: AnalyticsCollectionDocument +): Promise => { + const analyticsCollection = await fetchAnalyticsCollectionByName(client, document.name); + + if (analyticsCollection) { + throw new Error(ErrorCode.ANALYTICS_COLLECTION_ALREADY_EXISTS); + } + + // index the document + const result = await client.asCurrentUser.index({ + document, + index: ANALYTICS_COLLECTIONS_INDEX, + }); + + await client.asCurrentUser.indices.refresh({ index: ANALYTICS_COLLECTIONS_INDEX }); + + return { + id: result._id, + ...document, + }; +}; + +export const addAnalyticsCollection = async ( + client: IScopedClusterClient, + input: { name: string } +): Promise => { + const document: AnalyticsCollectionDocument = { + event_retention_day_length: 180, + name: input.name, + }; + + const analyticsCollectionIndexExists = await client.asCurrentUser.indices.exists({ + index: ANALYTICS_COLLECTIONS_INDEX, + }); + + if (!analyticsCollectionIndexExists) { + await setupAnalyticsCollectionIndex(client.asCurrentUser); + } + + return await createAnalyticsCollection(client, document); +}; diff --git a/x-pack/plugins/enterprise_search/server/lib/analytics/fetch_analytics_collection.test.ts b/x-pack/plugins/enterprise_search/server/lib/analytics/fetch_analytics_collection.test.ts new file mode 100644 index 0000000000000..e157df1df16f6 --- /dev/null +++ b/x-pack/plugins/enterprise_search/server/lib/analytics/fetch_analytics_collection.test.ts @@ -0,0 +1,103 @@ +/* + * Copyright 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 { IScopedClusterClient } from '@kbn/core-elasticsearch-server'; + +import { ANALYTICS_COLLECTIONS_INDEX } from '../..'; + +import { fetchAnalyticsCollectionByName } from './fetch_analytics_collection'; +import { setupAnalyticsCollectionIndex } from './setup_indices'; + +jest.mock('./setup_indices', () => ({ + setupAnalyticsCollectionIndex: jest.fn(), +})); + +describe('fetch analytics collection lib function', () => { + const mockClient = { + asCurrentUser: { + search: jest.fn(), + }, + asInternalUser: {}, + }; + + beforeEach(() => { + jest.clearAllMocks(); + }); + + describe('fetch collection by name', () => { + it('should fetch analytics collection by name', async () => { + mockClient.asCurrentUser.search.mockImplementationOnce(() => + Promise.resolve({ hits: { hits: [{ _id: 'fakeId', _source: { name: 'example' } }] } }) + ); + + await expect( + fetchAnalyticsCollectionByName(mockClient as unknown as IScopedClusterClient, 'example') + ).resolves.toEqual({ id: 'fakeId', name: 'example' }); + + expect(mockClient.asCurrentUser.search).toHaveBeenCalledWith({ + index: ANALYTICS_COLLECTIONS_INDEX, + query: { + term: { + name: 'example', + }, + }, + }); + }); + + it('should call setup analytics collection index on index not found error', async () => { + mockClient.asCurrentUser.search.mockImplementationOnce(() => + Promise.reject({ + meta: { + body: { + error: { type: 'index_not_found_exception' }, + }, + }, + }) + ); + await expect( + fetchAnalyticsCollectionByName(mockClient as unknown as IScopedClusterClient, 'example') + ).resolves.toEqual(undefined); + expect(mockClient.asCurrentUser.search).toHaveBeenCalledWith({ + index: ANALYTICS_COLLECTIONS_INDEX, + query: { + term: { + name: 'example', + }, + }, + }); + expect(setupAnalyticsCollectionIndex as jest.Mock).toHaveBeenCalledWith( + mockClient.asCurrentUser + ); + }); + + it('should not call setup connectors on other errors', async () => { + mockClient.asCurrentUser.search.mockImplementationOnce(() => + Promise.reject({ + meta: { + body: { + error: { + type: 'other error', + }, + }, + }, + }) + ); + await expect(fetchAnalyticsCollectionByName(mockClient as any, 'example')).resolves.toEqual( + undefined + ); + expect(mockClient.asCurrentUser.search).toHaveBeenCalledWith({ + index: ANALYTICS_COLLECTIONS_INDEX, + query: { + term: { + name: 'example', + }, + }, + }); + expect(setupAnalyticsCollectionIndex as jest.Mock).not.toHaveBeenCalled(); + }); + }); +}); diff --git a/x-pack/plugins/enterprise_search/server/lib/analytics/fetch_analytics_collection.ts b/x-pack/plugins/enterprise_search/server/lib/analytics/fetch_analytics_collection.ts new file mode 100644 index 0000000000000..46f718d23976d --- /dev/null +++ b/x-pack/plugins/enterprise_search/server/lib/analytics/fetch_analytics_collection.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { IScopedClusterClient } from '@kbn/core-elasticsearch-server'; + +import { ANALYTICS_COLLECTIONS_INDEX } from '../..'; +import { AnalyticsCollection } from '../../../common/types/analytics'; + +import { isIndexNotFoundException } from '../../utils/identify_exceptions'; + +import { setupAnalyticsCollectionIndex } from './setup_indices'; + +export const fetchAnalyticsCollectionByName = async ( + client: IScopedClusterClient, + name: string +): Promise => { + try { + const searchResults = await client.asCurrentUser.search({ + index: ANALYTICS_COLLECTIONS_INDEX, + query: { term: { name } }, + }); + + const result = searchResults.hits.hits[0]?._source + ? { ...searchResults.hits.hits[0]._source, id: searchResults.hits.hits[0]._id } + : undefined; + + return result; + } catch (error) { + if (isIndexNotFoundException(error)) { + await setupAnalyticsCollectionIndex(client.asCurrentUser); + } + return undefined; + } +}; diff --git a/x-pack/plugins/enterprise_search/server/lib/analytics/setup_indices.test.ts b/x-pack/plugins/enterprise_search/server/lib/analytics/setup_indices.test.ts new file mode 100644 index 0000000000000..ec72d7562b44e --- /dev/null +++ b/x-pack/plugins/enterprise_search/server/lib/analytics/setup_indices.test.ts @@ -0,0 +1,77 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { ANALYTICS_VERSION } from '../..'; + +import { setupAnalyticsCollectionIndex } from './setup_indices'; + +describe('setup analytics collection index', () => { + const mockClient = { + asCurrentUser: { + indices: { + create: jest.fn(), + updateAliases: jest.fn(), + }, + }, + asInternalUser: {}, + }; + + beforeEach(() => { + jest.clearAllMocks(); + }); + + it("should create the analytics collection index when it doesn't exist", async () => { + const indexName = '.elastic-analytics-collections'; + const analyticCollectionsMappings = { + _meta: { + version: ANALYTICS_VERSION, + }, + properties: { + event_retention_day_length: { + type: 'long', + }, + name: { + type: 'keyword', + }, + }, + }; + + mockClient.asCurrentUser.indices.create.mockImplementation(() => Promise.resolve()); + mockClient.asCurrentUser.indices.updateAliases.mockImplementation(() => Promise.resolve()); + await expect(setupAnalyticsCollectionIndex(mockClient.asCurrentUser as any)).resolves.toEqual( + undefined + ); + expect(mockClient.asCurrentUser.indices.create).toHaveBeenCalledWith({ + index: `${indexName}-v${1}`, + mappings: analyticCollectionsMappings, + settings: { auto_expand_replicas: '0-3', hidden: true, number_of_replicas: 0 }, + }); + expect(mockClient.asCurrentUser.indices.updateAliases).toHaveBeenCalledWith({ + actions: [ + { + add: { + aliases: [indexName], + index: `${indexName}-v${1}`, + is_hidden: true, + is_write_index: true, + }, + }, + ], + }); + }); + + it('should do nothing if it hits that resource already exists', async () => { + mockClient.asCurrentUser.indices.create.mockImplementation(() => + Promise.reject({ meta: { body: { error: { type: 'resource_already_exists_exception' } } } }) + ); + await expect(setupAnalyticsCollectionIndex(mockClient.asCurrentUser as any)).resolves.toEqual( + undefined + ); + expect(mockClient.asCurrentUser.indices.updateAliases).not.toHaveBeenCalled(); + expect(mockClient.asCurrentUser.indices.create).toHaveBeenCalled(); + }); +}); diff --git a/x-pack/plugins/enterprise_search/server/lib/analytics/setup_indices.ts b/x-pack/plugins/enterprise_search/server/lib/analytics/setup_indices.ts new file mode 100644 index 0000000000000..49a8aaca6f50f --- /dev/null +++ b/x-pack/plugins/enterprise_search/server/lib/analytics/setup_indices.ts @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { + IndicesIndexSettings, + MappingProperty, + MappingTypeMapping, +} from '@elastic/elasticsearch/lib/api/types'; +import { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; + +import { ANALYTICS_COLLECTIONS_INDEX, ANALYTICS_VERSION } from '../..'; +import { isResourceAlreadyExistsException } from '../../utils/identify_exceptions'; + +const analyticsCollectionMappingsProperties: Record = { + event_retention_day_length: { + type: 'long', + }, + name: { + type: 'keyword', + }, +}; + +const defaultSettings: IndicesIndexSettings = { + auto_expand_replicas: '0-3', + hidden: true, + number_of_replicas: 0, +}; + +interface IndexDefinition { + aliases: string[]; + mappings: MappingTypeMapping; + name: string; + settings: IndicesIndexSettings; +} + +export const setupAnalyticsCollectionIndex = async (client: ElasticsearchClient) => { + const indexConfiguration: IndexDefinition = { + aliases: [ANALYTICS_COLLECTIONS_INDEX], + mappings: { + _meta: { + version: ANALYTICS_VERSION, + }, + properties: analyticsCollectionMappingsProperties, + }, + name: `${ANALYTICS_COLLECTIONS_INDEX}-v${ANALYTICS_VERSION}`, + settings: defaultSettings, + }; + + try { + const { mappings, aliases, name: index, settings } = indexConfiguration; + await client.indices.create({ + index, + mappings, + settings, + }); + await client.indices.updateAliases({ + actions: [ + { + add: { + aliases, + index, + is_hidden: true, + is_write_index: true, + }, + }, + ], + }); + } catch (error) { + if (isResourceAlreadyExistsException(error)) { + // index already exists, swallow error + return; + } + return error; + } +}; diff --git a/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.test.ts b/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.test.ts index ac20e09284185..adb99b98a4226 100644 --- a/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.test.ts +++ b/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.test.ts @@ -40,13 +40,20 @@ describe('addConnector lib function', () => { asInternalUser: {}, }; + const createConnectorsIndexExistsFn = + (connectorsIndexExists: boolean, defaultValue: boolean) => + ({ index }: { index: string }) => + index === CONNECTORS_INDEX ? connectorsIndexExists : defaultValue; + beforeEach(() => { jest.clearAllMocks(); }); it('should add connector', async () => { mockClient.asCurrentUser.index.mockImplementation(() => ({ _id: 'fakeId' })); - mockClient.asCurrentUser.indices.exists.mockImplementation(() => false); + mockClient.asCurrentUser.indices.exists.mockImplementation( + createConnectorsIndexExistsFn(true, false) + ); (fetchConnectorByIndexName as jest.Mock).mockImplementation(() => undefined); (fetchCrawlerByIndexName as jest.Mock).mockImplementation(() => undefined); @@ -82,7 +89,9 @@ describe('addConnector lib function', () => { it('should reject if index already exists', async () => { mockClient.asCurrentUser.index.mockImplementation(() => ({ _id: 'fakeId' })); - mockClient.asCurrentUser.indices.exists.mockImplementation(() => true); + mockClient.asCurrentUser.indices.exists.mockImplementation( + createConnectorsIndexExistsFn(true, true) + ); (fetchConnectorByIndexName as jest.Mock).mockImplementation(() => undefined); (fetchCrawlerByIndexName as jest.Mock).mockImplementation(() => undefined); @@ -97,7 +106,9 @@ describe('addConnector lib function', () => { it('should reject if connector already exists', async () => { mockClient.asCurrentUser.index.mockImplementation(() => ({ _id: 'fakeId' })); - mockClient.asCurrentUser.indices.exists.mockImplementation(() => false); + mockClient.asCurrentUser.indices.exists.mockImplementation( + createConnectorsIndexExistsFn(true, false) + ); (fetchConnectorByIndexName as jest.Mock).mockImplementation(() => true); (fetchCrawlerByIndexName as jest.Mock).mockImplementation(() => undefined); @@ -110,9 +121,28 @@ describe('addConnector lib function', () => { expect(mockClient.asCurrentUser.indices.create).not.toHaveBeenCalled(); }); + it('should reject if crawler already exists', async () => { + mockClient.asCurrentUser.index.mockImplementation(() => ({ _id: 'fakeId' })); + mockClient.asCurrentUser.indices.exists.mockImplementation( + createConnectorsIndexExistsFn(true, false) + ); + (fetchConnectorByIndexName as jest.Mock).mockImplementation(() => undefined); + (fetchCrawlerByIndexName as jest.Mock).mockImplementation(() => true); + + await expect( + addConnector(mockClient as unknown as IScopedClusterClient, { + index_name: 'index_name', + language: 'en', + }) + ).rejects.toEqual(new Error(ErrorCode.CRAWLER_ALREADY_EXISTS)); + expect(mockClient.asCurrentUser.indices.create).not.toHaveBeenCalled(); + }); + it('should reject with index already exists if connector and index already exist', async () => { mockClient.asCurrentUser.index.mockImplementation(() => ({ _id: 'fakeId' })); - mockClient.asCurrentUser.indices.exists.mockImplementation(() => true); + mockClient.asCurrentUser.indices.exists.mockImplementation( + createConnectorsIndexExistsFn(true, true) + ); (fetchConnectorByIndexName as jest.Mock).mockImplementation(() => true); (fetchCrawlerByIndexName as jest.Mock).mockImplementation(() => undefined); @@ -127,7 +157,9 @@ describe('addConnector lib function', () => { it('should replace connector if deleteExistingConnector flag is true', async () => { mockClient.asCurrentUser.index.mockImplementation(() => ({ _id: 'fakeId' })); - mockClient.asCurrentUser.indices.exists.mockImplementation(() => false); + mockClient.asCurrentUser.indices.exists.mockImplementation( + createConnectorsIndexExistsFn(true, false) + ); (fetchConnectorByIndexName as jest.Mock).mockImplementation(() => ({ id: 'connectorId' })); (fetchCrawlerByIndexName as jest.Mock).mockImplementation(() => undefined); @@ -167,13 +199,9 @@ describe('addConnector lib function', () => { }); it('should create index if no connectors index exists', async () => { - mockClient.asCurrentUser.index.mockImplementationOnce(() => { - return Promise.reject({ - meta: { body: { error: { type: 'index_not_found_exception' } } }, - statusCode: 404, - }); - }); - mockClient.asCurrentUser.indices.exists.mockImplementation(() => false); + mockClient.asCurrentUser.indices.exists.mockImplementation( + createConnectorsIndexExistsFn(false, false) + ); (fetchConnectorByIndexName as jest.Mock).mockImplementation(() => false); (fetchCrawlerByIndexName as jest.Mock).mockImplementation(() => undefined); await expect( @@ -206,36 +234,4 @@ describe('addConnector lib function', () => { settings: textAnalysisSettings('en'), }); }); - it('should not create index if status code is not 404', async () => { - mockClient.asCurrentUser.index.mockImplementationOnce(() => { - return Promise.reject({ statusCode: 500 }); - }); - mockClient.asCurrentUser.indices.exists.mockImplementation(() => false); - (fetchConnectorByIndexName as jest.Mock).mockImplementation(() => false); - (fetchCrawlerByIndexName as jest.Mock).mockImplementation(() => undefined); - await expect( - addConnector(mockClient as unknown as IScopedClusterClient, { - index_name: 'index_name', - language: 'en', - }) - ).rejects.toEqual({ statusCode: 500 }); - expect(setupConnectorsIndices).not.toHaveBeenCalled(); - expect(mockClient.asCurrentUser.index).toHaveBeenCalledTimes(1); - }); - it('should not create index if crawler exists', async () => { - mockClient.asCurrentUser.index.mockImplementationOnce(() => { - return 'connector '; - }); - mockClient.asCurrentUser.indices.exists.mockImplementation(() => false); - (fetchConnectorByIndexName as jest.Mock).mockImplementation(() => false); - (fetchCrawlerByIndexName as jest.Mock).mockImplementation(() => 'crawler'); - await expect( - addConnector(mockClient as unknown as IScopedClusterClient, { - index_name: 'index_name', - language: 'en', - }) - ).rejects.toEqual(new Error(ErrorCode.CRAWLER_ALREADY_EXISTS)); - expect(setupConnectorsIndices).not.toHaveBeenCalled(); - expect(mockClient.asCurrentUser.index).not.toHaveBeenCalled(); - }); }); diff --git a/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.ts b/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.ts index 8528b28582bf0..39a9d562106d0 100644 --- a/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.ts +++ b/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.ts @@ -11,7 +11,6 @@ import { CONNECTORS_INDEX } from '../..'; import { ConnectorDocument, ConnectorStatus } from '../../../common/types/connectors'; import { ErrorCode } from '../../../common/types/error_codes'; import { setupConnectorsIndices } from '../../index_management/setup_indices'; -import { isIndexNotFoundException } from '../../utils/identify_exceptions'; import { fetchCrawlerByIndexName } from '../crawler/fetch_crawlers'; import { textAnalysisSettings } from '../indices/text_analysis'; @@ -80,21 +79,11 @@ export const addConnector = async ( status: ConnectorStatus.CREATED, sync_now: false, }; - try { - return await createConnector( - document, - client, - input.language, - !!input.delete_existing_connector - ); - } catch (error) { - if (isIndexNotFoundException(error)) { - // This means .ent-search-connectors index doesn't exist yet - // So we first have to create it, and then try inserting the document again - await setupConnectorsIndices(client.asCurrentUser); - return await createConnector(document, client, input.language, false); - } else { - throw error; - } + const connectorsIndexExists = await client.asCurrentUser.indices.exists({ + index: CONNECTORS_INDEX, + }); + if (!connectorsIndexExists) { + await setupConnectorsIndices(client.asCurrentUser); } + return await createConnector(document, client, input.language, !!input.delete_existing_connector); }; diff --git a/x-pack/plugins/enterprise_search/server/plugin.ts b/x-pack/plugins/enterprise_search/server/plugin.ts index cfc3d8d196fd9..f9d23af141119 100644 --- a/x-pack/plugins/enterprise_search/server/plugin.ts +++ b/x-pack/plugins/enterprise_search/server/plugin.ts @@ -46,6 +46,7 @@ import { import { registerAppSearchRoutes } from './routes/app_search'; import { registerEnterpriseSearchRoutes } from './routes/enterprise_search'; +import { registerAnalyticsRoutes } from './routes/enterprise_search/analytics'; import { registerConfigDataRoute } from './routes/enterprise_search/config_data'; import { registerConnectorRoutes } from './routes/enterprise_search/connectors'; import { registerCrawlerRoutes } from './routes/enterprise_search/crawler/crawler'; @@ -168,6 +169,7 @@ export class EnterpriseSearchPlugin implements Plugin { // Enterprise Search Routes registerConnectorRoutes(dependencies); registerCrawlerRoutes(dependencies); + registerAnalyticsRoutes(dependencies); getStartServices().then(([, { security: securityStart }]) => { registerCreateAPIKeyRoute(dependencies, securityStart); diff --git a/x-pack/plugins/enterprise_search/server/routes/enterprise_search/analytics.ts b/x-pack/plugins/enterprise_search/server/routes/enterprise_search/analytics.ts new file mode 100644 index 0000000000000..be53b797239a1 --- /dev/null +++ b/x-pack/plugins/enterprise_search/server/routes/enterprise_search/analytics.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 { schema } from '@kbn/config-schema'; + +import { i18n } from '@kbn/i18n'; + +import { ErrorCode } from '../../../common/types/error_codes'; +import { addAnalyticsCollection } from '../../lib/analytics/add_analytics_collection'; +import { RouteDependencies } from '../../plugin'; +import { createError } from '../../utils/create_error'; +import { elasticsearchErrorHandler } from '../../utils/elasticsearch_error_handler'; + +export function registerAnalyticsRoutes({ router, log }: RouteDependencies) { + router.post( + { + path: '/internal/enterprise_search/analytics/collections', + validate: { + body: schema.object({ + name: schema.string(), + }), + }, + }, + elasticsearchErrorHandler(log, async (context, request, response) => { + const { client } = (await context.core).elasticsearch; + try { + const body = await addAnalyticsCollection(client, request.body); + return response.ok({ body }); + } catch (error) { + if ((error as Error).message === ErrorCode.ANALYTICS_COLLECTION_ALREADY_EXISTS) { + return createError({ + errorCode: (error as Error).message as ErrorCode, + message: i18n.translate( + 'xpack.enterpriseSearch.server.routes.addAnalyticsCollection.analyticsCollectionExistsError', + { + defaultMessage: 'Analytics collection already exists', + } + ), + response, + statusCode: 409, + }); + } + throw error; + } + }) + ); +} diff --git a/x-pack/plugins/enterprise_search/server/routes/enterprise_search/indices.ts b/x-pack/plugins/enterprise_search/server/routes/enterprise_search/indices.ts index 5d5f72c297727..6741721053b86 100644 --- a/x-pack/plugins/enterprise_search/server/routes/enterprise_search/indices.ts +++ b/x-pack/plugins/enterprise_search/server/routes/enterprise_search/indices.ts @@ -9,6 +9,7 @@ import { schema } from '@kbn/config-schema'; import { i18n } from '@kbn/i18n'; import { ErrorCode } from '../../../common/types/error_codes'; +import { deleteConnectorById } from '../../lib/connectors/delete_connector'; import { fetchConnectorByIndexName, fetchConnectors } from '../../lib/connectors/fetch_connectors'; import { fetchCrawlerByIndexName, fetchCrawlers } from '../../lib/crawler/fetch_crawlers'; @@ -124,6 +125,52 @@ export function registerIndexRoutes({ router, log }: RouteDependencies) { }) ); + router.delete( + { + path: '/internal/enterprise_search/indices/{indexName}', + validate: { + params: schema.object({ + indexName: schema.string(), + }), + }, + }, + elasticsearchErrorHandler(log, async (context, request, response) => { + const indexName = decodeURIComponent(request.params.indexName); + const { client } = (await context.core).elasticsearch; + + try { + const connector = await fetchConnectorByIndexName(client, indexName); + const crawler = await fetchCrawlerByIndexName(client, indexName); + + if (connector) { + await deleteConnectorById(client, connector.id); + } + + if (crawler) { + // do nothing for now because we don't have a way to delete a crawler yet + } + + await client.asCurrentUser.indices.delete({ index: indexName }); + + return response.ok({ + body: {}, + headers: { 'content-type': 'application/json' }, + }); + } catch (error) { + if (isIndexNotFoundException(error)) { + return createError({ + errorCode: ErrorCode.INDEX_NOT_FOUND, + message: 'Could not find index', + response, + statusCode: 404, + }); + } + + throw error; + } + }) + ); + router.get( { path: '/internal/enterprise_search/indices/{indexName}/exists', diff --git a/x-pack/plugins/event_log/scripts/create_schemas.js b/x-pack/plugins/event_log/scripts/create_schemas.js index 1a775b44add8d..dc4eeb01c8957 100755 --- a/x-pack/plugins/event_log/scripts/create_schemas.js +++ b/x-pack/plugins/event_log/scripts/create_schemas.js @@ -9,7 +9,7 @@ const fs = require('fs'); const path = require('path'); -const { set } = require('@elastic/safer-lodash-set'); +const { set } = require('@kbn/safer-lodash-set'); const lodash = require('lodash'); const LineWriter = require('./lib/line_writer'); diff --git a/x-pack/plugins/files/common/types.ts b/x-pack/plugins/files/common/types.ts index 2fef7ab3f17c4..d3c8795fc7321 100644 --- a/x-pack/plugins/files/common/types.ts +++ b/x-pack/plugins/files/common/types.ts @@ -332,7 +332,16 @@ export interface FileUnshareOptions { * A class with set of properties and behaviors of the "smart" file object and adds * behaviours for interacting with files on top of the pure data. */ -export interface File extends FileJSON { +export interface File { + /** + * The file ID + */ + id: string; + + /** + * File metadata in camelCase form. + */ + data: FileJSON; /** * Update a file object's metadatathat can be updated. * @@ -345,7 +354,7 @@ export interface File extends FileJSON { * * @param content - The content to stream to storage. */ - uploadContent(content: Readable): Promise; + uploadContent(content: Readable): Promise>; /** * Stream file content from storage. diff --git a/x-pack/plugins/files/server/file/file.test.ts b/x-pack/plugins/files/server/file/file.test.ts index ebb1efe32422c..1b86af89ba61c 100644 --- a/x-pack/plugins/files/server/file/file.test.ts +++ b/x-pack/plugins/files/server/file/file.test.ts @@ -82,4 +82,14 @@ describe('File', () => { await setImmediate(); expect(blobStoreSpy.calledOnce).toBe(true); }); + + it('updates file data after upload', async () => { + const fileSO = { attributes: { Status: 'AWAITING_UPLOAD' } }; + (soClient.create as jest.Mock).mockResolvedValue(fileSO); + (soClient.update as jest.Mock).mockResolvedValue(fileSO); + + const file = await fileService.createFile({ name: 'test', fileKind }); + await file.uploadContent(Readable.from(['test'])); + expect(file.data.status).toBe('READY'); + }); }); diff --git a/x-pack/plugins/files/server/file/file.ts b/x-pack/plugins/files/server/file/file.ts index 00544a7e14f08..bdf85af1bec0e 100644 --- a/x-pack/plugins/files/server/file/file.ts +++ b/x-pack/plugins/files/server/file/file.ts @@ -6,27 +6,11 @@ */ import { Logger } from '@kbn/core/server'; -import mimeType from 'mime'; import { Readable } from 'stream'; -import type { FileCompression, FileShareJSON, FileShareJSONWithToken } from '../../common/types'; -import type { - File as IFile, - FileKind, - FileMetadata, - FileStatus, - UpdatableFileMetadata, - FileJSON, -} from '../../common'; -import { - fileAttributesReducer, - Action, - createDefaultFileAttributes, -} from './file_attributes_reducer'; -import { createAuditEvent } from '../audit_events'; -import { InternalFileService } from '../file_service/internal_file_service'; -import { InternalFileShareService } from '../file_share_service'; +import type { FileShareJSON, FileShareJSONWithToken } from '../../common/types'; +import type { File as IFile, UpdatableFileMetadata, FileJSON } from '../../common'; +import { fileAttributesReducer, Action } from './file_attributes_reducer'; import type { FileClientImpl } from '../file_client/file_client'; -import { toJSON } from './to_json'; import { AlreadyDeletedError, ContentAlreadyUploadedError, @@ -35,46 +19,37 @@ import { } from './errors'; /** - * Public class that provides all data and functionality consumers will need at the - * individual file level + * Scopes file actions to an ID and set of attributes. * - * @note Instantiation should not happen outside of this plugin + * Also exposes the upload and download functionality. */ export class File implements IFile { - private readonly logAuditEvent: InternalFileService['writeAuditLog']; - constructor( public readonly id: string, - private fileMetadata: FileMetadata, + private metadata: FileJSON, private readonly fileClient: FileClientImpl, - private readonly internalFileService: InternalFileService, - private readonly fileShareService: InternalFileShareService, private readonly logger: Logger - ) { - this.logAuditEvent = this.internalFileService.writeAuditLog.bind(this.internalFileService); - } + ) {} - private async updateFileState(action: Action) { - const { metadata } = await this.fileClient.update({ - id: this.id, - metadata: fileAttributesReducer(this.metadata, action), - }); - this.fileMetadata = metadata; + private async updateFileState(action: Action): Promise { + const metadata = fileAttributesReducer(this.data, action); + await this.fileClient.internalUpdate(this.id, metadata); + this.data = metadata as FileJSON; } private isReady(): boolean { - return this.status === 'READY'; + return this.data.status === 'READY'; } private isDeleted(): boolean { - return this.status === 'DELETED'; + return this.data.status === 'DELETED'; } private uploadInProgress(): boolean { - return this.status === 'UPLOADING'; + return this.data.status === 'UPLOADING'; } - public async update(attrs: Partial): Promise { + public async update(attrs: Partial): Promise> { await this.updateFileState({ action: 'updateFile', payload: attrs, @@ -82,14 +57,14 @@ export class File implements IFile { return this; } - public async uploadContent(content: Readable): Promise { + public async uploadContent(content: Readable): Promise> { if (this.uploadInProgress()) { throw new UploadInProgressError('Upload already in progress.'); } if (this.isReady()) { throw new ContentAlreadyUploadedError('Already uploaded file content.'); } - this.logger.debug(`Uploading file [id = ${this.id}][name = ${this.name}].`); + this.logger.debug(`Uploading file [id = ${this.id}][name = ${this.data.name}].`); await this.updateFileState({ action: 'uploading', }); @@ -100,6 +75,7 @@ export class File implements IFile { action: 'uploaded', payload: { size }, }); + return this; } catch (e) { await this.updateFileState({ action: 'uploadError' }); this.fileClient.deleteContent(this.id).catch(() => {}); // Best effort to remove any uploaded content @@ -108,7 +84,7 @@ export class File implements IFile { } public downloadContent(): Promise { - const { size } = this.metadata; + const { size } = this.data; if (!this.isReady()) { throw new NoDownloadAvailableError('This file content is not available for download.'); } @@ -126,142 +102,38 @@ export class File implements IFile { await this.updateFileState({ action: 'delete', }); - // Stop sharing this file - await this.fileShareService.deleteForFile({ file: this }); await this.fileClient.delete({ id: this.id, hasContent: this.isReady() }); - this.logAuditEvent( - createAuditEvent({ - action: 'delete', - outcome: 'success', - message: `Deleted file "${this.name}" of kind "${this.fileKind}" with id "${this.id}"`, - }) - ); } public async share({ name, validUntil, }: { - name?: string; + name: string; validUntil?: number; }): Promise { - const shareObject = await this.fileShareService.share({ file: this, name, validUntil }); - this.internalFileService.writeAuditLog( - createAuditEvent({ - action: 'create', - message: `Shared file "${this.name}" with id "${this.id}"`, - }) - ); - return shareObject; + return this.fileClient.share({ name, validUntil, file: this }); } async listShares(): Promise { - const { shares } = await this.fileShareService.list({ fileId: this.id }); + const { shares } = await this.fileClient.listShares({ + fileId: this.id, + }); return shares; } async unshare(opts: { shareId: string }): Promise { - await this.fileShareService.delete({ id: opts.shareId }); - this.internalFileService.writeAuditLog( - createAuditEvent({ - action: 'delete', - message: `Removed share for "${this.name}" with id "${this.id}"`, - }) - ); + await this.fileClient.unshare({ id: opts.shareId }); } public toJSON(): FileJSON { - return toJSON(this.id, this.metadata); - } - - private get metadata(): FileMetadata { - return this.fileMetadata; - } - - public get created(): string { - return this.metadata.created; - } - - public get updated(): string { - return this.metadata.Updated; - } - - public get chunkSize(): number | undefined { - return this.metadata.ChunkSize; - } - - public get fileKind(): string { - return this.fileClient.fileKind; - } - - public get name(): string { - return this.metadata.name; + return this.data; } - public get status(): FileStatus { - return this.metadata.Status; + public get data(): FileJSON { + return this.metadata; } - - public get compression(): undefined | FileCompression { - return this.metadata.Compression; - } - - public get size(): undefined | number { - return this.metadata.size; - } - - public get meta(): M { - return this.metadata.Meta as M; - } - - public get alt(): undefined | string { - return this.metadata.Alt; - } - - public get mimeType(): undefined | string { - return this.metadata.mime_type; - } - - public get extension(): undefined | string { - return this.metadata.extension; - } - - /** - * Static method for creating files so that we can keep all of the audit logging for files - * in the same place. - */ - public static async create( - { - name, - fileKind, - alt, - meta, - mime, - }: { name: string; fileKind: FileKind; alt?: string; meta?: unknown; mime?: string }, - internalFileService: InternalFileService, - fileClient: FileClientImpl - ) { - const fileMeta = await fileClient.create({ - metadata: { - ...createDefaultFileAttributes(), - name, - mime_type: mime, - Alt: alt, - Meta: meta, - FileKind: fileKind.id, - extension: (mime && mimeType.getExtension(mime)) ?? undefined, - }, - }); - - const file = internalFileService.toFile(fileMeta.id, fileMeta.metadata, fileKind, fileClient); - - internalFileService.writeAuditLog( - createAuditEvent({ - action: 'create', - message: `Created file "${file.name}" of kind "${file.fileKind}" and id "${file.id}"`, - }) - ); - - return file; + private set data(v: FileJSON) { + this.metadata = v; } } diff --git a/x-pack/plugins/files/server/file/file_attributes_reducer.ts b/x-pack/plugins/files/server/file/file_attributes_reducer.ts index 93bf2f74545d9..fdb2768408af5 100644 --- a/x-pack/plugins/files/server/file/file_attributes_reducer.ts +++ b/x-pack/plugins/files/server/file/file_attributes_reducer.ts @@ -4,8 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import moment from 'moment'; -import { FileMetadata, UpdatableFileMetadata } from '../../common'; +import { FileJSON, UpdatableFileMetadata } from '../../common'; export type Action = | { @@ -20,51 +19,32 @@ export type Action = | { action: 'uploadError'; payload?: undefined } | { action: 'updateFile'; payload: Partial }; -export function createDefaultFileAttributes(): Pick< - FileMetadata, - 'created' | 'Updated' | 'Status' -> { - const dateString = new Date().toISOString(); - return { - created: dateString, - Status: 'AWAITING_UPLOAD', - Updated: dateString, - }; -} - -export function fileAttributesReducer( - state: FileMetadata, - { action, payload }: Action -): FileMetadata { +export function fileAttributesReducer(state: FileJSON, { action, payload }: Action): FileJSON { switch (action) { case 'delete': - return { ...state, Status: 'DELETED' }; + return { ...state, status: 'DELETED' }; case 'uploading': return { ...state, - Status: 'UPLOADING', - Updated: moment().toISOString(), + status: 'UPLOADING', }; case 'uploaded': return { ...state, ...payload, - Status: 'READY', - Updated: moment().toISOString(), + status: 'READY', }; case 'uploadError': return { ...state, - Status: 'UPLOAD_ERROR', - Updated: moment().toISOString(), + status: 'UPLOAD_ERROR', }; case 'updateFile': return { ...state, name: payload.name ?? state.name, - Alt: payload.alt ?? state.Alt, - Meta: payload.meta ?? state.Meta, - Updated: moment().toISOString(), + alt: payload.alt ?? state.alt, + meta: payload.meta ?? state.meta, }; default: return state; diff --git a/x-pack/plugins/files/server/file/index.ts b/x-pack/plugins/files/server/file/index.ts index 02740d7eaab6d..2b584945cb71f 100644 --- a/x-pack/plugins/files/server/file/index.ts +++ b/x-pack/plugins/files/server/file/index.ts @@ -9,6 +9,6 @@ import * as fileErrors from './errors'; export { File } from './file'; export { toJSON } from './to_json'; -export { createDefaultFileAttributes, fileAttributesReducer } from './file_attributes_reducer'; +export { fileAttributesReducer } from './file_attributes_reducer'; export type { Action } from './file_attributes_reducer'; export { fileErrors }; diff --git a/x-pack/plugins/files/server/file/to_json.ts b/x-pack/plugins/files/server/file/to_json.ts index 390aa1672e06e..98096940fe75f 100644 --- a/x-pack/plugins/files/server/file/to_json.ts +++ b/x-pack/plugins/files/server/file/to_json.ts @@ -5,8 +5,28 @@ * 2.0. */ +import { pickBy } from 'lodash'; import type { FileMetadata, FileJSON } from '../../common/types'; +export function serializeJSON(attrs: Partial): Partial { + const { name, mimeType, size, created, updated, fileKind, status, alt, extension, meta } = attrs; + return pickBy( + { + name, + mime_type: mimeType, + size, + created, + extension, + Alt: alt, + Status: status, + Meta: meta as M, + Updated: updated, + FileKind: fileKind, + }, + (v) => v != null + ); +} + export function toJSON(id: string, attrs: FileMetadata): FileJSON { const { name, @@ -20,17 +40,20 @@ export function toJSON(id: string, attrs: FileMetadata): FileJSON>( + { + id, + name, + mimeType, + size, + created, + extension, + alt: Alt, + status: Status, + meta: Meta as M, + updated: Updated, + fileKind: FileKind, + }, + (v) => v != null + ) as FileJSON; } diff --git a/x-pack/plugins/files/server/file_client/create_es_file_client.ts b/x-pack/plugins/files/server/file_client/create_es_file_client.ts index 2ffb9bd458c6d..9f453a6a25bfc 100644 --- a/x-pack/plugins/files/server/file_client/create_es_file_client.ts +++ b/x-pack/plugins/files/server/file_client/create_es_file_client.ts @@ -7,7 +7,8 @@ import type { Logger, ElasticsearchClient } from '@kbn/core/server'; import { ElasticsearchBlobStorageClient } from '../blob_storage_service'; -import { FileClientImpl, FileClient } from './file_client'; +import { FileClientImpl } from './file_client'; +import type { FileClient } from './types'; import { EsIndexFilesMetadataClient } from './file_metadata_client'; const NO_FILE_KIND = 'none'; @@ -55,6 +56,9 @@ export function createEsFileClient(arg: CreateEsFileClientArgs): FileClient { maxSizeBytes, }, new EsIndexFilesMetadataClient(metadataIndex, elasticsearchClient, logger), - new ElasticsearchBlobStorageClient(elasticsearchClient, blobStorageIndex, undefined, logger) + new ElasticsearchBlobStorageClient(elasticsearchClient, blobStorageIndex, undefined, logger), + undefined, + undefined, + logger ); } diff --git a/x-pack/plugins/files/server/file_client/file_client.ts b/x-pack/plugins/files/server/file_client/file_client.ts index cc9a4a6de2994..595d0095a6625 100644 --- a/x-pack/plugins/files/server/file_client/file_client.ts +++ b/x-pack/plugins/files/server/file_client/file_client.ts @@ -4,165 +4,170 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ +import moment from 'moment'; import { Readable } from 'stream'; +import mimeType from 'mime'; import cuid from 'cuid'; -import { FileKind, FileMetadata } from '../../common/types'; +import type { Logger } from '@kbn/core/server'; +import type { AuditLogger } from '@kbn/security-plugin/server'; +import type { + File, + FileJSON, + FileKind, + FileMetadata, + FileShareJSONWithToken, + UpdatableFileMetadata, +} from '../../common/types'; import type { FileMetadataClient } from './file_metadata_client'; import type { BlobStorageClient, UploadOptions as BlobUploadOptions, } from '../blob_storage_service'; +import { File as FileImpl } from '../file'; +import { FileShareServiceStart, InternalFileShareService } from '../file_share_service'; import { enforceMaxByteSizeTransform } from './stream_transforms'; - -export interface DeleteArgs { - /** ID of the file to delete */ - id: string; - /** - * If `true`, the file will be deleted from the blob storage. - * - * @default true - */ - hasContent?: boolean; -} - -/** - * Args to create a file - */ -export interface CreateArgs { - /** - * Unique file ID - */ - id?: string; - /** - * The file's metadata - */ - metadata: Omit & { FileKind?: string }; -} +import { createAuditEvent } from '../audit_events'; +import type { FileClient, CreateArgs, DeleteArgs, P1, ShareArgs } from './types'; +import { serializeJSON, toJSON } from '../file/to_json'; +import { createDefaultFileAttributes } from './utils'; export type UploadOptions = Omit; -/** - * Wraps the {@link FileMetadataClient} and {@link BlobStorageClient} client - * to provide basic file CRUD functionality. - * - * For now this is just a shallow type of the implementation for export purposes. - */ -export interface FileClient { - /** See {@link FileMetadata.FileKind}. */ - fileKind: string; - - /** - * See {@link FileMetadataClient.create}. - * - * @param arg - Arg to create a file. - * */ - create(arg: CreateArgs): ReturnType; - - /** - * See {@link FileMetadataClient.get} - * - * @param arg - Argument to get a file - */ - get: FileMetadataClient['get']; - - /** - * {@link FileMetadataClient.update} - * - * @param arg - Argument to get a file - */ - update: FileMetadataClient['update']; - - /** - * Delete a file. - * @param arg - Argument to delete a file - */ - delete(arg: DeleteArgs): Promise; - - /** - * See {@link BlobStorageClient.delete} - * - * @param id - Argument to delete a file - */ - deleteContent: BlobStorageClient['delete']; - - /** - * See {@link FileMetadataClient.list} - * - * @param arg - Argument to list files - */ - list: FileMetadataClient['list']; - - /** - * See {@link FileMetadataClient.find}. - * - * @param arg - Argument to find files - */ - find: FileMetadataClient['find']; - - /** - * See {@link BlobStorageClient.upload} - * - * @param id - Readable stream to upload - * @param rs - Readable stream to upload - * @param opts - Argument for uploads - */ - upload(id: string, rs: Readable, opts?: UploadOptions): ReturnType; - - /** - * See {@link BlobStorageClient.download} - * - * @param args - to download a file - */ - download: BlobStorageClient['download']; +export function createFileClient({ + fileKindDescriptor, + auditLogger, + blobStorageClient, + internalFileShareService, + logger, + metadataClient, +}: { + fileKindDescriptor: FileKind; + metadataClient: FileMetadataClient; + blobStorageClient: BlobStorageClient; + internalFileShareService: undefined | InternalFileShareService; + auditLogger: undefined | AuditLogger; + logger: Logger; +}) { + return new FileClientImpl( + fileKindDescriptor, + metadataClient, + blobStorageClient, + internalFileShareService, + auditLogger, + logger + ); } + export class FileClientImpl implements FileClient { + private readonly logAuditEvent: AuditLogger['log']; + constructor( private fileKindDescriptor: FileKind, private readonly metadataClient: FileMetadataClient, - private readonly blobStorageClient: BlobStorageClient - ) {} + private readonly blobStorageClient: BlobStorageClient, + private readonly internalFileShareService: undefined | InternalFileShareService, + auditLogger: undefined | AuditLogger, + private readonly logger: Logger + ) { + this.logAuditEvent = (e) => { + if (auditLogger) { + auditLogger.log(e); + } else if (e) { + this.logger.info(JSON.stringify(e.event, null, 2)); + } + }; + } + + private instantiateFile(id: string, metadata: FileMetadata): File { + return new FileImpl( + id, + toJSON(id, { + ...createDefaultFileAttributes(), + ...metadata, + }), + this, + this.logger + ); + } public get fileKind(): string { return this.fileKindDescriptor.id; } - public create = async ({ - id, - metadata, - }: CreateArgs): ReturnType => { - return this.metadataClient.create({ + public async create({ id, metadata }: CreateArgs): Promise> { + const serializedMetadata = serializeJSON({ ...metadata, mimeType: metadata.mime }); + const result = await this.metadataClient.create({ id: id || cuid(), metadata: { + ...createDefaultFileAttributes(), + ...serializedMetadata, + name: serializedMetadata.name!, + extension: + (serializedMetadata.mime_type && mimeType.getExtension(serializedMetadata.mime_type)) ?? + undefined, FileKind: this.fileKind, - ...metadata, }, }); - }; + this.logAuditEvent( + createAuditEvent({ + action: 'create', + message: `Created file "${result.metadata.name}" of kind "${this.fileKind}" and id "${result.id}"`, + }) + ); + return this.instantiateFile(result.id, { + ...result.metadata, + FileKind: this.fileKind, + }) as File; + } - public get: FileMetadataClient['get'] = async (arg) => { - return this.metadataClient.get(arg); - }; + public async get(arg: P1): Promise> { + const { id, metadata } = await this.metadataClient.get(arg); + return this.instantiateFile(id, metadata as FileMetadata); + } - public update: FileMetadataClient['update'] = (arg) => { - return this.metadataClient.update(arg); - }; + public async internalUpdate(id: string, metadata: Partial): Promise { + await this.metadataClient.update({ id, metadata: serializeJSON(metadata) }); + } - public find: FileMetadataClient['find'] = (arg) => { - return this.metadataClient.find(arg); - }; + public async update(id: string, metadata: UpdatableFileMetadata): Promise { + const { alt, meta, name } = metadata; + const payload = { name, alt, meta, updated: moment().toISOString() }; + await this.internalUpdate(id, payload); + } + + public async find(arg: P1): Promise>> { + return this.metadataClient + .find(arg) + .then((r) => + r.map(({ id, metadata }) => this.instantiateFile(id, metadata as FileMetadata)) + ); + } public async delete({ id, hasContent = true }: DeleteArgs) { + if (this.internalFileShareService) { + // Stop sharing this file + await this.internalFileShareService.deleteForFile({ id }); + } if (hasContent) await this.blobStorageClient.delete(id); - return this.metadataClient.delete({ id }); + await this.metadataClient.delete({ id }); + this.logAuditEvent( + createAuditEvent({ + action: 'delete', + outcome: 'success', + message: `Deleted file with "${id}"`, + }) + ); } public deleteContent: BlobStorageClient['delete'] = (arg) => { return this.blobStorageClient.delete(arg); }; - public list: FileMetadataClient['list'] = (arg) => { - return this.metadataClient.list(arg); - }; + public async list(arg?: P1): Promise { + return this.metadataClient + .list(arg) + .then((r) => r.map(({ id, metadata }) => this.instantiateFile(id, metadata))); + } /** * Upload a blob @@ -188,4 +193,45 @@ export class FileClientImpl implements FileClient { public download: BlobStorageClient['download'] = (args) => { return this.blobStorageClient.download(args); }; + + async share({ file, name, validUntil }: ShareArgs): Promise { + if (!this.internalFileShareService) { + throw new Error('#share not implemented'); + } + const shareObject = await this.internalFileShareService.share({ + file, + name, + validUntil, + }); + this.logAuditEvent( + createAuditEvent({ + action: 'create', + message: `Shared file "${file.data.name}" with id "${file.data.id}"`, + }) + ); + return shareObject; + } + + unshare: FileShareServiceStart['delete'] = async (arg) => { + if (!this.internalFileShareService) { + throw new Error('#delete shares is not implemented'); + } + const result = await this.internalFileShareService.delete(arg); + + this.logAuditEvent( + createAuditEvent({ + action: 'delete', + message: `Removed share with id "${arg.id}"`, + }) + ); + + return result; + }; + + listShares: FileShareServiceStart['list'] = (args) => { + if (!this.internalFileShareService) { + throw new Error('#list shares not implemented'); + } + return this.internalFileShareService.list(args); + }; } diff --git a/x-pack/plugins/files/server/file_client/index.ts b/x-pack/plugins/files/server/file_client/index.ts index 2f764a53224e4..cb9c2187bc996 100644 --- a/x-pack/plugins/files/server/file_client/index.ts +++ b/x-pack/plugins/files/server/file_client/index.ts @@ -17,6 +17,12 @@ export type { UpdateMetadataArg, } from './file_metadata_client'; export { FileClientImpl } from './file_client'; -export type { FileClient } from './file_client'; +export type { FileClient } from './types'; export { createEsFileClient } from './create_es_file_client'; export type { CreateEsFileClientArgs } from './create_es_file_client'; +export { + AlreadyDeletedError, + ContentAlreadyUploadedError, + NoDownloadAvailableError, + UploadInProgressError, +} from '../file/errors'; diff --git a/x-pack/plugins/files/server/file_client/integration_tests/es_file_client.test.ts b/x-pack/plugins/files/server/file_client/integration_tests/es_file_client.test.ts index 3ab200533c6da..19abeafa786dc 100644 --- a/x-pack/plugins/files/server/file_client/integration_tests/es_file_client.test.ts +++ b/x-pack/plugins/files/server/file_client/integration_tests/es_file_client.test.ts @@ -8,7 +8,8 @@ import { Readable } from 'stream'; import { loggingSystemMock } from '@kbn/core/server/mocks'; import { TestEnvironmentUtils, setupIntegrationEnvironment } from '../../test_utils'; import { createEsFileClient } from '../create_es_file_client'; -import { FileClient } from '../file_client'; +import { FileClient } from '../types'; +import { FileMetadata } from '../../../common'; /** * This file client is using Elasticsearch interfaces directly to manage files. @@ -17,6 +18,8 @@ describe('ES-index-backed file client', () => { let esClient: TestEnvironmentUtils['esClient']; let fileClient: FileClient; let testHarness: TestEnvironmentUtils; + const blobStorageIndex = '.kibana-test-blob'; + const metadataIndex = '.kibana-test-metadata'; beforeAll(async () => { testHarness = await setupIntegrationEnvironment(); @@ -25,8 +28,8 @@ describe('ES-index-backed file client', () => { beforeEach(() => { fileClient = createEsFileClient({ - blobStorageIndex: '.kibana-test-blob', - metadataIndex: '.kibana-test-metadata', + blobStorageIndex, + metadataIndex, elasticsearchClient: esClient, logger: loggingSystemMock.create().get(), }); @@ -40,64 +43,46 @@ describe('ES-index-backed file client', () => { const file = await fileClient.create({ id: '123', metadata: { - Status: 'AWAITING_UPLOAD', - created: new Date().toISOString(), - Updated: new Date().toISOString(), name: 'cool name', }, }); - expect(file).toEqual( + expect(file.toJSON()).toEqual( expect.objectContaining({ id: '123', - metadata: { - FileKind: 'none', - Status: 'AWAITING_UPLOAD', - Updated: expect.any(String), - created: expect.any(String), - name: 'cool name', - }, + fileKind: 'none', + status: 'AWAITING_UPLOAD', + updated: expect.any(String), + created: expect.any(String), + name: 'cool name', }) ); await fileClient.delete({ id: file.id, hasContent: false }); }); test('uploads and downloads file content', async () => { - let { id, metadata } = await fileClient.create({ + const file = await fileClient.create({ id: '123', metadata: { - Status: 'AWAITING_UPLOAD', - created: new Date().toISOString(), - Updated: new Date().toISOString(), name: 'cool name', }, }); - - const { size } = await fileClient.upload(id, Readable.from([Buffer.from('test')])); - ({ id, metadata } = await fileClient.update({ - id, - metadata: { ...metadata, size, Status: 'READY' }, - })); - - const file = await fileClient.get({ id }); - const rs = await fileClient.download({ id: file.id, size: file.metadata.size }); + await file.uploadContent(Readable.from([Buffer.from('test')])); + const rs = await file.downloadContent(); const chunks: Buffer[] = []; for await (const chunk of rs) { chunks.push(chunk); } expect(Buffer.concat(chunks).toString('utf-8')).toBe('test'); - await fileClient.delete({ id, hasContent: true }); + await fileClient.delete({ id: file.id, hasContent: true }); }); test('searches across files', async () => { const { id: id1 } = await fileClient.create({ id: '123', metadata: { - Status: 'AWAITING_UPLOAD', - created: new Date().toISOString(), - Updated: new Date().toISOString(), name: 'cool name 1', - Meta: { + meta: { test: '1', }, }, @@ -105,28 +90,24 @@ describe('ES-index-backed file client', () => { const { id: id2 } = await fileClient.create({ id: '1234', metadata: { - Status: 'UPLOADING', - created: new Date().toISOString(), - Updated: new Date().toISOString(), name: 'cool name 2', - Meta: { + meta: { test: '2', }, }, }); - const { id: id3 } = await fileClient.create({ + const file3 = await fileClient.create({ id: '12345', metadata: { - Status: 'READY', - created: new Date().toISOString(), - Updated: new Date().toISOString(), name: 'cool name 3', - Meta: { + meta: { test: '3', }, }, }); + await file3.uploadContent(Readable.from(['test'])); + { const results = await fileClient.find({ status: ['READY'], @@ -137,7 +118,7 @@ describe('ES-index-backed file client', () => { expect(results[0]).toEqual( expect.objectContaining({ - id: id3, + id: file3.id, }) ); } @@ -147,7 +128,7 @@ describe('ES-index-backed file client', () => { status: ['READY', 'AWAITING_UPLOAD'], }); - expect(results).toHaveLength(2); + expect(results).toHaveLength(3); expect(results[0]).toEqual( expect.objectContaining({ @@ -157,7 +138,13 @@ describe('ES-index-backed file client', () => { expect(results[1]).toEqual( expect.objectContaining({ - id: id3, + id: id2, + }) + ); + + expect(results[2]).toEqual( + expect.objectContaining({ + id: file3.id, }) ); } @@ -165,7 +152,7 @@ describe('ES-index-backed file client', () => { await Promise.all([ fileClient.delete({ id: id1 }), fileClient.delete({ id: id2 }), - fileClient.delete({ id: id3 }), + fileClient.delete({ id: file3.id }), ]); }); @@ -173,24 +160,23 @@ describe('ES-index-backed file client', () => { const { id: id1 } = await fileClient.create({ id: '123', metadata: { - Status: 'AWAITING_UPLOAD', - created: new Date().toISOString(), - Updated: new Date().toISOString(), name: 'cool name 1', - Meta: { + meta: { test: '1', }, }, }); - const { id: id2 } = await fileClient.create({ - id: '1234', - metadata: { - Status: 'DELETED', - created: new Date().toISOString(), - Updated: new Date().toISOString(), - name: 'cool name 2', - Meta: { - test: '2', + const id2 = '1234'; + await esClient.index<{ file: FileMetadata }>({ + id: id2, + index: metadataIndex, + document: { + file: { + FileKind: 'none', + Status: 'DELETED', + Updated: new Date().toISOString(), + created: new Date().toISOString(), + name: 'coolname', }, }, }); @@ -198,17 +184,15 @@ describe('ES-index-backed file client', () => { const list = await fileClient.list(); expect(list).toHaveLength(1); - expect(list[0]).toEqual( + expect(list[0].toJSON()).toEqual( expect.objectContaining({ id: '123', - metadata: { - FileKind: 'none', - Meta: { test: '1' }, - Status: 'AWAITING_UPLOAD', - Updated: expect.any(String), - created: expect.any(String), - name: 'cool name 1', - }, + fileKind: 'none', + meta: { test: '1' }, + status: 'AWAITING_UPLOAD', + updated: expect.any(String), + created: expect.any(String), + name: 'cool name 1', }) ); diff --git a/x-pack/plugins/files/server/file_client/types.ts b/x-pack/plugins/files/server/file_client/types.ts new file mode 100644 index 0000000000000..bbab0066cf3f0 --- /dev/null +++ b/x-pack/plugins/files/server/file_client/types.ts @@ -0,0 +1,134 @@ +/* + * Copyright 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 { File, FileShareJSONWithToken, UpdatableFileMetadata } from '../../common/types'; +import { CreateFileArgs } from '../file_service'; +import { FileShareServiceStart } from '../file_share_service'; +import { FileMetadataClient } from './file_metadata_client'; + +export type P1 any> = Parameters[0]; + +export interface DeleteArgs { + /** ID of the file to delete */ + id: string; + /** + * If `true`, the file will be deleted from the blob storage. + * + * @default true + */ + hasContent?: boolean; +} + +/** + * Args to create a file + */ +export interface CreateArgs { + /** + * Unique file ID + */ + id?: string; + /** + * The file's metadata + */ + metadata: Omit; +} + +/** + * File share args + */ +export interface ShareArgs { + /** + * Name of the file share + */ + name?: string; + /** + * Unix timestamp (in milliseconds) when the file share will expire + */ + validUntil?: number; + /** + * The file to share + */ + file: File; +} + +/** + * Wraps the {@link FileMetadataClient} and {@link BlobStorageClient} client + * to provide basic file CRUD functionality. + * + * For now this is just a shallow type of the implementation for export purposes. + */ +export interface FileClient { + /** See {@link FileMetadata.FileKind}. */ + fileKind: string; + + /** + * See {@link FileMetadataClient.create}. + * + * @param arg - Arg to create a file. + * */ + create(arg: CreateArgs): Promise>; + + /** + * See {@link FileMetadataClient.get} + * + * @param arg - Argument to get a file + */ + get(arg: P1): Promise>; + + /** + * {@link FileMetadataClient.update} + * + * @param id - File id + * @param metadata - new file metadata + */ + update(id: string, metadata: UpdatableFileMetadata): Promise; + + /** + * Delete a file. + * @param arg - Argument to delete a file + */ + delete(arg: DeleteArgs): Promise; + + /** + * See {@link FileMetadataClient.list} + * + * @param arg - Argument to list files + */ + list(arg?: P1): Promise; + + /** + * See {@link FileMetadataClient.find}. + * + * @param arg - Argument to find files + */ + find: (arg: P1) => Promise; + + /** + * Create a file share instance for this file. + * + * @note this will only work for files that are share capable. + * + * @param args - Arguments to create a file share + */ + share(args: ShareArgs): Promise; + /** + * Create a file share instance for this file. + * + * @note this will only work for files that are share capable. + * + * @param args - Arguments to remove a file share + */ + unshare: FileShareServiceStart['delete']; + /** + * Create a file share instance for this file. + * + * @note this will only work for files that are share capable. + * + * @param arg - Arguments to remove a file share + */ + listShares: FileShareServiceStart['list']; +} diff --git a/x-pack/plugins/files/server/file_client/utils.ts b/x-pack/plugins/files/server/file_client/utils.ts new file mode 100644 index 0000000000000..b8b51117e8ac1 --- /dev/null +++ b/x-pack/plugins/files/server/file_client/utils.ts @@ -0,0 +1,20 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { FileMetadata } from '../../common'; + +export function createDefaultFileAttributes(): Pick< + FileMetadata, + 'created' | 'Updated' | 'Status' +> { + const dateString = new Date().toISOString(); + return { + created: dateString, + Status: 'AWAITING_UPLOAD', + Updated: dateString, + }; +} diff --git a/x-pack/plugins/files/server/file_service/file_service.ts b/x-pack/plugins/files/server/file_service/file_service.ts index 90303ac715437..f8d8534b7a635 100644 --- a/x-pack/plugins/files/server/file_service/file_service.ts +++ b/x-pack/plugins/files/server/file_service/file_service.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { File, FileJSON, FilesMetrics } from '../../common'; +import type { FileJSON, FilesMetrics, File } from '../../common'; import type { FileShareServiceStart } from '../file_share_service/types'; import type { CreateFileArgs, @@ -34,7 +34,7 @@ export interface FileServiceStart { * * @param args - update file args */ - update(args: UpdateFileArgs): Promise>; + update(args: UpdateFileArgs): Promise; /** * Delete a file. diff --git a/x-pack/plugins/files/server/file_service/file_service_factory.ts b/x-pack/plugins/files/server/file_service/file_service_factory.ts index bed007b00e507..b6603a43f8720 100644 --- a/x-pack/plugins/files/server/file_service/file_service_factory.ts +++ b/x-pack/plugins/files/server/file_service/file_service_factory.ts @@ -95,7 +95,7 @@ export class FileServiceFactoryImpl implements FileServiceFactory { return internalFileService.createFile(args) as Promise>; }, async update(args: UpdateFileArgs) { - return internalFileService.updateFile(args) as Promise>; + await internalFileService.updateFile(args); }, async delete(args) { return internalFileService.deleteFile(args); diff --git a/x-pack/plugins/files/server/file_service/internal_file_service.ts b/x-pack/plugins/files/server/file_service/internal_file_service.ts index 567df3e137848..a7ba92db9b2e8 100644 --- a/x-pack/plugins/files/server/file_service/internal_file_service.ts +++ b/x-pack/plugins/files/server/file_service/internal_file_service.ts @@ -23,7 +23,7 @@ import type { GetByIdArgs, ListFilesArgs, } from './file_action_types'; -import { FileClientImpl } from '../file_client/file_client'; +import { createFileClient, FileClientImpl } from '../file_client/file_client'; /** * Service containing methods for working with files. * @@ -42,16 +42,7 @@ export class InternalFileService { ) {} public async createFile(args: CreateFileArgs): Promise { - const fileKind = this.getFileKind(args.fileKind); - return await File.create( - { ...args, fileKind }, - this, - new FileClientImpl( - fileKind, - this.metadataClient, - this.blobStorageService.createBlobStorageClient(fileKind.blobStoreSettings) - ) - ); + return this.createFileClient(args.fileKind).create({ metadata: { ...args } }); } public writeAuditLog(event: AuditEvent) { @@ -79,7 +70,7 @@ export class InternalFileService { if (metadata.Status === 'DELETED') { throw new FileNotFoundError('File has been deleted'); } - return this.toFile(id, metadata, this.getFileKind(metadata.FileKind)); + return this.toFile(id, metadata, metadata.FileKind); } catch (e) { if (SavedObjectsErrorHelpers.isNotFoundError(e)) { throw new FileNotFoundError('File not found'); @@ -91,8 +82,8 @@ export class InternalFileService { public async getById({ fileKind, id }: GetByIdArgs): Promise { const file = await this.get(id); - if (file.fileKind !== fileKind) { - throw new Error(`Unexpected file kind "${file.fileKind}", expected "${fileKind}".`); + if (file.data.fileKind !== fileKind) { + throw new Error(`Unexpected file kind "${file.data.fileKind}", expected "${fileKind}".`); } return file; } @@ -108,28 +99,8 @@ export class InternalFileService { page, perPage, }); - return result.map((file) => this.toFile(file.id, file.metadata, fileKind)); - } - - public toFile( - id: string, - fileMetadata: FileMetadata, - fileKind: FileKind, - fileClient?: FileClientImpl - ): IFile { - return new File( - id, - fileMetadata, - fileClient ?? - new FileClientImpl( - fileKind, - this.metadataClient, - this.blobStorageService.createBlobStorageClient(fileKind.blobStoreSettings) - ), - this, - this.fileShareService, - this.logger.get(`file-${id}`) - ); + const fileClient = this.createFileClient(fileKind.id); + return result.map((file) => this.toFile(file.id, file.metadata, fileKind.id, fileClient)); } public getFileKind(id: string): FileKind { @@ -153,4 +124,32 @@ export class InternalFileService { const { fileId } = await this.fileShareService.getByToken(token); return this.get(fileId); } + + private toFile( + id: string, + fileMetadata: FileMetadata, + fileKind: string, + fileClient?: FileClientImpl + ): IFile { + return new File( + id, + toJSON(id, fileMetadata), + fileClient ?? this.createFileClient(fileKind), + this.logger.get(`file-${id}`) + ); + } + + private createFileClient(fileKindId: string) { + const fileKind = this.fileKindRegistry.get(fileKindId); + return createFileClient({ + auditLogger: this.auditLogger, + blobStorageClient: this.blobStorageService.createBlobStorageClient( + fileKind.blobStoreSettings + ), + fileKindDescriptor: fileKind, + internalFileShareService: this.fileShareService, + logger: this.logger, + metadataClient: this.metadataClient, + }); + } } diff --git a/x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts b/x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts index 7b6f8498b0e3e..6c9e09e5173b4 100644 --- a/x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts +++ b/x-pack/plugins/files/server/file_share_service/internal_file_share_service.ts @@ -85,9 +85,9 @@ export type GetArgs = IdArg; */ export interface DeleteForFileArgs { /** - * The file object to delete the shares for. + * The file id to delete the shares for. */ - file: File; + id: string; } /** @@ -144,7 +144,7 @@ export class InternalFileShareService implements FileShareServiceStart { token: generateShareToken(), }, { - references: [{ name: file.name, id: file.id, type: FILE_SO_TYPE }], + references: [{ name: file.data.name, id: file.data.id, type: FILE_SO_TYPE }], } ); @@ -183,8 +183,8 @@ export class InternalFileShareService implements FileShareServiceStart { return result.saved_objects; } - public async deleteForFile({ file }: DeleteForFileArgs): Promise { - const savedObjects = await this.internalList({ fileId: file.id }); + public async deleteForFile({ id: fileId }: DeleteForFileArgs): Promise { + const savedObjects = await this.internalList({ fileId }); await Promise.all(savedObjects.map(({ id }) => this.delete({ id }))); } diff --git a/x-pack/plugins/files/server/integration_tests/file_service.test.ts b/x-pack/plugins/files/server/integration_tests/file_service.test.ts index 0547fe0ed30fb..61196597cc5f9 100644 --- a/x-pack/plugins/files/server/integration_tests/file_service.test.ts +++ b/x-pack/plugins/files/server/integration_tests/file_service.test.ts @@ -107,9 +107,9 @@ describe('FileService', () => { it('creates file metadata awaiting upload', async () => { const file = await createDisposableFile({ fileKind, name: 'test' }); - expect(file.name).toEqual('test'); - expect(file.fileKind).toEqual(fileKind); - expect(file.status).toBe('AWAITING_UPLOAD' as FileStatus); + expect(file.data.name).toEqual('test'); + expect(file.data.fileKind).toEqual(fileKind); + expect(file.data.status).toBe('AWAITING_UPLOAD' as FileStatus); expect(auditLogger.log).toHaveBeenCalledTimes(1); expect(auditLogger.log).toHaveBeenCalledWith({ error: undefined, @@ -123,9 +123,9 @@ describe('FileService', () => { it('uploads file content', async () => { const file = await createDisposableFile({ fileKind, name: 'test' }); - expect(file.status).toBe('AWAITING_UPLOAD' as FileStatus); + expect(file.data.status).toBe('AWAITING_UPLOAD' as FileStatus); await file.uploadContent(Readable.from(['upload this'])); - expect(file.status).toBe('READY' as FileStatus); + expect(file.data.status).toBe('READY' as FileStatus); const rs = await file.downloadContent(); const chunks: string[] = []; for await (const chunk of rs) { @@ -170,17 +170,17 @@ describe('FileService', () => { meta: { some: 'data' }, }; const updatedFile1 = await file.update(updatableFields); - expect(updatedFile1.meta).toEqual(expect.objectContaining(updatableFields.meta)); - expect(updatedFile1.name).toBe(updatableFields.name); - expect(updatedFile1.alt).toBe(updatableFields.alt); + expect(updatedFile1.data.meta).toEqual(expect.objectContaining(updatableFields.meta)); + expect(updatedFile1.data.name).toBe(updatableFields.name); + expect(updatedFile1.data.alt).toBe(updatableFields.alt); // Fetch the file anew to be doubly sure const updatedFile2 = await fileService.getById({ fileKind, id: file.id }); - expect(updatedFile2.meta).toEqual(expect.objectContaining(updatableFields.meta)); + expect(updatedFile2.data.meta).toEqual(expect.objectContaining(updatableFields.meta)); // Below also tests that our meta type is work as expected by using `some` field. - expect(updatedFile2.meta?.some).toBe(updatableFields.meta.some); - expect(updatedFile2.name).toBe(updatableFields.name); - expect(updatedFile2.alt).toBe(updatableFields.alt); + expect(updatedFile2.data.meta?.some).toBe(updatableFields.meta.some); + expect(updatedFile2.data.name).toBe(updatableFields.name); + expect(updatedFile2.data.alt).toBe(updatableFields.alt); }); it('enforces max size settings', async () => { @@ -339,7 +339,7 @@ describe('FileService', () => { action: 'delete', outcome: 'success', }, - message: expect.stringContaining('Removed share for "myfile"'), + message: expect.stringContaining('Removed share with'), }); }); }); diff --git a/x-pack/plugins/files/server/routes/common.test.ts b/x-pack/plugins/files/server/routes/common.test.ts index cda57b5b6bf13..cc22b0d8afb01 100644 --- a/x-pack/plugins/files/server/routes/common.test.ts +++ b/x-pack/plugins/files/server/routes/common.test.ts @@ -16,7 +16,7 @@ describe('getDownloadHeadersForFile', () => { }; } - const file = { name: 'test', mimeType: undefined } as unknown as File; + const file = { data: { name: 'test', mimeType: undefined } } as unknown as File; test('no mime type and name from file object', () => { expect(getDownloadHeadersForFile(file, undefined)).toEqual( t({ ct: 'application/octet-stream', cd: 'test' }) @@ -34,13 +34,13 @@ describe('getDownloadHeadersForFile', () => { ); }); test('mime type and no name', () => { - const fileWithMime = { ...file, mimeType: 'application/pdf' } as File; + const fileWithMime = { data: { ...file.data, mimeType: 'application/pdf' } } as File; expect(getDownloadHeadersForFile(fileWithMime, undefined)).toEqual( t({ ct: 'application/pdf', cd: 'test' }) ); }); test('mime type and name', () => { - const fileWithMime = { ...file, mimeType: 'application/pdf' } as File; + const fileWithMime = { data: { ...file.data, mimeType: 'application/pdf' } } as File; expect(getDownloadHeadersForFile(fileWithMime, 'a cool file.pdf')).toEqual( t({ ct: 'application/pdf', cd: 'a cool file.pdf' }) ); diff --git a/x-pack/plugins/files/server/routes/common.ts b/x-pack/plugins/files/server/routes/common.ts index 23f702493c92d..f8a3a1965267b 100644 --- a/x-pack/plugins/files/server/routes/common.ts +++ b/x-pack/plugins/files/server/routes/common.ts @@ -11,7 +11,7 @@ import type { File } from '../../common/types'; export function getDownloadHeadersForFile(file: File, fileName?: string): ResponseHeaders { return { 'content-type': - (fileName && mime.getType(fileName)) ?? file.mimeType ?? 'application/octet-stream', + (fileName && mime.getType(fileName)) ?? file.data.mimeType ?? 'application/octet-stream', // Note, this name can be overridden by the client if set via a "download" attribute on the HTML tag. 'content-disposition': `attachment; filename="${fileName || getDownloadedFileName(file)}"`, }; @@ -20,8 +20,8 @@ export function getDownloadHeadersForFile(file: File, fileName?: string): Respon export function getDownloadedFileName(file: File): string { // When creating a file we also calculate the extension so the `file.extension` // check is not really necessary except for type checking. - if (file.mimeType && file.extension) { - return `${file.name}.${file.extension}`; + if (file.data.mimeType && file.data.extension) { + return `${file.data.name}.${file.data.extension}`; } - return file.name; + return file.data.name; } diff --git a/x-pack/plugins/files/server/routes/file_kind/upload.ts b/x-pack/plugins/files/server/routes/file_kind/upload.ts index 7b3db76ad38ad..dc6e8e7f4b268 100644 --- a/x-pack/plugins/files/server/routes/file_kind/upload.ts +++ b/x-pack/plugins/files/server/routes/file_kind/upload.ts @@ -50,7 +50,7 @@ export const handler: FileKindsRequestHandler = async ( } throw e; } - const body: Response = { ok: true, size: file.size! }; + const body: Response = { ok: true, size: file.data.size! }; return res.ok({ body }); }; diff --git a/x-pack/plugins/fleet/common/constants/routes.ts b/x-pack/plugins/fleet/common/constants/routes.ts index d46a5f23ddf08..b415328a303d3 100644 --- a/x-pack/plugins/fleet/common/constants/routes.ts +++ b/x-pack/plugins/fleet/common/constants/routes.ts @@ -49,6 +49,7 @@ export const DATA_STREAM_API_ROUTES = { // Package policy API routes export const PACKAGE_POLICY_API_ROUTES = { LIST_PATTERN: `${PACKAGE_POLICY_API_ROOT}`, + BULK_GET_PATTERN: `${PACKAGE_POLICY_API_ROOT}/_bulk_get`, INFO_PATTERN: `${PACKAGE_POLICY_API_ROOT}/{packagePolicyId}`, CREATE_PATTERN: `${PACKAGE_POLICY_API_ROOT}`, UPDATE_PATTERN: `${PACKAGE_POLICY_API_ROOT}/{packagePolicyId}`, @@ -61,6 +62,7 @@ export const PACKAGE_POLICY_API_ROUTES = { // Agent policy API routes export const AGENT_POLICY_API_ROUTES = { LIST_PATTERN: `${AGENT_POLICY_API_ROOT}`, + BULK_GET_PATTERN: `${AGENT_POLICY_API_ROOT}/_bulk_get`, INFO_PATTERN: `${AGENT_POLICY_API_ROOT}/{agentPolicyId}`, CREATE_PATTERN: `${AGENT_POLICY_API_ROOT}`, UPDATE_PATTERN: `${AGENT_POLICY_API_ROOT}/{agentPolicyId}`, diff --git a/x-pack/plugins/fleet/common/openapi/bundled.json b/x-pack/plugins/fleet/common/openapi/bundled.json index f7d5054f53224..adb49b25782cd 100644 --- a/x-pack/plugins/fleet/common/openapi/bundled.json +++ b/x-pack/plugins/fleet/common/openapi/bundled.json @@ -2215,6 +2215,66 @@ } } }, + "/agent_policies/_bulk_get": { + "post": { + "summary": "Agent policies - Bulk Get", + "tags": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "list of agent policy ids" + }, + "full": { + "type": "boolean", + "description": "get full policies with package policies populated" + }, + "ignoreMissing": { + "type": "boolean" + } + }, + "required": [ + "ids" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/agent_policy" + } + } + }, + "required": [ + "items" + ] + } + } + } + } + }, + "operationId": "bulk-get-agent-policies", + "security": [], + "parameters": [] + } + }, "/agent_policies/delete": { "post": { "summary": "Agent policy - Delete", @@ -2706,6 +2766,62 @@ ] } }, + "/package_policies/_bulk_get": { + "post": { + "summary": "Package policies - Bulk Get", + "tags": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "list of package policy ids" + }, + "ignoreMissing": { + "type": "boolean" + } + }, + "required": [ + "ids" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/package_policy" + } + } + }, + "required": [ + "items" + ] + } + } + } + } + }, + "operationId": "bulk-get-package-policies", + "security": [], + "parameters": [] + } + }, "/package_policies/delete": { "post": { "summary": "Package policy - Delete", diff --git a/x-pack/plugins/fleet/common/openapi/bundled.yaml b/x-pack/plugins/fleet/common/openapi/bundled.yaml index 60827666ca5e8..3cc16afc3f410 100644 --- a/x-pack/plugins/fleet/common/openapi/bundled.yaml +++ b/x-pack/plugins/fleet/common/openapi/bundled.yaml @@ -1355,6 +1355,45 @@ paths: required: - name description: '' + /agent_policies/_bulk_get: + post: + summary: Agent policies - Bulk Get + tags: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + ids: + type: array + items: + type: string + description: list of agent policy ids + full: + type: boolean + description: get full policies with package policies populated + ignoreMissing: + type: boolean + required: + - ids + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/agent_policy' + required: + - items + operationId: bulk-get-agent-policies + security: [] + parameters: [] /agent_policies/delete: post: summary: Agent policy - Delete @@ -1662,6 +1701,42 @@ paths: type: boolean parameters: - $ref: '#/components/parameters/kbn_xsrf' + /package_policies/_bulk_get: + post: + summary: Package policies - Bulk Get + tags: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + ids: + type: array + items: + type: string + description: list of package policy ids + ignoreMissing: + type: boolean + required: + - ids + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/package_policy' + required: + - items + operationId: bulk-get-package-policies + security: [] + parameters: [] /package_policies/delete: post: summary: Package policy - Delete diff --git a/x-pack/plugins/fleet/common/openapi/entrypoint.yaml b/x-pack/plugins/fleet/common/openapi/entrypoint.yaml index 316ffa6e5679a..2756656e189f2 100644 --- a/x-pack/plugins/fleet/common/openapi/entrypoint.yaml +++ b/x-pack/plugins/fleet/common/openapi/entrypoint.yaml @@ -82,6 +82,8 @@ paths: $ref: 'paths/agent_policies@{agent_policy_id}.yaml' '/agent_policies/{agentPolicyId}/copy': $ref: 'paths/agent_policies@{agent_policy_id}@copy.yaml' + /agent_policies/_bulk_get: + $ref: paths/agent_policies@_bulk_get.yaml /agent_policies/delete: $ref: paths/agent_policies@delete.yaml # Data streams endpoints @@ -99,6 +101,8 @@ paths: # Package policies endpoints /package_policies: $ref: paths/package_policies.yaml + /package_policies/_bulk_get: + $ref: paths/package_policies@_bulk_get.yaml /package_policies/delete: $ref: paths/package_policies@delete.yaml /package_policies/upgrade: diff --git a/x-pack/plugins/fleet/common/openapi/paths/agent_policies@_bulk_get.yaml b/x-pack/plugins/fleet/common/openapi/paths/agent_policies@_bulk_get.yaml new file mode 100644 index 0000000000000..0ac58fffba167 --- /dev/null +++ b/x-pack/plugins/fleet/common/openapi/paths/agent_policies@_bulk_get.yaml @@ -0,0 +1,38 @@ +post: + summary: Agent policies - Bulk Get + tags: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + ids: + type: array + items: + type: string + description: list of agent policy ids + full: + type: boolean + description: get full policies with package policies populated + ignoreMissing: + type: boolean + required: + - ids + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: ../components/schemas/agent_policy.yaml + required: + - items + operationId: bulk-get-agent-policies + security: [] + parameters: [] diff --git a/x-pack/plugins/fleet/common/openapi/paths/package_policies@_bulk_get.yaml b/x-pack/plugins/fleet/common/openapi/paths/package_policies@_bulk_get.yaml new file mode 100644 index 0000000000000..70d54b12e47eb --- /dev/null +++ b/x-pack/plugins/fleet/common/openapi/paths/package_policies@_bulk_get.yaml @@ -0,0 +1,35 @@ +post: + summary: Package policies - Bulk Get + tags: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + ids: + type: array + items: + type: string + description: list of package policy ids + ignoreMissing: + type: boolean + required: + - ids + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: ../components/schemas/package_policy.yaml + required: + - items + operationId: bulk-get-package-policies + security: [] + parameters: [] diff --git a/x-pack/plugins/fleet/common/types/rest_spec/agent_policy.ts b/x-pack/plugins/fleet/common/types/rest_spec/agent_policy.ts index d53da769c754b..a62b1a1b9e4e6 100644 --- a/x-pack/plugins/fleet/common/types/rest_spec/agent_policy.ts +++ b/x-pack/plugins/fleet/common/types/rest_spec/agent_policy.ts @@ -7,7 +7,7 @@ import type { AgentPolicy, NewAgentPolicy, FullAgentPolicy } from '../models'; -import type { ListResult, ListWithKuery } from './common'; +import type { ListResult, ListWithKuery, BulkGetResult } from './common'; export interface GetAgentPoliciesRequest { query: ListWithKuery & { @@ -17,6 +17,7 @@ export interface GetAgentPoliciesRequest { export type GetAgentPoliciesResponseItem = AgentPolicy & { agents?: number }; +export type BulkGetAgentPoliciesResponse = BulkGetResult; export type GetAgentPoliciesResponse = ListResult; export interface GetOneAgentPolicyRequest { diff --git a/x-pack/plugins/fleet/common/types/rest_spec/common.ts b/x-pack/plugins/fleet/common/types/rest_spec/common.ts index 7a0390d830de3..07bd3c7019c16 100644 --- a/x-pack/plugins/fleet/common/types/rest_spec/common.ts +++ b/x-pack/plugins/fleet/common/types/rest_spec/common.ts @@ -21,3 +21,7 @@ export interface ListResult { page: number; perPage: number; } + +export interface BulkGetResult { + items: T[]; +} diff --git a/x-pack/plugins/fleet/common/types/rest_spec/package_policy.ts b/x-pack/plugins/fleet/common/types/rest_spec/package_policy.ts index 260c8ebc8142f..c7de1bd489b47 100644 --- a/x-pack/plugins/fleet/common/types/rest_spec/package_policy.ts +++ b/x-pack/plugins/fleet/common/types/rest_spec/package_policy.ts @@ -14,13 +14,14 @@ import type { FullAgentPolicyInput, } from '../models'; -import type { ListResult, ListWithKuery } from './common'; +import type { BulkGetResult, ListResult, ListWithKuery } from './common'; export interface GetPackagePoliciesRequest { query: ListWithKuery; } export type GetPackagePoliciesResponse = ListResult; +export type BulkGetPackagePoliciesResponse = BulkGetResult; export interface GetOnePackagePolicyRequest { params: { diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_stream.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_stream.tsx index 77734feb67e21..1662f6d0c7214 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_stream.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_stream.tsx @@ -132,7 +132,7 @@ export const PackagePolicyInputStreamConfig: React.FunctionComponent<{ - + {packageInputStream.description} ) : null} diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_var_field.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_var_field.tsx index 327037a6f2745..812d5fc2233de 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_var_field.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/components/package_policy_input_var_field.tsx @@ -155,7 +155,7 @@ export const PackagePolicyInputVarField: React.FunctionComponent<{ ) : null } - helpText={} + helpText={description && } > {field} diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/agent_policy_debugger.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/agent_policy_debugger.tsx index 71ee096f1e4fa..78be94ef07048 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/agent_policy_debugger.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/agent_policy_debugger.tsx @@ -16,7 +16,7 @@ import { EuiSpacer, EuiText, } from '@elastic/eui'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; @@ -52,7 +52,7 @@ export const AgentPolicyDebugger: React.FunctionComponent = () => { // TODO: Depending on the number of agent policies, this might need to be switched to // `useInfinite` query with an infinite scrolling approach in the dropdown options. - const { data, status } = useQuery('debug-agent-policies', fetchAgentPolicies); + const { data, status } = useQuery(['debug-agent-policies'], fetchAgentPolicies); const agentPolicies = data?.data?.items ?? []; const comboBoxOptions = agentPolicies.map((policy) => ({ @@ -68,7 +68,7 @@ export const AgentPolicyDebugger: React.FunctionComponent = () => { const onDelete = () => { setSelectedPolicyId(undefined); - queryClient.invalidateQueries('debug-agent-policies'); + queryClient.invalidateQueries(['debug-agent-policies']); }; if (status === 'error') { diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/fleet_index_debugger.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/fleet_index_debugger.tsx index 7c0c81858414a..3f678d4463480 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/fleet_index_debugger.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/fleet_index_debugger.tsx @@ -15,7 +15,7 @@ import { EuiSpacer, EuiText, } from '@elastic/eui'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/integration_debugger.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/integration_debugger.tsx index 7140a582980cf..9c3fa21c752f8 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/integration_debugger.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/integration_debugger.tsx @@ -20,7 +20,7 @@ import { EuiSpacer, EuiText, } from '@elastic/eui'; -import { useMutation, useQuery } from 'react-query'; +import { useMutation, useQuery } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; @@ -58,7 +58,7 @@ export const IntegrationDebugger: React.FunctionComponent = () => { const [isReinstallModalVisible, setIsReinstallModalVisible] = useState(false); const [isUninstallModalVisible, setIsUninstallModalVisible] = useState(false); - const integrations = useQuery('debug-integrations', fetchInstalledIntegrations); + const integrations = useQuery(['debug-integrations'], fetchInstalledIntegrations); const uninstallMutation = useMutation(async (integration: PackageListItem) => { const response = await sendRemovePackage(integration.name, integration.version, true); @@ -86,7 +86,7 @@ export const IntegrationDebugger: React.FunctionComponent = () => { setSelectedIntegrationId(undefined); setIsUninstallModalVisible(false); - queryClient.invalidateQueries('debug-integrations'); + queryClient.invalidateQueries(['debug-integrations']); return response.data; }); @@ -132,7 +132,7 @@ export const IntegrationDebugger: React.FunctionComponent = () => { setSelectedIntegrationId(undefined); setIsReinstallModalVisible(false); - queryClient.invalidateQueries('debug-integrations'); + queryClient.invalidateQueries(['debug-integrations']); return installResponse.data; }); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/orphaned_integration_policy_debugger.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/orphaned_integration_policy_debugger.tsx index abc84ad425900..3febbe36c56f7 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/orphaned_integration_policy_debugger.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/orphaned_integration_policy_debugger.tsx @@ -15,7 +15,7 @@ import { EuiButton, EuiConfirmModal, } from '@elastic/eui'; -import { useMutation, useQuery } from 'react-query'; +import { useMutation, useQuery } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; @@ -46,7 +46,7 @@ export const OrphanedIntegrationPolicyDebugger: React.FunctionComponent = () => const [isDeleteModalVisible, setIsDeleteModalVisible] = useState(false); const [isDeleteAllModalVisible, setIsDeleteAllModalVisible] = useState(false); - const { data: orphanedPolicies } = useQuery('debug-orphaned-policies', fetchOrphanedPolicies); + const { data: orphanedPolicies } = useQuery(['debug-orphaned-policies'], fetchOrphanedPolicies); const comboBoxOptions = orphanedPolicies?.map((policy: { id: string; name: string }) => ({ @@ -83,7 +83,7 @@ export const OrphanedIntegrationPolicyDebugger: React.FunctionComponent = () => defaultMessage: 'Successfully deleted orphaned policy', }) ); - queryClient.invalidateQueries('debug-orphaned-policies'); + queryClient.invalidateQueries(['debug-orphaned-policies']); setSelectedPolicyId(undefined); setIsDeleteModalVisible(false); @@ -112,7 +112,7 @@ export const OrphanedIntegrationPolicyDebugger: React.FunctionComponent = () => defaultMessage: 'Successfully deleted all orphaned policies', }) ); - queryClient.invalidateQueries('debug-orphaned-policies'); + queryClient.invalidateQueries(['debug-orphaned-policies']); setSelectedPolicyId(undefined); setIsDeleteAllModalVisible(false); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/preconfiguration_debugger.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/preconfiguration_debugger.tsx index 35e9bcba75492..8184242f99e8d 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/preconfiguration_debugger.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/preconfiguration_debugger.tsx @@ -17,7 +17,7 @@ import { EuiLink, EuiConfirmModal, } from '@elastic/eui'; -import { useMutation, useQuery } from 'react-query'; +import { useMutation, useQuery } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; @@ -55,7 +55,7 @@ export const PreconfigurationDebugger: React.FunctionComponent = () => { const [isResetAllModalVisible, setIsResetAllModalVisible] = useState(false); const preconfiguredPolicies = useQuery( - 'debug-preconfigured-policies', + ['debug-preconfigured-policies'], fetchPreconfiguredPolicies ); @@ -91,7 +91,7 @@ export const PreconfigurationDebugger: React.FunctionComponent = () => { defaultMessage: 'Successfully reset policy', }) ); - queryClient.invalidateQueries('debug-preconfigured-policies'); + queryClient.invalidateQueries(['debug-preconfigured-policies']); setSelectedPolicyId(undefined); setIsResetModalVisible(false); @@ -116,7 +116,7 @@ export const PreconfigurationDebugger: React.FunctionComponent = () => { defaultMessage: 'Successfully reset policies', }) ); - queryClient.invalidateQueries('debug-preconfigured-policies'); + queryClient.invalidateQueries(['debug-preconfigured-policies']); setSelectedPolicyId(undefined); setIsResetAllModalVisible(false); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/saved_object_debugger.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/saved_object_debugger.tsx index c23b383d96f9d..de95b08a4dfb6 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/saved_object_debugger.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/saved_object_debugger.tsx @@ -6,7 +6,7 @@ */ import React, { useState, useRef } from 'react'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { EuiFlexGroup, EuiFlexItem, diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/saved_object_names_combo.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/saved_object_names_combo.tsx index 9458bca298b9a..aa9d7cb011e83 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/saved_object_names_combo.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/components/saved_object_names_combo.tsx @@ -6,7 +6,7 @@ */ import React, { forwardRef, useImperativeHandle } from 'react'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { EuiComboBox } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/index.tsx index b54a97d3b270c..89c61a78eb61c 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/debug/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/debug/index.tsx @@ -18,8 +18,8 @@ import { EuiText, EuiTitle, } from '@elastic/eui'; -import { QueryClient, QueryClientProvider } from 'react-query'; -import { ReactQueryDevtools } from 'react-query/devtools'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import { ReactQueryDevtools } from '@tanstack/react-query-devtools'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; diff --git a/x-pack/plugins/fleet/public/applications/integrations/components/header/header_portal.tsx b/x-pack/plugins/fleet/public/applications/integrations/components/header/header_portal.tsx index 190a6e1ba49c7..8b0671f0a9a45 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/components/header/header_portal.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/components/header/header_portal.tsx @@ -8,7 +8,7 @@ import type { AppMountParameters } from '@kbn/core/public'; import type { FC } from 'react'; import React, { useEffect, useMemo } from 'react'; -import { createPortalNode, InPortal, OutPortal } from 'react-reverse-portal'; +import { createHtmlPortalNode, InPortal, OutPortal } from 'react-reverse-portal'; import { toMountPoint } from '@kbn/kibana-react-plugin/public'; @@ -18,7 +18,7 @@ export interface Props { } export const HeaderPortal: FC = ({ children, setHeaderActionMenu, theme$ }) => { - const portalNode = useMemo(() => createPortalNode(), []); + const portalNode = useMemo(() => createHtmlPortalNode(), []); useEffect(() => { setHeaderActionMenu((element) => { diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/markdown_renderers.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/markdown_renderers.tsx index 2cbdfe3671c4e..8734d051e0be7 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/markdown_renderers.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/markdown_renderers.tsx @@ -11,9 +11,9 @@ import { EuiTableHeaderCell, EuiTableRow, EuiTableRowCell, - EuiText, } from '@elastic/eui'; import React from 'react'; +import type { TransformOptions } from 'react-markdown'; /** prevents links to the new pages from accessing `window.opener` */ const REL_NOOPENER = 'noopener'; @@ -30,42 +30,25 @@ const CODE_LANGUAGE_OVERRIDES: Record = { $yml: 'yml', }; -export const markdownRenderers = { - root: ({ children }: { children: React.ReactNode[] }) => ( - {children} - ), - table: ({ children }: { children: React.ReactNode[] }) => ( - {children}
- ), - tableRow: ({ children }: { children: React.ReactNode[] }) => ( - {children} - ), - tableCell: ({ isHeader, children }: { isHeader: boolean; children: React.ReactNode[] }) => { - return isHeader ? ( - {children} - ) : ( - {children} - ); - }, +export const markdownRenderers: TransformOptions['components'] = { + table: ({ children }) => {children}
, + tr: ({ children }) => {children}, + th: ({ children }) => {children}, + td: ({ children }) => {children}, // the headings used in markdown don't match our page so mapping them to the appropriate one - heading: ({ level, children }: { level: number; children: React.ReactNode[] }) => { - switch (level) { - case 1: - return

{children}

; - case 2: - return

{children}

; - case 3: - return
{children}
; - default: - return
{children}
; - } - }, + h1: ({ children }) =>

{children}

, + h2: ({ children }) =>

{children}

, + h3: ({ children }) =>
{children}
, + h4: ({ children }) =>
{children}
, + h5: ({ children }) =>
{children}
, + h6: ({ children }) =>
{children}
, link: ({ children, href }: { children: React.ReactNode[]; href?: string }) => ( {children} ), - code: ({ language, value }: { language: string; value: string }) => { + // @ts-expect-error update types + code: ({ language, value }) => { let parsedLang = language; // Some integrations export code block content that includes language tags that have since diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/readme.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/readme.tsx index 240b3c7bf7442..f7e9c2a5b4e8f 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/readme.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/readme.tsx @@ -43,11 +43,11 @@ export function Readme({ return ( {markdown !== undefined ? ( - + + + {markdown} + + ) : ( {/* simulates a long page of text loading */} diff --git a/x-pack/plugins/fleet/server/errors/index.ts b/x-pack/plugins/fleet/server/errors/index.ts index d0aca78fce5ef..713804d8a36f7 100644 --- a/x-pack/plugins/fleet/server/errors/index.ts +++ b/x-pack/plugins/fleet/server/errors/index.ts @@ -54,6 +54,7 @@ export class ConcurrentInstallOperationError extends IngestManagerError {} export class AgentReassignmentError extends IngestManagerError {} export class PackagePolicyIneligibleForUpgradeError extends IngestManagerError {} export class PackagePolicyValidationError extends IngestManagerError {} +export class PackagePolicyNotFoundError extends IngestManagerError {} export class BundledPackageNotFoundError extends IngestManagerError {} export class HostedAgentPolicyRestrictionRelatedError extends IngestManagerError { constructor(message = 'Cannot perform that action') { diff --git a/x-pack/plugins/fleet/server/routes/agent_policy/handlers.ts b/x-pack/plugins/fleet/server/routes/agent_policy/handlers.ts index 0f632dfbb9cff..8235c3c3348b2 100644 --- a/x-pack/plugins/fleet/server/routes/agent_policy/handlers.ts +++ b/x-pack/plugins/fleet/server/routes/agent_policy/handlers.ts @@ -6,7 +6,7 @@ */ import type { TypeOf } from '@kbn/config-schema'; -import type { RequestHandler, ResponseHeaders } from '@kbn/core/server'; +import type { RequestHandler, ResponseHeaders, ElasticsearchClient } from '@kbn/core/server'; import pMap from 'p-map'; import { safeDump } from 'js-yaml'; @@ -24,6 +24,8 @@ import type { GetFullAgentPolicyRequestSchema, GetK8sManifestRequestSchema, FleetRequestHandler, + BulkGetAgentPoliciesRequestSchema, + AgentPolicy, } from '../../types'; import type { @@ -37,10 +39,28 @@ import type { GetFullAgentPolicyResponse, GetFullAgentConfigMapResponse, GetFullAgentManifestResponse, + BulkGetAgentPoliciesResponse, } from '../../../common/types'; -import { defaultIngestErrorHandler } from '../../errors'; +import { defaultIngestErrorHandler, AgentPolicyNotFoundError } from '../../errors'; import { createAgentPolicyWithPackages } from '../../services/agent_policy_create'; +async function populateAssignedAgentsCount( + esClient: ElasticsearchClient, + agentPolicies: AgentPolicy[] +) { + await pMap( + agentPolicies, + (agentPolicy: GetAgentPoliciesResponseItem) => + getAgentsByKuery(esClient, { + showInactive: false, + perPage: 0, + page: 1, + kuery: `${AGENTS_PREFIX}.policy_id:${agentPolicy.id}`, + }).then(({ total: agentTotal }) => (agentPolicy.agents = agentTotal)), + { concurrency: 10 } + ); +} + export const getAgentPoliciesHandler: FleetRequestHandler< undefined, TypeOf @@ -62,20 +82,45 @@ export const getAgentPoliciesHandler: FleetRequestHandler< perPage, }; - await pMap( + await populateAssignedAgentsCount(esClient, items); + + return response.ok({ body }); + } catch (error) { + return defaultIngestErrorHandler({ error, response }); + } +}; + +export const bulkGetAgentPoliciesHandler: FleetRequestHandler< + undefined, + undefined, + TypeOf +> = async (context, request, response) => { + const coreContext = await context.core; + const fleetContext = await context.fleet; + const soClient = fleetContext.epm.internalSoClient; + const esClient = coreContext.elasticsearch.client.asInternalUser; + const { full: withPackagePolicies = false, ignoreMissing = false, ids } = request.body; + try { + const items = await agentPolicyService.getByIDs(soClient, ids, { + withPackagePolicies, + ignoreMissing, + }); + const body: BulkGetAgentPoliciesResponse = { items, - (agentPolicy: GetAgentPoliciesResponseItem) => - getAgentsByKuery(esClient, { - showInactive: false, - perPage: 0, - page: 1, - kuery: `${AGENTS_PREFIX}.policy_id:${agentPolicy.id}`, - }).then(({ total: agentTotal }) => (agentPolicy.agents = agentTotal)), - { concurrency: 10 } - ); + }; + + await populateAssignedAgentsCount(esClient, items); return response.ok({ body }); } catch (error) { + if (error instanceof AgentPolicyNotFoundError) { + return response.notFound({ + body: { + message: error.message, + }, + }); + } + return defaultIngestErrorHandler({ error, response }); } }; diff --git a/x-pack/plugins/fleet/server/routes/agent_policy/index.ts b/x-pack/plugins/fleet/server/routes/agent_policy/index.ts index b42799d738d4c..938d8b3332b71 100644 --- a/x-pack/plugins/fleet/server/routes/agent_policy/index.ts +++ b/x-pack/plugins/fleet/server/routes/agent_policy/index.ts @@ -15,6 +15,7 @@ import { DeleteAgentPolicyRequestSchema, GetFullAgentPolicyRequestSchema, GetK8sManifestRequestSchema, + BulkGetAgentPoliciesRequestSchema, } from '../../types'; import type { FleetAuthzRouter } from '../security'; @@ -31,6 +32,7 @@ import { downloadFullAgentPolicy, downloadK8sManifest, getK8sManifest, + bulkGetAgentPoliciesHandler, } from './handlers'; export const registerRoutes = (router: FleetAuthzRouter) => { @@ -46,6 +48,18 @@ export const registerRoutes = (router: FleetAuthzRouter) => { getAgentPoliciesHandler ); + // Bulk GET + router.post( + { + path: AGENT_POLICY_API_ROUTES.BULK_GET_PATTERN, + validate: BulkGetAgentPoliciesRequestSchema, + fleetAuthz: { + fleet: { readAgentPolicies: true }, + }, + }, + bulkGetAgentPoliciesHandler + ); + // Get one router.get( { diff --git a/x-pack/plugins/fleet/server/routes/package_policy/handlers.test.ts b/x-pack/plugins/fleet/server/routes/package_policy/handlers.test.ts index 222408c6e0524..5e67857540143 100644 --- a/x-pack/plugins/fleet/server/routes/package_policy/handlers.test.ts +++ b/x-pack/plugins/fleet/server/routes/package_policy/handlers.test.ts @@ -138,8 +138,8 @@ describe('When calling package policy', () => { // Set the routeConfig and routeHandler to the Create API beforeEach(() => { - [routeConfig, routeHandler] = routerMock.post.mock.calls.find(([{ path }]) => - path.startsWith(PACKAGE_POLICY_API_ROUTES.CREATE_PATTERN) + [routeConfig, routeHandler] = routerMock.post.mock.calls.find( + ([{ path }]) => path === PACKAGE_POLICY_API_ROUTES.CREATE_PATTERN )!; }); diff --git a/x-pack/plugins/fleet/server/routes/package_policy/handlers.ts b/x-pack/plugins/fleet/server/routes/package_policy/handlers.ts index 8ecbd11ec5986..0b5f71910cfa9 100644 --- a/x-pack/plugins/fleet/server/routes/package_policy/handlers.ts +++ b/x-pack/plugins/fleet/server/routes/package_policy/handlers.ts @@ -25,8 +25,10 @@ import type { FleetRequestHandler, PackagePolicy, DeleteOnePackagePolicyRequestSchema, + BulkGetPackagePoliciesRequestSchema, } from '../../types'; import type { + BulkGetPackagePoliciesResponse, CreatePackagePolicyResponse, DeletePackagePoliciesResponse, NewPackagePolicy, @@ -34,7 +36,7 @@ import type { UpgradePackagePolicyResponse, } from '../../../common/types'; import { installationStatuses } from '../../../common/constants'; -import { defaultIngestErrorHandler } from '../../errors'; +import { defaultIngestErrorHandler, PackagePolicyNotFoundError } from '../../errors'; import { getInstallations } from '../../services/epm/packages'; import { PACKAGES_SAVED_OBJECT_TYPE, SO_SEARCH_LIMIT } from '../../constants'; @@ -61,6 +63,34 @@ export const getPackagePoliciesHandler: RequestHandler< } }; +export const bulkGetPackagePoliciesHandler: RequestHandler< + undefined, + undefined, + TypeOf +> = async (context, request, response) => { + const soClient = (await context.core).savedObjects.client; + const { ids, ignoreMissing } = request.body; + try { + const items = await packagePolicyService.getByIDs(soClient, ids, { + ignoreMissing, + }); + + const body: BulkGetPackagePoliciesResponse = { items: items ?? [] }; + + return response.ok({ + body, + }); + } catch (error) { + if (error instanceof PackagePolicyNotFoundError) { + return response.notFound({ + body: { message: error.message }, + }); + } + + return defaultIngestErrorHandler({ error, response }); + } +}; + export const getOnePackagePolicyHandler: RequestHandler< TypeOf > = async (context, request, response) => { diff --git a/x-pack/plugins/fleet/server/routes/package_policy/index.ts b/x-pack/plugins/fleet/server/routes/package_policy/index.ts index cf52b740245f8..004037623bb0d 100644 --- a/x-pack/plugins/fleet/server/routes/package_policy/index.ts +++ b/x-pack/plugins/fleet/server/routes/package_policy/index.ts @@ -15,6 +15,7 @@ import { UpgradePackagePoliciesRequestSchema, DryRunPackagePoliciesRequestSchema, DeleteOnePackagePolicyRequestSchema, + BulkGetPackagePoliciesRequestSchema, } from '../../types'; import type { FleetAuthzRouter } from '../security'; @@ -28,6 +29,7 @@ import { dryRunUpgradePackagePolicyHandler, getOrphanedPackagePolicies, deleteOnePackagePolicyHandler, + bulkGetPackagePoliciesHandler, } from './handlers'; export const registerRoutes = (router: FleetAuthzRouter) => { @@ -43,6 +45,17 @@ export const registerRoutes = (router: FleetAuthzRouter) => { getPackagePoliciesHandler ); + router.post( + { + path: PACKAGE_POLICY_API_ROUTES.BULK_GET_PATTERN, + validate: BulkGetPackagePoliciesRequestSchema, + fleetAuthz: { + integrations: { readIntegrationPolicies: true }, + }, + }, + bulkGetPackagePoliciesHandler + ); + // Get one router.get( { diff --git a/x-pack/plugins/fleet/server/services/agent_policy.ts b/x-pack/plugins/fleet/server/services/agent_policy.ts index 7eb59ade87f0b..4008100518984 100644 --- a/x-pack/plugins/fleet/server/services/agent_policy.ts +++ b/x-pack/plugins/fleet/server/services/agent_policy.ts @@ -53,7 +53,11 @@ import type { Output, DeletePackagePoliciesResponse, } from '../../common/types'; -import { AgentPolicyNameExistsError, HostedAgentPolicyRestrictionRelatedError } from '../errors'; +import { + AgentPolicyNameExistsError, + HostedAgentPolicyRestrictionRelatedError, + AgentPolicyNotFoundError, +} from '../errors'; import type { FullAgentConfigMap } from '../../common/types/models/agent_cm'; @@ -259,7 +263,10 @@ class AgentPolicyService { agentPolicy.package_policies = (await packagePolicyService.getByIDs( soClient, - (agentPolicySO.attributes.package_policies as string[]) || [] + (agentPolicySO.attributes.package_policies as string[]) || [], + { + ignoreMissing: true, + } )) || []; } @@ -269,16 +276,44 @@ class AgentPolicyService { public async getByIDs( soClient: SavedObjectsClientContract, ids: string[], - options: { fields?: string[] } = {} + options: { fields?: string[]; withPackagePolicies?: boolean; ignoreMissing?: boolean } = {} ): Promise { const objects = ids.map((id) => ({ ...options, id, type: SAVED_OBJECT_TYPE })); - const agentPolicySO = await soClient.bulkGet(objects); + const bulkGetResponse = await soClient.bulkGet(objects); - return agentPolicySO.saved_objects.map((so) => ({ - id: so.id, - version: so.version, - ...so.attributes, - })); + const agentPolicies = await pMap( + bulkGetResponse.saved_objects, + async (agentPolicySO) => { + if (agentPolicySO.error) { + if (options.ignoreMissing && agentPolicySO.error.statusCode === 404) { + return null; + } else if (agentPolicySO.error.statusCode === 404) { + throw new AgentPolicyNotFoundError(`Agent policy ${agentPolicySO.id} not found`); + } else { + throw new Error(agentPolicySO.error.message); + } + } + + const agentPolicy = { + id: agentPolicySO.id, + ...agentPolicySO.attributes, + }; + if (options.withPackagePolicies) { + const agentPolicyWithPackagePolicies = await this.get( + soClient, + agentPolicySO.id, + options.withPackagePolicies + ); + if (agentPolicyWithPackagePolicies) { + agentPolicy.package_policies = agentPolicyWithPackagePolicies.package_policies; + } + } + return agentPolicy; + }, + { concurrency: 50 } + ); + + return agentPolicies.filter((agentPolicy): agentPolicy is AgentPolicy => agentPolicy !== null); } public async list( diff --git a/x-pack/plugins/fleet/server/services/agents/hosted_agent.ts b/x-pack/plugins/fleet/server/services/agents/hosted_agent.ts index 0c26e09575ac3..4acba8551e86d 100644 --- a/x-pack/plugins/fleet/server/services/agents/hosted_agent.ts +++ b/x-pack/plugins/fleet/server/services/agents/hosted_agent.ts @@ -22,6 +22,7 @@ export async function getHostedPolicies( // get the agent policies for those ids const agentPolicies = await agentPolicyService.getByIDs(soClient, Array.from(policyIdsToGet), { fields: ['is_managed'], + ignoreMissing: true, }); const hostedPolicies = agentPolicies.reduce>((acc, policy) => { acc[policy.id] = policy.is_managed; diff --git a/x-pack/plugins/fleet/server/services/package_policy.ts b/x-pack/plugins/fleet/server/services/package_policy.ts index ecdff37854b27..0e9c2fda047d1 100644 --- a/x-pack/plugins/fleet/server/services/package_policy.ts +++ b/x-pack/plugins/fleet/server/services/package_policy.ts @@ -54,6 +54,7 @@ import { PackagePolicyIneligibleForUpgradeError, PackagePolicyValidationError, PackagePolicyRestrictionRelatedError, + PackagePolicyNotFoundError, } from '../errors'; import { NewPackagePolicySchema, PackagePolicySchema, UpdatePackagePolicySchema } from '../types'; import type { @@ -293,7 +294,8 @@ class PackagePolicyService implements PackagePolicyServiceInterface { public async getByIDs( soClient: SavedObjectsClientContract, - ids: string[] + ids: string[], + options: { ignoreMissing?: boolean } = {} ): Promise { const packagePolicySO = await soClient.bulkGet( ids.map((id) => ({ @@ -305,11 +307,25 @@ class PackagePolicyService implements PackagePolicyServiceInterface { return null; } - return packagePolicySO.saved_objects.map((so) => ({ - id: so.id, - version: so.version, - ...so.attributes, - })); + return packagePolicySO.saved_objects + .map((so): PackagePolicy | null => { + if (so.error) { + if (options.ignoreMissing && so.error.statusCode === 404) { + return null; + } else if (so.error.statusCode === 404) { + throw new PackagePolicyNotFoundError(`Package policy ${so.id} not found`); + } else { + throw new Error(so.error.message); + } + } + + return { + id: so.id, + version: so.version, + ...so.attributes, + }; + }) + .filter((packagePolicy): packagePolicy is PackagePolicy => packagePolicy !== null); } public async list( @@ -1265,7 +1281,11 @@ export interface PackagePolicyServiceInterface { get(soClient: SavedObjectsClientContract, id: string): Promise; - getByIDs(soClient: SavedObjectsClientContract, ids: string[]): Promise; + getByIDs( + soClient: SavedObjectsClientContract, + ids: string[], + options?: { ignoreMissing?: boolean } + ): Promise; list( soClient: SavedObjectsClientContract, diff --git a/x-pack/plugins/fleet/server/types/rest_spec/agent_policy.ts b/x-pack/plugins/fleet/server/types/rest_spec/agent_policy.ts index 1f793445bf630..c2599d79b3364 100644 --- a/x-pack/plugins/fleet/server/types/rest_spec/agent_policy.ts +++ b/x-pack/plugins/fleet/server/types/rest_spec/agent_policy.ts @@ -9,7 +9,7 @@ import { schema } from '@kbn/config-schema'; import { NewAgentPolicySchema } from '../models'; -import { ListWithKuerySchema } from '.'; +import { ListWithKuerySchema, BulkRequestBodySchema } from './common'; export const GetAgentPoliciesRequestSchema = { query: ListWithKuerySchema.extends({ @@ -17,6 +17,12 @@ export const GetAgentPoliciesRequestSchema = { }), }; +export const BulkGetAgentPoliciesRequestSchema = { + body: BulkRequestBodySchema.extends({ + full: schema.maybe(schema.boolean()), + }), +}; + export const GetOneAgentPolicyRequestSchema = { params: schema.object({ agentPolicyId: schema.string(), diff --git a/x-pack/plugins/fleet/server/types/rest_spec/common.ts b/x-pack/plugins/fleet/server/types/rest_spec/common.ts index 2d12bd5d7c987..0c5f16ff87f90 100644 --- a/x-pack/plugins/fleet/server/types/rest_spec/common.ts +++ b/x-pack/plugins/fleet/server/types/rest_spec/common.ts @@ -22,4 +22,9 @@ export const ListWithKuerySchema = schema.object({ ), }); +export const BulkRequestBodySchema = schema.object({ + ids: schema.arrayOf(schema.string(), { minSize: 1 }), + ignoreMissing: schema.maybe(schema.boolean()), +}); + export type ListWithKuery = TypeOf; diff --git a/x-pack/plugins/fleet/server/types/rest_spec/package_policy.ts b/x-pack/plugins/fleet/server/types/rest_spec/package_policy.ts index b085060286d05..fa7cdce92400b 100644 --- a/x-pack/plugins/fleet/server/types/rest_spec/package_policy.ts +++ b/x-pack/plugins/fleet/server/types/rest_spec/package_policy.ts @@ -12,12 +12,16 @@ import { UpdatePackagePolicyRequestBodySchema, } from '../models'; -import { ListWithKuerySchema } from '.'; +import { ListWithKuerySchema, BulkRequestBodySchema } from './common'; export const GetPackagePoliciesRequestSchema = { query: ListWithKuerySchema, }; +export const BulkGetPackagePoliciesRequestSchema = { + body: BulkRequestBodySchema, +}; + export const GetOnePackagePolicyRequestSchema = { params: schema.object({ packagePolicyId: schema.string(), 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 c85c6f74b1641..e4d87d26cbecc 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 @@ -40,7 +40,9 @@ import './search_bar.scss'; const isMac = navigator.platform.toLowerCase().indexOf('mac') >= 0; -const blurEvent = new FocusEvent('blur'); +const blurEvent = new FocusEvent('focusout', { + bubbles: true, +}); const sortByScore = (a: GlobalSearchResult, b: GlobalSearchResult): number => { if (a.score < b.score) return 1; diff --git a/x-pack/plugins/infra/public/components/logging/log_text_stream/column_headers.tsx b/x-pack/plugins/infra/public/components/logging/log_text_stream/column_headers.tsx index d8c1fe071fe92..30355ea1a9a23 100644 --- a/x-pack/plugins/infra/public/components/logging/log_text_stream/column_headers.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_text_stream/column_headers.tsx @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import React, { useContext } from 'react'; +import React from 'react'; import { transparentize } from 'polished'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; @@ -17,7 +17,7 @@ import { LogEntryColumnWidths, } from './log_entry_column'; import { ASSUMED_SCROLLBAR_WIDTH } from './vertical_scroll_panel'; -import { LogPositionState } from '../../../containers/logs/log_position'; +import { useLogPositionStateContext } from '../../../containers/logs/log_position'; import { localizedDate } from '../../../../common/formatters/datetime'; import { LogColumnRenderConfiguration, @@ -30,7 +30,7 @@ export const LogColumnHeaders: React.FunctionComponent<{ columnConfigurations: LogColumnRenderConfiguration[]; columnWidths: LogEntryColumnWidths; }> = ({ columnConfigurations, columnWidths }) => { - const { firstVisiblePosition } = useContext(LogPositionState.Context); + const { firstVisiblePosition } = useLogPositionStateContext(); return ( {columnConfigurations.map((columnConfiguration) => { diff --git a/x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts b/x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts index 55b554560b743..70d72c25158da 100644 --- a/x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts +++ b/x-pack/plugins/infra/public/containers/logs/log_filter/log_filter_state.ts @@ -105,4 +105,5 @@ export const useLogFilterState = ({ indexPattern }: { indexPattern: DataViewBase }; }; -export const LogFilterState = createContainer(useLogFilterState); +export const [LogFilterStateProvider, useLogFilterStateContext] = + createContainer(useLogFilterState); diff --git a/x-pack/plugins/infra/public/containers/logs/log_filter/with_log_filter_url_state.tsx b/x-pack/plugins/infra/public/containers/logs/log_filter/with_log_filter_url_state.tsx index 5a62cb5e38677..2a5970721f5e5 100644 --- a/x-pack/plugins/infra/public/containers/logs/log_filter/with_log_filter_url_state.tsx +++ b/x-pack/plugins/infra/public/containers/logs/log_filter/with_log_filter_url_state.tsx @@ -6,13 +6,13 @@ */ import * as rt from 'io-ts'; -import React, { useContext } from 'react'; +import React from 'react'; import { Query } from '@kbn/es-query'; import { replaceStateKeyInQueryString, UrlStateContainer } from '../../../utils/url_state'; -import { LogFilterState } from './log_filter_state'; +import { useLogFilterStateContext } from './log_filter_state'; export const WithLogFilterUrlState: React.FC = () => { - const { filterQuery, applyLogFilterQuery } = useContext(LogFilterState.Context); + const { filterQuery, applyLogFilterQuery } = useLogFilterStateContext(); return ( { const [highlightTerms, setHighlightTerms] = useState([]); - const { visibleMidpoint, jumpToTargetPosition, startTimestamp, endTimestamp } = useContext( - LogPositionState.Context - ); + const { visibleMidpoint, jumpToTargetPosition, startTimestamp, endTimestamp } = + useLogPositionStateContext(); const throttledStartTimestamp = useThrottle(startTimestamp, FETCH_THROTTLE_INTERVAL); const throttledEndTimestamp = useThrottle(endTimestamp, FETCH_THROTTLE_INTERVAL); @@ -89,4 +88,5 @@ export const useLogHighlightsState = ({ }; }; -export const LogHighlightsState = createContainer(useLogHighlightsState); +export const [LogHighlightsStateProvider, useLogHighlightsStateContext] = + createContainer(useLogHighlightsState); diff --git a/x-pack/plugins/infra/public/containers/logs/log_position/log_position_state.ts b/x-pack/plugins/infra/public/containers/logs/log_position/log_position_state.ts index 59b7d00431459..521a5bf8562fc 100644 --- a/x-pack/plugins/infra/public/containers/logs/log_position/log_position_state.ts +++ b/x-pack/plugins/infra/public/containers/logs/log_position/log_position_state.ts @@ -249,4 +249,5 @@ export const useLogPositionState: () => LogPositionStateParams & LogPositionCall return { ...state, ...callbacks }; }; -export const LogPositionState = createContainer(useLogPositionState); +export const [LogPositionStateProvider, useLogPositionStateContext] = + createContainer(useLogPositionState); diff --git a/x-pack/plugins/infra/public/containers/logs/log_position/with_log_position_url_state.tsx b/x-pack/plugins/infra/public/containers/logs/log_position/with_log_position_url_state.tsx index c0da683568f39..d4d8075a2598f 100644 --- a/x-pack/plugins/infra/public/containers/logs/log_position/with_log_position_url_state.tsx +++ b/x-pack/plugins/infra/public/containers/logs/log_position/with_log_position_url_state.tsx @@ -5,11 +5,11 @@ * 2.0. */ -import React, { useContext, useMemo } from 'react'; +import React, { useMemo } from 'react'; import { pickTimeKey } from '../../../../common/time'; import { replaceStateKeyInQueryString, UrlStateContainer } from '../../../utils/url_state'; -import { LogPositionState, LogPositionStateParams } from './log_position_state'; +import { useLogPositionStateContext, LogPositionStateParams } from './log_position_state'; import { isValidDatemath, datemathToEpochMillis } from '../../../utils/datemath'; /** @@ -35,7 +35,7 @@ export const WithLogPositionUrlState = () => { endDateExpression, updateDateRange, initialize, - } = useContext(LogPositionState.Context); + } = useLogPositionStateContext(); const urlState = useMemo( () => ({ position: visibleMidpoint ? pickTimeKey(visibleMidpoint) : null, diff --git a/x-pack/plugins/infra/public/containers/logs/log_summary/with_summary.ts b/x-pack/plugins/infra/public/containers/logs/log_summary/with_summary.ts index 1b6d9f850187a..e36ef1caa2c66 100644 --- a/x-pack/plugins/infra/public/containers/logs/log_summary/with_summary.ts +++ b/x-pack/plugins/infra/public/containers/logs/log_summary/with_summary.ts @@ -5,12 +5,11 @@ * 2.0. */ -import { useContext } from 'react'; import useThrottle from 'react-use/lib/useThrottle'; import { useLogViewContext } from '../../../hooks/use_log_view'; import { RendererFunction } from '../../../utils/typed_react'; -import { LogFilterState } from '../log_filter'; -import { LogPositionState } from '../log_position'; +import { useLogFilterStateContext } from '../log_filter'; +import { useLogPositionStateContext } from '../log_position'; import { LogSummaryBuckets, useLogSummary } from './log_summary'; const FETCH_THROTTLE_INTERVAL = 3000; @@ -25,8 +24,8 @@ export const WithSummary = ({ }>; }) => { const { logViewId } = useLogViewContext(); - const { filterQuery } = useContext(LogFilterState.Context); - const { startTimestamp, endTimestamp } = useContext(LogPositionState.Context); + const { filterQuery } = useLogFilterStateContext(); + const { startTimestamp, endTimestamp } = useLogPositionStateContext(); // Keep it reasonably updated for the `now` case, but don't reload all the time when the user scrolls const throttledStartTimestamp = useThrottle(startTimestamp, FETCH_THROTTLE_INTERVAL); diff --git a/x-pack/plugins/infra/public/containers/logs/log_view_configuration.tsx b/x-pack/plugins/infra/public/containers/logs/log_view_configuration.tsx index 98672d6d14861..543cc61d78977 100644 --- a/x-pack/plugins/infra/public/containers/logs/log_view_configuration.tsx +++ b/x-pack/plugins/infra/public/containers/logs/log_view_configuration.tsx @@ -26,7 +26,8 @@ export const useLogViewConfiguration = () => { }; }; -export const LogViewConfiguration = createContainer(useLogViewConfiguration); +export const [LogViewConfigurationProvider, useLogViewConfigurationContext] = + createContainer(useLogViewConfiguration); /** * constants diff --git a/x-pack/plugins/infra/public/containers/logs/view_log_in_context/view_log_in_context.ts b/x-pack/plugins/infra/public/containers/logs/view_log_in_context/view_log_in_context.ts index a389589488d92..b22a73d77cc54 100644 --- a/x-pack/plugins/infra/public/containers/logs/view_log_in_context/view_log_in_context.ts +++ b/x-pack/plugins/infra/public/containers/logs/view_log_in_context/view_log_in_context.ts @@ -42,4 +42,5 @@ export const useViewLogInContext = ( ]; }; -export const ViewLogInContext = createContainer(useViewLogInContext); +export const [ViewLogInContextProvider, useViewLogInProviderContext] = + createContainer(useViewLogInContext); diff --git a/x-pack/plugins/infra/public/containers/logs/with_log_textview.tsx b/x-pack/plugins/infra/public/containers/logs/with_log_textview.tsx index c981a113bf2f4..f57368709467d 100644 --- a/x-pack/plugins/infra/public/containers/logs/with_log_textview.tsx +++ b/x-pack/plugins/infra/public/containers/logs/with_log_textview.tsx @@ -5,10 +5,14 @@ * 2.0. */ -import React, { useContext, useMemo } from 'react'; +import React, { useMemo } from 'react'; import { UrlStateContainer } from '../../utils/url_state'; -import { availableTextScales, LogViewConfiguration, TextScale } from './log_view_configuration'; +import { + availableTextScales, + useLogViewConfigurationContext, + TextScale, +} from './log_view_configuration'; interface LogTextviewUrlState { textScale?: TextScale; @@ -16,9 +20,7 @@ interface LogTextviewUrlState { } export const WithLogTextviewUrlState = () => { - const { textScale, textWrap, setTextScale, setTextWrap } = useContext( - LogViewConfiguration.Context - ); + const { textScale, textWrap, setTextScale, setTextWrap } = useLogViewConfigurationContext(); const urlState = useMemo(() => ({ textScale, wrap: textWrap }), [textScale, textWrap]); diff --git a/x-pack/plugins/infra/public/containers/metrics_explorer/with_metrics_explorer_options_url_state.tsx b/x-pack/plugins/infra/public/containers/metrics_explorer/with_metrics_explorer_options_url_state.tsx index e66191923e39a..b192bf54e4829 100644 --- a/x-pack/plugins/infra/public/containers/metrics_explorer/with_metrics_explorer_options_url_state.tsx +++ b/x-pack/plugins/infra/public/containers/metrics_explorer/with_metrics_explorer_options_url_state.tsx @@ -5,13 +5,13 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set'; -import React, { useContext, useMemo } from 'react'; +import { set } from '@kbn/safer-lodash-set'; +import React, { useMemo } from 'react'; import { ThrowReporter } from 'io-ts/lib/ThrowReporter'; import { UrlStateContainer } from '../../utils/url_state'; import { MetricsExplorerOptions, - MetricsExplorerOptionsContainer, + useMetricsExplorerOptionsContainerContext, MetricsExplorerTimeOptions, MetricsExplorerChartOptions, metricExplorerOptionsRT, @@ -33,7 +33,7 @@ export const WithMetricsExplorerOptionsUrlState = () => { currentTimerange, setOptions: setRawOptions, setTimeRange, - } = useContext(MetricsExplorerOptionsContainer.Context); + } = useMetricsExplorerOptionsContainerContext(); const setOptions = (value: MetricsExplorerOptions) => { setRawOptions(value); diff --git a/x-pack/plugins/infra/public/containers/metrics_source/source.tsx b/x-pack/plugins/infra/public/containers/metrics_source/source.tsx index 393cad266a123..6a7c7aedccc62 100644 --- a/x-pack/plugins/infra/public/containers/metrics_source/source.tsx +++ b/x-pack/plugins/infra/public/containers/metrics_source/source.tsx @@ -157,5 +157,4 @@ export const useSource = ({ sourceId }: { sourceId: string }) => { }; }; -export const Source = createContainer(useSource); -export const [SourceProvider, useSourceContext] = Source; +export const [SourceProvider, useSourceContext] = createContainer(useSource); diff --git a/x-pack/plugins/infra/public/containers/saved_view/saved_view.tsx b/x-pack/plugins/infra/public/containers/saved_view/saved_view.tsx index e2bb50e0dc2da..8eb3d4c50de1a 100644 --- a/x-pack/plugins/infra/public/containers/saved_view/saved_view.tsx +++ b/x-pack/plugins/infra/public/containers/saved_view/saved_view.tsx @@ -10,14 +10,14 @@ import * as rt from 'io-ts'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; import { constant, identity } from 'fp-ts/lib/function'; -import { useCallback, useMemo, useState, useEffect, useContext } from 'react'; +import { useCallback, useMemo, useState, useEffect } from 'react'; import { i18n } from '@kbn/i18n'; import { SimpleSavedObject, SavedObjectAttributes } from '@kbn/core/public'; import { useUrlState } from '../../utils/use_url_state'; import { useFindSavedObject } from '../../hooks/use_find_saved_object'; import { useCreateSavedObject } from '../../hooks/use_create_saved_object'; import { useDeleteSavedObject } from '../../hooks/use_delete_saved_object'; -import { Source } from '../metrics_source'; +import { useSourceContext } from '../metrics_source'; import { metricsExplorerViewSavedObjectName } from '../../../common/saved_objects/metrics_explorer_view'; import { inventoryViewSavedObjectName } from '../../../common/saved_objects/inventory_view'; import { useSourceConfigurationFormState } from '../../pages/metrics/settings/source_configuration_form_state'; @@ -59,7 +59,7 @@ export const useSavedView = (props: Props) => { sourceExists, createSourceConfiguration, updateSourceConfiguration, - } = useContext(Source.Context); + } = useSourceContext(); const { viewType, defaultViewState } = props; type ViewState = typeof defaultViewState; const { diff --git a/x-pack/plugins/infra/public/containers/with_source/with_source.tsx b/x-pack/plugins/infra/public/containers/with_source/with_source.tsx index 148b679018c7d..b2730cbf2e880 100644 --- a/x-pack/plugins/infra/public/containers/with_source/with_source.tsx +++ b/x-pack/plugins/infra/public/containers/with_source/with_source.tsx @@ -5,14 +5,14 @@ * 2.0. */ -import React, { useContext } from 'react'; +import React from 'react'; import { MetricsSourceConfigurationProperties, PartialMetricsSourceConfigurationProperties, } from '../../../common/metrics_sources'; import { RendererFunction } from '../../utils/typed_react'; -import { Source } from '../metrics_source'; +import { useSourceContext } from '../metrics_source'; import { CreateDerivedIndexPattern } from '../metrics_source'; interface WithSourceProps { @@ -52,7 +52,7 @@ export const WithSource: React.FunctionComponent = ({ children loadSourceFailureMessage, updateSourceConfiguration, version, - } = useContext(Source.Context); + } = useSourceContext(); return children({ create: createSourceConfiguration, diff --git a/x-pack/plugins/infra/public/pages/link_to/link_to_logs.test.tsx b/x-pack/plugins/infra/public/pages/link_to/link_to_logs.test.tsx index 6f4b0e73f0c33..5ed7ab99b4a3e 100644 --- a/x-pack/plugins/infra/public/pages/link_to/link_to_logs.test.tsx +++ b/x-pack/plugins/infra/public/pages/link_to/link_to_logs.test.tsx @@ -11,7 +11,7 @@ import React from 'react'; import { Route, Router, Switch } from 'react-router-dom'; import { httpServiceMock } from '@kbn/core/public/mocks'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; -import { KibanaPageTemplate } from '@kbn/shared-ux-components'; +import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; import { useLogView } from '../../hooks/use_log_view'; import { createLoadedUseLogViewMock, diff --git a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/page_results_content.tsx b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/page_results_content.tsx index 13dd004a1a5ce..6dff4b41ecf53 100644 --- a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/page_results_content.tsx +++ b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/page_results_content.tsx @@ -22,7 +22,7 @@ import { DatasetsSelector } from '../../../components/logging/log_analysis_resul import { RecreateJobButton } from '../../../components/logging/log_analysis_setup/create_job_button'; import { useLogAnalysisCapabilitiesContext } from '../../../containers/logs/log_analysis/log_analysis_capabilities'; import { useLogEntryCategoriesModuleContext } from '../../../containers/logs/log_analysis/modules/log_entry_categories'; -import { ViewLogInContext } from '../../../containers/logs/view_log_in_context'; +import { ViewLogInContextProvider } from '../../../containers/logs/view_log_in_context'; import { useKibanaContextForPlugin } from '../../../hooks/use_kibana'; import { useLogViewContext } from '../../../hooks/use_log_view'; import { LogsPageTemplate } from '../page_template'; @@ -205,7 +205,7 @@ export const LogEntryCategoriesResultsContent: React.FunctionComponent< }); return ( - - + ); }; diff --git a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/sections/top_categories/category_example_message.tsx b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/sections/top_categories/category_example_message.tsx index be5806d2b3064..091cbb1ba07b7 100644 --- a/x-pack/plugins/infra/public/pages/logs/log_entry_categories/sections/top_categories/category_example_message.tsx +++ b/x-pack/plugins/infra/public/pages/logs/log_entry_categories/sections/top_categories/category_example_message.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React, { useState, useCallback, useContext } from 'react'; +import React, { useState, useCallback } from 'react'; import { i18n } from '@kbn/i18n'; import { encode } from 'rison-node'; import moment from 'moment'; @@ -17,7 +17,7 @@ import { getFriendlyNameForPartitionId, partitionField, } from '../../../../../../common/log_analysis'; -import { ViewLogInContext } from '../../../../../containers/logs/view_log_in_context'; +import { useViewLogInProviderContext } from '../../../../../containers/logs/view_log_in_context'; import { LogEntryColumn, LogEntryFieldColumn, @@ -41,7 +41,7 @@ export const CategoryExampleMessage: React.FunctionComponent<{ context: LogEntryContext; }> = ({ id, dataset, message, timestamp, timeRange, tiebreaker, context }) => { const trackMetric = useUiTracker({ app: 'infra_logs' }); - const [, { setContextEntry }] = useContext(ViewLogInContext.Context); + const [, { setContextEntry }] = useViewLogInProviderContext(); // handle special cases for the dataset value const humanFriendlyDataset = getFriendlyNameForPartitionId(dataset); diff --git a/x-pack/plugins/infra/public/pages/logs/log_entry_rate/page_providers.tsx b/x-pack/plugins/infra/public/pages/logs/log_entry_rate/page_providers.tsx index 53e74ecf54320..f944b089d5d7d 100644 --- a/x-pack/plugins/infra/public/pages/logs/log_entry_rate/page_providers.tsx +++ b/x-pack/plugins/infra/public/pages/logs/log_entry_rate/page_providers.tsx @@ -11,7 +11,7 @@ import { LogSourceErrorPage } from '../../../components/logging/log_source_error import { SourceLoadingPage } from '../../../components/source_loading_page'; import { LogEntryCategoriesModuleProvider } from '../../../containers/logs/log_analysis/modules/log_entry_categories'; import { LogEntryRateModuleProvider } from '../../../containers/logs/log_analysis/modules/log_entry_rate'; -import { LogFlyout } from '../../../containers/logs/log_flyout'; +import { LogEntryFlyoutProvider } from '../../../containers/logs/log_flyout'; import { useActiveKibanaSpace } from '../../../hooks/use_kibana_space'; import { useLogViewContext } from '../../../hooks/use_log_view'; @@ -38,7 +38,7 @@ export const LogEntryRatePageProviders: React.FunctionComponent = ({ children }) return ; } else if (resolvedLogView != null) { return ( - + {children} - + ); } else { return null; diff --git a/x-pack/plugins/infra/public/pages/logs/page_template.tsx b/x-pack/plugins/infra/public/pages/logs/page_template.tsx index 32a5be3e071c7..3fb8884f963c4 100644 --- a/x-pack/plugins/infra/public/pages/logs/page_template.tsx +++ b/x-pack/plugins/infra/public/pages/logs/page_template.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import type { LazyObservabilityPageTemplateProps } from '@kbn/observability-plugin/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { KibanaPageTemplateProps } from '@kbn/shared-ux-components'; +import { NoDataConfig } from '@kbn/shared-ux-page-kibana-template'; import { useKibanaContextForPlugin } from '../../hooks/use_kibana'; interface LogsPageTemplateProps extends LazyObservabilityPageTemplateProps { @@ -35,7 +35,7 @@ export const LogsPageTemplate: React.FC = ({ const { http } = useKibana().services; const basePath = http!.basePath.get(); - const noDataConfig: KibanaPageTemplateProps['noDataConfig'] = hasData + const noDataConfig: NoDataConfig | undefined = hasData ? undefined : { solution: i18n.translate('xpack.infra.logs.noDataConfig.solutionName', { diff --git a/x-pack/plugins/infra/public/pages/logs/stream/page_logs_content.tsx b/x-pack/plugins/infra/public/pages/logs/stream/page_logs_content.tsx index 2cb7b2c6f5a7b..18ac30bb35e14 100644 --- a/x-pack/plugins/infra/public/pages/logs/stream/page_logs_content.tsx +++ b/x-pack/plugins/infra/public/pages/logs/stream/page_logs_content.tsx @@ -7,7 +7,7 @@ import { EuiSpacer } from '@elastic/eui'; import type { Query } from '@kbn/es-query'; -import React, { useCallback, useContext, useEffect, useMemo } from 'react'; +import React, { useCallback, useEffect, useMemo } from 'react'; import usePrevious from 'react-use/lib/usePrevious'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; import { LogEntry } from '../../../../common/log_entry'; @@ -18,17 +18,17 @@ import { LogMinimap } from '../../../components/logging/log_minimap'; import { ScrollableLogTextStreamView } from '../../../components/logging/log_text_stream'; import { LogEntryStreamItem } from '../../../components/logging/log_text_stream/item'; import { PageContent } from '../../../components/page'; -import { LogFilterState } from '../../../containers/logs/log_filter'; +import { useLogFilterStateContext } from '../../../containers/logs/log_filter'; import { useLogEntryFlyoutContext, WithFlyoutOptionsUrlState, } from '../../../containers/logs/log_flyout'; -import { LogHighlightsState } from '../../../containers/logs/log_highlights'; -import { LogPositionState } from '../../../containers/logs/log_position'; +import { useLogHighlightsStateContext } from '../../../containers/logs/log_highlights'; +import { useLogPositionStateContext } from '../../../containers/logs/log_position'; import { useLogStreamContext } from '../../../containers/logs/log_stream'; import { WithSummary } from '../../../containers/logs/log_summary'; -import { LogViewConfiguration } from '../../../containers/logs/log_view_configuration'; -import { ViewLogInContext } from '../../../containers/logs/view_log_in_context'; +import { useLogViewConfigurationContext } from '../../../containers/logs/log_view_configuration'; +import { useViewLogInProviderContext } from '../../../containers/logs/view_log_in_context'; import { WithLogTextviewUrlState } from '../../../containers/logs/with_log_textview'; import { useLogViewContext } from '../../../hooks/use_log_view'; import { datemathToEpochMillis, isValidDatemath } from '../../../utils/datemath'; @@ -39,7 +39,7 @@ const PAGE_THRESHOLD = 2; export const LogsPageLogsContent: React.FunctionComponent = () => { const { resolvedLogView, logView, logViewId } = useLogViewContext(); - const { textScale, textWrap } = useContext(LogViewConfiguration.Context); + const { textScale, textWrap } = useLogViewConfigurationContext(); const { surroundingLogsId, setSurroundingLogsId, @@ -64,8 +64,8 @@ export const LogsPageLogsContent: React.FunctionComponent = () => { endDateExpression, updateDateRange, lastCompleteDateRangeExpressionUpdate, - } = useContext(LogPositionState.Context); - const { filterQuery, applyLogFilterQuery } = useContext(LogFilterState.Context); + } = useLogPositionStateContext(); + const { filterQuery, applyLogFilterQuery } = useLogFilterStateContext(); const { isReloading, @@ -132,9 +132,8 @@ export const LogsPageLogsContent: React.FunctionComponent = () => { prevLastCompleteDateRangeExpressionUpdate, ]); - const { logSummaryHighlights, currentHighlightKey, logEntryHighlightsById } = useContext( - LogHighlightsState.Context - ); + const { logSummaryHighlights, currentHighlightKey, logEntryHighlightsById } = + useLogHighlightsStateContext(); const items = useMemo( () => @@ -147,7 +146,7 @@ export const LogsPageLogsContent: React.FunctionComponent = () => { [entries, isReloading, logEntryHighlightsById] ); - const [, { setContextEntry }] = useContext(ViewLogInContext.Context); + const [, { setContextEntry }] = useViewLogInProviderContext(); const handleDateRangeExtension = useCallback( (newDateRange) => { diff --git a/x-pack/plugins/infra/public/pages/logs/stream/page_providers.tsx b/x-pack/plugins/infra/public/pages/logs/stream/page_providers.tsx index 11aa74ca862ad..ea2af542586a2 100644 --- a/x-pack/plugins/infra/public/pages/logs/stream/page_providers.tsx +++ b/x-pack/plugins/infra/public/pages/logs/stream/page_providers.tsx @@ -5,29 +5,37 @@ * 2.0. */ -import React, { useContext } from 'react'; -import { LogFilterState, WithLogFilterUrlState } from '../../../containers/logs/log_filter'; -import { LogFlyout } from '../../../containers/logs/log_flyout'; -import { LogHighlightsState } from '../../../containers/logs/log_highlights/log_highlights'; -import { LogPositionState, WithLogPositionUrlState } from '../../../containers/logs/log_position'; +import React from 'react'; +import { + LogFilterStateProvider, + useLogFilterStateContext, + WithLogFilterUrlState, +} from '../../../containers/logs/log_filter'; +import { LogEntryFlyoutProvider } from '../../../containers/logs/log_flyout'; +import { LogHighlightsStateProvider } from '../../../containers/logs/log_highlights/log_highlights'; +import { + LogPositionStateProvider, + useLogPositionStateContext, + WithLogPositionUrlState, +} from '../../../containers/logs/log_position'; import { LogStreamProvider, useLogStreamContext } from '../../../containers/logs/log_stream'; -import { LogViewConfiguration } from '../../../containers/logs/log_view_configuration'; -import { ViewLogInContext } from '../../../containers/logs/view_log_in_context'; +import { LogViewConfigurationProvider } from '../../../containers/logs/log_view_configuration'; +import { ViewLogInContextProvider } from '../../../containers/logs/view_log_in_context'; import { useLogViewContext } from '../../../hooks/use_log_view'; -const LogFilterStateProvider: React.FC = ({ children }) => { +const LogFilterState: React.FC = ({ children }) => { const { derivedDataView } = useLogViewContext(); return ( - + {children} - + ); }; -const ViewLogInContextProvider: React.FC = ({ children }) => { - const { startTimestamp, endTimestamp } = useContext(LogPositionState.Context); +const ViewLogInContext: React.FC = ({ children }) => { + const { startTimestamp, endTimestamp } = useLogPositionStateContext(); const { logViewId } = useLogViewContext(); if (!startTimestamp || !endTimestamp) { @@ -35,22 +43,21 @@ const ViewLogInContextProvider: React.FC = ({ children }) => { } return ( - {children} - + ); }; const LogEntriesStateProvider: React.FC = ({ children }) => { const { logViewId } = useLogViewContext(); - const { startTimestamp, endTimestamp, targetPosition, isInitialized } = useContext( - LogPositionState.Context - ); - const { filterQuery } = useContext(LogFilterState.Context); + const { startTimestamp, endTimestamp, targetPosition, isInitialized } = + useLogPositionStateContext(); + const { filterQuery } = useLogFilterStateContext(); // Don't render anything if the date range is incorrect. if (!startTimestamp || !endTimestamp) { @@ -76,10 +83,10 @@ const LogEntriesStateProvider: React.FC = ({ children }) => { ); }; -const LogHighlightsStateProvider: React.FC = ({ children }) => { +const LogHighlightsState: React.FC = ({ children }) => { const { logViewId, logView } = useLogViewContext(); const { topCursor, bottomCursor, entries } = useLogStreamContext(); - const { filterQuery } = useContext(LogFilterState.Context); + const { filterQuery } = useLogFilterStateContext(); const highlightsProps = { sourceId: logViewId, @@ -90,7 +97,7 @@ const LogHighlightsStateProvider: React.FC = ({ children }) => { size: entries.length, filterQuery: filterQuery?.serializedQuery ?? null, }; - return {children}; + return {children}; }; export const LogsPageProviders: React.FunctionComponent = ({ children }) => { @@ -102,19 +109,19 @@ export const LogsPageProviders: React.FunctionComponent = ({ children }) => { } return ( - - - + + + - - + + - {children} + {children} - - - - - + + + + + ); }; diff --git a/x-pack/plugins/infra/public/pages/logs/stream/page_toolbar.tsx b/x-pack/plugins/infra/public/pages/logs/stream/page_toolbar.tsx index e3b2f01b6712e..6076849b79f12 100644 --- a/x-pack/plugins/infra/public/pages/logs/stream/page_toolbar.tsx +++ b/x-pack/plugins/infra/public/pages/logs/stream/page_toolbar.tsx @@ -8,7 +8,7 @@ import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { Query } from '@kbn/es-query'; import { i18n } from '@kbn/i18n'; -import React, { useContext } from 'react'; +import React from 'react'; import { QueryStringInput } from '@kbn/unified-search-plugin/public'; import { DataView } from '@kbn/data-views-plugin/public'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; @@ -17,21 +17,20 @@ import { LogDatepicker } from '../../../components/logging/log_datepicker'; import { LogHighlightsMenu } from '../../../components/logging/log_highlights_menu'; import { LogTextScaleControls } from '../../../components/logging/log_text_scale_controls'; import { LogTextWrapControls } from '../../../components/logging/log_text_wrap_controls'; -import { LogFilterState } from '../../../containers/logs/log_filter'; -import { LogFlyout } from '../../../containers/logs/log_flyout'; -import { LogHighlightsState } from '../../../containers/logs/log_highlights/log_highlights'; -import { LogPositionState } from '../../../containers/logs/log_position'; -import { LogViewConfiguration } from '../../../containers/logs/log_view_configuration'; +import { useLogFilterStateContext } from '../../../containers/logs/log_filter'; +import { useLogEntryFlyoutContext } from '../../../containers/logs/log_flyout'; +import { useLogHighlightsStateContext } from '../../../containers/logs/log_highlights/log_highlights'; +import { useLogPositionStateContext } from '../../../containers/logs/log_position'; +import { useLogViewConfigurationContext } from '../../../containers/logs/log_view_configuration'; import { useLogViewContext } from '../../../hooks/use_log_view'; export const LogsToolbar = () => { const { derivedDataView } = useLogViewContext(); - const { availableTextScales, setTextScale, setTextWrap, textScale, textWrap } = useContext( - LogViewConfiguration.Context - ); + const { availableTextScales, setTextScale, setTextWrap, textScale, textWrap } = + useLogViewConfigurationContext(); const { filterQueryDraft, isFilterQueryDraftValid, applyLogFilterQuery, setLogFilterQueryDraft } = - useContext(LogFilterState.Context); - const { setSurroundingLogsId } = useContext(LogFlyout.Context); + useLogFilterStateContext(); + const { setSurroundingLogsId } = useLogEntryFlyoutContext(); const { setHighlightTerms, @@ -41,7 +40,7 @@ export const LogsToolbar = () => { hasNextHighlight, goToPreviousHighlight, goToNextHighlight, - } = useContext(LogHighlightsState.Context); + } = useLogHighlightsStateContext(); const { isStreaming, startLiveStreaming, @@ -49,7 +48,7 @@ export const LogsToolbar = () => { startDateExpression, endDateExpression, updateDateRange, - } = useContext(LogPositionState.Context); + } = useLogPositionStateContext(); return (
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 7afc8e19c43ee..9b4a2ffb4185b 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 @@ -15,10 +15,10 @@ import { } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { isEmpty } from 'lodash'; -import React, { useCallback, useContext, useMemo } from 'react'; +import React, { useCallback, useMemo } from 'react'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; import { LogEntry } from '../../../../common/log_entry'; -import { ViewLogInContext } from '../../../containers/logs/view_log_in_context'; +import { useViewLogInProviderContext } from '../../../containers/logs/view_log_in_context'; import { useViewportDimensions } from '../../../utils/use_viewport_dimensions'; import { LogStream } from '../../../components/log_stream'; @@ -26,7 +26,7 @@ const MODAL_MARGIN = 25; export const PageViewLogInContext: React.FC = () => { const [{ contextEntry, startTimestamp, endTimestamp, sourceId }, { setContextEntry }] = - useContext(ViewLogInContext.Context); + useViewLogInProviderContext(); const closeModal = useCallback(() => setContextEntry(undefined), [setContextEntry]); const { width: vw, height: vh } = useViewportDimensions(); diff --git a/x-pack/plugins/infra/public/pages/metrics/index.tsx b/x-pack/plugins/infra/public/pages/metrics/index.tsx index f4d42b5994eb5..e2f4705f17b7d 100644 --- a/x-pack/plugins/infra/public/pages/metrics/index.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/index.tsx @@ -20,11 +20,12 @@ import { HelpCenterContent } from '../../components/help_center_content'; import { useReadOnlyBadge } from '../../hooks/use_readonly_badge'; import { MetricsExplorerOptionsContainer, + useMetricsExplorerOptionsContainerContext, DEFAULT_METRICS_EXPLORER_VIEW_STATE, } from './metrics_explorer/hooks/use_metrics_explorer_options'; import { WithMetricsExplorerOptionsUrlState } from '../../containers/metrics_explorer/with_metrics_explorer_options_url_state'; import { WithSource } from '../../containers/with_source'; -import { Source } from '../../containers/metrics_source'; +import { SourceProvider } from '../../containers/metrics_source'; import { MetricsExplorerPage } from './metrics_explorer'; import { SnapshotPage } from './inventory_view'; import { MetricDetail } from './metric_detail'; @@ -65,7 +66,7 @@ export const InfrastructurePage = ({ match }: RouteComponentProps) => { return ( - + @@ -109,7 +110,7 @@ export const InfrastructurePage = ({ match }: RouteComponentProps) => { render={(props) => ( {({ configuration, createDerivedIndexPattern }) => ( - + {configuration ? ( { ) : ( )} - + )} )} @@ -132,7 +133,7 @@ export const InfrastructurePage = ({ match }: RouteComponentProps) => { - + ); }; @@ -142,7 +143,7 @@ const PageContent = (props: { createDerivedIndexPattern: CreateDerivedIndexPattern; }) => { const { createDerivedIndexPattern, configuration } = props; - const { options } = useContext(MetricsExplorerOptionsContainer.Context); + const { options } = useMetricsExplorerOptionsContainerContext(); return ( { const nodeId = props.node.id; const nodeType = props.nodeType as InventoryItemType; const inventoryModel = findInventoryModel(nodeType); - const { sourceId } = useContext(Source.Context); + const { sourceId } = useSourceContext(); const { currentTimeRange } = useWaffleTimeContext(); const { loading, metadata } = useMetadata( nodeId, diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/properties/index.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/properties/index.tsx index 22c2af5496a60..65fa3bcfd0164 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/properties/index.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/node_details/tabs/properties/index.tsx @@ -5,12 +5,12 @@ * 2.0. */ -import React, { useCallback, useContext, useMemo } from 'react'; +import React, { useCallback, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiLoadingChart } from '@elastic/eui'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; import { TabContent, TabProps } from '../shared'; -import { Source } from '../../../../../../../containers/metrics_source'; +import { useSourceContext } from '../../../../../../../containers/metrics_source'; import { findInventoryModel } from '../../../../../../../../common/inventory_models'; import { InventoryItemType } from '../../../../../../../../common/inventory_models/types'; import { useMetadata } from '../../../../../metric_detail/hooks/use_metadata'; @@ -23,7 +23,7 @@ const TabComponent = (props: TabProps) => { const nodeId = props.node.id; const nodeType = props.nodeType as InventoryItemType; const inventoryModel = findInventoryModel(nodeType); - const { sourceId } = useContext(Source.Context); + const { sourceId } = useSourceContext(); const { currentTimeRange } = useWaffleTimeContext(); const { applyFilterQuery } = useWaffleFiltersContext(); const { loading: metadataLoading, metadata } = useMetadata( diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/search_bar.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/search_bar.tsx index 1b9e33a0c4dfb..7386322774442 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/search_bar.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/search_bar.tsx @@ -5,15 +5,15 @@ * 2.0. */ -import React, { useContext } from 'react'; +import React from 'react'; import { i18n } from '@kbn/i18n'; -import { Source } from '../../../../containers/metrics_source'; +import { useSourceContext } from '../../../../containers/metrics_source'; import { AutocompleteField } from '../../../../components/autocomplete_field'; import { WithKueryAutocompletion } from '../../../../containers/with_kuery_autocompletion'; import { useWaffleFiltersContext } from '../hooks/use_waffle_filters'; export const SearchBar = () => { - const { createDerivedIndexPattern } = useContext(Source.Context); + const { createDerivedIndexPattern } = useSourceContext(); const { applyFilterQueryFromKueryExpression, filterQueryDraft, diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/index.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/index.tsx index 47e8d739d73e8..0c00b87722c8c 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/index.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/index.tsx @@ -7,7 +7,7 @@ import { EuiErrorBoundary } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import React, { useContext } from 'react'; +import React from 'react'; import { useTrackPageview } from '@kbn/observability-plugin/public'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; import { APP_WRAPPER_CLASS } from '@kbn/core/public'; @@ -17,7 +17,7 @@ import { DocumentTitle } from '../../../components/document_title'; import { SourceErrorPage } from '../../../components/source_error_page'; import { SourceLoadingPage } from '../../../components/source_loading_page'; -import { Source } from '../../../containers/metrics_source'; +import { useSourceContext } from '../../../containers/metrics_source'; import { useMetricsBreadcrumbs } from '../../../hooks/use_metrics_breadcrumbs'; import { LayoutView } from './components/layout_view'; import { SavedViewProvider } from '../../../containers/saved_view/saved_view'; @@ -36,7 +36,7 @@ export const SnapshotPage = () => { loadSource, source, metricIndicesExist, - } = useContext(Source.Context); + } = useSourceContext(); useTrackPageview({ app: 'infra_metrics', path: 'inventory' }); useTrackPageview({ app: 'infra_metrics', path: 'inventory', delay: 15000 }); const { source: optionsSource } = useWaffleOptionsContext(); diff --git a/x-pack/plugins/infra/public/pages/metrics/metric_detail/components/node_details_page.tsx b/x-pack/plugins/infra/public/pages/metrics/metric_detail/components/node_details_page.tsx index cf766bdb104e5..339374678ab7f 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metric_detail/components/node_details_page.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/metric_detail/components/node_details_page.tsx @@ -5,11 +5,11 @@ * 2.0. */ -import React, { useCallback, useEffect, useState, useContext } from 'react'; +import React, { useCallback, useEffect, useState } from 'react'; import dateMath from '@kbn/datemath'; import moment from 'moment'; import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { Source } from '../../../../containers/metrics_source'; +import { useSourceContext } from '../../../../containers/metrics_source'; import { InventoryMetric, InventoryItemType } from '../../../../../common/inventory_models/types'; import { useNodeDetails } from '../hooks/use_node_details'; import { MetricsSideNav } from './side_nav'; @@ -53,7 +53,7 @@ const parseRange = (range: MetricsTimeInput) => { }; export const NodeDetailsPage = (props: Props) => { - const { metricIndicesExist } = useContext(Source.Context); + const { metricIndicesExist } = useSourceContext(); const [parsedTimeRange, setParsedTimeRange] = useState(parseRange(props.timeRange)); const { metrics, loading, makeRequest, error } = useNodeDetails( props.requiredMetrics, diff --git a/x-pack/plugins/infra/public/pages/metrics/metric_detail/index.tsx b/x-pack/plugins/infra/public/pages/metrics/metric_detail/index.tsx index e6843b98cf701..823b9d703f502 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metric_detail/index.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/metric_detail/index.tsx @@ -6,14 +6,14 @@ */ import { i18n } from '@kbn/i18n'; -import React, { useContext, useState } from 'react'; +import React, { useState } from 'react'; import { EuiTheme, withTheme } from '@kbn/kibana-react-plugin/common'; import { useLinkProps } from '@kbn/observability-plugin/public'; import { DocumentTitle } from '../../../components/document_title'; import { withMetricPageProviders } from './page_providers'; import { useMetadata } from './hooks/use_metadata'; import { useMetricsBreadcrumbs } from '../../../hooks/use_metrics_breadcrumbs'; -import { Source } from '../../../containers/metrics_source'; +import { useSourceContext } from '../../../containers/metrics_source'; import { InfraLoadingPanel } from '../../../components/loading'; import { findInventoryModel } from '../../../../common/inventory_models'; import { NavItem } from './lib/side_nav_context'; @@ -38,7 +38,7 @@ export const MetricDetail = withMetricPageProviders( const nodeId = match.params.node; const nodeType = match.params.type as InventoryItemType; const inventoryModel = findInventoryModel(nodeType); - const { sourceId, metricIndicesExist } = useContext(Source.Context); + const { sourceId, metricIndicesExist } = useSourceContext(); const { timeRange, diff --git a/x-pack/plugins/infra/public/pages/metrics/metric_detail/page_providers.tsx b/x-pack/plugins/infra/public/pages/metrics/metric_detail/page_providers.tsx index 6f44d49ddce90..eec4c7db0977b 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metric_detail/page_providers.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/metric_detail/page_providers.tsx @@ -7,7 +7,7 @@ import { EuiErrorBoundary } from '@elastic/eui'; import React from 'react'; -import { Source } from '../../../containers/metrics_source'; +import { SourceProvider } from '../../../containers/metrics_source'; import { MetricsTimeProvider } from './hooks/use_metrics_time'; export const withMetricPageProviders = @@ -15,10 +15,10 @@ export const withMetricPageProviders = (props: T) => ( - + - + ); diff --git a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/helpers/create_tsvb_link.ts b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/helpers/create_tsvb_link.ts index 7db25ae6898f1..a4e5cc4b92791 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/helpers/create_tsvb_link.ts +++ b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/components/helpers/create_tsvb_link.ts @@ -7,7 +7,7 @@ import { encode } from 'rison-node'; import uuid from 'uuid'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { LinkDescriptor } from '@kbn/observability-plugin/public'; import { TIMESTAMP_FIELD } from '../../../../../../common/constants'; import { MetricsSourceConfigurationProperties } from '../../../../../../common/metrics_sources'; diff --git a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.test.tsx b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.test.tsx index 67d3a71b6c1d4..3cd74c3560aa2 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.test.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.test.tsx @@ -25,9 +25,7 @@ const renderUseMetricsExplorerStateHook = () => renderHook((props) => useMetricsExplorerState(props.source, props.derivedIndexPattern), { initialProps: { source, derivedIndexPattern }, wrapper: ({ children }) => ( - - {children} - + {children} ), }); diff --git a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.ts b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.ts index 39eb7c928997b..4842125a6ff0c 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.ts +++ b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metric_explorer_state.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useState, useCallback, useContext } from 'react'; +import { useState, useCallback } from 'react'; import { DataViewBase } from '@kbn/es-query'; import { MetricsSourceConfigurationProperties } from '../../../../../common/metrics_sources'; import { @@ -14,7 +14,7 @@ import { } from '../../../../../common/http_api/metrics_explorer'; import { useMetricsExplorerData } from './use_metrics_explorer_data'; import { - MetricsExplorerOptionsContainer, + useMetricsExplorerOptionsContainerContext, MetricsExplorerChartOptions, MetricsExplorerTimeOptions, MetricsExplorerOptions, @@ -42,7 +42,7 @@ export const useMetricsExplorerState = ( setChartOptions, setTimeRange, setOptions, - } = useContext(MetricsExplorerOptionsContainer.Context); + } = useMetricsExplorerOptionsContainerContext(); const { loading, error, data, loadData } = useMetricsExplorerData( options, diff --git a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_options.ts b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_options.ts index 8bf64edcf8970..02cab766c57e9 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_options.ts +++ b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/hooks/use_metrics_explorer_options.ts @@ -208,4 +208,5 @@ export const useMetricsExplorerOptions = () => { }; }; -export const MetricsExplorerOptionsContainer = createContainer(useMetricsExplorerOptions); +export const [MetricsExplorerOptionsContainer, useMetricsExplorerOptionsContainerContext] = + createContainer(useMetricsExplorerOptions); diff --git a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/index.tsx b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/index.tsx index a475ae1c88c9a..f5269b99fd5c9 100644 --- a/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/index.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/metrics_explorer/index.tsx @@ -7,7 +7,7 @@ import { EuiErrorBoundary } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import React, { useEffect, useContext } from 'react'; +import React, { useEffect } from 'react'; import { useTrackPageview } from '@kbn/observability-plugin/public'; import { MetricsSourceConfigurationProperties } from '../../../../common/metrics_sources'; import { useMetricsBreadcrumbs } from '../../../hooks/use_metrics_breadcrumbs'; @@ -16,7 +16,7 @@ import { NoData } from '../../../components/empty_states'; import { MetricsExplorerCharts } from './components/charts'; import { MetricsExplorerToolbar } from './components/toolbar'; import { useMetricsExplorerState } from './hooks/use_metric_explorer_state'; -import { Source } from '../../../containers/metrics_source'; +import { useSourceContext } from '../../../containers/metrics_source'; import { useSavedViewContext } from '../../../containers/saved_view/saved_view'; import { MetricsPageTemplate } from '../page_template'; import { metricsExplorerTitle } from '../../../translations'; @@ -51,7 +51,7 @@ export const MetricsExplorerPage = ({ source, derivedIndexPattern }: MetricsExpl useTrackPageview({ app: 'infra_metrics', path: 'metrics_explorer' }); useTrackPageview({ app: 'infra_metrics', path: 'metrics_explorer', delay: 15000 }); - const { metricIndicesExist } = useContext(Source.Context); + const { metricIndicesExist } = useSourceContext(); useEffect(() => { if (currentView) { onViewStateChange(currentView); diff --git a/x-pack/plugins/infra/public/pages/metrics/page_template.tsx b/x-pack/plugins/infra/public/pages/metrics/page_template.tsx index 53a0cc21dd7ce..4d4dec50dd74c 100644 --- a/x-pack/plugins/infra/public/pages/metrics/page_template.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/page_template.tsx @@ -7,7 +7,7 @@ import { i18n } from '@kbn/i18n'; import type { LazyObservabilityPageTemplateProps } from '@kbn/observability-plugin/public'; -import { KibanaPageTemplateProps } from '@kbn/shared-ux-components'; +import type { NoDataConfig } from '@kbn/shared-ux-page-kibana-template'; import React from 'react'; import { noMetricIndicesPromptDescription, @@ -33,7 +33,7 @@ export const MetricsPageTemplate: React.FC = ({ }, } = useKibanaContextForPlugin(); - const noDataConfig: KibanaPageTemplateProps['noDataConfig'] = hasData + const noDataConfig: NoDataConfig | undefined = hasData ? undefined : { solution: i18n.translate('xpack.infra.metrics.noDataConfig.solutionName', { 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 eab8a82bc2d1e..1b21dfbc800f3 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 @@ -15,10 +15,10 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import React, { useCallback, useContext, useMemo } from 'react'; +import React, { useCallback, useMemo } from 'react'; import { Prompt } from '@kbn/observability-plugin/public'; import { SourceLoadingPage } from '../../../components/source_loading_page'; -import { Source } from '../../../containers/metrics_source'; +import { useSourceContext } from '../../../containers/metrics_source'; import { useInfraMLCapabilitiesContext } from '../../../containers/ml/infra_ml_capabilities'; import { IndicesConfigurationPanel } from './indices_configuration_panel'; import { MLConfigurationPanel } from './ml_configuration_panel'; @@ -48,7 +48,7 @@ export const SourceConfigurationSettings = ({ isLoading, isUninitialized, updateSourceConfiguration, - } = useContext(Source.Context); + } = useSourceContext(); const { indicesConfigurationProps, diff --git a/x-pack/plugins/infra/server/lib/metrics/index.ts b/x-pack/plugins/infra/server/lib/metrics/index.ts index c4641e265ea55..54dd69adb3ff4 100644 --- a/x-pack/plugins/infra/server/lib/metrics/index.ts +++ b/x-pack/plugins/infra/server/lib/metrics/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { ThrowReporter } from 'io-ts/lib/ThrowReporter'; import { TIMESTAMP_FIELD } from '../../../common/constants'; import { MetricsAPIRequest, MetricsAPIResponse, afterKeyObjectRT } from '../../../common/http_api'; diff --git a/x-pack/plugins/infra/server/routes/metadata/lib/get_node_info.ts b/x-pack/plugins/infra/server/routes/metadata/lib/get_node_info.ts index 97a0707a4c215..bc93d1f539e2a 100644 --- a/x-pack/plugins/infra/server/routes/metadata/lib/get_node_info.ts +++ b/x-pack/plugins/infra/server/routes/metadata/lib/get_node_info.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { first, startsWith } from 'lodash'; import type { InfraPluginRequestHandlerContext } from '../../../types'; import { KibanaFramework } from '../../../lib/adapters/framework/kibana_framework_adapter'; diff --git a/x-pack/plugins/infra/server/utils/create_afterkey_handler.ts b/x-pack/plugins/infra/server/utils/create_afterkey_handler.ts index 6d41f17a6bb5e..de797385c7171 100644 --- a/x-pack/plugins/infra/server/utils/create_afterkey_handler.ts +++ b/x-pack/plugins/infra/server/utils/create_afterkey_handler.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { InfraDatabaseSearchResponse } from '../lib/adapters/framework'; export const createAfterKeyHandler = diff --git a/x-pack/plugins/kubernetes_security/public/components/container_name_widget/hooks.ts b/x-pack/plugins/kubernetes_security/public/components/container_name_widget/hooks.ts index 66dcbc5b50265..c1b7c091b17a4 100644 --- a/x-pack/plugins/kubernetes_security/public/components/container_name_widget/hooks.ts +++ b/x-pack/plugins/kubernetes_security/public/components/container_name_widget/hooks.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useInfiniteQuery } from 'react-query'; +import { useInfiniteQuery } from '@tanstack/react-query'; import { CoreStart } from '@kbn/core/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { QUERY_KEY_CONTAINER_NAME_WIDGET, AGGREGATE_ROUTE } from '../../../common/constants'; diff --git a/x-pack/plugins/kubernetes_security/public/components/count_widget/hooks.ts b/x-pack/plugins/kubernetes_security/public/components/count_widget/hooks.ts index d194e74ae8c62..936419d06c703 100644 --- a/x-pack/plugins/kubernetes_security/public/components/count_widget/hooks.ts +++ b/x-pack/plugins/kubernetes_security/public/components/count_widget/hooks.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useInfiniteQuery } from 'react-query'; +import { useInfiniteQuery } from '@tanstack/react-query'; import { CoreStart } from '@kbn/core/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { QUERY_KEY_COUNT_WIDGET, COUNT_ROUTE } from '../../../common/constants'; diff --git a/x-pack/plugins/kubernetes_security/public/components/percent_widget/hooks.ts b/x-pack/plugins/kubernetes_security/public/components/percent_widget/hooks.ts index f13cdfa0ac7a4..5f5bf99ffd26f 100644 --- a/x-pack/plugins/kubernetes_security/public/components/percent_widget/hooks.ts +++ b/x-pack/plugins/kubernetes_security/public/components/percent_widget/hooks.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { CoreStart } from '@kbn/core/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { QUERY_KEY_PERCENT_WIDGET, AGGREGATE_ROUTE } from '../../../common/constants'; diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/hooks.ts b/x-pack/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/hooks.ts index ef6c849ee9242..0b8411e710728 100644 --- a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/hooks.ts +++ b/x-pack/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/hooks.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { useInfiniteQuery } from 'react-query'; +import { useInfiniteQuery } from '@tanstack/react-query'; import { CoreStart } from '@kbn/core/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { QueryDslQueryContainerBool } from '../../../types'; diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/index.test.tsx b/x-pack/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/index.test.tsx index 6a4595ddfb9a3..1763a881c2ba9 100644 --- a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/index.test.tsx +++ b/x-pack/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/index.test.tsx @@ -18,8 +18,6 @@ describe('DynamicTreeView component', () => { let mockedContext: AppContextTestRender; let mockedApi: AppContextTestRender['coreStart']['http']['get']; - const waitForApiCall = () => waitFor(() => expect(mockedApi).toHaveBeenCalled()); - const defaultProps = { globalFilter: { startDate: Date.now().toString(), @@ -69,8 +67,9 @@ describe('DynamicTreeView component', () => { it('should show loading state while retrieving empty data and hide it when settled', async () => { render(); expect(renderResult.queryByText(/loading/i)).toBeInTheDocument(); - await waitForApiCall(); - expect(renderResult.queryByText(/loading/i)).not.toBeInTheDocument(); + await waitFor(() => { + expect(renderResult.queryByText(/loading/i)).not.toBeInTheDocument(); + }); }); }); @@ -92,39 +91,42 @@ describe('DynamicTreeView component', () => { render({ tree, }); - await waitForApiCall(); - expect(mockedApi).toHaveBeenCalledWith( - '/internal/kubernetes_security/multi_terms_aggregate', - { - query: { - groupBys: `[{"field":"${key}"},{"field":"orchestrator.cluster.name","missing":""}]`, - index: '*-logs', - page: 0, - perPage: 50, - query: '{"bool":{"filter":[],"must":[],"must_not":[],"should":[]}}', - }, - } - ); + await waitFor(() => { + expect(mockedApi).toHaveBeenCalledWith( + '/internal/kubernetes_security/multi_terms_aggregate', + { + query: { + groupBys: `[{"field":"${key}"},{"field":"orchestrator.cluster.name","missing":""}]`, + index: '*-logs', + page: 0, + perPage: 50, + query: '{"bool":{"filter":[],"must":[],"must_not":[],"should":[]}}', + }, + } + ); + }); }); it('should render the parent level based on api response', async () => { render({ tree, }); - await waitForApiCall(); - ['awp-demo-gke-main', 'awp-demo-gke-test'].forEach((cluster) => { - expect(renderResult.queryByText(cluster)).toBeInTheDocument(); + await waitFor(() => { + ['awp-demo-gke-main', 'awp-demo-gke-test'].forEach((cluster) => { + expect(renderResult.queryByText(cluster)).toBeInTheDocument(); + }); }); }); it('should trigger a callback when tree node is clicked', async () => { const callback = jest.fn(); render({ tree, onSelect: callback }); - await waitForApiCall(); - renderResult.getByRole('button', { name: 'awp-demo-gke-main' }).click(); + await waitFor(() => { + renderResult.getByRole('button', { name: 'awp-demo-gke-main' }).click(); + }); expect(callback).toHaveBeenCalled(); }); @@ -156,37 +158,43 @@ describe('DynamicTreeView component', () => { it('should make a children api call with filter when parent is expanded', async () => { render({ tree }); - await waitForApiCall(); - renderResult.getByRole('button', { name: parent }).click(); + await waitFor(() => { + renderResult.getByRole('button', { name: parent }).click(); + }); mockedApi.mockResolvedValueOnce(nodeResponseMock); - await waitForApiCall(); - expect(mockedApi).toHaveBeenCalledWith('/internal/kubernetes_security/aggregate', { - query: { - groupBy: 'node', - index: '*-logs', - page: 0, - perPage: 50, - query: `{"bool":{"filter":[{"term":{"orchestrator.cluster.id":"${parent}"}}],"must":[],"must_not":[],"should":[]}}`, - }, + await waitFor(() => { + expect(mockedApi).toHaveBeenCalledWith('/internal/kubernetes_security/aggregate', { + query: { + groupBy: 'node', + index: '*-logs', + page: 0, + perPage: 50, + query: `{"bool":{"filter":[{"term":{"orchestrator.cluster.id":"${parent}"}}],"must":[],"must_not":[],"should":[]}}`, + }, + }); }); }); it('should render children when parent is expanded based on api request', async () => { render({ tree }); - await waitForApiCall(); - renderResult.getByRole('button', { name: parent }).click(); - - mockedApi.mockResolvedValueOnce(nodeResponseMock); + await waitFor(() => { + expect(renderResult.getByRole('button', { name: parent })).toBeTruthy(); + mockedApi.mockResolvedValueOnce(nodeResponseMock); + renderResult.getByRole('button', { name: parent }).click(); + }); // check if children has loading state - expect(renderResult.queryByText(/loading/i)).toBeInTheDocument(); - await waitForApiCall(); + await waitFor(() => { + expect(renderResult.queryByText(/loading/i)).toBeInTheDocument(); + }); - ['default', 'kube-system', 'production', 'qa', 'staging'].forEach((node) => { - expect(renderResult.queryByText(node)).toBeInTheDocument(); + await waitFor(() => { + ['default', 'kube-system', 'production', 'qa', 'staging'].forEach((node) => { + expect(renderResult.queryByText(node)).toBeInTheDocument(); + }); }); }); }); diff --git a/x-pack/plugins/kubernetes_security/public/methods/index.tsx b/x-pack/plugins/kubernetes_security/public/methods/index.tsx index f0a140a612705..362560c3b1ddf 100644 --- a/x-pack/plugins/kubernetes_security/public/methods/index.tsx +++ b/x-pack/plugins/kubernetes_security/public/methods/index.tsx @@ -7,7 +7,7 @@ import React, { lazy, Suspense } from 'react'; import { EuiLoadingSpinner } from '@elastic/eui'; -import { QueryClient, QueryClientProvider } from 'react-query'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { KubernetesSecurityDeps } from '../types'; // Initializing react-query diff --git a/x-pack/plugins/kubernetes_security/public/test/index.tsx b/x-pack/plugins/kubernetes_security/public/test/index.tsx index 6174925b6003c..244560d366ac4 100644 --- a/x-pack/plugins/kubernetes_security/public/test/index.tsx +++ b/x-pack/plugins/kubernetes_security/public/test/index.tsx @@ -8,7 +8,7 @@ import React, { memo, ReactNode, useMemo } from 'react'; import { createMemoryHistory, MemoryHistory } from 'history'; import { render as reactRender, RenderOptions, RenderResult } from '@testing-library/react'; -import { QueryClient, QueryClientProvider, setLogger } from 'react-query'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { Router } from 'react-router-dom'; import { History } from 'history'; import useObservable from 'react-use/lib/useObservable'; @@ -20,15 +20,6 @@ import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common'; type UiRender = (ui: React.ReactElement, options?: RenderOptions) => RenderResult; -// hide react-query output in console -setLogger({ - error: () => {}, - // eslint-disable-next-line no-console - log: console.log, - // eslint-disable-next-line no-console - warn: console.warn, -}); - /** * Mocked app root context renderer */ @@ -113,6 +104,14 @@ export const createAppRootMockRenderer = (): AppContextTestRender => { cacheTime: Infinity, }, }, + // hide react-query output in console + logger: { + error: () => {}, + // eslint-disable-next-line no-console + log: console.log, + // eslint-disable-next-line no-console + warn: console.warn, + }, }); const AppWrapper: React.FC<{ children: React.ReactElement }> = ({ children }) => ( diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/dimension_container.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/dimension_container.tsx index e660df8ff7bb9..3ddf2a2cc4b75 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/dimension_container.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/dimension_container.tsx @@ -17,9 +17,6 @@ import { EuiFlexGroup, EuiFlexItem, EuiFocusTrap, - EuiOutsideClickDetector, - EuiWindowEvent, - keys, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; @@ -37,7 +34,10 @@ function fromExcludedClickTarget(event: Event) { node !== null; node = node!.parentElement ) { - if (node.classList!.contains(DONT_CLOSE_DIMENSION_CONTAINER_ON_CLICK_CLASS)) { + if ( + node.classList!.contains(DONT_CLOSE_DIMENSION_CONTAINER_ON_CLICK_CLASS) || + node.classList!.contains('euiBody-hasPortalContent') + ) { return true; } } @@ -69,18 +69,6 @@ export function DimensionContainer({ return canClose; }, [handleClose]); - const closeOnEscape = useCallback( - (event: KeyboardEvent) => { - if (event.key === keys.ESCAPE) { - const canClose = closeFlyout(); - if (canClose) { - event.preventDefault(); - } - } - }, - [closeFlyout] - ); - useEffect(() => { if (isOpen) { document.body.classList.add('lnsBody--overflowHidden'); @@ -94,81 +82,80 @@ export function DimensionContainer({ return isOpen ? (
- - - { - if (isFullscreen || fromExcludedClickTarget(event)) { - return; + { + if (isFullscreen || fromExcludedClickTarget(event)) { + return; + } + closeFlyout(); + }} + onEscapeKey={closeFlyout} + > +
{ + if (isOpen) { + // EuiFocusTrap interferes with animating elements with absolute position: + // running this onAnimationEnd, otherwise the flyout pushes content when animating + setFocusTrapIsEnabled(true); } - closeFlyout(); }} - isDisabled={!isOpen} > -
{ - if (isOpen) { - // EuiFocusTrap interferes with animating elements with absolute position: - // running this onAnimationEnd, otherwise the flyout pushes content when animating - setFocusTrapIsEnabled(true); - } - }} - > - - - - -

- - {i18n.translate('xpack.lens.configure.configurePanelTitle', { - defaultMessage: '{groupLabel}', - values: { - groupLabel, - }, - })} - -

-
-
+ + + + +

+ + {i18n.translate('xpack.lens.configure.configurePanelTitle', { + defaultMessage: '{groupLabel}', + values: { + groupLabel, + }, + })} + +

+
+
- - - -
-
+ + + +
+
-
{panel}
+
{panel}
- - - {i18n.translate('xpack.lens.dimensionContainer.close', { - defaultMessage: 'Close', - })} - - -
- + + + {i18n.translate('xpack.lens.dimensionContainer.close', { + defaultMessage: 'Close', + })} + + +
) : null; 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 86e896c29910c..544835d2e3c21 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 @@ -614,7 +614,8 @@ export function LayerPanel( setState: updateDataLayerState, supportStaticValue: Boolean(activeGroup.supportStaticValue), paramEditorCustomProps: activeGroup.paramEditorCustomProps, - supportFieldFormat: activeGroup.supportFieldFormat !== false, + enableFormatSelector: activeGroup.enableFormatSelector !== false, + formatSelectorOptions: activeGroup.formatSelectorOptions, layerType: activeVisualization.getLayerType(layerId, visualizationState), indexPatterns: dataViews.indexPatterns, existingFields: dataViews.existingFields, diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.tsx index 2af3d90b33b95..a87e7cd3cac6c 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_editor.tsx @@ -95,7 +95,8 @@ export function DimensionEditor(props: DimensionEditorProps) { toggleFullscreen, isFullscreen, supportStaticValue, - supportFieldFormat = true, + enableFormatSelector = true, + formatSelectorOptions, layerType, paramEditorCustomProps, } = props; @@ -1010,11 +1011,15 @@ export function DimensionEditor(props: DimensionEditorProps) { /> )} - {supportFieldFormat && + {enableFormatSelector && !isFullscreen && selectedColumn && (selectedColumn.dataType === 'number' || selectedColumn.operationType === 'range') ? ( - + ) : null}
diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx index 35bd94d448270..b64e12b7bf0a4 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/dimension_panel.test.tsx @@ -244,6 +244,8 @@ describe('IndexPatternDimensionEditorPanel', () => { isFullscreen: false, supportStaticValue: false, toggleFullscreen: jest.fn(), + enableFormatSelector: true, + formatSelectorOptions: undefined, }; jest.clearAllMocks(); diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/format_selector.test.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/format_selector.test.tsx index 60fdb382322a6..d59cb4f136fda 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/format_selector.test.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/format_selector.test.tsx @@ -86,4 +86,18 @@ describe('FormatSelector', () => { component.update(); expect(props.onChange).toBeCalledWith({ id: 'bytes', params: { suffix: 'GB' } }); }); + describe('options', () => { + it('can disable the extra options', () => { + const props = getDefaultProps(); + const component = mount( + + ); + expect(component.exists('[data-test-subj="indexPattern-dimension-formatDecimals"]')).toBe( + false + ); + expect(component.exists('[data-test-subj="indexPattern-dimension-formatSuffix"]')).toBe( + false + ); + }); + }); }); diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/format_selector.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/format_selector.tsx index 49231e64d53be..5a6fc9aab91eb 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/format_selector.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/dimension_panel/format_selector.tsx @@ -51,9 +51,14 @@ const suffixLabel = i18n.translate('xpack.lens.indexPattern.suffixLabel', { defaultMessage: 'Suffix', }); +export interface FormatSelectorOptions { + disableExtraOptions?: boolean; +} + interface FormatSelectorProps { selectedColumn: GenericIndexPatternColumn; onChange: (newFormat?: { id: string; params?: Record }) => void; + options?: FormatSelectorOptions; } const RANGE_MIN = 0; @@ -149,9 +154,9 @@ export function FormatSelector(props: FormatSelectorProps) { selectedOptions={currentOption} onChange={onChangeWrapped} /> - {currentFormat ? ( + {currentFormat && !props.options?.disableExtraOptions ? ( <> - + - + + { 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 50eb6df5723f7..40b2f66b2b93d 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 @@ -457,7 +457,7 @@ export const dateHistogramOperation: OperationDefinition< ); }, helpComponentTitle: i18n.translate('xpack.lens.indexPattern.dateHistogram.titleHelp', { - defaultMessage: 'How auto date histogram works', + defaultMessage: 'How Date histogram works', }), helpComponent() { const infiniteBound = i18n.translate('xpack.lens.indexPattern.dateHistogram.moreThanYear', { @@ -471,14 +471,14 @@ export const dateHistogramOperation: OperationDefinition< <>

{i18n.translate('xpack.lens.indexPattern.dateHistogram.autoBasicExplanation', { - defaultMessage: 'The auto date histogram splits a data field into buckets by interval.', + defaultMessage: 'Date histogram splits data into time intervals.', })}

{UI_SETTINGS.HISTOGRAM_MAX_BARS}, targetBarSetting: {UI_SETTINGS.HISTOGRAM_BAR_TARGET}, diff --git a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/filters/filter_popover.tsx b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/filters/filter_popover.tsx index c4ab33c36f1f1..95021dd22900f 100644 --- a/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/filters/filter_popover.tsx +++ b/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/filters/filter_popover.tsx @@ -32,29 +32,6 @@ export const FilterPopover = ({ }) => { const inputRef = React.useRef(); - // The following code is to prevent an keypress - // from propagating. - // - // TODO - It looks like EUI should be handling this - // (see https://github.com/elastic/eui/commit/ad97583b0d644690379f72c7a20879cfadb16e7a) - const popoverRef = React.useRef(null); - let panelElement: HTMLDivElement; - const panelRefCallback = (element: HTMLDivElement) => { - const listener = (event: KeyboardEvent) => { - if (event.key === 'Escape') { - event.stopPropagation(); - panelElement.removeEventListener('keydown', listener); - popoverRef.current?.closePopover(); - } - }; - - if (element) { - panelElement = element; - panelElement.addEventListener('keydown', listener); - } - }; - // End handling code - const setFilterLabel = (label: string) => setFilter({ ...filter, label }); const setFilterQuery = (input: Query) => setFilter({ ...filter, input }); @@ -70,14 +47,12 @@ export const FilterPopover = ({ return ( triggerClose()} + closePopover={triggerClose} button={button} > triggerClose()} + onSubmit={triggerClose} dataTestSubj="indexPattern-filters-label" /> diff --git a/x-pack/plugins/lens/public/types.ts b/x-pack/plugins/lens/public/types.ts index 4333eb6667688..97df24648f4d4 100644 --- a/x-pack/plugins/lens/public/types.ts +++ b/x-pack/plugins/lens/public/types.ts @@ -44,8 +44,9 @@ import { LENS_EDIT_PAGESIZE_ACTION, } from './visualizations/datatable/components/constants'; import type { LensInspector } from './lens_inspector_service'; -import { DataViewsState } from './state_management/types'; -import { IndexPatternServiceAPI } from './indexpattern_service/service'; +import type { FormatSelectorOptions } from './indexpattern_datasource/dimension_panel/format_selector'; +import type { DataViewsState } from './state_management/types'; +import type { IndexPatternServiceAPI } from './indexpattern_service/service'; export interface IndexPatternRef { id: string; @@ -541,7 +542,8 @@ export type DatasourceDimensionEditorProps = DatasourceDimensionPro layerType: LayerType | undefined; supportStaticValue: boolean; paramEditorCustomProps?: ParamEditorCustomProps; - supportFieldFormat?: boolean; + enableFormatSelector: boolean; + formatSelectorOptions: FormatSelectorOptions | undefined; }; export type DatasourceDimensionTriggerProps = DatasourceDimensionProps; @@ -701,7 +703,8 @@ export type VisualizationDimensionGroupConfig = SharedDimensionProps & { requiresPreviousColumnOnDuplicate?: boolean; supportStaticValue?: boolean; paramEditorCustomProps?: ParamEditorCustomProps; - supportFieldFormat?: boolean; + enableFormatSelector?: boolean; + formatSelectorOptions?: FormatSelectorOptions; // only relevant if supportFieldFormat is true labels?: { buttonAriaLabel: string; buttonLabel: string }; }; diff --git a/x-pack/plugins/lens/public/visualizations/gauge/visualization.test.ts b/x-pack/plugins/lens/public/visualizations/gauge/visualization.test.ts index 7282259108a92..94c9ce28987bf 100644 --- a/x-pack/plugins/lens/public/visualizations/gauge/visualization.test.ts +++ b/x-pack/plugins/lens/public/visualizations/gauge/visualization.test.ts @@ -108,7 +108,7 @@ describe('gauge', () => { required: true, dataTestSubj: 'lnsGauge_metricDimensionPanel', enableDimensionEditor: true, - supportFieldFormat: true, + enableFormatSelector: true, }, { layerId: 'first', @@ -124,7 +124,7 @@ describe('gauge', () => { dataTestSubj: 'lnsGauge_minDimensionPanel', prioritizedOperation: 'min', suggestedValue: expect.any(Function), - supportFieldFormat: false, + enableFormatSelector: false, supportStaticValue: true, }, { @@ -141,7 +141,7 @@ describe('gauge', () => { dataTestSubj: 'lnsGauge_maxDimensionPanel', prioritizedOperation: 'max', suggestedValue: expect.any(Function), - supportFieldFormat: false, + enableFormatSelector: false, supportStaticValue: true, }, { @@ -157,7 +157,7 @@ describe('gauge', () => { supportsMoreColumns: false, required: false, dataTestSubj: 'lnsGauge_goalDimensionPanel', - supportFieldFormat: false, + enableFormatSelector: false, supportStaticValue: true, }, ], @@ -190,7 +190,7 @@ describe('gauge', () => { required: true, dataTestSubj: 'lnsGauge_metricDimensionPanel', enableDimensionEditor: true, - supportFieldFormat: true, + enableFormatSelector: true, }, { layerId: 'first', @@ -206,7 +206,7 @@ describe('gauge', () => { dataTestSubj: 'lnsGauge_minDimensionPanel', prioritizedOperation: 'min', suggestedValue: expect.any(Function), - supportFieldFormat: false, + enableFormatSelector: false, supportStaticValue: true, }, { @@ -223,7 +223,7 @@ describe('gauge', () => { dataTestSubj: 'lnsGauge_maxDimensionPanel', prioritizedOperation: 'max', suggestedValue: expect.any(Function), - supportFieldFormat: false, + enableFormatSelector: false, supportStaticValue: true, }, { @@ -239,7 +239,7 @@ describe('gauge', () => { supportsMoreColumns: true, required: false, dataTestSubj: 'lnsGauge_goalDimensionPanel', - supportFieldFormat: false, + enableFormatSelector: false, supportStaticValue: true, }, ], @@ -278,7 +278,7 @@ describe('gauge', () => { required: true, dataTestSubj: 'lnsGauge_metricDimensionPanel', enableDimensionEditor: true, - supportFieldFormat: true, + enableFormatSelector: true, }, { layerId: 'first', @@ -294,7 +294,7 @@ describe('gauge', () => { dataTestSubj: 'lnsGauge_minDimensionPanel', prioritizedOperation: 'min', suggestedValue: expect.any(Function), - supportFieldFormat: false, + enableFormatSelector: false, supportStaticValue: true, }, { @@ -311,7 +311,7 @@ describe('gauge', () => { dataTestSubj: 'lnsGauge_maxDimensionPanel', prioritizedOperation: 'max', suggestedValue: expect.any(Function), - supportFieldFormat: false, + enableFormatSelector: false, supportStaticValue: true, }, { @@ -327,7 +327,7 @@ describe('gauge', () => { supportsMoreColumns: false, required: false, dataTestSubj: 'lnsGauge_goalDimensionPanel', - supportFieldFormat: false, + enableFormatSelector: false, supportStaticValue: true, }, ], @@ -371,7 +371,7 @@ describe('gauge', () => { required: true, dataTestSubj: 'lnsGauge_metricDimensionPanel', enableDimensionEditor: true, - supportFieldFormat: true, + enableFormatSelector: true, }, { layerId: 'first', @@ -387,7 +387,7 @@ describe('gauge', () => { dataTestSubj: 'lnsGauge_minDimensionPanel', prioritizedOperation: 'min', suggestedValue: expect.any(Function), - supportFieldFormat: false, + enableFormatSelector: false, supportStaticValue: true, invalid: true, invalidMessage: 'Minimum value may not be greater than maximum value', @@ -406,7 +406,7 @@ describe('gauge', () => { dataTestSubj: 'lnsGauge_maxDimensionPanel', prioritizedOperation: 'max', suggestedValue: expect.any(Function), - supportFieldFormat: false, + enableFormatSelector: false, supportStaticValue: true, invalid: true, invalidMessage: 'Minimum value may not be greater than maximum value', @@ -424,7 +424,7 @@ describe('gauge', () => { supportsMoreColumns: false, required: false, dataTestSubj: 'lnsGauge_goalDimensionPanel', - supportFieldFormat: false, + enableFormatSelector: false, supportStaticValue: true, }, ], diff --git a/x-pack/plugins/lens/public/visualizations/gauge/visualization.tsx b/x-pack/plugins/lens/public/visualizations/gauge/visualization.tsx index 8c35a44242955..37d10918d4129 100644 --- a/x-pack/plugins/lens/public/visualizations/gauge/visualization.tsx +++ b/x-pack/plugins/lens/public/visualizations/gauge/visualization.tsx @@ -248,7 +248,7 @@ export const getGaugeVisualization = ({ return { groups: [ { - supportFieldFormat: true, + enableFormatSelector: true, layerId: state.layerId, groupId: GROUP_ID.METRIC, groupLabel: i18n.translate('xpack.lens.gauge.metricLabel', { @@ -281,7 +281,7 @@ export const getGaugeVisualization = ({ }, { supportStaticValue: true, - supportFieldFormat: false, + enableFormatSelector: false, layerId: state.layerId, groupId: GROUP_ID.MIN, groupLabel: i18n.translate('xpack.lens.gauge.minValueLabel', { @@ -307,7 +307,7 @@ export const getGaugeVisualization = ({ }, { supportStaticValue: true, - supportFieldFormat: false, + enableFormatSelector: false, layerId: state.layerId, groupId: GROUP_ID.MAX, groupLabel: i18n.translate('xpack.lens.gauge.maxValueLabel', { @@ -333,7 +333,7 @@ export const getGaugeVisualization = ({ }, { supportStaticValue: true, - supportFieldFormat: false, + enableFormatSelector: false, layerId: state.layerId, groupId: GROUP_ID.GOAL, groupLabel: i18n.translate('xpack.lens.gauge.goalValueLabel', { diff --git a/x-pack/plugins/lens/public/visualizations/metric/__snapshots__/visualization.test.ts.snap b/x-pack/plugins/lens/public/visualizations/metric/__snapshots__/visualization.test.ts.snap index c6fced0eba5e4..239baf2244da8 100644 --- a/x-pack/plugins/lens/public/visualizations/metric/__snapshots__/visualization.test.ts.snap +++ b/x-pack/plugins/lens/public/visualizations/metric/__snapshots__/visualization.test.ts.snap @@ -13,7 +13,11 @@ Object { ], "dataTestSubj": "lnsMetric_primaryMetricDimensionPanel", "enableDimensionEditor": true, + "enableFormatSelector": true, "filterOperations": [Function], + "formatSelectorOptions": Object { + "disableExtraOptions": true, + }, "groupId": "metric", "groupLabel": "Primary metric", "layerId": "first", @@ -21,7 +25,6 @@ Object { "headingLabel": "Value", }, "required": true, - "supportFieldFormat": false, "supportsMoreColumns": false, }, Object { @@ -32,7 +35,11 @@ Object { ], "dataTestSubj": "lnsMetric_secondaryMetricDimensionPanel", "enableDimensionEditor": true, + "enableFormatSelector": true, "filterOperations": [Function], + "formatSelectorOptions": Object { + "disableExtraOptions": true, + }, "groupId": "secondaryMetric", "groupLabel": "Secondary metric", "layerId": "first", @@ -40,7 +47,6 @@ Object { "headingLabel": "Value", }, "required": false, - "supportFieldFormat": false, "supportsMoreColumns": false, }, Object { @@ -51,7 +57,11 @@ Object { ], "dataTestSubj": "lnsMetric_maxDimensionPanel", "enableDimensionEditor": true, + "enableFormatSelector": false, "filterOperations": [Function], + "formatSelectorOptions": Object { + "disableExtraOptions": true, + }, "groupId": "max", "groupLabel": "Maximum value", "groupTooltip": "If the maximum value is specified, the minimum value is fixed at zero.", @@ -60,7 +70,6 @@ Object { "headingLabel": "Value", }, "required": false, - "supportFieldFormat": false, "supportStaticValue": true, "supportsMoreColumns": false, }, @@ -73,12 +82,15 @@ Object { ], "dataTestSubj": "lnsMetric_breakdownByDimensionPanel", "enableDimensionEditor": true, + "enableFormatSelector": true, "filterOperations": [Function], + "formatSelectorOptions": Object { + "disableExtraOptions": true, + }, "groupId": "breakdownBy", "groupLabel": "Break down by", "layerId": "first", "required": false, - "supportFieldFormat": false, "supportsMoreColumns": false, }, ], diff --git a/x-pack/plugins/lens/public/visualizations/metric/visualization.test.ts b/x-pack/plugins/lens/public/visualizations/metric/visualization.test.ts index 91a7e0ffc2053..18e664ce4ea36 100644 --- a/x-pack/plugins/lens/public/visualizations/metric/visualization.test.ts +++ b/x-pack/plugins/lens/public/visualizations/metric/visualization.test.ts @@ -517,12 +517,8 @@ describe('metric visualization', () => { it('clears a layer', () => { expect(visualization.clearLayer(fullState, 'some-id')).toMatchInlineSnapshot(` Object { - "color": "static-color", "layerId": "first", "layerType": "data", - "maxCols": 5, - "progressDirection": "vertical", - "subtitle": "subtitle", } `); }); @@ -634,6 +630,7 @@ describe('metric visualization', () => { expect(removed).not.toHaveProperty('metricAccessor'); expect(removed).not.toHaveProperty('palette'); + expect(removed).not.toHaveProperty('color'); }); it('removes secondary metric dimension', () => { const removed = visualization.removeDimension({ @@ -651,6 +648,7 @@ describe('metric visualization', () => { }); expect(removed).not.toHaveProperty('maxAccessor'); + expect(removed).not.toHaveProperty('progressDirection'); }); it('removes breakdown-by dimension', () => { const removed = visualization.removeDimension({ @@ -660,6 +658,7 @@ describe('metric visualization', () => { expect(removed).not.toHaveProperty('breakdownByAccessor'); expect(removed).not.toHaveProperty('collapseFn'); + expect(removed).not.toHaveProperty('maxCols'); }); }); diff --git a/x-pack/plugins/lens/public/visualizations/metric/visualization.tsx b/x-pack/plugins/lens/public/visualizations/metric/visualization.tsx index cb1d5a53c8e3c..6d74b02bae120 100644 --- a/x-pack/plugins/lens/public/visualizations/metric/visualization.tsx +++ b/x-pack/plugins/lens/public/visualizations/metric/visualization.tsx @@ -25,6 +25,7 @@ import { GROUP_ID, LENS_METRIC_ID } from './constants'; import { DimensionEditor } from './dimension_editor'; import { Toolbar } from './toolbar'; import { generateId } from '../../id_generator'; +import { FormatSelectorOptions } from '../../indexpattern_datasource/dimension_panel/format_selector'; export const DEFAULT_MAX_COLUMNS = 3; @@ -155,6 +156,28 @@ const metricGroupLabel = i18n.translate('xpack.lens.metric.groupLabel', { defaultMessage: 'Goal and single value', }); +const removeMetricDimension = (state: MetricVisualizationState) => { + delete state.metricAccessor; + delete state.palette; + delete state.color; +}; + +const removeSecondaryMetricDimension = (state: MetricVisualizationState) => { + delete state.secondaryMetricAccessor; + delete state.secondaryPrefix; +}; + +const removeMaxDimension = (state: MetricVisualizationState) => { + delete state.maxAccessor; + delete state.progressDirection; +}; + +const removeBreakdownByDimension = (state: MetricVisualizationState) => { + delete state.breakdownByAccessor; + delete state.collapseFn; + delete state.maxCols; +}; + export const getMetricVisualization = ({ paletteService, theme, @@ -181,14 +204,13 @@ export const getMetricVisualization = ({ clearLayer(state) { const newState = { ...state }; - delete newState.metricAccessor; - delete newState.secondaryMetricAccessor; - delete newState.secondaryPrefix; - delete newState.breakdownByAccessor; - delete newState.collapseFn; - delete newState.maxAccessor; - delete newState.palette; - // TODO - clear more? + delete newState.subtitle; + + removeMetricDimension(newState); + removeSecondaryMetricDimension(newState); + removeMaxDimension(newState); + removeBreakdownByDimension(newState); + return newState; }, @@ -245,6 +267,10 @@ export const getMetricVisualization = ({ const isBucketed = (op: OperationMetadata) => op.isBucketed; + const formatterOptions: FormatSelectorOptions = { + disableExtraOptions: true, + }; + return { groups: [ { @@ -270,7 +296,8 @@ export const getMetricVisualization = ({ supportsMoreColumns: !props.state.metricAccessor, filterOperations: isSupportedDynamicMetric, enableDimensionEditor: true, - supportFieldFormat: false, + enableFormatSelector: true, + formatSelectorOptions: formatterOptions, required: true, }, { @@ -295,7 +322,8 @@ export const getMetricVisualization = ({ supportsMoreColumns: !props.state.secondaryMetricAccessor, filterOperations: isSupportedDynamicMetric, enableDimensionEditor: true, - supportFieldFormat: false, + enableFormatSelector: true, + formatSelectorOptions: formatterOptions, required: false, }, { @@ -318,7 +346,8 @@ export const getMetricVisualization = ({ supportsMoreColumns: !props.state.maxAccessor, filterOperations: isSupportedMetric, enableDimensionEditor: true, - supportFieldFormat: false, + enableFormatSelector: false, + formatSelectorOptions: formatterOptions, supportStaticValue: true, required: false, groupTooltip: i18n.translate('xpack.lens.metric.maxTooltip', { @@ -344,7 +373,8 @@ export const getMetricVisualization = ({ supportsMoreColumns: !props.state.breakdownByAccessor, filterOperations: isBucketed, enableDimensionEditor: true, - supportFieldFormat: false, + enableFormatSelector: true, + formatSelectorOptions: formatterOptions, required: false, }, ], @@ -405,20 +435,16 @@ export const getMetricVisualization = ({ const updated = { ...prevState }; if (prevState.metricAccessor === columnId) { - delete updated.metricAccessor; - delete updated.palette; - delete updated.color; + removeMetricDimension(updated); } if (prevState.secondaryMetricAccessor === columnId) { - delete updated.secondaryMetricAccessor; - delete updated.secondaryPrefix; + removeSecondaryMetricDimension(updated); } if (prevState.maxAccessor === columnId) { - delete updated.maxAccessor; + removeMaxDimension(updated); } if (prevState.breakdownByAccessor === columnId) { - delete updated.breakdownByAccessor; - delete updated.collapseFn; + removeBreakdownByDimension(updated); } return updated; diff --git a/x-pack/plugins/maps/common/descriptor_types/source_descriptor_types.ts b/x-pack/plugins/maps/common/descriptor_types/source_descriptor_types.ts index 8ca9f2acb49d6..b862558d6a215 100644 --- a/x-pack/plugins/maps/common/descriptor_types/source_descriptor_types.ts +++ b/x-pack/plugins/maps/common/descriptor_types/source_descriptor_types.ts @@ -107,7 +107,6 @@ export type ESPewPewSourceDescriptor = AbstractESAggSourceDescriptor & { }; export type ESTermSourceDescriptor = AbstractESAggSourceDescriptor & { - indexPatternTitle?: string; term: string; // term field name whereQuery?: Query; size?: number; diff --git a/x-pack/plugins/maps/common/elasticsearch_util/elasticsearch_geo_utils.test.js b/x-pack/plugins/maps/common/elasticsearch_util/elasticsearch_geo_utils.test.js index 49996b61ba6c6..096f5370ca3b9 100644 --- a/x-pack/plugins/maps/common/elasticsearch_util/elasticsearch_geo_utils.test.js +++ b/x-pack/plugins/maps/common/elasticsearch_util/elasticsearch_geo_utils.test.js @@ -360,14 +360,6 @@ describe('geoPointToGeometry', () => { expect(points[0].coordinates).toEqual([lon, lat]); }); - it('Should convert runtime geo_point value', () => { - const points = []; - geoPointToGeometry(`${lat},${lon}`, points); - expect(points.length).toBe(1); - expect(points[0].type).toBe('Point'); - expect(points[0].coordinates).toEqual([lon, lat]); - }); - it('Should convert array of values', () => { const lat2 = 30; const lon2 = -60; diff --git a/x-pack/plugins/maps/common/elasticsearch_util/elasticsearch_geo_utils.ts b/x-pack/plugins/maps/common/elasticsearch_util/elasticsearch_geo_utils.ts index 964a88a8b1a93..9b03be8e7f8a0 100644 --- a/x-pack/plugins/maps/common/elasticsearch_util/elasticsearch_geo_utils.ts +++ b/x-pack/plugins/maps/common/elasticsearch_util/elasticsearch_geo_utils.ts @@ -129,7 +129,7 @@ export function hitsToGeoJson( // Parse geo_point fields API response export function geoPointToGeometry( - value: Point[] | Point | string | undefined, + value: Point[] | Point | undefined, accumulator: Geometry[] ): void { if (!value) { @@ -143,19 +143,6 @@ export function geoPointToGeometry( return; } - // runtime geo_point field returns value as "lat,lon" string instead of GeoJSON - // This is a workaround for a bug - https://github.com/elastic/elasticsearch/issues/85245 - if (typeof value === 'string') { - const commaSplit = value.split(','); - const lat = parseFloat(commaSplit[0]); - const lon = parseFloat(commaSplit[1]); - accumulator.push({ - type: GEO_JSON_TYPE.POINT, - coordinates: [lon, lat], - } as Point); - return; - } - // geo_point fields API returns GeoJSON accumulator.push(value as Point); } diff --git a/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts b/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts index 76dafc6a6c68e..90a29a0f72ee2 100644 --- a/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts +++ b/x-pack/plugins/maps/common/elasticsearch_util/es_agg_utils.ts @@ -18,8 +18,8 @@ export function getField(indexPattern: DataView, fieldName: string): DataViewFie if (!field) { throw new Error( i18n.translate('xpack.maps.source.esSearch.fieldNotFoundMsg', { - defaultMessage: `Unable to find '{fieldName}' in index-pattern '{indexPatternTitle}'.`, - values: { fieldName, indexPatternTitle: indexPattern.title }, + defaultMessage: `Unable to find '{fieldName}' in index-pattern '{indexPatternName}'.`, + values: { fieldName, indexPatternName: indexPattern.getName() }, }) ); } diff --git a/x-pack/plugins/maps/public/classes/fields/agg/agg_field.ts b/x-pack/plugins/maps/public/classes/fields/agg/agg_field.ts index 869c69229ebf1..1a6841ffa9e7e 100644 --- a/x-pack/plugins/maps/public/classes/fields/agg/agg_field.ts +++ b/x-pack/plugins/maps/public/classes/fields/agg/agg_field.ts @@ -83,7 +83,7 @@ export class AggField extends CountAggField { async getLabel(): Promise { return this._label ? this._label - : this._source.getAggLabel( + : await this._source.getAggLabel( this._aggType, this._esDocField ? await this._esDocField.getLabel() : '' ); diff --git a/x-pack/plugins/maps/public/classes/fields/agg/count_agg_field.ts b/x-pack/plugins/maps/public/classes/fields/agg/count_agg_field.ts index 16f7a7d09d28f..03ade37c3dbec 100644 --- a/x-pack/plugins/maps/public/classes/fields/agg/count_agg_field.ts +++ b/x-pack/plugins/maps/public/classes/fields/agg/count_agg_field.ts @@ -66,7 +66,7 @@ export class CountAggField implements IESAggField { } async getLabel(): Promise { - return this._label ? this._label : this._source.getAggLabel(AGG_TYPE.COUNT, ''); + return this._label ? this._label : await this._source.getAggLabel(AGG_TYPE.COUNT, ''); } isValid(): boolean { diff --git a/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts b/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts index 4566cf4a73f1c..3b6eff3313077 100644 --- a/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts +++ b/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.test.ts @@ -32,7 +32,7 @@ const mockEsAggSource = { getAggKey: (aggType: AGG_TYPE, fieldName: string) => { return 'agg_key'; }, - getAggLabel: (aggType: AGG_TYPE, fieldName: string) => { + getAggLabel: async (aggType: AGG_TYPE, fieldName: string) => { return 'agg_label'; }, getIndexPattern: async () => { diff --git a/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.ts b/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.ts index bc542bf891517..57dcd5631918c 100644 --- a/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.ts +++ b/x-pack/plugins/maps/public/classes/fields/agg/percentile_agg_field.ts @@ -57,7 +57,7 @@ export class PercentileAggField extends AggField implements IESAggField { } const suffix = getOrdinalSuffix(this._percentile); - return `${this._percentile}${suffix} ${this._source.getAggLabel( + return `${this._percentile}${suffix} ${await this._source.getAggLabel( this._getAggType(), this.getRootName() )}`; diff --git a/x-pack/plugins/maps/public/classes/joins/inner_join.test.js b/x-pack/plugins/maps/public/classes/joins/inner_join.test.js index 4e273f95515e4..f8ca092e9a164 100644 --- a/x-pack/plugins/maps/public/classes/joins/inner_join.test.js +++ b/x-pack/plugins/maps/public/classes/joins/inner_join.test.js @@ -15,7 +15,6 @@ const rightSource = { type: SOURCE_TYPES.ES_TERM_SOURCE, id: 'd3625663-5b34-4d50-a784-0d743f676a0c', indexPatternId: '90943e30-9a47-11e8-b64d-95841ca0b247', - indexPatternTitle: 'kibana_sample_data_logs', term: 'geo.dest', metrics: [{ type: 'count' }], }; diff --git a/x-pack/plugins/maps/public/classes/layers/create_region_map_layer_descriptor.ts b/x-pack/plugins/maps/public/classes/layers/create_region_map_layer_descriptor.ts index 19d9567a3480a..e88cbaa0d6d87 100644 --- a/x-pack/plugins/maps/public/classes/layers/create_region_map_layer_descriptor.ts +++ b/x-pack/plugins/maps/public/classes/layers/create_region_map_layer_descriptor.ts @@ -37,7 +37,6 @@ export interface CreateRegionMapLayerDescriptorParams { termsSize?: number; colorSchema: string; indexPatternId?: string; - indexPatternTitle?: string; metricAgg: string; metricFieldName?: string; } @@ -65,7 +64,6 @@ export function createRegionMapLayerDescriptor({ termsSize, colorSchema, indexPatternId, - indexPatternTitle, metricAgg, metricFieldName, }: CreateRegionMapLayerDescriptorParams): LayerDescriptor | null { @@ -87,7 +85,6 @@ export function createRegionMapLayerDescriptor({ type: SOURCE_TYPES.ES_TERM_SOURCE, id: joinId, indexPatternId, - indexPatternTitle: indexPatternTitle ? indexPatternTitle : indexPatternId, term: termsFieldName, metrics: [metricsDescriptor], applyGlobalQuery: true, diff --git a/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.test.tsx b/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.test.tsx index 5b91e5e49c514..b71fef484de01 100644 --- a/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.test.tsx +++ b/x-pack/plugins/maps/public/classes/layers/vector_layer/vector_layer.test.tsx @@ -72,7 +72,6 @@ describe('cloneDescriptor', () => { right: { id: '557d0f15', indexPatternId: 'myIndexPattern', - indexPatternTitle: 'logs-*', metrics: [{ type: AGG_TYPE.COUNT }], term: 'myTermField', type: SOURCE_TYPES.ES_TERM_SOURCE, @@ -114,7 +113,6 @@ describe('cloneDescriptor', () => { right: { id: '557d0f15', indexPatternId: 'myIndexPattern', - indexPatternTitle: 'logs-*', term: 'myTermField', type: 'joinSource', } as unknown as ESTermSourceDescriptor, diff --git a/x-pack/plugins/maps/public/classes/layers/wizards/choropleth_layer_wizard/create_choropleth_layer_descriptor.ts b/x-pack/plugins/maps/public/classes/layers/wizards/choropleth_layer_wizard/create_choropleth_layer_descriptor.ts index 36e07d7383d18..2cbf6d3000b9a 100644 --- a/x-pack/plugins/maps/public/classes/layers/wizards/choropleth_layer_wizard/create_choropleth_layer_descriptor.ts +++ b/x-pack/plugins/maps/public/classes/layers/wizards/choropleth_layer_wizard/create_choropleth_layer_descriptor.ts @@ -38,14 +38,12 @@ function createChoroplethLayerDescriptor({ sourceDescriptor, leftField, rightIndexPatternId, - rightIndexPatternTitle, rightTermField, layerType, }: { sourceDescriptor: EMSFileSourceDescriptor | ESSearchSourceDescriptor; leftField: string; rightIndexPatternId: string; - rightIndexPatternTitle: string; rightTermField: string; layerType: LAYER_TYPE.GEOJSON_VECTOR | LAYER_TYPE.MVT_VECTOR; }) { @@ -98,7 +96,6 @@ function createChoroplethLayerDescriptor({ type: SOURCE_TYPES.ES_TERM_SOURCE, id: joinId, indexPatternId: rightIndexPatternId, - indexPatternTitle: rightIndexPatternTitle, term: rightTermField, metrics: [metricsDescriptor], applyGlobalQuery: true, @@ -125,13 +122,11 @@ export function createEmsChoroplethLayerDescriptor({ leftEmsFileId, leftEmsField, rightIndexPatternId, - rightIndexPatternTitle, rightTermField, }: { leftEmsFileId: string; leftEmsField: string; rightIndexPatternId: string; - rightIndexPatternTitle: string; rightTermField: string; }) { return createChoroplethLayerDescriptor({ @@ -141,7 +136,6 @@ export function createEmsChoroplethLayerDescriptor({ }), leftField: leftEmsField, rightIndexPatternId, - rightIndexPatternTitle, rightTermField, layerType: LAYER_TYPE.GEOJSON_VECTOR, }); @@ -152,14 +146,12 @@ export function createEsChoroplethLayerDescriptor({ leftGeoField, leftJoinField, rightIndexPatternId, - rightIndexPatternTitle, rightTermField, }: { leftIndexPatternId: string; leftGeoField: string; leftJoinField: string; rightIndexPatternId: string; - rightIndexPatternTitle: string; rightTermField: string; }) { return createChoroplethLayerDescriptor({ @@ -174,7 +166,6 @@ export function createEsChoroplethLayerDescriptor({ }), leftField: leftJoinField, rightIndexPatternId, - rightIndexPatternTitle, rightTermField, layerType: LAYER_TYPE.MVT_VECTOR, }); 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 4edf85bc922d1..5fef8dd28ceb1 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 @@ -66,7 +66,6 @@ interface State { leftEmsJoinField: string | null; leftElasticsearchJoinField: string | null; rightIndexPatternId: string; - rightIndexPatternTitle: string | null; rightTermsFields: DataViewField[]; rightJoinField: string | null; } @@ -85,7 +84,6 @@ export class LayerTemplate extends Component { leftEmsJoinField: null, leftElasticsearchJoinField: null, rightIndexPatternId: '', - rightIndexPatternTitle: null, rightTermsFields: [], rightJoinField: null, }; @@ -99,7 +97,7 @@ export class LayerTemplate extends Component { } _loadRightFields = async (indexPatternId: string) => { - this.setState({ rightTermsFields: [], rightIndexPatternTitle: null }); + this.setState({ rightTermsFields: [] }); let indexPattern; try { @@ -116,7 +114,6 @@ export class LayerTemplate extends Component { this.setState({ rightTermsFields: getTermsFields(indexPattern.fields), - rightIndexPatternTitle: indexPattern.title, }); }; @@ -265,14 +262,12 @@ export class LayerTemplate extends Component { leftGeoField: this.state.leftGeoField!, leftJoinField: this.state.leftElasticsearchJoinField!, rightIndexPatternId: this.state.rightIndexPatternId, - rightIndexPatternTitle: this.state.rightIndexPatternTitle!, rightTermField: this.state.rightJoinField!, }) : createEmsChoroplethLayerDescriptor({ leftEmsFileId: this.state.leftEmsFileId!, leftEmsField: this.state.leftEmsJoinField!, rightIndexPatternId: this.state.rightIndexPatternId, - rightIndexPatternTitle: this.state.rightIndexPatternTitle!, rightTermField: this.state.rightJoinField!, }); diff --git a/x-pack/plugins/maps/public/classes/layers/wizards/solution_layers/observability/create_layer_descriptor.test.ts b/x-pack/plugins/maps/public/classes/layers/wizards/solution_layers/observability/create_layer_descriptor.test.ts index 771cf55ec25d3..7aaea96a06aed 100644 --- a/x-pack/plugins/maps/public/classes/layers/wizards/solution_layers/observability/create_layer_descriptor.test.ts +++ b/x-pack/plugins/maps/public/classes/layers/wizards/solution_layers/observability/create_layer_descriptor.test.ts @@ -55,7 +55,6 @@ describe('createLayerDescriptor', () => { applyGlobalTime: true, id: '12345', indexPatternId: 'apm_static_index_pattern_id', - indexPatternTitle: 'traces-apm*,logs-apm*,metrics-apm*,apm-*', metrics: [ { field: 'transaction.duration.us', diff --git a/x-pack/plugins/maps/public/classes/layers/wizards/solution_layers/observability/create_layer_descriptor.ts b/x-pack/plugins/maps/public/classes/layers/wizards/solution_layers/observability/create_layer_descriptor.ts index 26a9f14b8160f..b8536d8970939 100644 --- a/x-pack/plugins/maps/public/classes/layers/wizards/solution_layers/observability/create_layer_descriptor.ts +++ b/x-pack/plugins/maps/public/classes/layers/wizards/solution_layers/observability/create_layer_descriptor.ts @@ -173,7 +173,6 @@ export function createLayerDescriptor({ type: SOURCE_TYPES.ES_TERM_SOURCE, id: joinId, indexPatternId: APM_INDEX_PATTERN_ID, - indexPatternTitle: APM_INDEX_PATTERN_TITLE, // TODO look up from APM_OSS.indexPattern term: 'client.geo.country_iso_code', metrics: [metricsDescriptor], whereQuery: apmSourceQuery, diff --git a/x-pack/plugins/maps/public/classes/sources/es_agg_source/es_agg_source.ts b/x-pack/plugins/maps/public/classes/sources/es_agg_source/es_agg_source.ts index fce9293cf9f02..42b9c0ed73c77 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_agg_source/es_agg_source.ts +++ b/x-pack/plugins/maps/public/classes/sources/es_agg_source/es_agg_source.ts @@ -21,7 +21,7 @@ export const DEFAULT_METRIC = { type: AGG_TYPE.COUNT }; export interface IESAggSource extends IESSource { getAggKey(aggType: AGG_TYPE, fieldName: string): string; - getAggLabel(aggType: AGG_TYPE, fieldLabel: string): string; + getAggLabel(aggType: AGG_TYPE, fieldLabel: string): Promise; getMetricFields(): IESAggField[]; getMetricFieldForName(fieldName: string): IESAggField | null; getValueAggsDsl(indexPattern: DataView): { [key: string]: unknown }; @@ -88,7 +88,7 @@ export abstract class AbstractESAggSource extends AbstractESSource implements IE }); } - getAggLabel(aggType: AGG_TYPE, fieldLabel: string): string { + async getAggLabel(aggType: AGG_TYPE, fieldLabel: string): Promise { switch (aggType) { case AGG_TYPE.COUNT: return COUNT_PROP_LABEL; 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 37b764bf6dbdc..b0a230bebc3cd 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 @@ -142,14 +142,6 @@ export class ESGeoGridSource extends AbstractESAggSource implements IMvtVectorSo } async getImmutableProperties(): Promise { - let indexPatternName = this.getIndexPatternId(); - try { - const indexPattern = await this.getIndexPattern(); - indexPatternName = indexPattern.title; - } catch (error) { - // ignore error, title will just default to id - } - return [ { label: getDataSourceLabel(), @@ -157,7 +149,7 @@ export class ESGeoGridSource extends AbstractESAggSource implements IMvtVectorSo }, { label: getDataViewLabel(), - value: indexPatternName, + value: await this.getDisplayName(), }, { label: i18n.translate('xpack.maps.source.esGrid.geospatialFieldLabel', { diff --git a/x-pack/plugins/maps/public/classes/sources/es_geo_line_source/es_geo_line_source.tsx b/x-pack/plugins/maps/public/classes/sources/es_geo_line_source/es_geo_line_source.tsx index 4bb23cfb7e55b..78aae064a6555 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_geo_line_source/es_geo_line_source.tsx +++ b/x-pack/plugins/maps/public/classes/sources/es_geo_line_source/es_geo_line_source.tsx @@ -109,14 +109,6 @@ export class ESGeoLineSource extends AbstractESAggSource { } async getImmutableProperties(): Promise { - let indexPatternTitle = this.getIndexPatternId(); - try { - const indexPattern = await this.getIndexPattern(); - indexPatternTitle = indexPattern.title; - } catch (error) { - // ignore error, title will just default to id - } - return [ { label: getDataSourceLabel(), @@ -124,7 +116,7 @@ export class ESGeoLineSource extends AbstractESAggSource { }, { label: getDataViewLabel(), - value: indexPatternTitle, + value: await this.getDisplayName(), }, { label: i18n.translate('xpack.maps.source.esGeoLine.geospatialFieldLabel', { diff --git a/x-pack/plugins/maps/public/classes/sources/es_pew_pew_source/es_pew_pew_source.tsx b/x-pack/plugins/maps/public/classes/sources/es_pew_pew_source/es_pew_pew_source.tsx index 910181d6a2868..8e9f0aabf3070 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_pew_pew_source/es_pew_pew_source.tsx +++ b/x-pack/plugins/maps/public/classes/sources/es_pew_pew_source/es_pew_pew_source.tsx @@ -96,14 +96,6 @@ export class ESPewPewSource extends AbstractESAggSource { } async getImmutableProperties() { - let indexPatternTitle = this.getIndexPatternId(); - try { - const indexPattern = await this.getIndexPattern(); - indexPatternTitle = indexPattern.title; - } catch (error) { - // ignore error, title will just default to id - } - return [ { label: getDataSourceLabel(), @@ -111,7 +103,7 @@ export class ESPewPewSource extends AbstractESAggSource { }, { label: getDataViewLabel(), - value: indexPatternTitle, + value: await this.getDisplayName(), }, { label: i18n.translate('xpack.maps.source.pewPew.sourceGeoFieldLabel', { diff --git a/x-pack/plugins/maps/public/classes/sources/es_search_source/__snapshots__/update_source_editor.test.js.snap b/x-pack/plugins/maps/public/classes/sources/es_search_source/__snapshots__/update_source_editor.test.js.snap index 1edbdec242722..c99d67ffd5a30 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_search_source/__snapshots__/update_source_editor.test.js.snap +++ b/x-pack/plugins/maps/public/classes/sources/es_search_source/__snapshots__/update_source_editor.test.js.snap @@ -94,12 +94,10 @@ exports[`should enable sort order select when sort field provided 1`] = ` clusteringDisabledReason={null} filterByMapBounds={true} indexPatternId="indexPattern1" - mvtDisabledReason={null} numberOfJoins={0} onChange={[Function]} scalingType="LIMIT" supportsClustering={false} - supportsMvt={true} /> { ? { indexPatternId: indexPattern.id, geoField: geoFieldName, - scalingType: field && field.isRuntimeField ? SCALING_TYPES.LIMIT : SCALING_TYPES.MVT, + scalingType: SCALING_TYPES.MVT, } : null; const isPointsOnly = field ? field.type === 'geo_point' : false; diff --git a/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx b/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx index b99903423376e..f55f5be747dcd 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx +++ b/x-pack/plugins/maps/public/classes/sources/es_search_source/es_search_source.tsx @@ -220,15 +220,12 @@ export class ESSearchSource extends AbstractESSource implements IMvtVectorSource } async getImmutableProperties(): Promise { - let indexPatternName = this.getIndexPatternId(); let geoFieldType = ''; try { - const indexPattern = await this.getIndexPattern(); - indexPatternName = indexPattern.title; const geoField = await this._getGeoField(); geoFieldType = geoField.type; } catch (error) { - // ignore error, title will just default to id + // ignore error, geoFieldType will just be blank } return [ @@ -238,7 +235,7 @@ export class ESSearchSource extends AbstractESSource implements IMvtVectorSource }, { label: getDataViewLabel(), - value: indexPatternName, + value: await this.getDisplayName(), }, { label: i18n.translate('xpack.maps.source.esSearch.geoFieldLabel', { diff --git a/x-pack/plugins/maps/public/classes/sources/es_search_source/update_source_editor.tsx b/x-pack/plugins/maps/public/classes/sources/es_search_source/update_source_editor.tsx index 2c8dca0f1cdf6..51ebe8cc9e042 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_search_source/update_source_editor.tsx +++ b/x-pack/plugins/maps/public/classes/sources/es_search_source/update_source_editor.tsx @@ -47,8 +47,6 @@ interface State { sortFields: DataViewField[] | undefined; supportsClustering: boolean; clusteringDisabledReason: string | null; - supportsMvt: boolean; - mvtDisabledReason: string | null; } export class UpdateSourceEditor extends Component { @@ -58,8 +56,6 @@ export class UpdateSourceEditor extends Component { sortFields: undefined, supportsClustering: false, clusteringDisabledReason: null, - supportsMvt: true, - mvtDisabledReason: null, }; componentDidMount() { @@ -111,13 +107,6 @@ export class UpdateSourceEditor extends Component { this.setState({ supportsClustering: supportsGeoTileAgg(geoField), clusteringDisabledReason: getGeoTileAggNotSupportedReason(geoField), - supportsMvt: !geoField.isRuntimeField, - mvtDisabledReason: geoField.isRuntimeField - ? i18n.translate('xpack.maps.source.esSearch.mvtDisableReason', { - defaultMessage: 'Vector tile API does not support runtime {type} field', - values: { type: geoField.type }, - }) - : null, sourceFields, sortFields: indexPattern.fields.filter( (field) => field.sortable && !indexPatterns.isNestedField(field) @@ -228,8 +217,6 @@ export class UpdateSourceEditor extends Component { scalingType={this.props.scalingType} supportsClustering={this.state.supportsClustering} clusteringDisabledReason={this.state.clusteringDisabledReason} - supportsMvt={this.state.supportsMvt} - mvtDisabledReason={this.state.mvtDisabledReason} numberOfJoins={this.props.numberOfJoins} /> diff --git a/x-pack/plugins/maps/public/classes/sources/es_search_source/util/__snapshots__/scaling_form.test.tsx.snap b/x-pack/plugins/maps/public/classes/sources/es_search_source/util/__snapshots__/scaling_form.test.tsx.snap index 0c77be62179c2..f8c5951e95e04 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_search_source/util/__snapshots__/scaling_form.test.tsx.snap +++ b/x-pack/plugins/maps/public/classes/sources/es_search_source/util/__snapshots__/scaling_form.test.tsx.snap @@ -34,7 +34,6 @@ exports[`scaling form should disable clusters option when clustering is not supp

{ _renderContent() { return (
- +
{this.props.mvtOptionLabel} (Default)
diff --git a/x-pack/plugins/maps/public/classes/sources/es_search_source/util/scaling_form.test.tsx b/x-pack/plugins/maps/public/classes/sources/es_search_source/util/scaling_form.test.tsx index 65ce7071df048..38137ffcd72df 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_search_source/util/scaling_form.test.tsx +++ b/x-pack/plugins/maps/public/classes/sources/es_search_source/util/scaling_form.test.tsx @@ -25,7 +25,6 @@ const defaultProps = { onChange: () => {}, scalingType: SCALING_TYPES.LIMIT, supportsClustering: true, - supportsMvt: true, termFields: [], numberOfJoins: 0, }; diff --git a/x-pack/plugins/maps/public/classes/sources/es_search_source/util/scaling_form.tsx b/x-pack/plugins/maps/public/classes/sources/es_search_source/util/scaling_form.tsx index fd0c23a98df45..ccd3b3913a085 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_search_source/util/scaling_form.tsx +++ b/x-pack/plugins/maps/public/classes/sources/es_search_source/util/scaling_form.tsx @@ -35,8 +35,6 @@ interface Props { scalingType: SCALING_TYPES; supportsClustering: boolean; clusteringDisabledReason?: string | null; - supportsMvt: boolean; - mvtDisabledReason?: string | null; numberOfJoins: number; } @@ -188,26 +186,6 @@ export class ScalingForm extends Component { ); } - _renderMvtRadio() { - const radio = ( - this._onScalingTypeSelect(SCALING_TYPES.MVT)} - disabled={!this.props.supportsMvt} - /> - ); - - return this.props.mvtDisabledReason ? ( - - {radio} - - ) : ( - radio - ); - } - _renderClusteringRadio() { const clusteringRadio = ( {
- {this._renderMvtRadio()} + this._onScalingTypeSelect(SCALING_TYPES.MVT)} + /> {this._renderClusteringRadio()} { try { const indexPattern = await this.getIndexPattern(); - return indexPattern.title; + return indexPattern.getName(); } catch (error) { // Unable to load index pattern, just return id as display name return this.getIndexPatternId(); diff --git a/x-pack/plugins/maps/public/classes/sources/es_term_source/es_term_source.test.js b/x-pack/plugins/maps/public/classes/sources/es_term_source/es_term_source.test.js index 362b2b341714f..c5bce9de0b033 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_term_source/es_term_source.test.js +++ b/x-pack/plugins/maps/public/classes/sources/es_term_source/es_term_source.test.js @@ -9,7 +9,6 @@ import { ESTermSource, extractPropertiesMap } from './es_term_source'; jest.mock('../../layers/vector_layer', () => {}); -const indexPatternTitle = 'myIndex'; const termFieldName = 'myTermField'; const sumFieldName = 'myFieldGettingSummed'; const metricExamples = [ @@ -33,19 +32,17 @@ describe('getMetricFields', () => { it('should override name and label of count metric', async () => { const source = new ESTermSource({ id: '1234', - indexPatternTitle: indexPatternTitle, term: termFieldName, indexPatternId: 'foobar', }); const metrics = source.getMetricFields(); expect(metrics[0].getName()).toEqual('__kbnjoin__count__1234'); - expect(await metrics[0].getLabel()).toEqual('Count of myIndex'); + expect(await metrics[0].getLabel()).toEqual('Count of foobar'); }); it('should override name and label of sum metric', async () => { const source = new ESTermSource({ id: '1234', - indexPatternTitle: indexPatternTitle, term: termFieldName, metrics: metricExamples, indexPatternId: 'foobar', @@ -54,7 +51,7 @@ describe('getMetricFields', () => { expect(metrics[0].getName()).toEqual('__kbnjoin__sum_of_myFieldGettingSummed__1234'); expect(await metrics[0].getLabel()).toEqual('my custom label'); expect(metrics[1].getName()).toEqual('__kbnjoin__count__1234'); - expect(await metrics[1].getLabel()).toEqual('Count of myIndex'); + expect(await metrics[1].getLabel()).toEqual('Count of foobar'); }); }); @@ -114,7 +111,6 @@ describe('getSyncMeta', () => { it('should contain meta requiring source re-fetch when changed', () => { const source = new ESTermSource({ id: '1234', - indexPatternTitle: indexPatternTitle, term: termFieldName, indexPatternId: 'foobar', size: 10, diff --git a/x-pack/plugins/maps/public/classes/sources/es_term_source/es_term_source.ts b/x-pack/plugins/maps/public/classes/sources/es_term_source/es_term_source.ts index 5447910dc524a..71ce42be22ab0 100644 --- a/x-pack/plugins/maps/public/classes/sources/es_term_source/es_term_source.ts +++ b/x-pack/plugins/maps/public/classes/sources/es_term_source/es_term_source.ts @@ -63,9 +63,6 @@ export class ESTermSource extends AbstractESAggSource implements ITermJoinSource } return { ...normalizedDescriptor, - indexPatternTitle: descriptor.indexPatternTitle - ? descriptor.indexPatternTitle - : descriptor.indexPatternId, term: descriptor.term!, type: SOURCE_TYPES.ES_TERM_SOURCE, }; @@ -109,11 +106,18 @@ export class ESTermSource extends AbstractESAggSource implements ITermJoinSource }); } - getAggLabel(aggType: AGG_TYPE, fieldLabel: string): string { + async getAggLabel(aggType: AGG_TYPE, fieldLabel: string): Promise { + let indexPatternLabel: string | undefined; + try { + const indexPattern = await this.getIndexPattern(); + indexPatternLabel = indexPattern.getName(); + } catch (error) { + indexPatternLabel = this._descriptor.indexPatternId; + } return aggType === AGG_TYPE.COUNT ? i18n.translate('xpack.maps.source.esJoin.countLabel', { - defaultMessage: `Count of {indexPatternTitle}`, - values: { indexPatternTitle: this._descriptor.indexPatternTitle }, + defaultMessage: `Count of {indexPatternLabel}`, + values: { indexPatternLabel }, }) : super.getAggLabel(aggType, fieldLabel); } @@ -145,14 +149,14 @@ export class ESTermSource extends AbstractESAggSource implements ITermJoinSource const rawEsData = await this._runEsQuery({ requestId: this.getId(), - requestName: `${this._descriptor.indexPatternTitle}.${this._termField.getName()}`, + requestName: `${indexPattern.getName()}.${this._termField.getName()}`, searchSource, registerCancelCallback, requestDescription: i18n.translate('xpack.maps.source.esJoin.joinDescription', { defaultMessage: `Elasticsearch terms aggregation request, left source: {leftSource}, right source: {rightSource}`, values: { leftSource: `${leftSourceName}:${leftFieldName}`, - rightSource: `${this._descriptor.indexPatternTitle}:${this._termField.getName()}`, + rightSource: `${indexPattern.getName()}:${this._termField.getName()}`, }, }), searchSessionId: searchFilters.searchSessionId, diff --git a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/__snapshots__/join_editor.test.tsx.snap b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/__snapshots__/join_editor.test.tsx.snap index de9d74f68f965..41903e8accafc 100644 --- a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/__snapshots__/join_editor.test.tsx.snap +++ b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/__snapshots__/join_editor.test.tsx.snap @@ -48,7 +48,6 @@ exports[`Should render join editor 1`] = ` "right": Object { "id": "673ff994-fc75-4c67-909b-69fcb0e1060e", "indexPatternId": "abcde", - "indexPatternTitle": "kibana_sample_data_logs", "metrics": Array [ Object { "label": "web logs count", diff --git a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/join_editor.test.tsx b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/join_editor.test.tsx index cb007110f7d35..1bfe40b555261 100644 --- a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/join_editor.test.tsx +++ b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/join_editor.test.tsx @@ -37,7 +37,6 @@ const defaultProps = { leftField: 'iso2', right: { id: '673ff994-fc75-4c67-909b-69fcb0e1060e', - indexPatternTitle: 'kibana_sample_data_logs', term: 'geo.src', indexPatternId: 'abcde', metrics: [ diff --git a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join.tsx b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join.tsx index bbfc9bbb0f302..1eb23dc207cd4 100644 --- a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join.tsx +++ b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join.tsx @@ -95,13 +95,7 @@ export class Join extends Component { }); }; - _onRightSourceChange = ({ - indexPatternId, - indexPatternTitle, - }: { - indexPatternId: string; - indexPatternTitle: string; - }) => { + _onRightSourceChange = (indexPatternId: string) => { this.setState({ rightFields: [], loadError: undefined, @@ -113,7 +107,6 @@ export class Join extends Component { right: { ...restOfRight, indexPatternId, - indexPatternTitle, type: SOURCE_TYPES.ES_TERM_SOURCE, } as ESTermSourceDescriptor, }); @@ -183,9 +176,7 @@ export class Join extends Component { const { join, onRemove, leftFields, leftSourceName } = this.props; const { rightFields, indexPattern } = this.state; const right = _.get(join, 'right', {}) as ESTermSourceDescriptor; - const rightSourceName = right.indexPatternTitle - ? right.indexPatternTitle - : right.indexPatternId; + const rightSourceName = indexPattern ? indexPattern.getName() : right.indexPatternId; const isJoinConfigComplete = join.leftField && right.indexPatternId && right.term; let metricsExpression; diff --git a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join_documentation_popover.tsx b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join_documentation_popover.tsx index 1799b7264611d..1df70f334a4fd 100644 --- a/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join_documentation_popover.tsx +++ b/x-pack/plugins/maps/public/connected_components/edit_layer_panel/join_editor/resources/join_documentation_popover.tsx @@ -34,7 +34,7 @@ export class JoinDocumentationPopover extends Component<{}, State> { _renderContent() { return (
- +

void; + onRightSourceChange: (indexPatternId: string) => void; // Right field props rightValue: string; @@ -81,20 +72,12 @@ export class JoinExpression extends Component { }); }; - _onRightSourceChange = async (indexPatternId?: string) => { + _onRightSourceChange = (indexPatternId?: string) => { if (!indexPatternId || indexPatternId.length === 0) { return; } - try { - const indexPattern = await getIndexPatternService().get(indexPatternId); - this.props.onRightSourceChange({ - indexPatternId, - indexPatternTitle: indexPattern.title, - }); - } catch (err) { - // do not call onChange with when unable to get indexPatternId - } + this.props.onRightSourceChange(indexPatternId); }; _onLeftFieldChange = (selectedFields: Array>) => { diff --git a/x-pack/plugins/maps/public/connected_components/toolbar_overlay/tools_control/tools_control.test.tsx b/x-pack/plugins/maps/public/connected_components/toolbar_overlay/tools_control/tools_control.test.tsx index 4601b5c569290..443dd7b47a069 100644 --- a/x-pack/plugins/maps/public/connected_components/toolbar_overlay/tools_control/tools_control.test.tsx +++ b/x-pack/plugins/maps/public/connected_components/toolbar_overlay/tools_control/tools_control.test.tsx @@ -12,14 +12,6 @@ import { ToolsControl } from './tools_control'; const defaultProps = { initiateDraw: () => {}, cancelDraw: () => {}, - geoFields: [ - { - geoFieldName: 'location', - geoFieldType: 'geo_point', - indexPatternTitle: 'my_index', - indexPatternId: '1', - }, - ], filterModeActive: false, activateDrawFilterMode: () => {}, deactivateDrawMode: () => {}, diff --git a/x-pack/plugins/maps/public/embeddable/map_component.tsx b/x-pack/plugins/maps/public/embeddable/map_component.tsx index 4709255927734..bb331ccf38c0e 100644 --- a/x-pack/plugins/maps/public/embeddable/map_component.tsx +++ b/x-pack/plugins/maps/public/embeddable/map_component.tsx @@ -16,6 +16,7 @@ import type { LazyLoadedMapModules } from '../lazy_load_bundle'; import { lazyLoadMapModules } from '../lazy_load_bundle'; interface Props { + title: string; filters?: Filter[]; query?: Query; timeRange?: TimeRange; @@ -81,7 +82,7 @@ export class MapComponent extends Component { { id: uuid(), attributes: { - title: '', + title: this.props.title, layerListJSON: JSON.stringify([ mapModules.createBasemapLayerDescriptor(), ...this.props.getLayerDescriptors({ diff --git a/x-pack/plugins/maps/public/lazy_load_bundle/index.ts b/x-pack/plugins/maps/public/lazy_load_bundle/index.ts index cbd1b3aa4b4c8..cdf61a6ab9173 100644 --- a/x-pack/plugins/maps/public/lazy_load_bundle/index.ts +++ b/x-pack/plugins/maps/public/lazy_load_bundle/index.ts @@ -51,7 +51,6 @@ export interface LazyLoadedMapModules { termsSize, colorSchema, indexPatternId, - indexPatternTitle, metricAgg, metricFieldName, }: CreateRegionMapLayerDescriptorParams) => LayerDescriptor | null; diff --git a/x-pack/plugins/maps/public/legacy_visualizations/index.ts b/x-pack/plugins/maps/public/legacy_visualizations/index.ts index a01e0ebefb5ad..f6e154949390e 100644 --- a/x-pack/plugins/maps/public/legacy_visualizations/index.ts +++ b/x-pack/plugins/maps/public/legacy_visualizations/index.ts @@ -7,3 +7,4 @@ export { createRegionMapFn, regionMapRenderer, regionMapVisType } from './region_map'; export { createTileMapFn, tileMapRenderer, tileMapVisType } from './tile_map'; +export { isLegacyMap } from './is_legacy_map'; diff --git a/x-pack/plugins/maps/public/legacy_visualizations/is_legacy_map.ts b/x-pack/plugins/maps/public/legacy_visualizations/is_legacy_map.ts new file mode 100644 index 0000000000000..2a5fc483027e7 --- /dev/null +++ b/x-pack/plugins/maps/public/legacy_visualizations/is_legacy_map.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { Embeddable } from '@kbn/embeddable-plugin/public'; +import type { VisualizeEmbeddable } from '@kbn/visualizations-plugin/public'; + +export function isLegacyMap(embeddable: Embeddable) { + return ( + embeddable.type === 'visualization' && + typeof (embeddable as VisualizeEmbeddable).getVis === 'function' && + ['region_map', 'tile_map'].includes((embeddable as VisualizeEmbeddable).getVis()?.type?.name) + ); +} 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 2334b9af1996c..b6945995da9d9 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 @@ -36,6 +36,7 @@ function RegionMapVisualization(props: Props) { } return ( ) { leftFieldName: vis.params.selectedLayer.isEMS ? vis.params.selectedJoinField.name : undefined, colorSchema: vis.params.colorSchema, indexPatternId: vis.data.indexPattern?.id, - indexPatternTitle: vis.data.indexPattern?.title, metricAgg: 'count', }; 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 fd5f916baf4c6..97a3609d765a4 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 @@ -36,6 +36,7 @@ function TileMapVisualization(props: Props) { } return ( { - return embeddable.type === MAP_SAVED_OBJECT_TYPE && !embeddable.getInput().disableTriggers; + return ( + (embeddable.type === MAP_SAVED_OBJECT_TYPE || isLegacyMap(embeddable)) && + !embeddable.getInput().disableTriggers + ); }, execute: async (context: FilterByMapExtentActionContext) => { const { FilterByMapExtentModal } = await import('./filter_by_map_extent_modal'); diff --git a/x-pack/plugins/maps/public/trigger_actions/synchronize_movement_action.tsx b/x-pack/plugins/maps/public/trigger_actions/synchronize_movement_action.tsx index e3404c628a54f..7116e55fd521d 100644 --- a/x-pack/plugins/maps/public/trigger_actions/synchronize_movement_action.tsx +++ b/x-pack/plugins/maps/public/trigger_actions/synchronize_movement_action.tsx @@ -11,6 +11,7 @@ import { createReactOverlays } from '@kbn/kibana-react-plugin/public'; import { Embeddable, EmbeddableInput } from '@kbn/embeddable-plugin/public'; import { createAction } from '@kbn/ui-actions-plugin/public'; import type { Embeddable as LensEmbeddable } from '@kbn/lens-plugin/public'; +import { isLegacyMap } from '../legacy_visualizations'; import { MAP_SAVED_OBJECT_TYPE } from '../../common/constants'; import { getCore } from '../kibana_services'; @@ -52,6 +53,10 @@ export const synchronizeMovementAction = createAction { diff --git a/x-pack/plugins/maps/tsconfig.json b/x-pack/plugins/maps/tsconfig.json index 57cc09dec4b16..ee28c2be8d31c 100644 --- a/x-pack/plugins/maps/tsconfig.json +++ b/x-pack/plugins/maps/tsconfig.json @@ -32,7 +32,6 @@ { "path": "../../../src/plugins/usage_collection/tsconfig.json" }, { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, { "path": "../../../src/plugins/kibana_utils/tsconfig.json" }, - { "path": "../../../src/plugins/shared_ux/tsconfig.json" }, { "path": "../../../src/plugins/screenshot_mode/tsconfig.json" }, { "path": "../cloud/tsconfig.json" }, { "path": "../features/tsconfig.json" }, diff --git a/x-pack/plugins/ml/public/application/components/chart_tooltip/chart_tooltip.tsx b/x-pack/plugins/ml/public/application/components/chart_tooltip/chart_tooltip.tsx index d5b31b418e346..b721608d53f7e 100644 --- a/x-pack/plugins/ml/public/application/components/chart_tooltip/chart_tooltip.tsx +++ b/x-pack/plugins/ml/public/application/components/chart_tooltip/chart_tooltip.tsx @@ -122,11 +122,14 @@ const Tooltip: FC<{ service: ChartTooltipService }> = React.memo(({ service }) = return ( = ({ children }) => { const { setHeaderActionMenu } = useContext(MlPageControlsContext); - const portalNode = useMemo(() => createPortalNode(), []); + const portalNode = useMemo(() => createHtmlPortalNode(), []); useEffect(() => { if (!setHeaderActionMenu) { diff --git a/x-pack/plugins/ml/public/application/components/ml_page/ml_page.tsx b/x-pack/plugins/ml/public/application/components/ml_page/ml_page.tsx index 90dd95dbafb71..bd12a120420c2 100644 --- a/x-pack/plugins/ml/public/application/components/ml_page/ml_page.tsx +++ b/x-pack/plugins/ml/public/application/components/ml_page/ml_page.tsx @@ -11,7 +11,7 @@ import { i18n } from '@kbn/i18n'; import { Redirect, Route, Switch } from 'react-router-dom'; import type { AppMountParameters } from '@kbn/core/public'; import { KibanaPageTemplate, RedirectAppLinks } from '@kbn/kibana-react-plugin/public'; -import { createPortalNode, PortalNode } from 'react-reverse-portal'; +import { createHtmlPortalNode, HtmlPortalNode } from 'react-reverse-portal'; import { MlPageHeaderRenderer } from '../page_header/page_header'; import { useSideNavItems } from './side_nav'; import * as routes from '../../routing/routes'; @@ -23,13 +23,13 @@ import { useActiveRoute } from '../../routing/use_active_route'; import { useDocTitle } from '../../routing/use_doc_title'; export const MlPageControlsContext = createContext<{ - headerPortal: PortalNode; + headerPortal: HtmlPortalNode; setHeaderActionMenu?: AppMountParameters['setHeaderActionMenu']; setIsHeaderMounted: (v: boolean) => void; isHeaderMounted: boolean; }>({ setHeaderActionMenu: () => {}, - headerPortal: createPortalNode(), + headerPortal: createHtmlPortalNode(), isHeaderMounted: false, setIsHeaderMounted: () => {}, }); @@ -46,7 +46,7 @@ export const MlPage: FC<{ pageDeps: PageDependencies }> = React.memo(({ pageDeps }, } = useMlKibana(); - const headerPortalNode = useMemo(() => createPortalNode(), []); + const headerPortalNode = useMemo(() => createHtmlPortalNode(), []); const [isHeaderMounted, setIsHeaderMounted] = useState(false); const routeList = useMemo( @@ -114,7 +114,7 @@ interface CommonPageWrapperProps { setIsHeaderMounted: (v: boolean) => void; pageDeps: PageDependencies; routeList: MlRoute[]; - headerPortal: PortalNode; + headerPortal: HtmlPortalNode; } const CommonPageWrapper: FC = React.memo(({ pageDeps, routeList }) => { diff --git a/x-pack/plugins/monitoring/public/application/hooks/use_breadcrumbs.ts b/x-pack/plugins/monitoring/public/application/hooks/use_breadcrumbs.ts index 95cae1720fd07..7654e2d734e4c 100644 --- a/x-pack/plugins/monitoring/public/application/hooks/use_breadcrumbs.ts +++ b/x-pack/plugins/monitoring/public/application/hooks/use_breadcrumbs.ts @@ -301,4 +301,4 @@ export const useBreadcrumbs = ({ history }: { history: History }) => { }; }; -export const BreadcrumbContainer = createContainer(useBreadcrumbs); +export const [BreadcrumbContainer, useBreadcrumbContainerContext] = createContainer(useBreadcrumbs); diff --git a/x-pack/plugins/monitoring/public/application/hooks/use_charts.tsx b/x-pack/plugins/monitoring/public/application/hooks/use_charts.tsx index c37fae742d0ca..f456b62312ec6 100644 --- a/x-pack/plugins/monitoring/public/application/hooks/use_charts.tsx +++ b/x-pack/plugins/monitoring/public/application/hooks/use_charts.tsx @@ -5,15 +5,15 @@ * 2.0. */ import moment from 'moment'; -import { useContext, useState, useEffect, useRef } from 'react'; +import { useState, useEffect, useRef } from 'react'; import { useHistory } from 'react-router-dom'; import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { MonitoringTimeContainer } from './use_monitoring_time'; +import { useMonitoringTimeContainerContext } from './use_monitoring_time'; export function useCharts() { const { services } = useKibana<{ data: any }>(); const history = useHistory(); - const { handleTimeChange } = useContext(MonitoringTimeContainer.Context); + const { handleTimeChange } = useMonitoringTimeContainerContext(); const [zoomInLevel, setZoomInLevel] = useState(0); diff --git a/x-pack/plugins/monitoring/public/application/hooks/use_monitoring_time.ts b/x-pack/plugins/monitoring/public/application/hooks/use_monitoring_time.ts index 13f40fc89a704..74807fa957e6a 100644 --- a/x-pack/plugins/monitoring/public/application/hooks/use_monitoring_time.ts +++ b/x-pack/plugins/monitoring/public/application/hooks/use_monitoring_time.ts @@ -75,4 +75,5 @@ export const useMonitoringTime = () => { }; }; -export const MonitoringTimeContainer = createContainer(useMonitoringTime); +export const [MonitoringTimeContainer, useMonitoringTimeContainerContext] = + createContainer(useMonitoringTime); diff --git a/x-pack/plugins/monitoring/public/application/index.tsx b/x-pack/plugins/monitoring/public/application/index.tsx index 3fd12c312d13f..b313992863023 100644 --- a/x-pack/plugins/monitoring/public/application/index.tsx +++ b/x-pack/plugins/monitoring/public/application/index.tsx @@ -107,8 +107,8 @@ const MonitoringApp: React.FC<{ uiSettings={core.uiSettings} > - - + + @@ -336,8 +336,8 @@ const MonitoringApp: React.FC<{ /> - - + + diff --git a/x-pack/plugins/monitoring/public/application/pages/apm/instance.tsx b/x-pack/plugins/monitoring/public/application/pages/apm/instance.tsx index 97f19f3cf9204..e4340d6fdaa67 100644 --- a/x-pack/plugins/monitoring/public/application/pages/apm/instance.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/apm/instance.tsx @@ -13,7 +13,7 @@ import { useKibana } from '@kbn/kibana-react-plugin/public'; import { ComponentProps } from '../../route_init'; import { GlobalStateContext } from '../../contexts/global_state_context'; import { useCharts } from '../../hooks/use_charts'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; import { PageTemplate } from '../page_template'; // @ts-ignore import { ApmServerInstance } from '../../../components/apm/instance'; @@ -23,7 +23,7 @@ export const ApmInstancePage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); const { services } = useKibana<{ data: any }>(); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const { zoomInfo, onBrush } = useCharts(); const clusterUuid = globalState.cluster_uuid; const ccs = globalState.ccs; diff --git a/x-pack/plugins/monitoring/public/application/pages/apm/instances.tsx b/x-pack/plugins/monitoring/public/application/pages/apm/instances.tsx index 29f6a1f9e056e..e86ae43034af4 100644 --- a/x-pack/plugins/monitoring/public/application/pages/apm/instances.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/apm/instances.tsx @@ -17,7 +17,7 @@ import { ApmTemplate } from './apm_template'; import { ApmServerInstances } from '../../../components/apm/instances'; import { SetupModeRenderer } from '../../../components/renderers/setup_mode'; import { SetupModeContext } from '../../../components/setup_mode/setup_mode_context'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; import { APM_SYSTEM_ID } from '../../../../common/constants'; interface SetupModeProps { @@ -29,7 +29,7 @@ interface SetupModeProps { export const ApmInstancesPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); const { services } = useKibana<{ data: any }>(); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const { updateTotalItemCount, getPaginationTableProps } = useTable('apm.instances'); const clusterUuid = globalState.cluster_uuid; const ccs = globalState.ccs; diff --git a/x-pack/plugins/monitoring/public/application/pages/apm/overview.tsx b/x-pack/plugins/monitoring/public/application/pages/apm/overview.tsx index 1cf264daaeea3..39890954c877c 100644 --- a/x-pack/plugins/monitoring/public/application/pages/apm/overview.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/apm/overview.tsx @@ -13,7 +13,7 @@ import { ComponentProps } from '../../route_init'; import { ApmTemplate } from './apm_template'; import { GlobalStateContext } from '../../contexts/global_state_context'; import { useCharts } from '../../hooks/use_charts'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; // @ts-ignore import { ApmOverview } from '../../../components/apm/overview'; @@ -23,7 +23,7 @@ export const ApmOverviewPage: React.FC = ({ clusters }) => { const { services } = useKibana<{ data: any }>(); const clusterUuid = globalState.cluster_uuid; const ccs = globalState.ccs; - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const cluster = find(clusters, { cluster_uuid: clusterUuid, }) as any; diff --git a/x-pack/plugins/monitoring/public/application/pages/beats/instance.tsx b/x-pack/plugins/monitoring/public/application/pages/beats/instance.tsx index 68345db40caf2..f9b4794e44fed 100644 --- a/x-pack/plugins/monitoring/public/application/pages/beats/instance.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/beats/instance.tsx @@ -15,7 +15,7 @@ import { GlobalStateContext } from '../../contexts/global_state_context'; import { useCharts } from '../../hooks/use_charts'; // @ts-ignore import { Beat } from '../../../components/beats/beat'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; import { BeatsTemplate } from './beats_template'; export const BeatsInstancePage: React.FC = ({ clusters }) => { @@ -23,7 +23,7 @@ export const BeatsInstancePage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); const { services } = useKibana<{ data: any }>(); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const { zoomInfo, onBrush } = useCharts(); const clusterUuid = globalState.cluster_uuid; const ccs = globalState.ccs; diff --git a/x-pack/plugins/monitoring/public/application/pages/beats/instances.tsx b/x-pack/plugins/monitoring/public/application/pages/beats/instances.tsx index ea4f04151e83a..6fce1668fc98a 100644 --- a/x-pack/plugins/monitoring/public/application/pages/beats/instances.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/beats/instances.tsx @@ -17,13 +17,13 @@ import { BeatsTemplate } from './beats_template'; import { Listing } from '../../../components/beats/listing'; import { SetupModeRenderer, SetupModeProps } from '../../../components/renderers/setup_mode'; import { SetupModeContext } from '../../../components/setup_mode/setup_mode_context'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; import { BEATS_SYSTEM_ID } from '../../../../common/constants'; export const BeatsInstancesPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); const { services } = useKibana<{ data: any }>(); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const { updateTotalItemCount, getPaginationTableProps } = useTable('beats.instances'); const clusterUuid = globalState.cluster_uuid; const ccs = globalState.ccs; diff --git a/x-pack/plugins/monitoring/public/application/pages/beats/overview.tsx b/x-pack/plugins/monitoring/public/application/pages/beats/overview.tsx index 610fbe7ce2daf..4a142a8abd425 100644 --- a/x-pack/plugins/monitoring/public/application/pages/beats/overview.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/beats/overview.tsx @@ -15,7 +15,7 @@ import { GlobalStateContext } from '../../contexts/global_state_context'; import { useCharts } from '../../hooks/use_charts'; // @ts-ignore import { BeatsOverview } from '../../../components/beats/overview'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; export const BeatsOverviewPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); @@ -23,7 +23,7 @@ export const BeatsOverviewPage: React.FC = ({ clusters }) => { const { services } = useKibana<{ data: any }>(); const clusterUuid = globalState.cluster_uuid; const ccs = globalState.ccs; - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const cluster = find(clusters, { cluster_uuid: clusterUuid, }) as any; diff --git a/x-pack/plugins/monitoring/public/application/pages/cluster/overview_page.tsx b/x-pack/plugins/monitoring/public/application/pages/cluster/overview_page.tsx index d128beee7ce87..993cabad38af0 100644 --- a/x-pack/plugins/monitoring/public/application/pages/cluster/overview_page.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/cluster/overview_page.tsx @@ -16,7 +16,7 @@ import { Overview } from '../../../components/cluster/overview'; import { ExternalConfigContext } from '../../contexts/external_config_context'; import { SetupModeRenderer, SetupModeProps } from '../../../components/renderers/setup_mode'; import { SetupModeContext } from '../../../components/setup_mode/setup_mode_context'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; import { fetchClusters } from '../../../lib/fetch_clusters'; import { AlertsByName } from '../../../alerts/types'; import { fetchAlerts } from '../../../lib/fetch_alerts'; @@ -33,7 +33,7 @@ export const ClusterOverview: React.FC<{}> = () => { const [clusters, setClusters] = useState([] as any); const [alerts, setAlerts] = useState({}); const [loaded, setLoaded] = useState(false); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); let tabs: TabMenuItem[] = []; diff --git a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/ccr_page.tsx b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/ccr_page.tsx index cc0113acb3b5f..9018d2ab2071d 100644 --- a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/ccr_page.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/ccr_page.tsx @@ -18,7 +18,7 @@ import { SetupModeContext } from '../../../components/setup_mode/setup_mode_cont import { AlertsByName } from '../../../alerts/types'; import { fetchAlerts } from '../../../lib/fetch_alerts'; import { ELASTICSEARCH_SYSTEM_ID, RULE_CCR_READ_EXCEPTIONS } from '../../../../common/constants'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; interface SetupModeProps { setupMode: any; flyoutComponent: any; @@ -27,7 +27,7 @@ interface SetupModeProps { export const ElasticsearchCcrPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const { services } = useKibana<{ data: any }>(); const clusterUuid = globalState.cluster_uuid; diff --git a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/ccr_shard_page.tsx b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/ccr_shard_page.tsx index 925baa5edd052..3db3c25fd1f39 100644 --- a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/ccr_shard_page.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/ccr_shard_page.tsx @@ -20,7 +20,7 @@ import { SetupModeContext } from '../../../components/setup_mode/setup_mode_cont import { AlertsByName } from '../../../alerts/types'; import { fetchAlerts } from '../../../lib/fetch_alerts'; import { ELASTICSEARCH_SYSTEM_ID, RULE_CCR_READ_EXCEPTIONS } from '../../../../common/constants'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; interface SetupModeProps { setupMode: any; @@ -33,7 +33,7 @@ export const ElasticsearchCcrShardPage: React.FC = ({ clusters } const { services } = useKibana<{ data: any }>(); const [data, setData] = useState({} as any); const { index, shardId }: { index: string; shardId: string } = useParams(); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const clusterUuid = globalState.cluster_uuid; const cluster = find(clusters, { diff --git a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/index_advanced_page.tsx b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/index_advanced_page.tsx index 410a909a9c4ab..0dab4a4d4bc52 100644 --- a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/index_advanced_page.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/index_advanced_page.tsx @@ -20,11 +20,11 @@ import { AdvancedIndex } from '../../../components/elasticsearch/index/advanced' import { AlertsByName } from '../../../alerts/types'; import { fetchAlerts } from '../../../lib/fetch_alerts'; import { ELASTICSEARCH_SYSTEM_ID, RULE_LARGE_SHARD_SIZE } from '../../../../common/constants'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; export const ElasticsearchIndexAdvancedPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const { services } = useKibana<{ data: any }>(); const { index }: { index: string } = useParams(); const { zoomInfo, onBrush } = useCharts(); diff --git a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/index_page.tsx b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/index_page.tsx index dc2f718e64700..73c32fe0a42f3 100644 --- a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/index_page.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/index_page.tsx @@ -24,11 +24,11 @@ import { labels } from '../../../components/elasticsearch/shard_allocation/lib/l import { AlertsByName } from '../../../alerts/types'; import { fetchAlerts } from '../../../lib/fetch_alerts'; import { ELASTICSEARCH_SYSTEM_ID, RULE_LARGE_SHARD_SIZE } from '../../../../common/constants'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; export const ElasticsearchIndexPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const { services } = useKibana<{ data: any }>(); const { index }: { index: string } = useParams(); const { zoomInfo, onBrush } = useCharts(); diff --git a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/indices_page.tsx b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/indices_page.tsx index d14015532167e..49be26854571e 100644 --- a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/indices_page.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/indices_page.tsx @@ -19,11 +19,11 @@ import { useLocalStorage } from '../../hooks/use_local_storage'; import { AlertsByName } from '../../../alerts/types'; import { fetchAlerts } from '../../../lib/fetch_alerts'; import { ELASTICSEARCH_SYSTEM_ID, RULE_LARGE_SHARD_SIZE } from '../../../../common/constants'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; export const ElasticsearchIndicesPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const { services } = useKibana<{ data: any }>(); const { getPaginationTableProps } = useTable('elasticsearch.indices'); const clusterUuid = globalState.cluster_uuid; diff --git a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/ml_jobs_page.tsx b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/ml_jobs_page.tsx index 5c7fd227a0a53..0f9fe473ae4af 100644 --- a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/ml_jobs_page.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/ml_jobs_page.tsx @@ -16,7 +16,7 @@ import { SetupModeRenderer } from '../../../components/renderers/setup_mode'; import { SetupModeContext } from '../../../components/setup_mode/setup_mode_context'; import { useTable } from '../../hooks/use_table'; import type { MLJobs } from '../../../types'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; import { ELASTICSEARCH_SYSTEM_ID } from '../../../../common/constants'; interface SetupModeProps { @@ -27,7 +27,7 @@ interface SetupModeProps { export const ElasticsearchMLJobsPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const { services } = useKibana<{ data: any }>(); const { getPaginationTableProps } = useTable('elasticsearch.mlJobs'); const clusterUuid = globalState.cluster_uuid; diff --git a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/node_advanced_page.tsx b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/node_advanced_page.tsx index 05394a6d36aec..bf4b6c48b551e 100644 --- a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/node_advanced_page.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/node_advanced_page.tsx @@ -25,11 +25,11 @@ import { RULE_DISK_USAGE, RULE_MEMORY_USAGE, } from '../../../../common/constants'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; export const ElasticsearchNodeAdvancedPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const { zoomInfo, onBrush } = useCharts(); const [data, setData] = useState({} as any); diff --git a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/node_page.tsx b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/node_page.tsx index e41e921985015..b6682a2da876d 100644 --- a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/node_page.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/node_page.tsx @@ -31,11 +31,11 @@ import { RULE_DISK_USAGE, RULE_MEMORY_USAGE, } from '../../../../common/constants'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; export const ElasticsearchNodePage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const { zoomInfo, onBrush } = useCharts(); const [showSystemIndices, setShowSystemIndices] = useLocalStorage( 'showSystemIndices', diff --git a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/nodes_page.tsx b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/nodes_page.tsx index 156d8463b80be..b258361474a61 100644 --- a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/nodes_page.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/nodes_page.tsx @@ -16,7 +16,7 @@ import { ComponentProps } from '../../route_init'; import { SetupModeRenderer, SetupModeProps } from '../../../components/renderers/setup_mode'; import { SetupModeContext } from '../../../components/setup_mode/setup_mode_context'; import { useTable } from '../../hooks/use_table'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; import { AlertsByName } from '../../../alerts/types'; import { fetchAlerts } from '../../../lib/fetch_alerts'; import { @@ -34,7 +34,7 @@ export const ElasticsearchNodesPage: React.FC = ({ clusters }) = const { showCgroupMetricsElasticsearch } = useContext(ExternalConfigContext); const { services } = useKibana<{ data: any }>(); const [isLoading, setIsLoading] = React.useState(false); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const { getPaginationRouteOptions, updateTotalItemCount, getPaginationTableProps } = useTable('elasticsearch.nodes'); const clusterUuid = globalState.cluster_uuid; diff --git a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/overview.tsx b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/overview.tsx index c4524bb161040..4e213405cfd08 100644 --- a/x-pack/plugins/monitoring/public/application/pages/elasticsearch/overview.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/elasticsearch/overview.tsx @@ -14,13 +14,13 @@ import { GlobalStateContext } from '../../contexts/global_state_context'; import { ElasticsearchOverview } from '../../../components/elasticsearch'; import { ComponentProps } from '../../route_init'; import { useCharts } from '../../hooks/use_charts'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; export const ElasticsearchOverviewPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); const { zoomInfo, onBrush } = useCharts(); const { services } = useKibana<{ data: any }>(); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const clusterUuid = globalState.cluster_uuid; const ccs = globalState.ccs; const cluster = find(clusters, { diff --git a/x-pack/plugins/monitoring/public/application/pages/enterprise_search/overview.tsx b/x-pack/plugins/monitoring/public/application/pages/enterprise_search/overview.tsx index 75d2d2f89fae1..0cd97166dcf5d 100644 --- a/x-pack/plugins/monitoring/public/application/pages/enterprise_search/overview.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/enterprise_search/overview.tsx @@ -14,7 +14,7 @@ import { EntSearchTemplate } from './ent_search_template'; import { GlobalStateContext } from '../../contexts/global_state_context'; import { useCharts } from '../../hooks/use_charts'; import { EnterpriseSearchOverview } from '../../../components/enterprise_search/overview'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; export const EntSearchOverviewPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); @@ -22,7 +22,7 @@ export const EntSearchOverviewPage: React.FC = ({ clusters }) => const { services } = useKibana<{ data: any }>(); const clusterUuid = globalState.cluster_uuid; const ccs = globalState.ccs; - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const cluster = find(clusters, { cluster_uuid: clusterUuid, }) as any; diff --git a/x-pack/plugins/monitoring/public/application/pages/home/cluster_listing.tsx b/x-pack/plugins/monitoring/public/application/pages/home/cluster_listing.tsx index 80c46342294f5..45ed6172d4262 100644 --- a/x-pack/plugins/monitoring/public/application/pages/home/cluster_listing.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/home/cluster_listing.tsx @@ -17,7 +17,7 @@ import { ExternalConfigContext } from '../../contexts/external_config_context'; import { ComponentProps } from '../../route_init'; import { useTable } from '../../hooks/use_table'; import { PageTemplate, TabMenuItem } from '../page_template'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; import { fetchClusters } from '../../../lib/fetch_clusters'; const pageTitle = i18n.translate('xpack.monitoring.cluster.listing.pageTitle', { @@ -40,7 +40,7 @@ export const ClusterListing: React.FC = () => { const externalConfig = useContext(ExternalConfigContext); const { services } = useKibana<{ data: any }>(); const [clusters, setClusters] = useState([] as any); - const { update: updateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { update: updateBreadcrumbs } = useBreadcrumbContainerContext(); const fakeScope = { $evalAsync: (fn: () => void) => fn(), diff --git a/x-pack/plugins/monitoring/public/application/pages/kibana/instance.tsx b/x-pack/plugins/monitoring/public/application/pages/kibana/instance.tsx index c1dfecd69d2a8..56d8b6742c282 100644 --- a/x-pack/plugins/monitoring/public/application/pages/kibana/instance.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/kibana/instance.tsx @@ -23,7 +23,7 @@ import { ComponentProps } from '../../route_init'; import { GlobalStateContext } from '../../contexts/global_state_context'; import { useCharts } from '../../hooks/use_charts'; // @ts-ignore -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; // @ts-ignore import { MonitoringTimeseriesContainer } from '../../../components/chart'; // @ts-ignore @@ -148,7 +148,7 @@ export const KibanaInstancePage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); const { services } = useKibana<{ data: any }>(); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const clusterUuid = globalState.cluster_uuid; const ccs = globalState.ccs; const cluster = find(clusters, { diff --git a/x-pack/plugins/monitoring/public/application/pages/kibana/instances.tsx b/x-pack/plugins/monitoring/public/application/pages/kibana/instances.tsx index 6f1f822b8488f..5d272be8be30c 100644 --- a/x-pack/plugins/monitoring/public/application/pages/kibana/instances.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/kibana/instances.tsx @@ -18,7 +18,7 @@ import { KibanaInstances } from '../../../components/kibana/instances'; // @ts-ignore import { SetupModeRenderer, SetupModeProps } from '../../../components/renderers/setup_mode'; import { SetupModeContext } from '../../../components/setup_mode/setup_mode_context'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; import { AlertsByName } from '../../../alerts/types'; import { fetchAlerts } from '../../../lib/fetch_alerts'; import { KIBANA_SYSTEM_ID, RULE_KIBANA_VERSION_MISMATCH } from '../../../../common/constants'; @@ -26,7 +26,7 @@ import { KIBANA_SYSTEM_ID, RULE_KIBANA_VERSION_MISMATCH } from '../../../../comm export const KibanaInstancesPage: React.FC = ({ clusters }) => { const { cluster_uuid: clusterUuid, ccs } = useContext(GlobalStateContext); const { services } = useKibana<{ data: any }>(); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const { updateTotalItemCount, getPaginationTableProps } = useTable('kibana.instances'); const cluster = find(clusters, { cluster_uuid: clusterUuid, diff --git a/x-pack/plugins/monitoring/public/application/pages/kibana/overview.tsx b/x-pack/plugins/monitoring/public/application/pages/kibana/overview.tsx index 5ae89fd929eb4..dd31acec85e11 100644 --- a/x-pack/plugins/monitoring/public/application/pages/kibana/overview.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/kibana/overview.tsx @@ -25,7 +25,7 @@ import { ComponentProps } from '../../route_init'; import { MonitoringTimeseriesContainer } from '../../../components/chart'; // @ts-ignore import { ClusterStatus } from '../../../components/kibana/cluster_status'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; import { useCharts } from '../../hooks/use_charts'; const KibanaOverview = ({ data }: { data: any }) => { @@ -107,7 +107,7 @@ const KibanaOverview = ({ data }: { data: any }) => { export const KibanaOverviewPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); const { services } = useKibana<{ data: any }>(); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const [data, setData] = useState(); const clusterUuid = globalState.cluster_uuid; const cluster = find(clusters, { diff --git a/x-pack/plugins/monitoring/public/application/pages/license_page.tsx b/x-pack/plugins/monitoring/public/application/pages/license_page.tsx index 2f0e424d14238..b7288ce1b872b 100644 --- a/x-pack/plugins/monitoring/public/application/pages/license_page.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/license_page.tsx @@ -13,7 +13,7 @@ import { PageTemplate } from './page_template'; import { License } from '../../components'; import { GlobalStateContext } from '../contexts/global_state_context'; import { CODE_PATH_LICENSE, STANDALONE_CLUSTER_CLUSTER_UUID } from '../../../common/constants'; -import { MonitoringTimeContainer } from '../hooks/use_monitoring_time'; +import { useMonitoringTimeContainerContext } from '../hooks/use_monitoring_time'; const CODE_PATHS = [CODE_PATH_LICENSE]; @@ -22,7 +22,7 @@ export const LicensePage: React.FC<{}> = () => { defaultMessage: 'License', }); - const { setIsDisabled } = useContext(MonitoringTimeContainer.Context); + const { setIsDisabled } = useMonitoringTimeContainerContext(); useEffect(() => { setIsDisabled(true); return () => { diff --git a/x-pack/plugins/monitoring/public/application/pages/logstash/advanced.tsx b/x-pack/plugins/monitoring/public/application/pages/logstash/advanced.tsx index 29b2e4f6c1e44..f89d7b5df3726 100644 --- a/x-pack/plugins/monitoring/public/application/pages/logstash/advanced.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/logstash/advanced.tsx @@ -30,7 +30,7 @@ import { useCharts } from '../../hooks/use_charts'; import { AlertsByName } from '../../../alerts/types'; import { fetchAlerts } from '../../../lib/fetch_alerts'; import { RULE_LOGSTASH_VERSION_MISMATCH } from '../../../../common/constants'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; export const LogStashNodeAdvancedPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); @@ -43,7 +43,7 @@ export const LogStashNodeAdvancedPage: React.FC = ({ clusters }) cluster_uuid: clusterUuid, }) as any; - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const [data, setData] = useState({} as any); const [alerts, setAlerts] = useState({}); diff --git a/x-pack/plugins/monitoring/public/application/pages/logstash/node.tsx b/x-pack/plugins/monitoring/public/application/pages/logstash/node.tsx index 772bf5718c4ec..75d752b696fd9 100644 --- a/x-pack/plugins/monitoring/public/application/pages/logstash/node.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/logstash/node.tsx @@ -31,13 +31,13 @@ import { useCharts } from '../../hooks/use_charts'; import { AlertsByName } from '../../../alerts/types'; import { fetchAlerts } from '../../../lib/fetch_alerts'; import { RULE_LOGSTASH_VERSION_MISMATCH } from '../../../../common/constants'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; export const LogStashNodePage: React.FC = ({ clusters }) => { const match = useRouteMatch<{ uuid: string | undefined }>(); const globalState = useContext(GlobalStateContext); const { services } = useKibana<{ data: any }>(); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const clusterUuid = globalState.cluster_uuid; const ccs = globalState.ccs; const cluster = find(clusters, { diff --git a/x-pack/plugins/monitoring/public/application/pages/logstash/node_pipelines.tsx b/x-pack/plugins/monitoring/public/application/pages/logstash/node_pipelines.tsx index 90c8421a31eb0..6c97661e915cb 100644 --- a/x-pack/plugins/monitoring/public/application/pages/logstash/node_pipelines.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/logstash/node_pipelines.tsx @@ -20,7 +20,7 @@ import { useTable } from '../../hooks/use_table'; // @ts-expect-error import { PipelineListing } from '../../../components/logstash/pipeline_listing/pipeline_listing'; import { useCharts } from '../../hooks/use_charts'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; export const LogStashNodePipelinesPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); @@ -33,7 +33,7 @@ export const LogStashNodePipelinesPage: React.FC = ({ clusters } cluster_uuid: clusterUuid, }) as any; - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const { getPaginationTableProps, getPaginationRouteOptions, updateTotalItemCount } = useTable('logstash.pipelines'); diff --git a/x-pack/plugins/monitoring/public/application/pages/logstash/nodes.tsx b/x-pack/plugins/monitoring/public/application/pages/logstash/nodes.tsx index b350f057aae96..d3097ecc4a145 100644 --- a/x-pack/plugins/monitoring/public/application/pages/logstash/nodes.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/logstash/nodes.tsx @@ -19,7 +19,7 @@ import { useTable } from '../../hooks/use_table'; import { LOGSTASH_SYSTEM_ID, RULE_LOGSTASH_VERSION_MISMATCH } from '../../../../common/constants'; import { AlertsByName } from '../../../alerts/types'; import { fetchAlerts } from '../../../lib/fetch_alerts'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; interface SetupModeProps { setupMode: any; @@ -32,7 +32,7 @@ export const LogStashNodesPage: React.FC = ({ clusters }) => { const { services } = useKibana<{ data: any }>(); const clusterUuid = globalState.cluster_uuid; const ccs = globalState.ccs; - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const cluster = find(clusters, { cluster_uuid: clusterUuid, }) as any; diff --git a/x-pack/plugins/monitoring/public/application/pages/logstash/overview.tsx b/x-pack/plugins/monitoring/public/application/pages/logstash/overview.tsx index e8b9dda758713..20e7339e2b580 100644 --- a/x-pack/plugins/monitoring/public/application/pages/logstash/overview.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/logstash/overview.tsx @@ -14,7 +14,7 @@ import { useCharts } from '../../hooks/use_charts'; // @ts-ignore import { Overview } from '../../../components/logstash/overview'; import { LogstashTemplate } from './logstash_template'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; export const LogStashOverviewPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); @@ -25,7 +25,7 @@ export const LogStashOverviewPage: React.FC = ({ clusters }) => const cluster = find(clusters, { cluster_uuid: clusterUuid, }) as any; - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const [data, setData] = useState(null); // const [showShardActivityHistory, setShowShardActivityHistory] = useState(false); diff --git a/x-pack/plugins/monitoring/public/application/pages/logstash/pipeline.tsx b/x-pack/plugins/monitoring/public/application/pages/logstash/pipeline.tsx index af68390aa4e76..c3c229458da08 100644 --- a/x-pack/plugins/monitoring/public/application/pages/logstash/pipeline.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/logstash/pipeline.tsx @@ -29,7 +29,7 @@ import { formatTimestampToDuration } from '../../../../common'; import { CALCULATE_DURATION_SINCE } from '../../../../common/constants'; import { getSafeForExternalLink } from '../../../lib/get_safe_for_external_link'; import { PipelineVersions } from './pipeline_versions_dropdown'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; export const LogStashPipelinePage: React.FC = ({ clusters }) => { const match = useRouteMatch<{ id: string | undefined; hash: string | undefined }>(); @@ -126,7 +126,7 @@ export const LogStashPipelinePage: React.FC = ({ clusters }) => }, [data]); const timeseriesTooltipXValueFormatter = (xValue: any) => moment(xValue).format(dateFormat); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const onVertexChange = useCallback((vertex: any) => { if (!vertex) { diff --git a/x-pack/plugins/monitoring/public/application/pages/logstash/pipelines.tsx b/x-pack/plugins/monitoring/public/application/pages/logstash/pipelines.tsx index a669b06ac8bcf..19d5277f1a85a 100644 --- a/x-pack/plugins/monitoring/public/application/pages/logstash/pipelines.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/logstash/pipelines.tsx @@ -17,7 +17,7 @@ import { isPipelineMonitoringSupportedInVersion } from '../../../lib/logstash/pi import { PipelineListing } from '../../../components/logstash/pipeline_listing/pipeline_listing'; import { LogstashTemplate } from './logstash_template'; import { useTable } from '../../hooks/use_table'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; export const LogStashPipelinesPage: React.FC = ({ clusters }) => { const globalState = useContext(GlobalStateContext); @@ -43,7 +43,7 @@ export const LogStashPipelinesPage: React.FC = ({ clusters }) => defaultMessage: 'Logstash pipelines', }); - const { generate: generateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { generate: generateBreadcrumbs } = useBreadcrumbContainerContext(); const getPageData = useCallback(async () => { const bounds = services.data?.query.timefilter.timefilter.getBounds(); diff --git a/x-pack/plugins/monitoring/public/application/pages/no_data/no_data_page.tsx b/x-pack/plugins/monitoring/public/application/pages/no_data/no_data_page.tsx index d0806c1d86c02..ef6707a61d359 100644 --- a/x-pack/plugins/monitoring/public/application/pages/no_data/no_data_page.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/no_data/no_data_page.tsx @@ -16,7 +16,7 @@ import { PageTemplate } from '../page_template'; import { CODE_PATH_LICENSE, STANDALONE_CLUSTER_CLUSTER_UUID } from '../../../../common/constants'; import { Legacy } from '../../../legacy_shims'; import { Enabler } from './enabler'; -import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs'; +import { useBreadcrumbContainerContext } from '../../hooks/use_breadcrumbs'; import { initSetupModeState } from '../../../lib/setup_mode'; import { GlobalStateContext } from '../../contexts/global_state_context'; import { useRequestErrorHandler } from '../../hooks/use_request_error_handler'; @@ -67,7 +67,7 @@ export const NoDataPage = () => { isCollectionIntervalUpdated: false, } as any); - const { update: updateBreadcrumbs } = useContext(BreadcrumbContainer.Context); + const { update: updateBreadcrumbs } = useBreadcrumbContainerContext(); updateBreadcrumbs([ { 'data-test-subj': 'breadcrumbClusters', diff --git a/x-pack/plugins/monitoring/public/application/pages/page_template.tsx b/x-pack/plugins/monitoring/public/application/pages/page_template.tsx index 8e07d196ce588..842c86cc4ab95 100644 --- a/x-pack/plugins/monitoring/public/application/pages/page_template.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/page_template.tsx @@ -20,7 +20,7 @@ import type { IHttpFetchError, ResponseErrorBody } from '@kbn/core-http-browser' import { HeaderMenuPortal } from '@kbn/observability-plugin/public'; import { useTitle } from '../hooks/use_title'; import { MonitoringToolbar } from '../../components/shared/toolbar'; -import { MonitoringTimeContainer } from '../hooks/use_monitoring_time'; +import { useMonitoringTimeContainerContext } from '../hooks/use_monitoring_time'; import { PageLoading } from '../../components'; import { getSetupModeState, @@ -58,7 +58,7 @@ export const PageTemplate: React.FC = ({ }) => { useTitle('', title); - const { currentTimerange } = useContext(MonitoringTimeContainer.Context); + const { currentTimerange } = useMonitoringTimeContainerContext(); const [loaded, setLoaded] = useState(false); const [isRequestPending, setIsRequestPending] = useState(false); const history = useHistory(); diff --git a/x-pack/plugins/monitoring/public/components/shared/toolbar.tsx b/x-pack/plugins/monitoring/public/components/shared/toolbar.tsx index 200ce9f849433..ae90a304a019f 100644 --- a/x-pack/plugins/monitoring/public/components/shared/toolbar.tsx +++ b/x-pack/plugins/monitoring/public/components/shared/toolbar.tsx @@ -9,7 +9,7 @@ import { EuiPageHeader, EuiSuperDatePicker, OnRefreshChangeProps } from '@elasti import React, { useContext, useCallback, useMemo } from 'react'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { UI_SETTINGS } from '@kbn/data-plugin/common'; -import { MonitoringTimeContainer } from '../../application/hooks/use_monitoring_time'; +import { useMonitoringTimeContainerContext } from '../../application/hooks/use_monitoring_time'; import { GlobalStateContext } from '../../application/contexts/global_state_context'; import { Legacy } from '../../legacy_shims'; import { MonitoringStartServices } from '../../types'; @@ -49,7 +49,7 @@ export const MonitoringToolbar: React.FC = ({ pageTitle, setIsPaused, isPaused, isDisabled, - } = useContext(MonitoringTimeContainer.Context); + } = useMonitoringTimeContainerContext(); const state = useContext(GlobalStateContext); const onTimeChange = useCallback( diff --git a/x-pack/plugins/monitoring/public/components/table/storage.ts b/x-pack/plugins/monitoring/public/components/table/storage.ts index 7d4d3129650ae..3c28be3fe6114 100644 --- a/x-pack/plugins/monitoring/public/components/table/storage.ts +++ b/x-pack/plugins/monitoring/public/components/table/storage.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { get } from 'lodash'; import { Storage } from '@kbn/kibana-utils-plugin/public'; import { STORAGE_KEY } from '../../../common/constants'; diff --git a/x-pack/plugins/monitoring/public/lib/calculate_shard_stats.js b/x-pack/plugins/monitoring/public/lib/calculate_shard_stats.js index f74fd30fde84b..cb01c182694b4 100644 --- a/x-pack/plugins/monitoring/public/lib/calculate_shard_stats.js +++ b/x-pack/plugins/monitoring/public/lib/calculate_shard_stats.js @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { get, each } from 'lodash'; function addOne(obj, key) { diff --git a/x-pack/plugins/monitoring/server/lib/cluster/get_clusters_from_request.ts b/x-pack/plugins/monitoring/server/lib/cluster/get_clusters_from_request.ts index d8bf8487cee09..dd69669405098 100644 --- a/x-pack/plugins/monitoring/server/lib/cluster/get_clusters_from_request.ts +++ b/x-pack/plugins/monitoring/server/lib/cluster/get_clusters_from_request.ts @@ -7,7 +7,7 @@ import { notFound } from '@hapi/boom'; import { get, omit } from 'lodash'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { i18n } from '@kbn/i18n'; import { getClustersStats } from './get_clusters_stats'; import { flagSupportedClusters } from './flag_supported_clusters'; diff --git a/x-pack/plugins/monitoring/server/lib/cluster/get_clusters_state.test.js b/x-pack/plugins/monitoring/server/lib/cluster/get_clusters_state.test.js index 6b35012c9d55b..1b9e40e4d6300 100644 --- a/x-pack/plugins/monitoring/server/lib/cluster/get_clusters_state.test.js +++ b/x-pack/plugins/monitoring/server/lib/cluster/get_clusters_state.test.js @@ -7,7 +7,7 @@ import { handleResponse } from './get_clusters_state'; import moment from 'moment'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; const clusters = [ { diff --git a/x-pack/plugins/monitoring/server/lib/elasticsearch/get_ml_jobs.test.js b/x-pack/plugins/monitoring/server/lib/elasticsearch/get_ml_jobs.test.js index a04e53fdbbe9d..9ddcecb0cbbd0 100644 --- a/x-pack/plugins/monitoring/server/lib/elasticsearch/get_ml_jobs.test.js +++ b/x-pack/plugins/monitoring/server/lib/elasticsearch/get_ml_jobs.test.js @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { handleResponse } from './get_ml_jobs'; describe('Get ML Jobs', () => { diff --git a/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/calculate_node_type.test.js b/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/calculate_node_type.test.js index d249bc82b9387..915c305d294c7 100644 --- a/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/calculate_node_type.test.js +++ b/x-pack/plugins/monitoring/server/lib/elasticsearch/nodes/calculate_node_type.test.js @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { calculateNodeType } from './calculate_node_type'; const masterNodeId = 'def456'; diff --git a/x-pack/plugins/monitoring/server/telemetry_collection/create_query.test.ts b/x-pack/plugins/monitoring/server/telemetry_collection/create_query.test.ts index 236b9280c3b05..c24efe86e48ff 100644 --- a/x-pack/plugins/monitoring/server/telemetry_collection/create_query.test.ts +++ b/x-pack/plugins/monitoring/server/telemetry_collection/create_query.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { createTypeFilter, createQuery } from './create_query'; describe('Create Type Filter', () => { diff --git a/x-pack/plugins/monitoring/server/telemetry_collection/get_all_stats.ts b/x-pack/plugins/monitoring/server/telemetry_collection/get_all_stats.ts index f1c36f848ca98..f74c712fb055a 100644 --- a/x-pack/plugins/monitoring/server/telemetry_collection/get_all_stats.ts +++ b/x-pack/plugins/monitoring/server/telemetry_collection/get_all_stats.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { get, merge } from 'lodash'; import moment from 'moment'; diff --git a/x-pack/plugins/observability/common/index.ts b/x-pack/plugins/observability/common/index.ts index 794275c380c97..379404c3a48a1 100644 --- a/x-pack/plugins/observability/common/index.ts +++ b/x-pack/plugins/observability/common/index.ts @@ -15,7 +15,6 @@ export { enableInspectEsQueries, maxSuggestions, enableComparisonByDefault, - enableInfrastructureView, defaultApmServiceEnvironment, apmServiceInventoryOptimizedSorting, apmProgressiveLoading, diff --git a/x-pack/plugins/observability/common/ui_settings_keys.ts b/x-pack/plugins/observability/common/ui_settings_keys.ts index 60328a189b696..f3c77c76d4186 100644 --- a/x-pack/plugins/observability/common/ui_settings_keys.ts +++ b/x-pack/plugins/observability/common/ui_settings_keys.ts @@ -9,7 +9,6 @@ export const enableNewSyntheticsView = 'observability:enableNewSyntheticsView'; export const enableInspectEsQueries = 'observability:enableInspectEsQueries'; export const maxSuggestions = 'observability:maxSuggestions'; export const enableComparisonByDefault = 'observability:enableComparisonByDefault'; -export const enableInfrastructureView = 'observability:enableInfrastructureView'; export const defaultApmServiceEnvironment = 'observability:apmDefaultServiceEnvironment'; export const apmProgressiveLoading = 'observability:apmProgressiveLoading'; export const enableServiceGroups = 'observability:enableServiceGroups'; diff --git a/x-pack/plugins/observability/kibana.json b/x-pack/plugins/observability/kibana.json index 5464bffccd9cd..7754aedfe9ffc 100644 --- a/x-pack/plugins/observability/kibana.json +++ b/x-pack/plugins/observability/kibana.json @@ -31,7 +31,6 @@ "triggersActionsUi", "inspector", "unifiedSearch", - "sharedUX", "security" ], "ui": true, diff --git a/x-pack/plugins/observability/public/application/application.test.tsx b/x-pack/plugins/observability/public/application/application.test.tsx index 371be0ceb3a34..d630988446aa6 100644 --- a/x-pack/plugins/observability/public/application/application.test.tsx +++ b/x-pack/plugins/observability/public/application/application.test.tsx @@ -11,7 +11,7 @@ import React from 'react'; import { Observable } from 'rxjs'; import { AppMountParameters, CoreStart } from '@kbn/core/public'; import { themeServiceMock } from '@kbn/core/public/mocks'; -import { KibanaPageTemplate } from '@kbn/shared-ux-components'; +import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; import { ObservabilityPublicPluginsStart } from '../plugin'; import { createObservabilityRuleTypeRegistryMock } from '../rules/observability_rule_type_registry_mock'; import { renderApp } from '.'; diff --git a/x-pack/plugins/observability/public/components/app/section/apm/index.test.tsx b/x-pack/plugins/observability/public/components/app/section/apm/index.test.tsx index 6ba0556fa0172..00b4e464e1f45 100644 --- a/x-pack/plugins/observability/public/components/app/section/apm/index.test.tsx +++ b/x-pack/plugins/observability/public/components/app/section/apm/index.test.tsx @@ -17,7 +17,7 @@ import * as pluginContext from '../../../../hooks/use_plugin_context'; import { HasDataContextValue } from '../../../../context/has_data_context'; import { AppMountParameters } from '@kbn/core/public'; import { createObservabilityRuleTypeRegistryMock } from '../../../../rules/observability_rule_type_registry_mock'; -import { KibanaPageTemplate } from '@kbn/shared-ux-components'; +import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; jest.mock('react-router-dom', () => ({ useLocation: () => ({ diff --git a/x-pack/plugins/observability/public/components/shared/header_menu_portal.tsx b/x-pack/plugins/observability/public/components/shared/header_menu_portal.tsx index 02d16c13ce4e8..dcfe8b9ce85ba 100644 --- a/x-pack/plugins/observability/public/components/shared/header_menu_portal.tsx +++ b/x-pack/plugins/observability/public/components/shared/header_menu_portal.tsx @@ -6,7 +6,7 @@ */ import React, { useEffect, useMemo } from 'react'; -import { createPortalNode, InPortal, OutPortal } from 'react-reverse-portal'; +import { createHtmlPortalNode, InPortal, OutPortal } from 'react-reverse-portal'; import { toMountPoint } from '@kbn/kibana-react-plugin/public'; import { HeaderMenuPortalProps } from './types'; @@ -16,7 +16,7 @@ export default function HeaderMenuPortal({ setHeaderActionMenu, theme$, }: HeaderMenuPortalProps) { - const portalNode = useMemo(() => createPortalNode(), []); + const portalNode = useMemo(() => createHtmlPortalNode(), []); useEffect(() => { setHeaderActionMenu((element) => { 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 176e137242ebc..89574732b5a85 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 @@ -10,7 +10,8 @@ import { render } from '@testing-library/react'; import { shallow } from 'enzyme'; import React from 'react'; import { of } from 'rxjs'; -import { sharedUXPluginMock } from '@kbn/shared-ux-plugin/public/mocks'; +import { getKibanaPageTemplateKibanaDependenciesMock as getPageTemplateServices } from '@kbn/shared-ux-page-kibana-template-mocks'; + import { createNavigationRegistry } from '../../../services/navigation_registry'; import { createLazyObservabilityPageTemplate } from './lazy_page_template'; import { ObservabilityPageTemplate } from './page_template'; @@ -52,7 +53,7 @@ describe('Page template', () => { getUrlForApp: () => '/test-url', navigateToApp: async () => {}, navigationSections$: navigationRegistry.sections$, - getSharedUXContext: sharedUXPluginMock.createStartContract().getContextServices, + getPageTemplateServices, }); const component = shallow( @@ -76,11 +77,11 @@ describe('Page template', () => { getUrlForApp={() => '/test-url'} navigateToApp={async () => {}} navigationSections$={navigationRegistry.sections$} - getSharedUXContext={sharedUXPluginMock.createStartContract().getContextServices} pageHeader={{ pageTitle: 'Test title', rightSideItems: [Test side item], }} + getPageTemplateServices={getPageTemplateServices} >

Test structure
@@ -97,11 +98,11 @@ describe('Page template', () => { getUrlForApp={() => '/test-url'} navigateToApp={async () => {}} navigationSections$={navigationRegistry.sections$} - getSharedUXContext={sharedUXPluginMock.createStartContract().getContextServices} pageHeader={{ pageTitle: 'Test title', rightSideItems: [Test side item], }} + getPageTemplateServices={getPageTemplateServices} >
Test structure
diff --git a/x-pack/plugins/observability/public/components/shared/page_template/page_template.tsx b/x-pack/plugins/observability/public/components/shared/page_template/page_template.tsx index ee05d2c4b59cb..d852a8658c2e1 100644 --- a/x-pack/plugins/observability/public/components/shared/page_template/page_template.tsx +++ b/x-pack/plugins/observability/public/components/shared/page_template/page_template.tsx @@ -12,10 +12,15 @@ import { matchPath, useLocation } from 'react-router-dom'; import useObservable from 'react-use/lib/useObservable'; import type { Observable } from 'rxjs'; import type { ApplicationStart } from '@kbn/core/public'; -import { SharedUxServicesProvider } from '@kbn/shared-ux-services'; -import type { SharedUXPluginStart } from '@kbn/shared-ux-plugin/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { KibanaPageTemplate, KibanaPageTemplateProps } from '@kbn/shared-ux-components'; +import { + KibanaPageTemplate, + KibanaPageTemplateKibanaProvider, +} from '@kbn/shared-ux-page-kibana-template'; +import type { + KibanaPageTemplateProps, + KibanaPageTemplateKibanaDependencies, +} from '@kbn/shared-ux-page-kibana-template'; import type { NavigationSection } from '../../../services/navigation_registry'; import { ObservabilityTour } from '../tour'; import { NavNameWithBadge, hideBadge } from './nav_name_with_badge'; @@ -43,7 +48,7 @@ export interface ObservabilityPageTemplateDependencies { getUrlForApp: ApplicationStart['getUrlForApp']; navigateToApp: ApplicationStart['navigateToApp']; navigationSections$: Observable; - getSharedUXContext: SharedUXPluginStart['getContextServices']; + getPageTemplateServices: () => KibanaPageTemplateKibanaDependencies; } export type ObservabilityPageTemplateProps = ObservabilityPageTemplateDependencies & @@ -55,15 +60,14 @@ export function ObservabilityPageTemplate({ getUrlForApp, navigateToApp, navigationSections$, - getSharedUXContext, showSolutionNav = true, isPageDataLoaded = true, + getPageTemplateServices, ...pageTemplateProps }: ObservabilityPageTemplateProps): React.ReactElement | null { const sections = useObservable(navigationSections$, []); const currentAppId = useObservable(currentAppId$, undefined); const { pathname: currentPath } = useLocation(); - const sharedUXServices = getSharedUXContext(); const { services } = useKibana(); @@ -130,7 +134,7 @@ export function ObservabilityPageTemplate({ ); return ( - + - + ); } diff --git a/x-pack/plugins/observability/public/index.ts b/x-pack/plugins/observability/public/index.ts index 04cb8289dd247..b4e23ce0e83ad 100644 --- a/x-pack/plugins/observability/public/index.ts +++ b/x-pack/plugins/observability/public/index.ts @@ -27,7 +27,6 @@ export type { export { enableInspectEsQueries, enableComparisonByDefault, - enableInfrastructureView, enableServiceGroups, enableNewSyntheticsView, apmServiceGroupMaxNumberOfServices, diff --git a/x-pack/plugins/observability/public/pages/cases/cases.stories.tsx b/x-pack/plugins/observability/public/pages/cases/cases.stories.tsx index b384047a1c77b..bab4397a49a75 100644 --- a/x-pack/plugins/observability/public/pages/cases/cases.stories.tsx +++ b/x-pack/plugins/observability/public/pages/cases/cases.stories.tsx @@ -9,7 +9,7 @@ import React, { ComponentType } from 'react'; import { MemoryRouter } from 'react-router-dom'; import { AppMountParameters } from '@kbn/core/public'; import { CoreStart } from '@kbn/core/public'; -import { KibanaPageTemplate } from '@kbn/shared-ux-components'; +import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; import { createKibanaReactContext } from '@kbn/kibana-react-plugin/public'; import { casesFeatureId } from '../../../common'; import { PluginContext, PluginContextValue } from '../../context/plugin_context'; diff --git a/x-pack/plugins/observability/public/pages/overview/overview.stories.tsx b/x-pack/plugins/observability/public/pages/overview/overview.stories.tsx index aab1663482636..2e384e83fd03d 100644 --- a/x-pack/plugins/observability/public/pages/overview/overview.stories.tsx +++ b/x-pack/plugins/observability/public/pages/overview/overview.stories.tsx @@ -12,7 +12,7 @@ import React, { ReactNode } from 'react'; import { MemoryRouter } from 'react-router-dom'; import { UI_SETTINGS } from '@kbn/data-plugin/public'; import { createKibanaReactContext } from '@kbn/kibana-react-plugin/public'; -import { KibanaPageTemplate } from '@kbn/shared-ux-components'; +import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; import { HasDataContextProvider } from '../../context/has_data_context'; import { PluginContext } from '../../context/plugin_context'; import { registerDataHandler, unregisterDataHandler } from '../../data_handler'; diff --git a/x-pack/plugins/observability/public/pages/rules/index.test.tsx b/x-pack/plugins/observability/public/pages/rules/index.test.tsx index a9bf4aff99a83..cc8a093e32333 100644 --- a/x-pack/plugins/observability/public/pages/rules/index.test.tsx +++ b/x-pack/plugins/observability/public/pages/rules/index.test.tsx @@ -14,7 +14,7 @@ import { ObservabilityPublicPluginsStart } from '../../plugin'; import { RulesPage } from '.'; import { kibanaStartMock } from '../../utils/kibana_react.mock'; import * as pluginContext from '../../hooks/use_plugin_context'; -import { KibanaPageTemplate } from '@kbn/shared-ux-components'; +import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; import { createObservabilityRuleTypeRegistryMock } from '../../rules/observability_rule_type_registry_mock'; import { AppMountParameters } from '@kbn/core/public'; import { ALERTS_FEATURE_ID } from '@kbn/alerting-plugin/common'; diff --git a/x-pack/plugins/observability/public/plugin.ts b/x-pack/plugins/observability/public/plugin.ts index 617dce2959f1e..97b3746671c9d 100644 --- a/x-pack/plugins/observability/public/plugin.ts +++ b/x-pack/plugins/observability/public/plugin.ts @@ -26,7 +26,6 @@ import type { EmbeddableStart } from '@kbn/embeddable-plugin/public'; import type { HomePublicPluginSetup, HomePublicPluginStart } from '@kbn/home-plugin/public'; import { CasesDeepLinkId, CasesUiStart, getCasesDeepLinks } from '@kbn/cases-plugin/public'; import type { LensPublicStart } from '@kbn/lens-plugin/public'; -import type { SharedUXPluginStart } from '@kbn/shared-ux-plugin/public'; import { TriggersAndActionsUIPublicPluginSetup, TriggersAndActionsUIPublicPluginStart, @@ -72,7 +71,6 @@ export interface ObservabilityPublicPluginsStart { dataViews: DataViewsPublicPluginStart; lens: LensPublicStart; discover: DiscoverStart; - sharedUX: SharedUXPluginStart; ruleTypeRegistry: RuleTypeRegistryContract; actionTypeRegistry: ActionTypeRegistryContract; security: SecurityPluginStart; @@ -282,7 +280,7 @@ export class Plugin getUrlForApp: application.getUrlForApp, navigateToApp: application.navigateToApp, navigationSections$: this.navigationRegistry.sections$, - getSharedUXContext: pluginsStart.sharedUX.getContextServices, + getPageTemplateServices: () => ({ coreStart }), }); const getAsyncO11yAlertsTableConfiguration = async () => { diff --git a/x-pack/plugins/observability/public/utils/no_data_config.ts b/x-pack/plugins/observability/public/utils/no_data_config.ts index c71520e35bf18..be19e6658b5b6 100644 --- a/x-pack/plugins/observability/public/utils/no_data_config.ts +++ b/x-pack/plugins/observability/public/utils/no_data_config.ts @@ -7,7 +7,7 @@ import { i18n } from '@kbn/i18n'; import { IBasePath } from '@kbn/core/public'; -import { KibanaPageTemplateProps } from '@kbn/shared-ux-components'; +import type { NoDataConfig } from '@kbn/shared-ux-page-kibana-template'; export function getNoDataConfig({ docsLink, @@ -17,7 +17,7 @@ export function getNoDataConfig({ docsLink: string; basePath: IBasePath; hasData?: boolean; -}): KibanaPageTemplateProps['noDataConfig'] { +}): NoDataConfig | undefined { if (hasData === false) { return { solution: i18n.translate('xpack.observability.noDataConfig.solutionName', { diff --git a/x-pack/plugins/observability/public/utils/test_helper.tsx b/x-pack/plugins/observability/public/utils/test_helper.tsx index d262f290d1fe1..ef197f7dfc8d5 100644 --- a/x-pack/plugins/observability/public/utils/test_helper.tsx +++ b/x-pack/plugins/observability/public/utils/test_helper.tsx @@ -12,7 +12,7 @@ import { coreMock } from '@kbn/core/public/mocks'; import React from 'react'; import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; -import { KibanaPageTemplate } from '@kbn/shared-ux-components'; +import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; import translations from '@kbn/translations-plugin/translations/ja-JP.json'; import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common'; import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; diff --git a/x-pack/plugins/observability/server/ui_settings.ts b/x-pack/plugins/observability/server/ui_settings.ts index 36fb6cd9f62ff..f22da4b96e6b9 100644 --- a/x-pack/plugins/observability/server/ui_settings.ts +++ b/x-pack/plugins/observability/server/ui_settings.ts @@ -13,7 +13,6 @@ import { enableComparisonByDefault, enableInspectEsQueries, maxSuggestions, - enableInfrastructureView, defaultApmServiceEnvironment, apmProgressiveLoading, enableServiceGroups, @@ -84,17 +83,6 @@ export const uiSettings: Record { }); it('by changing ecs mappings and platforms', () => { + cy.getBySel('pagination-button-next').click(); cy.react('CustomItemAction', { props: { index: 1, item: { attributes: { id: SAVED_QUERY_ID } } }, }).click(); diff --git a/x-pack/plugins/osquery/cypress/integration/all/metrics.spec.ts b/x-pack/plugins/osquery/cypress/integration/all/metrics.spec.ts index 88145dfa46401..0edefdc24ea42 100644 --- a/x-pack/plugins/osquery/cypress/integration/all/metrics.spec.ts +++ b/x-pack/plugins/osquery/cypress/integration/all/metrics.spec.ts @@ -46,7 +46,7 @@ describe('ALL - Inventory', () => { cy.getBySel('comboBoxInput').first().click(); cy.wait(500); - cy.getBySel('comboBoxInput').first().type('{downArrow}{enter}'); + cy.getBySel('comboBoxInput').first().type('saved{downArrow}{enter}'); submitQuery(); checkResults(); diff --git a/x-pack/plugins/osquery/cypress/integration/roles/reader.spec.ts b/x-pack/plugins/osquery/cypress/integration/roles/reader.spec.ts index ddbca76efcf16..365f4d5b0eba1 100644 --- a/x-pack/plugins/osquery/cypress/integration/roles/reader.spec.ts +++ b/x-pack/plugins/osquery/cypress/integration/roles/reader.spec.ts @@ -27,6 +27,7 @@ describe('Reader - only READ', () => { it('should not be able to add nor run saved queries', () => { navigateTo('/app/osquery/saved_queries'); cy.waitForReact(1000); + cy.getBySel('pagination-button-next').click(); cy.contains(SAVED_QUERY_ID); cy.contains('Add saved query').should('be.disabled'); cy.react('PlayButtonComponent', { diff --git a/x-pack/plugins/osquery/cypress/integration/roles/t1_analyst.spec.ts b/x-pack/plugins/osquery/cypress/integration/roles/t1_analyst.spec.ts index c151cce2c2e60..2920cf8521ac6 100644 --- a/x-pack/plugins/osquery/cypress/integration/roles/t1_analyst.spec.ts +++ b/x-pack/plugins/osquery/cypress/integration/roles/t1_analyst.spec.ts @@ -29,6 +29,7 @@ describe('T1 Analyst - READ + runSavedQueries ', () => { it('should be able to run saved queries but not add new ones', () => { navigateTo('/app/osquery/saved_queries'); cy.waitForReact(1000); + cy.getBySel('pagination-button-next').click(); cy.contains(SAVED_QUERY_ID); cy.contains('Add saved query').should('be.disabled'); cy.react('PlayButtonComponent', { diff --git a/x-pack/plugins/osquery/cypress/integration/roles/t2_analyst.spec.ts b/x-pack/plugins/osquery/cypress/integration/roles/t2_analyst.spec.ts index 901b18f1461c7..9b73a01ac41c1 100644 --- a/x-pack/plugins/osquery/cypress/integration/roles/t2_analyst.spec.ts +++ b/x-pack/plugins/osquery/cypress/integration/roles/t2_analyst.spec.ts @@ -100,7 +100,7 @@ describe('T2 Analyst - READ + Write Live/Saved + runSavedQueries ', () => { }); it('to click the edit button and edit pack', () => { navigateTo('/app/osquery/saved_queries'); - + cy.getBySel('pagination-button-next').click(); cy.react('CustomItemAction', { props: { index: 1, item: { attributes: { id: SAVED_QUERY_ID } } }, }).click(); diff --git a/x-pack/plugins/osquery/cypress/tasks/live_query.ts b/x-pack/plugins/osquery/cypress/tasks/live_query.ts index 3a1f1b0930edf..140b5698f55b5 100644 --- a/x-pack/plugins/osquery/cypress/tasks/live_query.ts +++ b/x-pack/plugins/osquery/cypress/tasks/live_query.ts @@ -8,7 +8,7 @@ import { LIVE_QUERY_EDITOR } from '../screens/live_query'; export const DEFAULT_QUERY = 'select * from processes;'; -export const BIG_QUERY = 'select * from processes, users limit 200;'; +export const BIG_QUERY = 'select * from processes, users limit 110;'; export const selectAllAgents = () => { cy.react('AgentsTable').find('input').should('not.be.disabled'); diff --git a/x-pack/plugins/osquery/public/action_results/action_results_summary.tsx b/x-pack/plugins/osquery/public/action_results/action_results_summary.tsx index 29d823560d6e3..81feb53fb4012 100644 --- a/x-pack/plugins/osquery/public/action_results/action_results_summary.tsx +++ b/x-pack/plugins/osquery/public/action_results/action_results_summary.tsx @@ -53,9 +53,8 @@ const ActionResultsSummaryComponent: React.FC = ({ skip: !hasActionResultsPrivileges, }); if (expired) { - // @ts-expect-error update types edges.forEach((edge) => { - if (!edge.fields.completed_at) { + if (!edge.fields?.completed_at && edge.fields) { edge.fields['error.keyword'] = edge.fields.error = [ i18n.translate('xpack.osquery.liveQueryActionResults.table.expiredErrorText', { defaultMessage: 'The action request timed out.', diff --git a/x-pack/plugins/osquery/public/action_results/use_action_privileges.tsx b/x-pack/plugins/osquery/public/action_results/use_action_privileges.tsx index 6d0477b22edee..83508def6a483 100644 --- a/x-pack/plugins/osquery/public/action_results/use_action_privileges.tsx +++ b/x-pack/plugins/osquery/public/action_results/use_action_privileges.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { useKibana } from '../common/lib/kibana'; export const useActionResultsPrivileges = () => { diff --git a/x-pack/plugins/osquery/public/action_results/use_action_results.ts b/x-pack/plugins/osquery/public/action_results/use_action_results.ts index 964feb9eafb3b..f950b4f1907c3 100644 --- a/x-pack/plugins/osquery/public/action_results/use_action_results.ts +++ b/x-pack/plugins/osquery/public/action_results/use_action_results.ts @@ -7,7 +7,7 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { flatten, reverse, uniqBy } from 'lodash/fp'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { lastValueFrom } from 'rxjs'; import type { InspectResponse } from '../common/helpers'; diff --git a/x-pack/plugins/osquery/public/actions/use_all_live_queries.ts b/x-pack/plugins/osquery/public/actions/use_all_live_queries.ts index f0fb0cd35ead6..a4bb5e5037a48 100644 --- a/x-pack/plugins/osquery/public/actions/use_all_live_queries.ts +++ b/x-pack/plugins/osquery/public/actions/use_all_live_queries.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { createFilter } from '../common/helpers'; diff --git a/x-pack/plugins/osquery/public/actions/use_live_query_details.ts b/x-pack/plugins/osquery/public/actions/use_live_query_details.ts index a31c493487057..b8703a8370d02 100644 --- a/x-pack/plugins/osquery/public/actions/use_live_query_details.ts +++ b/x-pack/plugins/osquery/public/actions/use_live_query_details.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { useKibana } from '../common/lib/kibana'; diff --git a/x-pack/plugins/osquery/public/agent_policies/use_agent_policies.ts b/x-pack/plugins/osquery/public/agent_policies/use_agent_policies.ts index 5eb70c802140c..37f1789a964de 100644 --- a/x-pack/plugins/osquery/public/agent_policies/use_agent_policies.ts +++ b/x-pack/plugins/osquery/public/agent_policies/use_agent_policies.ts @@ -6,7 +6,7 @@ */ import { mapKeys } from 'lodash'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import type { GetAgentPoliciesResponseItem } from '@kbn/fleet-plugin/common'; diff --git a/x-pack/plugins/osquery/public/agent_policies/use_agent_policy.ts b/x-pack/plugins/osquery/public/agent_policies/use_agent_policy.ts index f629a138f70f6..7a819e1118ad2 100644 --- a/x-pack/plugins/osquery/public/agent_policies/use_agent_policy.ts +++ b/x-pack/plugins/osquery/public/agent_policies/use_agent_policy.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import type { AgentPolicy } from '@kbn/fleet-plugin/common'; diff --git a/x-pack/plugins/osquery/public/agents/use_agent_details.ts b/x-pack/plugins/osquery/public/agents/use_agent_details.ts index 59ac973eb1dc1..d75987f38e93b 100644 --- a/x-pack/plugins/osquery/public/agents/use_agent_details.ts +++ b/x-pack/plugins/osquery/public/agents/use_agent_details.ts @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import type { GetOneAgentResponse } from '@kbn/fleet-plugin/common'; import { useErrorToast } from '../common/hooks/use_error_toast'; diff --git a/x-pack/plugins/osquery/public/agents/use_agent_groups.ts b/x-pack/plugins/osquery/public/agents/use_agent_groups.ts index 497819a15031d..156b439dcc18d 100644 --- a/x-pack/plugins/osquery/public/agents/use_agent_groups.ts +++ b/x-pack/plugins/osquery/public/agents/use_agent_groups.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { lastValueFrom } from 'rxjs'; import { useKibana } from '../common/lib/kibana'; diff --git a/x-pack/plugins/osquery/public/agents/use_agent_policies.ts b/x-pack/plugins/osquery/public/agents/use_agent_policies.ts index 58032f8476f32..737a64226c2bc 100644 --- a/x-pack/plugins/osquery/public/agents/use_agent_policies.ts +++ b/x-pack/plugins/osquery/public/agents/use_agent_policies.ts @@ -6,8 +6,8 @@ */ import { mapKeys } from 'lodash'; -import type { UseQueryResult } from 'react-query'; -import { useQueries } from 'react-query'; +import type { UseQueryResult } from '@tanstack/react-query'; +import { useQueries } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import type { GetOneAgentPolicyResponse } from '@kbn/fleet-plugin/common'; import { useKibana } from '../common/lib/kibana'; @@ -17,20 +17,21 @@ export const useAgentPolicies = (policyIds: string[] = []) => { const { http } = useKibana().services; const setErrorToast = useErrorToast(); - const agentResponse = useQueries( - policyIds.map((policyId) => ({ + const agentResponse = useQueries({ + queries: policyIds.map((policyId) => ({ queryKey: ['agentPolicy', policyId], queryFn: () => http.get(`/internal/osquery/fleet_wrapper/agent_policies/${policyId}`), enabled: policyIds.length > 0, onSuccess: () => setErrorToast(), + onError: (error: Error) => setErrorToast(error, { title: i18n.translate('xpack.osquery.action_policy_details.fetchError', { defaultMessage: 'Error while fetching policy details', }), }), - })) - ) as Array>; + })), + }) as Array>; const agentPoliciesLoading = agentResponse.some((p) => p.isLoading); const agentPolicies = agentResponse.map((p) => p.data?.item); diff --git a/x-pack/plugins/osquery/public/agents/use_agent_policy_agent_ids.ts b/x-pack/plugins/osquery/public/agents/use_agent_policy_agent_ids.ts index 4007f14ccc3e0..cd30baf32d52d 100644 --- a/x-pack/plugins/osquery/public/agents/use_agent_policy_agent_ids.ts +++ b/x-pack/plugins/osquery/public/agents/use_agent_policy_agent_ids.ts @@ -7,7 +7,7 @@ import { map } from 'lodash'; import { i18n } from '@kbn/i18n'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import type { Agent } from '@kbn/fleet-plugin/common'; import { AGENTS_PREFIX } from '@kbn/fleet-plugin/common'; diff --git a/x-pack/plugins/osquery/public/agents/use_agent_status.ts b/x-pack/plugins/osquery/public/agents/use_agent_status.ts index dd733c27675cd..bc0d4e6323f62 100644 --- a/x-pack/plugins/osquery/public/agents/use_agent_status.ts +++ b/x-pack/plugins/osquery/public/agents/use_agent_status.ts @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import type { GetAgentStatusResponse } from '@kbn/fleet-plugin/common'; import { useErrorToast } from '../common/hooks/use_error_toast'; diff --git a/x-pack/plugins/osquery/public/agents/use_all_agents.ts b/x-pack/plugins/osquery/public/agents/use_all_agents.ts index c5e7c2d703bcf..4f2aa8826f85f 100644 --- a/x-pack/plugins/osquery/public/agents/use_all_agents.ts +++ b/x-pack/plugins/osquery/public/agents/use_all_agents.ts @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import type { ListResult, Agent } from '@kbn/fleet-plugin/common'; import { useErrorToast } from '../common/hooks/use_error_toast'; diff --git a/x-pack/plugins/osquery/public/agents/use_osquery_policies.ts b/x-pack/plugins/osquery/public/agents/use_osquery_policies.ts index 9ecf5d14c6b38..589deab5334b1 100644 --- a/x-pack/plugins/osquery/public/agents/use_osquery_policies.ts +++ b/x-pack/plugins/osquery/public/agents/use_osquery_policies.ts @@ -6,7 +6,7 @@ */ import { uniq } from 'lodash'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { useKibana } from '../common/lib/kibana'; import { useErrorToast } from '../common/hooks/use_error_toast'; diff --git a/x-pack/plugins/osquery/public/application.tsx b/x-pack/plugins/osquery/public/application.tsx index c57a9cb46795f..b8f8f504a5b5a 100644 --- a/x-pack/plugins/osquery/public/application.tsx +++ b/x-pack/plugins/osquery/public/application.tsx @@ -12,8 +12,8 @@ import ReactDOM from 'react-dom'; import { Router } from 'react-router-dom'; import { I18nProvider } from '@kbn/i18n-react'; import { ThemeProvider } from 'styled-components'; -import { QueryClientProvider } from 'react-query'; -import { ReactQueryDevtools } from 'react-query/devtools'; +import { QueryClientProvider } from '@tanstack/react-query'; +import { ReactQueryDevtools } from '@tanstack/react-query-devtools'; import type { Storage } from '@kbn/kibana-utils-plugin/public'; import type { AppMountParameters, CoreStart } from '@kbn/core/public'; diff --git a/x-pack/plugins/osquery/public/assets/use_assets_status.ts b/x-pack/plugins/osquery/public/assets/use_assets_status.ts index 28e752df6b2f4..0d082f29b0175 100644 --- a/x-pack/plugins/osquery/public/assets/use_assets_status.ts +++ b/x-pack/plugins/osquery/public/assets/use_assets_status.ts @@ -6,7 +6,7 @@ */ import type { SavedObject } from '@kbn/core/public'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { useKibana } from '../common/lib/kibana'; import { INTEGRATION_ASSETS_STATUS_ID } from './constants'; diff --git a/x-pack/plugins/osquery/public/assets/use_import_assets.ts b/x-pack/plugins/osquery/public/assets/use_import_assets.ts index feb2c48041567..4ae6d8549d6fa 100644 --- a/x-pack/plugins/osquery/public/assets/use_import_assets.ts +++ b/x-pack/plugins/osquery/public/assets/use_import_assets.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useMutation, useQueryClient } from 'react-query'; +import { useMutation, useQueryClient } from '@tanstack/react-query'; import { useKibana } from '../common/lib/kibana'; import { useErrorToast } from '../common/hooks/use_error_toast'; import { PACKS_ID } from '../packs/constants'; @@ -26,8 +26,8 @@ export const useImportAssets = ({ successToastText }: UseImportAssetsProps) => { return useMutation(() => http.post('/internal/osquery/assets/update'), { onSuccess: () => { setErrorToast(); - queryClient.invalidateQueries(PACKS_ID); - queryClient.invalidateQueries(INTEGRATION_ASSETS_STATUS_ID); + queryClient.invalidateQueries([PACKS_ID]); + queryClient.invalidateQueries([INTEGRATION_ASSETS_STATUS_ID]); toasts.addSuccess(successToastText); }, onError: (error) => { diff --git a/x-pack/plugins/osquery/public/common/hooks/use_logs_data_view.tsx b/x-pack/plugins/osquery/public/common/hooks/use_logs_data_view.tsx index 1ac76a54b6729..cf5a9e42d8911 100644 --- a/x-pack/plugins/osquery/public/common/hooks/use_logs_data_view.tsx +++ b/x-pack/plugins/osquery/public/common/hooks/use_logs_data_view.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import type { DataView } from '@kbn/data-plugin/common'; import { useKibana } from '../lib/kibana'; diff --git a/x-pack/plugins/osquery/public/common/hooks/use_osquery_integration.tsx b/x-pack/plugins/osquery/public/common/hooks/use_osquery_integration.tsx index 92f32d6535b4c..4602b8df24d78 100644 --- a/x-pack/plugins/osquery/public/common/hooks/use_osquery_integration.tsx +++ b/x-pack/plugins/osquery/public/common/hooks/use_osquery_integration.tsx @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { useKibana } from '../lib/kibana'; import { useErrorToast } from './use_error_toast'; @@ -16,7 +16,7 @@ export const useOsqueryIntegrationStatus = () => { const setErrorToast = useErrorToast(); return useQuery( - 'integration', + ['integration'], () => http.get<{ name: string; version: string; title: string; install_status: string }>( '/internal/osquery/status' diff --git a/x-pack/plugins/osquery/public/live_queries/use_create_live_query_action.tsx b/x-pack/plugins/osquery/public/live_queries/use_create_live_query_action.tsx index 72ac627b02a63..dfb08ddeda87d 100644 --- a/x-pack/plugins/osquery/public/live_queries/use_create_live_query_action.tsx +++ b/x-pack/plugins/osquery/public/live_queries/use_create_live_query_action.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { useMutation } from 'react-query'; +import { useMutation } from '@tanstack/react-query'; import type { AgentSelection } from '../../common/schemas/common'; import type { CreateLiveQueryRequestBodySchema } from '../../common/schemas/routes/live_query'; import { useKibana } from '../common/lib/kibana'; diff --git a/x-pack/plugins/osquery/public/packs/active_state_switch.tsx b/x-pack/plugins/osquery/public/packs/active_state_switch.tsx index 41f7c7a32522e..cb67f248207fc 100644 --- a/x-pack/plugins/osquery/public/packs/active_state_switch.tsx +++ b/x-pack/plugins/osquery/public/packs/active_state_switch.tsx @@ -7,7 +7,7 @@ import { EuiSwitch, EuiLoadingSpinner } from '@elastic/eui'; import React, { useCallback, useMemo, useState } from 'react'; -import { useQueryClient } from 'react-query'; +import { useQueryClient } from '@tanstack/react-query'; import styled from 'styled-components'; import { i18n } from '@kbn/i18n'; @@ -55,7 +55,7 @@ const ActiveStateSwitchComponent: React.FC = ({ item }) const { isLoading, mutateAsync } = useUpdatePack({ options: { onSuccess: (response) => { - queryClient.invalidateQueries(PACKS_ID); + queryClient.invalidateQueries([PACKS_ID]); setErrorToast(); toasts.addSuccess( response?.data?.attributes.enabled diff --git a/x-pack/plugins/osquery/public/packs/use_create_pack.ts b/x-pack/plugins/osquery/public/packs/use_create_pack.ts index b536f50075a86..26cf1fad2eeb9 100644 --- a/x-pack/plugins/osquery/public/packs/use_create_pack.ts +++ b/x-pack/plugins/osquery/public/packs/use_create_pack.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useMutation, useQueryClient } from 'react-query'; +import { useMutation, useQueryClient } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { useKibana } from '../common/lib/kibana'; @@ -42,7 +42,7 @@ export const useCreatePack = ({ withRedirect }: UseCreatePackProps) => { setErrorToast(error, { title: error.body.error, toastMessage: error.body.message }); }, onSuccess: (payload) => { - queryClient.invalidateQueries(PACKS_ID); + queryClient.invalidateQueries([PACKS_ID]); if (withRedirect) { navigateToApp(PLUGIN_ID, { path: pagePathGetters.packs() }); } diff --git a/x-pack/plugins/osquery/public/packs/use_delete_pack.ts b/x-pack/plugins/osquery/public/packs/use_delete_pack.ts index 439a850c785b0..8b5e7f0fb1450 100644 --- a/x-pack/plugins/osquery/public/packs/use_delete_pack.ts +++ b/x-pack/plugins/osquery/public/packs/use_delete_pack.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useMutation, useQueryClient } from 'react-query'; +import { useMutation, useQueryClient } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { useKibana } from '../common/lib/kibana'; @@ -36,7 +36,7 @@ export const useDeletePack = ({ packId, withRedirect }: UseDeletePackProps) => { }); }, onSuccess: () => { - queryClient.invalidateQueries(PACKS_ID); + queryClient.invalidateQueries([PACKS_ID]); if (withRedirect) { navigateToApp(PLUGIN_ID, { path: pagePathGetters.packs() }); } diff --git a/x-pack/plugins/osquery/public/packs/use_pack.ts b/x-pack/plugins/osquery/public/packs/use_pack.ts index da6062fb8309f..bedaceff9c63c 100644 --- a/x-pack/plugins/osquery/public/packs/use_pack.ts +++ b/x-pack/plugins/osquery/public/packs/use_pack.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { useKibana } from '../common/lib/kibana'; import type { PackItem } from './types'; diff --git a/x-pack/plugins/osquery/public/packs/use_pack_query_errors.ts b/x-pack/plugins/osquery/public/packs/use_pack_query_errors.ts index 1e57af58c46b4..95b2ddc7c9268 100644 --- a/x-pack/plugins/osquery/public/packs/use_pack_query_errors.ts +++ b/x-pack/plugins/osquery/public/packs/use_pack_query_errors.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { lastValueFrom } from 'rxjs'; import type { DataView } from '@kbn/data-plugin/common'; import { SortDirection } from '@kbn/data-plugin/common'; diff --git a/x-pack/plugins/osquery/public/packs/use_pack_query_last_results.ts b/x-pack/plugins/osquery/public/packs/use_pack_query_last_results.ts index 28b474530f4bc..15fbcce34a862 100644 --- a/x-pack/plugins/osquery/public/packs/use_pack_query_last_results.ts +++ b/x-pack/plugins/osquery/public/packs/use_pack_query_last_results.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import moment from 'moment-timezone'; import { lastValueFrom } from 'rxjs'; import { SortDirection } from '@kbn/data-plugin/common'; diff --git a/x-pack/plugins/osquery/public/packs/use_packs.ts b/x-pack/plugins/osquery/public/packs/use_packs.ts index b8fadaf571a84..05dd200b8f1c8 100644 --- a/x-pack/plugins/osquery/public/packs/use_packs.ts +++ b/x-pack/plugins/osquery/public/packs/use_packs.ts @@ -6,7 +6,7 @@ */ import type { SavedObjectsFindResponse } from '@kbn/core/public'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { useKibana } from '../common/lib/kibana'; import { PACKS_ID } from './constants'; diff --git a/x-pack/plugins/osquery/public/packs/use_update_pack.ts b/x-pack/plugins/osquery/public/packs/use_update_pack.ts index 1075078dd0e98..840d01e9b32fd 100644 --- a/x-pack/plugins/osquery/public/packs/use_update_pack.ts +++ b/x-pack/plugins/osquery/public/packs/use_update_pack.ts @@ -5,8 +5,8 @@ * 2.0. */ -import type { UseMutationOptions } from 'react-query'; -import { useMutation, useQueryClient } from 'react-query'; +import type { UseMutationOptions } from '@tanstack/react-query'; +import { useMutation, useQueryClient } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { useKibana } from '../common/lib/kibana'; @@ -48,7 +48,7 @@ export const useUpdatePack = ({ withRedirect, options }: UseUpdatePackProps) => setErrorToast(error, { title: error?.body?.error, toastMessage: error?.body?.message }); }, onSuccess: (response) => { - queryClient.invalidateQueries(PACKS_ID); + queryClient.invalidateQueries([PACKS_ID]); if (withRedirect) { navigateToApp(PLUGIN_ID, { path: pagePathGetters.packs() }); } diff --git a/x-pack/plugins/osquery/public/query_client.ts b/x-pack/plugins/osquery/public/query_client.ts index a0ee6c71be288..41467404c7bff 100644 --- a/x-pack/plugins/osquery/public/query_client.ts +++ b/x-pack/plugins/osquery/public/query_client.ts @@ -5,14 +5,12 @@ * 2.0. */ -/* eslint-disable @typescript-eslint/no-empty-function */ +import { QueryClient } from '@tanstack/react-query'; -import { QueryClient, setLogger } from 'react-query'; - -setLogger({ - log: () => {}, - warn: () => {}, - error: () => {}, +export const queryClient = new QueryClient({ + logger: { + log: () => null, + warn: () => null, + error: () => null, + }, }); - -export const queryClient = new QueryClient(); diff --git a/x-pack/plugins/osquery/public/results/use_all_results.ts b/x-pack/plugins/osquery/public/results/use_all_results.ts index 94a80fb09734a..ee545a2eaf9e9 100644 --- a/x-pack/plugins/osquery/public/results/use_all_results.ts +++ b/x-pack/plugins/osquery/public/results/use_all_results.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { lastValueFrom } from 'rxjs'; diff --git a/x-pack/plugins/osquery/public/saved_queries/use_create_saved_query.ts b/x-pack/plugins/osquery/public/saved_queries/use_create_saved_query.ts index 7081fda6e4484..0d96e4a118736 100644 --- a/x-pack/plugins/osquery/public/saved_queries/use_create_saved_query.ts +++ b/x-pack/plugins/osquery/public/saved_queries/use_create_saved_query.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useMutation, useQueryClient } from 'react-query'; +import { useMutation, useQueryClient } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { useKibana } from '../common/lib/kibana'; @@ -41,7 +41,7 @@ export const useCreateSavedQuery = ({ withRedirect }: UseCreateSavedQueryProps) }); }, onSuccess: (response) => { - queryClient.invalidateQueries(SAVED_QUERIES_ID); + queryClient.invalidateQueries([SAVED_QUERIES_ID]); if (withRedirect) { navigateToApp(PLUGIN_ID, { path: pagePathGetters.saved_queries() }); } diff --git a/x-pack/plugins/osquery/public/saved_queries/use_delete_saved_query.ts b/x-pack/plugins/osquery/public/saved_queries/use_delete_saved_query.ts index e882a9ba2f1ea..f03ac709db1ee 100644 --- a/x-pack/plugins/osquery/public/saved_queries/use_delete_saved_query.ts +++ b/x-pack/plugins/osquery/public/saved_queries/use_delete_saved_query.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useMutation, useQueryClient } from 'react-query'; +import { useMutation, useQueryClient } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { useKibana } from '../common/lib/kibana'; @@ -35,7 +35,7 @@ export const useDeleteSavedQuery = ({ savedQueryId }: UseDeleteSavedQueryProps) }); }, onSuccess: () => { - queryClient.invalidateQueries(SAVED_QUERIES_ID); + queryClient.invalidateQueries([SAVED_QUERIES_ID]); navigateToApp(PLUGIN_ID, { path: pagePathGetters.saved_queries() }); toasts.addSuccess( i18n.translate('xpack.osquery.editSavedQuery.deleteSuccessToastMessageText', { diff --git a/x-pack/plugins/osquery/public/saved_queries/use_saved_queries.ts b/x-pack/plugins/osquery/public/saved_queries/use_saved_queries.ts index 53d07c52e325b..bceeaed5be435 100644 --- a/x-pack/plugins/osquery/public/saved_queries/use_saved_queries.ts +++ b/x-pack/plugins/osquery/public/saved_queries/use_saved_queries.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import type { SavedObjectsFindResponse } from '@kbn/core/public'; import { useKibana } from '../common/lib/kibana'; diff --git a/x-pack/plugins/osquery/public/saved_queries/use_saved_query.ts b/x-pack/plugins/osquery/public/saved_queries/use_saved_query.ts index f146910f35c14..e5c39d76c94f2 100644 --- a/x-pack/plugins/osquery/public/saved_queries/use_saved_query.ts +++ b/x-pack/plugins/osquery/public/saved_queries/use_saved_query.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { PLUGIN_ID } from '../../common'; import { useKibana } from '../common/lib/kibana'; diff --git a/x-pack/plugins/osquery/public/saved_queries/use_update_saved_query.ts b/x-pack/plugins/osquery/public/saved_queries/use_update_saved_query.ts index 95eb446e147bd..2e47ef1ef7c29 100644 --- a/x-pack/plugins/osquery/public/saved_queries/use_update_saved_query.ts +++ b/x-pack/plugins/osquery/public/saved_queries/use_update_saved_query.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useMutation, useQueryClient } from 'react-query'; +import { useMutation, useQueryClient } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { useKibana } from '../common/lib/kibana'; @@ -41,7 +41,7 @@ export const useUpdateSavedQuery = ({ savedQueryId }: UseUpdateSavedQueryProps) }); }, onSuccess: (payload: SavedQuerySO) => { - queryClient.invalidateQueries(SAVED_QUERIES_ID); + queryClient.invalidateQueries([SAVED_QUERIES_ID]); queryClient.invalidateQueries([SAVED_QUERY_ID, { savedQueryId }]); navigateToApp(PLUGIN_ID, { path: pagePathGetters.saved_queries() }); toasts.addSuccess( diff --git a/x-pack/plugins/osquery/public/shared_components/osquery_action/index.tsx b/x-pack/plugins/osquery/public/shared_components/osquery_action/index.tsx index 3cffdbde50dd1..15c6fa645de11 100644 --- a/x-pack/plugins/osquery/public/shared_components/osquery_action/index.tsx +++ b/x-pack/plugins/osquery/public/shared_components/osquery_action/index.tsx @@ -7,7 +7,7 @@ import { EuiErrorBoundary, EuiLoadingContent, EuiEmptyPrompt, EuiCode } from '@elastic/eui'; import React, { useMemo } from 'react'; -import { QueryClientProvider } from 'react-query'; +import { QueryClientProvider } from '@tanstack/react-query'; import type { CoreStart } from '@kbn/core/public'; import { AGENT_STATUS_ERROR, diff --git a/x-pack/plugins/osquery/public/shared_components/osquery_action/osquery_action.test.tsx b/x-pack/plugins/osquery/public/shared_components/osquery_action/osquery_action.test.tsx index 4c9214ca3ea14..927d408884d20 100644 --- a/x-pack/plugins/osquery/public/shared_components/osquery_action/osquery_action.test.tsx +++ b/x-pack/plugins/osquery/public/shared_components/osquery_action/osquery_action.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; import { render } from '@testing-library/react'; -import { QueryClientProvider } from 'react-query'; +import { QueryClientProvider } from '@tanstack/react-query'; import { OsqueryAction } from '.'; import { queryClient } from '../../query_client'; diff --git a/x-pack/plugins/rule_registry/common/mapping_from_field_map.ts b/x-pack/plugins/rule_registry/common/mapping_from_field_map.ts index 4833631f09adb..1b66496bee19b 100644 --- a/x-pack/plugins/rule_registry/common/mapping_from_field_map.ts +++ b/x-pack/plugins/rule_registry/common/mapping_from_field_map.ts @@ -6,7 +6,7 @@ */ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { FieldMap } from './field_map/types'; export function mappingFromFieldMap( diff --git a/x-pack/plugins/security/public/authentication/access_agreement/__snapshots__/access_agreement_page.test.tsx.snap b/x-pack/plugins/security/public/authentication/access_agreement/__snapshots__/access_agreement_page.test.tsx.snap index 04dd39c69e64d..2735c8d14d1a1 100644 --- a/x-pack/plugins/security/public/authentication/access_agreement/__snapshots__/access_agreement_page.test.tsx.snap +++ b/x-pack/plugins/security/public/authentication/access_agreement/__snapshots__/access_agreement_page.test.tsx.snap @@ -2,42 +2,18 @@ exports[`AccessAgreementPage renders as expected when state is available 1`] = ` - -

- - This is - - - - link - - -

-
+ link + +

`; diff --git a/x-pack/plugins/security/public/authentication/login/components/login_form/__snapshots__/login_form.test.tsx.snap b/x-pack/plugins/security/public/authentication/login/components/login_form/__snapshots__/login_form.test.tsx.snap index d6eb4c20b8003..9e150c2ff0312 100644 --- a/x-pack/plugins/security/public/authentication/login/components/login_form/__snapshots__/login_form.test.tsx.snap +++ b/x-pack/plugins/security/public/authentication/login/components/login_form/__snapshots__/login_form.test.tsx.snap @@ -2,103 +2,49 @@ exports[`LoginForm login selector properly switches to login form -> login help and back: Login Help 1`] = ` - -

- - - some help - - -

-
+ some help + +

`; exports[`LoginForm login selector properly switches to login help: Login Help 1`] = ` - -

- - - some help - - -

-
+ some help + +

`; exports[`LoginForm properly switches to login help: Login Help 1`] = ` - -

- - - some help - - -

-
+ some help + +

`; diff --git a/x-pack/plugins/security/public/management/api_keys/api_keys_management_app.test.tsx b/x-pack/plugins/security/public/management/api_keys/api_keys_management_app.test.tsx index 514e9aa5e306c..c4f3000277af7 100644 --- a/x-pack/plugins/security/public/management/api_keys/api_keys_management_app.test.tsx +++ b/x-pack/plugins/security/public/management/api_keys/api_keys_management_app.test.tsx @@ -89,7 +89,9 @@ describe('apiKeysManagementApp', () => {
`); - unmount!(); + act(() => { + unmount!(); + }); expect(docTitle.reset).toHaveBeenCalledTimes(1); expect(container).toMatchInlineSnapshot(`
`); diff --git a/x-pack/plugins/security/public/management/role_mappings/role_mappings_management_app.test.tsx b/x-pack/plugins/security/public/management/role_mappings/role_mappings_management_app.test.tsx index 04db6c58c27d1..c085bafb562c2 100644 --- a/x-pack/plugins/security/public/management/role_mappings/role_mappings_management_app.test.tsx +++ b/x-pack/plugins/security/public/management/role_mappings/role_mappings_management_app.test.tsx @@ -82,7 +82,9 @@ describe('roleMappingsManagementApp', () => {
`); - unmount(); + act(() => { + unmount(); + }); expect(docTitle.reset).toHaveBeenCalledTimes(1); @@ -105,7 +107,9 @@ describe('roleMappingsManagementApp', () => {
`); - unmount(); + act(() => { + unmount(); + }); expect(docTitle.reset).toHaveBeenCalledTimes(1); @@ -133,7 +137,9 @@ describe('roleMappingsManagementApp', () => {
`); - unmount(); + act(() => { + unmount(); + }); expect(docTitle.reset).toHaveBeenCalledTimes(1); diff --git a/x-pack/plugins/security/public/management/roles/roles_management_app.test.tsx b/x-pack/plugins/security/public/management/roles/roles_management_app.test.tsx index 327499c64bb76..a6e06351f38c9 100644 --- a/x-pack/plugins/security/public/management/roles/roles_management_app.test.tsx +++ b/x-pack/plugins/security/public/management/roles/roles_management_app.test.tsx @@ -88,7 +88,9 @@ describe('rolesManagementApp', () => {
`); - unmount(); + act(() => { + unmount(); + }); expect(docTitle.reset).toHaveBeenCalledTimes(1); @@ -108,7 +110,9 @@ describe('rolesManagementApp', () => {
`); - unmount(); + act(() => { + unmount(); + }); expect(docTitle.reset).toHaveBeenCalledTimes(1); @@ -133,7 +137,9 @@ describe('rolesManagementApp', () => {
`); - unmount(); + act(() => { + unmount(); + }); expect(docTitle.reset).toHaveBeenCalledTimes(1); @@ -158,7 +164,9 @@ describe('rolesManagementApp', () => { `); - unmount(); + act(() => { + unmount(); + }); expect(docTitle.reset).toHaveBeenCalledTimes(1); 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 231ef70fed5bf..5fbb81bd7e106 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 @@ -204,8 +204,7 @@ export const EditUserPage: FunctionComponent = ({ username }) diff --git a/x-pack/plugins/security/server/saved_objects/secure_saved_objects_client_wrapper.test.ts b/x-pack/plugins/security/server/saved_objects/secure_saved_objects_client_wrapper.test.ts index 96505d2b5f963..52702c014f0cb 100644 --- a/x-pack/plugins/security/server/saved_objects/secure_saved_objects_client_wrapper.test.ts +++ b/x-pack/plugins/security/server/saved_objects/secure_saved_objects_client_wrapper.test.ts @@ -23,11 +23,12 @@ import { Actions } from '../authorization'; import type { SavedObjectActions } from '../authorization/actions/saved_object'; import { SecureSavedObjectsClientWrapper } from './secure_saved_objects_client_wrapper'; -jest.mock('@kbn/core/server/saved_objects/service/lib/utils', () => { - const { SavedObjectsUtils } = jest.requireActual( - '@kbn/core/server/saved_objects/service/lib/utils' +jest.mock('@kbn/core-saved-objects-utils-server', () => { + const { SavedObjectsUtils, ...actual } = jest.requireActual( + '@kbn/core-saved-objects-utils-server' ); return { + ...actual, SavedObjectsUtils: { ...SavedObjectsUtils, createEmptyFindResponse: SavedObjectsUtils.createEmptyFindResponse, diff --git a/x-pack/plugins/security_solution/public/app/home/global_header/index.test.tsx b/x-pack/plugins/security_solution/public/app/home/global_header/index.test.tsx index ff082a27e575e..48f1109e33443 100644 --- a/x-pack/plugins/security_solution/public/app/home/global_header/index.test.tsx +++ b/x-pack/plugins/security_solution/public/app/home/global_header/index.test.tsx @@ -48,7 +48,7 @@ jest.mock('../../../common/containers/sourcerer/use_signal_helpers', () => ({ jest.mock('react-reverse-portal', () => ({ InPortal: ({ children }: { children: React.ReactNode }) => <>{children}, OutPortal: ({ children }: { children: React.ReactNode }) => <>{children}, - createPortalNode: () => ({ unmount: jest.fn() }), + createHtmlPortalNode: () => ({ unmount: jest.fn() }), })); describe('global header', () => { diff --git a/x-pack/plugins/security_solution/public/app/home/global_header/index.tsx b/x-pack/plugins/security_solution/public/app/home/global_header/index.tsx index e585cf18ca156..08b3888130836 100644 --- a/x-pack/plugins/security_solution/public/app/home/global_header/index.tsx +++ b/x-pack/plugins/security_solution/public/app/home/global_header/index.tsx @@ -12,7 +12,7 @@ import { } from '@elastic/eui'; import React, { useCallback, useEffect, useMemo } from 'react'; import { useLocation } from 'react-router-dom'; -import { createPortalNode, InPortal, OutPortal } from 'react-reverse-portal'; +import { createHtmlPortalNode, InPortal, OutPortal } from 'react-reverse-portal'; import { i18n } from '@kbn/i18n'; import type { AppMountParameters } from '@kbn/core/public'; @@ -39,7 +39,7 @@ const BUTTON_ADD_DATA = i18n.translate('xpack.securitySolution.globalHeader.butt */ export const GlobalHeader = React.memo( ({ setHeaderActionMenu }: { setHeaderActionMenu: AppMountParameters['setHeaderActionMenu'] }) => { - const portalNode = useMemo(() => createPortalNode(), []); + const portalNode = useMemo(() => createHtmlPortalNode(), []); const { theme, http: { diff --git a/x-pack/plugins/security_solution/public/app/home/template_wrapper/bottom_bar/index.tsx b/x-pack/plugins/security_solution/public/app/home/template_wrapper/bottom_bar/index.tsx index 407c0db35f49d..123ae4563f756 100644 --- a/x-pack/plugins/security_solution/public/app/home/template_wrapper/bottom_bar/index.tsx +++ b/x-pack/plugins/security_solution/public/app/home/template_wrapper/bottom_bar/index.tsx @@ -8,7 +8,7 @@ /* eslint-disable react/display-name */ import React from 'react'; -import type { KibanaPageTemplateProps } from '@kbn/shared-ux-components'; +import type { KibanaPageTemplateProps } from '@kbn/shared-ux-page-kibana-template'; import type { AppLeaveHandler } from '@kbn/core/public'; import { TimelineId } from '../../../../../common/types/timeline'; import { AutoSaveWarningMsg } from '../../../../timelines/components/timeline/auto_save_warning'; diff --git a/x-pack/plugins/security_solution/public/app/home/template_wrapper/index.tsx b/x-pack/plugins/security_solution/public/app/home/template_wrapper/index.tsx index 21db51173ca20..79c7a0899e9c6 100644 --- a/x-pack/plugins/security_solution/public/app/home/template_wrapper/index.tsx +++ b/x-pack/plugins/security_solution/public/app/home/template_wrapper/index.tsx @@ -10,7 +10,7 @@ import styled from 'styled-components'; import { EuiPanel, EuiThemeProvider, useEuiTheme } from '@elastic/eui'; import { IS_DRAGGING_CLASS_NAME } from '@kbn/securitysolution-t-grid'; import type { AppLeaveHandler } from '@kbn/core/public'; -import { KibanaPageTemplate } from '@kbn/shared-ux-components'; +import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; import { useSecuritySolutionNavigation } from '../../../common/components/navigation/use_security_solution_navigation'; import { TimelineId } from '../../../../common/types/timeline'; import { getTimelineShowStatusByIdSelector } from '../../../timelines/components/flyout/selectors'; diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/cti_details/threat_summary_view.test.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/cti_details/threat_summary_view.test.tsx index 94c2aa6bc9e8d..b87c96c34632a 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/cti_details/threat_summary_view.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/event_details/cti_details/threat_summary_view.test.tsx @@ -24,7 +24,7 @@ jest.mock('../../../lib/kibana', () => ({ }), })); -jest.mock('../table/action_cell'); +jest.mock('../table/action_cell', () => ({ ActionCell: () => <> })); jest.mock('../table/field_name_cell'); describe('ThreatSummaryView', () => { diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/event_details.test.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/event_details.test.tsx index cb4affec563d5..eb034eca172dc 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/event_details.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/event_details/event_details.test.tsx @@ -6,6 +6,7 @@ */ import { waitFor } from '@testing-library/dom'; +import { mount } from 'enzyme'; import type { ReactWrapper } from 'enzyme'; import React from 'react'; @@ -15,7 +16,6 @@ import { mockDetailItemData, mockDetailItemDataId, rawEventData, TestProviders } import { EventDetails, EventsViewType } from './event_details'; import { mockBrowserFields } from '../../containers/source/mock'; -import { useMountAppended } from '../../utils/use_mount_appended'; import { mockAlertDetailsData } from './__mocks__'; import type { TimelineEventsDetailsItem } from '../../../../common/search_strategy'; import { TimelineTabs } from '../../../../common/types/timeline'; @@ -44,7 +44,6 @@ jest.mock('../../../detections/containers/detection_engine/rules/use_rule_with_f jest.mock('../link_to'); describe('EventDetails', () => { - const mount = useMountAppended(); const defaultProps = { browserFields: mockBrowserFields, data: mockDetailItemData, diff --git a/x-pack/plugins/security_solution/public/common/components/events_viewer/selectors/mock_state.ts b/x-pack/plugins/security_solution/public/common/components/events_viewer/selectors/mock_state.ts index 4b51ae9f329a7..3d54f078e7087 100644 --- a/x-pack/plugins/security_solution/public/common/components/events_viewer/selectors/mock_state.ts +++ b/x-pack/plugins/security_solution/public/common/components/events_viewer/selectors/mock_state.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { pipe } from 'lodash/fp'; import { mockGlobalState } from '../../../mock'; diff --git a/x-pack/plugins/security_solution/public/common/components/filters_global/__snapshots__/filters_global.test.tsx.snap b/x-pack/plugins/security_solution/public/common/components/filters_global/__snapshots__/filters_global.test.tsx.snap index 4dd14f56997eb..f6734aa75add9 100644 --- a/x-pack/plugins/security_solution/public/common/components/filters_global/__snapshots__/filters_global.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/common/components/filters_global/__snapshots__/filters_global.test.tsx.snap @@ -2,7 +2,16 @@ exports[`rendering renders correctly 1`] = ` } + node={ + Object { + "element":
, + "elementType": "html", + "getInitialPortalProps": [Function], + "mount": [Function], + "setPortalProps": [Function], + "unmount": [Function], + } + } > [0]; diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_global_header_portal.tsx b/x-pack/plugins/security_solution/public/common/hooks/use_global_header_portal.tsx index 8e8d73ff12849..c240f102d5e67 100644 --- a/x-pack/plugins/security_solution/public/common/hooks/use_global_header_portal.tsx +++ b/x-pack/plugins/security_solution/public/common/hooks/use_global_header_portal.tsx @@ -6,12 +6,12 @@ */ import { useState } from 'react'; -import { createPortalNode } from 'react-reverse-portal'; +import { createHtmlPortalNode } from 'react-reverse-portal'; /** * A singleton portal for rendering content in the global header */ -const globalKQLHeaderPortalNodeSingleton = createPortalNode(); +const globalKQLHeaderPortalNodeSingleton = createHtmlPortalNode(); export const useGlobalHeaderPortal = () => { const [globalKQLHeaderPortalNode] = useState(globalKQLHeaderPortalNodeSingleton); diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_timeline_events_count.tsx b/x-pack/plugins/security_solution/public/common/hooks/use_timeline_events_count.tsx index e801db0190799..e6e744fdd4b2e 100644 --- a/x-pack/plugins/security_solution/public/common/hooks/use_timeline_events_count.tsx +++ b/x-pack/plugins/security_solution/public/common/hooks/use_timeline_events_count.tsx @@ -6,13 +6,13 @@ */ import React, { useState } from 'react'; -import { createPortalNode, OutPortal } from 'react-reverse-portal'; +import { createHtmlPortalNode, OutPortal } from 'react-reverse-portal'; /** * A singleton portal for rendering content in the global header */ -const timelineEventsCountPortalNodeSingleton = createPortalNode(); -const eqlEventsCountPortalNodeSingleton = createPortalNode(); +const timelineEventsCountPortalNodeSingleton = createHtmlPortalNode(); +const eqlEventsCountPortalNodeSingleton = createHtmlPortalNode(); export const useTimelineEventsCountPortal = () => { const [timelineEventsCountPortalNode] = useState(timelineEventsCountPortalNodeSingleton); diff --git a/x-pack/plugins/security_solution/public/common/lib/kibana/hooks.ts b/x-pack/plugins/security_solution/public/common/lib/kibana/hooks.ts index b7c22f4398f91..4a736fc622055 100644 --- a/x-pack/plugins/security_solution/public/common/lib/kibana/hooks.ts +++ b/x-pack/plugins/security_solution/public/common/lib/kibana/hooks.ts @@ -11,7 +11,7 @@ import { useCallback, useEffect, useState, useRef } from 'react'; import { i18n } from '@kbn/i18n'; import { camelCase, isArray, isObject } from 'lodash'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import type { AuthenticatedUser } from '@kbn/security-plugin/common/model'; import type { Capabilities, NavigateToAppOptions } from '@kbn/core/public'; import type { CasesPermissions } from '@kbn/cases-plugin/common/ui'; diff --git a/x-pack/plugins/security_solution/public/common/mock/endpoint/app_context_render.tsx b/x-pack/plugins/security_solution/public/common/mock/endpoint/app_context_render.tsx index b4987a6080342..4ed453a4ce0a3 100644 --- a/x-pack/plugins/security_solution/public/common/mock/endpoint/app_context_render.tsx +++ b/x-pack/plugins/security_solution/public/common/mock/endpoint/app_context_render.tsx @@ -13,7 +13,7 @@ import type { RenderOptions, RenderResult } from '@testing-library/react'; import { render as reactRender } from '@testing-library/react'; import type { Action, Reducer, Store } from 'redux'; import type { AppDeepLink } from '@kbn/core/public'; -import { QueryClient, QueryClientProvider, setLogger } from 'react-query'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { coreMock } from '@kbn/core/public/mocks'; import { PLUGIN_ID } from '@kbn/fleet-plugin/common'; import type { RenderHookOptions, RenderHookResult } from '@testing-library/react-hooks'; @@ -22,7 +22,7 @@ import type { ReactHooksRenderer, WrapperComponent, } from '@testing-library/react-hooks/src/types/react'; -import type { UseBaseQueryResult } from 'react-query/types/react/types'; +import type { UseBaseQueryResult } from '@tanstack/react-query'; import ReactDOM from 'react-dom'; import { ConsoleManager } from '../../../management/components/console'; import type { StartPlugins, StartServices } from '../../../types'; @@ -89,7 +89,6 @@ export type WaitForReactHookState = | 'isSuccess' | 'isLoading' | 'isError' - | 'isIdle' | 'isLoadingError' | 'isStale' | 'isFetched' @@ -117,15 +116,6 @@ export type ReactQueryHookRenderer< options?: RenderHookOptions ) => Promise; -// hide react-query output in console -setLogger({ - error: () => {}, - // eslint-disable-next-line no-console - log: console.log, - // eslint-disable-next-line no-console - warn: console.warn, -}); - /** * Mocked app root context renderer */ @@ -228,6 +218,14 @@ export const createAppRootMockRenderer = (): AppContextTestRender => { cacheTime: Infinity, }, }, + // hide react-query output in console + logger: { + error: () => {}, + // eslint-disable-next-line no-console + log: console.log, + // eslint-disable-next-line no-console + warn: console.warn, + }, }); const AppWrapper: React.FC<{ children: React.ReactElement }> = ({ children }) => ( 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 41d68949daccb..3907232cc1120 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 @@ -16,7 +16,7 @@ import type { Store } from 'redux'; import { BehaviorSubject } from 'rxjs'; import { ThemeProvider } from 'styled-components'; import type { Capabilities } from '@kbn/core/public'; -import { QueryClient, QueryClientProvider } from 'react-query'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { ConsoleManager } from '../../management/components/console'; import type { State } from '../store'; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_execution_events.test.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_execution_events.test.tsx index 9a62fd58a0fbc..5e07dadf02492 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_execution_events.test.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_execution_events.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { QueryClient, QueryClientProvider } from 'react-query'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { renderHook, cleanup } from '@testing-library/react-hooks'; import { diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_execution_events.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_execution_events.ts index 4a37f55dc1d6a..8c0a698eac43f 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_execution_events.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_execution_events.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { useAppToasts } from '../../../../common/hooks/use_app_toasts'; import type { GetRuleExecutionEventsResponse } from '../../../../../common/detection_engine/rule_monitoring'; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_results_table/use_execution_results.test.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_results_table/use_execution_results.test.tsx index 63565f7cfa1b5..ddb553998584f 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_results_table/use_execution_results.test.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_results_table/use_execution_results.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { QueryClient, QueryClientProvider } from 'react-query'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { renderHook, cleanup } from '@testing-library/react-hooks'; import { useExecutionResults } from './use_execution_results'; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_results_table/use_execution_results.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_results_table/use_execution_results.tsx index a07289969af12..001c0bc153961 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_results_table/use_execution_results.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_results_table/use_execution_results.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { useAppToasts } from '../../../../common/hooks/use_app_toasts'; import type { GetRuleExecutionResultsResponse } from '../../../../../common/detection_engine/rule_monitoring'; diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/add_item_form/index.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/add_item_form/index.tsx index 68ba032175e3a..48c306a36a2eb 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/add_item_form/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/add_item_form/index.tsx @@ -99,7 +99,6 @@ export const AddItem = ({ const updateItem = useCallback( (event: ChangeEvent, index: number) => { - event.persist(); const values = field.value as string[]; const value = event.target.value; field.setValue([...values.slice(0, index), value, ...values.slice(index + 1)]); diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/use_installed_integrations.test.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/use_installed_integrations.test.tsx index 9ce7134db5f2a..705c7f5f3fbd3 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/use_installed_integrations.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/use_installed_integrations.test.tsx @@ -9,7 +9,7 @@ jest.mock('../../../containers/detection_engine/rules/api'); jest.mock('../../../../common/lib/kibana'); import React from 'react'; -import { QueryClient, QueryClientProvider } from 'react-query'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { renderHook, cleanup } from '@testing-library/react-hooks'; import { useInstalledIntegrations } from './use_installed_integrations'; diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/use_installed_integrations.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/use_installed_integrations.tsx index bc9e837911233..734ef6e628214 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/use_installed_integrations.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/use_installed_integrations.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import type { InstalledIntegrationArray } from '../../../../../common/detection_engine/schemas/common'; import { fetchInstalledIntegrations } from '../../../containers/detection_engine/rules/api'; // import { useAppToasts } from '../../../../common/hooks/use_app_toasts'; diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_field/index.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_field/index.tsx index 1cccca810f7e0..c0698ba443d8b 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_field/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_field/index.tsx @@ -150,7 +150,7 @@ export const RuleActionsField: React.FC = ({ field, messageVariables }) = <> - + {fieldErrors} diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/index.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/index.tsx index 3f541344abe5a..0639fda39ca4d 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/index.tsx @@ -101,6 +101,13 @@ const PreviewButton = styled(EuiButton)` const defaultTimeRange: Unit = 'h'; +const refreshedTimeframe = (startDate: string, endDate: string) => { + return { + start: dateMath.parse(startDate) || moment().subtract(1, 'hour'), + end: dateMath.parse(endDate) || moment(), + }; +}; + const RulePreviewComponent: React.FC = ({ index, indexPattern, @@ -129,9 +136,20 @@ const RulePreviewComponent: React.FC = ({ } }, [spaces]); + // Raw timeframe as a string const [startDate, setStartDate] = useState('now-1h'); const [endDate, setEndDate] = useState('now'); + // Parsed timeframe as a Moment object + const [timeframeStart, setTimeframeStart] = useState(moment().subtract(1, 'hour')); + const [timeframeEnd, setTimeframeEnd] = useState(moment()); + + useEffect(() => { + const { start, end } = refreshedTimeframe(startDate, endDate); + setTimeframeStart(start); + setTimeframeEnd(end); + }, [startDate, endDate]); + const { form } = useForm({ defaultValue: advancedOptionsDefaultValue, options: { stripEmptyFields: false }, @@ -180,21 +198,22 @@ const RulePreviewComponent: React.FC = ({ const showAdvancedOptions = queryPreviewIdSelected === ADVANCED_QUERY_SELECT_ID; const advancedOptions = useMemo( () => - showAdvancedOptions && startDate && endDate && formInterval && formLookback + showAdvancedOptions && formInterval && formLookback ? { - timeframeStart: dateMath.parse(startDate) || moment().subtract(1, 'hour'), - timeframeEnd: dateMath.parse(endDate) || moment(), + timeframeStart, + timeframeEnd, interval: formInterval, lookback: formLookback, } : undefined, - [endDate, formInterval, formLookback, showAdvancedOptions, startDate] + [formInterval, formLookback, showAdvancedOptions, timeframeEnd, timeframeStart] ); const [timeFrame, setTimeFrame] = useState(defaultTimeRange); const { addNoiseWarning, createPreview, + clearPreview, isPreviewRequestInProgress, previewId, logs, @@ -228,10 +247,27 @@ const RulePreviewComponent: React.FC = ({ const { startTransaction } = useStartTransaction(); + const [isRefreshing, setIsRefreshing] = useState(false); + useEffect(() => { + if (!isRefreshing) { + return; + } + createPreview(); + setIsRefreshing(false); + }, [isRefreshing, createPreview]); + const handlePreviewClick = useCallback(() => { startTransaction({ name: SINGLE_RULE_ACTIONS.PREVIEW }); - createPreview(); - }, [createPreview, startTransaction]); + if (showAdvancedOptions) { + // Refresh timeframe on Preview button click to make sure that relative times recalculated based on current time + const { start, end } = refreshedTimeframe(startDate, endDate); + setTimeframeStart(start); + setTimeframeEnd(end); + } else { + clearPreview(); + } + setIsRefreshing(true); + }, [clearPreview, endDate, showAdvancedOptions, startDate, startTransaction]); const onTimeChange = useCallback( ({ start: newStart, end: newEnd, isInvalid }: OnTimeChangeProps) => { diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/use_preview_route.tsx b/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/use_preview_route.tsx index d0c543e3c3a31..7c5c3e673fd2a 100644 --- a/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/use_preview_route.tsx +++ b/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview/use_preview_route.tsx @@ -5,7 +5,8 @@ * 2.0. */ -import { useEffect, useState, useCallback } from 'react'; +import { useEffect, useMemo, useState, useCallback } from 'react'; +import moment from 'moment'; import type { Unit } from '@kbn/datemath'; import type { Type, ThreatMapping } from '@kbn/securitysolution-io-ts-alerting-types'; import type { FieldValueQueryBar } from '../query_bar'; @@ -60,8 +61,23 @@ export const usePreviewRoute = ({ }: PreviewRouteParams) => { const [isRequestTriggered, setIsRequestTriggered] = useState(false); + const [timeframeEnd, setTimeframeEnd] = useState(moment()); + useEffect(() => { + if (isRequestTriggered) { + setTimeframeEnd(moment()); + } + }, [isRequestTriggered, setTimeframeEnd]); + + const quickQueryOptions = useMemo( + () => ({ + timeframe: timeFrame, + timeframeEnd, + }), + [timeFrame, timeframeEnd] + ); + const { isLoading, showInvocationCountWarning, response, rule, setRule } = usePreviewRule({ - timeframe: timeFrame, + quickQueryOptions, advancedOptions, }); const [logs, setLogs] = useState(response.logs ?? []); 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 01e676189f79e..6a83df5a87d19 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 @@ -474,14 +474,13 @@ describe('take action dropdown', () => { await waitFor(() => { expect(apiMocks.responseProvider.metadataDetails).toHaveBeenCalled(); - }); - - wrapper.update(); + wrapper.update(); - expect(findLaunchResponderButton().first().prop('disabled')).toBe(true); - expect(findLaunchResponderButton().first().prop('toolTipContent')).toEqual( - HOST_ENDPOINT_UNENROLLED_TOOLTIP - ); + expect(findLaunchResponderButton().first().prop('disabled')).toBe(true); + expect(findLaunchResponderButton().first().prop('toolTipContent')).toEqual( + HOST_ENDPOINT_UNENROLLED_TOOLTIP + ); + }); }); }); }); diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_find_rules_query.ts b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_find_rules_query.ts index e78be9ca1c753..523a05012ca19 100644 --- a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_find_rules_query.ts +++ b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_find_rules_query.ts @@ -6,8 +6,8 @@ */ import { useCallback } from 'react'; -import type { UseQueryOptions } from 'react-query'; -import { useQuery, useQueryClient } from 'react-query'; +import type { UseQueryOptions } from '@tanstack/react-query'; +import { useQuery, useQueryClient } from '@tanstack/react-query'; import { useAppToasts } from '../../../../common/hooks/use_app_toasts'; import { fetchRules } from './api'; import * as i18n from './translations'; @@ -78,9 +78,8 @@ export const useInvalidateRules = () => { * Invalidate all queries that start with FIND_RULES_QUERY_KEY. This * includes the in-memory query cache and paged query cache. */ - queryClient.invalidateQueries(FIND_RULES_QUERY_KEY, { - refetchActive: true, - refetchInactive: false, + queryClient.invalidateQueries([FIND_RULES_QUERY_KEY], { + refetchType: 'active', }); }, [queryClient]); }; @@ -104,7 +103,7 @@ export const useUpdateRulesCache = () => { return useCallback( (newRules: Rule[]) => { queryClient.setQueriesData['data']>( - FIND_RULES_QUERY_KEY, + [FIND_RULES_QUERY_KEY], (currentData) => currentData ? { diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_install_pre_packaged_rules.ts b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_install_pre_packaged_rules.ts index ff3493037182c..3f56cac04fb02 100644 --- a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_install_pre_packaged_rules.ts +++ b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_install_pre_packaged_rules.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { useMutation } from 'react-query'; +import { useMutation } from '@tanstack/react-query'; import { useAppToasts } from '../../../../common/hooks/use_app_toasts'; import { createPrepackagedRules } from './api'; import * as i18n from './translations'; diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_pre_packaged_rules.test.tsx b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_pre_packaged_rules.test.tsx index f977e15626c16..5cddbeef63028 100644 --- a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_pre_packaged_rules.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_pre_packaged_rules.test.tsx @@ -4,7 +4,6 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - import { act, renderHook } from '@testing-library/react-hooks'; import { shallow } from 'enzyme'; import type { ReactElement } from 'react'; @@ -144,6 +143,7 @@ describe('usePrePackagedRules', () => { result.current.createPrePackagedRules(); await waitForNextUpdate(); expect(api.createPrepackagedRules).toHaveBeenCalled(); + await waitForNextUpdate(); expect(result.current).toEqual({ getLoadPrebuiltRulesAndTemplatesButton: result.current.getLoadPrebuiltRulesAndTemplatesButton, diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_pre_packaged_rules_status.ts b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_pre_packaged_rules_status.ts index 02350d84ec99e..c01bce4fe8bc2 100644 --- a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_pre_packaged_rules_status.ts +++ b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_pre_packaged_rules_status.ts @@ -5,7 +5,7 @@ * 2.0. */ import { useCallback } from 'react'; -import { useQuery, useQueryClient } from 'react-query'; +import { useQuery, useQueryClient } from '@tanstack/react-query'; import { useAppToasts } from '../../../../common/hooks/use_app_toasts'; import { getPrePackagedRulesStatus } from './api'; import * as i18n from './translations'; @@ -62,9 +62,8 @@ export const useInvalidatePrePackagedRulesStatus = () => { const queryClient = useQueryClient(); return useCallback(() => { - queryClient.invalidateQueries(PRE_PACKAGED_RULES_STATUS_QUERY_KEY, { - refetchActive: true, - refetchInactive: false, + queryClient.invalidateQueries([PRE_PACKAGED_RULES_STATUS_QUERY_KEY], { + refetchType: 'active', }); }, [queryClient]); }; diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_preview_rule.ts b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_preview_rule.ts index a8b12a9ebc121..ed7f4150f7349 100644 --- a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_preview_rule.ts +++ b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_preview_rule.ts @@ -8,7 +8,6 @@ import { useEffect, useMemo, useState } from 'react'; import moment from 'moment'; -import type { Unit } from '@kbn/datemath'; import { RULE_PREVIEW_FROM, RULE_PREVIEW_INTERVAL, @@ -23,7 +22,10 @@ import type { import { previewRule } from './api'; import * as i18n from './translations'; import { transformOutput } from './transforms'; -import type { AdvancedPreviewOptions } from '../../../pages/detection_engine/rules/types'; +import type { + AdvancedPreviewOptions, + QuickQueryPreviewOptions, +} from '../../../pages/detection_engine/rules/types'; import { getTimeTypeValue } from '../../../pages/detection_engine/rules/create/helpers'; const REASONABLE_INVOCATION_COUNT = 200; @@ -35,10 +37,10 @@ const emptyPreviewRule: PreviewResponse = { }; export const usePreviewRule = ({ - timeframe = 'h', + quickQueryOptions, advancedOptions, }: { - timeframe: Unit; + quickQueryOptions: QuickQueryPreviewOptions; advancedOptions?: AdvancedPreviewOptions; }) => { const [rule, setRule] = useState(null); @@ -49,7 +51,7 @@ export const usePreviewRule = ({ let interval: string = RULE_PREVIEW_INTERVAL.HOUR; let from: string = RULE_PREVIEW_FROM.HOUR; - switch (timeframe) { + switch (quickQueryOptions.timeframe) { case 'd': invocationCount = RULE_PREVIEW_INVOCATION_COUNT.DAY; interval = RULE_PREVIEW_INTERVAL.DAY; @@ -67,8 +69,11 @@ export const usePreviewRule = ({ break; } const timeframeEnd = useMemo( - () => (advancedOptions ? advancedOptions.timeframeEnd.toISOString() : moment().toISOString()), - [advancedOptions] + () => + advancedOptions + ? advancedOptions.timeframeEnd.toISOString() + : quickQueryOptions.timeframeEnd.toISOString(), + [advancedOptions, quickQueryOptions] ); if (advancedOptions) { diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/bulk_actions/use_bulk_actions_dry_run.ts b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/bulk_actions/use_bulk_actions_dry_run.ts index 4468b1c65ece0..28c4e4be608dc 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/bulk_actions/use_bulk_actions_dry_run.ts +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/all/bulk_actions/use_bulk_actions_dry_run.ts @@ -5,8 +5,8 @@ * 2.0. */ -import type { UseMutateAsyncFunction } from 'react-query'; -import { useMutation } from 'react-query'; +import type { UseMutateAsyncFunction } from '@tanstack/react-query'; +import { useMutation } from '@tanstack/react-query'; import type { BulkAction, diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/types.ts b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/types.ts index ce4060dcf6e87..93910509193e2 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/types.ts +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/types.ts @@ -19,6 +19,7 @@ import type { import type { Filter } from '@kbn/es-query'; import type { RuleAction } from '@kbn/alerting-plugin/common'; import type { DataViewListItem } from '@kbn/data-views-plugin/common'; +import type { Unit } from '@kbn/datemath'; import type { RuleAlertAction } from '../../../../../common/detection_engine/types'; import type { FieldValueQueryBar } from '../../../components/rules/query_bar'; @@ -242,6 +243,11 @@ export interface ActionsStepRuleJson { meta?: unknown; } +export interface QuickQueryPreviewOptions { + timeframe: Unit; + timeframeEnd: moment.Moment; +} + export interface AdvancedPreviewForm { interval: string; lookback: string; diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_flyout.test.tsx b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_flyout.test.tsx index 7a95a328606cb..ee3ac4a907ee4 100644 --- a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_flyout.test.tsx +++ b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_flyout.test.tsx @@ -146,7 +146,9 @@ describe('When the flyout is opened in the ArtifactListPage component', () => { let getByTestId: typeof renderResult['getByTestId']; beforeEach(async () => { - await render(); + await act(async () => { + await render(); + }); getByTestId = renderResult.getByTestId; @@ -166,34 +168,38 @@ describe('When the flyout is opened in the ArtifactListPage component', () => { } }); - it('should disable all buttons while an update is in flight', () => { - expect(getByTestId('testPage-flyout-cancelButton')).not.toBeEnabled(); - expect(getByTestId('testPage-flyout-submitButton')).not.toBeEnabled(); + it('should disable all buttons while an update is in flight', async () => { + await waitFor(() => { + expect(getByTestId('testPage-flyout-cancelButton')).not.toBeEnabled(); + expect(getByTestId('testPage-flyout-submitButton')).not.toBeEnabled(); + }); }); - it('should display loading indicator on Submit while an update is in flight', () => { - expect( - getByTestId('testPage-flyout-submitButton').querySelector('.euiLoadingSpinner') - ).toBeTruthy(); + it('should display loading indicator on Submit while an update is in flight', async () => { + await waitFor(() => + expect( + getByTestId('testPage-flyout-submitButton').querySelector('.euiLoadingSpinner') + ).toBeTruthy() + ); }); - it('should pass `disabled=true` to the Form component while an update is in flight', () => { - expect(getLastFormComponentProps().disabled).toBe(true); + it('should pass `disabled=true` to the Form component while an update is in flight', async () => { + await waitFor(() => expect(getLastFormComponentProps().disabled).toBe(true)); }); }); describe('and submit is successful', () => { beforeEach(async () => { - await render(); + await act(async () => { + await render(); + }); act(() => { userEvent.click(renderResult.getByTestId('testPage-flyout-submitButton')); }); - await act(async () => { - await waitFor(() => { - expect(renderResult.queryByTestId('testPage-flyout')).toBeNull(); - }); + await waitFor(() => { + expect(renderResult.queryByTestId('testPage-flyout')).toBeNull(); }); }); @@ -209,25 +215,25 @@ describe('When the flyout is opened in the ArtifactListPage component', () => { }); describe('and submit fails', () => { - beforeEach(async () => { + beforeEach(() => { const _renderAndWaitForFlyout = render; render = async (...args) => { - mockedApi.responseProvider.trustedAppCreate.mockImplementation(() => { - throw new Error('oh oh. no good!'); - }); + mockedApi.responseProvider.trustedAppCreate.mockRejectedValue( + new Error('oh oh. no good!') as never + ); - await _renderAndWaitForFlyout(...args); + await act(async () => { + await _renderAndWaitForFlyout(...args); + }); act(() => { userEvent.click(renderResult.getByTestId('testPage-flyout-submitButton')); }); - await act(async () => { - await waitFor(() => - expect(mockedApi.responseProvider.trustedAppCreate).toHaveBeenCalled() - ); - }); + await waitFor(() => + expect(mockedApi.responseProvider.trustedAppCreate).toHaveBeenCalled() + ); return renderResult; }; @@ -270,7 +276,9 @@ describe('When the flyout is opened in the ArtifactListPage component', () => { return new ExceptionsListItemGenerator().generateTrustedApp(item); }); - await render({ onFormSubmit: handleSubmitCallback }); + await act(async () => { + await render({ onFormSubmit: handleSubmitCallback }); + }); act(() => { userEvent.click(renderResult.getByTestId('testPage-flyout-submitButton')); @@ -319,8 +327,10 @@ describe('When the flyout is opened in the ArtifactListPage component', () => { }); describe('and in Edit mode', () => { - beforeEach(async () => { - history.push('somepage?show=edit&itemId=123'); + beforeEach(() => { + act(() => { + history.push('somepage?show=edit&itemId=123'); + }); }); it('should show loader while initializing in edit mode', async () => { @@ -355,10 +365,8 @@ describe('When the flyout is opened in the ArtifactListPage component', () => { it('should provide Form component with the item for edit', async () => { const { getByTestId } = await render(); - await act(async () => { - await waitFor(() => { - expect(getByTestId('formMock')).toBeTruthy(); - }); + await waitFor(() => { + expect(getByTestId('formMock')).toBeTruthy(); }); const expectedProps = { @@ -373,37 +381,34 @@ describe('When the flyout is opened in the ArtifactListPage component', () => { expectedProps.entries ) as ExceptionListItemSchema['entries']; - expect(getLastFormComponentProps().item).toEqual(expectedProps); + await waitFor(() => { + expect(getLastFormComponentProps().item).toEqual(expectedProps); + }); }); it('should show error toast and close flyout if item for edit does not exist', async () => { - mockedApi.responseProvider.trustedApp.mockImplementation(() => { - throw new Error('does not exist'); - }); - - await render(); + mockedApi.responseProvider.trustedApp.mockRejectedValue(new Error('does not exist') as never); await act(async () => { - await waitFor(() => { - expect(mockedApi.responseProvider.trustedApp).toHaveBeenCalled(); - }); + await render(); }); - expect(coreStart.notifications.toasts.addWarning).toHaveBeenCalledWith( - 'Failed to retrieve item for edit. Reason: does not exist' - ); + await waitFor(() => { + expect(mockedApi.responseProvider.trustedApp).toHaveBeenCalled(); + + expect(coreStart.notifications.toasts.addWarning).toHaveBeenCalledWith( + 'Failed to retrieve item for edit. Reason: does not exist' + ); + }); }); it('should not show the expired license callout', async () => { const { queryByTestId, getByTestId } = await render(); - await act(async () => { - await waitFor(() => { - expect(getByTestId('formMock')).toBeTruthy(); - }); + await waitFor(() => { + expect(getByTestId('formMock')).toBeTruthy(); + expect(queryByTestId('testPage-flyout-expiredLicenseCallout')).not.toBeTruthy(); }); - - expect(queryByTestId('testPage-flyout-expiredLicenseCallout')).not.toBeTruthy(); }); it('should show expired license warning when unsupported features are being used (downgrade scenario)', async () => { @@ -425,13 +430,10 @@ describe('When the flyout is opened in the ArtifactListPage component', () => { const { getByTestId } = await render(); - await act(async () => { - await waitFor(() => { - expect(getByTestId('formMock')).toBeTruthy(); - }); + await waitFor(() => { + expect(getByTestId('formMock')).toBeTruthy(); + expect(getByTestId('testPage-flyout-expiredLicenseCallout')).toBeTruthy(); }); - - expect(getByTestId('testPage-flyout-expiredLicenseCallout')).toBeTruthy(); }); }); }); diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_flyout.tsx b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_flyout.tsx index e0ec473d22dad..4d9f53c73341e 100644 --- a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_flyout.tsx +++ b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_flyout.tsx @@ -231,7 +231,7 @@ export const ArtifactFlyout = memo( }, [externalSubmitHandlerError, internalSubmitError, submitHandler]); const { - isLoading: isLoadingItemForEdit, + isRefetching: isLoadingItemForEdit, error, refetch: fetchItemForEdit, } = useGetArtifact(apiClient, urlParams.itemId ?? '', undefined, { diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_with_artifact_list_data.ts b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_with_artifact_list_data.ts index 1f343142ee18e..813e205b64c9a 100644 --- a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_with_artifact_list_data.ts +++ b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_with_artifact_list_data.ts @@ -7,7 +7,7 @@ import { useEffect, useMemo, useState } from 'react'; import type { Pagination } from '@elastic/eui'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import type { ServerApiError } from '../../../../common/types'; import { useIsMounted } from '../../../hooks/use_is_mounted'; import { MANAGEMENT_PAGE_SIZE_OPTIONS } from '../../../common/constants'; diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/status_action.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/status_action.tsx index de8987f47ea55..b75a480765844 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/status_action.tsx +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/status_action.tsx @@ -46,7 +46,7 @@ export const EndpointStatusActionResult = memo< error: fetchedDetailsError, isFetching, isFetched, - } = useGetEndpointDetails(endpointId, { enabled: isPending, queryKey }); + } = useGetEndpointDetails(endpointId, { enabled: isPending, queryKey: [queryKey] }); const { data: fetchedPendingActionsSummary } = useGetEndpointPendingActionsSummary([endpointId], { enabled: isPending, diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_delete_artifact.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_delete_artifact.tsx index e75402ae98427..aef46affd4252 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_delete_artifact.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_delete_artifact.tsx @@ -7,8 +7,8 @@ import pMap from 'p-map'; import type { IHttpFetchError } from '@kbn/core-http-browser'; import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; -import type { UseMutationOptions, UseMutationResult } from 'react-query'; -import { useMutation } from 'react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { useMutation } from '@tanstack/react-query'; import type { ExceptionsListApiClient } from '../../services/exceptions_list/exceptions_list_api_client'; const DEFAULT_OPTIONS = Object.freeze({}); diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_update_artifact.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_update_artifact.tsx index fdbe6a451dc44..be99fb5f1abb8 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_update_artifact.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_update_artifact.tsx @@ -10,8 +10,8 @@ import type { UpdateExceptionListItemSchema, ExceptionListItemSchema, } from '@kbn/securitysolution-io-ts-list-types'; -import type { UseMutationOptions, UseMutationResult } from 'react-query'; -import { useMutation } from 'react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { useMutation } from '@tanstack/react-query'; import type { ExceptionsListApiClient } from '../../services/exceptions_list/exceptions_list_api_client'; const DEFAULT_OPTIONS = Object.freeze({}); diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_create_artifact.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_create_artifact.tsx index fa807e2d93438..63a41492b2699 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_create_artifact.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_create_artifact.tsx @@ -9,8 +9,8 @@ import type { ExceptionListItemSchema, } from '@kbn/securitysolution-io-ts-list-types'; import type { IHttpFetchError } from '@kbn/core-http-browser'; -import type { UseMutationOptions, UseMutationResult } from 'react-query'; -import { useMutation } from 'react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { useMutation } from '@tanstack/react-query'; import type { ExceptionsListApiClient } from '../../services/exceptions_list/exceptions_list_api_client'; const DEFAULT_OPTIONS = Object.freeze({}); diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_delete_artifact.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_delete_artifact.tsx index de3b4c386bc3f..9b366d033caf5 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_delete_artifact.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_delete_artifact.tsx @@ -6,8 +6,8 @@ */ import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; import type { IHttpFetchError } from '@kbn/core-http-browser'; -import type { UseMutationOptions, UseMutationResult } from 'react-query'; -import { useMutation } from 'react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { useMutation } from '@tanstack/react-query'; import type { ExceptionsListApiClient } from '../../services/exceptions_list/exceptions_list_api_client'; const DEFAULT_OPTIONS = Object.freeze({}); diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_get_artifact.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_get_artifact.tsx index 7ce83d84c9394..58b0cd1c16e73 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_get_artifact.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_get_artifact.tsx @@ -6,8 +6,8 @@ */ import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; import type { IHttpFetchError } from '@kbn/core-http-browser'; -import type { QueryObserverResult, UseQueryOptions } from 'react-query'; -import { useQuery } from 'react-query'; +import type { QueryObserverResult, UseQueryOptions } from '@tanstack/react-query'; +import { useQuery } from '@tanstack/react-query'; import type { ExceptionsListApiClient } from '../../services/exceptions_list/exceptions_list_api_client'; export function useGetArtifact( diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_list_artifact.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_list_artifact.tsx index 4064c9bdeb82e..0c751cd6525cb 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_list_artifact.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_list_artifact.tsx @@ -6,8 +6,8 @@ */ import type { FoundExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; import type { IHttpFetchError } from '@kbn/core-http-browser'; -import type { QueryObserverResult, UseQueryOptions } from 'react-query'; -import { useQuery } from 'react-query'; +import type { QueryObserverResult, UseQueryOptions } from '@tanstack/react-query'; +import { useQuery } from '@tanstack/react-query'; import { useMemo } from 'react'; import { MANAGEMENT_DEFAULT_PAGE, diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_summary_artifact.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_summary_artifact.tsx index 36fc65a309fa6..da4dcf765a8c9 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_summary_artifact.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_summary_artifact.tsx @@ -6,8 +6,8 @@ */ import type { ExceptionListSummarySchema } from '@kbn/securitysolution-io-ts-list-types'; import type { IHttpFetchError } from '@kbn/core-http-browser'; -import type { QueryObserverResult, UseQueryOptions } from 'react-query'; -import { useQuery } from 'react-query'; +import type { QueryObserverResult, UseQueryOptions } from '@tanstack/react-query'; +import { useQuery } from '@tanstack/react-query'; import { parsePoliciesAndFilterToKql, parseQueryFilterToKQL } from '../../common/utils'; import type { ExceptionsListApiClient } from '../../services/exceptions_list/exceptions_list_api_client'; import { DEFAULT_EXCEPTION_LIST_ITEM_SEARCHABLE_FIELDS } from '../../../../common/endpoint/service/artifacts/constants'; diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_update_artifact.tsx b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_update_artifact.tsx index 910f2228040a0..ad0791f94f687 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_update_artifact.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_update_artifact.tsx @@ -9,8 +9,8 @@ import type { ExceptionListItemSchema, } from '@kbn/securitysolution-io-ts-list-types'; import type { IHttpFetchError } from '@kbn/core-http-browser'; -import type { UseMutationOptions, UseMutationResult } from 'react-query'; -import { useMutation } from 'react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { useMutation } from '@tanstack/react-query'; import type { ExceptionsListApiClient } from '../../services/exceptions_list/exceptions_list_api_client'; const DEFAULT_OPTIONS = Object.freeze({}); diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_action_details.test.ts b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_action_details.test.ts index b04e0428037cf..381bd906f58f5 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_action_details.test.ts +++ b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_action_details.test.ts @@ -11,12 +11,12 @@ import { useGetActionDetails } from './use_get_action_details'; import { responseActionsHttpMocks } from '../../mocks/response_actions_http_mocks'; import { resolvePathVariables } from '../../../common/utils/resolve_path_variables'; import { ACTION_DETAILS_ROUTE } from '../../../../common/endpoint/constants'; -import { useQuery as _useQuery } from 'react-query'; +import { useQuery as _useQuery } from '@tanstack/react-query'; const useQueryMock = _useQuery as jest.Mock; -jest.mock('react-query', () => { - const actualReactQueryModule = jest.requireActual('react-query'); +jest.mock('@tanstack/react-query', () => { + const actualReactQueryModule = jest.requireActual('@tanstack/react-query'); return { ...actualReactQueryModule, diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_action_details.ts b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_action_details.ts index 5bc85d8007176..8336c46e2b232 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_action_details.ts +++ b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_action_details.ts @@ -5,9 +5,9 @@ * 2.0. */ -import type { UseQueryOptions, UseQueryResult } from 'react-query'; +import type { UseQueryOptions, UseQueryResult } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import { useHttp } from '../../../common/lib/kibana'; import { resolvePathVariables } from '../../../common/utils/resolve_path_variables'; import { ACTION_DETAILS_ROUTE } from '../../../../common/endpoint/constants'; diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_action_list.test.ts b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_action_list.test.ts index 8ff8a6f43d11e..d039890256a3d 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_action_list.test.ts +++ b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_action_list.test.ts @@ -9,13 +9,13 @@ import type { AppContextTestRender, ReactQueryHookRenderer } from '../../../comm import { createAppRootMockRenderer } from '../../../common/mock/endpoint'; import { useGetEndpointActionList } from './use_get_endpoint_action_list'; import { ENDPOINTS_ACTION_LIST_ROUTE } from '../../../../common/endpoint/constants'; -import { useQuery as _useQuery } from 'react-query'; +import { useQuery as _useQuery } from '@tanstack/react-query'; import { responseActionsHttpMocks } from '../../mocks/response_actions_http_mocks'; const useQueryMock = _useQuery as jest.Mock; -jest.mock('react-query', () => { - const actualReactQueryModule = jest.requireActual('react-query'); +jest.mock('@tanstack/react-query', () => { + const actualReactQueryModule = jest.requireActual('@tanstack/react-query'); return { ...actualReactQueryModule, diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_action_list.ts b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_action_list.ts index e0a1e1c1a2485..58420993cb788 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_action_list.ts +++ b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_action_list.ts @@ -5,9 +5,9 @@ * 2.0. */ -import type { UseQueryOptions, UseQueryResult } from 'react-query'; +import type { UseQueryOptions, UseQueryResult } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; -import { useQuery } from 'react-query'; +import { useQuery } from '@tanstack/react-query'; import type { EndpointActionListRequestQuery } from '../../../../common/endpoint/schema/actions'; import { useHttp } from '../../../common/lib/kibana'; import { ENDPOINTS_ACTION_LIST_ROUTE } from '../../../../common/endpoint/constants'; diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_details.test.ts b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_details.test.ts index b9771f7dee3dd..ce8b08014686e 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_details.test.ts +++ b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_details.test.ts @@ -10,13 +10,13 @@ import { createAppRootMockRenderer } from '../../../common/mock/endpoint'; import { useGetEndpointDetails } from './use_get_endpoint_details'; import { resolvePathVariables } from '../../../common/utils/resolve_path_variables'; import { HOST_METADATA_GET_ROUTE } from '../../../../common/endpoint/constants'; -import { useQuery as _useQuery } from 'react-query'; +import { useQuery as _useQuery } from '@tanstack/react-query'; import { endpointMetadataHttpMocks } from '../../pages/endpoint_hosts/mocks'; const useQueryMock = _useQuery as jest.Mock; -jest.mock('react-query', () => { - const actualReactQueryModule = jest.requireActual('react-query'); +jest.mock('@tanstack/react-query', () => { + const actualReactQueryModule = jest.requireActual('@tanstack/react-query'); return { ...actualReactQueryModule, diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_details.ts b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_details.ts index e81e8b716ea9c..68d53372e9dd3 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_details.ts +++ b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_details.ts @@ -5,8 +5,8 @@ * 2.0. */ -import type { UseQueryOptions, UseQueryResult } from 'react-query'; -import { useQuery } from 'react-query'; +import type { UseQueryOptions, UseQueryResult } from '@tanstack/react-query'; +import { useQuery } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; import { resolvePathVariables } from '../../../common/utils/resolve_path_variables'; import { useHttp } from '../../../common/lib/kibana'; diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_pending_actions_summary.test.ts b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_pending_actions_summary.test.ts index b36cf686d67f5..6bc17c8794616 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_pending_actions_summary.test.ts +++ b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_pending_actions_summary.test.ts @@ -9,13 +9,13 @@ import type { AppContextTestRender, ReactQueryHookRenderer } from '../../../comm import { createAppRootMockRenderer } from '../../../common/mock/endpoint'; import { useGetEndpointPendingActionsSummary } from './use_get_endpoint_pending_actions_summary'; import { ACTION_STATUS_ROUTE } from '../../../../common/endpoint/constants'; -import { useQuery as _useQuery } from 'react-query'; +import { useQuery as _useQuery } from '@tanstack/react-query'; import { responseActionsHttpMocks } from '../../mocks/response_actions_http_mocks'; const useQueryMock = _useQuery as jest.Mock; -jest.mock('react-query', () => { - const actualReactQueryModule = jest.requireActual('react-query'); +jest.mock('@tanstack/react-query', () => { + const actualReactQueryModule = jest.requireActual('@tanstack/react-query'); return { ...actualReactQueryModule, diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_pending_actions_summary.ts b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_pending_actions_summary.ts index 3254e743da44a..cee29041b0354 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_pending_actions_summary.ts +++ b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_pending_actions_summary.ts @@ -5,8 +5,8 @@ * 2.0. */ -import type { QueryObserverResult, UseQueryOptions } from 'react-query'; -import { useQuery } from 'react-query'; +import type { QueryObserverResult, UseQueryOptions } from '@tanstack/react-query'; +import { useQuery } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; import type { PendingActionsResponse } from '../../../../common/endpoint/types'; import { fetchPendingActionsByAgentId } from '../../../common/lib/endpoint_pending_actions'; diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_policy_response.tsx b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_policy_response.tsx index 7a67d5a446bac..a930dd43eecd4 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_policy_response.tsx +++ b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_policy_response.tsx @@ -5,8 +5,8 @@ * 2.0. */ import type { IHttpFetchError } from '@kbn/core-http-browser'; -import type { UseQueryResult, UseQueryOptions } from 'react-query'; -import { useQuery } from 'react-query'; +import type { UseQueryResult, UseQueryOptions } from '@tanstack/react-query'; +import { useQuery } from '@tanstack/react-query'; import { useHttp } from '../../../common/lib/kibana'; import { BASE_POLICY_RESPONSE_ROUTE } from '../../../../common/endpoint/constants'; import type { GetHostPolicyResponse } from '../../../../common/endpoint/types'; diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_get_endpoint_processes_request.ts b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_get_endpoint_processes_request.ts index aa3f2b69c807b..8fa97e75dc6be 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_get_endpoint_processes_request.ts +++ b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_get_endpoint_processes_request.ts @@ -5,8 +5,8 @@ * 2.0. */ -import type { UseMutationOptions, UseMutationResult } from 'react-query'; -import { useMutation } from 'react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { useMutation } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; import type { ProcessesRequestBody, diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_isolate_endpoint_request.ts b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_isolate_endpoint_request.ts index d4ca621a1fc16..b0fb5029ab15d 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_isolate_endpoint_request.ts +++ b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_isolate_endpoint_request.ts @@ -5,8 +5,8 @@ * 2.0. */ -import type { UseMutationOptions, UseMutationResult } from 'react-query'; -import { useMutation } from 'react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { useMutation } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; import { isolateHost } from '../../../common/lib/endpoint_isolation'; import type { diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_kill_process_endpoint_request.ts b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_kill_process_endpoint_request.ts index a049d35c21f5c..2d86f15f81d40 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_kill_process_endpoint_request.ts +++ b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_kill_process_endpoint_request.ts @@ -5,8 +5,8 @@ * 2.0. */ -import type { UseMutationOptions, UseMutationResult } from 'react-query'; -import { useMutation } from 'react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { useMutation } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; import type { KillOrSuspendProcessRequestBody, diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_release_endpoint_request.ts b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_release_endpoint_request.ts index aaf6e6ab71944..f6d45393ae885 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_release_endpoint_request.ts +++ b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_release_endpoint_request.ts @@ -5,8 +5,8 @@ * 2.0. */ -import type { UseMutationOptions, UseMutationResult } from 'react-query'; -import { useMutation } from 'react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import { useMutation } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; import type { HostIsolationRequestBody, diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_suspend_process_endpoint_request.ts b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_suspend_process_endpoint_request.ts index 483b0d53e1d6b..d6c2f56cb627f 100644 --- a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_suspend_process_endpoint_request.ts +++ b/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_send_suspend_process_endpoint_request.ts @@ -5,8 +5,8 @@ * 2.0. */ -import { useMutation } from 'react-query'; -import type { UseMutationOptions, UseMutationResult } from 'react-query'; +import { useMutation } from '@tanstack/react-query'; +import type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; import type { KillOrSuspendProcessRequestBody, diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form.test.tsx b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form.test.tsx index bc8ce0c6a3216..f4eac8de48805 100644 --- a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form.test.tsx @@ -5,8 +5,7 @@ * 2.0. */ import React from 'react'; -import { act, cleanup } from '@testing-library/react'; -import { fireEvent } from '@testing-library/dom'; +import { act, cleanup, fireEvent } from '@testing-library/react'; import { stubIndexPattern } from '@kbn/data-plugin/common/stubs'; import { useFetchIndex } from '../../../../../common/containers/source'; import { NAME_ERROR } from '../event_filters_list'; @@ -187,9 +186,7 @@ describe('Event filter form', () => { render(); expect(renderResult.queryByText(NAME_ERROR)).toBeNull(); const nameInput = renderResult.getByTestId(`${formPrefix}-name-input`); - act(() => { - fireEvent.blur(nameInput); - }); + fireEvent.blur(nameInput); rerenderWithLatestProps(); expect(renderResult.queryByText(NAME_ERROR)).not.toBeNull(); }); diff --git a/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/form.test.tsx b/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/form.test.tsx index 43245b340e47c..b60cdf6040b1d 100644 --- a/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/form.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/form.test.tsx @@ -63,24 +63,12 @@ describe('When on the host isolation exceptions entry form', () => { ).resolves.toHaveLength(10); }); - await act(async () => { - await waitFor(() => { - userEvent.click( - renderResult.getByTestId('hostIsolationExceptionsListPage-pageAddButton') - ); - }); - }); - - await act(async () => { - await waitFor(() => { - expect(renderResult.getByTestId('hostIsolationExceptions-form')).toBeTruthy(); - }); + userEvent.click(renderResult.getByTestId('hostIsolationExceptionsListPage-pageAddButton')); - await waitFor(() => { - expect(fleetApiMock.responseProvider.endpointPackagePolicyList).toHaveBeenCalled(); - }); + await waitFor(() => { + expect(renderResult.getByTestId('hostIsolationExceptions-form')).toBeTruthy(); + expect(fleetApiMock.responseProvider.endpointPackagePolicyList).toHaveBeenCalled(); }); - return renderResult; }; diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/policy_artifacts_delete_modal.test.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/policy_artifacts_delete_modal.test.tsx index 6bb63fb96c62a..37f04ff804c1d 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/policy_artifacts_delete_modal.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/policy_artifacts_delete_modal.test.tsx @@ -20,6 +20,7 @@ import { PolicyArtifactsDeleteModal } from './policy_artifacts_delete_modal'; import { exceptionsListAllHttpMocks } from '../../../../../mocks/exceptions_list_http_mocks'; import { ExceptionsListApiClient } from '../../../../../services/exceptions_list/exceptions_list_api_client'; import { POLICY_ARTIFACT_DELETE_MODAL_LABELS } from './translations'; +import { getDeferred } from '../../../../../components/mocks'; const listType: Array = [ 'endpoint_events', @@ -80,6 +81,8 @@ describe.each(listType)('Policy details %s artifact delete modal', (type) => { }); it('should disable the submit button while deleting ', async () => { + const deferred = getDeferred(); + mockedApi.responseProvider.exceptionUpdate.mockDelay.mockReturnValue(deferred.promise); await render(); const confirmButton = renderResult.getByTestId('confirmModalConfirmButton'); userEvent.click(confirmButton); @@ -87,6 +90,10 @@ describe.each(listType)('Policy details %s artifact delete modal', (type) => { await waitFor(() => { expect(confirmButton).toBeDisabled(); }); + + await act(async () => { + deferred.resolve(); // cleanup + }); }); it('should call the API with the removed policy from the exception tags', async () => { diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/policy_artifacts_delete_modal.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/policy_artifacts_delete_modal.tsx index beee26506cd9e..b37fbfe95bd59 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/policy_artifacts_delete_modal.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/policy_artifacts_delete_modal.tsx @@ -6,7 +6,7 @@ */ import { EuiCallOut, EuiConfirmModal, EuiSpacer, EuiText } from '@elastic/eui'; -import { useQueryClient } from 'react-query'; +import { useQueryClient } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; import React, { useCallback } from 'react'; diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/flyout/policy_artifacts_flyout.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/flyout/policy_artifacts_flyout.tsx index c13c351f935ac..d4adb3b53b23a 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/flyout/policy_artifacts_flyout.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/flyout/policy_artifacts_flyout.tsx @@ -6,7 +6,7 @@ */ import React, { useCallback, useMemo, useState } from 'react'; -import { useQueryClient } from 'react-query'; +import { useQueryClient } from '@tanstack/react-query'; import { isEmpty, without } from 'lodash/fp'; import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; import { diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/list/policy_artifacts_list.test.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/list/policy_artifacts_list.test.tsx index 2ccfaff3c8b2b..5f9336e291e77 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/list/policy_artifacts_list.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/list/policy_artifacts_list.test.tsx @@ -67,7 +67,7 @@ describe('Policy details artifacts list', () => { getArtifactPath={getEventFiltersListPath} /> ); - await waitFor(mockedApi.responseProvider.eventFiltersList); + await waitFor(() => expect(mockedApi.responseProvider.eventFiltersList).toHaveBeenCalled()); }); return renderResult; }; @@ -99,7 +99,9 @@ describe('Policy details artifacts list', () => { it('should expand an item when expand is clicked', async () => { await render(); - expect(renderResult.getAllByTestId('artifacts-collapsed-list-card')).toHaveLength(1); + await waitFor(() => { + expect(renderResult.getAllByTestId('artifacts-collapsed-list-card')).toHaveLength(1); + }); userEvent.click( renderResult.getByTestId('artifacts-collapsed-list-card-header-expandCollapse') diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_integration_artifacts_card.test.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_integration_artifacts_card.test.tsx index 2e662b393c92f..2ac194b39bd8e 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_integration_artifacts_card.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_integration_artifacts_card.test.tsx @@ -69,9 +69,11 @@ describe('Fleet integration policy endpoint security event filters card', () => ); await render(); - expect(renderResult.getByTestId('artifacts-fleet-integration-card')).toHaveTextContent( - 'Event filters3' - ); + await waitFor(() => { + expect(renderResult.getByTestId('artifacts-fleet-integration-card')).toHaveTextContent( + 'Event filters3' + ); + }); }); it('should show the card even when no event filters associated with the policy', async () => { diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_details.test.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_details.test.tsx index 227e4eb3a78cd..eab38e3cdd7b5 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_details.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_details.test.tsx @@ -23,7 +23,9 @@ import { APP_UI_ID } from '../../../../../common/constants'; import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; import { exceptionsFindHttpMocks } from '../../../mocks/exceptions_list_http_mocks'; -jest.mock('./policy_forms/components/policy_form_layout'); +jest.mock('./policy_forms/components/policy_form_layout', () => ({ + PolicyFormLayout: () => <>, +})); jest.mock('../../../../common/components/user_privileges'); jest.mock('../../../../common/hooks/use_experimental_features'); diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_list.test.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_list.test.tsx index 122ef57fa4a3e..75ebfc9ebda54 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_list.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_list.test.tsx @@ -42,7 +42,7 @@ describe('When on the policy list page', () => { describe('and there are no policies', () => { beforeEach(async () => { - getPackagePolicies.mockImplementation(() => + getPackagePolicies.mockResolvedValue( sendGetEndpointSpecificPackagePoliciesMock({ page: 1, perPage: 20, @@ -60,24 +60,24 @@ describe('When on the policy list page', () => { it('should show the empty page', () => { expect(renderResult.getByTestId('emptyPolicyTable')).toBeTruthy(); }); - it('should show instruction text and a button to add the Endpoint Security integration', () => { + it('should show instruction text and a button to add the Endpoint Security integration', async () => { expect( renderResult.findByText( 'From this page, you’ll be able to view and manage the Endpoint and Cloud Security Integration policies in your environment running Endpoint and Cloud Security.' ) ).toBeTruthy(); - expect(renderResult.getByTestId('onboardingStartButton')).toBeTruthy(); + await waitFor(() => { + expect(renderResult.getByTestId('onboardingStartButton')).toBeTruthy(); + }); }); }); describe('and data exists', () => { - let policies: GetPolicyListResponse; + const policies: GetPolicyListResponse = sendGetEndpointSpecificPackagePoliciesMock(); + beforeEach(async () => { - policies = await sendGetEndpointSpecificPackagePoliciesMock(); - getPackagePolicies.mockImplementation(async () => { - return policies; - }); - getAgentPolicies.mockResolvedValue({ + getPackagePolicies.mockReturnValue(policies); + getAgentPolicies.mockReturnValue({ items: [ { package_policies: [policies.items[0].id], agents: 4 }, { package_policies: [policies.items[1].id], agents: 2 }, @@ -118,7 +118,7 @@ describe('When on the policy list page', () => { expect(updatedByCells[0].textContent).toEqual(expectedAvatarName.charAt(0)); expect(firstUpdatedByName.textContent).toEqual(expectedAvatarName); }); - it('should show the correct endpoint count', () => { + it('should show the correct endpoint count', async () => { const endpointCount = renderResult.getAllByTestId('policyEndpointCountLink'); expect(endpointCount[0].textContent).toBe('4'); }); @@ -151,24 +151,28 @@ describe('When on the policy list page', () => { }); describe('pagination', () => { beforeEach(async () => { - getPackagePolicies.mockImplementation(async ({ page, perPage }) => { + getPackagePolicies.mockImplementation(({ page, perPage }) => { // # policies = 100 to trigger UI to show pagination - const response = await sendGetEndpointSpecificPackagePoliciesMock({ + return sendGetEndpointSpecificPackagePoliciesMock({ page, perPage, count: 100, }); - return response; }); render(); await waitFor(() => { expect(getPackagePolicies).toHaveBeenCalled(); + expect(sendGetEndpointSpecificPackagePolicies).toHaveBeenCalled(); + expect(sendGetAgentPolicyList).toHaveBeenCalled(); }); }); afterEach(() => { getPackagePolicies.mockReset(); }); it('should pass the correct page value to the api', async () => { + await waitFor(() => { + expect(renderResult.getByTestId('pagination-button-next')).toBeTruthy(); + }); act(() => { renderResult.getByTestId('pagination-button-next').click(); }); @@ -181,6 +185,9 @@ describe('When on the policy list page', () => { }); }); it('should pass the correct pageSize value to the api', async () => { + await waitFor(() => { + expect(renderResult.getByTestId('tablePaginationPopoverButton')).toBeTruthy(); + }); act(() => { renderResult.getByTestId('tablePaginationPopoverButton').click(); }); @@ -203,10 +210,10 @@ describe('When on the policy list page', () => { }); await waitFor(() => { expect(getPackagePolicies).toHaveBeenCalledTimes(2); - }); - expect(getPackagePolicies.mock.calls[1][1].query).toEqual({ - page: 3, - perPage: 50, + expect(getPackagePolicies.mock.calls[1][1].query).toEqual({ + page: 3, + perPage: 50, + }); }); }); it('should reset page back to 1 if the user is on a page > 1 and they change page size', async () => { @@ -215,24 +222,23 @@ describe('When on the policy list page', () => { history.push('/administration/policies?page=2&pageSize=20'); }); await waitFor(() => { - expect(getPackagePolicies).toHaveBeenCalledTimes(2); + expect(getPackagePolicies).toHaveBeenCalled(); }); // change pageSize - act(() => { - renderResult.getByTestId('tablePaginationPopoverButton').click(); + await act(async () => { + (await renderResult.getByTestId('tablePaginationPopoverButton')).click(); }); const pageSize10 = await renderResult.findByTestId('tablePagination-10-rows'); act(() => { pageSize10.click(); }); - await waitFor(() => { - expect(getPackagePolicies).toHaveBeenCalledTimes(3); - }); - expect(getPackagePolicies.mock.calls[2][1].query).toEqual({ - page: 1, - perPage: 10, + expect(sendGetEndpointSpecificPackagePolicies).toHaveBeenLastCalledWith(expect.any(Object), { + query: { + page: 1, + perPage: 10, + }, }); }); it('should set page to 1 if user tries to force an invalid page number', async () => { diff --git a/x-pack/plugins/security_solution/public/management/services/policies/hooks.test.ts b/x-pack/plugins/security_solution/public/management/services/policies/hooks.test.ts index b591051d72c94..8bd8c4c72efea 100644 --- a/x-pack/plugins/security_solution/public/management/services/policies/hooks.test.ts +++ b/x-pack/plugins/security_solution/public/management/services/policies/hooks.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { UseQueryOptions } from 'react-query'; +import type { UseQueryOptions } from '@tanstack/react-query'; import type { IHttpFetchError, HttpSetup } from '@kbn/core-http-browser'; import type { GetPackagesResponse } from '@kbn/fleet-plugin/common'; import { useGetEndpointSecurityPackage } from './hooks'; diff --git a/x-pack/plugins/security_solution/public/management/services/policies/hooks.ts b/x-pack/plugins/security_solution/public/management/services/policies/hooks.ts index 6b2c726875827..fef45b657d5da 100644 --- a/x-pack/plugins/security_solution/public/management/services/policies/hooks.ts +++ b/x-pack/plugins/security_solution/public/management/services/policies/hooks.ts @@ -4,8 +4,8 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import type { QueryObserverResult, UseQueryOptions } from 'react-query'; -import { useQuery } from 'react-query'; +import type { QueryObserverResult, UseQueryOptions } from '@tanstack/react-query'; +import { useQuery } from '@tanstack/react-query'; import type { IHttpFetchError } from '@kbn/core-http-browser'; import type { GetAgentPoliciesResponse, GetPackagesResponse } from '@kbn/fleet-plugin/common'; import { AGENT_POLICY_SAVED_OBJECT_TYPE } from '@kbn/fleet-plugin/common'; diff --git a/x-pack/plugins/security_solution/public/management/services/policies/test_mock_utils.ts b/x-pack/plugins/security_solution/public/management/services/policies/test_mock_utils.ts index b415fceedc0cd..af7a531d5a352 100644 --- a/x-pack/plugins/security_solution/public/management/services/policies/test_mock_utils.ts +++ b/x-pack/plugins/security_solution/public/management/services/policies/test_mock_utils.ts @@ -7,13 +7,13 @@ import { FleetPackagePolicyGenerator } from '../../../../common/endpoint/data_generators/fleet_package_policy_generator'; import type { GetPolicyListResponse } from '../../pages/policy/types'; -export const sendGetEndpointSpecificPackagePoliciesMock = async ( +export const sendGetEndpointSpecificPackagePoliciesMock = ( params: { page: number; perPage: number; count: number; } = { page: 1, perPage: 20, count: 5 } -): Promise => { +): GetPolicyListResponse => { const { page, perPage, count } = params; const generator = new FleetPackagePolicyGenerator(); const items = Array.from({ length: count }, (_, index) => { diff --git a/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map.tsx b/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map.tsx index a7e2f67e5f586..53c69b5b47afd 100644 --- a/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map.tsx +++ b/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map.tsx @@ -8,7 +8,7 @@ import { EuiAccordion, EuiLink, EuiText } from '@elastic/eui'; import deepEqual from 'fast-deep-equal'; import React, { useCallback, useEffect, useState, useMemo } from 'react'; -import { createPortalNode, InPortal } from 'react-reverse-portal'; +import { createHtmlPortalNode, InPortal } from 'react-reverse-portal'; import styled, { css } from 'styled-components'; import type { Filter, Query } from '@kbn/es-query'; @@ -127,7 +127,7 @@ export const EmbeddedMapComponent = ({ // own component tree instead of the embeddables (default). This is necessary to have access to // the Redux store, theme provider, etc, which is required to register and un-register the draggable // Search InPortal/OutPortal for implementation touch points - const portalNode = React.useMemo(() => createPortalNode(), []); + const portalNode = React.useMemo(() => createHtmlPortalNode(), []); useEffect(() => { setMapIndexPatterns((prevMapIndexPatterns) => { diff --git a/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map_helpers.test.tsx b/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map_helpers.test.tsx index b7e27b2422451..c82051b11769c 100644 --- a/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map_helpers.test.tsx +++ b/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map_helpers.test.tsx @@ -7,7 +7,7 @@ import { embeddablePluginMock } from '@kbn/embeddable-plugin/public/mocks'; import { createEmbeddable, findMatchingIndexPatterns } from './embedded_map_helpers'; -import { createPortalNode } from 'react-reverse-portal'; +import { createHtmlPortalNode } from 'react-reverse-portal'; import { mockAPMIndexPattern, mockAPMRegexIndexPattern, @@ -43,7 +43,7 @@ describe('embedded_map_helpers', () => { '2020-07-07T08:20:18.966Z', '2020-07-08T08:20:18.966Z', setQueryMock, - createPortalNode(), + createHtmlPortalNode(), mockEmbeddable ); expect(setQueryMock).toHaveBeenCalledTimes(1); @@ -58,7 +58,7 @@ describe('embedded_map_helpers', () => { '2020-07-07T08:20:18.966Z', '2020-07-08T08:20:18.966Z', setQueryMock, - createPortalNode(), + createHtmlPortalNode(), mockEmbeddable ); expect(setQueryMock.mock.calls[0][0].refetch).not.toBe(embeddable.reload); diff --git a/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map_helpers.tsx b/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map_helpers.tsx index 731adaa9b5081..3583e54f4c980 100644 --- a/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map_helpers.tsx +++ b/x-pack/plugins/security_solution/public/network/components/embeddables/embedded_map_helpers.tsx @@ -7,7 +7,7 @@ import uuid from 'uuid'; import React from 'react'; -import type { PortalNode } from 'react-reverse-portal'; +import type { HtmlPortalNode } from 'react-reverse-portal'; import { OutPortal } from 'react-reverse-portal'; import minimatch from 'minimatch'; import type { Filter, Query } from '@kbn/es-query'; @@ -51,7 +51,7 @@ export const createEmbeddable = async ( startDate: GlobalTimeArgs['from'], endDate: GlobalTimeArgs['to'], setQuery: GlobalTimeArgs['setQuery'], - portalNode: PortalNode, + portalNode: HtmlPortalNode, embeddableApi: EmbeddableStart ): Promise => { const factory = embeddableApi.getEmbeddableFactory< diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_by_status/use_cases_by_status.test.tsx b/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_by_status/use_cases_by_status.test.tsx index eff9948617b67..cee2884d1bdf1 100644 --- a/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_by_status/use_cases_by_status.test.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_by_status/use_cases_by_status.test.tsx @@ -62,95 +62,81 @@ describe('useCasesByStatus', () => { beforeEach(() => { jest.clearAllMocks(); }); - test('init', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook< - UseCasesByStatusProps, - UseCasesByStatusResults - >(() => useCasesByStatus({ skip: false }), { + test('init', () => { + const { result } = renderHook( + () => useCasesByStatus({}), + { wrapper: TestProviders, - }); - await waitForNextUpdate(); - expect(result.current).toEqual({ - closed: 0, - inProgress: 0, - isLoading: true, - open: 0, - totalCounts: 0, - updatedAt: dateNow, - }); + } + ); + expect(result.current).toEqual({ + closed: 0, + inProgress: 0, + isLoading: true, + open: 0, + totalCounts: 0, + updatedAt: dateNow, }); }); test('fetch data', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook< - UseCasesByStatusProps, - UseCasesByStatusResults - >(() => useCasesByStatus({ skip: false }), { - wrapper: TestProviders, - }); - await waitForNextUpdate(); - await waitForNextUpdate(); - expect(result.current).toEqual({ - closed: 3, - inProgress: 2, - isLoading: false, - open: 1, - totalCounts: 6, - updatedAt: dateNow, - }); + const { result, waitForNextUpdate } = renderHook< + UseCasesByStatusProps, + UseCasesByStatusResults + >(() => useCasesByStatus({ skip: false }), { + wrapper: TestProviders, + }); + await waitForNextUpdate(); + expect(result.current).toEqual({ + closed: 3, + inProgress: 2, + isLoading: false, + open: 1, + totalCounts: 6, + updatedAt: dateNow, }); }); test('it should call setQuery when fetching', async () => { - await act(async () => { - const { waitForNextUpdate } = renderHook( - () => useCasesByStatus({ skip: false }), - { - wrapper: TestProviders, - } - ); - await waitForNextUpdate(); - await waitForNextUpdate(); - expect(mockSetQuery).toHaveBeenCalled(); - }); + const { waitForNextUpdate } = renderHook( + () => useCasesByStatus({ skip: false }), + { + wrapper: TestProviders, + } + ); + await waitForNextUpdate(); + expect(mockSetQuery).toHaveBeenCalled(); }); test('it should call deleteQuery when unmounting', async () => { - await act(async () => { - const { waitForNextUpdate, unmount } = renderHook< - UseCasesByStatusProps, - UseCasesByStatusResults - >(() => useCasesByStatus({ skip: false }), { - wrapper: TestProviders, - }); - await waitForNextUpdate(); + const { waitForNextUpdate, unmount } = renderHook< + UseCasesByStatusProps, + UseCasesByStatusResults + >(() => useCasesByStatus({ skip: false }), { + wrapper: TestProviders, + }); + await waitForNextUpdate(); - unmount(); + unmount(); - expect(mockDeleteQuery).toHaveBeenCalled(); - }); + expect(mockDeleteQuery).toHaveBeenCalled(); }); test('skip', async () => { const abortSpy = jest.spyOn(AbortController.prototype, 'abort'); - await act(async () => { - const localProps = { skip: false }; + const localProps = { skip: false }; - const { rerender, waitForNextUpdate } = renderHook< - UseCasesByStatusProps, - UseCasesByStatusResults - >(() => useCasesByStatus(localProps), { - wrapper: TestProviders, - }); - await waitForNextUpdate(); - await waitForNextUpdate(); - - localProps.skip = true; - act(() => rerender()); - act(() => rerender()); - expect(abortSpy).toHaveBeenCalledTimes(2); + const { rerender, waitForNextUpdate } = renderHook< + UseCasesByStatusProps, + UseCasesByStatusResults + >(() => useCasesByStatus(localProps), { + wrapper: TestProviders, }); + await waitForNextUpdate(); + + localProps.skip = true; + act(() => rerender()); + act(() => rerender()); + expect(abortSpy).toHaveBeenCalledTimes(2); }); }); diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_table/use_case_items.test.ts b/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_table/use_case_items.test.ts index 1e9b742f70600..036ed835b46cf 100644 --- a/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_table/use_case_items.test.ts +++ b/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_table/use_case_items.test.ts @@ -63,17 +63,14 @@ describe('useCaseItems', () => { }); it('should return default values', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderUseCaseItems(); + const { result, waitForNextUpdate } = renderUseCaseItems(); - await waitForNextUpdate(); - await waitForNextUpdate(); + await waitForNextUpdate(); - expect(result.current).toEqual({ - items: [], - isLoading: false, - updatedAt: dateNow, - }); + expect(result.current).toEqual({ + items: [], + isLoading: false, + updatedAt: dateNow, }); expect(mockCasesApi).toBeCalledWith({ @@ -89,44 +86,36 @@ describe('useCaseItems', () => { it('should return parsed items', async () => { mockCasesApi.mockReturnValue(mockCasesResult); + const { result, waitForNextUpdate } = renderUseCaseItems(); - await act(async () => { - const { result, waitForNextUpdate } = renderUseCaseItems(); + await waitForNextUpdate(); - await waitForNextUpdate(); - await waitForNextUpdate(); - - expect(result.current).toEqual({ - items: parsedCasesItems, - isLoading: false, - updatedAt: dateNow, - }); + expect(result.current).toEqual({ + items: parsedCasesItems, + isLoading: false, + updatedAt: dateNow, }); }); test('it should call setQuery when fetching', async () => { mockCasesApi.mockReturnValue(mockCasesResult); - await act(async () => { - const { waitForNextUpdate } = renderUseCaseItems(); + const { waitForNextUpdate } = renderUseCaseItems(); - await waitForNextUpdate(); - await waitForNextUpdate(); + await waitForNextUpdate(); - expect(mockSetQuery).toHaveBeenCalled(); - }); + expect(mockSetQuery).toHaveBeenCalled(); }); test('it should call deleteQuery when unmounting', async () => { - await act(async () => { - const { waitForNextUpdate, unmount } = renderUseCaseItems(); + const { waitForNextUpdate, unmount } = renderUseCaseItems(); - await waitForNextUpdate(); - await waitForNextUpdate(); + await waitForNextUpdate(); + act(() => { unmount(); - - expect(mockDeleteQuery).toHaveBeenCalled(); }); + + expect(mockDeleteQuery).toHaveBeenCalled(); }); it('should return new updatedAt', async () => { @@ -135,18 +124,15 @@ describe('useCaseItems', () => { mockDateNow.mockReturnValueOnce(dateNow); mockCasesApi.mockReturnValue(mockCasesResult); - await act(async () => { - const { result, waitForNextUpdate } = renderUseCaseItems(); + const { result, waitForNextUpdate } = renderUseCaseItems(); - await waitForNextUpdate(); - await waitForNextUpdate(); + await waitForNextUpdate(); - expect(mockDateNow).toHaveBeenCalled(); - expect(result.current).toEqual({ - items: parsedCasesItems, - isLoading: false, - updatedAt: newDateNow, - }); + expect(mockDateNow).toHaveBeenCalled(); + expect(result.current).toEqual({ + items: parsedCasesItems, + isLoading: false, + updatedAt: newDateNow, }); }); diff --git a/x-pack/plugins/security_solution/public/threat_intelligence/routes.tsx b/x-pack/plugins/security_solution/public/threat_intelligence/routes.tsx index a6189921665eb..167f2c8d67476 100644 --- a/x-pack/plugins/security_solution/public/threat_intelligence/routes.tsx +++ b/x-pack/plugins/security_solution/public/threat_intelligence/routes.tsx @@ -8,8 +8,9 @@ import React, { memo } from 'react'; import { Redirect } from 'react-router-dom'; import { TrackApplicationView } from '@kbn/usage-collection-plugin/public'; -import type { ThreatIntelligenceSecuritySolutionContext } from '@kbn/threat-intelligence-plugin/public'; +import type { SecuritySolutionPluginContext } from '@kbn/threat-intelligence-plugin/public'; import { THREAT_INTELLIGENCE_BASE_PATH } from '@kbn/threat-intelligence-plugin/public'; +import type { SourcererDataView } from '@kbn/threat-intelligence-plugin/public/types'; import { useKibana } from '../common/lib/kibana'; import { FiltersGlobal } from '../common/components/filters_global'; import { SpyRoute } from '../common/utils/route/spy_routes'; @@ -18,19 +19,23 @@ import { useIsExperimentalFeatureEnabled } from '../common/hooks/use_experimenta import { licenseService } from '../common/hooks/use_license'; import { SecurityPageName } from '../app/types'; import type { SecuritySubPluginRoutes } from '../app/types'; +import { useSourcererDataView } from '../common/containers/sourcerer'; const ThreatIntelligence = memo(() => { const { threatIntelligence } = useKibana().services; const ThreatIntelligencePlugin = threatIntelligence.getComponent(); + const sourcererDataView = useSourcererDataView(); + const enabled = useIsExperimentalFeatureEnabled('threatIntelligenceEnabled'); if (!enabled) { return ; } - const securitySolutionContext: ThreatIntelligenceSecuritySolutionContext = { + const securitySolutionContext: SecuritySolutionPluginContext = { getFiltersGlobalComponent: () => FiltersGlobal, licenseService, + sourcererDataView: sourcererDataView as unknown as SourcererDataView, }; return ( diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/helpers.ts b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/helpers.ts index 8c69ae2df30da..0d560b600ae34 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/helpers.ts +++ b/x-pack/plugins/security_solution/public/timelines/components/open_timeline/helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set/fp'; +import { set } from '@kbn/safer-lodash-set/fp'; import { getOr, isEmpty } from 'lodash/fp'; import type { Action } from 'typescript-fsa'; import uuid from 'uuid'; 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 d8c7c5e34c908..292dd5e1a44b9 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 @@ -38,7 +38,9 @@ jest.mock('../../containers', () => ({ useTimelineEvents: jest.fn(), })); -jest.mock('./tabs_content'); +jest.mock('./tabs_content', () => ({ + TabsContent: () =>
, +})); jest.mock('../../../common/lib/kibana'); const originalKibanaLib = jest.requireActual('../../../common/lib/kibana'); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/helpers.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/helpers.test.tsx index 76d3ceb240883..b7f9d74a9019c 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/helpers.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/helpers.test.tsx @@ -40,7 +40,7 @@ jest.mock('../../../../common/lib/kibana', () => ({ })); describe('NewTimeline', () => { - const mockGetButton = jest.fn(); + const mockGetButton = jest.fn().mockReturnValue('<>'); const props: NewTimelineProps = { closeGearMenu: jest.fn(), diff --git a/x-pack/plugins/security_solution/server/__mocks__/core.mock.ts b/x-pack/plugins/security_solution/server/__mocks__/core.mock.ts index 57feaedbc9487..1ae9b046dc636 100644 --- a/x-pack/plugins/security_solution/server/__mocks__/core.mock.ts +++ b/x-pack/plugins/security_solution/server/__mocks__/core.mock.ts @@ -8,8 +8,8 @@ // See: https://github.com/elastic/kibana/issues/117255, this creates mocks to avoid memory leaks from kibana core. // We _must_ import from the restricted path or we pull in _everything_ including memory leaks from Kibana core -import { SavedObjectsUtils } from '@kbn/core/server/saved_objects/service/lib/utils'; -import { SavedObjectsErrorHelpers } from '@kbn/core/server/saved_objects/service/lib/errors'; +import { SavedObjectsUtils, SavedObjectsErrorHelpers } from '@kbn/core-saved-objects-utils-server'; + module.exports = { SavedObjectsUtils, SavedObjectsErrorHelpers, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/__mocks__/es_results.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/__mocks__/es_results.ts index ebdf002986ffb..6c7d5d581ce61 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/__mocks__/es_results.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/__mocks__/es_results.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import type { SignalSourceHit, SignalSearchResponse, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/reason_formatter.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/reason_formatter.test.ts index 67deaec8e1d23..42c18e523f3d3 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/reason_formatter.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/reason_formatter.test.ts @@ -5,39 +5,50 @@ * 2.0. */ -import { buildReasonMessageUtil } from './reason_formatters'; -import type { SignalSourceHit } from './types'; +import { buildReasonMessageForThresholdAlert, buildReasonMessageUtil } from './reason_formatters'; + +const mergedDoc = { + _index: 'index-1', + _id: 'id-1', + fields: { + 'destination.address': ['9.99.99.9'], + 'destination.port': ['6789'], + 'event.category': ['test'], + 'file.name': ['sample'], + 'host.name': ['host'], + 'process.name': ['doingThings.exe'], + 'process.parent.name': ['didThings.exe'], + 'source.address': ['1.11.11.1'], + 'source.port': ['1234'], + 'user.name': ['test-user'], + '@timestamp': '2021-08-11T02:28:59.101Z', + }, +}; + +const genThresholdMergedDoc = (groupedKeys: Record) => ({ + _index: 'index-1', + _id: 'some-id', + _source: { + '@timestamp': '2022-08-16T11:01:09.848Z', + threshold_result: [Object], + ...groupedKeys, + }, +}); describe('reason_formatter', () => { - let name: string; + let ruleName: string; let severity: string; - let mergedDoc: SignalSourceHit; beforeAll(() => { - name = 'my-rule'; + ruleName = 'my-rule'; severity = 'medium'; - mergedDoc = { - _index: 'index-1', - _id: 'id-1', - fields: { - 'destination.address': ['9.99.99.9'], - 'destination.port': ['6789'], - 'event.category': ['test'], - 'file.name': ['sample'], - 'host.name': ['host'], - 'process.name': ['doingThings.exe'], - 'process.parent.name': ['didThings.exe'], - 'source.address': ['1.11.11.1'], - 'source.port': ['1234'], - 'user.name': ['test-user'], - '@timestamp': '2021-08-11T02:28:59.101Z', - }, - }; }); describe('buildReasonMessageUtil', () => { describe('when rule and mergedDoc are provided', () => { it('should return the full reason message', () => { - expect(buildReasonMessageUtil({ name, severity, mergedDoc })).toMatchInlineSnapshot( + expect( + buildReasonMessageUtil({ name: ruleName, severity, mergedDoc }) + ).toMatchInlineSnapshot( `"test event with process doingThings.exe, parent process didThings.exe, file sample, source 1.11.11.1:1234, destination 9.99.99.9:6789, by test-user on host created medium alert my-rule."` ); }); @@ -52,7 +63,7 @@ describe('reason_formatter', () => { }, }; expect( - buildReasonMessageUtil({ name, severity, mergedDoc: updatedMergedDoc }) + buildReasonMessageUtil({ name: ruleName, severity, mergedDoc: updatedMergedDoc }) ).toMatchInlineSnapshot( `"item one, item two event with process doingThings.exe, parent process didThings.exe, file sample, source 1.11.11.1:1234, destination 9.99.99.9:6789, by test-user on host created medium alert my-rule."` ); @@ -68,7 +79,7 @@ describe('reason_formatter', () => { }, }; expect( - buildReasonMessageUtil({ name, severity, mergedDoc: updatedMergedDoc }) + buildReasonMessageUtil({ name: ruleName, severity, mergedDoc: updatedMergedDoc }) ).toMatchInlineSnapshot( `"test event with process doingThings.exe, parent process didThings.exe, file sample, source 1.11.11.1:1234, destination 9.99.99.9:6789, by test-user created medium alert my-rule."` ); @@ -84,7 +95,7 @@ describe('reason_formatter', () => { }, }; expect( - buildReasonMessageUtil({ name, severity, mergedDoc: updatedMergedDoc }) + buildReasonMessageUtil({ name: ruleName, severity, mergedDoc: updatedMergedDoc }) ).toMatchInlineSnapshot( `"test event with process doingThings.exe, parent process didThings.exe, file sample, source 1.11.11.1:1234, destination 9.99.99.9:6789, on host created medium alert my-rule."` ); @@ -100,7 +111,7 @@ describe('reason_formatter', () => { }, }; expect( - buildReasonMessageUtil({ name, severity, mergedDoc: noDestinationPortDoc }) + buildReasonMessageUtil({ name: ruleName, severity, mergedDoc: noDestinationPortDoc }) ).toMatchInlineSnapshot( `"test event with process doingThings.exe, parent process didThings.exe, file sample, source 1.11.11.1:1234, destination 9.99.99.9 by test-user on host created medium alert my-rule."` ); @@ -115,7 +126,7 @@ describe('reason_formatter', () => { }, }; expect( - buildReasonMessageUtil({ name, severity, mergedDoc: noDestinationPortDoc }) + buildReasonMessageUtil({ name: ruleName, severity, mergedDoc: noDestinationPortDoc }) ).toMatchInlineSnapshot( `"test event with process doingThings.exe, parent process didThings.exe, file sample, source 1.11.11.1:1234, by test-user on host created medium alert my-rule."` ); @@ -131,7 +142,7 @@ describe('reason_formatter', () => { }, }; expect( - buildReasonMessageUtil({ name, severity, mergedDoc: noSourcePortDoc }) + buildReasonMessageUtil({ name: ruleName, severity, mergedDoc: noSourcePortDoc }) ).toMatchInlineSnapshot( `"test event with process doingThings.exe, parent process didThings.exe, file sample, source 1.11.11.1 destination 9.99.99.9:6789, by test-user on host created medium alert my-rule."` ); @@ -146,7 +157,7 @@ describe('reason_formatter', () => { }, }; expect( - buildReasonMessageUtil({ name, severity, mergedDoc: noSourcePortDoc }) + buildReasonMessageUtil({ name: ruleName, severity, mergedDoc: noSourcePortDoc }) ).toMatchInlineSnapshot( `"test event with process doingThings.exe, parent process didThings.exe, file sample, destination 9.99.99.9:6789, by test-user on host created medium alert my-rule."` ); @@ -163,7 +174,7 @@ describe('reason_formatter', () => { }, }; expect( - buildReasonMessageUtil({ name, severity, mergedDoc: updatedMergedDoc }) + buildReasonMessageUtil({ name: ruleName, severity, mergedDoc: updatedMergedDoc }) ).toMatchInlineSnapshot( `"test event with file sample, source 1.11.11.1:1234, destination 9.99.99.9:6789, by test-user on host created medium alert my-rule."` ); @@ -180,14 +191,61 @@ describe('reason_formatter', () => { }, }; expect( - buildReasonMessageUtil({ name, severity, mergedDoc: updatedMergedDoc }) + buildReasonMessageUtil({ name: ruleName, severity, mergedDoc: updatedMergedDoc }) ).toMatchInlineSnapshot(`"test event by test-user created medium alert my-rule."`); }); }); describe('when only rule is provided', () => { it('should return the reason message without host name or user name', () => { - expect(buildReasonMessageUtil({ name, severity })).toMatchInlineSnapshot(`""`); + expect(buildReasonMessageUtil({ name: ruleName, severity })).toMatchInlineSnapshot(`""`); + }); + }); + }); + + describe(`buildReasonMessageForThresholdAlert`, () => { + it('When thresold rule is grouped by user.name', () => { + const userName = 'Some User Name'; + const thresholdMergedDoc = genThresholdMergedDoc({ + 'user.name': userName, + }); + expect( + buildReasonMessageForThresholdAlert({ + name: ruleName, + severity, + mergedDoc: thresholdMergedDoc, + }) + ).toEqual(`event by ${userName} created ${severity} alert ${ruleName}.`); + }); + + it('When threshold rule is grouped by host.name', () => { + const hostName = 'Some Host Name'; + const thresholdMergedDoc = genThresholdMergedDoc({ + 'host.name': hostName, }); + + expect( + buildReasonMessageForThresholdAlert({ + name: ruleName, + severity, + mergedDoc: thresholdMergedDoc, + }) + ).toEqual(`event on ${hostName} created ${severity} alert ${ruleName}.`); + }); + it('When threshold rule is grouped by host.name and user.name', () => { + const hostName = 'Some Host Name'; + const userName = 'Some User Name'; + const thresholdMergedDoc = genThresholdMergedDoc({ + 'host.name': hostName, + 'user.name': userName, + }); + + expect( + buildReasonMessageForThresholdAlert({ + name: ruleName, + severity, + mergedDoc: thresholdMergedDoc, + }) + ).toEqual(`event by ${userName} on ${hostName} created ${severity} alert ${ruleName}.`); }); }); }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/reason_formatters.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/reason_formatters.ts index 0b9148d995c74..88aa69186e58a 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/reason_formatters.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/reason_formatters.ts @@ -35,7 +35,7 @@ interface ReasonFields { } const getFieldsFromDoc = (mergedDoc: SignalSourceHit) => { const reasonFields: ReasonFields = {}; - const docToUse = mergedDoc?.fields || mergedDoc; + const docToUse = mergedDoc?.fields || mergedDoc?._source || mergedDoc; reasonFields.destinationAddress = getOr(null, 'destination.address', docToUse); reasonFields.destinationPort = getOr(null, 'destination.port', docToUse); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_all_fields_with_source.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_all_fields_with_source.ts index f4851e77f2048..e3c7f8f5ee50e 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_all_fields_with_source.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_all_fields_with_source.ts @@ -6,7 +6,7 @@ */ import { get } from 'lodash/fp'; -import { set } from '@elastic/safer-lodash-set/fp'; +import { set } from '@kbn/safer-lodash-set/fp'; import type { SignalSource } from '../../types'; import { filterFieldEntries } from '../utils/filter_field_entries'; import type { FieldsType, MergeStrategyFunction } from '../types'; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_missing_fields_with_source.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_missing_fields_with_source.test.ts index a5c811bc1a5c1..f5863533ea283 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_missing_fields_with_source.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_missing_fields_with_source.test.ts @@ -370,9 +370,9 @@ describe('merge_missing_fields_with_source', () => { /** * tests for https://github.com/elastic/kibana/issues/135963 * This test will fail when we replace the import - * import { set } from '@elastic/safer-lodash-set'; + * import { set } from '@kbn/safer-lodash-set'; * to use the fp version - * import { set } from '@elastic/safer-lodash-set/fp'; + * import { set } from '@kbn/safer-lodash-set/fp'; * and switch around the return inside of filteredEntries.reduce * to be the following: * return set(fieldsKey, valueToMerge, merged); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_missing_fields_with_source.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_missing_fields_with_source.ts index 89695f6b562b0..c20f6b55301bd 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_missing_fields_with_source.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/strategies/merge_missing_fields_with_source.ts @@ -6,7 +6,7 @@ */ import { get } from 'lodash/fp'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import type { SignalSource } from '../../types'; import { filterFieldEntries } from '../utils/filter_field_entries'; import type { FieldsType, MergeStrategyFunction } from '../types'; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/recursive_unboxing_fields.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/recursive_unboxing_fields.ts index cc5096825951f..8bb490c2d62df 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/recursive_unboxing_fields.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/source_fields_merging/utils/recursive_unboxing_fields.ts @@ -6,7 +6,7 @@ */ import { get } from 'lodash/fp'; -import { set } from '@elastic/safer-lodash-set/fp'; +import { set } from '@kbn/safer-lodash-set/fp'; import type { SearchTypes } from '../../../../../../common/detection_engine/types'; import type { FieldsType } from '../types'; diff --git a/x-pack/plugins/security_solution/server/lib/timeline/utils/common.ts b/x-pack/plugins/security_solution/server/lib/timeline/utils/common.ts index 0d5cf7684f02b..97b6ec743d109 100644 --- a/x-pack/plugins/security_solution/server/lib/timeline/utils/common.ts +++ b/x-pack/plugins/security_solution/server/lib/timeline/utils/common.ts @@ -5,7 +5,7 @@ * 2.0. */ import type * as rt from 'io-ts'; -import { set } from '@elastic/safer-lodash-set/fp'; +import { set } from '@kbn/safer-lodash-set/fp'; import readline from 'readline'; import fs from 'fs'; import type { Readable } from 'stream'; diff --git a/x-pack/plugins/security_solution/server/lib/timeline/utils/migrator.ts b/x-pack/plugins/security_solution/server/lib/timeline/utils/migrator.ts index c97f7053a5098..fa9c9250e2190 100644 --- a/x-pack/plugins/security_solution/server/lib/timeline/utils/migrator.ts +++ b/x-pack/plugins/security_solution/server/lib/timeline/utils/migrator.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import _ from 'lodash'; import type { SavedObject, diff --git a/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/base_validator.test.ts b/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/base_validator.test.ts index d149b8c0fd7ba..a1918b628c1d4 100644 --- a/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/base_validator.test.ts +++ b/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/base_validator.test.ts @@ -144,12 +144,7 @@ describe('When using Artifacts Exceptions BaseValidator', () => { }); it('should throw if policy ids for by policy artifacts are not valid', async () => { - packagePolicyService.getByIDs.mockResolvedValue([ - { - id: '123', - version: undefined, - } as PackagePolicy, - ]); + packagePolicyService.getByIDs.mockResolvedValue([]); await expect(initValidator()._validateByPolicyItem(exceptionLikeItem)).rejects.toBeInstanceOf( EndpointArtifactExceptionValidationError diff --git a/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/base_validator.ts b/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/base_validator.ts index 04a7d5a09875b..872d8da7cdb3d 100644 --- a/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/base_validator.ts +++ b/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/base_validator.ts @@ -131,7 +131,9 @@ export class BaseValidator { return; } - const policiesFromFleet = await packagePolicy.getByIDs(internalReadonlySoClient, policyIds); + const policiesFromFleet = await packagePolicy.getByIDs(internalReadonlySoClient, policyIds, { + ignoreMissing: true, + }); if (!policiesFromFleet) { throw new EndpointArtifactExceptionValidationError( @@ -139,9 +141,9 @@ export class BaseValidator { ); } - const invalidPolicyIds = policiesFromFleet - .filter((policy) => policy.version === undefined) - .map((policy) => policy.id); + const invalidPolicyIds = policyIds.filter( + (policyId) => !policiesFromFleet.some((policy) => policyId === policy.id) + ); if (invalidPolicyIds.length) { throw new EndpointArtifactExceptionValidationError( diff --git a/x-pack/plugins/security_solution/server/search_strategy/helpers/format_response_object_values.ts b/x-pack/plugins/security_solution/server/search_strategy/helpers/format_response_object_values.ts index a20e5aba9fda1..f44ad77e67929 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/helpers/format_response_object_values.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/helpers/format_response_object_values.ts @@ -6,7 +6,7 @@ */ import { mapValues, isObject, isArray } from 'lodash/fp'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { toArray } from '../../../common/utils/to_array'; import { isGeoField } from '../../../common/utils/field_formatters'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/helpers/get_flattened_fields.ts b/x-pack/plugins/security_solution/server/search_strategy/helpers/get_flattened_fields.ts index d0a9991f866db..f40edfc5914df 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/helpers/get_flattened_fields.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/helpers/get_flattened_fields.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { get, isEmpty } from 'lodash/fp'; import { toObjectArrayOfStrings } from '../../../common/utils/to_array'; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/helpers.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/helpers.ts index 3e92a733d12bd..93ce3a15009b7 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/helpers.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set/fp'; +import { set } from '@kbn/safer-lodash-set/fp'; import { get, has } from 'lodash/fp'; import { hostFieldsMap } from '../../../../../../common/ecs/ecs_fields'; import type { diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/helpers.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/helpers.ts index 3f2a052ffc1b1..0c1ef643e663f 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/helpers.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set/fp'; +import { set } from '@kbn/safer-lodash-set/fp'; import { get, has, head } from 'lodash/fp'; import type { IScopedClusterClient, diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/helpers.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/helpers.ts index 15d1b3029a96d..3cae17446439f 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/helpers.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/helpers.ts @@ -6,7 +6,7 @@ */ import { get } from 'lodash/fp'; -import { set } from '@elastic/safer-lodash-set/fp'; +import { set } from '@kbn/safer-lodash-set/fp'; import type { ProcessHits, diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/helpers.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/helpers.ts index 60cd570478488..53623d44205b3 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/helpers.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/helpers.ts @@ -6,7 +6,7 @@ */ import { get, getOr, isEmpty } from 'lodash/fp'; -import { set } from '@elastic/safer-lodash-set/fp'; +import { set } from '@kbn/safer-lodash-set/fp'; import { toObjectArrayOfStrings } from '../../../../../../common/utils/to_array'; import { sourceFieldsMap, hostFieldsMap } from '../../../../../../common/ecs/ecs_fields'; import type { diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/details/helpers.ts b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/details/helpers.ts index cf18f08476fcd..f6c9f1d194215 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/details/helpers.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/details/helpers.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { set } from '@elastic/safer-lodash-set/fp'; +import { set } from '@kbn/safer-lodash-set/fp'; import { get, has } from 'lodash/fp'; import type { UserAggEsItem, diff --git a/x-pack/plugins/session_view/public/components/session_view/hooks.ts b/x-pack/plugins/session_view/public/components/session_view/hooks.ts index 2d24305cc02d7..06a1e0125aea1 100644 --- a/x-pack/plugins/session_view/public/components/session_view/hooks.ts +++ b/x-pack/plugins/session_view/public/components/session_view/hooks.ts @@ -5,7 +5,7 @@ * 2.0. */ import { useEffect, useState, useMemo } from 'react'; -import { useQuery, useInfiniteQuery } from 'react-query'; +import { useQuery, useInfiniteQuery } from '@tanstack/react-query'; import { EuiSearchBarOnChangeArgs } from '@elastic/eui'; import { CoreStart } from '@kbn/core/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; diff --git a/x-pack/plugins/session_view/public/components/session_view/index.test.tsx b/x-pack/plugins/session_view/public/components/session_view/index.test.tsx index 26b5d9c3cc7f9..215fa55747098 100644 --- a/x-pack/plugins/session_view/public/components/session_view/index.test.tsx +++ b/x-pack/plugins/session_view/public/components/session_view/index.test.tsx @@ -23,8 +23,6 @@ describe('SessionView component', () => { let mockedContext: AppContextTestRender; let mockedApi: AppContextTestRender['coreStart']['http']['get']; - const waitForApiCall = () => waitFor(() => expect(mockedApi).toHaveBeenCalled()); - beforeEach(() => { mockedContext = createAppRootMockRenderer(); mockedApi = mockedContext.coreStart.http.get; @@ -47,10 +45,11 @@ describe('SessionView component', () => { // make the request wait mockedApi.mockReturnValue(new Promise((resolve) => (releaseApiResponse = resolve))); render(); - await waitForApiCall(); // see if loader is present - expect(renderResult.getByTestId('sectionLoading')).toBeTruthy(); + await waitFor(() => { + expect(renderResult.getByTestId('sectionLoading')).toBeTruthy(); + }); // release the request releaseApiResponse!(mockedApi); @@ -61,13 +60,15 @@ describe('SessionView component', () => { it('should show the Empty message', async () => { render(); - await waitForApiCall(); - expect(renderResult.getByTestId('sessionView:sessionViewProcessEventsEmpty')).toBeTruthy(); + await waitFor(() => { + expect( + renderResult.getByTestId('sessionView:sessionViewProcessEventsEmpty') + ).toBeTruthy(); + }); }); it('should not display the search bar', async () => { render(); - await waitForApiCall(); expect( renderResult.queryByTestId('sessionView:sessionViewProcessEventsSearch') ).toBeFalsy(); @@ -85,10 +86,11 @@ describe('SessionView component', () => { // make the request wait mockedApi.mockReturnValue(new Promise((resolve) => (releaseApiResponse = resolve))); render(); - await waitForApiCall(); // see if loader is present - expect(renderResult.getByTestId('sectionLoading')).toBeTruthy(); + await waitFor(() => { + expect(renderResult.getByTestId('sectionLoading')).toBeTruthy(); + }); // release the request releaseApiResponse!(mockedApi); @@ -99,20 +101,28 @@ describe('SessionView component', () => { it('should display the search bar', async () => { render(); - await waitForApiCall(); - expect(renderResult.getByTestId('sessionView:sessionViewProcessEventsSearch')).toBeTruthy(); + + await waitFor(() => { + expect( + renderResult.getByTestId('sessionView:sessionViewProcessEventsSearch') + ).toBeTruthy(); + }); }); it('should show items on the list, and auto selects session leader', async () => { render(); - await waitForApiCall(); - expect(renderResult.getAllByTestId('sessionView:processTreeNode')).toBeTruthy(); + await waitFor(() => { + expect(renderResult.getAllByTestId('sessionView:processTreeNode')).toBeTruthy(); + }); }); it('should toggle detail panel visibilty when detail button clicked', async () => { render(); - await waitForApiCall(); + + await waitFor(() => { + expect(renderResult.getByTestId('sessionView:sessionViewDetailPanelToggle')).toBeTruthy(); + }); userEvent.click(renderResult.getByTestId('sessionView:sessionViewDetailPanelToggle')); expect(renderResult.getByText('Process')).toBeTruthy(); @@ -122,7 +132,11 @@ describe('SessionView component', () => { it('should render session view options button and its options when clicked', async () => { render(); - await waitForApiCall(); + + await waitFor(() => { + expect(renderResult.getByTestId('sessionView:sessionViewOptionButton')).toBeTruthy(); + }); + userEvent.click(renderResult.getByTestId('sessionView:sessionViewOptionButton')); expect(renderResult.getByText('Display options')).toBeTruthy(); expect(renderResult.getByText('Timestamp')).toBeTruthy(); @@ -131,9 +145,10 @@ describe('SessionView component', () => { it('should show refresh button', async () => { render(); - await waitForApiCall(); - expect(renderResult.getAllByTestId('sessionView:sessionViewRefreshButton')).toBeTruthy(); + await waitFor(() => { + expect(renderResult.getAllByTestId('sessionView:sessionViewRefreshButton')).toBeTruthy(); + }); }); }); @@ -150,9 +165,10 @@ describe('SessionView component', () => { }); render(); - await waitForApiCall(); - expect(renderResult.queryByTestId('sessionView:TTYPlayerToggle')).toBeTruthy(); + await waitFor(() => { + expect(renderResult.queryByTestId('sessionView:TTYPlayerToggle')).toBeTruthy(); + }); }); it('should NOT show tty player button, if session has no output', async () => { @@ -171,9 +187,10 @@ describe('SessionView component', () => { }); render(); - await waitForApiCall(); - expect(renderResult.queryByTestId('sessionView:TTYPlayerToggle')).toBeFalsy(); + await waitFor(() => { + expect(renderResult.queryByTestId('sessionView:TTYPlayerToggle')).toBeFalsy(); + }); }); }); }); diff --git a/x-pack/plugins/session_view/public/components/tty_player/hooks.ts b/x-pack/plugins/session_view/public/components/tty_player/hooks.ts index a37f8899d0ed4..e122a2dbd0c11 100644 --- a/x-pack/plugins/session_view/public/components/tty_player/hooks.ts +++ b/x-pack/plugins/session_view/public/components/tty_player/hooks.ts @@ -8,7 +8,7 @@ import { Terminal } from 'xterm'; import 'xterm/css/xterm.css'; import { FitAddon } from 'xterm-addon-fit'; import { useMemo, useState, useEffect, useCallback } from 'react'; -import { useInfiniteQuery } from 'react-query'; +import { useInfiniteQuery } from '@tanstack/react-query'; import { CoreStart } from '@kbn/core/public'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { SearchAddon } from './xterm_search'; diff --git a/x-pack/plugins/session_view/public/methods/index.tsx b/x-pack/plugins/session_view/public/methods/index.tsx index 3654e296e7412..b8a581ea3ba95 100644 --- a/x-pack/plugins/session_view/public/methods/index.tsx +++ b/x-pack/plugins/session_view/public/methods/index.tsx @@ -7,7 +7,7 @@ import React, { lazy, Suspense } from 'react'; import { EuiLoadingSpinner } from '@elastic/eui'; -import { QueryClient, QueryClientProvider } from 'react-query'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { SessionViewDeps } from '../types'; // Initializing react-query diff --git a/x-pack/plugins/session_view/public/test/index.tsx b/x-pack/plugins/session_view/public/test/index.tsx index 6174925b6003c..244560d366ac4 100644 --- a/x-pack/plugins/session_view/public/test/index.tsx +++ b/x-pack/plugins/session_view/public/test/index.tsx @@ -8,7 +8,7 @@ import React, { memo, ReactNode, useMemo } from 'react'; import { createMemoryHistory, MemoryHistory } from 'history'; import { render as reactRender, RenderOptions, RenderResult } from '@testing-library/react'; -import { QueryClient, QueryClientProvider, setLogger } from 'react-query'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { Router } from 'react-router-dom'; import { History } from 'history'; import useObservable from 'react-use/lib/useObservable'; @@ -20,15 +20,6 @@ import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common'; type UiRender = (ui: React.ReactElement, options?: RenderOptions) => RenderResult; -// hide react-query output in console -setLogger({ - error: () => {}, - // eslint-disable-next-line no-console - log: console.log, - // eslint-disable-next-line no-console - warn: console.warn, -}); - /** * Mocked app root context renderer */ @@ -113,6 +104,14 @@ export const createAppRootMockRenderer = (): AppContextTestRender => { cacheTime: Infinity, }, }, + // hide react-query output in console + logger: { + error: () => {}, + // eslint-disable-next-line no-console + log: console.log, + // eslint-disable-next-line no-console + warn: console.warn, + }, }); const AppWrapper: React.FC<{ children: React.ReactElement }> = ({ children }) => ( diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_details_link.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_details_link.tsx index c17112ce68aa9..8a92811b9b5c8 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_details_link.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_details_link.tsx @@ -13,6 +13,7 @@ import { ConfigKey, EncryptedSyntheticsSavedMonitor, } from '../../../../../../../common/runtime_types'; +import { useMonitorDetailLocator } from '../../hooks/use_monitor_detail_locator'; export const MonitorDetailsLink = ({ basePath, @@ -30,13 +31,11 @@ export const MonitorDetailsLink = ({ const locationId = lastSelectedLocationId && monitorHasLocation ? lastSelectedLocationId : firstMonitorLocationId; - const locationUrlQueryParam = locationId ? `?locationId=${locationId}` : ''; + const monitorDetailLinkUrl = useMonitorDetailLocator({ monitorId: monitor.id, locationId }); return ( <> - - {monitor.name} - + {monitor.name} ); }; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/actions_popover.test.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/actions_popover.test.tsx new file mode 100644 index 0000000000000..af6799068c278 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/actions_popover.test.tsx @@ -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 React from 'react'; +import { fireEvent } from '@testing-library/react'; +import { render } from '../../../../utils/testing/rtl_helpers'; +import { ActionsPopover } from './actions_popover'; +import * as editMonitorLocatorModule from '../../hooks/use_edit_monitor_locator'; +import * as monitorDetailLocatorModule from '../../hooks/use_monitor_detail_locator'; +import * as monitorEnableHandlerModule from '../../../../hooks/use_monitor_enable_handler'; +import { FETCH_STATUS } from '@kbn/observability-plugin/public'; +import { MonitorOverviewItem } from '../types'; + +describe('ActionsPopover', () => { + let testMonitor: MonitorOverviewItem; + + beforeEach(() => { + testMonitor = { + location: { + id: 'us_central', + isServiceManaged: true, + }, + isEnabled: true, + name: 'Monitor 1', + id: 'somelongstring', + }; + }); + + afterEach(() => { + jest.restoreAllMocks(); + }); + + it('renders the popover button', () => { + const { queryByText, getByLabelText } = render( + + ); + expect(getByLabelText('Open actions menu')); + expect(queryByText('Actions')).not.toBeInTheDocument(); + }); + + it('opens the popover on click', async () => { + const setIsPopoverOpen = jest.fn(); + const isPopoverOpen = false; + const { getByLabelText } = render( + + ); + const popoverButton = getByLabelText('Open actions menu'); + fireEvent.click(popoverButton); + expect(setIsPopoverOpen).toHaveBeenCalled(); + // the popover passes back a function that accepts a bool and returns the inverse, + // so we're calling it here just to make sure the behavior is correct + expect(setIsPopoverOpen.mock.calls[0][0](isPopoverOpen)).toBe(true); + }); + + it('closes the popover on subsequent click', async () => { + const setIsPopoverOpen = jest.fn(); + const isPopoverOpen = true; + const { getByLabelText } = render( + + ); + const popoverButton = getByLabelText('Open actions menu'); + fireEvent.click(popoverButton); + expect(setIsPopoverOpen).toHaveBeenCalled(); + // the popover passes back a function that accepts a bool and returns the inverse, + // so we're calling it here just to make sure the behavior is correct + expect(setIsPopoverOpen.mock.calls[0][0](isPopoverOpen)).toBe(false); + }); + + it('contains link to edit page', async () => { + jest + .spyOn(editMonitorLocatorModule, 'useEditMonitorLocator') + .mockReturnValue('/a/test/edit/url'); + const { getByRole } = render( + + ); + expect(getByRole('link')?.getAttribute('href')).toBe('/a/test/edit/url'); + }); + + it('contains link to detail page', async () => { + jest + .spyOn(monitorDetailLocatorModule, 'useMonitorDetailLocator') + .mockReturnValue('/a/test/detail/url'); + const { getByRole } = render( + + ); + expect(getByRole('link')?.getAttribute('href')).toBe('/a/test/detail/url'); + }); + + it('sets the enabled state', async () => { + const updateMonitorEnabledState = jest.fn(); + jest.spyOn(monitorEnableHandlerModule, 'useMonitorEnableHandler').mockReturnValue({ + status: FETCH_STATUS.SUCCESS, + isEnabled: true, + updateMonitorEnabledState, + }); + const { getByText } = render( + + ); + const enableButton = getByText('Disable monitor'); + fireEvent.click(enableButton); + expect(updateMonitorEnabledState).toHaveBeenCalledTimes(1); + expect(updateMonitorEnabledState.mock.calls[0]).toEqual([ + { + id: 'somelongstring', + isEnabled: true, + location: { id: 'us_central', isServiceManaged: true }, + name: 'Monitor 1', + }, + false, + ]); + }); + + it('sets enabled state to true', async () => { + const updateMonitorEnabledState = jest.fn(); + jest.spyOn(monitorEnableHandlerModule, 'useMonitorEnableHandler').mockReturnValue({ + status: FETCH_STATUS.PENDING, + isEnabled: null, + updateMonitorEnabledState, + }); + const { getByText } = render( + + ); + const enableButton = getByText('Enable monitor'); + fireEvent.click(enableButton); + expect(updateMonitorEnabledState).toHaveBeenCalledTimes(1); + expect(updateMonitorEnabledState.mock.calls[0]).toEqual([ + { + id: 'somelongstring', + isEnabled: false, + location: { id: 'us_central', isServiceManaged: true }, + name: 'Monitor 1', + }, + true, + ]); + }); +}); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/actions_popover.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/actions_popover.tsx new file mode 100644 index 0000000000000..932c6344c4716 --- /dev/null +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/actions_popover.tsx @@ -0,0 +1,220 @@ +/* + * Copyright 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 { EuiPopover, EuiButtonIcon, EuiContextMenu, useEuiShadow } from '@elastic/eui'; +import { FETCH_STATUS } from '@kbn/observability-plugin/public'; +import { useTheme } from '@kbn/observability-plugin/public'; +import React, { useCallback, useEffect, useMemo, useState } from 'react'; +import { useDispatch, useSelector } from 'react-redux'; +import styled from 'styled-components'; +import { MonitorOverviewItem } from '../../../../../../../common/runtime_types'; +import { useMonitorEnableHandler } from '../../../../hooks/use_monitor_enable_handler'; +import { quietFetchOverviewAction } from '../../../../state/overview/actions'; +import { selectOverviewState } from '../../../../state/overview/selectors'; +import { useEditMonitorLocator } from '../../hooks/use_edit_monitor_locator'; +import { useMonitorDetailLocator } from '../../hooks/use_monitor_detail_locator'; + +interface ActionContainerProps { + boxShadow: string; +} + +const ActionContainer = styled.div` + // position + display: inline-block; + position: relative; + bottom: 42px; + left: 12px; + z-index: 1; + + // style + border-radius: ${({ theme }) => theme.eui.euiBorderRadius}; + ${({ boxShadow }) => boxShadow} +`; + +export function ActionsPopover({ + isPopoverOpen, + setIsPopoverOpen, + monitor, +}: { + isPopoverOpen: boolean; + monitor: MonitorOverviewItem; + setIsPopoverOpen: React.Dispatch>; +}) { + const theme = useTheme(); + const euiShadow = useEuiShadow('l'); + const dispatch = useDispatch(); + const { pageState } = useSelector(selectOverviewState); + + const detailUrl = useMonitorDetailLocator({ + monitorId: monitor.id, + locationId: monitor.location.id, + }); + const editUrl = useEditMonitorLocator({ monitorId: monitor.id }); + + const labels = useMemo( + () => ({ + enabledSuccessLabel: enabledSuccessLabel(monitor.name), + disabledSuccessLabel: disabledSuccessLabel(monitor.name), + failureLabel: enabledFailLabel(monitor.name), + }), + [monitor.name] + ); + const { status, isEnabled, updateMonitorEnabledState } = useMonitorEnableHandler({ + id: monitor.id, + reloadPage: useCallback(() => { + dispatch(quietFetchOverviewAction.get(pageState)); + setIsPopoverOpen(false); + }, [dispatch, pageState, setIsPopoverOpen]), + labels, + }); + + const [enableLabel, setEnableLabel] = useState( + monitor.isEnabled ? disableMonitorLabel : enableMonitorLabel + ); + + useEffect(() => { + if (status === FETCH_STATUS.LOADING) { + setEnableLabel(enableLabelLoading); + } else if (status === FETCH_STATUS.SUCCESS) { + setEnableLabel(isEnabled ? disableMonitorLabel : enableMonitorLabel); + } + }, [setEnableLabel, status, isEnabled, monitor.isEnabled]); + + return ( + + setIsPopoverOpen((b: boolean) => !b)} + /> + } + color="lightestShade" + isOpen={isPopoverOpen} + closePopover={() => setIsPopoverOpen(false)} + anchorPosition="rightUp" + panelPaddingSize="none" + > + { + if (status !== FETCH_STATUS.LOADING) + updateMonitorEnabledState(monitor, !monitor.isEnabled); + }, + }, + ], + }, + ]} + /> + + + ); +} + +const openActionsMenuAria = i18n.translate( + 'xpack.synthetics.overview.actions.openPopover.ariaLabel', + { + defaultMessage: 'Open actions menu', + } +); + +const actionsMenuTitle = i18n.translate('xpack.synthetics.overview.actions.menu.title', { + defaultMessage: 'Actions', + description: 'This is the text in the heading of a menu containing a set of actions', +}); + +const actionsMenuGoToMonitorName = i18n.translate( + 'xpack.synthetics.overview.actions.goToMonitor.name', + { + defaultMessage: 'Go to monitor', + description: + 'This is the text for a menu item that will take the user to the monitor detail page', + } +); + +const actionsMenuEditMonitorName = i18n.translate( + 'xpack.synthetics.overview.actions.editMonitor.name', + { + defaultMessage: 'Edit monitor', + description: + 'This is the text for a menu item that will take the user to the monitor edit page', + } +); + +const enableLabelLoading = i18n.translate('xpack.synthetics.overview.actions.enableLabel', { + defaultMessage: 'Loading...', +}); + +const enableMonitorLabel = i18n.translate( + 'xpack.synthetics.overview.actions.enableLabelEnableMonitor', + { + defaultMessage: 'Enable monitor', + } +); + +const disableMonitorLabel = i18n.translate( + 'xpack.synthetics.overview.actions.enableLabelDisableMonitor', + { + defaultMessage: 'Disable monitor', + } +); + +const enabledSuccessLabel = (name: string) => + i18n.translate('xpack.synthetics.overview.actions.enabledSuccessLabel', { + defaultMessage: 'Monitor "{name}" enabled successfully', + values: { name }, + }); + +export const disabledSuccessLabel = (name: string) => + i18n.translate('xpack.synthetics.overview.actions.disabledSuccessLabel', { + defaultMessage: 'Monitor "{name}" disabled successfully.', + values: { name }, + }); + +export const enabledFailLabel = (name: string) => + i18n.translate('xpack.synthetics.overview.actions.enabledFailLabel', { + defaultMessage: 'Unable to update monitor "{name}".', + values: { name }, + }); diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item.tsx index 3348f529fe799..755777bad04ea 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item.tsx @@ -4,15 +4,16 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import React from 'react'; import { i18n } from '@kbn/i18n'; +import React, { useState } from 'react'; import { Chart, Settings, Metric, MetricTrendShape } from '@elastic/charts'; import { EuiPanel, EuiLoadingChart } from '@elastic/eui'; import { DARK_THEME } from '@elastic/charts'; import { useTheme } from '@kbn/observability-plugin/public'; import { useLocationName, useStatusByLocation } from '../../../../hooks'; import { formatDuration } from '../../../../utils/formatting'; -import { Ping } from '../../../../../../../common/runtime_types'; +import { MonitorOverviewItem, Ping } from '../../../../../../../common/runtime_types'; +import { ActionsPopover } from './actions_popover'; export const getColor = (theme: ReturnType, isEnabled: boolean, ping?: Ping) => { if (!isEnabled) { @@ -24,24 +25,20 @@ export const getColor = (theme: ReturnType, isEnabled: boolean, }; export const MetricItem = ({ - monitorId, - locationId, - monitorName, - isMonitorEnabled, + monitor, averageDuration, data, loaded, }: { - monitorId: string; - locationId: string; - monitorName: string; - isMonitorEnabled: boolean; + monitor: MonitorOverviewItem; data: Array<{ x: number; y: number }>; averageDuration: number; loaded: boolean; }) => { - const locationName = useLocationName({ locationId }); - const { locations } = useStatusByLocation(monitorId); + const [isMouseOver, setIsMouseOver] = useState(false); + const [isPopoverOpen, setIsPopoverOpen] = useState(false); + const locationName = useLocationName({ locationId: monitor.location?.id }); + const { locations } = useStatusByLocation(monitor.id); const ping = locations.find((loc) => loc.observer?.geo?.name === locationName); const theme = useTheme(); @@ -53,6 +50,16 @@ export const MetricItem = ({ > {loaded ? ( { + if (!isMouseOver) { + setIsMouseOver(true); + } + }} + onMouseLeave={() => { + if (isMouseOver) { + setIsMouseOver(false); + } + }} style={{ padding: '0px', height: '100%', @@ -62,11 +69,11 @@ export const MetricItem = ({ ), valueFormatter: (d: number) => formatDuration(d), - color: getColor(theme, isMonitorEnabled, ping), + color: getColor(theme, monitor.isEnabled, ping), }, ], ]} /> + {(isMouseOver || isPopoverOpen) && ( + + )} ) : ( diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid.tsx index 24059c6e90330..898e68ba84001 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid.tsx @@ -40,12 +40,7 @@ export const OverviewGrid = () => { key={`${monitor.id}-${monitor.location?.id}`} data-test-subj="syntheticsOverviewGridItem" > - + ))} diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid_item.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid_item.tsx index b11534b096f91..d9141c5cbeb85 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid_item.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid_item.tsx @@ -7,28 +7,14 @@ import React from 'react'; import { MetricItem } from './metric_item'; import { useLast50DurationChart } from '../../../../hooks'; +import { MonitorOverviewItem } from '../../../../../../../common/runtime_types'; -export const OverviewGridItem = ({ - monitorId, - monitorName, - locationId, - isMonitorEnabled, -}: { - monitorId: string; - monitorName: string; - locationId: string; - isMonitorEnabled: boolean; -}) => { - const { data, loading, averageDuration } = useLast50DurationChart({ locationId, monitorId }); +export const OverviewGridItem = ({ monitor }: { monitor: MonitorOverviewItem }) => { + const { data, loading, averageDuration } = useLast50DurationChart({ + locationId: monitor.location?.id, + monitorId: monitor.id, + }); return ( - + ); }; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_last_50_duration_chart.ts b/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_last_50_duration_chart.ts index 6bfd3616e8654..a543c146ec82b 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_last_50_duration_chart.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_last_50_duration_chart.ts @@ -37,7 +37,7 @@ export function useLast50DurationChart({ const coords = hits .reverse() // results are returned in desc order by timestamp. Reverse to ensure the data is in asc order by timestamp .map((hit, index) => { - const duration = hit['monitor.duration.us']?.[0]; + const duration = hit?.['monitor.duration.us']?.[0]; totalDuration += duration || 0; if (duration === undefined) { return null; diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_monitor_enable_handler.tsx b/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_monitor_enable_handler.tsx index e1703654f8538..6fed27f2df6b5 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_monitor_enable_handler.tsx +++ b/x-pack/plugins/synthetics/public/apps/synthetics/hooks/use_monitor_enable_handler.tsx @@ -9,7 +9,11 @@ import { useKibana } from '@kbn/kibana-react-plugin/public'; import { FETCH_STATUS } from '@kbn/observability-plugin/public'; import React, { useCallback, useEffect, useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; -import { ConfigKey, EncryptedSyntheticsMonitor } from '../components/monitors_page/overview/types'; +import { + ConfigKey, + EncryptedSyntheticsMonitor, + MonitorOverviewItem, +} from '../components/monitors_page/overview/types'; import { clearMonitorUpsertStatus, fetchUpsertMonitorAction, @@ -37,7 +41,7 @@ export function useMonitorEnableHandler({ const savedObjEnabledState = upsertStatuses[id]?.enabled; const [isEnabled, setIsEnabled] = useState(null); const updateMonitorEnabledState = useCallback( - (monitor: EncryptedSyntheticsMonitor, enabled: boolean) => { + (monitor: EncryptedSyntheticsMonitor | MonitorOverviewItem, enabled: boolean) => { dispatch( fetchUpsertMonitorAction({ id, @@ -82,5 +86,5 @@ export function useMonitorEnableHandler({ savedObjEnabledState, ]); - return { isEnabled, setIsEnabled, updateMonitorEnabledState, status }; + return { isEnabled, updateMonitorEnabledState, status }; } diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/actions.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/actions.ts index bd65a771de531..3315719a6bb16 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/actions.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/actions.ts @@ -10,6 +10,7 @@ import { createAction } from '@reduxjs/toolkit'; import { EncryptedSyntheticsMonitor, MonitorManagementListResult, + MonitorOverviewItem, } from '../../../../../common/runtime_types'; import { createAsyncAction } from '../utils/actions'; @@ -22,7 +23,7 @@ export const fetchMonitorListAction = createAsyncAction< export interface UpsertMonitorRequest { id: string; - monitor: EncryptedSyntheticsMonitor; + monitor: EncryptedSyntheticsMonitor | MonitorOverviewItem; } export const fetchUpsertMonitorAction = createAction('fetchUpsertMonitor'); export const fetchUpsertSuccessAction = createAction<{ diff --git a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/api.ts b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/api.ts index 97d60011e35d4..5e4e2e1bc1a67 100644 --- a/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/api.ts +++ b/x-pack/plugins/synthetics/public/apps/synthetics/state/monitor_list/api.ts @@ -11,6 +11,7 @@ import { FetchMonitorManagementListQueryArgs, MonitorManagementListResult, MonitorManagementListResultCodec, + MonitorOverviewItem, ServiceLocationErrors, SyntheticsMonitor, } from '../../../../../common/runtime_types'; @@ -54,7 +55,7 @@ export const fetchUpsertMonitor = async ({ monitor, id, }: { - monitor: SyntheticsMonitor | EncryptedSyntheticsMonitor; + monitor: SyntheticsMonitor | EncryptedSyntheticsMonitor | MonitorOverviewItem; id?: string; }): Promise<{ attributes: { errors: ServiceLocationErrors } } | SyntheticsMonitor> => { if (id) { diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/app/use_no_data_config.ts b/x-pack/plugins/synthetics/public/legacy_uptime/app/use_no_data_config.ts index af51f39786898..64d72aa248d78 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/app/use_no_data_config.ts +++ b/x-pack/plugins/synthetics/public/legacy_uptime/app/use_no_data_config.ts @@ -9,12 +9,12 @@ import { i18n } from '@kbn/i18n'; import { useContext } from 'react'; import { useSelector } from 'react-redux'; import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { KibanaPageTemplateProps } from '@kbn/shared-ux-components'; +import type { NoDataConfig } from '@kbn/shared-ux-page-kibana-template'; import { UptimeSettingsContext } from '../contexts'; import { ClientPluginsStart } from '../../plugin'; import { indexStatusSelector } from '../state/selectors'; -export function useNoDataConfig(): KibanaPageTemplateProps['noDataConfig'] { +export function useNoDataConfig(): NoDataConfig | undefined { const { basePath } = useContext(UptimeSettingsContext); const { diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/components/settings/settings_bottom_bar.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/components/settings/settings_bottom_bar.tsx index b080c3ea89712..99d672b24dd74 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/components/settings/settings_bottom_bar.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/components/settings/settings_bottom_bar.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { OutPortal, createPortalNode, InPortal } from 'react-reverse-portal'; +import { OutPortal, createHtmlPortalNode, InPortal } from 'react-reverse-portal'; import { SettingsActions, SettingsActionsProps } from './settings_actions'; export const SettingsBottomBar = () => { @@ -24,4 +24,4 @@ export const SettingsActionBarPortal = (props: SettingsActionsProps) => { ); }; -export const SettingsBarPortalNode = createPortalNode(); +export const SettingsBarPortalNode = createHtmlPortalNode(); diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/hooks/__snapshots__/use_url_params.test.tsx.snap b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/__snapshots__/use_url_params.test.tsx.snap index 5bac7ff7caf76..febc67e115ef9 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/hooks/__snapshots__/use_url_params.test.tsx.snap +++ b/x-pack/plugins/synthetics/public/legacy_uptime/hooks/__snapshots__/use_url_params.test.tsx.snap @@ -148,6 +148,7 @@ exports[`useUrlParams deletes keys that do not have truthy values 1`] = ` Array [], Array [], Array [], + Array [], ], "results": Array [ Object { @@ -174,6 +175,12 @@ exports[`useUrlParams deletes keys that do not have truthy values 1`] = ` "selectedFilters": null, }, }, + Object { + "type": "return", + "value": Object { + "selectedFilters": null, + }, + }, ], }, "replaceReducer": [MockFunction], @@ -378,6 +385,7 @@ exports[`useUrlParams gets the expected values using the context 1`] = ` Array [], Array [], Array [], + Array [], ], "results": Array [ Object { @@ -404,6 +412,12 @@ exports[`useUrlParams gets the expected values using the context 1`] = ` "selectedFilters": null, }, }, + Object { + "type": "return", + "value": Object { + "selectedFilters": null, + }, + }, ], }, "replaceReducer": [MockFunction], diff --git a/x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor_management/portals.tsx b/x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor_management/portals.tsx index 2ca83d1f6972f..b4574d2a5c6d3 100644 --- a/x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor_management/portals.tsx +++ b/x-pack/plugins/synthetics/public/legacy_uptime/pages/monitor_management/portals.tsx @@ -5,10 +5,10 @@ * 2.0. */ -import { createPortalNode } from 'react-reverse-portal'; +import { createHtmlPortalNode } from 'react-reverse-portal'; -export const ActionBarPortalNode = createPortalNode(); +export const ActionBarPortalNode = createHtmlPortalNode(); -export const APIKeysPortalNode = createPortalNode(); +export const APIKeysPortalNode = createHtmlPortalNode(); -export const ManageLocationsPortalNode = createPortalNode(); +export const ManageLocationsPortalNode = createHtmlPortalNode(); diff --git a/x-pack/plugins/synthetics/server/synthetics_service/project_monitor_formatter.ts b/x-pack/plugins/synthetics/server/synthetics_service/project_monitor_formatter.ts index 0b582dd74c4fc..3067ee6319052 100644 --- a/x-pack/plugins/synthetics/server/synthetics_service/project_monitor_formatter.ts +++ b/x-pack/plugins/synthetics/server/synthetics_service/project_monitor_formatter.ts @@ -341,7 +341,7 @@ export class ProjectMonitorFormatter { } catch (e) { this.handleStreamingMessage({ message: `Monitor ${journeyId} could not be deleted` }); this.failedStaleMonitors.push({ - id: monitorId, + id: journeyId, reason: 'Failed to delete stale monitor', details: e.message, }); diff --git a/x-pack/plugins/task_manager/server/monitoring/monitoring_stats_stream.ts b/x-pack/plugins/task_manager/server/monitoring/monitoring_stats_stream.ts index e0e7ddd3e79a4..a16e01189f4c7 100644 --- a/x-pack/plugins/task_manager/server/monitoring/monitoring_stats_stream.ts +++ b/x-pack/plugins/task_manager/server/monitoring/monitoring_stats_stream.ts @@ -7,7 +7,7 @@ import { merge, of, Observable } from 'rxjs'; import { map, scan } from 'rxjs/operators'; -import { set } from '@elastic/safer-lodash-set'; +import { set } from '@kbn/safer-lodash-set'; import { Logger } from '@kbn/core/server'; import { JsonObject } from '@kbn/utility-types'; import { TaskStore } from '../task_store'; diff --git a/x-pack/plugins/task_manager/server/task_store.test.ts b/x-pack/plugins/task_manager/server/task_store.test.ts index e7696102db8ca..561d4ac6a0989 100644 --- a/x-pack/plugins/task_manager/server/task_store.test.ts +++ b/x-pack/plugins/task_manager/server/task_store.test.ts @@ -15,20 +15,15 @@ import { TaskLifecycleResult, SerializedConcreteTaskInstance, } from './task'; -import { elasticsearchServiceMock } from '@kbn/core/server/mocks'; +import { elasticsearchServiceMock, savedObjectsServiceMock } from '@kbn/core/server/mocks'; import { TaskStore, SearchOpts, AggregationOpts } from './task_store'; import { savedObjectsRepositoryMock } from '@kbn/core/server/mocks'; -import { - SavedObjectsSerializer, - SavedObjectTypeRegistry, - SavedObjectAttributes, - SavedObjectsErrorHelpers, -} from '@kbn/core/server'; +import { SavedObjectAttributes, SavedObjectsErrorHelpers } from '@kbn/core/server'; import { TaskTypeDictionary } from './task_type_dictionary'; import { mockLogger } from './test_utils'; const savedObjectsClient = savedObjectsRepositoryMock.create(); -const serializer = new SavedObjectsSerializer(new SavedObjectTypeRegistry()); +const serializer = savedObjectsServiceMock.createSerializer(); beforeEach(() => jest.resetAllMocks()); diff --git a/x-pack/plugins/threat_intelligence/common/constants.ts b/x-pack/plugins/threat_intelligence/common/constants.ts index eba5c281652a9..952323223f352 100644 --- a/x-pack/plugins/threat_intelligence/common/constants.ts +++ b/x-pack/plugins/threat_intelligence/common/constants.ts @@ -7,8 +7,6 @@ export const EMPTY_VALUE = '-'; -export const DEFAULT_THREAT_INDEX_KEY = 'securitySolution:defaultThreatIndex' as const; - export const DEFAULT_DATE_FORMAT = 'dateFormat' as const; export const DEFAULT_DATE_FORMAT_TZ = 'dateFormat:tz' as const; diff --git a/x-pack/plugins/threat_intelligence/cypress/integration/indicators/indicators.spec.ts b/x-pack/plugins/threat_intelligence/cypress/integration/indicators/indicators.spec.ts index fa17dcac2d5d4..70dbd9e9fbf61 100644 --- a/x-pack/plugins/threat_intelligence/cypress/integration/indicators/indicators.spec.ts +++ b/x-pack/plugins/threat_intelligence/cypress/integration/indicators/indicators.spec.ts @@ -23,20 +23,18 @@ import { BREADCRUMBS, LEADING_BREADCRUMB, ENDING_BREADCRUMB, + FIELD_BROWSER, + FIELD_BROWSER_MODAL, } from '../../screens/indicators'; import { login } from '../../tasks/login'; import { esArchiverLoad, esArchiverUnload } from '../../tasks/es_archiver'; +import { selectRange } from '../../tasks/select_range'; before(() => { login(); }); -/** - * Time range extended to 15 years back to ensure fixtures are showing up correctly - * TODO: https://github.com/elastic/security-team/issues/4595 - */ -const THREAT_INTELLIGENCE_15Y_DATA = - '/app/security/threat_intelligence/indicators?indicators=(filterQuery:(language:kuery,query:%27%27),filters:!(),timeRange:(from:now-15y/d,to:now))'; +const THREAT_INTELLIGENCE = '/app/security/threat_intelligence/indicators'; const URL_WITH_CONTRADICTORY_FILTERS = '/app/security/threat_intelligence/indicators?indicators=(filterQuery:(language:kuery,query:%27%27),filters:!((%27$state%27:(store:appState),meta:(alias:!n,disabled:!f,index:%27%27,key:threat.indicator.type,negate:!f,params:(query:file),type:phrase),query:(match_phrase:(threat.indicator.type:file))),(%27$state%27:(store:appState),meta:(alias:!n,disabled:!f,index:%27%27,key:threat.indicator.type,negate:!f,params:(query:url),type:phrase),query:(match_phrase:(threat.indicator.type:url)))),timeRange:(from:now/d,to:now/d))'; @@ -51,7 +49,9 @@ describe('Indicators', () => { describe('Indicators page basics', () => { before(() => { - cy.visit(THREAT_INTELLIGENCE_15Y_DATA); + cy.visit(THREAT_INTELLIGENCE); + + selectRange(); }); it('should render the basic page elements', () => { @@ -90,7 +90,9 @@ describe('Indicators', () => { describe('Indicator page search', () => { before(() => { - cy.visit(THREAT_INTELLIGENCE_15Y_DATA); + cy.visit(THREAT_INTELLIGENCE); + + selectRange(); }); it('should narrow the results to url indicators when respective KQL search is executed', () => { @@ -121,10 +123,12 @@ describe('Indicators', () => { }); describe('No items match search criteria', () => { - before(() => + before(() => { // Contradictory filter set - cy.visit(URL_WITH_CONTRADICTORY_FILTERS) - ); + cy.visit(URL_WITH_CONTRADICTORY_FILTERS); + + selectRange(); + }); it('should not display the table when contractictory filters are set', () => { cy.get(FLYOUT_TABLE).should('not.exist'); @@ -147,4 +151,20 @@ describe('Indicators', () => { cy.get(`${FIELD_SELECTOR}`).should('have.value', threatIndicatorIp); }); }); + + describe('Field browser', () => { + before(() => { + cy.visit(THREAT_INTELLIGENCE); + + selectRange(); + }); + + describe('when field browser is triggered', () => { + it('should render proper modal window', () => { + cy.get(FIELD_BROWSER).last().click({ force: true }); + + cy.get(FIELD_BROWSER_MODAL).should('be.visible'); + }); + }); + }); }); diff --git a/x-pack/plugins/threat_intelligence/cypress/screens/indicators.ts b/x-pack/plugins/threat_intelligence/cypress/screens/indicators.ts index 3c68050c58f8c..f5ab5f46f687d 100644 --- a/x-pack/plugins/threat_intelligence/cypress/screens/indicators.ts +++ b/x-pack/plugins/threat_intelligence/cypress/screens/indicators.ts @@ -38,3 +38,11 @@ export const TABLE_CONTROLS = '[data-test-sub="dataGridControls"]'; export const INDICATOR_TYPE_CELL = '[data-gridcell-column-id="threat.indicator.type"]'; export const FIELD_SELECTOR = '[data-test-subj="tiIndicatorFieldSelectorDropdown"]'; + +export const FIELD_BROWSER = `[data-test-subj="show-field-browser"]`; + +export const FIELD_BROWSER_MODAL = `[data-test-subj="fields-browser-container"]`; + +export const FIELD_BROWSER_MODAL_SOURCE_CHECKBOX = `[data-test-subj="field-_source-checkbox"]`; + +export const FIELD_BROWSER_CLOSE = `[data-test-subj="close"]`; diff --git a/x-pack/plugins/threat_intelligence/cypress/tasks/select_range.ts b/x-pack/plugins/threat_intelligence/cypress/tasks/select_range.ts new file mode 100644 index 0000000000000..8bf94c7f920ee --- /dev/null +++ b/x-pack/plugins/threat_intelligence/cypress/tasks/select_range.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. + */ + +import { FIELD_BROWSER, TIME_RANGE_PICKER } from '../screens/indicators'; + +export const selectRange = () => { + cy.get(FIELD_BROWSER); + + cy.get(TIME_RANGE_PICKER).first().click({ force: true }); + cy.get('[aria-label="Time unit"]').select('y'); + cy.get('[data-test-subj="superDatePickerQuickMenu"] .euiQuickSelect__applyButton').click({ + force: true, + }); +}; diff --git a/x-pack/plugins/threat_intelligence/kibana.json b/x-pack/plugins/threat_intelligence/kibana.json index 18493feca7c4f..efd1e8bce761e 100644 --- a/x-pack/plugins/threat_intelligence/kibana.json +++ b/x-pack/plugins/threat_intelligence/kibana.json @@ -3,6 +3,7 @@ "version": "1.0.0", "kibanaVersion": "kibana", "ui": true, + "server": false, "owner": { "name": "Protections Experience Team", "githubTeam": "protections-experience" @@ -14,7 +15,8 @@ "unifiedSearch", "kibanaUtils", "navigation", - "kibanaReact" + "kibanaReact", + "triggersActionsUi" ], "requiredBundles": [ "data", diff --git a/x-pack/plugins/threat_intelligence/public/common/mocks/mock_kibana_data_service.tsx b/x-pack/plugins/threat_intelligence/public/common/mocks/mock_kibana_data_service.tsx deleted file mode 100644 index c002343369988..0000000000000 --- a/x-pack/plugins/threat_intelligence/public/common/mocks/mock_kibana_data_service.tsx +++ /dev/null @@ -1,42 +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 { Observable } from 'rxjs'; -import { TimeRangeBounds } from '@kbn/data-plugin/common'; -import * as hook from '../../hooks/use_kibana'; - -export interface MockSearchServiceParams { - searchSubject?: Observable; - calculateSubject?: TimeRangeBounds; -} - -export const mockKibanaDataService = ({ - searchSubject, - calculateSubject, -}: MockSearchServiceParams) => { - const search = jest.fn().mockReturnValue(searchSubject); - const showError = jest.fn(); - const getUiSetting = jest.fn(); - const calculateBounds = jest.fn().mockReturnValue(calculateSubject); - - (hook as jest.Mocked).useKibana.mockReturnValue({ - services: { - data: { - search: { search, showError }, - query: { timefilter: { timefilter: { calculateBounds } } }, - }, - uiSettings: { get: getUiSetting }, - }, - } as any); - - return { - search, - showError, - getUiSetting, - calculateBounds, - }; -}; diff --git a/x-pack/plugins/threat_intelligence/public/common/mocks/mock_use_kibana_for_filters.ts b/x-pack/plugins/threat_intelligence/public/common/mocks/mock_use_kibana_for_filters.ts index cb77e0cec5523..598bec07732a0 100644 --- a/x-pack/plugins/threat_intelligence/public/common/mocks/mock_use_kibana_for_filters.ts +++ b/x-pack/plugins/threat_intelligence/public/common/mocks/mock_use_kibana_for_filters.ts @@ -42,7 +42,6 @@ export const mockUseKibanaForFilters = ({ }, }, dataViews: { getFieldsForWildcard }, - uiSettings: { get: () => ['mock-index'] }, }, } as any); diff --git a/x-pack/plugins/threat_intelligence/public/common/mocks/test_providers.tsx b/x-pack/plugins/threat_intelligence/public/common/mocks/test_providers.tsx index 019587c4b30fb..afd526342689b 100644 --- a/x-pack/plugins/threat_intelligence/public/common/mocks/test_providers.tsx +++ b/x-pack/plugins/threat_intelligence/public/common/mocks/test_providers.tsx @@ -13,9 +13,10 @@ import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; import type { IStorage } from '@kbn/kibana-utils-plugin/public'; import { Storage } from '@kbn/kibana-utils-plugin/public'; import { unifiedSearchPluginMock } from '@kbn/unified-search-plugin/public/mocks'; +import { BehaviorSubject } from 'rxjs'; import { mockUiSetting } from './mock_kibana_ui_setting'; -import { KibanaContextProvider } from '../../hooks/use_kibana'; -import { Services, ThreatIntelligenceSecuritySolutionContext } from '../../types'; +import { KibanaContext } from '../../hooks/use_kibana'; +import { SecuritySolutionPluginContext } from '../../types'; import { SecuritySolutionContext } from '../../containers/security_solution_context'; export const localStorageMock = (): IStorage => { @@ -51,6 +52,7 @@ export const unifiedSearch = unifiedSearchPluginMock.createStartContract(); const validDate: string = '1 Jan 2022 00:00:00 GMT'; const data = dataPluginMock.createStartContract(); + const dataServiceMock = { ...data, query: { @@ -83,20 +85,7 @@ const dataServiceMock = { }, search: { ...data.search, - search: jest.fn().mockImplementation(() => ({ - subscribe: jest.fn().mockImplementation(() => ({ - error: jest.fn(), - next: jest.fn(), - unsubscribe: jest.fn(), - })), - pipe: jest.fn().mockImplementation(() => ({ - subscribe: jest.fn().mockImplementation(() => ({ - error: jest.fn(), - next: jest.fn(), - unsubscribe: jest.fn(), - })), - })), - })), + search: jest.fn().mockReturnValue(new BehaviorSubject({})), }, }; @@ -106,7 +95,7 @@ const coreServiceMock = { uiSettings: { get: jest.fn().mockImplementation(mockUiSetting) }, }; -const mockSecurityContext: ThreatIntelligenceSecuritySolutionContext = { +const mockSecurityContext: SecuritySolutionPluginContext = { getFiltersGlobalComponent: () => ({ children }) => @@ -116,19 +105,36 @@ const mockSecurityContext: ThreatIntelligenceSecuritySolutionContext = { return true; }, }, + sourcererDataView: { + browserFields: {}, + selectedPatterns: [], + indexPattern: { fields: [], title: '' }, + }, }; -const mockedServices = { +export const mockedServices = { ...coreServiceMock, data: dataServiceMock, storage, unifiedSearch, -} as unknown as Services; + triggersActionsUi: { + getFieldBrowser: jest.fn().mockReturnValue(null), + }, +}; export const TestProvidersComponent: FC = ({ children }) => ( - + {children} - + ); + +export type MockedSearch = jest.Mocked; +export type MockedTimefilter = jest.Mocked; +export type MockedTriggersActionsUi = jest.Mocked; + +export const mockedSearchService = mockedServices.data.search as MockedSearch; +export const mockedTimefilterService = mockedServices.data.query.timefilter as MockedTimefilter; +export const mockedTriggersActionsUiService = + mockedServices.triggersActionsUi as MockedTriggersActionsUi; diff --git a/x-pack/plugins/threat_intelligence/public/containers/enterprise_guard/enterprise_guard.test.tsx b/x-pack/plugins/threat_intelligence/public/containers/enterprise_guard/enterprise_guard.test.tsx index bb4739bb6251f..4c0abd97f154d 100644 --- a/x-pack/plugins/threat_intelligence/public/containers/enterprise_guard/enterprise_guard.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/containers/enterprise_guard/enterprise_guard.test.tsx @@ -7,7 +7,7 @@ import { render, screen } from '@testing-library/react'; import React from 'react'; -import { ThreatIntelligenceSecuritySolutionContext } from '../../types'; +import { SecuritySolutionPluginContext } from '../../types'; import { SecuritySolutionContext } from '../security_solution_context'; import { EnterpriseGuard } from './enterprise_guard'; @@ -19,7 +19,7 @@ describe('', () => { value={ { licenseService: { isEnterprise: jest.fn().mockReturnValue(true) }, - } as unknown as ThreatIntelligenceSecuritySolutionContext + } as unknown as SecuritySolutionPluginContext } > @@ -39,7 +39,7 @@ describe('', () => { value={ { licenseService: { isEnterprise: jest.fn().mockReturnValue(false) }, - } as unknown as ThreatIntelligenceSecuritySolutionContext + } as unknown as SecuritySolutionPluginContext } > fallback for non enterprise
}> diff --git a/x-pack/plugins/threat_intelligence/public/containers/security_solution_context.tsx b/x-pack/plugins/threat_intelligence/public/containers/security_solution_context.tsx index 0dae7e9538c38..91a2934463d07 100644 --- a/x-pack/plugins/threat_intelligence/public/containers/security_solution_context.tsx +++ b/x-pack/plugins/threat_intelligence/public/containers/security_solution_context.tsx @@ -6,8 +6,8 @@ */ import { createContext } from 'react'; -import { ThreatIntelligenceSecuritySolutionContext } from '../types'; +import { SecuritySolutionPluginContext } from '../types'; -export const SecuritySolutionContext = createContext< - ThreatIntelligenceSecuritySolutionContext | undefined ->(undefined); +export const SecuritySolutionContext = createContext( + undefined +); diff --git a/x-pack/plugins/threat_intelligence/public/hooks/use_kibana.ts b/x-pack/plugins/threat_intelligence/public/hooks/use_kibana.ts index 28e15734e6dcc..a6431c3c40a8f 100644 --- a/x-pack/plugins/threat_intelligence/public/hooks/use_kibana.ts +++ b/x-pack/plugins/threat_intelligence/public/hooks/use_kibana.ts @@ -5,9 +5,13 @@ * 2.0. */ -import { KibanaContextProvider, useKibana } from '@kbn/kibana-react-plugin/public'; +import { + KibanaContextProvider, + useKibana, + context as KibanaContext, +} from '@kbn/kibana-react-plugin/public'; import { Services } from '../types'; const useTypedKibana = () => useKibana(); -export { KibanaContextProvider, useTypedKibana as useKibana }; +export { KibanaContextProvider, useTypedKibana as useKibana, KibanaContext }; diff --git a/x-pack/plugins/threat_intelligence/public/hooks/use_security_context.ts b/x-pack/plugins/threat_intelligence/public/hooks/use_security_context.ts index 433f12bf548c0..4d5fad34baf09 100644 --- a/x-pack/plugins/threat_intelligence/public/hooks/use_security_context.ts +++ b/x-pack/plugins/threat_intelligence/public/hooks/use_security_context.ts @@ -7,9 +7,9 @@ import { useContext } from 'react'; import { SecuritySolutionContext } from '../containers/security_solution_context'; -import { ThreatIntelligenceSecuritySolutionContext } from '../types'; +import { SecuritySolutionPluginContext } from '../types'; -export const useSecurityContext = (): ThreatIntelligenceSecuritySolutionContext => { +export const useSecurityContext = (): SecuritySolutionPluginContext => { const contextValue = useContext(SecuritySolutionContext); if (!contextValue) { diff --git a/x-pack/plugins/threat_intelligence/public/index.ts b/x-pack/plugins/threat_intelligence/public/index.ts index 3751d0d0f7003..539b807426341 100755 --- a/x-pack/plugins/threat_intelligence/public/index.ts +++ b/x-pack/plugins/threat_intelligence/public/index.ts @@ -24,5 +24,5 @@ export function plugin() { export type { ThreatIntelligencePluginSetup, ThreatIntelligencePluginStart, - ThreatIntelligenceSecuritySolutionContext, + SecuritySolutionPluginContext, } from './types'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_barchart_wrapper/indicators_barchart_wrapper.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_barchart_wrapper/indicators_barchart_wrapper.stories.tsx index cda6671d03fda..1f4cbce1c76a2 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_barchart_wrapper/indicators_barchart_wrapper.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_barchart_wrapper/indicators_barchart_wrapper.stories.tsx @@ -23,20 +23,18 @@ export default { }; const mockTimeRange: TimeRange = DEFAULT_TIME_RANGE; -const mockIndexPatterns: DataView[] = [ - { - fields: [ - { - name: '@timestamp', - type: 'date', - } as DataViewField, - { - name: 'threat.feed.name', - type: 'string', - } as DataViewField, - ], - } as DataView, -]; +const mockIndexPattern: DataView = { + fields: [ + { + name: '@timestamp', + type: 'date', + } as DataViewField, + { + name: 'threat.feed.name', + type: 'string', + } as DataViewField, + ], +} as DataView; const validDate: string = '1 Jan 2022 00:00:00 GMT'; const numberOfDays: number = 1; @@ -107,7 +105,7 @@ const KibanaReactContext = createKibanaReactContext({ export const Default: Story = () => { return ( - + ); }; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_barchart_wrapper/indicators_barchart_wrapper.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_barchart_wrapper/indicators_barchart_wrapper.test.tsx index 39afea8a11a0e..b8f06c06aa6f5 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_barchart_wrapper/indicators_barchart_wrapper.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_barchart_wrapper/indicators_barchart_wrapper.test.tsx @@ -13,27 +13,25 @@ import { TestProvidersComponent } from '../../../../common/mocks/test_providers' import { IndicatorsBarChartWrapper } from './indicators_barchart_wrapper'; import { DEFAULT_TIME_RANGE } from '../../hooks/use_filters/utils'; -const mockIndexPatterns: DataView[] = [ - { - fields: [ - { - name: '@timestamp', - type: 'date', - } as DataViewField, - { - name: 'threat.feed.name', - type: 'string', - } as DataViewField, - ], - } as DataView, -]; +const mockIndexPatterns: DataView = { + fields: [ + { + name: '@timestamp', + type: 'date', + } as DataViewField, + { + name: 'threat.feed.name', + type: 'string', + } as DataViewField, + ], +} as DataView; const mockTimeRange: TimeRange = DEFAULT_TIME_RANGE; describe('', () => { it('should render barchart and field selector dropdown', () => { const component = render( - + ); diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_barchart_wrapper/indicators_barchart_wrapper.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_barchart_wrapper/indicators_barchart_wrapper.tsx index 0988e50dc0007..a30bdffe0e23c 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_barchart_wrapper/indicators_barchart_wrapper.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_barchart_wrapper/indicators_barchart_wrapper.tsx @@ -8,8 +8,8 @@ import React, { memo } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiTitle } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; -import { DataView } from '@kbn/data-views-plugin/common'; import { TimeRange } from '@kbn/es-query'; +import { SecuritySolutionDataViewBase } from '../../../../types'; import { RawIndicatorFieldId } from '../../../../../common/types/indicator'; import { useAggregatedIndicators } from '../../hooks/use_aggregated_indicators'; import { IndicatorsFieldSelector } from '../indicators_field_selector/indicators_field_selector'; @@ -19,11 +19,11 @@ const DEFAULT_FIELD = RawIndicatorFieldId.Feed; export interface IndicatorsBarChartWrapperProps { timeRange?: TimeRange; - indexPatterns: DataView[]; + indexPattern: SecuritySolutionDataViewBase; } export const IndicatorsBarChartWrapper = memo( - ({ timeRange, indexPatterns }) => { + ({ timeRange, indexPattern }) => { const { dateRange, indicators, onFieldChange } = useAggregatedIndicators({ timeRange }); return ( @@ -41,7 +41,7 @@ export const IndicatorsBarChartWrapper = memo( diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_browser/index.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_browser/index.tsx new file mode 100644 index 0000000000000..8fefebf88e799 --- /dev/null +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_browser/index.tsx @@ -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 * from './indicators_field_browser'; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_browser/indicators_field_browser.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_browser/indicators_field_browser.test.tsx new file mode 100644 index 0000000000000..29e97062cf22d --- /dev/null +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_browser/indicators_field_browser.test.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 { + mockedTriggersActionsUiService, + TestProvidersComponent, +} from '../../../../common/mocks/test_providers'; +import { render } from '@testing-library/react'; +import React from 'react'; +import { IndicatorsFieldBrowser } from './indicators_field_browser'; + +const stub = jest.fn(); + +describe('', () => { + it('should retrieve the field browser widget from respective service', () => { + render( + , + { + wrapper: TestProvidersComponent, + } + ); + + expect(mockedTriggersActionsUiService.getFieldBrowser).toHaveBeenCalledTimes(1); + expect(mockedTriggersActionsUiService.getFieldBrowser).toHaveBeenCalledWith( + expect.objectContaining({ + browserFields: {}, + columnIds: [], + onResetColumns: stub, + onToggleColumn: stub, + options: {}, + }) + ); + }); +}); diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_browser/indicators_field_browser.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_browser/indicators_field_browser.tsx new file mode 100644 index 0000000000000..2adcc4ee5b9ee --- /dev/null +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_browser/indicators_field_browser.tsx @@ -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 { BrowserField } from '@kbn/triggers-actions-ui-plugin/public/application/sections/field_browser/types'; +import { VFC } from 'react'; +import { useKibana } from '../../../../hooks/use_kibana'; + +export interface IndicatorsFieldBrowserProps { + browserFields: Readonly>>; + columnIds: string[]; + onResetColumns: () => void; + onToggleColumn: (columnId: string) => void; +} + +export const IndicatorsFieldBrowser: VFC = ({ + browserFields, + columnIds, + onResetColumns, + onToggleColumn, +}) => { + const { triggersActionsUi } = useKibana().services; + + return triggersActionsUi.getFieldBrowser({ + browserFields, + columnIds, + onResetColumns, + onToggleColumn, + options: {}, + }); +}; diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_selector/indicators_field_selector.stories.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_selector/indicators_field_selector.stories.tsx index f7bb3300334a5..94ca9f903aec6 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_selector/indicators_field_selector.stories.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_selector/indicators_field_selector.stories.tsx @@ -11,20 +11,18 @@ import { DataView, DataViewField } from '@kbn/data-views-plugin/common'; import { RawIndicatorFieldId } from '../../../../../common/types/indicator'; import { IndicatorsFieldSelector } from './indicators_field_selector'; -const mockIndexPatterns: DataView[] = [ - { - fields: [ - { - name: '@timestamp', - type: 'date', - } as DataViewField, - { - name: 'threat.feed.name', - type: 'string', - } as DataViewField, - ], - } as DataView, -]; +const mockIndexPattern: DataView = { + fields: [ + { + name: '@timestamp', + type: 'date', + } as DataViewField, + { + name: 'threat.feed.name', + type: 'string', + } as DataViewField, + ], +} as DataView; export default { component: IndicatorsFieldSelector, @@ -34,7 +32,7 @@ export default { export const Default: Story = () => { return ( console.log(value)} /> @@ -44,7 +42,7 @@ export const Default: Story = () => { export const WithDefaultValue: Story = () => { return ( console.log(value)} defaultStackByValue={RawIndicatorFieldId.LastSeen} @@ -55,7 +53,7 @@ export const WithDefaultValue: Story = () => { export const NoData: Story = () => { return ( console.log(value)} /> diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_selector/indicators_field_selector.test.tsx b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_selector/indicators_field_selector.test.tsx index 21a0f56dfb36a..e3bd4129d4fc5 100644 --- a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_selector/indicators_field_selector.test.tsx +++ b/x-pack/plugins/threat_intelligence/public/modules/indicators/components/indicators_field_selector/indicators_field_selector.test.tsx @@ -11,27 +11,25 @@ import { DataView, DataViewField } from '@kbn/data-views-plugin/common'; import { TestProvidersComponent } from '../../../../common/mocks/test_providers'; import { DROPDOWN_TEST_ID, IndicatorsFieldSelector } from './indicators_field_selector'; -const mockIndexPatterns: DataView[] = [ - { - fields: [ - { - name: '@timestamp', - type: 'date', - } as DataViewField, - { - name: 'threat.feed.name', - type: 'string', - } as DataViewField, - ], - } as DataView, -]; +const mockIndexPattern: DataView = { + fields: [ + { + name: '@timestamp', + type: 'date', + } as DataViewField, + { + name: 'threat.feed.name', + type: 'string', + } as DataViewField, + ], +} as DataView; describe('', () => { it('should handle empty array of indexPatterns', () => { const component = render( console.log(value)} /> @@ -45,7 +43,7 @@ describe('', () => { const component = render( console.log(value)} /> @@ -56,7 +54,7 @@ describe('', () => { const dropdownOptions: string = component.getByTestId(DROPDOWN_TEST_ID).innerHTML; const optionsCount: number = (dropdownOptions.match(/