@@ -11,13 +11,22 @@ import {
1111 WidgetMapping ,
1212 ExtendedTemplateConfig ,
1313 AnalyticsTracker ,
14+ WidgetConfiguration ,
1415} from './types' ;
1516import { Button , EmptyState , EmptyStateActions , EmptyStateBody , EmptyStateVariant , PageSection } from '@patternfly/react-core' ;
1617import { ExternalLinkAltIcon , GripVerticalIcon , PlusCircleIcon } from '@patternfly/react-icons' ;
1718import { columns , breakpoints , droppingElemId , getWidgetIdentifier , extendLayout , getGridDimensions } from './utils' ;
1819
1920export const defaultBreakpoints = breakpoints ;
2021
22+ const createSerializableConfig = ( config ?: WidgetConfiguration ) => {
23+ if ( ! config ) return undefined ;
24+ return {
25+ ...( config . title && { title : config . title } ) ,
26+ ...( config . headerLink && { headerLink : config . headerLink } )
27+ } ;
28+ } ;
29+
2130// SVG resize handle as inline data URI
2231const resizeHandleSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE2IDEuMTQyODZMMTQuODU3MSAwTDAgMTQuODU3MVYxNkgxLjE0Mjg2TDE2IDEuMTQyODZaIiBmaWxsPSIjRDJEMkQyIi8+Cjwvc3ZnPgo=' ;
2332
@@ -115,7 +124,7 @@ const GridLayout = ({
115124 i : droppingElemId ,
116125 widgetType : currentDropInItem ,
117126 title : 'New title' ,
118- config : widget . config ,
127+ config : createSerializableConfig ( widget . config )
119128 } ;
120129 }
121130 return undefined ;
@@ -161,7 +170,7 @@ const GridLayout = ({
161170 widgetType : data ,
162171 i : getWidgetIdentifier ( data ) ,
163172 title : 'New title' ,
164- config : widget . config ,
173+ config : createSerializableConfig ( widget . config )
165174 } ;
166175 return {
167176 ...acc ,
0 commit comments