Closed cmoulliard closed 8 months ago
Still need to pass data that the plugin can display and which is matching the component
When correct data are mocked, then the kubernetes accordion is working.
So, there is certainly an issue with the context we provide to the Quarkus ApplicationInfo card which is perhaps related to this error:
My assumption is confirmed when I debug the code if I check the code as such:
const hasValues =
(obj) => Object.values(obj).some(v => v !== null && typeof v !== "undefined")
useEffect(() => {
if (! hasValues(watchResourcesData)) {
console.log("WatchedResourcesData object is empty !")
return;
}
==>
WatchedResourcesData object is empty !
I found the issue ;-)
The following code const componentName = currentPageLocation.pathname.split("/")[4];
part of QuarkusApplicationInfo.tsx
file which is working when a component is registered as Entity part of a backstage catalog don't work at all when we create a devApp
and set the path to access the Quarkus Console as such /quarkus
as the component name is not included !
Until now, I aligned the path of the Page to register the QuarkusApplicationInfo as such "/a/b/c/my-quarkus-app"
but we should certainly review how the componentName
to be fetched from the watchResourcesData
is calculated to avoid the issue.
createDevApp()
.addPage({
title: "Quarkus application info",
path: "/a/b/c/my-quarkus-app",
element: (
<TestApiProvider
apis={[
[kubernetesApiRef, new MockKubernetesClient(mockKubernetesQuarkusApplicationResponse)],
]}
>
<EntityProvider entity={mockEntity}>
<QuarkusConsolePage />
</EntityProvider>
</TestApiProvider>
)
})
@cmoulliard: Approved, but you might want to squash some of those commits before mergin.
No implementation available for apiRef{plugin.kubernetes-auth-providers.service}
-> fixed with commit "c84f991"