mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 17:12:41 +08:00
Plugins: Add hide_angular_deprecation setting (#79296)
* Add plugins.hide_angular_deprecation config ini * Add more tests * Remove the ability to use [plugins.*] hide_angular_deprecation
This commit is contained in:
@ -1303,25 +1303,21 @@ func TestLoader_HideAngularDeprecation(t *testing.T) {
|
||||
cfg *config.Cfg
|
||||
expHideAngularDeprecation bool
|
||||
}{
|
||||
{name: `without "hide_angular_deprecation" setting`, cfg: &config.Cfg{
|
||||
AngularSupportEnabled: true,
|
||||
PluginSettings: setting.PluginSettings{},
|
||||
Features: featuremgmt.WithFeatures(),
|
||||
}},
|
||||
{name: `with "hide_angular_deprecation" = true`, cfg: &config.Cfg{
|
||||
AngularSupportEnabled: true,
|
||||
PluginSettings: setting.PluginSettings{
|
||||
"plugin-id": map[string]string{"hide_angular_deprecation": "true"},
|
||||
},
|
||||
Features: featuremgmt.WithFeatures(),
|
||||
}},
|
||||
{name: `with "hide_angular_deprecation" = false`, cfg: &config.Cfg{
|
||||
AngularSupportEnabled: true,
|
||||
PluginSettings: setting.PluginSettings{
|
||||
"plugin-id": map[string]string{"hide_angular_deprecation": "false"},
|
||||
},
|
||||
Features: featuremgmt.WithFeatures(),
|
||||
}},
|
||||
{name: "with plugin id in HideAngularDeprecation list", cfg: &config.Cfg{
|
||||
AngularSupportEnabled: true,
|
||||
HideAngularDeprecation: []string{"one-app", "two-panel", "test-datasource", "three-datasource"},
|
||||
Features: featuremgmt.WithFeatures(),
|
||||
}, expHideAngularDeprecation: true},
|
||||
{name: "without plugin id in HideAngularDeprecation list", cfg: &config.Cfg{
|
||||
AngularSupportEnabled: true,
|
||||
HideAngularDeprecation: []string{"one-app", "two-panel", "three-datasource"},
|
||||
Features: featuremgmt.WithFeatures(),
|
||||
}, expHideAngularDeprecation: false},
|
||||
{name: "with empty HideAngularDeprecation", cfg: &config.Cfg{
|
||||
AngularSupportEnabled: true,
|
||||
HideAngularDeprecation: nil,
|
||||
Features: featuremgmt.WithFeatures(),
|
||||
}, expHideAngularDeprecation: false},
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
l := newLoaderWithOpts(t, tc.cfg, loaderDepOpts{
|
||||
|
Reference in New Issue
Block a user