mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Canvas: Adhere editing state to dashboard editable state (#87883)
This commit is contained in:
parent
a17340ea8b
commit
431fdd4bab
@ -7,6 +7,7 @@ import { PanelContext, PanelContextRoot } from '@grafana/ui';
|
||||
import { CanvasFrameOptions } from 'app/features/canvas';
|
||||
import { ElementState } from 'app/features/canvas/runtime/element';
|
||||
import { Scene } from 'app/features/canvas/runtime/scene';
|
||||
import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv';
|
||||
import { PanelEditEnteredEvent, PanelEditExitedEvent } from 'app/types/events';
|
||||
|
||||
import { SetBackground } from './components/SetBackground';
|
||||
@ -61,11 +62,16 @@ export class CanvasPanel extends Component<Props, State> {
|
||||
moveableAction: false,
|
||||
};
|
||||
|
||||
// TODO: Will need to update this approach for dashboard scenes
|
||||
// migration (new dashboard edit experience)
|
||||
const dashboard = getDashboardSrv().getCurrent();
|
||||
const allowEditing = this.props.options.inlineEditing && dashboard?.editable;
|
||||
|
||||
// Only the initial options are ever used.
|
||||
// later changes are all controlled by the scene
|
||||
this.scene = new Scene(
|
||||
this.props.options.root,
|
||||
this.props.options.inlineEditing,
|
||||
allowEditing,
|
||||
this.props.options.showAdvancedTypes,
|
||||
this.props.options.panZoom,
|
||||
this.props.options.infinitePan,
|
||||
|
Loading…
Reference in New Issue
Block a user