* Add coremodelValidation feature flag * coremodels: use stubs when feature flag is off * api: validate dashboards on save * Need pointer receiver for FeatureManager * Update dashboard Go model * Align doc comments * Include CoremodelRegistry in test * Wedge coremodel in on all test cases, ugh * Ugh fix comment again * Update pkg/framework/coremodel/staticregistry/provide.go Co-authored-by: Artur Wierzbicki <wierzbicki.artur.94@gmail.com> * Update Thema (and its deps) for better errs * omg whitespace Co-authored-by: Artur Wierzbicki <wierzbicki.artur.94@gmail.com>
20 lines
453 B
Go
20 lines
453 B
Go
package staticregistry
|
|
|
|
import (
|
|
"github.com/grafana/grafana/pkg/coremodel/dashboard"
|
|
"github.com/grafana/grafana/pkg/framework/coremodel"
|
|
)
|
|
|
|
// ProvideRegistry provides a simple static Registry for coremodels.
|
|
// Coremodels have to be manually added.
|
|
// TODO dynamism
|
|
func ProvideRegistry(
|
|
dashboard *dashboard.Coremodel,
|
|
) (*coremodel.Registry, error) {
|
|
cmlist := []coremodel.Interface{
|
|
dashboard,
|
|
}
|
|
|
|
return coremodel.NewRegistry(cmlist...)
|
|
}
|