Skip to content

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

Open
kristofferrandersen wants to merge 1 commit into
uber:masterfrom
kristofferrandersen:fix-current
Open

Set the first option as current when none is given#99
kristofferrandersen wants to merge 1 commit into
uber:masterfrom
kristofferrandersen:fix-current

Conversation

@kristofferrandersen

@kristofferrandersen kristofferrandersen commented Mar 31, 2023

Copy link
Copy Markdown

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
}
this.state.current = defaultOption
} else if (!this.state.current && !this.state.includeAll) {
} else if (!this.state.current) {

@najisawas najisawas Mar 31, 2023

Copy link
Copy Markdown
Contributor

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

kristofferrandersen commented Mar 31, 2023 via email

Copy link
Copy Markdown
Author

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