From db2b8ea602ff49374d99e9a6fc2c877ec44ced6c Mon Sep 17 00:00:00 2001 From: Peter Holmberg Date: Wed, 6 Mar 2019 13:23:11 +0100 Subject: [PATCH 1/2] keep size from copied panel and not from add panel widget --- .../dashboard/components/AddPanelWidget/AddPanelWidget.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/public/app/features/dashboard/components/AddPanelWidget/AddPanelWidget.tsx b/public/app/features/dashboard/components/AddPanelWidget/AddPanelWidget.tsx index fe04248524a..1349069059f 100644 --- a/public/app/features/dashboard/components/AddPanelWidget/AddPanelWidget.tsx +++ b/public/app/features/dashboard/components/AddPanelWidget/AddPanelWidget.tsx @@ -95,12 +95,11 @@ export class AddPanelWidget extends React.Component { onPasteCopiedPanel = panelPluginInfo => { const dashboard = this.props.dashboard; - const { gridPos } = this.props.panel; const newPanel: any = { type: panelPluginInfo.id, title: 'Panel Title', - gridPos: { x: gridPos.x, y: gridPos.y, w: gridPos.w, h: gridPos.h }, + gridPos: panelPluginInfo.defaults.gridPos, }; // apply panel template / defaults From 2c1be2c37e4f5079d283ddc53cdc5f6fceef7106 Mon Sep 17 00:00:00 2001 From: Peter Holmberg Date: Wed, 6 Mar 2019 15:19:58 +0100 Subject: [PATCH 2/2] position from add panel, dimensions from copied panel --- .../components/AddPanelWidget/AddPanelWidget.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/public/app/features/dashboard/components/AddPanelWidget/AddPanelWidget.tsx b/public/app/features/dashboard/components/AddPanelWidget/AddPanelWidget.tsx index 1349069059f..bdcc3c9d165 100644 --- a/public/app/features/dashboard/components/AddPanelWidget/AddPanelWidget.tsx +++ b/public/app/features/dashboard/components/AddPanelWidget/AddPanelWidget.tsx @@ -95,11 +95,17 @@ export class AddPanelWidget extends React.Component { onPasteCopiedPanel = panelPluginInfo => { const dashboard = this.props.dashboard; + const { gridPos } = this.props.panel; const newPanel: any = { type: panelPluginInfo.id, title: 'Panel Title', - gridPos: panelPluginInfo.defaults.gridPos, + gridPos: { + x: gridPos.x, + y: gridPos.y, + w: panelPluginInfo.defaults.gridPos.w, + h: panelPluginInfo.defaults.gridPos.h, + }, }; // apply panel template / defaults