From ff4e68584282141d82f43aecc8bd74cc1590a873 Mon Sep 17 00:00:00 2001 From: Jari Kolehmainen Date: Wed, 26 May 2021 20:24:34 +0300 Subject: [PATCH] rename events Signed-off-by: Jari Kolehmainen --- src/common/catalog-entities/kubernetes-cluster.ts | 4 ++-- src/common/catalog/catalog-entity.ts | 6 +++--- src/renderer/components/+catalog/catalog-add-button.tsx | 2 +- src/renderer/components/+catalog/catalog-entity.store.ts | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/common/catalog-entities/kubernetes-cluster.ts b/src/common/catalog-entities/kubernetes-cluster.ts index 9014c71aa1..4b2af1f43c 100644 --- a/src/common/catalog-entities/kubernetes-cluster.ts +++ b/src/common/catalog-entities/kubernetes-cluster.ts @@ -139,7 +139,7 @@ export class KubernetesCluster extends CatalogEntity(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", diff --git a/src/common/catalog/catalog-entity.ts b/src/common/catalog/catalog-entity.ts index 1f966b192b..afc15d4c64 100644 --- a/src/common/catalog/catalog-entity.ts +++ b/src/common/catalog/catalog-entity.ts @@ -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) { diff --git a/src/renderer/components/+catalog/catalog-add-button.tsx b/src/renderer/components/+catalog/catalog-add-button.tsx index c839f8dc26..25cd43239f 100644 --- a/src/renderer/components/+catalog/catalog-add-button.tsx +++ b/src/renderer/components/+catalog/catalog-add-button.tsx @@ -55,7 +55,7 @@ export class CatalogAddButton extends React.Component { menuItems: this.menuItems }; - category.emit("onCatalogAddMenu", context); + category.emit("catalogAddMenu", context); } }, { fireImmediately: true }) ]); diff --git a/src/renderer/components/+catalog/catalog-entity.store.ts b/src/renderer/components/+catalog/catalog-entity.store.ts index 8737b9873d..c11374ede2 100644 --- a/src/renderer/components/+catalog/catalog-entity.store.ts +++ b/src/renderer/components/+catalog/catalog-entity.store.ts @@ -111,10 +111,10 @@ export class CatalogEntityStore extends ItemStore { 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"); } }