diff --git a/.buildkite/scripts/steps/storybooks/build_and_upload.ts b/.buildkite/scripts/steps/storybooks/build_and_upload.ts index 13b346794f7b4..10128470005ce 100644 --- a/.buildkite/scripts/steps/storybooks/build_and_upload.ts +++ b/.buildkite/scripts/steps/storybooks/build_and_upload.ts @@ -18,7 +18,6 @@ const STORYBOOKS = [ 'canvas', 'cases', 'cell_actions', - 'cloud_chat', 'coloring', 'chart_icons', 'content_management_examples', diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index 55a2a19040aec..a99e030a4adc1 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -487,7 +487,8 @@ The plugin exposes the static DefaultEditorController class to consume. |{kib-repo}blob/{branch}/x-pack/plugins/cloud_integrations/cloud_chat/README.md[cloudChat] -|Integrates with DriftChat in order to provide live support to our Elastic Cloud users. This plugin should only run on Elastic Cloud. +|The plugin was meant to integrate with DriftChat in order to provide live support to our Elastic Cloud users. +It was removed, but the plugin was left behind to register no longer used config keys. |{kib-repo}blob/{branch}/x-pack/plugins/cloud_integrations/cloud_data_migration/README.md[cloudDataMigration] diff --git a/packages/kbn-optimizer/limits.yml b/packages/kbn-optimizer/limits.yml index da5ba0500eeb9..8af1cb4460ecb 100644 --- a/packages/kbn-optimizer/limits.yml +++ b/packages/kbn-optimizer/limits.yml @@ -11,7 +11,6 @@ pageLoadAssetSize: cases: 180037 charts: 55000 cloud: 21076 - cloudChat: 19894 cloudDataMigration: 19170 cloudDefend: 18697 cloudExperiments: 109746 diff --git a/src/dev/storybook/aliases.ts b/src/dev/storybook/aliases.ts index 4d52c77fc8e20..07e92a23f9bc5 100644 --- a/src/dev/storybook/aliases.ts +++ b/src/dev/storybook/aliases.ts @@ -16,7 +16,6 @@ export const storybookAliases = { canvas: 'x-pack/plugins/canvas/storybook', cases: 'packages/kbn-cases-components/.storybook', cell_actions: 'packages/kbn-cell-actions/.storybook', - cloud_chat: 'x-pack/plugins/cloud_integrations/cloud_chat/.storybook', cloud: 'packages/cloud/.storybook', coloring: 'packages/kbn-coloring/.storybook', language_documentation_popover: 'packages/kbn-language-documentation/.storybook', diff --git a/test/plugin_functional/config.ts b/test/plugin_functional/config.ts index 88eef1ff3ee15..dbdf8f033848a 100644 --- a/test/plugin_functional/config.ts +++ b/test/plugin_functional/config.ts @@ -59,8 +59,6 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { // We want to test when the banner is shown '--telemetry.banner=true', // explicitly enable the cloud integration plugins to validate the rendered config keys - '--xpack.cloud_integrations.chat.enabled=true', - '--xpack.cloud_integrations.chat.chatURL=a_string', '--xpack.cloud_integrations.experiments.enabled=true', '--xpack.cloud_integrations.experiments.launch_darkly.sdk_key=a_string', '--xpack.cloud_integrations.experiments.launch_darkly.client_id=a_string', diff --git a/test/plugin_functional/test_suites/core_plugins/rendering.ts b/test/plugin_functional/test_suites/core_plugins/rendering.ts index f1922eee52380..b0e915cbbc735 100644 --- a/test/plugin_functional/test_suites/core_plugins/rendering.ts +++ b/test/plugin_functional/test_suites/core_plugins/rendering.ts @@ -233,8 +233,6 @@ export default function ({ getService }: PluginFunctionalProviderContext) { 'xpack.cloud.deployments_url (string?)', 'xpack.cloud.is_elastic_staff_owned (boolean?)', 'xpack.cloud.trial_end_date (string?)', - 'xpack.cloud_integrations.chat.chatURL (string?)', - 'xpack.cloud_integrations.chat.trialBuffer (number?)', // Commented because it's inside a schema conditional, and the test is not able to resolve it. But it's shared. // Added here for documentation purposes. // 'xpack.cloud_integrations.experiments.launch_darkly.client_id (string)', diff --git a/x-pack/.i18nrc.json b/x-pack/.i18nrc.json index 72e35fb16de2f..a46e291093411 100644 --- a/x-pack/.i18nrc.json +++ b/x-pack/.i18nrc.json @@ -18,7 +18,6 @@ "xpack.canvas": "plugins/canvas", "xpack.cases": "plugins/cases", "xpack.cloud": "plugins/cloud", - "xpack.cloudChat": "plugins/cloud_integrations/cloud_chat", "xpack.cloudDefend": "plugins/cloud_defend", "xpack.cloudLinks": "plugins/cloud_integrations/cloud_links", "xpack.cloudDataMigration": "plugins/cloud_integrations/cloud_data_migration", diff --git a/x-pack/plugins/cloud_integrations/cloud_chat/.storybook/decorator.tsx b/x-pack/plugins/cloud_integrations/cloud_chat/.storybook/decorator.tsx deleted file mode 100644 index 6331b82951bf0..0000000000000 --- a/x-pack/plugins/cloud_integrations/cloud_chat/.storybook/decorator.tsx +++ /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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React, { FC, PropsWithChildren } from 'react'; -import { DecoratorFn } from '@storybook/react'; -import { ServicesProvider, CloudChatServices } from '../public/services'; - -// TODO: move to a storybook implementation of the service using parameters. -const services: CloudChatServices = { - chat: { - chatURL: 'https://elasticcloud-production-chat-us-east-1.s3.amazonaws.com/drift-iframe.html', - chatVariant: 'bubble', - user: { - id: 'user-id', - email: 'test-user@elastic.co', - // this doesn't affect chat appearance, - // but a user identity in Drift only - jwt: 'identity-jwt', - trialEndDate: new Date(), - kbnVersion: '8.9.0', - kbnBuildNum: 12345, - }, - }, -}; - -export const getCloudContextProvider: () => FC> = - () => - ({ children }) => - {children}; - -export const getCloudContextDecorator: DecoratorFn = (storyFn) => { - const CloudContextProvider = getCloudContextProvider(); - return {storyFn()}; -}; diff --git a/x-pack/plugins/cloud_integrations/cloud_chat/.storybook/index.ts b/x-pack/plugins/cloud_integrations/cloud_chat/.storybook/index.ts deleted file mode 100644 index 321df983cb20d..0000000000000 --- a/x-pack/plugins/cloud_integrations/cloud_chat/.storybook/index.ts +++ /dev/null @@ -1,8 +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. - */ - -export { getCloudContextDecorator, getCloudContextProvider } from './decorator'; diff --git a/x-pack/plugins/cloud_integrations/cloud_chat/.storybook/main.ts b/x-pack/plugins/cloud_integrations/cloud_chat/.storybook/main.ts deleted file mode 100644 index bf63e08d64c32..0000000000000 --- a/x-pack/plugins/cloud_integrations/cloud_chat/.storybook/main.ts +++ /dev/null @@ -1,10 +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 { defaultConfig } from '@kbn/storybook'; - -module.exports = defaultConfig; diff --git a/x-pack/plugins/cloud_integrations/cloud_chat/.storybook/manager.ts b/x-pack/plugins/cloud_integrations/cloud_chat/.storybook/manager.ts deleted file mode 100644 index 54c3d31c2002f..0000000000000 --- a/x-pack/plugins/cloud_integrations/cloud_chat/.storybook/manager.ts +++ /dev/null @@ -1,20 +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 { addons } from '@storybook/addons'; -import { create } from '@storybook/theming'; -import { PANEL_ID } from '@storybook/addon-actions'; - -addons.setConfig({ - theme: create({ - base: 'light', - brandTitle: 'Cloud Storybook', - brandUrl: 'https://github.com/elastic/kibana/tree/main/x-pack/plugins/cloud', - }), - showPanel: true.valueOf, - selectedPanel: PANEL_ID, -}); diff --git a/x-pack/plugins/cloud_integrations/cloud_chat/.storybook/preview.ts b/x-pack/plugins/cloud_integrations/cloud_chat/.storybook/preview.ts deleted file mode 100644 index 83c512e516d5a..0000000000000 --- a/x-pack/plugins/cloud_integrations/cloud_chat/.storybook/preview.ts +++ /dev/null @@ -1,11 +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 { addDecorator } from '@storybook/react'; -import { getCloudContextDecorator } from './decorator'; - -addDecorator(getCloudContextDecorator); diff --git a/x-pack/plugins/cloud_integrations/cloud_chat/README.md b/x-pack/plugins/cloud_integrations/cloud_chat/README.md index cee3d9f5a6671..edc102df9b7d3 100755 --- a/x-pack/plugins/cloud_integrations/cloud_chat/README.md +++ b/x-pack/plugins/cloud_integrations/cloud_chat/README.md @@ -1,3 +1,4 @@ -# Cloud Chat +# Cloud Chat - Deprecated / Removed -Integrates with DriftChat in order to provide live support to our Elastic Cloud users. This plugin should only run on Elastic Cloud. +The plugin was meant to integrate with DriftChat in order to provide live support to our Elastic Cloud users. +It was removed, but the plugin was left behind to register no longer used config keys. diff --git a/x-pack/plugins/cloud_integrations/cloud_chat/common/constants.ts b/x-pack/plugins/cloud_integrations/cloud_chat/common/constants.ts deleted file mode 100755 index b196959a582d3..0000000000000 --- a/x-pack/plugins/cloud_integrations/cloud_chat/common/constants.ts +++ /dev/null @@ -1,9 +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. - */ - -export const GET_CHAT_USER_DATA_ROUTE_PATH = '/internal/cloud/chat_user'; -export const DEFAULT_TRIAL_BUFFER = 90; diff --git a/x-pack/plugins/cloud_integrations/cloud_chat/common/types.ts b/x-pack/plugins/cloud_integrations/cloud_chat/common/types.ts deleted file mode 100644 index 8b7d316ceedfa..0000000000000 --- a/x-pack/plugins/cloud_integrations/cloud_chat/common/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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export type ChatVariant = 'header' | 'bubble'; - -export interface GetChatUserDataResponseBody { - token: string; - email: string; - id: string; - chatVariant: ChatVariant; -} diff --git a/x-pack/plugins/cloud_integrations/cloud_chat/common/util.ts b/x-pack/plugins/cloud_integrations/cloud_chat/common/util.ts deleted file mode 100644 index 9d6cddac77f99..0000000000000 --- a/x-pack/plugins/cloud_integrations/cloud_chat/common/util.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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -/** - * Returns true if today's date is within the an end date + buffer, false otherwise. - * - * @param endDate The end date of the trial. - * @param buffer The number of days to add to the end date. - * @returns true if today's date is within the an end date + buffer, false otherwise. - */ -export const isTodayInDateWindow = (endDate: Date, buffer: number) => { - const endDateWithBuffer = new Date(endDate); - endDateWithBuffer.setDate(endDateWithBuffer.getDate() + buffer); - return endDateWithBuffer > new Date(); -}; diff --git a/x-pack/plugins/cloud_integrations/cloud_chat/jest.config.js b/x-pack/plugins/cloud_integrations/cloud_chat/jest.config.js deleted file mode 100644 index 44f6f241d44d0..0000000000000 --- a/x-pack/plugins/cloud_integrations/cloud_chat/jest.config.js +++ /dev/null @@ -1,18 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../', - roots: ['/x-pack/plugins/cloud_integrations/cloud_chat'], - coverageDirectory: - '/target/kibana-coverage/jest/x-pack/plugins/cloud_integrations/cloud_chat', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '/x-pack/plugins/cloud_integrations/cloud_chat/{common,public,server}/**/*.{ts,tsx}', - ], -}; diff --git a/x-pack/plugins/cloud_integrations/cloud_chat/kibana.jsonc b/x-pack/plugins/cloud_integrations/cloud_chat/kibana.jsonc index 6394ccc7b53f1..dad2a22752df1 100644 --- a/x-pack/plugins/cloud_integrations/cloud_chat/kibana.jsonc +++ b/x-pack/plugins/cloud_integrations/cloud_chat/kibana.jsonc @@ -6,7 +6,7 @@ "plugin": { "id": "cloudChat", "server": true, - "browser": true, + "browser": false, "configPath": [ "xpack", "cloud_integrations", 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 deleted file mode 100644 index debc600de80a7..0000000000000 --- a/x-pack/plugins/cloud_integrations/cloud_chat/public/components/chat/chat.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; 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 { WhenIdle } from './when_idle'; -import { useChatConfig, ChatApi } from './use_chat_config'; -export type { ChatApi } from './use_chat_config'; - -export interface Props { - /** Handler invoked when the chat widget signals it is ready. */ - onReady?: (chatApi: ChatApi) => void; - /** Handler invoked when the chat widget signals to be resized. */ - onResize?: () => void; - /** Handler invoked when the playbook is fired. */ - onPlaybookFired?: () => void; - /** The offset from the top of the page to the chat widget. */ - topOffset?: number; -} - -/** - * A component that will display a trigger that will allow the user to chat with a human operator, - * when the service is enabled; otherwise, it renders nothing. - */ -export const Chat = ({ onReady, onResize, onPlaybookFired, topOffset = 0 }: Props) => { - const config = useChatConfig({ - onReady, - onResize, - onPlaybookFired, - }); - - if (!config.enabled) { - return null; - } - - return ( - -