mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add workload 'kind' param to 'show-details' event (#7464)
* Introduce getWorkloadKindFromUrl() method Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Whitelist kind param to 'show-details' event Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Using parseKubeApi instead of new utility Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Adding checks for empty selfLink Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> --------- Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
df9db01be5
commit
2cf8a2f188
@ -4,6 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { AppEvent } from "../../../common/app-event-bus/event-bus";
|
||||
import { parseKubeApi } from "../../../common/k8s-api/kube-api-parse";
|
||||
|
||||
const navigateTo = [
|
||||
"navigate-to-preference-tab-id",
|
||||
@ -91,13 +92,20 @@ const extensions = [
|
||||
|
||||
const externalActions = ["open-link-in-browser"];
|
||||
|
||||
const uiInteraction = ["show-details"];
|
||||
const uiInteraction = [{
|
||||
id: "show-details",
|
||||
getParams: (selfLink: string) => {
|
||||
return {
|
||||
kind: selfLink ? parseKubeApi(selfLink).resource : "",
|
||||
};
|
||||
},
|
||||
}];
|
||||
|
||||
const terminal = ["create-terminal-tab"];
|
||||
|
||||
export type WhiteListItem =
|
||||
| string
|
||||
| { id: string; getParams: (...args: unknown[]) => AppEvent["params"] };
|
||||
| { id: string; getParams: (...args: any[]) => AppEvent["params"] };
|
||||
|
||||
const telemetryWhiteListForFunctionsInjectable = getInjectable({
|
||||
id: "telemetry-white-list-for-functions",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user