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

Set the first option as current when none is given #99

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kristofferrandersen
Copy link

@kristofferrandersen kristofferrandersen commented Mar 31, 2023

When starting to use grafana varsion 9.3.8 we have issues when the templates do not have the current value set. This was prev. the case when includeAll was true and not current or defaultvalue was set. In this diff we ensure that current is always set

@kristofferrandersen kristofferrandersen marked this pull request as ready for review March 31, 2023 13:57
@@ -92,7 +92,7 @@ Custom.prototype._processOptions = function _processOptions() {
throw new SyntaxError("default value not found in options list")
}
this.state.current = defaultOption
} else if (!this.state.current && !this.state.includeAll) {
} else if (!this.state.current) {
Copy link
Contributor

@najisawas najisawas Mar 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure this will break includeAll. For example if includeAll == true then it will get ignored and the dash will default to the newOptions[0], right?

i remember playing with something related to this area in grafana. I would recommend looking into how current is set when theres no allValue. For example if the allValue is "" i believe current is set to null. But if there is an allValue then it's used

@kristofferrandersen
Copy link
Author

kristofferrandersen commented Mar 31, 2023 via email

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