-
Notifications
You must be signed in to change notification settings - Fork 715
fix: dashboard refresh warning when no variables present #8191
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
fix: dashboard refresh warning when no variables present #8191
Conversation
PR Reviewer Guide 🔍(Review updated until commit b9667ec)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to b9667ec
Previous suggestionsSuggestions up to commit b9667ec
|
|
Persistent review updated to latest commit b9667ec |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Summary
This PR fixes a UX issue in the dashboard interface where the refresh button would incorrectly display a warning state (orange color with warning message) when no variables are present on the dashboard. The problem occurred because of inconsistent initialization of two reactive objects used to track variable states.
The change is in ViewDashboard.vue and addresses the root cause by ensuring both variablesData and refreshedVariablesData reactive objects are properly initialized with identical empty states when a dashboard has no variables configured. Specifically, when no variables are present, both objects now get:
isVariablesLoadingset tofalsevaluesset to an empty array[]
This fix integrates with the existing isVariablesChanged computed property that performs deep equality comparison between these two objects to determine whether to show the warning state. Previously, only variablesData was being initialized while refreshedVariablesData remained uninitialized (empty object {}), causing the comparison to always return true for "variables changed" even when no variables existed. The solution ensures consistent initialization, making the comparison accurate and eliminating false positive warnings.
The change fits well within the component's architecture, which already handles various dashboard states and uses these reactive objects throughout the variable management system.
Confidence score: 5/5
- This PR is safe to merge with minimal risk
- Score reflects a targeted bug fix with clear logic and no side effects
- No files require special attention
1 file reviewed, no comments
b9667ec to
352bc06
Compare
PR Type
Bug fix
Description
Prevent refresh warning without dashboard variables
Reset refreshed variables state when none exist
Diagram Walkthrough
File Walkthrough
ViewDashboard.vue
Reset refreshed variables state when none existweb/src/views/Dashboards/ViewDashboard.vue
refreshedVariablesData.refreshedVariablesData.isVariablesLoadingto false.refreshedVariablesData.valuesarray.