Allow to control catalog entity menu item visibility based on source (#2499)

* allow to control catalog entity menu item visibility based on source

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* fix

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen authored and GitHub committed 2021-04-15 15:16:56 +03:00
1 parent 95ebb52f5d
commit 1ac5588fab
4 files changed
+7 -2

No files matched your search

@@ -49,11 +49,13 @@ export class KubernetesCluster implements CatalogEntity {
{
icon: "settings",
title: "Settings",
onlyVisibleForSource: "local",
onClick: async () => context.navigate(`/cluster/${this.metadata.uid}/settings`)
},
{
icon: "delete",
title: "Delete",
onlyVisibleForSource: "local",
onClick: async () => clusterStore.removeById(this.metadata.uid),
confirm: {
message: `Remove Kubernetes Cluster "${this.metadata.name} from Lens?`
+1
View File
@@ -45,6 +45,7 @@ export interface CatalogEntityActionContext {
export type CatalogEntityContextMenu = {
icon: string;
title: string;
onlyVisibleForSource?: string; // show only if empty or if matches with entity source
onClick: () => Promise<void>;
confirm?: {
message: string;