Skip to content
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

Control enabled/disabled for UI-SLIDER #1610

Open
ortegafernando opened this issue Feb 5, 2025 · 7 comments
Open

Control enabled/disabled for UI-SLIDER #1610

ortegafernando opened this issue Feb 5, 2025 · 7 comments
Labels
feature-request New feature or request that needs to be turned into Epic/Story details needs-triage Needs looking at to decide what to do

Comments

@ortegafernando
Copy link

Description

Hi, why not add the control enabled/disabled feature for ui-slider? (msg.enabled TRUE/FALSE)

And why not for other nodes?

Thanks

Have you provided an initial effort estimate for this issue?

I have provided an initial effort estimate

@ortegafernando ortegafernando added feature-request New feature or request that needs to be turned into Epic/Story details needs-triage Needs looking at to decide what to do labels Feb 5, 2025
@colinl
Copy link
Contributor

colinl commented Feb 5, 2025

msg.enabled boolean true/false works for me. Not TRUE/FALSE of course.
It should work the same for most, if not all, ui nodes that generate an output.

Example flow:

[{"id":"f22455a1d7ebe86c","type":"inject","z":"997da33a0beedade","name":"enable","props":[{"p":"enabled","v":"true","vt":"bool"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":190,"y":7000,"wires":[["b8507b8c4fa9309b"]]},{"id":"36a0fc86e683c938","type":"inject","z":"997da33a0beedade","name":"disable","props":[{"p":"enabled","v":"false","vt":"bool"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":190,"y":7040,"wires":[["b8507b8c4fa9309b"]]},{"id":"1badd748960885a1","type":"debug","z":"997da33a0beedade","name":"debug 31","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":660,"y":7020,"wires":[]},{"id":"bc6e1420642b3da6","type":"ui-slider","z":"997da33a0beedade","group":"4f87bd59a15b847e","name":"","label":"slider","tooltip":"","order":0,"width":0,"height":0,"passthru":false,"outs":"all","topic":"topic","topicType":"msg","thumbLabel":"true","showTicks":"always","min":0,"max":10,"step":1,"className":"","iconPrepend":"","iconAppend":"","color":"","colorTrack":"","colorThumb":"","showTextField":false,"x":470,"y":7020,"wires":[["1badd748960885a1"]]},{"id":"b8507b8c4fa9309b","type":"junction","z":"997da33a0beedade","x":340,"y":7020,"wires":[["bc6e1420642b3da6"]]},{"id":"4f87bd59a15b847e","type":"ui-group","name":"test","page":"c6ff182a4185f2f2","width":"6","height":"1","order":1,"showTitle":false,"className":"","visible":"true","disabled":"false"},{"id":"c6ff182a4185f2f2","type":"ui-page","name":"Test page","ui":"ID-BASE-1","path":"/testpage","icon":"home","layout":"grid","theme":"f9b6670b127dc219","order":2,"className":"","visible":"true","disabled":"false"},{"id":"ID-BASE-1","type":"ui-base","name":"Dashboard","path":"/dashboard","includeClientData":true,"acceptsClientConfig":["ui-control","ui-notification","ui-gauge-classic"],"titleBarStyle":"default"},{"id":"f9b6670b127dc219","type":"ui-theme","name":"FlowForge Theme","colors":{"surface":"#152a47","primary":"#005aff","bgPage":"#ffffff","groupBg":"#ffffff","groupOutline":"#cc3e3e"},"sizes":{"pagePadding":"12px","groupGap":"12px","groupBorderRadius":"4px","widgetGap":"12px"}}]

@bartbutenaers
Copy link
Contributor

It should work the same for most, if not all, ui nodes

Hii @colinl,
I did not have a detailed look at this. But at first sight the msg.enabled is being handled in the ui-base code. And I don't think that piece of the base code can be overridden by a ui widget, so I would also think that it is automatically handled for all ui nodes.

But you know that the whole stores mechanism is quite complex, so indeed it might be that the msg.enabled gets lost for the slider somewhere in the backend or frontend. Don't know at the moment...

@colinl
Copy link
Contributor

colinl commented Feb 5, 2025

it might be that the msg.enabled gets lost for the slider

No, as I said, msg.enabled does work for me with the slider.

@ortegafernando
Copy link
Author

That is good news! Thanks a lot.

I haven't tried it yet; I've only read the documentation about the slider, and I haven't seen anything about the 'enabled' option.

So, maybe it's only necessary to update the documentation?

@colinl
Copy link
Contributor

colinl commented Feb 6, 2025

Yes, I imagine a Pull Request to update the docs would be very welcome.

@ortegafernando
Copy link
Author

I have just tried to check slider and it works perfectly. What I dont know exaclty how to do is to check if all ui nodes will behave the same.

@colinl
Copy link
Contributor

colinl commented Feb 6, 2025

The only way to be certain is to test them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request that needs to be turned into Epic/Story details needs-triage Needs looking at to decide what to do
Projects
Status: Backlog
Development

No branches or pull requests

3 participants