@@ -23,7 +23,7 @@ import uuid from 'uuid';
2323import { ActionByType , IncompatibleActionError } from '../../ui_actions_plugin' ;
2424import { ViewMode , PanelState , IEmbeddable } from '../../embeddable_plugin' ;
2525import { SavedObject } from '../../../../saved_objects/public' ;
26- import { PanelNotFoundError } from '../../../../embeddable/public' ;
26+ import { PanelNotFoundError , EmbeddableInput } from '../../../../embeddable/public' ;
2727import {
2828 placePanelBeside ,
2929 IPanelPlacementBesideArgs ,
@@ -125,19 +125,19 @@ export class ClonePanelAction implements ActionByType<typeof ACTION_CLONE_PANEL>
125125 panelToClone : DashboardPanelState ,
126126 embeddableType : string
127127 ) : Promise < Partial < PanelState > > {
128- const panelState : Partial < PanelState > = {
128+ const panelState : PanelState < EmbeddableInput > = {
129129 type : embeddableType ,
130130 explicitInput : {
131131 ...panelToClone . explicitInput ,
132132 id : uuid . v4 ( ) ,
133133 } ,
134134 } ;
135135 let newTitle : string = '' ;
136- if ( panelToClone . savedObjectId ) {
136+ if ( panelToClone . explicitInput . savedObjectId ) {
137137 // Fetch existing saved object
138138 const savedObjectToClone = await this . core . savedObjects . client . get < SavedObject > (
139139 embeddableType ,
140- panelToClone . savedObjectId
140+ panelToClone . explicitInput . savedObjectId
141141 ) ;
142142
143143 // Clone the saved object
@@ -150,7 +150,7 @@ export class ClonePanelAction implements ActionByType<typeof ACTION_CLONE_PANEL>
150150 } ,
151151 { references : _ . cloneDeep ( savedObjectToClone . references ) }
152152 ) ;
153- panelState . savedObjectId = clonedSavedObject . id ;
153+ panelState . explicitInput . savedObjectId = clonedSavedObject . id ;
154154 }
155155 this . core . notifications . toasts . addSuccess ( {
156156 title : i18n . translate ( 'dashboard.panel.clonedToast' , {
0 commit comments