Add CatalogCategory filter to the extension API (#3718)

* Add CatalogCategory filter to the extension API.

Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>

* Fix test.

Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
This commit is contained in:
Panu Horsmalahti authored and GitHub committed 2021-09-13 15:46:28 +03:00
1 parent e2b096fae1
commit 936927af98
6 files changed
+96 -8

No files matched your search

@@ -29,6 +29,7 @@ import { Icon } from "../icon";
import { StylesProvider } from "@material-ui/core";
import { cssNames } from "../../utils";
import type { CatalogCategory } from "../../api/catalog-entity";
import { observer } from "mobx-react";
type Props = {
activeItem: string;
@@ -36,7 +37,7 @@ type Props = {
};
function getCategories() {
return catalogCategoryRegistry.items;
return catalogCategoryRegistry.filteredItems;
}
function getCategoryIcon(category: CatalogCategory) {
@@ -53,7 +54,7 @@ function Item(props: TreeItemProps) {
);
}
export function CatalogMenu(props: Props) {
export const CatalogMenu = observer((props: Props) => {
return (
// Overwrite Material UI styles with injectFirst https://material-ui.com/guides/interoperability/#controlling-priority-4
<StylesProvider injectFirst>
@@ -88,4 +89,4 @@ export function CatalogMenu(props: Props) {
</div>
</StylesProvider>
);
}
});