-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(consultation-portal): KAM-2522: PowerBI report added (#15251)
- Loading branch information
Showing
13 changed files
with
227 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { useRef } from 'react' | ||
import { PowerBIEmbed } from 'powerbi-client-react' | ||
import { type Embed, models } from 'powerbi-client' | ||
|
||
export const PowerBI = () => { | ||
const embedRef = useRef<Embed | null>(null) | ||
|
||
const getEmbeddedComponent = (embed: Embed) => { | ||
embed.element.style.height = '700px' | ||
embed.element.style.width = '100%' | ||
embed.iframe.style.border = 'none' | ||
embedRef.current = embed | ||
} | ||
|
||
return ( | ||
<PowerBIEmbed | ||
embedConfig={{ | ||
type: 'report', | ||
tokenType: models.TokenType.Embed, | ||
embedUrl: | ||
'https://app.powerbi.com/view?r=eyJrIjoiZjFjOWRlODEtNGFlNS00MDkxLTlhNmYtNGUxY2Y0ZWM0M2E5IiwidCI6ImJjMTRhNDRlLWUwZmItNGUwYi1hNTM1LTEwMDU3OWQ0MWI2NSIsImMiOjh9', | ||
settings: { | ||
layoutType: models.LayoutType.MobilePortrait, | ||
}, | ||
}} | ||
getEmbeddedComponent={getEmbeddedComponent} | ||
/> | ||
) | ||
} | ||
|
||
export default PowerBI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import dynamic from 'next/dynamic' | ||
|
||
export const PowerBIComponent = dynamic(() => import('./PowerBI'), { | ||
ssr: false, | ||
}) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { StatisticsScreen } from '../../screens/Statistics/Statistics' | ||
|
||
export const Index = () => <StatisticsScreen /> | ||
|
||
export default Index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import LinkExpiredScreen from '../../../screens/EmailVerified/LinkExpired' | ||
|
||
export const Index = () => { | ||
return <LinkExpiredScreen /> | ||
} | ||
|
||
export default Index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import NotFoundScreen from '../../../screens/EmailVerified/NotFound' | ||
|
||
export const Index = () => { | ||
return <NotFoundScreen /> | ||
} | ||
|
||
export default Index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
apps/consultation-portal/screens/EmailVerified/LinkExpired.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { | ||
ArrowLink, | ||
Box, | ||
GridColumn, | ||
GridContainer, | ||
GridRow, | ||
Text, | ||
} from '@island.is/island-ui/core' | ||
import { Layout } from '../../components' | ||
import localization from './EmailVerified.json' | ||
|
||
export const LinkExpiredScreen = () => { | ||
const loc = localization['linkExpired'] | ||
return ( | ||
<Layout seo={{ title: loc.seo.title, url: loc.seo.url }}> | ||
<GridContainer> | ||
<GridRow> | ||
<GridColumn span={'12/12'} paddingBottom={10} paddingTop={8}> | ||
<Box | ||
display="flex" | ||
flexDirection="column" | ||
width="full" | ||
alignItems="center" | ||
> | ||
<Text | ||
variant="eyebrow" | ||
as="div" | ||
paddingBottom={2} | ||
color="purple400" | ||
> | ||
{loc.failText} | ||
</Text> | ||
|
||
<Text variant="h1" as="h1" paddingBottom={3}> | ||
{loc.linkExpiredText} | ||
</Text> | ||
<Text paddingBottom={3}>{loc.text}</Text> | ||
<ArrowLink href="/">{loc.arrowLinkText}</ArrowLink> | ||
</Box> | ||
</GridColumn> | ||
</GridRow> | ||
</GridContainer> | ||
</Layout> | ||
) | ||
} | ||
export default LinkExpiredScreen |
46 changes: 46 additions & 0 deletions
46
apps/consultation-portal/screens/EmailVerified/NotFound.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { | ||
ArrowLink, | ||
Box, | ||
GridColumn, | ||
GridContainer, | ||
GridRow, | ||
Text, | ||
} from '@island.is/island-ui/core' | ||
import { Layout } from '../../components' | ||
import localization from './EmailVerified.json' | ||
|
||
export const NotFoundScreen = () => { | ||
const loc = localization['notFound'] | ||
return ( | ||
<Layout seo={{ title: loc.seo.title, url: loc.seo.url }}> | ||
<GridContainer> | ||
<GridRow> | ||
<GridColumn span={'12/12'} paddingBottom={10} paddingTop={8}> | ||
<Box | ||
display="flex" | ||
flexDirection="column" | ||
width="full" | ||
alignItems="center" | ||
> | ||
<Text | ||
variant="eyebrow" | ||
as="div" | ||
paddingBottom={2} | ||
color="purple400" | ||
> | ||
{loc.failText} | ||
</Text> | ||
|
||
<Text variant="h1" as="h1" paddingBottom={3}> | ||
{loc.notFoundText} | ||
</Text> | ||
<Text paddingBottom={3}>{loc.text}</Text> | ||
<ArrowLink href="/">{loc.arrowLinkText}</ArrowLink> | ||
</Box> | ||
</GridColumn> | ||
</GridRow> | ||
</GridContainer> | ||
</Layout> | ||
) | ||
} | ||
export default NotFoundScreen |
19 changes: 19 additions & 0 deletions
19
apps/consultation-portal/screens/Statistics/Statistics.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"statistics": { | ||
"seo": { | ||
"title": "Tölfræði", | ||
"url": "/tolfraedi", | ||
"description": "Tölfræði um samráðsgátt", | ||
"keywords": "" | ||
}, | ||
"breadcrumbs": [ | ||
{ | ||
"title": "Samráðsgátt", | ||
"href": "/samradsgatt" | ||
}, | ||
{ | ||
"title": "Tölfræði" | ||
} | ||
] | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
apps/consultation-portal/screens/Statistics/Statistics.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { GridContainer } from '@island.is/island-ui/core' | ||
|
||
import { Breadcrumbs, Layout } from '../../components' | ||
import localization from './Statistics.json' | ||
import { PowerBIComponent } from '../../components/PowerBI' | ||
|
||
export const StatisticsScreen = () => { | ||
const loc = localization['statistics'] | ||
|
||
return ( | ||
<Layout | ||
seo={{ | ||
title: loc.seo.title, | ||
url: loc.seo.url, | ||
description: loc.seo.description, | ||
keywords: loc.seo.keywords, | ||
}} | ||
> | ||
<Breadcrumbs | ||
items={[ | ||
{ title: loc.breadcrumbs[0].title, href: loc.breadcrumbs[0].href }, | ||
{ title: loc.breadcrumbs[1].title }, | ||
]} | ||
/> | ||
<GridContainer> | ||
<PowerBIComponent /> | ||
</GridContainer> | ||
</Layout> | ||
) | ||
} | ||
|
||
export default StatisticsScreen |