From 51d5387b8bef626f4393baf874a79438cf8a3587 Mon Sep 17 00:00:00 2001 From: Jonathan Budzenski Date: Fri, 21 Apr 2023 11:48:50 -0500 Subject: [PATCH 1/3] skip flaky suite (#155534) --- .../metric_threshold/metric_threshold_executor.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.test.ts b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.test.ts index eca33d020130d..fb8121d224187 100644 --- a/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.test.ts +++ b/x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.test.ts @@ -130,7 +130,8 @@ const setEvaluationResults = (response: Array>) => { jest.requireMock('./lib/evaluate_rule').evaluateRule.mockImplementation(() => response); }; -describe('The metric threshold alert type', () => { +// FAILING: https://github.com/elastic/kibana/issues/155534 +describe.skip('The metric threshold alert type', () => { describe('querying the entire infrastructure', () => { afterAll(() => clearInstances()); const instanceID = '*'; From 791555641ce683a239f255d1d7c9163ad021aa3d Mon Sep 17 00:00:00 2001 From: Ignacio Rivas Date: Fri, 21 Apr 2023 18:54:19 +0200 Subject: [PATCH 2/3] [Snapshot Restore] Migrate away from EuiCodeEditor in favour of Monaco (#155368) --- .../helpers/repository_edit.helpers.ts | 1 + .../helpers/setup_environment.tsx | 21 ++++++++++---- ..._edit.test.ts => repository_edit.test.tsx} | 22 ++++++++++++-- .../public/application/app_context.tsx | 3 +- .../type_settings/hdfs_settings.tsx | 22 +++++--------- .../steps/step_review.tsx | 17 +++++------ .../steps/step_settings.tsx | 23 +++++---------- .../public/application/index.tsx | 9 ++++-- .../application/mount_management_section.ts | 1 + .../policy_details/tabs/tab_history.tsx | 27 +++++------------ .../type_details/default_details.tsx | 29 +++++-------------- .../snapshot_restore/public/shared_imports.ts | 1 - 12 files changed, 85 insertions(+), 91 deletions(-) rename x-pack/plugins/snapshot_restore/__jest__/client_integration/{repository_edit.test.ts => repository_edit.test.tsx} (93%) diff --git a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/repository_edit.helpers.ts b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/repository_edit.helpers.ts index 04ddabf9c1bfd..0807f8985af90 100644 --- a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/repository_edit.helpers.ts +++ b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/repository_edit.helpers.ts @@ -88,4 +88,5 @@ type TestSubjects = | 'stepTwo.submitButton' | 'stepTwo.title' | 'submitButton' + | 'codeEditor' | 'title'; diff --git a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/setup_environment.tsx b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/setup_environment.tsx index 1124a179d245d..7eef715118c95 100644 --- a/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/setup_environment.tsx +++ b/x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/setup_environment.tsx @@ -10,6 +10,7 @@ import { i18n } from '@kbn/i18n'; import { merge } from 'lodash'; import { LocationDescriptorObject } from 'history'; +import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { HttpSetup } from '@kbn/core/public'; import { coreMock, scopedHistoryMock } from '@kbn/core/public/mocks'; import { setUiMetricService, httpService } from '../../../public/application/services/http'; @@ -50,8 +51,10 @@ export const services = { setUiMetricService(services.uiMetricService); +const core = coreMock.createStart(); + const appDependencies = { - core: coreMock.createStart(), + core, services, config: { slm_ui: { enabled: true }, @@ -59,6 +62,10 @@ const appDependencies = { plugins: {}, }; +const kibanaContextDependencies = { + uiSettings: core.uiSettings, +}; + export const setupEnvironment = () => { breadcrumbService.setup(() => undefined); textService.setup(i18n); @@ -88,11 +95,13 @@ export const WithAppDependencies = - - - - - + + + + + + + ); }; diff --git a/x-pack/plugins/snapshot_restore/__jest__/client_integration/repository_edit.test.ts b/x-pack/plugins/snapshot_restore/__jest__/client_integration/repository_edit.test.tsx similarity index 93% rename from x-pack/plugins/snapshot_restore/__jest__/client_integration/repository_edit.test.ts rename to x-pack/plugins/snapshot_restore/__jest__/client_integration/repository_edit.test.tsx index 102c0d13a012b..dc05d9c09e627 100644 --- a/x-pack/plugins/snapshot_restore/__jest__/client_integration/repository_edit.test.ts +++ b/x-pack/plugins/snapshot_restore/__jest__/client_integration/repository_edit.test.tsx @@ -5,6 +5,7 @@ * 2.0. */ +import React from 'react'; import { act } from 'react-dom/test-utils'; import { setupEnvironment, pageHelpers, nextTick, TestBed, getRandomString } from './helpers'; @@ -16,6 +17,23 @@ import { REPOSITORY_EDIT, REPOSITORY_NAME } from './helpers/constant'; const { setup } = pageHelpers.repositoryEdit; const { setup: setupRepositoryAdd } = pageHelpers.repositoryAdd; +jest.mock('@kbn/kibana-react-plugin/public', () => { + const original = jest.requireActual('@kbn/kibana-react-plugin/public'); + return { + ...original, + // Mocking CodeEditor, which uses React Monaco under the hood + CodeEditor: (props: any) => ( + { + props.onChange(e.jsonContent); + }} + /> + ), + }; +}); + describe('', () => { let testBed: TestBed; let testBedRepositoryAdd: TestBed; @@ -211,8 +229,8 @@ describe('', () => { ); expect(find('readOnlyToggle').props()['aria-checked']).toBe(settings.readonly); - const codeEditor = testBed.component.find('EuiCodeEditor').at(1); - expect(JSON.parse(codeEditor.props().value as string)).toEqual({ + const codeEditorValue = testBed.find('codeEditor').props()['data-currentvalue']; + expect(JSON.parse(codeEditorValue)).toEqual({ loadDefault: true, conf1: 'foo', conf2: 'bar', diff --git a/x-pack/plugins/snapshot_restore/public/application/app_context.tsx b/x-pack/plugins/snapshot_restore/public/application/app_context.tsx index 4f36da98cfed6..85e4b3b079541 100644 --- a/x-pack/plugins/snapshot_restore/public/application/app_context.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/app_context.tsx @@ -9,7 +9,7 @@ import React, { createContext, useContext } from 'react'; import { i18n } from '@kbn/i18n'; import { Observable } from 'rxjs'; -import { CoreStart, ScopedHistory, CoreTheme } from '@kbn/core/public'; +import { CoreStart, ScopedHistory, CoreTheme, IUiSettingsClient } from '@kbn/core/public'; import { ClientConfigType } from '../types'; import { HttpService, UiMetricService } from './services'; @@ -18,6 +18,7 @@ const AppContext = createContext(undefined); export interface AppDependencies { core: CoreStart; services: { + uiSettings: IUiSettingsClient; httpService: HttpService; uiMetricService: UiMetricService; i18n: typeof i18n; diff --git a/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/hdfs_settings.tsx b/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/hdfs_settings.tsx index 724f3a6a17a5f..6abb387e87a1a 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/hdfs_settings.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/repository_form/type_settings/hdfs_settings.tsx @@ -18,8 +18,8 @@ import { EuiTitle, } from '@elastic/eui'; +import { CodeEditor } from '@kbn/kibana-react-plugin/public'; import { HDFSRepository, Repository, SourceRepository } from '../../../../../common/types'; -import { EuiCodeEditor } from '../../../../shared_imports'; import { RepositorySettingsValidation } from '../../../services/validation'; import { ChunkSizeField, MaxSnapshotsField, MaxRestoreField } from './common'; @@ -347,21 +347,16 @@ export const HDFSSettings: React.FunctionComponent = ({ /> } > - = ({ setIsConfInvalid(true); } }} - data-test-subj="codeEditor" /> diff --git a/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/steps/step_review.tsx b/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/steps/step_review.tsx index 2f650ee754259..09feaf61ca9e7 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/steps/step_review.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/steps/step_review.tsx @@ -21,9 +21,9 @@ import { EuiLink, EuiIcon, EuiToolTip, + EuiCodeBlock, } from '@elastic/eui'; import { serializeRestoreSettings } from '../../../../../common/lib'; -import { EuiCodeEditor } from '../../../../shared_imports'; import { useServices } from '../../../app_context'; import { StepProps } from '.'; import { CollapsibleIndicesList } from '../../collapsible_lists'; @@ -285,18 +285,17 @@ export const RestoreSnapshotStepReview: React.FunctionComponent = ({ const renderJsonTab = () => ( - + > + {JSON.stringify(serializedRestoreSettings, null, 2)} + ); diff --git a/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/steps/step_settings.tsx b/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/steps/step_settings.tsx index 46ad27e9a997b..70da1ebb1e449 100644 --- a/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/steps/step_settings.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/components/restore_snapshot_form/steps/step_settings.tsx @@ -21,8 +21,8 @@ import { EuiLink, EuiCallOut, } from '@elastic/eui'; +import { CodeEditor } from '@kbn/kibana-react-plugin/public'; import { RestoreSettings } from '../../../../../common/types'; -import { EuiCodeEditor } from '../../../../shared_imports'; import { REMOVE_INDEX_SETTINGS_SUGGESTIONS } from '../../../constants'; import { useCore, useServices } from '../../../app_context'; import { StepProps } from '.'; @@ -190,22 +190,15 @@ export const RestoreSnapshotStepSettings: React.FunctionComponent = ( /> } > - ( export const renderApp = (elem: Element, dependencies: AppDependencies) => { render( - - - , + + + + + , elem ); diff --git a/x-pack/plugins/snapshot_restore/public/application/mount_management_section.ts b/x-pack/plugins/snapshot_restore/public/application/mount_management_section.ts index 352e7c37f7ee2..b86cfe6318c80 100644 --- a/x-pack/plugins/snapshot_restore/public/application/mount_management_section.ts +++ b/x-pack/plugins/snapshot_restore/public/application/mount_management_section.ts @@ -37,6 +37,7 @@ export async function mountManagementSection( core, config, services: { + uiSettings: coreSetup.uiSettings, httpService, uiMetricService: services.uiMetricService, i18n, diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_details/tabs/tab_history.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_details/tabs/tab_history.tsx index aee603d5d7f6d..b3256f2a0c6ff 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_details/tabs/tab_history.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/policy_list/policy_details/tabs/tab_history.tsx @@ -19,11 +19,11 @@ import { EuiText, EuiHorizontalRule, EuiSpacer, + EuiCodeBlock, } from '@elastic/eui'; import { reactRouterNavigate } from '@kbn/kibana-react-plugin/public'; import { SlmPolicy } from '../../../../../../../common/types'; -import { EuiCodeEditor } from '../../../../../../shared_imports'; import { FormattedDateTime } from '../../../../../components'; import { linkToSnapshot } from '../../../../../services/navigation'; import { useServices } from '../../../../../app_context'; @@ -148,23 +148,10 @@ export const TabHistory: React.FunctionComponent = ({ policy }) => { - = ({ policy }) => { values: { name }, } )} - /> + > + {JSON.stringify(details, null, 2)} + diff --git a/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/default_details.tsx b/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/default_details.tsx index c1a379785ffd1..fb03299102db9 100644 --- a/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/default_details.tsx +++ b/x-pack/plugins/snapshot_restore/public/application/sections/home/repository_list/repository_details/type_details/default_details.tsx @@ -5,15 +5,12 @@ * 2.0. */ -import 'react-ace'; -import 'brace/theme/textmate'; import React, { Fragment } from 'react'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import { EuiSpacer, EuiTitle } from '@elastic/eui'; +import { EuiCodeBlock, EuiSpacer, EuiTitle } from '@elastic/eui'; import { Repository } from '../../../../../../../common/types'; -import { EuiCodeEditor } from '../../../../../../shared_imports'; interface Props { repository: Repository; @@ -35,22 +32,10 @@ export const DefaultDetails: React.FunctionComponent = ({ - = ({ }, } )} - /> + > + {JSON.stringify(settings, null, 2)} + ); }; diff --git a/x-pack/plugins/snapshot_restore/public/shared_imports.ts b/x-pack/plugins/snapshot_restore/public/shared_imports.ts index 749d5ed51b53b..4a3ec13727dd1 100644 --- a/x-pack/plugins/snapshot_restore/public/shared_imports.ts +++ b/x-pack/plugins/snapshot_restore/public/shared_imports.ts @@ -28,7 +28,6 @@ export { useAuthorizationContext, useRequest, WithPrivileges, - EuiCodeEditor, AuthorizationContext, GlobalFlyout, } from '@kbn/es-ui-shared-plugin/public'; From 376c48a7bd45388be7e77e576b1a09c3c425e413 Mon Sep 17 00:00:00 2001 From: Ignacio Rivas Date: Fri, 21 Apr 2023 18:55:13 +0200 Subject: [PATCH 3/3] [Watcher] Migrate from EuiCodeEditor to Monaco (#155486) --- .../helpers/setup_environment.tsx | 9 ++++--- .../helpers/watch_edit_page.helpers.ts | 1 + ..._page.test.ts => watch_edit_page.test.tsx} | 24 ++++++++++++++++--- .../watcher/public/application/index.tsx | 9 ++++--- .../json_watch_edit/json_watch_edit_form.tsx | 19 ++++++++------- .../json_watch_edit_simulate.tsx | 22 +++++++++-------- .../action_fields/webhook_action_fields.tsx | 18 ++++++++------ .../public/application/shared_imports.ts | 8 +------ x-pack/plugins/watcher/tsconfig.json | 1 - 9 files changed, 69 insertions(+), 42 deletions(-) rename x-pack/plugins/watcher/__jest__/client_integration/{watch_edit_page.test.ts => watch_edit_page.test.tsx} (88%) diff --git a/x-pack/plugins/watcher/__jest__/client_integration/helpers/setup_environment.tsx b/x-pack/plugins/watcher/__jest__/client_integration/helpers/setup_environment.tsx index 39ce0108a4d41..89c3407f83a46 100644 --- a/x-pack/plugins/watcher/__jest__/client_integration/helpers/setup_environment.tsx +++ b/x-pack/plugins/watcher/__jest__/client_integration/helpers/setup_environment.tsx @@ -7,6 +7,7 @@ import React from 'react'; import { HttpSetup } from '@kbn/core/public'; +import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { init as initHttpRequests } from './http_requests'; import { mockContextValue } from './app_context.mock'; @@ -18,9 +19,11 @@ export const WithAppDependencies = setHttpClient(httpSetup); return ( - - - + + + + + ); }; diff --git a/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_edit_page.helpers.ts b/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_edit_page.helpers.ts index cbda9eb293a70..20f8389c0fec7 100644 --- a/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_edit_page.helpers.ts +++ b/x-pack/plugins/watcher/__jest__/client_integration/helpers/watch_edit_page.helpers.ts @@ -56,5 +56,6 @@ export type TestSubjects = | 'jsonWatchForm' | 'nameInput' | 'pageTitle' + | 'jsonEditor' | 'thresholdWatchForm' | 'watchTimeFieldSelect'; diff --git a/x-pack/plugins/watcher/__jest__/client_integration/watch_edit_page.test.ts b/x-pack/plugins/watcher/__jest__/client_integration/watch_edit_page.test.tsx similarity index 88% rename from x-pack/plugins/watcher/__jest__/client_integration/watch_edit_page.test.ts rename to x-pack/plugins/watcher/__jest__/client_integration/watch_edit_page.test.tsx index 0da6fa68bd856..ba38fbd5b3cc7 100644 --- a/x-pack/plugins/watcher/__jest__/client_integration/watch_edit_page.test.ts +++ b/x-pack/plugins/watcher/__jest__/client_integration/watch_edit_page.test.tsx @@ -5,6 +5,7 @@ * 2.0. */ +import React from 'react'; import { act } from 'react-dom/test-utils'; import { getWatch } from '../../__fixtures__'; @@ -16,6 +17,23 @@ import { API_BASE_PATH } from '../../common/constants'; const { setup } = pageHelpers.watchEditPage; +jest.mock('@kbn/kibana-react-plugin/public', () => { + const original = jest.requireActual('@kbn/kibana-react-plugin/public'); + return { + ...original, + // Mocking CodeEditor, which uses React Monaco under the hood + CodeEditor: (props: any) => ( + { + props.onChange(e.jsonContent); + }} + /> + ), + }; +}); + describe('', () => { const { httpSetup, httpRequestsMockHelpers } = setupEnvironment(); let testBed: WatchEditTestBed; @@ -43,14 +61,14 @@ describe('', () => { }); test('should populate the correct values', () => { - const { find, exists, component } = testBed; + const { find, exists } = testBed; const { watch } = WATCH; - const codeEditor = component.find('EuiCodeEditor').at(1); + const jsonEditorValue = testBed.find('jsonEditor').props()['data-currentvalue']; expect(exists('jsonWatchForm')).toBe(true); expect(find('nameInput').props().value).toBe(watch.name); expect(find('idInput').props().value).toBe(watch.id); - expect(JSON.parse(codeEditor.props().value as string)).toEqual(defaultWatch); + expect(JSON.parse(jsonEditorValue)).toEqual(defaultWatch); // ID should not be editable expect(find('idInput').props().readOnly).toEqual(true); diff --git a/x-pack/plugins/watcher/public/application/index.tsx b/x-pack/plugins/watcher/public/application/index.tsx index dc12832825b81..8c2edb133660d 100644 --- a/x-pack/plugins/watcher/public/application/index.tsx +++ b/x-pack/plugins/watcher/public/application/index.tsx @@ -9,6 +9,7 @@ import React from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; import { Observable } from 'rxjs'; import { CoreTheme } from '@kbn/core/public'; +import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { KibanaThemeProvider } from './shared_imports'; import { App, AppDeps } from './app'; @@ -27,9 +28,11 @@ export const renderApp = (bootDeps: BootDeps) => { render( - - - + + + + + , element ); diff --git a/x-pack/plugins/watcher/public/application/sections/watch_edit_page/components/json_watch_edit/json_watch_edit_form.tsx b/x-pack/plugins/watcher/public/application/sections/watch_edit_page/components/json_watch_edit/json_watch_edit_form.tsx index 95db0ab535f8e..ef71362bf22a1 100644 --- a/x-pack/plugins/watcher/public/application/sections/watch_edit_page/components/json_watch_edit/json_watch_edit_form.tsx +++ b/x-pack/plugins/watcher/public/application/sections/watch_edit_page/components/json_watch_edit/json_watch_edit_form.tsx @@ -20,18 +20,17 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import { XJsonMode } from '@kbn/ace'; +import { CodeEditor } from '@kbn/kibana-react-plugin/public'; +import { XJson } from '../../../../shared_imports'; import { serializeJsonWatch } from '../../../../../../common/lib/serialization'; import { ErrableFormRow, SectionError, Error as ServerError } from '../../../../components'; -import { XJson, EuiCodeEditor } from '../../../../shared_imports'; import { onWatchSave } from '../../watch_edit_actions'; import { WatchContext } from '../../watch_context'; import { goToWatchList } from '../../../../lib/navigation'; import { RequestFlyout } from '../request_flyout'; import { useAppContext } from '../../../../app_context'; -const xJsonMode = new XJsonMode(); const { useXJsonMode } = XJson; export const JsonWatchEditForm = () => { @@ -168,18 +167,22 @@ export const JsonWatchEditForm = () => { fullWidth errors={jsonErrors} > - { if (validationError) { setValidationError(null); diff --git a/x-pack/plugins/watcher/public/application/sections/watch_edit_page/components/json_watch_edit/json_watch_edit_simulate.tsx b/x-pack/plugins/watcher/public/application/sections/watch_edit_page/components/json_watch_edit/json_watch_edit_simulate.tsx index 9e2fa3f35b50f..bc6ecfcbc16cc 100644 --- a/x-pack/plugins/watcher/public/application/sections/watch_edit_page/components/json_watch_edit/json_watch_edit_simulate.tsx +++ b/x-pack/plugins/watcher/public/application/sections/watch_edit_page/components/json_watch_edit/json_watch_edit_simulate.tsx @@ -24,9 +24,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import { XJsonMode } from '@kbn/ace'; - -const xJsonMode = new XJsonMode(); +import { CodeEditor } from '@kbn/kibana-react-plugin/public'; import { WatchHistoryItem } from '../../../../models/watch_history_item'; @@ -43,7 +41,7 @@ import { SimulateWatchResultsFlyout } from './simulate_watch_results_flyout'; import { getTimeUnitLabel } from '../../../../lib/get_time_unit_label'; import { useAppContext } from '../../../../app_context'; -import { XJson, EuiCodeEditor } from '../../../../shared_imports'; +import { XJson } from '../../../../shared_imports'; const { useXJsonMode } = XJson; @@ -369,18 +367,22 @@ export const JsonWatchEditSimulate = ({ fullWidth errors={executeWatchErrors} > - { setXJson(xjson); setExecuteDetails( diff --git a/x-pack/plugins/watcher/public/application/sections/watch_edit_page/components/threshold_watch_edit/action_fields/webhook_action_fields.tsx b/x-pack/plugins/watcher/public/application/sections/watch_edit_page/components/threshold_watch_edit/action_fields/webhook_action_fields.tsx index bbe5449fa8732..e7da2c3073870 100644 --- a/x-pack/plugins/watcher/public/application/sections/watch_edit_page/components/threshold_watch_edit/action_fields/webhook_action_fields.tsx +++ b/x-pack/plugins/watcher/public/application/sections/watch_edit_page/components/threshold_watch_edit/action_fields/webhook_action_fields.tsx @@ -18,7 +18,8 @@ import { EuiSpacer, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { EuiCodeEditor } from '../../../../../shared_imports'; +import { CodeEditor } from '@kbn/kibana-react-plugin/public'; + import { ErrableFormRow } from '../../../../../components/form_errors'; import { WebhookAction } from '../../../../../../../common/types/action_types'; @@ -242,19 +243,22 @@ export const WebhookActionFields: React.FunctionComponent = ({ fullWidth errors={errors} > - { editAction({ key: 'body', value: json }); }} diff --git a/x-pack/plugins/watcher/public/application/shared_imports.ts b/x-pack/plugins/watcher/public/application/shared_imports.ts index 971182a22a7a7..2396c7783aeb1 100644 --- a/x-pack/plugins/watcher/public/application/shared_imports.ts +++ b/x-pack/plugins/watcher/public/application/shared_imports.ts @@ -11,12 +11,6 @@ export type { UseRequestConfig, } from '@kbn/es-ui-shared-plugin/public'; -export { - sendRequest, - useRequest, - XJson, - PageError, - EuiCodeEditor, -} from '@kbn/es-ui-shared-plugin/public'; +export { sendRequest, useRequest, XJson, PageError } from '@kbn/es-ui-shared-plugin/public'; export { KibanaThemeProvider, useExecutionContext } from '@kbn/kibana-react-plugin/public'; diff --git a/x-pack/plugins/watcher/tsconfig.json b/x-pack/plugins/watcher/tsconfig.json index 0762abab662de..cd4305fe86779 100644 --- a/x-pack/plugins/watcher/tsconfig.json +++ b/x-pack/plugins/watcher/tsconfig.json @@ -31,7 +31,6 @@ "@kbn/datemath", "@kbn/field-formats-plugin", "@kbn/i18n-react", - "@kbn/ace", "@kbn/shared-ux-router", "@kbn/license-management-plugin", "@kbn/share-plugin",