DashboardMigrator: Fixed issue migrating incomplete panel link models (#18786)

pull/18826/head
Torkel Ödegaard 6 years ago committed by GitHub
parent 8e9cb5c81a
commit 65a6eda93b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      public/app/features/dashboard/state/DashboardMigrator.test.ts
  2. 5
      public/app/features/dashboard/state/DashboardMigrator.ts

@ -415,6 +415,10 @@ describe('DashboardModel', () => {
dashUri: '',
title: 'test',
},
{
type: 'dashboard',
keepTime: true,
},
],
},
],

@ -643,6 +643,11 @@ function upgradePanelLink(link: any): DataLink {
url = `/dashboard/${link.dashUri}`;
}
// some models are incomplete and have no dashboard or dashUri
if (!url) {
url = '/';
}
if (link.keepTime) {
url = appendQueryToUrl(url, `$${DataLinkBuiltInVars.keepTime}`);
}

Loading…
Cancel
Save