mirror of https://github.com/grafana/grafana.git
				
				
				
			Feature highlights: add setting toggle (#43394)
* Feature highlights: add toggle setting * Settings: Use provider for 'feature_highlights' section * Fix frontendsettings API tests * Document the toggle Co-authored-by: Joan López de la Franca Beltran <5459617+joanlopez@users.noreply.github.com> Co-authored-by: Joan López de la Franca Beltran <joanjan14@gmail.com>
This commit is contained in:
		
							parent
							
								
									e75edc810d
								
							
						
					
					
						commit
						3b4a4be3c6
					
				|  | @ -1076,10 +1076,10 @@ grpc_port = | ||||||
| license_path = | license_path = | ||||||
| 
 | 
 | ||||||
| [feature_toggles] | [feature_toggles] | ||||||
| # there are currently two ways to enable feature toggles in the `grafana.ini`.  | # there are currently two ways to enable feature toggles in the `grafana.ini`. | ||||||
| # you can either pass an array of feature you want to enable to the `enable` field or  | # you can either pass an array of feature you want to enable to the `enable` field or | ||||||
| # configure each toggle by setting the name of the toggle to true/false. Toggles set to true/false | # configure each toggle by setting the name of the toggle to true/false. Toggles set to true/false | ||||||
| # will take presidence over toggles in the `enable` list. | # will take precedence over toggles in the `enable` list. | ||||||
| 
 | 
 | ||||||
| # enable = feature1,feature2 | # enable = feature1,feature2 | ||||||
| enable = | enable = | ||||||
|  |  | ||||||
|  | @ -495,3 +495,9 @@ The org id of the datasource where the query data will be written. | ||||||
| 
 | 
 | ||||||
| If all `default_remote_write_*` properties are set, this information will be populated at startup. If a remote write target has | If all `default_remote_write_*` properties are set, this information will be populated at startup. If a remote write target has | ||||||
| already been configured, nothing will happen. | already been configured, nothing will happen. | ||||||
|  | 
 | ||||||
|  | ## [feature_highlights] | ||||||
|  | 
 | ||||||
|  | ### enabled | ||||||
|  | 
 | ||||||
|  | Whether the feature highlights feature is enabled | ||||||
|  |  | ||||||
|  | @ -283,6 +283,9 @@ func (hs *HTTPServer) getFrontendSettingsMap(c *models.ReqContext) (map[string]i | ||||||
| 			"enabled": hs.Cfg.SectionWithEnvOverrides("recorded_queries").Key("enabled").MustBool(false), | 			"enabled": hs.Cfg.SectionWithEnvOverrides("recorded_queries").Key("enabled").MustBool(false), | ||||||
| 		}, | 		}, | ||||||
| 		"unifiedAlertingEnabled": hs.Cfg.UnifiedAlerting.Enabled, | 		"unifiedAlertingEnabled": hs.Cfg.UnifiedAlerting.Enabled, | ||||||
|  | 		"featureHighlights": map[string]bool{ | ||||||
|  | 			"enabled": hs.SettingsProvider.Section("feature_highlights").KeyValue("enabled").MustBool(false), | ||||||
|  | 		}, | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	if hs.Cfg.GeomapDefaultBaseLayerConfig != nil { | 	if hs.Cfg.GeomapDefaultBaseLayerConfig != nil { | ||||||
|  |  | ||||||
|  | @ -44,10 +44,11 @@ func setupTestEnvironment(t *testing.T, cfg *setting.Cfg) (*web.Mux, *HTTPServer | ||||||
| 			Cfg:                   cfg, | 			Cfg:                   cfg, | ||||||
| 			RendererPluginManager: &fakeRendererManager{}, | 			RendererPluginManager: &fakeRendererManager{}, | ||||||
| 		}, | 		}, | ||||||
| 		SQLStore:      sqlStore, | 		SQLStore:         sqlStore, | ||||||
| 		pluginStore:   &fakePluginStore{}, | 		SettingsProvider: setting.ProvideProvider(cfg), | ||||||
| 		updateChecker: &updatechecker.Service{}, | 		pluginStore:      &fakePluginStore{}, | ||||||
| 		AccessControl: accesscontrolmock.New().WithDisabled(), | 		updateChecker:    &updatechecker.Service{}, | ||||||
|  | 		AccessControl:    accesscontrolmock.New().WithDisabled(), | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	m := web.New() | 	m := web.New() | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue