mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Update injectable library (#4842)
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>
This commit is contained in:
1 parent
e8ca1ddf87
commit
b65f6e00ec
231 files changed
+630
-613
No files matched your search
@@ -3,11 +3,11 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { apiManager } from "../../../../common/k8s-api/api-manager";
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
|
||||
const apiManagerInjectable = getInjectable({
|
||||
id: "api-manager",
|
||||
instantiate: () => apiManager,
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default apiManagerInjectable;
|
||||
@@ -7,6 +7,8 @@ import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import clusterInjectable from "./cluster.injectable";
|
||||
|
||||
const clusterNameInjectable = getInjectable({
|
||||
id: "cluster-name",
|
||||
|
||||
instantiate: (di) => {
|
||||
const cluster = di.inject(clusterInjectable);
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import { getActiveClusterEntity } from "../../../api/catalog-entity-registry";
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
|
||||
const clusterInjectable = getInjectable({
|
||||
id: "cluster",
|
||||
instantiate: () => getActiveClusterEntity(),
|
||||
lifecycle: lifecycleEnum.transient,
|
||||
});
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { hideDetails } from "../../kube-detail-params";
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
|
||||
const hideDetailsInjectable = getInjectable({
|
||||
id: "hide-details",
|
||||
instantiate: () => hideDetails,
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
});
|
||||
|
||||
export default hideDetailsInjectable;
|
||||
+1
@@ -9,6 +9,7 @@ import type { KubeObject } from "../../../../../common/k8s-api/kube-object";
|
||||
import rendererExtensionsInjectable from "../../../../../extensions/renderer-extensions.injectable";
|
||||
|
||||
const kubeObjectMenuItemsInjectable = getInjectable({
|
||||
id: "kube-object-menu-items",
|
||||
instantiate: (di, { kubeObject }: { kubeObject: KubeObject }) =>
|
||||
getKubeObjectMenuItems({
|
||||
extensions: di.inject(rendererExtensionsInjectable).get(),
|
||||
|
||||
@@ -7,7 +7,7 @@ import { screen } from "@testing-library/react";
|
||||
import "@testing-library/jest-dom/extend-expect";
|
||||
import { KubeObject } from "../../../common/k8s-api/kube-object";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
import type { ConfigurableDependencyInjectionContainer } from "@ogre-tools/injectable";
|
||||
import type { DiContainer } from "@ogre-tools/injectable";
|
||||
import { ConfirmDialog } from "../confirm-dialog";
|
||||
import asyncFn, { AsyncFnMock } from "@async-fn/jest";
|
||||
import { getDiForUnitTesting } from "../../getDiForUnitTesting";
|
||||
@@ -47,7 +47,7 @@ class SomeTestExtension extends LensRendererExtension {
|
||||
}
|
||||
|
||||
describe("kube-object-menu", () => {
|
||||
let di: ConfigurableDependencyInjectionContainer;
|
||||
let di: DiContainer;
|
||||
let render: DiRender;
|
||||
|
||||
beforeEach(async () => {
|
||||
|
||||
Reference in new issue
Block a user