bartbutenaers / node-red-contrib-blockly

A Node Red node for visual programming a function using Blockly
Apache License 2.0
89 stars 22 forks source link

Add OR block #34

Open bartbutenaers opened 6 years ago

bartbutenaers commented 6 years ago

See feature request on the Node-RED forum from @mikeS7:

Has property in a get block is the nice feature. Could you please add default value to the get method to support javascript style such as msg.property || or for a context context.get('property') ||

But we need to take into account the feedback from Dave:

don't forget that that syntax doesn't always work as 0, "0", false, etc are all "falsey" in javascript, so while it's a neat shorthand in many cases... it's not 100%. I'd argue it's safer to leave out of the blocks for now.

We will postpone this feature to version 1.2.0

bartbutenaers commented 3 years ago

The AND/OR block is already available in the "Logic" category:

blockly_or

bartbutenaers commented 3 years ago

@mikeS7, I will reopen this issue, based on the comments on Discourse.

bartbutenaers commented 3 years ago

When we don't find/want an easy solution, at least the workaround and workspace from @cymplecy should be added to a wiki page.

mikeS7 commented 3 years ago

I agree with Simon, this is specific to Javascript. Solution with Javascript block is elegant and simple. image

bartbutenaers commented 3 years ago

@cymplecy, Can you then please create a wiki page with both your flows from Discourse please? Thanks!

cymplecy commented 3 years ago

Certainly :)

cymplecy commented 3 years ago

Basic page done - will probably amend it later but at least it's there :)

https://github.com/bartbutenaers/node-red-contrib-blockly/wiki/Advanced-usage

bartbutenaers commented 3 years ago

Ok thanks!! Perhaps you can add your flow json definitions also, so people can import them.