@@ -107,7 +107,7 @@ export const SimplePowerBIReportEmbed = ({
107
107
useAAD,
108
108
iframeRatio,
109
109
} ) => {
110
- const { reportId, settings, staticFilters, dynamicFilters, pageName } = reportConfiguration [ index ] ;
110
+ const { reportId, settings, staticFilters, dynamicFilters, pageName } = reportConfiguration [ index ] || { } ;
111
111
const hasNavContentPane = settings ?. navContentPaneEnabled ;
112
112
const iframeHeightOffset = hasNavContentPane ? '35px' : '0px' ;
113
113
const classes = useStyles ( { hasNavContentPane } ) ;
@@ -130,12 +130,14 @@ export const SimplePowerBIReportEmbed = ({
130
130
( ) => PowerBIUtils . constructDynamicFilters ( dynamicFilters , scenarioDTO ) ,
131
131
[ dynamicFilters , scenarioDTO ]
132
132
) ;
133
+ const noDashboardConfigured = reportConfiguration [ index ] === undefined ;
133
134
const noScenario = scenario === null ;
134
135
const scenarioState = noScenario ? 'Created' : scenarioDTO . state ;
135
136
const noRun = scenarioState === 'Created' || scenarioState === null ;
136
137
const runInProgress = scenarioState === 'Running' ;
137
138
const hasError = scenarioState === 'Failed' ;
138
139
const isReady = ( scenarioState === undefined || scenarioState === 'Successful' ) && ! noScenario ;
140
+ const hasUnknownStatus = scenarioState === 'Unknown' ;
139
141
140
142
useEffect ( ( ) => {
141
143
const newConfig = {
@@ -193,6 +195,7 @@ export const SimplePowerBIReportEmbed = ({
193
195
< div className = { classes . errorTitle } > { errorCode } </ div >
194
196
< div className = { classes . errorDescription } > { errorDescription } </ div >
195
197
</ div >
198
+ { noDashboardConfigured && < DashboardPlaceholder label = { labels . noDashboard . label } /> }
196
199
{ noScenario && < DashboardPlaceholder label = { labels . noScenario . label } title = { labels . noScenario . title } /> }
197
200
{ ! noScenario && noRun && ! alwaysShowReports && (
198
201
< DashboardPlaceholder label = { labels . noRun . label } title = { labels . noRun . title } />
@@ -212,6 +215,7 @@ export const SimplePowerBIReportEmbed = ({
212
215
downloadLabel = { labels . downloadButton }
213
216
/>
214
217
) }
218
+ { hasUnknownStatus && < DashboardPlaceholder label = { labels . hasUnknownStatus . label } /> }
215
219
< div className = { classes . divContainer } style = { ! isReady && ! alwaysShowReports ? { display : 'none' } : { } } >
216
220
{ refreshable && (
217
221
< div className = { classes . toolbar } >
@@ -311,6 +315,10 @@ SimplePowerBIReportEmbed.propTypes = {
311
315
title : PropTypes . string ,
312
316
label : PropTypes . string . isRequired ,
313
317
} ) . isRequired ,
318
+ noDashboard : PropTypes . shape ( {
319
+ title : PropTypes . string ,
320
+ label : PropTypes . string ,
321
+ } ) ,
314
322
noRun : PropTypes . shape ( {
315
323
title : PropTypes . string ,
316
324
label : PropTypes . string . isRequired ,
@@ -323,6 +331,10 @@ SimplePowerBIReportEmbed.propTypes = {
323
331
title : PropTypes . string ,
324
332
label : PropTypes . string . isRequired ,
325
333
} ) . isRequired ,
334
+ hasUnknownStatus : PropTypes . shape ( {
335
+ title : PropTypes . string ,
336
+ label : PropTypes . string ,
337
+ } ) ,
326
338
downloadButton : PropTypes . string . isRequired ,
327
339
refreshTooltip : PropTypes . string . isRequired ,
328
340
errors : PropTypes . shape ( {
@@ -342,6 +354,9 @@ SimplePowerBIReportEmbed.defaultProps = {
342
354
title : 'No scenario yet' ,
343
355
label : 'You can create a scenario by clicking on Create new scenario' ,
344
356
} ,
357
+ noDashboard : {
358
+ label : "There isn't any dashboard configured for this run template" ,
359
+ } ,
345
360
noRun : {
346
361
label : 'The scenario has not been run yet' ,
347
362
} ,
@@ -351,6 +366,9 @@ SimplePowerBIReportEmbed.defaultProps = {
351
366
hasErrors : {
352
367
label : 'An error occured during the scenario run' ,
353
368
} ,
369
+ hasUnknownStatus : {
370
+ label : 'This scenario has an unknown state, if the problem persists, please, contact your administrator' ,
371
+ } ,
354
372
downloadButton : 'Download logs' ,
355
373
refreshTooltip : 'Refresh' ,
356
374
errors : {
0 commit comments