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 { ResizeDirection, ResizeGrowthDirection, ResizeSide, ResizingAnchor } from "../resizing-anchor";
import drawerStorageInjectable, { defaultDrawerWidth } from "./drawer-storage/drawer-storage.injectable"; import drawerStorageInjectable, { defaultDrawerWidth } from "./drawer-storage/drawer-storage.injectable";
import { withInjectables } from "@ogre-tools/injectable-react"; import { withInjectables } from "@ogre-tools/injectable-react";
import { observableHistoryInjectable } from "@k8slens/routing"; import { historyInjectable } from "@k8slens/routing";
import type { History } from "history"; import type { History } from "history";
import type { StorageLayer } from "../../utils/storage-helper"; 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>, { export const Drawer = withInjectables<Dependencies, DrawerProps>(NonInjectedDrawer as React.ElementType<DrawerProps & Dependencies>, {
getProps: (di, props) => ({ getProps: (di, props) => ({
...props, ...props,
history: di.inject(observableHistoryInjectable), history: di.inject(historyInjectable),
drawerStorage: di.inject(drawerStorageInjectable), 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 hostedClusterInjectable from "../../cluster-frame-context/hosted-cluster.injectable";
import { Cluster } from "../../../common/cluster/cluster"; import { Cluster } from "../../../common/cluster/cluster";
import type { NamespaceStore } from "../+namespaces/store"; 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 type { MinimalTrayMenuItem } from "../../../main/tray/electron-tray/electron-tray.injectable";
import electronTrayInjectable from "../../../main/tray/electron-tray/electron-tray.injectable"; import electronTrayInjectable from "../../../main/tray/electron-tray/electron-tray.injectable";
import { getDiForUnitTesting as getRendererDi } from "../../getDiForUnitTesting"; import { getDiForUnitTesting as getRendererDi } from "../../getDiForUnitTesting";
@ -292,7 +292,7 @@ export const getApplicationBuilder = () => {
await callback({ windowDi }); await callback({ windowDi });
} }
const history = windowDi.inject(observableHistoryInjectable); const history = windowDi.inject(historyInjectable);
const render = renderFor(windowDi); const render = renderFor(windowDi);

View File

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

View File

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