Repository navigation
Conversation
…in a subflow, with translated labels
… elementSizer behavior
|
Pulled the branch and ran it locally. Verified
Questions
|
|
I am attempting to test this. I am running the branch 2343-subflow-aware-sizer but it appears to have broken the sizer-in-a-subflow feature. Core dashboard nodes that already exist in a subflow are shown correctly, but if I add a new (core) one to a subflow then it shows the usual sizer, not width/height/order. Any suggestions what I may be doing wrong? [Edit] In fact after a page refresh even existing nodes in the subflow have reverted to showing the interactive sizer. |
|
Hey @andypalmi thank you for looking, added both. Small correction on 3.x Order still shows if the template has its own order input, which all core widgets do. It's only contrib nodes without one that lose it. The comment and the note in the Subflows doc say that. |
|
Hey @colinl do you also have |
|
@n-lark yes I do have D1 installed. |
|
I have not followed along fully but I suspect having D1 and D2 name their sizer widget exactly the same thing
Renaming flowfuse element sizer to something like |
That said, it would probably break existing contribs using elementSizer - bah! - this should have never happened in the first place :( |
…is installed and add the missing elementSizerByNum
|
@Steve-Mcl yahhh I thought the same thing but renaming would break all the contrib nodes so instead I made the sizer get picked per node when the editor opens. Dashboard nodes get ours, D1 nodes keep theirs. I tested with and without D1 and seems to be working. @colinl mind giving it another go? Just restart Node-RED after pulling. Thank you sm for catching this, never would've found it on my own. |
| $.fn.elementSizer = (otherSizer && !isDashboardNode) ? otherSizer : dashboardSizer | ||
| }) | ||
|
|
||
| $.widget('nodereddashboard.elementSizerByNum', { |
There was a problem hiding this comment.
This is just ported over from node-red-dashboard - we call it and it would throw unless d1 was installed.
|
All good now. Tested with @colinl/node-red-dashboard-2-ui-gauge-classic and @hotnipi/node-red-dashboard-2-ui-edgewise-meter. |
|
@colinl could you post a couple of screenshots of the edit panels of both those nodes please (one where the sizer is shown, one where the fields are shown) - I am curious as to how they affect layout and if we should inline them!? |
|
@Steve-Mcl, Certainly
|




Description
Contrib dashboard nodes in a subflow only showed the Size button, so size and order couldn't be set per instance with
${ENV}. Core widgets worked around this with a block copied into all 19 of them.elementSizernow detects the subflow and shows Width, Height and Order inputs itself. Every node using the sizer gets this for free, and the 19 copies are gone.ui-spacerOrder not saving in subflows (typo in the input id)node-red-dashboard) is installed. Both register$.fn.elementSizerand D1 loads last, so its sizer replaced ours. The sizer is now picked per node when the editor opens, and D1 nodes keep D1'selementSizerByNum, which our sizer called but never defined. Clicking the size label in the popup threw unless D1 was installedNo changes needed for contrib authors. The example node already uses the sizer this way, so it just works.
Test plan
npm test, lint${W}/${H}/ order save, grid picker outsideW×HRelated Issue(s)
Resolves #2343
Checklist
flowforge.yml?FlowFuse/helmto update ConfigMap TemplateFlowFuse/CloudProjectto update values for Staging/ProductionLabels
area:migrationlabel