LibraryPanels: Fixes connections after dashboard import (#34461)

This commit is contained in:
Hugo Häggmark
2021-05-20 09:40:23 +02:00
committed by GitHub
parent ca416df9d1
commit 740f1ab3e2
4 changed files with 129 additions and 3 deletions
+4
View File
@@ -1348,6 +1348,10 @@ func (m *mockLibraryPanelService) ConnectLibraryPanelsForDashboard(c *models.Req
return nil
}
func (m *mockLibraryPanelService) ImportDashboard(c *models.ReqContext, dashboard *simplejson.Json, importedID int64) error {
return nil
}
type mockLibraryElementService struct {
}
+5
View File
@@ -226,6 +226,11 @@ func (hs *HTTPServer) ImportDashboard(c *models.ReqContext, apiCmd dtos.ImportDa
return hs.dashboardSaveErrorToApiResponse(err)
}
err = hs.LibraryPanelService.ImportDashboard(c, apiCmd.Dashboard, dashInfo.DashboardId)
if err != nil {
return response.Error(500, "Error while connecting library panels", err)
}
return response.JSON(200, dashInfo)
}