PanelLinks: fixed issue with old panel links and grafana behind a subpath (#20298)

This commit is contained in:
Torkel Ödegaard 2019-11-11 12:18:58 +01:00 committed by GitHub
parent 422a94707d
commit 6f3f0bf3e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -438,7 +438,7 @@ describe('DashboardModel', () => {
});
it('should slugify dashboard name', () => {
expect(model.panels[0].links[3].url).toBe(`/dashboard/db/my-other-dashboard`);
expect(model.panels[0].links[3].url).toBe(`dashboard/db/my-other-dashboard`);
});
});

View File

@ -685,11 +685,11 @@ function upgradePanelLink(link: any): DataLink {
let url = link.url;
if (!url && link.dashboard) {
url = `/dashboard/db/${kbn.slugifyForUrl(link.dashboard)}`;
url = `dashboard/db/${kbn.slugifyForUrl(link.dashboard)}`;
}
if (!url && link.dashUri) {
url = `/dashboard/${link.dashUri}`;
url = `dashboard/${link.dashUri}`;
}
// some models are incomplete and have no dashboard or dashUri