mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Clean at the upstream line 41
Signed-off-by: Hung-Han (Henry) Chen <chenhungh@gmail.com>
This commit is contained in:
parent
b0cff92ca8
commit
5ff2c6941c
@ -38,7 +38,7 @@ export class CatalogEntityRegistry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@action updateItems(items: (CatalogEntityData & CatalogEntityKindData)[]) {
|
@action updateItems(items: (CatalogEntityData & CatalogEntityKindData)[]) {
|
||||||
this._items = items.map(data => this.categoryRegistry.getEntityForData(data));
|
this._items = items.map(data => this.categoryRegistry.getEntityForData(data)).filter(Boolean);
|
||||||
}
|
}
|
||||||
|
|
||||||
set activeEntity(entity: CatalogEntity) {
|
set activeEntity(entity: CatalogEntity) {
|
||||||
@ -65,9 +65,7 @@ export class CatalogEntityRegistry {
|
|||||||
|
|
||||||
getItemsForCategory<T extends CatalogEntity>(category: CatalogCategory): T[] {
|
getItemsForCategory<T extends CatalogEntity>(category: CatalogCategory): T[] {
|
||||||
const supportedVersions = category.spec.versions.map((v) => `${category.spec.group}/${v.name}`);
|
const supportedVersions = category.spec.versions.map((v) => `${category.spec.group}/${v.name}`);
|
||||||
const items = this._items
|
const items = this._items.filter((item) => supportedVersions.includes(item.apiVersion) && item.kind === category.spec.names.kind);
|
||||||
.filter(Boolean)
|
|
||||||
.filter((item) => supportedVersions.includes(item.apiVersion) && item.kind === category.spec.names.kind);
|
|
||||||
|
|
||||||
return items as T[];
|
return items as T[];
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user