cloudspout / cloudspout-button-panel

Grafana panel to integrate with any kind of HTTP/REST API
MIT License
50 stars 35 forks source link

'Custom' variant option resets to 'Primary' #34

Closed kochetov-dmitrij closed 3 years ago

kochetov-dmitrij commented 3 years ago

When I use 'Custom' variant, save my dashboard and reload the page, the variant option resets to 'Primary'. Because Grafana doesn't save undefined values into json configs, it uses the defaultValue which is 'primary'.

What is the point of using undefined value instead of 'custom' str? https://github.com/cloudspout/cloudspout-button-panel/blob/743a01b174358bce41d39302ebc1dfae06f272e8/src/module.ts#L107

derjust commented 3 years ago

Using undefinied was used to not invent a new value to store.

Thanks for reporting. Fixed in b885a23576c98f5076d50bdafedb131d000a6c8b