-
Notifications
You must be signed in to change notification settings - Fork 11.7k
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
Dashboard: Migration - Dashboard Settings Variables (List, Duplicate, Delete) #78917
Conversation
…les with the old format
Did a quick testing @axelavargas, and found some issues:
![]()
![]()
|
public/app/features/dashboard-scene/settings/VariablesEditView.tsx
Outdated
Show resolved
Hide resolved
@dprokop Thanks for the review 🙌🏾 , regarding not being able to create variables, indeed that is not being implemented in this PR. I am planning to tackle it in a different PR, my reasoning was to keep this PR small and also learn that we will need to create new forms per each variable type. |
public/app/features/dashboard-scene/settings/VariablesEditView.tsx
Outdated
Show resolved
Hide resolved
public/app/features/dashboard-scene/settings/VariablesEditView.tsx
Outdated
Show resolved
Hide resolved
public/app/features/dashboard-scene/settings/VariablesEditView.tsx
Outdated
Show resolved
Hide resolved
public/app/features/dashboard-scene/settings/VariablesEditView.tsx
Outdated
Show resolved
Hide resolved
infoBox={{ | ||
__html: ` <p> | ||
Variables enable more interactive and dynamic dashboards. Instead of hard-coding things like server | ||
or sensor names in your metric queries you can use variables in their place. Variables are shown as | ||
list boxes at the top of the dashboard. These drop-down lists make it easy to change the data | ||
being displayed in your dashboard. Check out the | ||
<a class="external-link" href="https://grafana.com/docs/grafana/latest/variables/" target="_blank"> | ||
Templates and variables documentation | ||
</a> | ||
for more information. | ||
</p>`, | ||
}} |
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.
Probably, we should add internationalization here. WDYT?
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.
I think is a good idea, but I would refrain from doing it in the scope of the migration 😄.
@@ -195,6 +195,11 @@ export function createDashboardSceneFromDashboardModel(oldModel: DashboardModel) | |||
variables = new SceneVariableSet({ | |||
variables: variableObjects, | |||
}); | |||
} else { |
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.
If it is mandatory to get always a valid value in variables
, probably it is a good idea to add a test for it. WDYT?
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.
Good idea, I have added the test :)
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.
yeah, +1 to ivan's. Overall what we see is it's better to attach even empty objects rather than conditonally adding theme. It simplifies downstream code a lot.
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
public/app/features/dashboard-scene/settings/VariablesEditView.tsx
Outdated
Show resolved
Hide resolved
public/app/features/dashboard-scene/settings/VariablesEditView.tsx
Outdated
Show resolved
Hide resolved
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.
Looks good now @axelavargas. I suggest merging this PR and moving forward with the following tasks :) They may reveal some gaps that we may not see here, but not necessarily.
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.
Thanks for considering the feedback ✅
Basic infrastructure
NOTE:
Not implemented anything regarding usage, renaming variables or creating variables
Part of: #78690