Extending Foreman Host creation Tab with React Js

I want to add a react_component in host creation page (more specifically, Virtual Machine Tab) from another plugin, foreman_fog_proxmox. I have registered the component in foreman_fog_proxmox with componentRegistry in index file in foreman_fog_proxmox. But when rendering the react_component in Virtual Machine tab it fails with the error Component not found in list of foreman components. The error occurs even before reaching the line in index file where I register the component. The issue occur if I only select compute resource to deploy on but the component is detected when I select the compute profile the component is visible. Am I missing something to config to make it visible/recognized in foreman host creation page?

Here is the draft PR for my code: Draft: Extend react app by Manisha15 · Pull Request #320 · theforeman/foreman_fog_proxmox · GitHub

Also commenting here as the pr:
Wrapping js code in <% content_for(:javascripts) do %> makes sure the loading order is correct

1 Like