Remove global version of appEventBus (#6096)

* Remove global version of appEventBus

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Introduce a temporary but better shape of ExecFileInjectable error

Signed-off-by: Sebastian Malton <sebastian@malton.name>

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton authored and GitHub committed 2022-10-31 14:59:05 +02:00
1 parent ba349e8b8d
commit 900f02fd8c
53 files changed
+330 -283

No files matched your search

@@ -8,9 +8,9 @@ import extensionLoaderInjectable from "../../../../extensions/extension-loader/e
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 appEventBusInjectable from "../../../../common/app-event-bus/app-event-bus.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",
@@ -25,7 +25,7 @@ const initClusterFrameInjectable = getInjectable({
loadExtensions: di.inject(extensionLoaderInjectable).loadOnClusterRenderer,
catalogEntityRegistry: di.inject(catalogEntityRegistryInjectable),
frameRoutingId: di.inject(frameRoutingIdInjectable),
emitEvent: di.inject(appEventBusInjectable).emit,
emitAppEvent: di.inject(emitAppEventInjectable),
clusterFrameContext: di.inject(clusterFrameContextInjectable),
});
},
@@ -7,19 +7,19 @@ import type { CatalogEntityRegistry } from "../../../api/catalog/entity/registry
import logger from "../../../../main/logger";
import type { KubernetesCluster } from "../../../../common/catalog-entities";
import { Notifications } from "../../../components/notifications";
import type { AppEvent } from "../../../../common/app-event-bus/event-bus";
import type { CatalogEntity } from "../../../../common/catalog";
import { when } from "mobx";
import type { ClusterFrameContext } from "../../../cluster-frame-context/cluster-frame-context";
import { KubeObjectStore } from "../../../../common/k8s-api/kube-object.store";
import { requestSetClusterFrameId } from "../../../ipc";
import type { EmitAppEvent } from "../../../../common/app-event-bus/emit-event.injectable";
interface Dependencies {
hostedCluster: Cluster;
loadExtensions: (getCluster: () => CatalogEntity) => void;
catalogEntityRegistry: CatalogEntityRegistry;
frameRoutingId: number;
emitEvent: (event: AppEvent) => void;
emitAppEvent: EmitAppEvent;
// TODO: This dependency belongs to KubeObjectStore
clusterFrameContext: ClusterFrameContext;
@@ -32,7 +32,7 @@ export const initClusterFrame = ({
loadExtensions,
catalogEntityRegistry,
frameRoutingId,
emitEvent,
emitAppEvent,
clusterFrameContext,
}: Dependencies) =>
async (unmountRoot: () => void) => {
@@ -70,7 +70,7 @@ export const initClusterFrame = ({
);
setTimeout(() => {
emitEvent({
emitAppEvent({
name: "cluster",
action: "open",
params: {