-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Supporting typedInputs and simplified dynamic property setup #1237
base: main
Are you sure you want to change the base?
Conversation
Another avenue may be to utilise the existing mechanism of |
@Steve-Mcl,
|
The current implementation of the UI node only sends "timeout" or "confirm" etc. What I did here was to move the reason for it closing into The point of Fwiw, I don't mind what it's called. I chose Another suggestion on the forum was multiple outputs. That would remove the need for any property at all. E.g output 1-Success, output 2-cancelled etc |
I've been bitten by timeouts in the past. I did also move the clear calls above the emit but i could still cause dual messages. The interlock was a final catch all that stopped it happening. |
I need to spend time on this before committing either way, and give it the attention it deserves, will quickly comment on:
Whilst it's clean from the notification node perspective, joining these in order to compute on them is then a pain as you have two async messages. |
There would be no need to join. The msg (and its original payload) would be sent to the specific output - zero joins, zero switches - if it comes out of port 1 - success, port 2 - cancelled, etc |
I think the confusion is that early on there was a suggestion to move just the result to a separate output, but I think that has been superseded by the suggestion of sending just to one output of the three, dependent on what is clicked. Effectively including a Switch node inside the Notification node. |
Does this PR already include adding a note to the docs and help text to say that empty or 0 timeout disables the timeout? |
No Colin. No docs done at all - very much PoC at the moment. Will make a mental note to include that kind of info if/when it evolves into something. |
In fact that is actually just something missing from the docs for the existing node, it isn't anything to do with the suggested enhancements. |
progress finalise typed input support update ignore
@joepavitt as discussed recently. This rather large PR (sorry) covers the whole boilerplate setup required for nodes when using typedInputs and dynamic properties. This to check (not sure i have handled, but my flows are now corrupted by the new features (for want of better words)
I am more than happy to do a 1:1 when you come to review as I realise this is rather large. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for consideration
@Steve-Mcl merging #1343 has triggered a merge conflict - you okay to sanity check it please? |
All done. Found and fixed an issue too so e2e tests should pass now. |
so this (rather large) piece of work now has conflicts again - bah! There are some things in this PR that fix things like breaking of widgets after being dynamically updated etc - we should get this is. It is likely going to conflict with #1401 / #1428 and #30 / #1369 With these 3 large PRs hanging around, I am loathe to start some of the other tasks that will probably compound this further. |
Thanks Steve, it's a huge PR which is going to take a lot of my time to review properly. I can't promise when I can get to it as there are a lot of fundamental changes here. |
I understand Joe. This may be one that is simply pulled and tested. Happy to do on a call tomorrow to make this swift(er) |
Let's do that - mind putting something in that suits you please? |
Description
This is not tied directly to any one ISSUE.
This was based on recent forum feedback and my desire to support TypedInputs throughout DB2 widgets.
The changes implemented are opinionated and may not all may be welcomed but since I had some playtime, and I like where it got to, I thought I would raise a PR for feedback.
At present, this PR includes no doc updates or tests because if the changes are rejected I wont have wasted any time ;)
Whats changed
Support
DynamicProperties
// as part of registration of a node... const dynamicProperties = { label: true, mode: true, clearable: true, icon: true, iconPosition: true, iconInnerPosition: true } group.register(node, config, evts, { dynamicProperties })
beforeSend
beforeSend
they can callmsg = await applyUpdates(RED, node, msg)
to perform the same thing ui_base does.Support
TypedInput
// as part of registration instead const typedInputs = { label: { nodeProperty: 'label', nodePropertyType: 'labelType' } } group.register(node, config, evts, { typedInputs })
property
/propertyType
and applying the computed value to the existingui_update
methods of transmitting the value to the client side.register
method.label
label
andvalue
Notification specific improvements
false
(hard coded)reason
tomsg._event
msg._event.reason
will contain the relevant close reason oftimeout
,dismiss_clicked
, orconfirm_clicked
show
is trueDemo
Related Issue(s)
Checklist
flowforge.yml
?FlowFuse/helm
to update ConfigMap TemplateFlowFuse/CloudProject
to update values for Staging/ProductionLabels
area:migration
label