mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
chore: Fixup kube-object-menu tests
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
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;
|
||||
+3
-3
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user