FlowFuse / FlowFuse/node-red-dashboard

Support for dynamic class in third party ui nodes

Open
#1,240 18 comments 0 reactions 0 assignees View on GitHub
needs-triage type:feature
Dominant language
HTML
Stars
355
Forks
82
Avg merge
4d 23h
Merged PRs (30d)
24

Description

### Description

I don't know whether this is a feature request or just a request for guidance.

Server side the dashboard includes seamless support for class control. The developer merely needs to provide a config field `className` for the node. This results in a `className` field in the `props` sent to the node on page refresh. In addition there is a `class` field in `props` that is initially an empty string.
If a message containing `msg.class` or `msg.ui_update.class` then the dashboard automatically includes that setting in `props.class`.

Client side there appears to be partial support. On opening the page, both the configured className and any class passed in via a message, automatically appear in the top level widget element in the DOM, which is perfect. However, when `msg.class` or `msg.ui_update.class` are sent to the node, the DOM does not immediately update, it does not update until the page is refreshed.

So the question is, does the developer need to provide support for this, or should the dashboard core code do this automatically? If the developer needs to do something then what is it?
I tried setting `props.class` when a message is received but that did not cause the DOM to change.

See this [forum post](https://discourse.nodered.org/t/how-to-handle-widget-class-in-a-third-party-db2-ui-node/90449) for background info.

### Have you provided an initial effort estimate for this issue?

I am no FlowFuse team member

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.