Allow extensions to iteract with kube detail menu items like CatalogEntity menu items

- Allow registering handlers

- Cannot remove menu items

- Can add menu items in any location

- Add example of StatefulSets

- Could be used to deprecate the old API

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2022-04-20 08:17:51 -04:00
1 parent 51f7e8f1bc
commit 597f22003d
50 files changed
+1196 -730

No files matched your search

+12 -1
View File
@@ -278,11 +278,22 @@ export interface CatalogEntitySettingsMenu {
};
}
export interface CatalogEntityContextMenuNavigate {
/**
* @param pathname The location to navigate to in the main iframe
*/
(pathname: string, forceMainFrame?: boolean): void;
/**
* @param pathname The location to navigate to in the current iframe. Useful for when called within the cluster frame
*/
(pathname: string, forceMainFrame: false): void;
}
export interface CatalogEntityContextMenuContext {
/**
* Navigate to the specified pathname
*/
navigate: (pathname: string) => void;
navigate: CatalogEntityContextMenuNavigate;
menuItems: CatalogEntityContextMenu[];
}
+1
View File
@@ -32,6 +32,7 @@ export * from "./objects";
export * from "./openBrowser";
export * from "./paths";
export * from "./promise-exec";
export * from "./readonly";
export * from "./reject-promise";
export * from "./singleton";
export * from "./sort-compare";
+10
View File
@@ -0,0 +1,10 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import type { ReadonlyDeep } from "type-fest";
export function readonly<T>(src: T): ReadonlyDeep<T> {
return src as ReadonlyDeep<T>;
}