diff --git a/public/app/features/dashboard-scene/scene/layout-default/DefaultGridLayoutManager.tsx b/public/app/features/dashboard-scene/scene/layout-default/DefaultGridLayoutManager.tsx index 0a33231fb9d..de3bd6b6c65 100644 --- a/public/app/features/dashboard-scene/scene/layout-default/DefaultGridLayoutManager.tsx +++ b/public/app/features/dashboard-scene/scene/layout-default/DefaultGridLayoutManager.tsx @@ -153,17 +153,23 @@ export class DefaultGridLayoutManager const emptySpace = findSpaceForNewPanel(this.state.grid); const newGridItem = getDashboardGridItemFromClipboard(getDashboardSceneFor(this), emptySpace); - dashboardEditActions.edit({ - description: t('dashboard.edit-actions.paste-panel', 'Paste panel'), - addedObject: newGridItem.state.body, - source: this, - perform: () => { - this.state.grid.setState({ children: [...this.state.grid.state.children, newGridItem] }); - }, - undo: () => { - this.state.grid.setState({ children: this.state.grid.state.children.filter((child) => child !== newGridItem) }); - }, - }); + if (config.featureToggles.dashboardNewLayouts) { + dashboardEditActions.edit({ + description: t('dashboard.edit-actions.paste-panel', 'Paste panel'), + addedObject: newGridItem.state.body, + source: this, + perform: () => { + this.state.grid.setState({ children: [...this.state.grid.state.children, newGridItem] }); + }, + undo: () => { + this.state.grid.setState({ + children: this.state.grid.state.children.filter((child) => child !== newGridItem), + }); + }, + }); + } else { + this.state.grid.setState({ children: [...this.state.grid.state.children, newGridItem] }); + } clearClipboard(); }