mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
refactor
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
5393cf4ec9
commit
3bad5ddea6
@ -1,4 +1,4 @@
|
||||
import { LensMainExtension, Navigation } from "@k8slens/extensions";
|
||||
import { LensMainExtension } from "@k8slens/extensions";
|
||||
import { supportPageURL } from "./src/support.route";
|
||||
|
||||
export default class SupportPageMainExtension extends LensMainExtension {
|
||||
@ -6,8 +6,8 @@ export default class SupportPageMainExtension extends LensMainExtension {
|
||||
{
|
||||
parentId: "help",
|
||||
label: "Support",
|
||||
click() {
|
||||
Navigation.navigate(supportPageURL());
|
||||
click: () => {
|
||||
this.navigate(supportPageURL());
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
6
extensions/support-page/package-lock.json
generated
6
extensions/support-page/package-lock.json
generated
@ -26,6 +26,12 @@
|
||||
"integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "14.14.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.7.tgz",
|
||||
"integrity": "sha512-Zw1vhUSQZYw+7u5dAwNbIA9TuTotpzY/OF7sJM9FqPOF3SPjKnxrjoTktXDZgUjybf4cWVBP7O8wvKdSaGHweg==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/prop-types": {
|
||||
"version": "15.7.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.3.tgz",
|
||||
|
||||
@ -8,13 +8,11 @@ import * as EventBus from "./event-bus"
|
||||
import * as Store from "./stores"
|
||||
import * as Util from "./utils"
|
||||
import * as ClusterFeature from "./cluster-feature"
|
||||
import * as Navigation from "./navigation"
|
||||
|
||||
export {
|
||||
App,
|
||||
EventBus,
|
||||
ClusterFeature,
|
||||
Navigation,
|
||||
Store,
|
||||
Util,
|
||||
}
|
||||
|
||||
@ -1,14 +0,0 @@
|
||||
import { ipcMain } from "electron";
|
||||
import { WindowManager } from "../../main/window-manager";
|
||||
import { navigate as navRenderer } from "../../renderer/navigation";
|
||||
export { hideDetails, showDetails, getDetailsUrl } from "../../renderer/navigation"
|
||||
export { RouteProps } from "react-router"
|
||||
export { IURLParams } from "../../common/utils/buildUrl";
|
||||
|
||||
export async function navigate(location: string) {
|
||||
if (ipcMain) {
|
||||
await WindowManager.getInstance<WindowManager>().navigate(location)
|
||||
} else {
|
||||
navRenderer(location)
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,12 @@
|
||||
import type { MenuRegistration } from "./registries/menu-registry";
|
||||
import { observable } from "mobx";
|
||||
import { LensExtension } from "./lens-extension"
|
||||
import { WindowManager } from "../main/window-manager";
|
||||
|
||||
export class LensMainExtension extends LensExtension {
|
||||
@observable.shallow appMenus: MenuRegistration[] = []
|
||||
|
||||
async navigate(location: string, frameId?: number) {
|
||||
await WindowManager.getInstance<WindowManager>().navigate(location, frameId)
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,8 +3,10 @@
|
||||
// APIs
|
||||
import * as Component from "./components"
|
||||
import * as K8sApi from "./k8s-api"
|
||||
import * as Navigation from "./navigation"
|
||||
|
||||
export {
|
||||
Component,
|
||||
K8sApi,
|
||||
Navigation
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user