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

Revert switch to react-router-dom by installing history as dependency

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne Savolainen 2022-05-18 08:30:20 +03:00
parent c0cc56dba2
commit df4e65d4b3
No known key found for this signature in database
GPG Key ID: 8C6CFB2FFFE8F68A
7 changed files with 13 additions and 9 deletions

View File

@ -227,6 +227,7 @@
"got": "^11.8.3", "got": "^11.8.3",
"grapheme-splitter": "^1.0.4", "grapheme-splitter": "^1.0.4",
"handlebars": "^4.7.7", "handlebars": "^4.7.7",
"history": "^4.10.1",
"http-proxy": "^1.18.1", "http-proxy": "^1.18.1",
"immer": "^9.0.12", "immer": "^9.0.12",
"joi": "^17.6.0", "joi": "^17.6.0",

View File

@ -34,7 +34,7 @@ import userStoreInjectable from "../common/user-store/user-store.injectable";
import initRootFrameInjectable from "./frames/root-frame/init-root-frame/init-root-frame.injectable"; import initRootFrameInjectable from "./frames/root-frame/init-root-frame/init-root-frame.injectable";
import initClusterFrameInjectable from "./frames/cluster-frame/init-cluster-frame/init-cluster-frame.injectable"; import initClusterFrameInjectable from "./frames/cluster-frame/init-cluster-frame/init-cluster-frame.injectable";
import commandOverlayInjectable from "./components/command-palette/command-overlay.injectable"; import commandOverlayInjectable from "./components/command-palette/command-overlay.injectable";
import { Router } from "react-router-dom"; import { Router } from "react-router";
import historyInjectable from "./navigation/history.injectable"; import historyInjectable from "./navigation/history.injectable";
import themeStoreInjectable from "./themes/store.injectable"; import themeStoreInjectable from "./themes/store.injectable";
import navigateToAddClusterInjectable from "../common/front-end-routing/routes/add-cluster/navigate-to-add-cluster.injectable"; import navigateToAddClusterInjectable from "../common/front-end-routing/routes/add-cluster/navigate-to-add-cluster.injectable";
@ -178,9 +178,11 @@ export async function bootstrap(di: DiContainer) {
}); });
} }
const history = di.inject(historyInjectable);
render( render(
<DiContextProvider value={{ di }}> <DiContextProvider value={{ di }}>
<Router history={di.inject(historyInjectable)}> <Router history={history}>
{DefaultProps(App)} {DefaultProps(App)}
</Router> </Router>
</DiContextProvider>, </DiContextProvider>,

View File

@ -6,7 +6,7 @@
import "./cluster-manager.scss"; import "./cluster-manager.scss";
import React from "react"; import React from "react";
import { Redirect } from "react-router-dom"; import { Redirect } from "react-router";
import { disposeOnUnmount, observer } from "mobx-react"; import { disposeOnUnmount, observer } from "mobx-react";
import { StatusBar } from "../status-bar/status-bar"; import { StatusBar } from "../status-bar/status-bar";
import { HotbarMenu } from "../hotbar/hotbar-menu"; import { HotbarMenu } from "../hotbar/hotbar-menu";

View File

@ -7,7 +7,7 @@ import "./tab-layout.scss";
import type { ReactNode } from "react"; import type { ReactNode } from "react";
import React from "react"; import React from "react";
import { matchPath, Redirect, Route, Switch } from "react-router-dom"; import { matchPath, Redirect, Route, Switch } from "react-router";
import { observer } from "mobx-react"; import { observer } from "mobx-react";
import type { IClassName } from "../../utils"; import type { IClassName } from "../../utils";
import { cssNames } from "../../utils"; import { cssNames } from "../../utils";

View File

@ -10,7 +10,7 @@ import type { IObservableArray } from "mobx";
import { computed, observable, runInAction } from "mobx"; import { computed, observable, runInAction } from "mobx";
import { renderFor } from "./renderFor"; import { renderFor } from "./renderFor";
import React from "react"; import React from "react";
import { Router } from "react-router-dom"; import { Router } from "react-router";
import { Observer } from "mobx-react"; import { Observer } from "mobx-react";
import subscribeStoresInjectable from "../../kube-watch-api/subscribe-stores.injectable"; import subscribeStoresInjectable from "../../kube-watch-api/subscribe-stores.injectable";
import allowedResourcesInjectable from "../../../common/cluster-store/allowed-resources.injectable"; import allowedResourcesInjectable from "../../../common/cluster-store/allowed-resources.injectable";
@ -323,7 +323,7 @@ export const getApplicationBuilder = () => {
await startFrame(); await startFrame();
const render = renderFor(rendererDi); const render = renderFor(rendererDi);
const history = rendererDi.inject(historyInjectable) as any; const history = rendererDi.inject(historyInjectable);
const currentRouteComponent = rendererDi.inject(currentRouteComponentInjectable); const currentRouteComponent = rendererDi.inject(currentRouteComponentInjectable);
for (const callback of beforeRenderCallbacks) { for (const callback of beforeRenderCallbacks) {

View File

@ -5,7 +5,7 @@
import React, { useEffect } from "react"; import React, { useEffect } from "react";
import type { IComputedValue } from "mobx"; import type { IComputedValue } from "mobx";
import { observer } from "mobx-react"; import { observer } from "mobx-react";
import { Redirect } from "react-router-dom"; import { Redirect } from "react-router";
import { ConfirmDialog } from "../../components/confirm-dialog"; import { ConfirmDialog } from "../../components/confirm-dialog";
import { DeploymentScaleDialog } from "../../components/+workloads-deployments/scale/dialog"; import { DeploymentScaleDialog } from "../../components/+workloads-deployments/scale/dialog";
import { CronJobTriggerDialog } from "../../components/+workloads-cronjobs/cronjob-trigger-dialog"; import { CronJobTriggerDialog } from "../../components/+workloads-cronjobs/cronjob-trigger-dialog";

View File

@ -4,10 +4,11 @@
*/ */
import { getInjectable } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { createBrowserHistory } from "history"; import { createBrowserHistory } from "history";
import type { History } from "history";
const historyInjectable = getInjectable({ const historyInjectable = getInjectable({
id: "history", id: "history",
instantiate: () => createBrowserHistory(), instantiate: (): History => createBrowserHistory(),
}); });
export default historyInjectable; export default historyInjectable;