Feature Management: Update admin page UI after a successful update (#76380)

* Feature Management: Update admin page UI after a successful update

* lint

* lint

* refactor
This commit is contained in:
João Calisto
2023-10-13 11:54:34 +01:00
committed by GitHub
parent 2857870bfb
commit 9fc0e1566e
7 changed files with 101 additions and 19 deletions
+16 -7
View File
@@ -14,13 +14,14 @@ var (
)
type FeatureManager struct {
isDevMod bool
licensing licensing.Licensing
flags map[string]*FeatureFlag
enabled map[string]bool // only the "on" values
config string // path to config file
vars map[string]any
log log.Logger
isDevMod bool
restartRequired bool
licensing licensing.Licensing
flags map[string]*FeatureFlag
enabled map[string]bool // only the "on" values
config string // path to config file
vars map[string]any
log log.Logger
}
// This will merge the flags with the current configuration
@@ -148,6 +149,14 @@ func (fm *FeatureManager) GetFlags() []FeatureFlag {
return v
}
func (fm *FeatureManager) GetState() *FeatureManagerState {
return &FeatureManagerState{RestartRequired: fm.restartRequired}
}
func (fm *FeatureManager) SetRestartRequired() {
fm.restartRequired = true
}
// Check to see if a feature toggle exists by name
func (fm *FeatureManager) LookupFlag(name string) (FeatureFlag, bool) {
f, ok := fm.flags[name]
+4
View File
@@ -127,3 +127,7 @@ type FeatureToggleDTO struct {
Enabled bool `json:"enabled"`
ReadOnly bool `json:"readOnly,omitempty"`
}
type FeatureManagerState struct {
RestartRequired bool `json:"restartRequired"`
}