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 { BaseRegistry } from "./base-registry";
|
||||
import { LensExtension } from "../lens-extension";
|
||||
import { PageRegistration } from "../interfaces";
|
||||
|
||||
export interface PageMenuTarget {
|
||||
pageId: string;
|
||||
@ -32,12 +31,11 @@ export class PageMenuRegistry<T extends PageMenuRegistration> extends BaseRegist
|
||||
|
||||
@action
|
||||
add(items: T[], ext?: LensExtension) {
|
||||
const normalizedItems = items.map((i) => {
|
||||
console.log(i)
|
||||
if (i.target && !i.target.extensionId) {
|
||||
i.target.extensionId = ext.name
|
||||
const normalizedItems = items.map((menu) => {
|
||||
if (menu.target && !menu.target.extensionId) {
|
||||
menu.target.extensionId = ext.name
|
||||
}
|
||||
return i
|
||||
return menu
|
||||
})
|
||||
return super.add(normalizedItems);
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@ import { LensExtension } from "../lens-extension"
|
||||
import { PageMenuTarget } from "./page-menu-registry";
|
||||
|
||||
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"
|
||||
exact?: boolean; // route matching flag, see: https://reactrouter.com/web/api/NavLink/exact-bool
|
||||
components: PageComponents;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user