From 1feb59562dc70596bd361a264edd06dd3ae0deed Mon Sep 17 00:00:00 2001 From: Alex Andreev Date: Mon, 21 Feb 2022 10:10:47 +0300 Subject: [PATCH] Adding noItemsMessage to CatalogEntitySpec Signed-off-by: Alex Andreev --- src/common/catalog/catalog-entity.ts | 5 +++++ src/renderer/components/+catalog/catalog.tsx | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/common/catalog/catalog-entity.ts b/src/common/catalog/catalog-entity.ts index 7f5f8bbe73..74c2954be9 100644 --- a/src/common/catalog/catalog-entity.ts +++ b/src/common/catalog/catalog-entity.ts @@ -81,6 +81,11 @@ export interface CatalogCategorySpec { * These columns will not be used in the "Browse" view. */ displayColumns?: CategoryColumnRegistration[]; + + /** + * Custom message to display when no items available inside current category + */ + noItemsMessage?: string; } /** diff --git a/src/renderer/components/+catalog/catalog.tsx b/src/renderer/components/+catalog/catalog.tsx index c793ae68bd..150654a6e1 100644 --- a/src/renderer/components/+catalog/catalog.tsx +++ b/src/renderer/components/+catalog/catalog.tsx @@ -250,8 +250,7 @@ class NonInjectedCatalog extends React.Component { ? `catalog-items-${activeCategory.metadata.name.replace(" ", "")}` : "catalog-items"; - const noItemsMessage = activeCategory?.metadata.name == "Dev Clusters" ? "There are no Dev Clusters in this space" - : "Item list is empty"; + const noItemsMessage = activeCategory?.spec.noItemsMessage ?? "Item list is empty"; if (this.activeTab === undefined) { return null;