mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Remove unnecessary 'onlyVisibleForSource' (#2982)
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
6044d08a74
commit
6677e22371
5 files changed
+17
-24
No files matched your search
@@ -101,20 +101,18 @@ export class KubernetesCluster extends CatalogEntity<CatalogEntityMetadata, Kube
|
||||
}
|
||||
|
||||
async onContextMenuOpen(context: CatalogEntityContextMenuContext) {
|
||||
context.menuItems = [
|
||||
{
|
||||
if (!this.metadata.source || this.metadata.source === "local") {
|
||||
context.menuItems.push({
|
||||
title: "Settings",
|
||||
icon: "edit",
|
||||
onlyVisibleForSource: "local",
|
||||
onClick: async () => context.navigate(`/entity/${this.metadata.uid}/settings`)
|
||||
},
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
if (this.metadata.labels["file"]?.startsWith(ClusterStore.storedKubeConfigFolder)) {
|
||||
context.menuItems.push({
|
||||
title: "Delete",
|
||||
icon: "delete",
|
||||
onlyVisibleForSource: "local",
|
||||
onClick: async () => ClusterStore.getInstance().removeById(this.metadata.uid),
|
||||
confirm: {
|
||||
message: `Remove Kubernetes Cluster "${this.metadata.name} from ${productName}?`
|
||||
|
||||
@@ -104,10 +104,6 @@ export interface CatalogEntityContextMenu {
|
||||
* Menu icon
|
||||
*/
|
||||
icon?: string;
|
||||
/**
|
||||
* Show only if empty or if value matches with entity.metadata.source
|
||||
*/
|
||||
onlyVisibleForSource?: string;
|
||||
/**
|
||||
* OnClick handler
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user