Closed seth350 closed 5 years ago
Good catch! I swear it was working at some point, it must have been when it was built half from examples and had ui_
still in the type name ;)
Does lineargauge also have this issue or am I missing a difference between the two?
Yes, the current version in the repo has the same issue. I have another fork going right now making the changes. I fought with this all day yesterday and finally got an answer today.
Gotcha! Was this a recently change in node-red-dashboard?
Thanks a lot btw, didn't say so from the get go 👍
Hmm, now I'm getting:
TypeError: Cannot read property 'config' of null`
null
being the group
. It's resolved when I manually add the node to a dashboard group.
Investigating further!
Right, group
should be a required value, this error is valid if one shirks the warning making it required presents. Unrelated to this change!
Yes, and it is also a good idea to check that the config
is defined and that a group is present over in the .js file.
function checkConfig(node, conf) {
if (!conf || !conf.hasOwnProperty("group")) {
node.error(RED._("ui_list.error.no-group"));
return false;
}
return true;
}
Then place this call before you call ui.addWidget
if (checkConfig(node, config)) {
var html = HTML(config);
done = ui.addWidget({
node: node,
.....
} <-- second bracket for if statement here
}
catch (e) {
console.log(e);
}
Fixed issue with node not displaying in dashboard group in the sidebar. The node type must begin with "ui_"