mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
cleanup
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
697587514d
commit
0f45f82a89
@ -5,7 +5,6 @@ import { action } from "mobx";
|
|||||||
import type { IconProps } from "../../renderer/components/icon";
|
import type { IconProps } from "../../renderer/components/icon";
|
||||||
import { BaseRegistry } from "./base-registry";
|
import { BaseRegistry } from "./base-registry";
|
||||||
import { LensExtension } from "../lens-extension";
|
import { LensExtension } from "../lens-extension";
|
||||||
import { PageRegistration } from "../interfaces";
|
|
||||||
|
|
||||||
export interface PageMenuTarget {
|
export interface PageMenuTarget {
|
||||||
pageId: string;
|
pageId: string;
|
||||||
@ -32,12 +31,11 @@ export class PageMenuRegistry<T extends PageMenuRegistration> extends BaseRegist
|
|||||||
|
|
||||||
@action
|
@action
|
||||||
add(items: T[], ext?: LensExtension) {
|
add(items: T[], ext?: LensExtension) {
|
||||||
const normalizedItems = items.map((i) => {
|
const normalizedItems = items.map((menu) => {
|
||||||
console.log(i)
|
if (menu.target && !menu.target.extensionId) {
|
||||||
if (i.target && !i.target.extensionId) {
|
menu.target.extensionId = ext.name
|
||||||
i.target.extensionId = ext.name
|
|
||||||
}
|
}
|
||||||
return i
|
return menu
|
||||||
})
|
})
|
||||||
return super.add(normalizedItems);
|
return super.add(normalizedItems);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import { LensExtension } from "../lens-extension"
|
|||||||
import { PageMenuTarget } from "./page-menu-registry";
|
import { PageMenuTarget } from "./page-menu-registry";
|
||||||
|
|
||||||
export interface PageRegistration {
|
export interface PageRegistration {
|
||||||
id: string; // hello-world:id
|
id: string; // will be automatically prefixed with extension name
|
||||||
routePath?: string; // additional (suffix) route path to base extension's route: "/extension/:name"
|
routePath?: string; // additional (suffix) route path to base extension's route: "/extension/:name"
|
||||||
exact?: boolean; // route matching flag, see: https://reactrouter.com/web/api/NavLink/exact-bool
|
exact?: boolean; // route matching flag, see: https://reactrouter.com/web/api/NavLink/exact-bool
|
||||||
components: PageComponents;
|
components: PageComponents;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user