mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
rename events
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
d31f4b15e7
commit
ff4e685842
@ -139,7 +139,7 @@ export class KubernetesCluster extends CatalogEntity<CatalogEntityMetadata, Kube
|
||||
|
||||
const category = catalogCategoryRegistry.getCategoryForEntity<KubernetesClusterCategory>(this);
|
||||
|
||||
if (category) category.emit("onContextMenuOpen", this, context);
|
||||
if (category) category.emit("contextMenuOpen", this, context);
|
||||
}
|
||||
}
|
||||
|
||||
@ -166,7 +166,7 @@ export class KubernetesClusterCategory extends CatalogCategory {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.on("onCatalogAddMenu", (ctx: CatalogEntityAddMenuContext) => {
|
||||
this.on("catalogAddMenu", (ctx: CatalogEntityAddMenuContext) => {
|
||||
ctx.menuItems.push({
|
||||
icon: "text_snippet",
|
||||
title: "Add from kubeconfig",
|
||||
|
||||
@ -49,9 +49,9 @@ export interface CatalogCategorySpec {
|
||||
}
|
||||
|
||||
export interface CatalogCategoryEvents {
|
||||
onLoad: () => void;
|
||||
onCatalogAddMenu: (context: CatalogEntityAddMenuContext) => void;
|
||||
onContextMenuOpen: (entity: CatalogEntity, context: CatalogEntityContextMenuContext) => void;
|
||||
load: () => void;
|
||||
catalogAddMenu: (context: CatalogEntityAddMenuContext) => void;
|
||||
contextMenuOpen: (entity: CatalogEntity, context: CatalogEntityContextMenuContext) => void;
|
||||
}
|
||||
|
||||
export abstract class CatalogCategory extends (EventEmitter as new () => TypedEmitter<CatalogCategoryEvents>) {
|
||||
|
||||
@ -55,7 +55,7 @@ export class CatalogAddButton extends React.Component<CatalogAddButtonProps> {
|
||||
menuItems: this.menuItems
|
||||
};
|
||||
|
||||
category.emit("onCatalogAddMenu", context);
|
||||
category.emit("catalogAddMenu", context);
|
||||
}
|
||||
}, { fireImmediately: true })
|
||||
]);
|
||||
|
||||
@ -111,10 +111,10 @@ export class CatalogEntityStore extends ItemStore<CatalogEntityItem> {
|
||||
|
||||
loadAll() {
|
||||
if (this.activeCategory) {
|
||||
this.activeCategory.emit("onLoad");
|
||||
this.activeCategory.emit("load");
|
||||
} else {
|
||||
for (const category of catalogCategoryRegistry.items) {
|
||||
category.emit("onLoad");
|
||||
category.emit("load");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user