From 54cc28461ce4b5407f791bdc0a398050f07f4882 Mon Sep 17 00:00:00 2001 From: Muhammad Ibragimov <53621505+mibragimov@users.noreply.github.com> Date: Fri, 24 Dec 2021 14:21:06 +0500 Subject: [PATCH] [Console] Move split_panel component to Console (#121283) * Move split_panel component to Console Co-authored-by: Muhammad Ibragimov Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../public/application/containers/editor/editor.tsx | 2 +- .../console/public/application/containers/index.ts | 1 + .../__snapshots__/split_panel.test.tsx.snap | 0 .../application/containers}/split_panel/index.ts | 4 ++-- .../application/containers/split_panel}/panel.tsx | 2 +- .../containers/split_panel}/panel_container.tsx | 5 ++--- .../application/containers/split_panel}/resizer.tsx | 2 +- .../containers}/split_panel/split_panel.test.tsx | 3 ++- .../console/public/application/contexts/index.ts | 2 ++ .../public/application/contexts/split_panel/index.ts | 10 ++++++++++ .../contexts/split_panel/split_panel_context.tsx} | 2 +- .../contexts/split_panel/split_panel_registry.ts} | 0 src/plugins/kibana_react/public/index.ts | 1 - x-pack/plugins/translations/translations/ja-JP.json | 2 +- x-pack/plugins/translations/translations/zh-CN.json | 2 +- 15 files changed, 25 insertions(+), 13 deletions(-) rename src/plugins/{kibana_react/public => console/public/application/containers}/split_panel/__snapshots__/split_panel.test.tsx.snap (100%) rename src/plugins/{kibana_react/public => console/public/application/containers}/split_panel/index.ts (76%) rename src/plugins/{kibana_react/public/split_panel/containers => console/public/application/containers/split_panel}/panel.tsx (96%) rename src/plugins/{kibana_react/public/split_panel/containers => console/public/application/containers/split_panel}/panel_container.tsx (97%) rename src/plugins/{kibana_react/public/split_panel/components => console/public/application/containers/split_panel}/resizer.tsx (92%) rename src/plugins/{kibana_react/public => console/public/application/containers}/split_panel/split_panel.test.tsx (96%) create mode 100644 src/plugins/console/public/application/contexts/split_panel/index.ts rename src/plugins/{kibana_react/public/split_panel/context.tsx => console/public/application/contexts/split_panel/split_panel_context.tsx} (94%) rename src/plugins/{kibana_react/public/split_panel/registry.ts => console/public/application/contexts/split_panel/split_panel_registry.ts} (100%) diff --git a/src/plugins/console/public/application/containers/editor/editor.tsx b/src/plugins/console/public/application/containers/editor/editor.tsx index b756aa4f28f1b..df017250664e4 100644 --- a/src/plugins/console/public/application/containers/editor/editor.tsx +++ b/src/plugins/console/public/application/containers/editor/editor.tsx @@ -11,7 +11,7 @@ import { debounce } from 'lodash'; import { EuiProgress } from '@elastic/eui'; import { EditorContentSpinner } from '../../components'; -import { Panel, PanelsContainer } from '../../../../../kibana_react/public'; +import { Panel, PanelsContainer } from '../../containers'; import { Editor as EditorUI, EditorOutput } from './legacy/console_editor'; import { StorageKeys } from '../../../services'; import { useEditorReadContext, useServicesContext, useRequestReadContext } from '../../contexts'; diff --git a/src/plugins/console/public/application/containers/index.ts b/src/plugins/console/public/application/containers/index.ts index da7eb41637f21..447b574676144 100644 --- a/src/plugins/console/public/application/containers/index.ts +++ b/src/plugins/console/public/application/containers/index.ts @@ -7,3 +7,4 @@ */ export { Main } from './main'; +export { Panel, PanelsContainer } from './split_panel'; diff --git a/src/plugins/kibana_react/public/split_panel/__snapshots__/split_panel.test.tsx.snap b/src/plugins/console/public/application/containers/split_panel/__snapshots__/split_panel.test.tsx.snap similarity index 100% rename from src/plugins/kibana_react/public/split_panel/__snapshots__/split_panel.test.tsx.snap rename to src/plugins/console/public/application/containers/split_panel/__snapshots__/split_panel.test.tsx.snap diff --git a/src/plugins/kibana_react/public/split_panel/index.ts b/src/plugins/console/public/application/containers/split_panel/index.ts similarity index 76% rename from src/plugins/kibana_react/public/split_panel/index.ts rename to src/plugins/console/public/application/containers/split_panel/index.ts index 6d976fe2f5849..0d54d48c484d9 100644 --- a/src/plugins/kibana_react/public/split_panel/index.ts +++ b/src/plugins/console/public/application/containers/split_panel/index.ts @@ -6,5 +6,5 @@ * Side Public License, v 1. */ -export { Panel } from './containers/panel'; -export { PanelsContainer } from './containers/panel_container'; +export { Panel } from './panel'; +export { PanelsContainer } from './panel_container'; diff --git a/src/plugins/kibana_react/public/split_panel/containers/panel.tsx b/src/plugins/console/public/application/containers/split_panel/panel.tsx similarity index 96% rename from src/plugins/kibana_react/public/split_panel/containers/panel.tsx rename to src/plugins/console/public/application/containers/split_panel/panel.tsx index 436c07adfb224..1bbff074c2829 100644 --- a/src/plugins/kibana_react/public/split_panel/containers/panel.tsx +++ b/src/plugins/console/public/application/containers/split_panel/panel.tsx @@ -7,7 +7,7 @@ */ import React, { CSSProperties, ReactNode, useEffect, useRef, useState } from 'react'; -import { usePanelContext } from '../context'; +import { usePanelContext } from '../../contexts'; export interface Props { children: ReactNode[] | ReactNode; diff --git a/src/plugins/kibana_react/public/split_panel/containers/panel_container.tsx b/src/plugins/console/public/application/containers/split_panel/panel_container.tsx similarity index 97% rename from src/plugins/kibana_react/public/split_panel/containers/panel_container.tsx rename to src/plugins/console/public/application/containers/split_panel/panel_container.tsx index 69beb565ad857..30e200880d2cb 100644 --- a/src/plugins/kibana_react/public/split_panel/containers/panel_container.tsx +++ b/src/plugins/console/public/application/containers/split_panel/panel_container.tsx @@ -9,9 +9,8 @@ import React, { Children, ReactNode, useRef, useState, useCallback, useEffect } from 'react'; import { keys } from '@elastic/eui'; -import { PanelContextProvider } from '../context'; -import { Resizer, ResizerMouseEvent, ResizerKeyDownEvent } from '../components/resizer'; -import { PanelRegistry } from '../registry'; +import { Resizer, ResizerMouseEvent, ResizerKeyDownEvent } from './resizer'; +import { PanelContextProvider, PanelRegistry } from '../../contexts'; export interface Props { children: ReactNode; diff --git a/src/plugins/kibana_react/public/split_panel/components/resizer.tsx b/src/plugins/console/public/application/containers/split_panel/resizer.tsx similarity index 92% rename from src/plugins/kibana_react/public/split_panel/components/resizer.tsx rename to src/plugins/console/public/application/containers/split_panel/resizer.tsx index 8a4c348d482d9..9ead5045805ff 100644 --- a/src/plugins/kibana_react/public/split_panel/components/resizer.tsx +++ b/src/plugins/console/public/application/containers/split_panel/resizer.tsx @@ -24,7 +24,7 @@ export function Resizer(props: Props) {