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

Switching gauge types clears users entered values #1266

Closed
Steve-Mcl opened this issue Sep 4, 2024 · 3 comments · Fixed by #1309
Closed

Switching gauge types clears users entered values #1266

Steve-Mcl opened this issue Sep 4, 2024 · 3 comments · Fixed by #1309
Assignees
Labels
bug Something isn't working size:S - 2 Sizing estimation point

Comments

@Steve-Mcl
Copy link
Contributor

Current Behavior

OP

  1. Next I added a gauge, and spent a while setting up the "segments" (these are the different colours for different thresholds of the gauge). Also I set up the range for the gauge. I enjoyed spending time choosing the segment colours and thresholds. Unfortunately when I deployed, the segment colours just didn't show at first. Then I changed another field and re-deployed, and suddenly they showed. Then the problem happened again, so I changed the gauge type, and immediately lost the threshold colours, threshold levels, and range, all of which I had carefully set and planned to duplicate later

Response

When switching gauge types, we have different defaults, it had been built to switch to the relevant defaults when changing gauge type. A better solution here would be for us to check your values vs. Our known defaults, if it doesnt match anything, keep your values...

See https://discourse.nodered.org/t/latest-dashboard-2-0-release-tabs-number-input-new-gauges/90506/28?u=steve-mcl for

Expected Behavior

If user has entered values, dont discard them

Steps To Reproduce

enter your own colour settings, switch gauge type

Environment

  • Dashboard version: current
  • Node-RED version:
  • Node.js version:
  • npm version:
  • Platform/OS: all
  • Browser: all

Have you provided an initial effort estimate for this issue?

I have provided an initial effort estimate

@Steve-Mcl Steve-Mcl added bug Something isn't working needs-triage Needs looking at to decide what to do labels Sep 4, 2024
@joepavitt joepavitt moved this from Backlog to Up Next in Dashboard Backlog Sep 10, 2024
@joepavitt joepavitt added size:S - 2 Sizing estimation point and removed needs-triage Needs looking at to decide what to do labels Sep 10, 2024
@gayanSandamal gayanSandamal moved this from Up Next to In Progress in Dashboard Backlog Sep 10, 2024
@gayanSandamal
Copy link
Contributor

@joepavitt this seems it has been already fixed with #1264

[{"id":"12275bcb16ade4b9","type":"ui-gauge","z":"80a7b66be7ea4735","g":"6dc51f8e4811d988","name":"","group":"f1e8ea54f0c8cf36","order":2,"width":3,"height":3,"gtype":"gauge-half","gstyle":"needle","title":"gauge","units":"units","icon":"","prefix":"","suffix":"","segments":[{"from":"0","color":"#5cd65c"},{"from":"4","color":"#ffc800"},{"from":"7","color":"#ea5353"}],"min":0,"max":10,"sizeThickness":16,"sizeGap":4,"sizeKeyThickness":8,"styleRounded":true,"styleGlow":false,"className":"","x":930,"y":5380,"wires":[]},{"id":"64692bd9f4c7a9f0","type":"inject","z":"80a7b66be7ea4735","g":"6dc51f8e4811d988","name":"dynamic","props":[{"p":"ui_update.suffix","v":"s","vt":"str"},{"p":"ui_update.prefix","v":"p","vt":"str"},{"p":"ui_update.gtype","v":"gauge-34","vt":"str"},{"p":"ui_update.icon","v":"home","vt":"str"},{"p":"ui_update.units","v":"t","vt":"str"},{"p":"ui_update.gstyle","v":"needle","vt":"str"},{"p":"ui_update.title","v":"speed 'O","vt":"str"},{"p":"ui_update.min","v":"2","vt":"num"},{"p":"ui_update.max","v":"7","vt":"num"},{"p":"ui_update.label","v":"label","vt":"str"},{"p":"ui_update.segments","v":"[{\"color\":\"#53ac6d\",\"from\":0},{\"color\":\"#bdd763\",\"from\":2},{\"color\":\"#f5ef59\",\"from\":4},{\"color\":\"#febe57\",\"from\":6},{\"color\":\"#f15353\",\"from\":8}]","vt":"json"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":760,"y":5340,"wires":[["12275bcb16ade4b9"]]},{"id":"3ba046be21906d25","type":"inject","z":"80a7b66be7ea4735","g":"6dc51f8e4811d988","name":"gauge-half","props":[{"p":"ui_update.gtype","v":"gauge-half","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":760,"y":5380,"wires":[["12275bcb16ade4b9"]]},{"id":"fab5f00bde7cc658","type":"inject","z":"80a7b66be7ea4735","g":"6dc51f8e4811d988","name":"gauge-34","props":[{"p":"ui_update.gtype","v":"gauge-34","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":760,"y":5420,"wires":[["12275bcb16ade4b9"]]},{"id":"f1e8ea54f0c8cf36","type":"ui-group","name":"#1266 Switching gauge types clears users entered values","page":"c2a6a254b088c41d","width":"6","height":"1","order":1,"showTitle":true,"className":"","visible":"true","disabled":"false"},{"id":"c2a6a254b088c41d","type":"ui-page","name":"1111","ui":"a171c8195c1b8e57","path":"/page1111","icon":"wifi","layout":"grid","theme":"0d92c765bfad87e6","order":18,"className":"","visible":"true","disabled":"false"},{"id":"a171c8195c1b8e57","type":"ui-base","name":"My Dashboard","path":"/dashboard","includeClientData":true,"acceptsClientConfig":["ui-control","ui-chart","ui-form","ui-file-input","ui-button","ui-button-group","ui-dropdown","ui-slider","ui-switch","ui-text","ui-table","ui-markdown","ui-notification","ui-template","ui-number-input"],"showPathInSidebar":false,"showPageTitle":true,"navigationStyle":"icon","titleBarStyle":"fixed"},{"id":"0d92c765bfad87e6","type":"ui-theme","name":"Basic Blue Theme","colors":{"surface":"#4d58ff","primary":"#cc00a7","bgPage":"#eeeeee","groupBg":"#ffffff","groupOutline":"#cccccc"},"sizes":{"pagePadding":"12px","groupGap":"12px","groupBorderRadius":"4px","widgetGap":"12px","density":"default"}}]
Screen.Recording.2024-09-11.at.16.14.13.mov

@joepavitt
Copy link
Collaborator

For dynamically injected values yes, as they're stored in the statestore, but when configuring the gauge "normally" via the config screen in Node-RED, those values are overwritten when switching gauge types.

@gayanSandamal
Copy link
Contributor

For dynamically injected values yes, as they're stored in the statestore, but when configuring the gauge "normally" via the config screen in Node-RED, those values are overwritten when switching gauge types.

@joepavitt Thank you for the clarification. I will work on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size:S - 2 Sizing estimation point
Projects
Status: Done
Status: Done
3 participants