Hi There,
I was playing around with the idea of having a search limited to a selection of nodes/groups when I thought how hard could it be?.
So I had a look at the source code and discovered the uses:<node-id> flag:
val = extractValue(val,"uses",flags);// uses:<node-id>
Great I thought, then all I need to do is implement uses:selection, which I did somewhat like this:
if (flags.uses && flags.uses.indexOf("selection") >= 0) {
let seletectedThings = (RED.view.selection() &&
RED.view.selection().nodes) || [];
flags.uses = seletectedThings.map( d => d.id )
seletectedThings.forEach( thng => {
if ( thng.type == "group" ) {
RED.group.getNodes(thng,true,false).forEach( d => flags.uses.push(d.id) )
}
})
flags.uses = [ ...new Set(flags.uses) ]
}
But then I discovered that the uses feature doesn't work or at least I couldn't get it working. So I debugged it. Eventually I figured out how the search works and that the uses flags should be used as a filter and not as a keys reduction value. Anyway, a made two other changes and now the feature is available over at Browser-Red.
