Dashboard Library: Integrate community dashboards on Suggested Dashboards Flow (#112808)
* Extend interpolate endpoint to support community dashboard json interpolation Added unit tests * Implement Frontend Side - Show tabs - Fetch Community dashboads - Use DashboardCard component - Search grafana dashboard in the community tab - Make Tabs and pagination sticky - Adjust titles to be scoped by datasource name/type - Add skeleton loading for community tabs and pagination - Add dashboard details tooltip - Bring old datasource-provisioned box back and rely on new feature toggle for community dashboards - update i18n - update swagger --------- Co-authored-by: Juan Cabanas <juan.cabanas@grafana.com> Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
This commit is contained in:
co-authored by
Juan Cabanas
nmarrs
parent
34e85113d2
commit
62eef87208
@@ -47,7 +47,7 @@ func (api *ImportDashboardAPI) RegisterAPIEndpoints(routeRegister routing.RouteR
|
||||
routing.Wrap(api.ImportDashboard),
|
||||
)
|
||||
//nolint:staticcheck // not yet migrated to OpenFeature
|
||||
if api.features.IsEnabledGlobally(featuremgmt.FlagDashboardLibrary) {
|
||||
if api.features.IsEnabledGlobally(featuremgmt.FlagDashboardLibrary) || api.features.IsEnabledGlobally(featuremgmt.FlagSuggestedDashboards) {
|
||||
route.Post(
|
||||
"/interpolate",
|
||||
authorize(accesscontrol.EvalPermission(dashboards.ActionDashboardsCreate)),
|
||||
@@ -59,7 +59,7 @@ func (api *ImportDashboardAPI) RegisterAPIEndpoints(routeRegister routing.RouteR
|
||||
|
||||
// swagger:route POST /dashboards/interpolate dashboards interpolateDashboard
|
||||
//
|
||||
// Interpolate dashboard. This is an experimental endpoint under dashboardLibrary FF and is subject to change.
|
||||
// Interpolate dashboard. This is an experimental endpoint under dashboardLibrary or suggestedDashboards feature flags and is subject to change.
|
||||
//
|
||||
// Responses:
|
||||
// 200: interpolateDashboardResponse
|
||||
@@ -73,8 +73,8 @@ func (api *ImportDashboardAPI) InterpolateDashboard(c *contextmodel.ReqContext)
|
||||
return response.Error(http.StatusBadRequest, "bad request data", err)
|
||||
}
|
||||
|
||||
if req.PluginId == "" {
|
||||
return response.Error(http.StatusUnprocessableEntity, "pluginId must be set", nil)
|
||||
if req.PluginId == "" && req.Dashboard == nil {
|
||||
return response.Error(http.StatusUnprocessableEntity, "pluginId or dashboard must be set", nil)
|
||||
}
|
||||
|
||||
resp, err := api.dashboardImportService.InterpolateDashboard(c.Req.Context(), &req)
|
||||
|
||||
Reference in New Issue
Block a user