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

SLEEP-1499 Support embedding of Superset dashboard in Iaso #1698

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bramj
Copy link
Contributor

@bramj bramj commented Oct 10, 2024

This PR contains a v1 for embedding Superset dashboards in Iaso, using the Pages model.

Specifically:

  • Add a new pages template that supports embedding a new type of page "SUPERSET"
  • Add an API endpoint POST /api/superset/token that creates a Superset "guest token" for a specific dashboard

Related JIRA tickets : https://bluesquare.atlassian.net/browse/SLEEP-1499

Note that this is a v1. In order to make this properly usable for regular users, I think we should have a place where you can configure the connection to such a dashboard for a given account.

Doc

No docs yet since it's not really publicly usable yet. Like PowerBI, we can enable it by setting the page type to "Superset" via the admin, but not just any user can activate it since it requires ENV vars to be configured to a Superset server.

How to test

  1. Create a Superset dashboard, make it embeddable, this will give you a dashboard_id.
  2. Create an embedded page, e.g. iframe. Set the contents to the dashboard_id you want to embed.
  3. Visit the page, you should now see your dashboard.

- Add a new pages template that supports embedding a new type of page
"SUPERSET"
- Add an API endpoint POST /api/superset/token that creates a Superset
"guest token" for a specific dashboard
SERVER_URL:
SUPERSET_DB_NAME:
SUPERSET_DB_HOSTNAME:
SUPERSET_DB_PASSWORD:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is that here?

<head>
<title>{{title}}</title>
{{ analytics_script | safe }}
<script src="https://unpkg.com/@superset-ui/embedded-sdk"></script>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, we should have this copied in our code base and not depending on an external source


supersetEmbeddedSdk.embedDashboard({
id: '{{dashboard_id}}',
supersetDomain: 'https://superset.trypelim.org',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Domain name seems hardcoded?

</head>

<body>
<div id="my-superset-container"></div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not very important, but why "my" ?

@bramj bramj self-assigned this Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants