Rendering: Add PDFRendering capability (#84438)

* Rendering: Add PDFRendering capability

* fix tests
This commit is contained in:
Agnès Toulet
2024-03-19 08:48:46 +01:00
committed by GitHub
parent d3571c399a
commit 58170d4141
6 changed files with 47 additions and 14 deletions
-5
View File
@@ -6,15 +6,10 @@ import (
"fmt"
"github.com/grafana/grafana/pkg/plugins/backendplugin/pluginextensionv2"
"github.com/grafana/grafana/pkg/services/featuremgmt"
)
func (rs *RenderingService) renderViaPlugin(ctx context.Context, renderType RenderType, renderKey string, opts Opts) (*RenderResult, error) {
if renderType == RenderPDF {
if !rs.features.IsEnabled(ctx, featuremgmt.FlagNewPDFRendering) {
return nil, fmt.Errorf("feature 'newPDFRendering' disabled")
}
opts.Encoding = "pdf"
}