@@ -39,6 +39,9 @@ const propTypes = {
3939 * ex: { manufacturer: ['Rentech', 'GHI Industries'], deviceid: ['73000', '73001', '73002'] }
4040 */
4141 availableDimensions : PropTypes . shape ( { } ) ,
42+ /** call back to retrieve the dynamic demo hotspots, by default just returns one example dynamic hotspot, override to return true hotspots.
43+ * See HotspotEditorModal propTypes for params and details */
44+ onFetchDynamicDemoHotspots : PropTypes . func ,
4245} ;
4346
4447const defaultProps = {
@@ -51,6 +54,7 @@ const defaultProps = {
5154 } ,
5255 dataItems : [ ] ,
5356 availableDimensions : { } ,
57+ onFetchDynamicDemoHotspots : ( ) => Promise . resolve ( [ { x : 50 , y : 50 } ] ) ,
5458} ;
5559
5660const ImageCardFormItems = ( {
@@ -60,6 +64,7 @@ const ImageCardFormItems = ({
6064 dataItems,
6165 availableDimensions,
6266 translateWithId,
67+ onFetchDynamicDemoHotspots,
6368} ) => {
6469 const [ isHotspotModalShowing , setIsHotspotModalShowing ] = useState ( false ) ;
6570 const mergedI18n = { ...defaultProps . i18n , ...i18n } ;
@@ -94,8 +99,7 @@ const ImageCardFormItems = ({
9499 onClose = { handleCloseHotspotEditor }
95100 translateWithId = { translateWithId }
96101 i18n = { mergedI18n }
97- // TODO go get the hotspots from the real data layer
98- onFetchDynamicHotspots = { ( ) => Promise . resolve ( [ { x : 10 , y : 10 } ] ) }
102+ onFetchDynamicDemoHotspots = { onFetchDynamicDemoHotspots }
99103 />
100104 ) : null }
101105 < div
0 commit comments