Skip to content

Commit

Permalink
Merge branch 'main' of github.com:elastic/kibana into kbn-team-1309-r…
Browse files Browse the repository at this point in the history
…elocate-20241219135219
  • Loading branch information
Dosant committed Dec 23, 2024
2 parents 17c895c + 5ae53d4 commit fad8a41
Show file tree
Hide file tree
Showing 640 changed files with 10,967 additions and 1,547 deletions.
23 changes: 12 additions & 11 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,11 @@ packages/content-management/table_list_view @elastic/appex-sharedux
packages/content-management/table_list_view_common @elastic/appex-sharedux
packages/content-management/table_list_view_table @elastic/appex-sharedux
packages/content-management/user_profiles @elastic/appex-sharedux
packages/core/analytics/core-analytics-browser @elastic/kibana-core
packages/core/analytics/core-analytics-browser-internal @elastic/kibana-core
packages/core/analytics/core-analytics-browser-mocks @elastic/kibana-core
packages/core/analytics/core-analytics-server @elastic/kibana-core
packages/core/analytics/core-analytics-server-internal @elastic/kibana-core
packages/core/analytics/core-analytics-server-mocks @elastic/kibana-core
packages/core/application/core-application-browser @elastic/kibana-core
packages/core/application/core-application-browser-internal @elastic/kibana-core
packages/core/application/core-application-browser-mocks @elastic/kibana-core
packages/core/application/core-application-common @elastic/kibana-core
packages/core/apps/core-apps-browser-internal @elastic/kibana-core
packages/core/apps/core-apps-browser-mocks @elastic/kibana-core
packages/core/apps/core-apps-server-internal @elastic/kibana-core
packages/core/base/core-base-browser-internal @elastic/kibana-core
packages/core/base/core-base-browser-mocks @elastic/kibana-core
packages/core/base/core-base-common @elastic/kibana-core
packages/core/base/core-base-common-internal @elastic/kibana-core
packages/core/base/core-base-server-internal @elastic/kibana-core
packages/core/base/core-base-server-mocks @elastic/kibana-core
Expand Down Expand Up @@ -558,6 +547,17 @@ packages/shared-ux/storybook/config @elastic/appex-sharedux
packages/shared-ux/storybook/mock @elastic/appex-sharedux
packages/shared-ux/table_persist @elastic/appex-sharedux
src/core @elastic/kibana-core
src/core/packages/analytics/browser @elastic/kibana-core
src/core/packages/analytics/browser-internal @elastic/kibana-core
src/core/packages/analytics/server @elastic/kibana-core
src/core/packages/analytics/server-internal @elastic/kibana-core
src/core/packages/application/browser @elastic/kibana-core
src/core/packages/application/browser-internal @elastic/kibana-core
src/core/packages/application/common @elastic/kibana-core
src/core/packages/apps/browser-internal @elastic/kibana-core
src/core/packages/apps/server-internal @elastic/kibana-core
src/core/packages/base/browser-internal @elastic/kibana-core
src/core/packages/base/common @elastic/kibana-core
src/platform/packages/private/default-nav/devtools @elastic/kibana-management
src/platform/packages/private/default-nav/management @elastic/kibana-management
src/platform/packages/private/default-nav/ml @elastic/ml-ui
Expand Down Expand Up @@ -763,6 +763,7 @@ x-pack/packages/kbn-ai-assistant @elastic/search-kibana
x-pack/packages/kbn-alerting-comparators @elastic/response-ops
x-pack/packages/kbn-alerting-state-types @elastic/response-ops
x-pack/packages/kbn-random-sampling @elastic/kibana-visualizations
x-pack/packages/kbn-streams-schema @elastic/streams-program-team
x-pack/packages/kbn-synthetics-private-location @elastic/obs-ux-management-team
x-pack/packages/maps/vector_tile_utils @elastic/kibana-presentation
x-pack/packages/observability/observability_utils/observability_utils_browser @elastic/observability-ui
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class MyPlugin implements Plugin {
}
}
----
<1> Refer to {kib-repo}/blob/8.9/packages/core/application/core-application-browser/src/contracts.ts[application.register interface]
<1> Refer to {kib-repo}tree/{branch}/packages/core/application/core-application-browser/src/contracts.ts[application.register interface]
<2> Application specific URL.
<3> `mount` callback is invoked when a user navigates to the application-specific URL.
<4> `core.getStartServices` method provides API available during `start` lifecycle.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Registering a feature consists of the following fields. For more information, co
|A human readable name for your feature.

|`category` (required)
|{kib-repo}blob/{branch}/packages/core/application/core-application-common/src/app_category.ts[`AppCategory`]
|{kib-repo}blob/{branch}/src/core/packages/application/common/src/app_category.ts[`AppCategory`]
|`DEFAULT_APP_CATEGORIES.kibana`
|The `AppCategory` which best represents your feature. Used to organize the display
of features within the management screens.
Expand Down
16 changes: 8 additions & 8 deletions docs/developer/best-practices/navigation.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ window.location.href = urlToADashboard;

To navigate between different {kib} apps without a page reload (by default) there are APIs in `core`:

* {kib-repo}tree/{branch}/packages/core/application/core-application-browser/src/contracts.ts[core.application.navigateToApp]
* {kib-repo}tree/{branch}/packages/core/application/core-application-browser/src/contracts.ts[core.application.navigateToUrl]
* {kib-repo}tree/{branch}/src/core/packages/application/browser/src/contracts.ts[core.application.navigateToApp]
* {kib-repo}tree/{branch}/src/core/packages/application/browser/src/contracts.ts[core.application.navigateToUrl]

Both methods offer customization such as opening the target in a new page, with an `options` parameter. All the options are optional be default.

* {kib-repo}tree/{branch}/packages/core/application/core-application-browser/src/contracts.ts[core.application.navigateToApp options]
* {kib-repo}tree/{branch}/packages/core/application/core-application-browser/src/contracts.ts[core.application.navigateToUrl options]
* {kib-repo}tree/{branch}/src/core/packages/application/browser/src/contracts.ts[core.application.navigateToApp options]
* {kib-repo}tree/{branch}/src/core/packages/application/browser/src/contracts.ts[core.application.navigateToUrl options]

*Rendering a link to a different {kib} app on its own would also cause a full page reload:*

Expand Down Expand Up @@ -163,8 +163,8 @@ Common rules to follow in this scenario:

This is required to make sure `core` is aware of navigations triggered inside your app, so it could act accordingly when needed.

* `Core`'s {kib-repo}tree/{branch}/packages/core/application/core-application-browser/src/scoped_history.ts[ScopedHistory] instance.
* {kib-repo}tree/{branch}/packages/core/application/core-application-browser/src/app_mount.ts[Example usage]
* `Core`'s {kib-repo}tree/{branch}/src/core/packages/application/browser/src/scoped_history.ts[ScopedHistory] instance.
* {kib-repo}tree/{branch}/src/core/packages/application/browser/src/app_mount.ts[Example usage]
* {kib-repo}tree/{branch}/test/plugin_functional/plugins/core_plugin_a/public/application.tsx#L120[Example plugin]

Relative links will be resolved relative to your app's route (e.g.: `http://localhost5601/app/{your-app-id}`)
Expand All @@ -181,14 +181,14 @@ const MyInternalLink = () => <Link to="/my-other-page"></Link>
=== Using history and browser location

Try to avoid using `window.location` and `window.history` directly. +
Instead, consider using {kib-repo}tree/{branch}/packages/core/application/core-application-browser/src/scoped_history.ts[ScopedHistory]
Instead, consider using {kib-repo}tree/{branch}/src/core/packages/application/browser/src/scoped_history.ts[ScopedHistory]
instance provided by `core`.

* This way `core` will know about location changes triggered within your app, and it would act accordingly.
* Some plugins are listening to location changes. Triggering location change manually could lead to unpredictable and hard-to-catch bugs.

Common use-case for using
`core`'s {kib-repo}tree/{branch}/packages/core/application/core-application-browser/src/scoped_history.ts[ScopedHistory] directly:
`core`'s {kib-repo}tree/{branch}/src/core/packages/application/browser/src/scoped_history.ts[ScopedHistory] directly:

* Reading/writing query params or hash.
* Imperatively triggering internal navigations within your app.
Expand Down
23 changes: 12 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,18 +245,18 @@
"@kbn/controls-example-plugin": "link:examples/controls_example",
"@kbn/controls-plugin": "link:src/plugins/controls",
"@kbn/core": "link:src/core",
"@kbn/core-analytics-browser": "link:packages/core/analytics/core-analytics-browser",
"@kbn/core-analytics-browser-internal": "link:packages/core/analytics/core-analytics-browser-internal",
"@kbn/core-analytics-server": "link:packages/core/analytics/core-analytics-server",
"@kbn/core-analytics-server-internal": "link:packages/core/analytics/core-analytics-server-internal",
"@kbn/core-analytics-browser": "link:src/core/packages/analytics/browser",
"@kbn/core-analytics-browser-internal": "link:src/core/packages/analytics/browser-internal",
"@kbn/core-analytics-server": "link:src/core/packages/analytics/server",
"@kbn/core-analytics-server-internal": "link:src/core/packages/analytics/server-internal",
"@kbn/core-app-status-plugin": "link:test/plugin_functional/plugins/core_app_status",
"@kbn/core-application-browser": "link:packages/core/application/core-application-browser",
"@kbn/core-application-browser-internal": "link:packages/core/application/core-application-browser-internal",
"@kbn/core-application-common": "link:packages/core/application/core-application-common",
"@kbn/core-apps-browser-internal": "link:packages/core/apps/core-apps-browser-internal",
"@kbn/core-apps-server-internal": "link:packages/core/apps/core-apps-server-internal",
"@kbn/core-base-browser-internal": "link:packages/core/base/core-base-browser-internal",
"@kbn/core-base-common": "link:packages/core/base/core-base-common",
"@kbn/core-application-browser": "link:src/core/packages/application/browser",
"@kbn/core-application-browser-internal": "link:src/core/packages/application/browser-internal",
"@kbn/core-application-common": "link:src/core/packages/application/common",
"@kbn/core-apps-browser-internal": "link:src/core/packages/apps/browser-internal",
"@kbn/core-apps-server-internal": "link:src/core/packages/apps/server-internal",
"@kbn/core-base-browser-internal": "link:src/core/packages/base/browser-internal",
"@kbn/core-base-common": "link:src/core/packages/base/common",
"@kbn/core-base-common-internal": "link:packages/core/base/core-base-common-internal",
"@kbn/core-base-server-internal": "link:packages/core/base/core-base-server-internal",
"@kbn/core-capabilities-browser-internal": "link:packages/core/capabilities/core-capabilities-browser-internal",
Expand Down Expand Up @@ -945,6 +945,7 @@
"@kbn/std": "link:packages/kbn-std",
"@kbn/streams-app-plugin": "link:x-pack/solutions/observability/plugins/streams_app",
"@kbn/streams-plugin": "link:x-pack/solutions/observability/plugins/streams",
"@kbn/streams-schema": "link:x-pack/packages/kbn-streams-schema",
"@kbn/synthetics-plugin": "link:x-pack/solutions/observability/plugins/synthetics",
"@kbn/synthetics-private-location": "link:x-pack/packages/kbn-synthetics-private-location",
"@kbn/task-manager-fixture-plugin": "link:x-pack/test/alerting_api_integration/common/plugins/task_manager_fixture",
Expand Down

This file was deleted.

This file was deleted.

14 changes: 0 additions & 14 deletions packages/core/application/core-application-browser/jest.config.js

This file was deleted.

3 changes: 3 additions & 0 deletions packages/kbn-check-mappings-update-cli/current_fields.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@
"external_service.pushed_by.full_name",
"external_service.pushed_by.profile_uid",
"external_service.pushed_by.username",
"observables",
"observables.typeKey",
"observables.value",
"owner",
"settings",
"settings.syncAlerts",
Expand Down
11 changes: 11 additions & 0 deletions packages/kbn-check-mappings-update-cli/current_mappings.json
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,17 @@
}
}
},
"observables": {
"properties": {
"typeKey": {
"type": "keyword"
},
"value": {
"type": "keyword"
}
},
"type": "nested"
},
"owner": {
"type": "keyword"
},
Expand Down
6 changes: 4 additions & 2 deletions packages/kbn-relocate/relocate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,13 @@ const findModules = ({ teams, paths, included, excluded }: FindModulesParams, lo
.filter(({ manifest }) => !manifest.devOnly)
// explicit exclusions
.filter(({ id }) => !EXCLUDED_MODULES.includes(id) && !excluded.includes(id))
// we don't want to move test modules (just yet)
// we don't want to move test and example modules (just yet)
.filter(
({ directory }) =>
!directory.includes(`/${KIBANA_FOLDER}/test/`) &&
!directory.includes(`/${KIBANA_FOLDER}/x-pack/test/`)
!directory.includes(`/${KIBANA_FOLDER}/x-pack/test/`) &&
!directory.includes(`/${KIBANA_FOLDER}/examples/`) &&
!directory.includes(`/${KIBANA_FOLDER}/x-pack/examples/`)
)
// the module is under the umbrella specified by the user
.filter(
Expand Down
2 changes: 2 additions & 0 deletions packages/kbn-relocate/utils/transforms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const TRANSFORMS: Record<string, string | TransformFunction> = {
'x-pack/solutions/security/packages/security-solution/': 'x-pack/solutions/security/packages/',
'x-pack/solutions/observability/plugins/observability_solution/':
'x-pack/solutions/observability/plugins/',
'x-pack/solutions/observability/packages/observability/observability_utils/observability_':
'x-pack/solutions/observability/packages/',
'x-pack/solutions/observability/packages/observability/':
'x-pack/solutions/observability/packages/',
'src/core/packages/core/': (path: string) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/react/kibana_context/root/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ DEPS = [
"@npm//react",
"@npm//tslib",
"@npm//@elastic/eui",
"//packages/core/base/core-base-common",
"//src/core/packages/base/common:core-base-common",
"//packages/shared-ux/router/impl:shared-ux-router",
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

module.exports = {
preset: '@kbn/test',
rootDir: '../../../..',
roots: ['<rootDir>/packages/core/application/core-application-common'],
rootDir: '../../../../..',
roots: ['<rootDir>/src/core/packages/analytics/browser-internal'],
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../../tsconfig.base.json",
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": ["jest", "node"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

module.exports = {
preset: '@kbn/test',
rootDir: '../../../..',
roots: ['<rootDir>/packages/core/apps/core-apps-browser-internal'],
rootDir: '../../../../..',
roots: ['<rootDir>/src/core/packages/analytics/browser'],
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../../tsconfig.base.json",
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

module.exports = {
preset: '@kbn/test/jest_node',
rootDir: '../../../..',
roots: ['<rootDir>/packages/core/analytics/core-analytics-server-internal'],
rootDir: '../../../../..',
roots: ['<rootDir>/src/core/packages/analytics/server-internal'],
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../../tsconfig.base.json",
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

module.exports = {
preset: '@kbn/test/jest_node',
rootDir: '../../../..',
roots: ['<rootDir>/packages/core/apps/core-apps-server-internal'],
rootDir: '../../../../..',
roots: ['<rootDir>/src/core/packages/analytics/server'],
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../../tsconfig.base.json",
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [
Expand Down
14 changes: 14 additions & 0 deletions src/core/packages/application/browser-internal/jest.config.js
Original file line number Diff line number Diff line change
@@ -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", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/

module.exports = {
preset: '@kbn/test',
rootDir: '../../../../..',
roots: ['<rootDir>/src/core/packages/application/browser-internal'],
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

module.exports = {
preset: '@kbn/test/jest_integration',
rootDir: '../../../..',
roots: ['<rootDir>/packages/core/application/core-application-browser-internal'],
rootDir: '../../../../..',
roots: ['<rootDir>/src/core/packages/application/browser-internal'],
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../../tsconfig.base.json",
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

module.exports = {
preset: '@kbn/test',
rootDir: '../../../..',
roots: ['<rootDir>/packages/core/base/core-base-browser-internal'],
rootDir: '../../../../..',
roots: ['<rootDir>/src/core/packages/application/browser'],
};
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export interface ApplicationStart {
* application.navigateToUrl('/app/discover/some-path') // does not include the current basePath
* application.navigateToUrl('/base-path/s/my-space/app/unknown-app/some-path') // unknown application
* application.navigateToUrl('../discover') // resolve to `/base-path/s/my-space/discover` which is not a path of a known app.
* application.navigateToUrl('../../other-space/discover') // resolve to `/base-path/s/other-space/discover` which is not within the current basePath.
* application.navigateToUrl('../../../other-space/discover') // resolve to `/base-path/s/other-space/discover` which is not within the current basePath.
* ```
*
* @param url - an absolute URL, an absolute path or a relative path, to navigate to.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../../tsconfig.base.json",
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

module.exports = {
preset: '@kbn/test',
rootDir: '../../../..',
roots: ['<rootDir>/packages/core/analytics/core-analytics-browser'],
rootDir: '../../../../..',
roots: ['<rootDir>/src/core/packages/application/common'],
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../../tsconfig.base.json",
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [
Expand Down
Loading

0 comments on commit fad8a41

Please sign in to comment.