rename events

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen committed 2021-05-26 20:24:34 +03:00
1 parent d31f4b15e7
commit ff4e685842
4 files changed
+8 -8

No files matched your search

@@ -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",
+3 -3
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>) {
@@ -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 })
]); ]);
@@ -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");
} }
} }