Canvas: add feature flag for nesting elements (#49958)

This commit is contained in:
Adela Almasan 2022-05-31 14:03:34 -05:00 committed by GitHub
parent 1e4ebf876b
commit e18e8002c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 1 deletions

View File

@ -60,4 +60,5 @@ export interface FeatureToggles {
prometheusStreamingJSONParser?: boolean;
validateDashboardsOnSave?: boolean;
prometheusWideSeries?: boolean;
canvasPanelNesting?: boolean;
}

View File

@ -248,5 +248,11 @@ var (
Description: "Enable wide series responses in the Prometheus datasource",
State: FeatureStateAlpha,
},
{
Name: "canvasPanelNesting",
Description: "Allow elements nesting",
State: FeatureStateAlpha,
FrontendOnly: true,
},
}
)

View File

@ -182,4 +182,8 @@ const (
// FlagPrometheusWideSeries
// Enable wide series responses in the Prometheus datasource
FlagPrometheusWideSeries = "prometheusWideSeries"
// FlagCanvasPanelNesting
// Allow elements nesting
FlagCanvasPanelNesting = "canvasPanelNesting"
)

View File

@ -2,6 +2,7 @@ import React, { PureComponent } from 'react';
import { DropResult } from 'react-beautiful-dnd';
import { AppEvents, SelectableValue, StandardEditorProps } from '@grafana/data';
import { config } from '@grafana/runtime/src';
import { Button, HorizontalGroup } from '@grafana/ui';
import appEvents from 'app/core/app_events';
import { AddLayerButton } from 'app/core/components/Layers/AddLayerButton';
@ -269,7 +270,7 @@ export class LayerElementListEditor extends PureComponent<Props> {
Clear selection
</Button>
)}
{selection.length > 1 && (
{selection.length > 1 && config.featureToggles.canvasPanelNesting && (
<Button size="sm" variant="secondary" onClick={this.onFrameSelection}>
Frame selection
</Button>