chore: Fixup kube-object-menu tests

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2023-04-21 14:11:15 -04:00
1 parent 535bac4df9
commit 6741b94220
4 files changed
+55 -26

No files matched your search

@@ -0,0 +1,18 @@
/**
* 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 { computed } from "mobx";
import catalogEntityRegistryInjectable from "./registry.injectable";
const activeEntityIdInjectable = getInjectable({
id: "active-entity-id",
instantiate: (di) => {
const entityRegistry = di.inject(catalogEntityRegistryInjectable);
return computed(() => entityRegistry.activeEntity?.getId());
},
});
export default activeEntityIdInjectable;
@@ -5,16 +5,16 @@
import { getInjectable } from "@ogre-tools/injectable";
import { computed } from "mobx";
import getClusterByIdInjectable from "../../../../features/cluster/storage/common/get-by-id.injectable";
import catalogEntityRegistryInjectable from "./registry.injectable";
import activeEntityIdInjectable from "./active-entity-id.injectable";
const activeEntityInternalClusterInjectable = getInjectable({
id: "active-entity-internal-cluster",
instantiate: (di) => {
const getClusterById = di.inject(getClusterByIdInjectable);
const entityRegistry = di.inject(catalogEntityRegistryInjectable);
const activeEntityId = di.inject(activeEntityIdInjectable);
return computed(() => {
const entityId = entityRegistry.activeEntity?.getId();
const entityId = activeEntityId.get();
if (entityId) {
return getClusterById(entityId);