-
Notifications
You must be signed in to change notification settings - Fork 26
Description
Describe the problem
Hi! I'm trying to add a decorator to a OpenShift Console dynamic plugin for use in their Topology page(s), but I'm running into the following error message when using the Decorator: TypeError: Cannot destructure property 'addDef' of 'undefined' as it is undefined
Example snippet: <Decorator x={x} y={y} radius={radius}></Decorator>
My dev console is pointing here: https://github.com/patternfly/react-topology/blob/main/packages/module/src/components/defs/SVGDefs.tsx#L27
How do you reproduce the problem?
I've put together a branch to illustrate this: https://github.com/aptmac/console-plugin-template/tree/example-decorator
It's an OpenShift dynamic plugin, so you'll need a running instance of OpenShift or CRC to test against.
- In one terminal, install and run the plugin:
yarn install && yarn run start - In another terminal, run a local console frontend:
yarn run start-console - Have a running deployment. Quickest way would be to go to the Developer perspective ->
+Addpage, and under "Create applications using samples" select "Basic Quarkus" and follow the steps to create - Go to the Topology page, and try to view the new deployment
The expected behaviour is that a new decorator should be present in the top left of the deployment node. The actual behaviour is the error message above.
Expected behavior
A clear and concise description of the expected behavior.
Is this issue blocking you?
List the workaround if there is one.
Screenshots
Actual: here's a screenshot of the error

Expected: I'm expecting a decorator and icon to be drawn in the top left of the node. Here I replaced the <Decorator> and used the icon directly instead and it appears, but it would look nicer with the decorator around it

What is your environment?
- OS: Fedora 42
- Browser: Chrome
- Version: 140.0.7339.80
Metadata
Metadata
Assignees
Labels
Type
Projects
Status