File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
frontend/src/app/pages/DashBoardPage Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -279,19 +279,20 @@ export const addWrapChartWidget = createAsyncThunk<
279279 { getState, dispatch } ,
280280 ) => {
281281 const dataCharts = [ dataChart ] ;
282- const viewViews = [ view ] ;
282+ const viewViews = view ? [ view ] : [ ] ;
283283 dispatch ( boardActions . setDataChartToMap ( dataCharts ) ) ;
284284 dispatch ( boardActions . setViewMap ( viewViews ) ) ;
285285 let widget = widgetToolKit . chart . create ( {
286286 dashboardId : boardId ,
287287 boardType : boardType ,
288288 dataChartId : chartId ,
289- viewId : view . id ,
289+ viewId : view ? .id || '' ,
290290 dataChartConfig : dataChart ,
291291 subType : 'widgetChart' ,
292292 } ) ;
293293 dispatch ( addWidgetsToEditBoard ( [ widget ] ) ) ;
294- dispatch ( addVariablesToBoard ( view . variables ) ) ;
294+ dispatch ( addVariablesToBoard ( view ?. variables ) ) ;
295+
295296 return null ;
296297 } ,
297298) ;
Original file line number Diff line number Diff line change @@ -420,6 +420,7 @@ export const getChartWidgetRequestParams = (obj: {
420420 // errorHandle(`can\`t find Chart ${curWidget.datachartId}`);
421421 return null ;
422422 }
423+ if ( ! dataChart . viewId ) return null ;
423424 const chartDataView = viewMap [ dataChart ?. viewId ] ;
424425
425426 if ( ! chartDataView ) {
You can’t perform that action at this time.
0 commit comments