1
0
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:
Jari Kolehmainen 2021-05-26 20:24:34 +03:00
parent d31f4b15e7
commit ff4e685842
4 changed files with 8 additions and 8 deletions

View File

@ -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",

View File

@ -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>) {

View File

@ -55,7 +55,7 @@ export class CatalogAddButton extends React.Component<CatalogAddButtonProps> {
menuItems: this.menuItems
};
category.emit("onCatalogAddMenu", context);
category.emit("catalogAddMenu", context);
}
}, { fireImmediately: true })
]);

View File

@ -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");
}
}