diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index cb9607ecbb51a..94f805bd6cd09 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -477,6 +477,7 @@ x-pack/packages/ml/url_state @elastic/ml-ui packages/kbn-monaco @elastic/appex-sharedux x-pack/plugins/monitoring_collection @elastic/infra-monitoring-ui x-pack/plugins/monitoring @elastic/infra-monitoring-ui +src/plugins/navigation_embeddable @elastic/kibana-presentation src/plugins/navigation @elastic/appex-sharedux src/plugins/newsfeed @elastic/kibana-core test/common/plugins/newsfeed @elastic/kibana-core diff --git a/.i18nrc.json b/.i18nrc.json index d3afda75dce51..9c03677612481 100644 --- a/.i18nrc.json +++ b/.i18nrc.json @@ -73,6 +73,7 @@ "management": ["src/legacy/core_plugins/management", "src/plugins/management"], "monaco": "packages/kbn-monaco/src", "navigation": "src/plugins/navigation", + "navigationEmbeddable": "src/plugins/navigation_embeddable", "newsfeed": "src/plugins/newsfeed", "presentationUtil": "src/plugins/presentation_util", "randomSampling": "x-pack/packages/kbn-random-sampling", diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index e218387d64341..61e3f80dfbddc 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -249,6 +249,10 @@ management section itself. It also provides a stateful version of it on the start contract. +|{kib-repo}blob/{branch}/src/plugins/navigation_embeddable/README.md[navigationEmbeddable] +|This plugin adds the Navigation Embeddable which allows authors to create hard links to navigate on click and bring all context from the source dashboard to the destination dashboard. + + |{kib-repo}blob/{branch}/src/plugins/newsfeed/README.md[newsfeed] |The newsfeed plugin adds a NewsfeedNavButton to the top navigation bar and renders the content in the flyout. Content is fetched from the remote (https://feeds.elastic.co) once a day, with periodic checks if the content needs to be refreshed. All newsfeed content is hosted remotely. diff --git a/package.json b/package.json index a85349f9841e8..807b4bec95938 100644 --- a/package.json +++ b/package.json @@ -492,6 +492,7 @@ "@kbn/monaco": "link:packages/kbn-monaco", "@kbn/monitoring-collection-plugin": "link:x-pack/plugins/monitoring_collection", "@kbn/monitoring-plugin": "link:x-pack/plugins/monitoring", + "@kbn/navigation-embeddable-plugin": "link:src/plugins/navigation_embeddable", "@kbn/navigation-plugin": "link:src/plugins/navigation", "@kbn/newsfeed-plugin": "link:src/plugins/newsfeed", "@kbn/newsfeed-test-plugin": "link:test/common/plugins/newsfeed", diff --git a/packages/kbn-optimizer/limits.yml b/packages/kbn-optimizer/limits.yml index 13cf535a36873..e36b6116308d1 100644 --- a/packages/kbn-optimizer/limits.yml +++ b/packages/kbn-optimizer/limits.yml @@ -92,6 +92,7 @@ pageLoadAssetSize: ml: 82187 monitoring: 80000 navigation: 37269 + navigationEmbeddable: 17892 newsfeed: 42228 observability: 95000 observabilityOnboarding: 19573 diff --git a/src/plugins/navigation_embeddable/README.md b/src/plugins/navigation_embeddable/README.md new file mode 100644 index 0000000000000..598a29be2e037 --- /dev/null +++ b/src/plugins/navigation_embeddable/README.md @@ -0,0 +1,3 @@ +# Navigation Embeddable + +This plugin adds the Navigation Embeddable which allows authors to create hard links to navigate on click and bring all context from the source dashboard to the destination dashboard. diff --git a/src/plugins/navigation_embeddable/kibana.jsonc b/src/plugins/navigation_embeddable/kibana.jsonc new file mode 100644 index 0000000000000..76d185c560084 --- /dev/null +++ b/src/plugins/navigation_embeddable/kibana.jsonc @@ -0,0 +1,17 @@ +{ + "type": "plugin", + "id": "@kbn/navigation-embeddable-plugin", + "owner": "@elastic/kibana-presentation", + "description": "An embeddable for quickly navigating between dashboards.", + "plugin": { + "id": "navigationEmbeddable", + "server": false, + "browser": true, + "requiredPlugins": [ + "embeddable" + ], + "optionalPlugins": [], + "requiredBundles": [ + ] + } +} diff --git a/src/plugins/navigation_embeddable/public/index.ts b/src/plugins/navigation_embeddable/public/index.ts new file mode 100644 index 0000000000000..5e8be17c8958b --- /dev/null +++ b/src/plugins/navigation_embeddable/public/index.ts @@ -0,0 +1,20 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export type { NavigationEmbeddableFactory } from './navigation_embeddable'; +export { + NAVIGATION_EMBEDDABLE_TYPE, + NavigationEmbeddableFactoryDefinition, + NavigationEmbeddable, +} from './navigation_embeddable'; + +import { NavigationEmbeddablePlugin } from './plugin'; + +export function plugin() { + return new NavigationEmbeddablePlugin(); +} diff --git a/src/plugins/navigation_embeddable/public/navigation_embeddable/index.ts b/src/plugins/navigation_embeddable/public/navigation_embeddable/index.ts new file mode 100644 index 0000000000000..1676f521ceb84 --- /dev/null +++ b/src/plugins/navigation_embeddable/public/navigation_embeddable/index.ts @@ -0,0 +1,11 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { NAVIGATION_EMBEDDABLE_TYPE, NavigationEmbeddable } from './navigation_embeddable'; +export type { NavigationEmbeddableFactory } from './navigation_embeddable_factory'; +export { NavigationEmbeddableFactoryDefinition } from './navigation_embeddable_factory'; diff --git a/src/plugins/navigation_embeddable/public/navigation_embeddable/navigation_embeddable.tsx b/src/plugins/navigation_embeddable/public/navigation_embeddable/navigation_embeddable.tsx new file mode 100644 index 0000000000000..2c66f4b655fac --- /dev/null +++ b/src/plugins/navigation_embeddable/public/navigation_embeddable/navigation_embeddable.tsx @@ -0,0 +1,32 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import { EuiTitle } from '@elastic/eui'; +import { Embeddable } from '@kbn/embeddable-plugin/public'; +import type { EmbeddableInput, IContainer } from '@kbn/embeddable-plugin/public'; + +export const NAVIGATION_EMBEDDABLE_TYPE = 'navigation'; + +export class NavigationEmbeddable extends Embeddable { + public readonly type = NAVIGATION_EMBEDDABLE_TYPE; + + constructor(initialInput: EmbeddableInput, parent?: IContainer) { + super(initialInput, {}, parent); + } + + public render(el: HTMLElement) { + return ( + +

Call me Magellan, cuz I'm a navigator!

+
+ ); + } + + public reload() {} +} diff --git a/src/plugins/navigation_embeddable/public/navigation_embeddable/navigation_embeddable_factory.ts b/src/plugins/navigation_embeddable/public/navigation_embeddable/navigation_embeddable_factory.ts new file mode 100644 index 0000000000000..54f8ecbb9f892 --- /dev/null +++ b/src/plugins/navigation_embeddable/public/navigation_embeddable/navigation_embeddable_factory.ts @@ -0,0 +1,36 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { i18n } from '@kbn/i18n'; +import type { EmbeddableInput, IContainer } from '@kbn/embeddable-plugin/public'; +import { EmbeddableFactory, EmbeddableFactoryDefinition } from '@kbn/embeddable-plugin/public'; +import { NavigationEmbeddable, NAVIGATION_EMBEDDABLE_TYPE } from './navigation_embeddable'; + +export type NavigationEmbeddableFactory = EmbeddableFactory; + +export class NavigationEmbeddableFactoryDefinition implements EmbeddableFactoryDefinition { + public readonly type = NAVIGATION_EMBEDDABLE_TYPE; + + public async isEditable() { + return true; + } + + public async create(initialInput: EmbeddableInput, parent?: IContainer) { + return new NavigationEmbeddable(initialInput, parent); + } + + public getDisplayName() { + return i18n.translate('navigationEmbeddable.navigationEmbeddableFactory.displayName', { + defaultMessage: 'Navigation', + }); + } + + public getIconType() { + return 'link'; + } +} diff --git a/src/plugins/navigation_embeddable/public/plugin.ts b/src/plugins/navigation_embeddable/public/plugin.ts new file mode 100644 index 0000000000000..23dff1f5d1eb8 --- /dev/null +++ b/src/plugins/navigation_embeddable/public/plugin.ts @@ -0,0 +1,39 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; +import { EmbeddableSetup, EmbeddableStart } from '@kbn/embeddable-plugin/public'; +import { NAVIGATION_EMBEDDABLE_TYPE } from './navigation_embeddable'; +import { NavigationEmbeddableFactoryDefinition } from './navigation_embeddable'; + +export interface SetupDependencies { + embeddable: EmbeddableSetup; +} + +export interface StartDependencies { + embeddable: EmbeddableStart; +} + +export class NavigationEmbeddablePlugin + implements Plugin +{ + constructor() {} + + public setup(core: CoreSetup, plugins: SetupDependencies) { + plugins.embeddable.registerEmbeddableFactory( + NAVIGATION_EMBEDDABLE_TYPE, + new NavigationEmbeddableFactoryDefinition() + ); + } + + public start(core: CoreStart, plugins: StartDependencies) { + return {}; + } + + public stop() {} +} diff --git a/src/plugins/navigation_embeddable/tsconfig.json b/src/plugins/navigation_embeddable/tsconfig.json new file mode 100644 index 0000000000000..05ce2326f9768 --- /dev/null +++ b/src/plugins/navigation_embeddable/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + }, + "include": ["public/**/*", "common/**/*", "server/**/*"], + "kbn_references": [ + "@kbn/core", + "@kbn/embeddable-plugin", + "@kbn/i18n", + ], + "exclude": [ + "target/**/*", + ] +} diff --git a/tsconfig.base.json b/tsconfig.base.json index 01e7276e6bb86..6a7db032a2801 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -948,6 +948,8 @@ "@kbn/monitoring-collection-plugin/*": ["x-pack/plugins/monitoring_collection/*"], "@kbn/monitoring-plugin": ["x-pack/plugins/monitoring"], "@kbn/monitoring-plugin/*": ["x-pack/plugins/monitoring/*"], + "@kbn/navigation-embeddable-plugin": ["src/plugins/navigation_embeddable"], + "@kbn/navigation-embeddable-plugin/*": ["src/plugins/navigation_embeddable/*"], "@kbn/navigation-plugin": ["src/plugins/navigation"], "@kbn/navigation-plugin/*": ["src/plugins/navigation/*"], "@kbn/newsfeed-plugin": ["src/plugins/newsfeed"], diff --git a/yarn.lock b/yarn.lock index 5aa75006e8c02..cc8bdb36a4f3f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4634,6 +4634,10 @@ version "0.0.0" uid "" +"@kbn/navigation-embeddable-plugin@link:src/plugins/navigation_embeddable": + version "0.0.0" + uid "" + "@kbn/navigation-plugin@link:src/plugins/navigation": version "0.0.0" uid "" @@ -5025,7 +5029,7 @@ "@kbn/server-route-repository@link:packages/kbn-server-route-repository": version "0.0.0" uid "" - + "@kbn/serverless-observability@link:x-pack/plugins/serverless_observability": version "0.0.0" uid "" @@ -5034,19 +5038,19 @@ version "0.0.0" uid "" -"@kbn/serverless-storybook-config@link:packages/serverless/storybook/config": +"@kbn/serverless-search@link:x-pack/plugins/serverless_search": version "0.0.0" uid "" -"@kbn/serverless-types@link:packages/serverless/types": +"@kbn/serverless-security@link:x-pack/plugins/serverless_security": version "0.0.0" uid "" -"@kbn/serverless-search@link:x-pack/plugins/serverless_search": +"@kbn/serverless-storybook-config@link:packages/serverless/storybook/config": version "0.0.0" uid "" -"@kbn/serverless-security@link:x-pack/plugins/serverless_security": +"@kbn/serverless-types@link:packages/serverless/types": version "0.0.0" uid ""