Adding noItemsMessage to CatalogEntitySpec

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev committed 2022-02-21 10:10:47 +03:00
1 parent b7021b017f
commit 1feb59562d
2 files changed
+6 -2

No files matched your search

+5
View File
@@ -81,6 +81,11 @@ export interface CatalogCategorySpec {
* These columns will not be used in the "Browse" view. * These columns will not be used in the "Browse" view.
*/ */
displayColumns?: CategoryColumnRegistration[]; displayColumns?: CategoryColumnRegistration[];
/**
* Custom message to display when no items available inside current category
*/
noItemsMessage?: string;
} }
/** /**
+1 -2
View File
@@ -250,8 +250,7 @@ class NonInjectedCatalog extends React.Component<Props & Dependencies> {
? `catalog-items-${activeCategory.metadata.name.replace(" ", "")}` ? `catalog-items-${activeCategory.metadata.name.replace(" ", "")}`
: "catalog-items"; : "catalog-items";
const noItemsMessage = activeCategory?.metadata.name == "Dev Clusters" ? "There are no Dev Clusters in this space" const noItemsMessage = activeCategory?.spec.noItemsMessage ?? "Item list is empty";
: "Item list is empty";
if (this.activeTab === undefined) { if (this.activeTab === undefined) {
return null; return null;