/** * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; import { initClusterFrame } from "./init-cluster-frame"; import extensionLoaderInjectable from "../../../../extensions/extension-loader/extension-loader.injectable"; import catalogEntityRegistryInjectable from "../../../api/catalog/entity/registry.injectable"; import frameRoutingIdInjectable from "./frame-routing-id/frame-routing-id.injectable"; import hostedClusterInjectable from "../../../cluster-frame-context/hosted-cluster.injectable"; import clusterFrameContextInjectable from "../../../cluster-frame-context/cluster-frame-context.injectable"; import assert from "assert"; import emitAppEventInjectable from "../../../../common/app-event-bus/emit-event.injectable"; const initClusterFrameInjectable = getInjectable({ id: "init-cluster-frame", instantiate: (di) => { const hostedCluster = di.inject(hostedClusterInjectable); assert(hostedCluster, "This can only be injected within a cluster frame"); return initClusterFrame({ hostedCluster, loadExtensions: di.inject(extensionLoaderInjectable).autoInitExtensions, catalogEntityRegistry: di.inject(catalogEntityRegistryInjectable), frameRoutingId: di.inject(frameRoutingIdInjectable), emitAppEvent: di.inject(emitAppEventInjectable), clusterFrameContext: di.inject(clusterFrameContextInjectable), }); }, }); export default initClusterFrameInjectable;