diff --git a/packages/core/src/common/catalog/category-registry.ts b/packages/core/src/common/catalog/category-registry.ts index 75c33d8a10..e4de26b322 100644 --- a/packages/core/src/common/catalog/category-registry.ts +++ b/packages/core/src/common/catalog/category-registry.ts @@ -34,6 +34,10 @@ export class CatalogCategoryRegistry { }; } + getById(id: string) { + return iter.find(this.categories.values(), (category) => category.getId() === id); + } + @computed get items() { return Array.from(this.categories); } diff --git a/packages/core/src/extensions/renderer-api/navigation.ts b/packages/core/src/extensions/renderer-api/navigation.ts index ec7081c948..4b7dcd5d39 100644 --- a/packages/core/src/extensions/renderer-api/navigation.ts +++ b/packages/core/src/extensions/renderer-api/navigation.ts @@ -3,6 +3,8 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ +import hideEntityDetailsInjectable from "../../renderer/components/+catalog/entity-details/hide.injectable"; +import showEntityDetailsInjectable from "../../renderer/components/+catalog/entity-details/show.injectable"; import getDetailsUrlInjectable from "../../renderer/components/kube-detail-params/get-details-url.injectable"; import hideDetailsInjectable from "../../renderer/components/kube-detail-params/hide-details.injectable"; import showDetailsInjectable from "../../renderer/components/kube-detail-params/show-details.injectable"; @@ -20,3 +22,6 @@ export const hideDetails = asLegacyGlobalFunctionForExtensionApi(hideDetailsInje export const createPageParam = asLegacyGlobalFunctionForExtensionApi(createPageParamInjectable); export const isActiveRoute = asLegacyGlobalFunctionForExtensionApi(isActiveRouteInjectable); export const navigate = asLegacyGlobalFunctionForExtensionApi(navigateInjectable); + +export const showEntityDetails = asLegacyGlobalFunctionForExtensionApi(showEntityDetailsInjectable); +export const hideEntityDetails = asLegacyGlobalFunctionForExtensionApi(hideEntityDetailsInjectable); diff --git a/packages/core/src/features/catalog/__snapshots__/entity-running.test.tsx.snap b/packages/core/src/features/catalog/__snapshots__/entity-running.test.tsx.snap new file mode 100644 index 0000000000..2d5653372c --- /dev/null +++ b/packages/core/src/features/catalog/__snapshots__/entity-running.test.tsx.snap @@ -0,0 +1,1608 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`entity running technical tests when navigated to catalog renders 1`] = ` + +
+
+
+
+
+ + + home + + +
+
+
+ + + arrow_back + + +
+
+
+ + + arrow_forward + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Ca +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + arrow_left + + +
+
+ 1 +
+
+ + + arrow_right + + +
+
+
+
+
+
+
+
+
+ +`; + +exports[`entity running technical tests when navigated to catalog when details panel is opened renders 1`] = ` + +
+
+
+
+
+ + + home + + +
+
+
+ + + arrow_back + + +
+
+
+ + + arrow_forward + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Ca +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + arrow_left + + +
+
+ 1 +
+
+ + + arrow_right + + +
+
+
+
+
+
+
+
+
+ +
+
+
+
+ Mock: a catalog entity + + + content_copy + + +
+ Copy +
+
+ + + close + + +
+ Close +
+
+
+
+
+
+ ace +
+
+ Click to open +
+
+ +
+
+
+
+
+
+ +`; diff --git a/packages/core/src/features/catalog/__snapshots__/opening-entity-details.test.tsx.snap b/packages/core/src/features/catalog/__snapshots__/opening-entity-details.test.tsx.snap index c7b284a08e..69f175cfcd 100644 --- a/packages/core/src/features/catalog/__snapshots__/opening-entity-details.test.tsx.snap +++ b/packages/core/src/features/catalog/__snapshots__/opening-entity-details.test.tsx.snap @@ -1925,10 +1925,10 @@ exports[`opening catalog entity details panel when navigated to the catalog when />