Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions src/charts/SimplePowerBIReportEmbed/SimplePowerBIReportEmbed.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,6 @@ import { PowerBIUtils } from '@cosmotech/azure';
import { FadingTooltip } from '../../misc';
import DashboardPlaceholder from '../Dashboard/components';

const StyledErrorContainerDiv = styled('div')(({ theme }) => ({
'z-index': '1', // Need z-index > 0, otherwise the error banner is hidden behind the powerbi loading screen
height: '50px',
width: '100%',
position: 'absolute',
textAlign: 'center',
padding: '5px 0',
backgroundColor: theme.palette.error.main,
color: theme.palette.error.contrastText,
}));

const PREFIX = 'SimplePowerBIReportEmbed';
const classes = { report: `${PREFIX}-report` };

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

function getErrorCode(labels, reports) {
if (!reports?.error?.status && !reports?.error?.statusText) return labels.errors.unknown;
return `${reports?.error?.status ?? ''} ${reports?.error?.statusText ?? ''}`;
}

function getErrorDescription(labels, reports) {
return reports?.error?.powerBIErrorInfo ?? labels.errors.details;
}

function addDynamicParameters(pageName, lang, newConfig, settings, staticFilters, additionalFilters) {
if (pageName !== undefined && pageName[lang] !== undefined) {
newConfig.pageName = pageName[lang];
Expand Down Expand Up @@ -189,9 +169,6 @@ export const SimplePowerBIReportEmbed = ({
}
}, [theme, report]);

const errorCode = getErrorCode(labels, reports);
const errorDescription = getErrorDescription(labels, reports);

const refreshReport = useCallback(
(triggerTimeout = true) => {
if (!report) return;
Expand Down Expand Up @@ -246,10 +223,6 @@ export const SimplePowerBIReportEmbed = ({

return (
<Root style={{ height: '100%', width: '100%', position: 'relative' }}>
<StyledErrorContainerDiv hidden={reports.status !== 'ERROR'}>
<div style={{ fontWeight: 'bold', fontSize: 'large' }}>{errorCode}</div>
<div style={{ fontWeight: 'bold', fontSize: 'small' }}>{errorDescription}</div>
</StyledErrorContainerDiv>
{placeholder}
<div style={{ width: '100%', display: 'flex', flexDirection: 'row', ...divContainerStyle }}>
{refreshable && (
Expand Down