StatPanel: Fix stat panel display name not showing when explicitly set #26616
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #26583
A bit conflicted on how to solve this or if it should be solved. with Text mode set to Auto should stat panel show display name if set via Field tab default? what about via override? I started on a fix like that, to check in StatPanel.tsx if fieldConfig.defaults.displayName was set and then switch text mode to value and name (passed to BigValue). But not sure, maybe Auto should just be if count === 1 then do not show name, if you want to show name if count === 1 you have to change display name. and to fix broken old dashboards instead of adding logic in StatPanel.tsx we can do a migration that for panels with default displayName set we change textMode. Only downside with that users will try to change Display name and it won't have any effect when text mode set to Auto.