1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Adding noItemsMessage to CatalogEntitySpec

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

View File

@ -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;
}
/**

View File

@ -250,8 +250,7 @@ class NonInjectedCatalog extends React.Component<Props & Dependencies> {
? `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;