diff --git a/src/plugins/embeddable/public/lib/containers/container.ts b/src/plugins/embeddable/public/lib/containers/container.ts index 8e7487323cf44..a160c469f05c3 100644 --- a/src/plugins/embeddable/public/lib/containers/container.ts +++ b/src/plugins/embeddable/public/lib/containers/container.ts @@ -44,7 +44,6 @@ import { IContainer, PanelState, } from './i_container'; -import { reactEmbeddableRegistryHasKey } from '../../react_embeddable_system'; const getKeys = (o: T): Array => Object.keys(o) as Array; @@ -548,17 +547,6 @@ export abstract class Container< } private async onPanelAdded(panel: PanelState) { - // do nothing if this panel's type is in the new Embeddable registry. - if (reactEmbeddableRegistryHasKey(panel.type)) { - this.updateOutput({ - embeddableLoaded: { - ...this.output.embeddableLoaded, - [panel.explicitInput.id]: true, - }, - } as Partial); - return; - } - this.updateOutput({ embeddableLoaded: { ...this.output.embeddableLoaded, diff --git a/src/plugins/embeddable/public/mocks.tsx b/src/plugins/embeddable/public/mocks.tsx index fcabaa7cdb6c7..cdfaa8e0ce01b 100644 --- a/src/plugins/embeddable/public/mocks.tsx +++ b/src/plugins/embeddable/public/mocks.tsx @@ -35,10 +35,7 @@ import { import { setKibanaServices } from './kibana_services'; import { SelfStyledOptions } from './lib/self_styled_embeddable/types'; import { EmbeddablePublicPlugin } from './plugin'; -import { - reactEmbeddableRegistryHasKey, - registerReactEmbeddableFactory, -} from './react_embeddable_system'; +import { registerReactEmbeddableFactory } from './react_embeddable_system'; import { registerAddFromLibraryType } from './add_from_library/registry'; export { mockAttributeService } from './lib/attribute_service/attribute_service.mock'; @@ -110,7 +107,6 @@ const createSetupContract = (): Setup => { const createStartContract = (): Start => { const startContract: Start = { - reactEmbeddableRegistryHasKey: jest.fn().mockImplementation(reactEmbeddableRegistryHasKey), getEmbeddableFactories: jest.fn(), getEmbeddableFactory: jest.fn(), telemetry: jest.fn(), diff --git a/src/plugins/embeddable/public/plugin.tsx b/src/plugins/embeddable/public/plugin.tsx index 801b518a0bd01..18af7eda372ec 100644 --- a/src/plugins/embeddable/public/plugin.tsx +++ b/src/plugins/embeddable/public/plugin.tsx @@ -54,10 +54,7 @@ import { } from '../common/lib'; import { getAllMigrations } from '../common/lib/get_all_migrations'; import { setKibanaServices } from './kibana_services'; -import { - reactEmbeddableRegistryHasKey, - registerReactEmbeddableFactory, -} from './react_embeddable_system'; +import { registerReactEmbeddableFactory } from './react_embeddable_system'; import { registerAddFromLibraryType } from './add_from_library/registry'; export interface EmbeddableSetupDependencies { @@ -121,11 +118,6 @@ export interface EmbeddableSetup { } export interface EmbeddableStart extends PersistableStateService { - /** - * Checks if a {@link ReactEmbeddableFactory} has been registered using {@link registerReactEmbeddableFactory} - */ - reactEmbeddableRegistryHasKey: (type: string) => boolean; - /** * @deprecated use {@link registerReactEmbeddableFactory} instead. */ @@ -224,8 +216,6 @@ export class EmbeddablePublicPlugin implements Plugin diff --git a/src/plugins/embeddable/public/react_embeddable_system/index.ts b/src/plugins/embeddable/public/react_embeddable_system/index.ts index d0bd95e32e10e..8b1b59da6767b 100644 --- a/src/plugins/embeddable/public/react_embeddable_system/index.ts +++ b/src/plugins/embeddable/public/react_embeddable_system/index.ts @@ -7,9 +7,6 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -export { - reactEmbeddableRegistryHasKey, - registerReactEmbeddableFactory, -} from './react_embeddable_registry'; +export { registerReactEmbeddableFactory } from './react_embeddable_registry'; export { ReactEmbeddableRenderer } from './react_embeddable_renderer'; export type { DefaultEmbeddableApi, ReactEmbeddableFactory } from './types'; diff --git a/src/plugins/embeddable/public/react_embeddable_system/react_embeddable_registry.test.tsx b/src/plugins/embeddable/public/react_embeddable_system/react_embeddable_registry.test.tsx index aa3e9b0e99675..43f8541fbab7f 100644 --- a/src/plugins/embeddable/public/react_embeddable_system/react_embeddable_registry.test.tsx +++ b/src/plugins/embeddable/public/react_embeddable_system/react_embeddable_registry.test.tsx @@ -9,7 +9,6 @@ import { registerReactEmbeddableFactory, - reactEmbeddableRegistryHasKey, getReactEmbeddableFactory, } from './react_embeddable_registry'; import { ReactEmbeddableFactory } from './types'; @@ -33,9 +32,4 @@ describe('react embeddable registry', () => { registerReactEmbeddableFactory('test', getTestEmbeddableFactory); expect(getReactEmbeddableFactory('test')).toEqual(returnedFactory); }); - - it('can check if a factory is registered', () => { - expect(reactEmbeddableRegistryHasKey('test')).toBe(true); - expect(reactEmbeddableRegistryHasKey('notRegistered')).toBe(false); - }); }); diff --git a/src/plugins/embeddable/public/react_embeddable_system/react_embeddable_registry.ts b/src/plugins/embeddable/public/react_embeddable_system/react_embeddable_registry.ts index 0d007f85f7977..046b63d5531ab 100644 --- a/src/plugins/embeddable/public/react_embeddable_system/react_embeddable_registry.ts +++ b/src/plugins/embeddable/public/react_embeddable_system/react_embeddable_registry.ts @@ -40,8 +40,6 @@ export const registerReactEmbeddableFactory = < registry[type] = getFactory; }; -export const reactEmbeddableRegistryHasKey = (key: string) => registry[key] !== undefined; - export const getReactEmbeddableFactory = async < SerializedState extends object = object, RuntimeState extends object = SerializedState,