diff --git a/x-pack/plugins/cloud_integrations/cloud_chat/public/components/chat/chat.tsx b/x-pack/plugins/cloud_integrations/cloud_chat/public/components/chat/chat.tsx index f58c5d0834ae2..1a11542699ed3 100644 --- a/x-pack/plugins/cloud_integrations/cloud_chat/public/components/chat/chat.tsx +++ b/x-pack/plugins/cloud_integrations/cloud_chat/public/components/chat/chat.tsx @@ -37,10 +37,10 @@ export const Chat = ({ onHide = () => {}, onReady, onResize }: Props) => { } const { isReady, isResized, style } = config; - const { bottom, height, right } = style; + const { right } = style; const buttonCSS = css` - bottom: calc(${bottom} + ${height}); + bottom: ${euiThemeVars.euiSizeXS}; position: fixed; right: calc(${right} + ${euiThemeVars.euiSizeXS}); visibility: ${isReady && isResized ? 'visible' : 'hidden'}; diff --git a/x-pack/plugins/observability/kibana.jsonc b/x-pack/plugins/observability/kibana.jsonc index c60511b3ec6a5..a69ffbd0234f6 100644 --- a/x-pack/plugins/observability/kibana.jsonc +++ b/x-pack/plugins/observability/kibana.jsonc @@ -29,8 +29,8 @@ "unifiedSearch", "visualizations" ], - "optionalPlugins": ["discover", "home", "licensing", "usageCollection"], - "requiredBundles": ["data", "kibanaReact", "kibanaUtils", "unifiedSearch"], + "optionalPlugins": ["discover", "home", "licensing", "usageCollection", "cloud"], + "requiredBundles": ["data", "kibanaReact", "kibanaUtils", "unifiedSearch", "cloudChat"], "extraPublicDirs": ["common"] } } diff --git a/x-pack/plugins/observability/public/application/index.tsx b/x-pack/plugins/observability/public/application/index.tsx index b04dfca154d6b..ea0294f1eca77 100644 --- a/x-pack/plugins/observability/public/application/index.tsx +++ b/x-pack/plugins/observability/public/application/index.tsx @@ -85,43 +85,50 @@ export const renderApp = ({ const ApplicationUsageTrackingProvider = usageCollection?.components.ApplicationUsageTrackingProvider ?? React.Fragment; + const CloudProvider = plugins.cloud?.CloudContextProvider ?? React.Fragment; + ReactDOM.render( - - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + , diff --git a/x-pack/plugins/observability/public/pages/overview/overview.tsx b/x-pack/plugins/observability/public/pages/overview/overview.tsx index 5212897a5c53c..a938cdc98023e 100644 --- a/x-pack/plugins/observability/public/pages/overview/overview.tsx +++ b/x-pack/plugins/observability/public/pages/overview/overview.tsx @@ -11,6 +11,7 @@ import { BoolQuery } from '@kbn/es-query'; import { i18n } from '@kbn/i18n'; import { AlertConsumers } from '@kbn/rule-data-utils'; import { useBreadcrumbs, useFetcher } from '@kbn/observability-shared-plugin/public'; +import { Chat } from '@kbn/cloud-chat-plugin/public'; import { useKibana } from '../../utils/kibana_react'; import { LoadingObservability } from '../../components/loading_observability'; @@ -240,6 +241,8 @@ export function OverviewPage() { {isDataAssistantFlyoutVisible ? ( setIsDataAssistantFlyoutVisible(false)} /> ) : null} + + ); } diff --git a/x-pack/plugins/observability/public/plugin.ts b/x-pack/plugins/observability/public/plugin.ts index f0b515f554973..fd6300eff8caa 100644 --- a/x-pack/plugins/observability/public/plugin.ts +++ b/x-pack/plugins/observability/public/plugin.ts @@ -26,6 +26,7 @@ import type { DiscoverStart } from '@kbn/discover-plugin/public'; import type { EmbeddableStart } from '@kbn/embeddable-plugin/public'; import type { HomePublicPluginSetup, HomePublicPluginStart } from '@kbn/home-plugin/public'; import type { ChartsPluginStart } from '@kbn/charts-plugin/public'; +import type { CloudStart } from '@kbn/cloud-plugin/public'; import type { ObservabilitySharedPluginSetup, ObservabilitySharedPluginStart, @@ -117,6 +118,7 @@ export interface ObservabilityPublicPluginsStart { usageCollection: UsageCollectionSetup; unifiedSearch: UnifiedSearchPublicPluginStart; home?: HomePublicPluginStart; + cloud?: CloudStart; } export type ObservabilityPublicStart = ReturnType; diff --git a/x-pack/plugins/observability/tsconfig.json b/x-pack/plugins/observability/tsconfig.json index 4adbf40cd1d94..77f668338ba35 100644 --- a/x-pack/plugins/observability/tsconfig.json +++ b/x-pack/plugins/observability/tsconfig.json @@ -75,7 +75,9 @@ "@kbn/ui-actions-plugin", "@kbn/field-types", "@kbn/safer-lodash-set", - "@kbn/core-http-server" + "@kbn/core-http-server", + "@kbn/cloud-chat-plugin", + "@kbn/cloud-plugin" ], "exclude": [ "target/**/*" diff --git a/x-pack/plugins/security_solution/kibana.jsonc b/x-pack/plugins/security_solution/kibana.jsonc index b279ea77e0bac..f24dffb58edc6 100644 --- a/x-pack/plugins/security_solution/kibana.jsonc +++ b/x-pack/plugins/security_solution/kibana.jsonc @@ -68,7 +68,8 @@ "usageCollection", "lists", "ml", - "unifiedSearch" + "unifiedSearch", + "cloudChat" ], "extraPublicDirs": [ "common" diff --git a/x-pack/plugins/security_solution/public/app/app.tsx b/x-pack/plugins/security_solution/public/app/app.tsx index 3aac1b90bed37..ef4e05a5046e4 100644 --- a/x-pack/plugins/security_solution/public/app/app.tsx +++ b/x-pack/plugins/security_solution/public/app/app.tsx @@ -153,23 +153,29 @@ const SecurityAppComponent: React.FC = ({ setHeaderActionMenu, store, theme$, -}) => ( - - { + const CloudProvider = services.cloud?.CloudContextProvider ?? React.Fragment; + + return ( + - {children} - - -); + + + {children} + + + + ); +}; export const SecurityApp = memo(SecurityAppComponent); diff --git a/x-pack/plugins/security_solution/public/overview/pages/landing.tsx b/x-pack/plugins/security_solution/public/overview/pages/landing.tsx index c12eae3e0a7b5..71dd89fe0ba7f 100644 --- a/x-pack/plugins/security_solution/public/overview/pages/landing.tsx +++ b/x-pack/plugins/security_solution/public/overview/pages/landing.tsx @@ -7,6 +7,7 @@ import React, { memo } from 'react'; import useObservable from 'react-use/lib/useObservable'; +import { Chat } from '@kbn/cloud-chat-plugin/public'; import { SpyRoute } from '../../common/utils/route/spy_routes'; import { SecurityPageName } from '../../../common/constants'; import { LandingPageComponent } from '../../common/components/landing_page'; @@ -24,6 +25,7 @@ export const LandingPage = memo(() => { )} + ); diff --git a/x-pack/plugins/security_solution/tsconfig.json b/x-pack/plugins/security_solution/tsconfig.json index 46ba02332e5c3..a4d2e2873a072 100644 --- a/x-pack/plugins/security_solution/tsconfig.json +++ b/x-pack/plugins/security_solution/tsconfig.json @@ -160,6 +160,7 @@ "@kbn/url-state", "@kbn/ml-anomaly-utils", "@kbn/field-formats-plugin", - "@kbn/dev-proc-runner" + "@kbn/dev-proc-runner", + "@kbn/cloud-chat-plugin" ] } diff --git a/x-pack/test/cloud_integration/config.ts b/x-pack/test/cloud_integration/config.ts index efa0096e5a199..6ce2950753394 100644 --- a/x-pack/test/cloud_integration/config.ts +++ b/x-pack/test/cloud_integration/config.ts @@ -95,7 +95,15 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { 'dateFormat:tz': 'UTC', }, }, - apps: kibanaFunctionalConfig.get('apps'), + apps: { + ...kibanaFunctionalConfig.get('apps'), + observability: { + pathname: '/app/observability', + }, + security: { + pathname: '/app/security', + }, + }, screenshots: { directory: resolve(__dirname, 'screenshots') }, junit: { diff --git a/x-pack/test/cloud_integration/tests/chat.ts b/x-pack/test/cloud_integration/tests/chat.ts index 25bb869805d12..1f50386a8dcf9 100644 --- a/x-pack/test/cloud_integration/tests/chat.ts +++ b/x-pack/test/cloud_integration/tests/chat.ts @@ -21,7 +21,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('chat widget is present on integrations page', async () => { - PageObjects.common.navigateToUrl('integrations', 'browse', { + await PageObjects.common.navigateToUrl('integrations', 'browse', { useActualUrl: true, shouldUseHashForSubUrl: false, }); @@ -29,16 +29,37 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('chat widget is present on home getting_started page', async () => { - PageObjects.common.navigateToUrl('home', '/getting_started', { + await PageObjects.common.navigateToUrl('home', '/getting_started', { useActualUrl: true, shouldUseHashForSubUrl: true, }); await testSubjects.existOrFail('cloud-chat'); }); + it('chat widget is present on management page', async () => { + await PageObjects.common.navigateToApp('management'); + await testSubjects.existOrFail('cloud-chat'); + }); + it('chat widget is present on management page', async () => { PageObjects.common.navigateToApp('management'); await testSubjects.existOrFail('cloud-chat'); }); + + it('chat widget is present on observability/overview page', async () => { + await PageObjects.common.navigateToUrl('observability', '/overview', { + useActualUrl: true, + shouldUseHashForSubUrl: true, + }); + await testSubjects.existOrFail('cloud-chat'); + }); + + it('chat widget is present on security/get_started page', async () => { + await PageObjects.common.navigateToUrl('security', '/get_started', { + useActualUrl: true, + shouldUseHashForSubUrl: true, + }); + await testSubjects.existOrFail('cloud-chat'); + }); }); }