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

ui-dropdown sync issue #1570

Merged
merged 2 commits into from
Jan 10, 2025
Merged

Conversation

bartbutenaers
Copy link
Contributor

Description

When a dropdown value is selected in one dashboard, then the other dashboard is updated. But the dropdown in the second dashboard shows the new value (instead of the new label).

This only seemed to happen when the following option was selected:

image

In that case the ui-dropdown node uses a v-combobox (instead of a v-select). Such a combobox has a caveats section, because it requires the full item (i.e. object with label and value) instead of only the value.

I used this example flow:

[{"id":"44c5df29fd7e7a1d","type":"ui-dropdown","z":"5d03484c007ac7f6","group":"bbec16a84d289909","name":"","label":"Select Option:","tooltip":"","order":1,"width":0,"height":0,"passthru":false,"multiple":false,"chips":false,"clearable":false,"options":[{"label":"String one","value":"one","type":"str"},{"label":"Number 2","value":2,"type":"num"},{"label":"Boolean true","value":true,"type":"bool"},{"label":"Boolean false","value":false,"type":"bool"}],"payload":"","topic":"topic","topicType":"msg","className":"","typeIsComboBox":true,"msgTrigger":"onChange","x":1060,"y":200,"wires":[["51d9bc7a797cbdfd"]]},{"id":"51d9bc7a797cbdfd","type":"debug","z":"5d03484c007ac7f6","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1240,"y":200,"wires":[]},{"id":"7492232dc64b68f7","type":"inject","z":"5d03484c007ac7f6","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"one","payloadType":"str","x":850,"y":200,"wires":[["44c5df29fd7e7a1d"]]},{"id":"581f73fdaaa6283e","type":"inject","z":"5d03484c007ac7f6","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"2","payloadType":"num","x":850,"y":240,"wires":[["44c5df29fd7e7a1d"]]},{"id":"ecc74a25ac6757ed","type":"inject","z":"5d03484c007ac7f6","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":850,"y":280,"wires":[["44c5df29fd7e7a1d"]]},{"id":"b34df764bce13d78","type":"inject","z":"5d03484c007ac7f6","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"false","payloadType":"bool","x":850,"y":320,"wires":[["44c5df29fd7e7a1d"]]},{"id":"bbec16a84d289909","type":"ui-group","name":"Group 1","page":"361c099f0b8b4fd9","width":10,"height":1,"order":1,"showTitle":true,"className":"","visible":"true","disabled":"false","groupType":"default"},{"id":"361c099f0b8b4fd9","type":"ui-page","name":"Page 1","ui":"ba0979b23b606ba0","path":"/page1","icon":"home","layout":"flex","theme":"c10c66e2e8a774ed","breakpoints":[{"name":"Default","px":"0","cols":"3"},{"name":"Tablet","px":"576","cols":"6"},{"name":"Small Desktop","px":"768","cols":"9"},{"name":"Desktop","px":"1024","cols":"12"}],"order":1,"className":"","visible":"true","disabled":"false"},{"id":"ba0979b23b606ba0","type":"ui-base","name":"My Dashboard","path":"/dashboard","appIcon":"","includeClientData":true,"acceptsClientConfig":["ui-notification","ui-control"],"showPathInSidebar":false,"navigationStyle":"default","titleBarStyle":"default","showReconnectNotification":true,"notificationDisplayTime":1,"showDisconnectNotification":true},{"id":"c10c66e2e8a774ed","type":"ui-theme","name":"Default Theme","colors":{"surface":"#ffffff","primary":"#0094CE","bgPage":"#eeeeee","groupBg":"#ffffff","groupOutline":"#cccccc"},"sizes":{"density":"default","pagePadding":"12px","groupGap":"12px","groupBorderRadius":"4px","widgetGap":"12px"}}]

To test it with all the available data types:
ui-dropdown-sync-issue

Related Issue(s)

1569 : this PR solves only 1 of 2 problems in that ticket!

Checklist

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production

Labels

  • Includes a DB migration? -> add the area:migration label

@joepavitt joepavitt self-requested a review January 10, 2025 10:42
@joepavitt joepavitt merged commit 11c4f0a into FlowFuse:main Jan 10, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants