-
Notifications
You must be signed in to change notification settings - Fork 316
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
Main improved dashboard links #622
Main improved dashboard links #622
Conversation
Thanks for approving the workflows, will work to correct the tests shortly! |
Looks like the issue is with py37/38 support, will push some fixes shortly. |
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 the PR it looks really good and well documented.
I spotted one issue that might be type that I would like you to check.
If you had time, you could add a test for this class to the tests, but as this Class did not previously have a test, I am happy to merge without this.
Includes the ability to create direct links or a list of dashboard links, extra options like includeVars and targetBlank.
Removing this parameter is a breaking change... It didn't actually impact the generated link, other than acting as an alias to 'title' in some cases. If preferred, I can restore it to retain that alias behaviour, and perhaps add a warning log message?
2df85b5
to
fb44dd6
Compare
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.
LGTM
What does this do?
Extends the implementation of DashboardLink to support creating both direct links and lists of dashboards.
Why is it a good idea?
This enables grafanalib users to fully employ the DashboardLink feature. The previous JSON model was no longer accurate for recent grafana versions, meaning dashboard links were not properly generated. Here we add all available fields, allowing users to create dashboard links correctly from grafanalib.
Context
Dashboard Links are a way to create links along the top of a dashboard, linking either to other sets of dashboards from the same organization or arbitrary external resources. See the documentation here: https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/manage-dashboard-links/#manage-dashboard-links
Questions
I have removed a parameter from the old DashboardLink class,
dashboard
; this could consistute a breaking change.This parameter was not actually consumed by Grafana, so was in effect only acting as an internal alias to the
title
field. Thetitle
would only be shown if theDashboardLink.type
attribute is set tolink
, something actually not possible before this PR. so I don't consider it to be a significant change. But, if desired, we can retain that alias-like behaviour to maintain API compatability.