Closed padraic-padraic closed 1 year ago
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.
Running locally against Python 3.8 passes now, screenshot is provided 🙂
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.