AppPlugins: Options to disable showing config page in nav (#31354)

* AppPlugins: Options to disable showing config page in nav

* rename

* Added autoEnabled

* updated

* Things are working sort of

* Simplify
This commit is contained in:
Torkel Ödegaard
2021-02-25 10:00:21 +01:00
committed by GitHub
parent df3d84f161
commit 584886fa46
8 changed files with 19 additions and 13 deletions
+2 -1
View File
@@ -15,7 +15,8 @@ import (
type AppPlugin struct {
FrontendPluginBase
Routes []*AppPluginRoute `json:"routes"`
Routes []*AppPluginRoute `json:"routes"`
AutoEnabled bool `json:"autoEnabled"`
FoundChildPlugins []*PluginInclude `json:"-"`
Pinned bool `json:"-"`
+4 -3
View File
@@ -30,9 +30,10 @@ func GetPluginSettings(orgId int64) (map[string]*models.PluginSettingInfoDTO, er
Enabled: true,
}
// apps are disabled by default
if pluginDef.Type == PluginTypeApp {
opt.Enabled = false
// apps are disabled by default unless autoEnabled: true
if app, exists := Apps[pluginDef.Id]; exists {
opt.Enabled = app.AutoEnabled
opt.Pinned = app.AutoEnabled
}
// if it's included in app check app settings