mirror of
https://github.com/grafana/grafana.git
synced 2025-01-24 23:37:01 -06:00
Feature Highlights: move setting to a feature toggle (#44780)
* Add toggle * Use the toggle * Cleanup
This commit is contained in:
parent
c23bc1e7b7
commit
a79c048344
@ -501,9 +501,3 @@ 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
|
||||
already been configured, nothing will happen.
|
||||
|
||||
## [feature_highlights]
|
||||
|
||||
### enabled
|
||||
|
||||
Whether the feature highlights feature is enabled
|
||||
|
@ -36,4 +36,5 @@ export interface FeatureToggles {
|
||||
showFeatureFlagsInUI?: boolean;
|
||||
disable_http_request_histogram?: boolean;
|
||||
validatedQueries?: boolean;
|
||||
featureHighlights?: boolean;
|
||||
}
|
||||
|
@ -273,9 +273,6 @@ func (hs *HTTPServer) getFrontendSettingsMap(c *models.ReqContext) (map[string]i
|
||||
"enabled": hs.Cfg.SectionWithEnvOverrides("recorded_queries").Key("enabled").MustBool(true),
|
||||
},
|
||||
"unifiedAlertingEnabled": hs.Cfg.UnifiedAlerting.Enabled,
|
||||
"featureHighlights": map[string]bool{
|
||||
"enabled": hs.SettingsProvider.Section("feature_highlights").KeyValue("enabled").MustBool(false),
|
||||
},
|
||||
}
|
||||
|
||||
if hs.Cfg.GeomapDefaultBaseLayerConfig != nil {
|
||||
|
@ -110,5 +110,10 @@ var (
|
||||
State: FeatureStateAlpha,
|
||||
RequiresDevMode: true,
|
||||
},
|
||||
{
|
||||
Name: "featureHighlights",
|
||||
Description: "Highlight Enterprise features",
|
||||
State: FeatureStateStable,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
@ -82,4 +82,8 @@ const (
|
||||
// FlagValidatedQueries
|
||||
// only execute the query saved in a panel
|
||||
FlagValidatedQueries = "validatedQueries"
|
||||
|
||||
// FlagFeatureHighlights
|
||||
// Highlight Enterprise features
|
||||
FlagFeatureHighlights = "featureHighlights"
|
||||
)
|
||||
|
@ -8,7 +8,7 @@ import { GenericDataSourcePlugin } from '../settings/PluginSettings';
|
||||
|
||||
export function buildNavModel(dataSource: DataSourceSettings, plugin: GenericDataSourcePlugin): NavModelItem {
|
||||
const pluginMeta = plugin.meta;
|
||||
|
||||
const highlightsEnabled = config.featureToggles.featureHighlights;
|
||||
const navModel: NavModelItem = {
|
||||
img: pluginMeta.info.logos.large,
|
||||
id: 'datasource-' + dataSource.uid,
|
||||
@ -61,7 +61,7 @@ export function buildNavModel(dataSource: DataSourceSettings, plugin: GenericDat
|
||||
if (contextSrv.hasPermission(AccessControlAction.DataSourcesPermissionsRead)) {
|
||||
navModel.children!.push(dsPermissions);
|
||||
}
|
||||
} else if (config.featureHighlights.enabled) {
|
||||
} else if (highlightsEnabled) {
|
||||
navModel.children!.push({
|
||||
...dsPermissions,
|
||||
url: dsPermissions.url + '/upgrade',
|
||||
@ -79,7 +79,7 @@ export function buildNavModel(dataSource: DataSourceSettings, plugin: GenericDat
|
||||
|
||||
if (featureEnabled('analytics')) {
|
||||
navModel.children!.push(analytics);
|
||||
} else if (config.featureHighlights.enabled) {
|
||||
} else if (highlightsEnabled) {
|
||||
navModel.children!.push({
|
||||
...analytics,
|
||||
url: analytics.url + '/upgrade',
|
||||
@ -98,7 +98,7 @@ export function buildNavModel(dataSource: DataSourceSettings, plugin: GenericDat
|
||||
|
||||
if (featureEnabled('caching')) {
|
||||
navModel.children!.push(caching);
|
||||
} else if (config.featureHighlights.enabled) {
|
||||
} else if (highlightsEnabled) {
|
||||
navModel.children!.push({
|
||||
...caching,
|
||||
url: caching.url + '/upgrade',
|
||||
|
@ -130,7 +130,7 @@ export class TeamPages extends PureComponent<Props, State> {
|
||||
case PageTypes.GroupSync:
|
||||
if (isSignedInUserTeamAdmin && isSyncEnabled) {
|
||||
return <TeamGroupSync />;
|
||||
} else if (config.featureHighlights.enabled) {
|
||||
} else if (config.featureToggles.featureHighlights) {
|
||||
return (
|
||||
<UpgradeBox
|
||||
text={
|
||||
|
@ -40,7 +40,7 @@ export function buildNavModel(team: Team): NavModelItem {
|
||||
|
||||
if (featureEnabled('teamsync')) {
|
||||
navModel.children!.push(teamGroupSync);
|
||||
} else if (config.featureHighlights.enabled) {
|
||||
} else if (config.featureToggles.featureHighlights) {
|
||||
navModel.children!.push({ ...teamGroupSync, tabSuffix: ProBadge });
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user