Plugins: Standardize Golang enum naming convention (#69449)

* standardize enum pattern

* fix up
This commit is contained in:
Will Browne
2023-06-08 12:21:19 +02:00
committed by GitHub
parent 4db6679460
commit a221e1d226
31 changed files with 308 additions and 306 deletions

View File

@@ -36,7 +36,7 @@ func (s *ServiceImpl) addAppLinks(treeRoot *navtree.NavTreeRoot, c *contextmodel
return false
}
for _, plugin := range s.pluginStore.Plugins(c.Req.Context(), plugins.App) {
for _, plugin := range s.pluginStore.Plugins(c.Req.Context(), plugins.TypeApp) {
if !isPluginEnabled(plugin) {
continue
}

View File

@@ -37,7 +37,7 @@ func TestAddAppLinks(t *testing.T) {
JSONData: plugins.JSONData{
ID: "test-app1",
Name: "Test app1 name",
Type: plugins.App,
Type: plugins.TypeApp,
Includes: []*plugins.Includes{
{
Name: "Catalog",
@@ -60,7 +60,7 @@ func TestAddAppLinks(t *testing.T) {
JSONData: plugins.JSONData{
ID: "test-app2",
Name: "Test app2 name",
Type: plugins.App,
Type: plugins.TypeApp,
Includes: []*plugins.Includes{
{
Name: "Hello",
@@ -77,7 +77,7 @@ func TestAddAppLinks(t *testing.T) {
JSONData: plugins.JSONData{
ID: "test-app3",
Name: "Test app3 name",
Type: plugins.App,
Type: plugins.TypeApp,
Includes: []*plugins.Includes{
{
Name: "Default page",
@@ -402,7 +402,7 @@ func TestAddAppLinksAccessControl(t *testing.T) {
testApp1 := plugins.PluginDTO{
JSONData: plugins.JSONData{
ID: "test-app1", Name: "Test app1 name", Type: plugins.App,
ID: "test-app1", Name: "Test app1 name", Type: plugins.TypeApp,
Includes: []*plugins.Includes{
{
Name: "Catalog",

View File

@@ -78,14 +78,14 @@ func NewStaticDashboardSummaryBuilder(lookup DatasourceLookup, sanitize bool) en
p.Fields["type"] = panel.Type
if panel.Type != "row" {
panelRefs.Add(entity.ExternalEntityReferencePlugin, string(plugins.Panel), panel.Type)
dashboardRefs.Add(entity.ExternalEntityReferencePlugin, string(plugins.Panel), panel.Type)
panelRefs.Add(entity.ExternalEntityReferencePlugin, string(plugins.TypePanel), panel.Type)
dashboardRefs.Add(entity.ExternalEntityReferencePlugin, string(plugins.TypePanel), panel.Type)
}
for _, v := range panel.Datasource {
dashboardRefs.Add(entity.StandardKindDataSource, v.Type, v.UID)
panelRefs.Add(entity.StandardKindDataSource, v.Type, v.UID)
if v.Type != "" {
dashboardRefs.Add(entity.ExternalEntityReferencePlugin, string(plugins.DataSource), v.Type)
dashboardRefs.Add(entity.ExternalEntityReferencePlugin, string(plugins.TypeDataSource), v.Type)
}
}
for _, v := range panel.Transformer {

View File

@@ -134,33 +134,33 @@ func TestPluginUpdateChecker_checkForUpdates(t *testing.T) {
JSONData: plugins.JSONData{
ID: "test-ds",
Info: plugins.Info{Version: "0.9.0"},
Type: plugins.DataSource,
Type: plugins.TypeDataSource,
},
Class: plugins.External,
Class: plugins.ClassExternal,
},
{
JSONData: plugins.JSONData{
ID: "test-app",
Info: plugins.Info{Version: "0.5.0"},
Type: plugins.App,
Type: plugins.TypeApp,
},
Class: plugins.External,
Class: plugins.ClassExternal,
},
{
JSONData: plugins.JSONData{
ID: "test-panel",
Info: plugins.Info{Version: "2.5.7"},
Type: plugins.Panel,
Type: plugins.TypePanel,
},
Class: plugins.Bundled,
Class: plugins.ClassBundled,
},
{
JSONData: plugins.JSONData{
ID: "test-core-panel",
Info: plugins.Info{Version: "0.0.1"},
Type: plugins.Panel,
Type: plugins.TypePanel,
},
Class: plugins.Core,
Class: plugins.ClassCore,
},
},
},