diff --git a/packages/power-bi/src/lib/components/PowerBi.tsx b/packages/power-bi/src/lib/components/PowerBi.tsx index 0736be75..ccb4ec5c 100644 --- a/packages/power-bi/src/lib/components/PowerBi.tsx +++ b/packages/power-bi/src/lib/components/PowerBi.tsx @@ -11,6 +11,8 @@ import { Report } from './report/Report'; import React from 'react'; import { models, factories, service } from 'powerbi-client'; +import styled from 'styled-components'; +import { StyledLoadingWrapper } from './loading/loading.styles'; Icon.add({ chevron_down, chevron_up }); @@ -51,6 +53,16 @@ export const PowerBi = (props: PowerBiProps) => { ); }; + +const StyledPowerBiBootstrap = styled.div` + visbility: hidden; + position: absolute; + top: 0; + right: 0; + width: 0; + height: 0; +` + /** * Initializes preloading of iframe javascript resources */ @@ -58,9 +70,8 @@ function PowerBiBootstrap() { const isBootstrapped = useRef(false); return ( -
{ if (!ref || isBootstrapped.current == true) return; new service.Service(factories.hpmFactory, factories.wpmpFactory, factories.routerFactory).bootstrap(ref, { diff --git a/packages/power-bi/src/lib/components/report/Report.tsx b/packages/power-bi/src/lib/components/report/Report.tsx index 6b973be3..0751701b 100644 --- a/packages/power-bi/src/lib/components/report/Report.tsx +++ b/packages/power-bi/src/lib/components/report/Report.tsx @@ -5,6 +5,15 @@ import { IReportEmbedConfiguration, models } from 'powerbi-client'; import { LoadedReport } from '../loadedReport/LoadedReport'; import { PowerBiProps } from '../PowerBi'; import { CircularProgress } from '@equinor/eds-core-react'; +import styled from 'styled-components'; + +const StyledLoadingWrapper = styled.div` + height: 100%; + display: flex; + width: 100%; + align-items: center; + justify-content: center; +` export function Report({ getEmbedInfo, getToken, reportUri, controller, filters, bookmark }: PowerBiProps) { const { data: token, isLoading: isTokenLoading } = useQuery({ @@ -28,9 +37,9 @@ export function Report({ getEmbedInfo, getToken, reportUri, controller, filters, if (isTokenLoading || isEmbedLoading) { return ( -
+ -
+ ); } @@ -44,7 +53,7 @@ export function Report({ getEmbedInfo, getToken, reportUri, controller, filters, return ( { if (bookmark) { rep.bookmarksManager.applyState(bookmark);