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); 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() { constructor() {
super(); super();
this.on("onCatalogAddMenu", (ctx: CatalogEntityAddMenuContext) => { this.on("catalogAddMenu", (ctx: CatalogEntityAddMenuContext) => {
ctx.menuItems.push({ ctx.menuItems.push({
icon: "text_snippet", icon: "text_snippet",
title: "Add from kubeconfig", title: "Add from kubeconfig",

View File

@ -49,9 +49,9 @@ export interface CatalogCategorySpec {
} }
export interface CatalogCategoryEvents { export interface CatalogCategoryEvents {
onLoad: () => void; load: () => void;
onCatalogAddMenu: (context: CatalogEntityAddMenuContext) => void; catalogAddMenu: (context: CatalogEntityAddMenuContext) => void;
onContextMenuOpen: (entity: CatalogEntity, context: CatalogEntityContextMenuContext) => void; contextMenuOpen: (entity: CatalogEntity, context: CatalogEntityContextMenuContext) => void;
} }
export abstract class CatalogCategory extends (EventEmitter as new () => TypedEmitter<CatalogCategoryEvents>) { 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 menuItems: this.menuItems
}; };
category.emit("onCatalogAddMenu", context); category.emit("catalogAddMenu", context);
} }
}, { fireImmediately: true }) }, { fireImmediately: true })
]); ]);

View File

@ -111,10 +111,10 @@ export class CatalogEntityStore extends ItemStore<CatalogEntityItem> {
loadAll() { loadAll() {
if (this.activeCategory) { if (this.activeCategory) {
this.activeCategory.emit("onLoad"); this.activeCategory.emit("load");
} else { } else {
for (const category of catalogCategoryRegistry.items) { for (const category of catalogCategoryRegistry.items) {
category.emit("onLoad"); category.emit("load");
} }
} }