mirror of
https://github.com/grafana/grafana.git
synced 2025-09-29 01:24:12 +08:00
PluginExtensions: Added support for sharing functions (#98888)
* feat: add generic plugin extension functions * updated betterer. * Fixed type issues after sync with main. * Remved extensions from datasource and panel. * Added validation for extension function registry. * Added tests and validation logic for function extensions registry. * removed prop already existing on base. * fixed lint error. --------- Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
This commit is contained in:
@ -63,6 +63,7 @@ type ExtensionsV2 struct {
|
||||
AddedComponents []AddedComponent `json:"addedComponents"`
|
||||
ExposedComponents []ExposedComponent `json:"exposedComponents"`
|
||||
ExtensionPoints []ExtensionPoint `json:"extensionPoints"`
|
||||
AddedFunctions []AddedFunction `json:"addedFunctions"`
|
||||
}
|
||||
|
||||
type Extensions ExtensionsV2
|
||||
@ -76,6 +77,7 @@ func (e *Extensions) UnmarshalJSON(data []byte) error {
|
||||
e.AddedLinks = extensionsV2.AddedLinks
|
||||
e.ExposedComponents = extensionsV2.ExposedComponents
|
||||
e.ExtensionPoints = extensionsV2.ExtensionPoints
|
||||
e.AddedFunctions = extensionsV2.AddedFunctions
|
||||
|
||||
return nil
|
||||
}
|
||||
@ -123,6 +125,11 @@ type AddedComponent struct {
|
||||
Description string `json:"description"`
|
||||
}
|
||||
|
||||
type AddedFunction struct {
|
||||
Targets []string `json:"targets"`
|
||||
Title string `json:"title"`
|
||||
}
|
||||
|
||||
type ExposedComponent struct {
|
||||
Id string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
@ -267,6 +274,7 @@ type PluginMetaDTO struct {
|
||||
Angular AngularMeta `json:"angular"`
|
||||
MultiValueFilterOperators bool `json:"multiValueFilterOperators"`
|
||||
LoadingStrategy LoadingStrategy `json:"loadingStrategy"`
|
||||
Extensions Extensions `json:"extensions"`
|
||||
}
|
||||
|
||||
type DataSourceDTO struct {
|
||||
|
Reference in New Issue
Block a user