Suggestions: Proposed PanelPlugin API (#113688)

* Suggestions: Update ownership of core files and improve some types

* Suggestions: Proposed PanelPlugin API

* get rid of .useSuggestionsConfig

* update i18n

* iterate on TypeScript types, add example in radialbar

* tweak implementation, add commentary

* actually, suggestions really does not need panel defaults

* split suggestions handler into its own file and add tests for radialbar

* small comment revision

* fix test

* add ds.hasData check back for state-timeline

* restore a handful of comments that got lost in the merge shuffle

* more updated commnets

* remove pluginId from VisualizationSuggestion, whoops

* fix getAllSuggestions test

* update i18n

* might as well restore description here

* move fieldconfig back on radialbar

* call them suppliers, remove boolean return type in favor of internal util

* Update packages/grafana-data/src/panel/PanelPlugin.ts

* Update packages/grafana-data/src/panel/PanelPlugin.ts

* Update packages/grafana-data/src/panel/PanelPlugin.ts

* tweak return type for setSuggestionSupplier to be this
This commit is contained in:
Paul Marbach
2025-11-18 18:49:29 +01:00
committed by GitHub
parent a636e1dc8e
commit 92ac33736b
18 changed files with 456 additions and 206 deletions
@@ -1,6 +1,6 @@
import * as React from 'react';
import { FieldConfigSource, PanelData, VisualizationSuggestion } from '@grafana/data';
import { FieldConfigSource, PanelData, PanelPluginVisualizationSuggestion } from '@grafana/data';
/**
* Describes the properties that can be passed to the PanelDataErrorView.
@@ -15,7 +15,7 @@ export interface PanelDataErrorViewProps {
needsTimeField?: boolean;
needsNumberField?: boolean;
needsStringField?: boolean;
suggestions?: VisualizationSuggestion[];
suggestions?: PanelPluginVisualizationSuggestion[];
}
/**