1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

historyInjectable back in play

Signed-off-by: Gabriel <gaccettola@mirantis.com>
This commit is contained in:
Gabriel 2023-04-24 21:44:38 +02:00
parent 9684aab984
commit 6eedeec94d
4 changed files with 8 additions and 8 deletions

View File

@ -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 { observableHistoryInjectable } from "@k8slens/routing";
import { historyInjectable } 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(observableHistoryInjectable),
history: di.inject(historyInjectable),
drawerStorage: di.inject(drawerStorageInjectable),
}),
});

View File

@ -24,7 +24,7 @@ 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 { observableHistoryInjectable } from "@k8slens/routing";
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";
@ -292,7 +292,7 @@ export const getApplicationBuilder = () => {
await callback({ windowDi });
}
const history = windowDi.inject(observableHistoryInjectable);
const history = windowDi.inject(historyInjectable);
const render = renderFor(windowDi);

View File

@ -12,7 +12,7 @@ import { DiContextProvider } from "@ogre-tools/injectable-react";
import { Router } from "react-router";
import { DefaultProps } from "../../mui-base-theme";
import { ClusterFrame } from "./cluster-frame";
import { observableHistoryInjectable } from "@k8slens/routing";
import { historyInjectable } from "@k8slens/routing";
import { computed } from "mobx";
import { Cluster } from "../../../common/cluster/cluster";
import subscribeStoresInjectable from "../../kube-watch-api/subscribe-stores.injectable";
@ -34,7 +34,7 @@ describe("<ClusterFrame />", () => {
di = getDiForUnitTesting();
render = () => testingLibraryRender((
<DiContextProvider value={{ di }}>
<Router history={di.inject(observableHistoryInjectable)}>
<Router history={di.inject(historyInjectable)}>
{DefaultProps(ClusterFrame)}
</Router>
</DiContextProvider>

View File

@ -4,7 +4,7 @@
*/
import { getInjectable } from "@ogre-tools/injectable";
import { Router } from "react-router";
import { observableHistoryInjectable } from "@k8slens/routing";
import { historyInjectable } from "@k8slens/routing";
import React from "react";
import {
@ -15,7 +15,7 @@ const routingReactApplicationHocInjectable = getInjectable({
id: "routing-react-application-hoc",
instantiate: (di) => {
const history = di.inject(observableHistoryInjectable);
const history = di.inject(historyInjectable);
return ({ children }) =>
(