Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/embed dashboard superset #497

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions configs/ecospheres/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ website:
to: /datasets
- text: Bouquets
to: /bouquets
- text: Tableau de bord
to: /dashboard
- text: A propos
to: /about
router:
Expand All @@ -99,6 +101,10 @@ website:
id: 'terms'
route: '/terms'
url: '/ecospheres/pages/terms.md'
- title: Tableau de bord
id: dashboard
url: '/ecospheres/pages/dashboard.md'
route: /dashboard
home_buttons:
topic_charts:
display: false
Expand Down
7 changes: 7 additions & 0 deletions public/ecospheres/pages/dashboard.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<iframe
src="https://ecospheres-catalog-superset.app.france.sh/superset/dashboard/2/?standalone=1"
frameborder="0"
width="100%"
height="1200"
allowtransparency
></iframe>
3 changes: 2 additions & 1 deletion src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ export const descriptionFromMarkdown = (ref, attr = 'description') => {
*
* @param {string} value
*/
export const fromMarkdown = (value) => {
export const fromMarkdown = (value, safe = false) => {
if (!value) return ''
const parsed = marked.parse(value, markedOptions)
if (safe) return parsed
return DOMPurify.sanitize(parsed)
}

Expand Down
2 changes: 1 addition & 1 deletion src/views/SimplePageView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ watchEffect(async () => {
</div>
<GenericContainer>
<!-- eslint-disable-next-line vue/no-v-html -->
<div v-html="fromMarkdown(content)" />
<div v-html="fromMarkdown(content, true)" />
</GenericContainer>
</template>
Loading