Skip to content

@k8slens/extensions / Exports / Common / Catalog / CatalogCategory

Class: CatalogCategory#

Common.Catalog.CatalogCategory

Hierarchy#

  • CatalogCategory_base

CatalogCategory

↳↳ KubernetesClusterCategory

Table of contents#

Constructors#

Properties#

Methods#

Constructors#

constructor#

new CatalogCategory()

Inherited from#

CatalogCategory_base.constructor

Properties#

apiVersion#

Readonly Abstract apiVersion: string

The version of category that you are wanting to declare.

Currently supported values:

  • "catalog.k8slens.dev/v1alpha1"

filters#

Protected Readonly filters: ObservableSet<AddMenuFilter>


kind#

Readonly Abstract kind: string

The kind of item you wish to declare.

Currently supported values:

  • "CatalogCategory"

metadata#

Readonly Abstract metadata: CatalogCategoryMetadata

The data about the category itself


spec#

Readonly Abstract spec: CatalogCategorySpec

The most important part of a category, as it is where entity versions are declared.

Methods#

addMenuFilter#

addMenuFilter(fn): Disposer

Add a filter for menu items of catalogAddMenu

Parameters#

Name Type Description
fn AddMenuFilter The function that should return a truthy value if that menu item should be displayed

Returns#

Disposer

A function to remove that filter


filteredItems#

filteredItems(menuItems): CatalogEntityAddMenu[]

Filter menuItems according to the Category's set filters

Parameters#

Name Type Description
menuItems CatalogEntityAddMenu[] menu items to filter

Returns#

CatalogEntityAddMenu[]

filtered menu items


getBadge#

getBadge(): StrictReactNode

Get the badge of this category. Defaults to no badge. The badge is displayed next to the Category name in the Catalog Category menu

Returns#

StrictReactNode


getId#

getId(): string

Get the ID of this category

Returns#

string


getName#

getName(): string

Get the name of this category

Returns#

string


parseId#

Static parseId(id): Object

Parse a category ID into parts.

Parameters#

Name Type Description
id string The id of a category is parse

Returns#

Object

The group and kind parts of the ID

Name Type
group? string
kind? string