Skip to content

Commit b86b300

Browse files
author
Edon Zeqiraj
committed
feature: [PROD-14860] remove error handling component from simplepowerbireportembed
1 parent 9676e10 commit b86b300

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

src/charts/SimplePowerBIReportEmbed/SimplePowerBIReportEmbed.js

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,6 @@ import { PowerBIUtils } from '@cosmotech/azure';
1010
import { FadingTooltip } from '../../misc';
1111
import DashboardPlaceholder from '../Dashboard/components';
1212

13-
const StyledErrorContainerDiv = styled('div')(({ theme }) => ({
14-
'z-index': '1', // Need z-index > 0, otherwise the error banner is hidden behind the powerbi loading screen
15-
height: '50px',
16-
width: '100%',
17-
position: 'absolute',
18-
textAlign: 'center',
19-
padding: '5px 0',
20-
backgroundColor: theme.palette.error.main,
21-
color: theme.palette.error.contrastText,
22-
}));
23-
2413
const PREFIX = 'SimplePowerBIReportEmbed';
2514
const classes = { report: `${PREFIX}-report` };
2615

@@ -31,15 +20,6 @@ const Root = styled('div')(({ theme }) => ({
3120
},
3221
}));
3322

34-
function getErrorCode(labels, reports) {
35-
if (!reports?.error?.status && !reports?.error?.statusText) return labels.errors.unknown;
36-
return `${reports?.error?.status ?? ''} ${reports?.error?.statusText ?? ''}`;
37-
}
38-
39-
function getErrorDescription(labels, reports) {
40-
return reports?.error?.powerBIErrorInfo ?? labels.errors.details;
41-
}
42-
4323
function addDynamicParameters(pageName, lang, newConfig, settings, staticFilters, additionalFilters) {
4424
if (pageName !== undefined && pageName[lang] !== undefined) {
4525
newConfig.pageName = pageName[lang];
@@ -189,9 +169,6 @@ export const SimplePowerBIReportEmbed = ({
189169
}
190170
}, [theme, report]);
191171

192-
const errorCode = getErrorCode(labels, reports);
193-
const errorDescription = getErrorDescription(labels, reports);
194-
195172
const refreshReport = useCallback(
196173
(triggerTimeout = true) => {
197174
if (!report) return;
@@ -246,10 +223,6 @@ export const SimplePowerBIReportEmbed = ({
246223

247224
return (
248225
<Root style={{ height: '100%', width: '100%', position: 'relative' }}>
249-
<StyledErrorContainerDiv hidden={reports.status !== 'ERROR'}>
250-
<div style={{ fontWeight: 'bold', fontSize: 'large' }}>{errorCode}</div>
251-
<div style={{ fontWeight: 'bold', fontSize: 'small' }}>{errorDescription}</div>
252-
</StyledErrorContainerDiv>
253226
{placeholder}
254227
<div style={{ width: '100%', display: 'flex', flexDirection: 'row', ...divContainerStyle }}>
255228
{refreshable && (

0 commit comments

Comments
 (0)