mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
chore: Extract an injectionToken
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
This commit is contained in:
1 parent
0dae1594ba
commit
db9a3675e1
7 files changed
+19
-14
No files matched your search
@@ -16,7 +16,7 @@ import { Animate } from "../animate";
|
||||
import { ResizeDirection, ResizeGrowthDirection, ResizeSide, ResizingAnchor } from "../resizing-anchor";
|
||||
import drawerStorageInjectable, { defaultDrawerWidth } from "./drawer-storage/drawer-storage.injectable";
|
||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||
import { historyInjectable } from "@k8slens/routing";
|
||||
import { historyInjectionToken } from "@k8slens/routing";
|
||||
import type { History } from "history";
|
||||
import type { StorageLayer } from "../../utils/storage-helper";
|
||||
|
||||
@@ -251,7 +251,7 @@ class NonInjectedDrawer extends React.Component<DrawerProps & Dependencies & typ
|
||||
export const Drawer = withInjectables<Dependencies, DrawerProps>(NonInjectedDrawer as React.ElementType<DrawerProps & Dependencies>, {
|
||||
getProps: (di, props) => ({
|
||||
...props,
|
||||
history: di.inject(historyInjectable),
|
||||
history: di.inject(historyInjectionToken),
|
||||
drawerStorage: di.inject(drawerStorageInjectable),
|
||||
}),
|
||||
});
|
||||
|
||||
@@ -24,7 +24,6 @@ import navigateToHelmChartsInjectable from "../../../common/front-end-routing/ro
|
||||
import hostedClusterInjectable from "../../cluster-frame-context/hosted-cluster.injectable";
|
||||
import { Cluster } from "../../../common/cluster/cluster";
|
||||
import type { NamespaceStore } from "../+namespaces/store";
|
||||
import { historyInjectable } from "@k8slens/routing";
|
||||
import type { MinimalTrayMenuItem } from "../../../main/tray/electron-tray/electron-tray.injectable";
|
||||
import electronTrayInjectable from "../../../main/tray/electron-tray/electron-tray.injectable";
|
||||
import { getDiForUnitTesting as getRendererDi } from "../../getDiForUnitTesting";
|
||||
@@ -71,6 +70,7 @@ import { applicationFeature, startApplicationInjectionToken } from "@k8slens/app
|
||||
import { testUsingFakeTime } from "../../../test-utils/use-fake-time";
|
||||
import { sendMessageToChannelInjectionToken } from "@k8slens/messaging";
|
||||
import { getMessageBridgeFake } from "@k8slens/messaging-fake-bridge";
|
||||
import { historyInjectionToken } from "@k8slens/routing";
|
||||
|
||||
type MainDiCallback = (container: { mainDi: DiContainer }) => void | Promise<void>;
|
||||
type WindowDiCallback = (container: { windowDi: DiContainer }) => void | Promise<void>;
|
||||
@@ -292,7 +292,7 @@ export const getApplicationBuilder = () => {
|
||||
await callback({ windowDi });
|
||||
}
|
||||
|
||||
const history = windowDi.inject(historyInjectable);
|
||||
const history = windowDi.inject(historyInjectionToken);
|
||||
|
||||
const render = renderFor(windowDi);
|
||||
|
||||
|
||||
Reference in new issue
Block a user