diff --git a/src/plugins/console/public/application/containers/embeddable/_embeddable_console.scss b/src/plugins/console/public/application/containers/embeddable/_embeddable_console.scss new file mode 100644 index 0000000000000..206ab6459c05a --- /dev/null +++ b/src/plugins/console/public/application/containers/embeddable/_embeddable_console.scss @@ -0,0 +1,146 @@ +.embeddableConsole { + background: $embeddableConsoleBackground; + color: $embeddableConsoleText; + display: flex; + flex-direction: column; + // This large box shadow helps prevent a flicker of dark + // background when the content is shown and hidden + box-shadow: inset 0 $embeddableConsoleInitialHeight 0 $embeddableConsoleBackground, inset 0 600rem 0 $euiPageBackgroundColor; + bottom: 0; + right: 0; + left: var(--euiCollapsibleNavOffset, 0); + transform: translateY(0); + height: $embeddableConsoleInitialHeight; + max-height: $embeddableConsoleMaxHeight; + + &--fixed { + position: fixed; + z-index: $euiZLevel1; + } + + &-isOpen { + animation-duration: $euiAnimSpeedNormal; + animation-timing-function: $euiAnimSlightResistance; + animation-fill-mode: forwards; + } + + &-isOpen.embeddableConsole--large { + animation-name: embeddableConsoleOpenPanelLarge; + height: $embeddableConsoleMaxHeight; + bottom: map-get($embeddableConsoleHeights, 'l') * -1; + } + + &-isOpen.embeddableConsole--medium { + animation-name: embeddableConsoleOpenPanelMedium; + height: map-get($embeddableConsoleHeights, 'm'); + bottom: map-get($embeddableConsoleHeights, 'm') * -1; + } + + &-isOpen.embeddableConsole--small { + animation-name: embeddableConsoleOpenPanelSmall; + height: map-get($embeddableConsoleHeights, 's'); + bottom: map-get($embeddableConsoleHeights, 's') * -1; + } +} + +.embeddableConsole__controls { + height: $embeddableConsoleInitialHeight; + width: 100%; + display: flex; + justify-content: flex-start; + overflow-y: hidden; // Ensures the movement of buttons in :focus don't cause scrollbars + overflow-x: auto; + + &--button { + justify-content: flex-start; + } +} + +.embeddableConsole__content { + @include euiScrollBar; + overflow-y: auto; + width: 100%; + height: calc(100% - #{$embeddableConsoleInitialHeight}); + background-color: $euiPageBackgroundColor; + animation-name: embeddableConsoleShowContent; + animation-duration: $euiAnimSpeedSlow; + animation-iteration-count: 1; + animation-timing-function: $euiAnimSlightResistance; + color: $euiColorDarkestShade; + + #consoleRoot { + height: 100%; + } +} + +@each $colorName, $colorValue in $euiButtonTypes { + .embeddableConsole__controls { + .euiLink.euiLink--#{$colorName} { + color: makeHighContrastColor($colorValue, $embeddableConsoleBackground); + + &:hover { + color: tintOrShade($colorValue, 30%, 30%); + } + } + + .euiLink.euiLink--text { + color: $euiColorGhost; + } + + .embeddableConsole__button.euiButton[class*='#{$colorName}']:enabled:not(.euiButton--fill) { + color: makeHighContrastColor($colorValue, $embeddableConsoleBackground); + border-color: makeHighContrastColor($colorValue, $embeddableConsoleBackground); + } + + .euiButtonIcon[class*='#{$colorName}'] { + color: makeHighContrastColor($colorValue, $embeddableConsoleBackground); + } + } +} + +@include euiBreakpoint('xs', 's') { + .embeddableConsole:not(.embeddableConsole--showOnMobile) { + display: none; + } +} + +@keyframes embeddableConsoleOpenPanelLarge { + 0% { + // Accounts for the initial height offset from the top + transform: translateY(calc((#{$embeddableConsoleInitialHeight} * 3) * -1)); + } + + 100% { + transform: translateY(map-get($embeddableConsoleHeights, 'l') * -1); + } +} + +@keyframes embeddableConsoleOpenPanelMedium { + 0% { + transform: translateY(-$embeddableConsoleInitialHeight); + } + + 100% { + transform: translateY(map-get($embeddableConsoleHeights, 'm') * -1); + } +} + +@keyframes embeddableConsoleOpenPanelSmall { + 0% { + transform: translateY(-$embeddableConsoleInitialHeight); + } + + 100% { + transform: translateY(map-get($embeddableConsoleHeights, 's') * -1); + } +} + +@keyframes embeddableConsoleShowContent { + 0% { + opacity: 0; + } + + 100% { + opacity: 1; + } +} diff --git a/src/plugins/console/public/application/containers/embeddable/_index.scss b/src/plugins/console/public/application/containers/embeddable/_index.scss new file mode 100644 index 0000000000000..ccd6b800f99cc --- /dev/null +++ b/src/plugins/console/public/application/containers/embeddable/_index.scss @@ -0,0 +1,2 @@ +@import 'variables'; +@import 'embeddable_console'; diff --git a/src/plugins/console/public/application/containers/embeddable/_variables.scss b/src/plugins/console/public/application/containers/embeddable/_variables.scss new file mode 100644 index 0000000000000..b987037af4d62 --- /dev/null +++ b/src/plugins/console/public/application/containers/embeddable/_variables.scss @@ -0,0 +1,12 @@ +$embeddableConsoleBackground: lightOrDarkTheme($euiColorDarkestShade, $euiColorInk); +$embeddableConsoleText: lighten(makeHighContrastColor($euiColorLightestShade, $embeddableConsoleBackground), 20%); +$embeddableConsoleBorderColor: transparentize($euiColorGhost, .8); +$embeddableConsoleInitialHeight: $euiSizeXXL; +$embeddableConsoleMaxHeight: calc(100vh - #{$euiSize * 5}); + +// Pixel heights ensure no blurriness caused by half pixel offsets +$embeddableConsoleHeights: ( + s: $euiSize * 30, + m: $euiSize * 50, + l: 100vh, +); diff --git a/src/plugins/console/public/application/containers/embeddable/console_wrapper.tsx b/src/plugins/console/public/application/containers/embeddable/console_wrapper.tsx new file mode 100644 index 0000000000000..7594bc06fa322 --- /dev/null +++ b/src/plugins/console/public/application/containers/embeddable/console_wrapper.tsx @@ -0,0 +1,160 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React, { useMemo, useEffect } from 'react'; +import { Observable } from 'rxjs'; +import { + HttpSetup, + NotificationsStart, + I18nStart, + CoreTheme, + DocLinksStart, +} from '@kbn/core/public'; +import { KibanaThemeProvider } from '@kbn/react-kibana-context-theme'; + +import { ObjectStorageClient } from '../../../../common/types'; + +import * as localStorageObjectClient from '../../../lib/local_storage_object_client'; +import { + getAutocompleteInfo, + AutocompleteInfo, + History, + Settings, + Storage, + createStorage, + createHistory, + createSettings, + setStorage, +} from '../../../services'; +import { createUsageTracker } from '../../../services/tracker'; +import { MetricsTracker, EmbeddableConsoleDependencies } from '../../../types'; + +import { createApi, createEsHostService } from '../../lib'; +import { EsHostService } from '../../lib/es_host_service'; + +import { + ServicesContextProvider, + EditorContextProvider, + RequestContextProvider, +} from '../../contexts'; +import { Main } from '../main'; + +interface ConsoleDependencies { + I18nContext: I18nStart['Context']; + autocompleteInfo: AutocompleteInfo; + docLinks: DocLinksStart['links']; + docLinkVersion: string; + esHostService: EsHostService; + history: History; + http: HttpSetup; + notifications: NotificationsStart; + objectStorageClient: ObjectStorageClient; + settings: Settings; + storage: Storage; + theme$: Observable; + trackUiMetric: MetricsTracker; +} + +const loadDependencies = ({ + core, + usageCollection, +}: EmbeddableConsoleDependencies): ConsoleDependencies => { + const { + docLinks: { DOC_LINK_VERSION, links }, + http, + i18n: { Context: I18nContext }, + notifications, + theme: { theme$ }, + } = core; + const trackUiMetric = createUsageTracker(usageCollection); + trackUiMetric.load('opened_remote_app'); + + const autocompleteInfo = getAutocompleteInfo(); + const storage = createStorage({ + engine: window.localStorage, + prefix: 'sense:', + }); + setStorage(storage); + const history = createHistory({ storage }); + const settings = createSettings({ storage }); + const objectStorageClient = localStorageObjectClient.create(storage); + const api = createApi({ http }); + const esHostService = createEsHostService({ api }); + + autocompleteInfo.mapping.setup(http, settings); + return { + I18nContext, + autocompleteInfo, + docLinks: links, + docLinkVersion: DOC_LINK_VERSION, + esHostService, + history, + http, + notifications, + objectStorageClient, + settings, + storage, + theme$, + trackUiMetric, + }; +}; + +export const ConsoleWrapper = (props: EmbeddableConsoleDependencies): React.ReactElement => { + const dependencies = useMemo(() => loadDependencies(props), [props]); + useEffect(() => { + return () => { + dependencies.autocompleteInfo.clearSubscriptions(); + }; + }, [dependencies]); + + const { + I18nContext, + autocompleteInfo, + docLinkVersion, + docLinks, + esHostService, + history, + http, + notifications, + objectStorageClient, + settings, + storage, + theme$, + trackUiMetric, + } = dependencies; + return ( + + + + + +
+ + + + + + ); +}; diff --git a/src/plugins/console/public/application/containers/embeddable/embeddable_console.tsx b/src/plugins/console/public/application/containers/embeddable/embeddable_console.tsx new file mode 100644 index 0000000000000..48a1337266668 --- /dev/null +++ b/src/plugins/console/public/application/containers/embeddable/embeddable_console.tsx @@ -0,0 +1,106 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React, { useState } from 'react'; +import classNames from 'classnames'; +import { + EuiButton, + EuiFocusTrap, + EuiPortal, + EuiScreenReaderOnly, + EuiThemeProvider, + EuiWindowEvent, + keys, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; + +import { + EmbeddableConsoleProps, + EmbeddableConsoleDependencies, +} from '../../../types/embeddable_console'; + +import { ConsoleWrapper } from './console_wrapper'; +import './_index.scss'; + +const landmarkHeading = i18n.translate('console.embeddableConsole.landmarkHeading', { + defaultMessage: 'Developer console', +}); + +export const EmbeddableConsole = ({ + size = 'm', + core, + usageCollection, +}: EmbeddableConsoleProps & EmbeddableConsoleDependencies) => { + const [isConsoleOpen, setIsConsoleOpen] = useState(false); + const toggleConsole = () => setIsConsoleOpen(!isConsoleOpen); + + const onKeyDown = (event: any) => { + if (event.key === keys.ESCAPE) { + event.preventDefault(); + event.stopPropagation(); + setIsConsoleOpen(false); + } + }; + + const classes = classNames('embeddableConsole', { + 'embeddableConsole-isOpen': isConsoleOpen, + 'embeddableConsole--large': size === 'l', + 'embeddableConsole--medium': size === 'm', + 'embeddableConsole--small': size === 's', + 'embeddableConsole--fixed': true, + 'embeddableConsole--showOnMobile': false, + }); + + return ( + + +
+ +

{landmarkHeading}

+
+ +
+ + {i18n.translate('console.embeddableConsole.title', { + defaultMessage: 'Console', + })} + +
+
+ {isConsoleOpen ? ( +
+ + +
+ ) : null} +
+ +

+ {i18n.translate('console.embeddableConsole.customScreenReaderAnnouncement', { + defaultMessage: + 'There is a new region landmark called {landmarkHeading} with page level controls at the end of the document.', + values: { landmarkHeading }, + })} +

+
+
+
+ ); +}; + +// Default Export is needed to lazy load this react component +// eslint-disable-next-line import/no-default-export +export default EmbeddableConsole; diff --git a/src/plugins/console/public/application/containers/embeddable/index.tsx b/src/plugins/console/public/application/containers/embeddable/index.tsx new file mode 100644 index 0000000000000..7ddf9f3355c94 --- /dev/null +++ b/src/plugins/console/public/application/containers/embeddable/index.tsx @@ -0,0 +1,26 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React, { ReactElement, lazy, Suspense } from 'react'; +import { + EmbeddableConsoleProps, + EmbeddableConsoleDependencies, +} from '../../../types/embeddable_console'; + +const RemoteConsole = lazy(() => import('./embeddable_console')); + +export function renderEmbeddableConsole( + props: EmbeddableConsoleProps | undefined, + deps: EmbeddableConsoleDependencies +): ReactElement | null { + return ( + }> + + + ); +} diff --git a/src/plugins/console/public/application/containers/main/main.tsx b/src/plugins/console/public/application/containers/main/main.tsx index 8bbb5a986d6c2..11ff2e9b5146f 100644 --- a/src/plugins/console/public/application/containers/main/main.tsx +++ b/src/plugins/console/public/application/containers/main/main.tsx @@ -29,7 +29,11 @@ import { getTopNavConfig } from './get_top_nav'; import type { SenseEditor } from '../../models/sense_editor'; import { getResponseWithMostSevereStatusCode } from '../../../lib/utils'; -export function Main() { +export interface MainProps { + hideWelcome?: boolean; +} + +export function Main({ hideWelcome = false }: MainProps) { const { services: { storage }, } = useServicesContext(); @@ -42,7 +46,7 @@ export function Main() { } = useRequestReadContext(); const [showWelcome, setShowWelcomePanel] = useState( - () => storage.get('version_welcome_shown') !== '@@SENSE_REVISION' + () => storage.get('version_welcome_shown') !== '@@SENSE_REVISION' && !hideWelcome ); const [showingHistory, setShowHistory] = useState(false); diff --git a/src/plugins/console/public/application/index.tsx b/src/plugins/console/public/application/index.tsx index 92d875b9db2a9..ef5d2943f4d20 100644 --- a/src/plugins/console/public/application/index.tsx +++ b/src/plugins/console/public/application/index.tsx @@ -16,9 +16,9 @@ import { CoreTheme, DocLinksStart, } from '@kbn/core/public'; +import { KibanaThemeProvider } from '@kbn/react-kibana-context-theme'; import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; -import { KibanaThemeProvider } from '../shared_imports'; import { createStorage, createHistory, @@ -73,7 +73,7 @@ export function renderApp({ render( - + (); + if (isConsoleUiEnabled) { + return { + renderEmbeddableConsole: (props: EmbeddableConsoleProps) => { + const consoleDeps: EmbeddableConsoleDependencies = { + core, + usageCollection: deps.usageCollection, + }; + return renderEmbeddableConsole(props, consoleDeps); + }, + }; + } + return {}; + } } diff --git a/src/plugins/console/public/services/tracker.ts b/src/plugins/console/public/services/tracker.ts index 43675c4f9d8dd..e8dc4198d8fb1 100644 --- a/src/plugins/console/public/services/tracker.ts +++ b/src/plugins/console/public/services/tracker.ts @@ -7,12 +7,14 @@ */ import { METRIC_TYPE, UiCounterMetricType } from '@kbn/analytics'; -import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; +import { UsageCollectionSetup, UsageCollectionStart } from '@kbn/usage-collection-plugin/public'; import { MetricsTracker } from '../types'; const APP_TRACKER_NAME = 'console'; -export const createUsageTracker = (usageCollection?: UsageCollectionSetup): MetricsTracker => { +export const createUsageTracker = ( + usageCollection?: UsageCollectionSetup | UsageCollectionStart +): MetricsTracker => { const track = (type: UiCounterMetricType, name: string) => usageCollection?.reportUiCounter(APP_TRACKER_NAME, type, name); diff --git a/src/plugins/console/public/types/embeddable_console.ts b/src/plugins/console/public/types/embeddable_console.ts new file mode 100644 index 0000000000000..da0e3346a7bd2 --- /dev/null +++ b/src/plugins/console/public/types/embeddable_console.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 { CoreStart } from '@kbn/core/public'; +import type { UsageCollectionStart } from '@kbn/usage-collection-plugin/public'; + +/** + * EmbeddableConsoleProps are optional props used when rendering the embeddable developer console. + */ +export interface EmbeddableConsoleProps { + /** + * The default height of the content area. + */ + size?: 's' | 'm' | 'l'; +} + +export interface EmbeddableConsoleDependencies { + core: CoreStart; + usageCollection?: UsageCollectionStart; +} diff --git a/src/plugins/console/public/types/index.ts b/src/plugins/console/public/types/index.ts index 2a86e53e55b80..e384d81ef13db 100644 --- a/src/plugins/console/public/types/index.ts +++ b/src/plugins/console/public/types/index.ts @@ -11,5 +11,6 @@ export * from './core_editor'; export * from './token'; export * from './tokens_provider'; export * from './common'; +export * from './embeddable_console'; export type { ClientConfigType } from './config'; export type { ConsoleUILocatorParams } from './locator'; diff --git a/src/plugins/console/public/types/plugin_dependencies.ts b/src/plugins/console/public/types/plugin_dependencies.ts index 40d82a4df29ac..e4f65d44cb727 100644 --- a/src/plugins/console/public/types/plugin_dependencies.ts +++ b/src/plugins/console/public/types/plugin_dependencies.ts @@ -6,12 +6,14 @@ * Side Public License, v 1. */ -import { HomePublicPluginSetup } from '@kbn/home-plugin/public'; +import { ReactElement } from 'react'; +import { HomePublicPluginSetup, HomePublicPluginStart } from '@kbn/home-plugin/public'; import { DevToolsSetup } from '@kbn/dev-tools-plugin/public'; -import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; -import { SharePluginSetup, LocatorPublic } from '@kbn/share-plugin/public'; +import { UsageCollectionSetup, UsageCollectionStart } from '@kbn/usage-collection-plugin/public'; +import { SharePluginSetup, SharePluginStart, LocatorPublic } from '@kbn/share-plugin/public'; import { ConsoleUILocatorParams } from './locator'; +import { EmbeddableConsoleProps } from './embeddable_console'; export interface AppSetupUIPluginDependencies { home?: HomePublicPluginSetup; @@ -20,6 +22,29 @@ export interface AppSetupUIPluginDependencies { usageCollection?: UsageCollectionSetup; } +export interface AppStartUIPluginDependencies { + home?: HomePublicPluginStart; + share: SharePluginStart; + usageCollection?: UsageCollectionStart; +} + +/** + * Console plugin's setup service object + */ export interface ConsolePluginSetup { + /** + * Public locator for the console UI + */ locator?: LocatorPublic; } + +/** + * Console plugin's start service object + */ +export interface ConsolePluginStart { + /** + * renderEmbeddableConsole is available if the console UI is enabled. This function can be called to + * render an embeddable version of the developer console on the page. + */ + renderEmbeddableConsole?: (props?: EmbeddableConsoleProps) => ReactElement | null; +} diff --git a/src/plugins/console/tsconfig.json b/src/plugins/console/tsconfig.json index 4d1d508078eec..925cef9cbbbab 100644 --- a/src/plugins/console/tsconfig.json +++ b/src/plugins/console/tsconfig.json @@ -26,6 +26,7 @@ "@kbn/web-worker-stub", "@kbn/core-elasticsearch-server", "@kbn/core-http-browser-mocks", + "@kbn/react-kibana-context-theme", ], "exclude": [ "target/**/*", diff --git a/x-pack/plugins/serverless_search/public/application/components/connectors_overview.tsx b/x-pack/plugins/serverless_search/public/application/components/connectors_overview.tsx index 78c70321d178c..9ba21a5e1afc6 100644 --- a/x-pack/plugins/serverless_search/public/application/components/connectors_overview.tsx +++ b/x-pack/plugins/serverless_search/public/application/components/connectors_overview.tsx @@ -16,7 +16,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import React from 'react'; +import React, { useMemo } from 'react'; import { LEARN_MORE_LABEL } from '../../../common/i18n_string'; import { PLUGIN_ID } from '../../../common'; @@ -28,9 +28,12 @@ import { ConnectorsTable } from './connectors/connectors_table'; export const ConnectorsOverview = () => { const { data, isLoading: connectorsLoading } = useConnectors(); - const { http } = useKibanaServices(); - + const { http, console: consolePlugin } = useKibanaServices(); const { createConnector, isLoading } = useCreateConnector(); + const embeddableConsole = useMemo( + () => consolePlugin?.renderEmbeddableConsole?.() ?? <>, + [consolePlugin] + ); return ( @@ -116,6 +119,7 @@ export const ConnectorsOverview = () => { )} + {embeddableConsole} ); }; diff --git a/x-pack/plugins/serverless_search/public/application/components/overview.tsx b/x-pack/plugins/serverless_search/public/application/components/overview.tsx index e0b858b99022d..2a2313564c2e2 100644 --- a/x-pack/plugins/serverless_search/public/application/components/overview.tsx +++ b/x-pack/plugins/serverless_search/public/application/components/overview.tsx @@ -57,8 +57,7 @@ import { PipelineButtonOverview } from './pipeline_button_overview'; export const ElasticsearchOverview = () => { const [selectedLanguage, setSelectedLanguage] = useState(javaDefinition); const [clientApiKey, setClientApiKey] = useState(API_KEY_PLACEHOLDER); - const { application, cloud, http, user, share } = useKibanaServices(); - + const { application, cloud, http, user, share, console: consolePlugin } = useKibanaServices(); const { elasticsearchURL, cloudId } = useMemo(() => { return { elasticsearchURL: cloud?.elasticsearchUrl ?? ELASTICSEARCH_URL_PLACEHOLDER, @@ -66,11 +65,6 @@ export const ElasticsearchOverview = () => { }; }, [cloud]); const assetBasePath = useAssetBasePath(); - const codeSnippetArguments: LanguageDefinitionSnippetArguments = { - url: elasticsearchURL, - apiKey: clientApiKey, - cloudId, - }; const { hash } = useLocation(); useEffect(() => { if (hash) { @@ -81,6 +75,16 @@ export const ElasticsearchOverview = () => { } } }, [hash]); + const embeddableConsole = useMemo( + () => consolePlugin?.renderEmbeddableConsole?.() ?? <>, + [consolePlugin] + ); + + const codeSnippetArguments: LanguageDefinitionSnippetArguments = { + url: elasticsearchURL, + apiKey: clientApiKey, + cloudId, + }; return ( @@ -341,6 +345,7 @@ export const ElasticsearchOverview = () => { links={[]} overviewPanelProps={{ color: 'transparent', hasShadow: false }} /> + {embeddableConsole} ); diff --git a/x-pack/plugins/serverless_search/public/application/hooks/use_kibana.tsx b/x-pack/plugins/serverless_search/public/application/hooks/use_kibana.tsx index 6d3a37651bb35..21ff4c0fff505 100644 --- a/x-pack/plugins/serverless_search/public/application/hooks/use_kibana.tsx +++ b/x-pack/plugins/serverless_search/public/application/hooks/use_kibana.tsx @@ -6,6 +6,7 @@ */ import { CloudStart } from '@kbn/cloud-plugin/public'; +import { ConsolePluginStart } from '@kbn/console-plugin/public'; import type { AppMountParameters, CoreStart } from '@kbn/core/public'; import type { SharePluginStart } from '@kbn/share-plugin/public'; import { useKibana as useKibanaBase } from '@kbn/kibana-react-plugin/public'; @@ -13,6 +14,7 @@ import { AuthenticatedUser } from '@kbn/security-plugin/common'; export interface ServerlessSearchContext { cloud: CloudStart; + console: ConsolePluginStart; history: AppMountParameters['history']; share: SharePluginStart; user?: AuthenticatedUser; diff --git a/x-pack/plugins/serverless_search/public/types.ts b/x-pack/plugins/serverless_search/public/types.ts index 039353fa4e867..2bde66e05e99f 100644 --- a/x-pack/plugins/serverless_search/public/types.ts +++ b/x-pack/plugins/serverless_search/public/types.ts @@ -6,6 +6,7 @@ */ import { CloudSetup, CloudStart } from '@kbn/cloud-plugin/public'; +import { ConsolePluginStart } from '@kbn/console-plugin/public'; import { ManagementSetup, ManagementStart } from '@kbn/management-plugin/public'; import { SecurityPluginStart } from '@kbn/security-plugin/public'; import { ServerlessPluginSetup, ServerlessPluginStart } from '@kbn/serverless/public'; @@ -26,6 +27,7 @@ export interface ServerlessSearchPluginSetupDependencies { export interface ServerlessSearchPluginStartDependencies { cloud: CloudStart; + console: ConsolePluginStart; management: ManagementStart; security: SecurityPluginStart; serverless: ServerlessPluginStart; diff --git a/x-pack/plugins/serverless_search/tsconfig.json b/x-pack/plugins/serverless_search/tsconfig.json index 48eed31ef78d3..ef6072e765a66 100644 --- a/x-pack/plugins/serverless_search/tsconfig.json +++ b/x-pack/plugins/serverless_search/tsconfig.json @@ -42,5 +42,6 @@ "@kbn/usage-collection-plugin", "@kbn/es-types", "@kbn/code-editor", + "@kbn/console-plugin", ] }