Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
The Apache Superset Userview Menu plugin is used to integrate Apache Superset dashboards into Joget DX Userview Menu. User can choose to embed their dashboard in either public or protected. Customisation options can be configured to show or hide before rendering the dashboard.
This plugin is created with the use of Superset Embedded SDK to embed the Superset dashboards into Joget DX.
This plugin source code and jar is available in JogetOSS repository at https://github.com/jogetoss/superset-menu.
Plugins Available in the Bundle:
Apache Superset Userview Menu
This plugin bundle is compatible with Joget DX 8.
Able to display an Apache Superset dashboard in Joget Userview Menu as shown in Figure 1.
Figure 1: A dashboard from Apache Superset displayed in userview menu
Before proceeding, make sure you have the following prerequisites:
Please follow the link to setup Apache Superset using Docker: https://superset.apache.org/docs/installation/installing-superset-using-docker-compose/.
If you wish to use other means other than Docker to setup Apache Superset, please dive into their documentation under Installation and Configuration for more details.
git clone https://github.com/apache/superset.git
Enter the "superset" folder
cd superset
Run in development mode using the following code:
docker compose up
In docker, you can see that the superset container is running:
Figure 2: Docker Superset Container Running
You will need to wait a short while for all the containers to initialise and run around 5-10 minutes. After everything is done, you will be able to login and see the landing page.
Wait for a short while, after that you can launch http://localhost:8088/ which is the default hosting location, and you can see the following login page.
Username "admin", password "admin" will be the default user credentials.
Figure 3: Hosting Apache Superset Locally
After logging in, this will be the main page of superset.
Figure 4: Landing page of Superset
Figure 5: Invalid Login
You might need to run following command to setup username and password manually:
docker-compose exec superset bash docker/docker-init.sh
Figure 6: Access is Denied
Try adding the permissions as shown in Configure All Dashboard to be Public.
Try following Disabling Talisman. [Source: node.js - Problem with Superset dashboard embedding in web app - Stack Overflow]
Please refer to Source Code and Plugin Download.
1. In Joget, go to UI Builder. Under Marketplace section, drag the Apache Superset Userview Menu into the UI.
Figure 7: UI Builder
2. Fill in all the plugin configuration properties by referring to Apache Superset Userview Menu Properties.
3. For public dashboard, make sure you can see your dashboard in incognito mode (without logging into superset). Copy the URL.
Figure 8: Apache Superset Public Dashboard
4. Paste the URL in the Dashboard URL for Public Dashboard Type.
Figure 9: Apache Superset Public Dashboard Configurations
5. Save and run in UI. You will be able to see the Apache Superset Public Dashboard.
Figure 10: Apache Superset Public Dashboard shown
6. For protected dashboards, you can use admin user for the Superset Username and Password if you want to save the hassle of creating a new user. If you wish to create a user with limited permissions, please refer to Configure Superset User Permissions.
Figure 11: Apache Superset Protected Dashboard Configurations
7. Obtain the dashboard embed ID after you have done the steps in Retrieve Superset Dashboard Embed ID
Figure 12: Apache Superset Protected Dashboard Embed ID
8. Paste the embed ID in Dashboard Embed ID. Save and run the UI.
Figure 13: Apache Superset Protected Dashboard Configurations Save
9. Save and run in UI. You will be able to see the Apache Superset Protected Dashboard.
Figure 14: Apache Superset Protected Dashboard shown
Figure 3: Plugin Configurations with no Dashboard Type
Figure 4: Plugin Configurations with Public Dashboard Type
Figure 5: Plugin Configurations with Protected Dashboard Type
Name | Description |
---|---|
Label | Menu label. Mandatory field. |
Menu ID | Menu element unique ID. |
Dashboard Type | The type of dashboard that is shown to the user.
|
Dashboard URL | This field is visible when "Dashboard Type" is public. Defines the entire URL of the dashboard. Example: http://localhost:8088/superset/dashboard/5/ (Assuming your Apache Superset is running on default http://localhost:8088/). |
Apache Superset URL | This field is visible when "Dashboard Type" is protected. Defines the domain running Apache Superset. Example: http://localhost:8088 (Assuming your Apache Superset is running on default http://localhost:8088/) |
Superset Username | This field is visible when "Dashboard Type" is protected. Superset username used to create guest token. Refer to Configure Superset User Permissions. If you do not wish to create a new user, use the admin role. |
Superset Password | This field is visible when "Dashboard Type" is protected. Superset user password used to create guest token. |
Dashboard Embed ID | This field is visible when "Dashboard Type" is protected. Embed ID retrieved from Superset dashboard. Refer to Retrieve Superset Dashboard Embed ID. |
Show Title | This option is visible when "Dashboard Type" is protected. Show or hide the title of the dashboard.
|
Show Tabs | This option is visible when "Dashboard Type" is protected. Show or hide the tabs of the dashboard.
|
Show Chart Controls | This option is visible when "Dashboard Type" is protected. Show or hide the chart controls of the dashboard.
|
Show Filters | This option is visible when "Dashboard Type" is protected. Show or hide the filter bar of the dashboard.
|
Please navigate to the domain where your superset is hosted, if you follow the documentation in Get Started -> Prerequisites / Assumptions, the default host location will be http://localhost:8088/.
Settings > List Roles > Edit Record for "Public" role
Add Permissions:
can read on chart
can read on Dashboard
can dashboard on Superset
can explore json on Superset
all datasource access on all_datasource_access
all database access on all_database_access
And any other permissions if required.
Figure 6: Edit Role for "Public"
And any other permissions if required.
Figure 7: Permission "datasource access on [examples]"
Figure 8: Permission "database access on [examples]"
When "Dashboard Type" is protected, username and password is required. The user is required to generate guest token for end user to access the dashboard anonymously. The guest token that is generated follows the role configured in config.py for Superset (Figure 5). Note: the guest does not follow the role of the user configured in Apache Superset Userview Menu. The default role for guest is "Public".
To generate the least permission user to only be used to generate guest token, create a new user and role for it.
Create a new role (Figure 6):
Create a new user (Figure 7):
To read more on roles, refer to Apache Superset Documentation on roles: Apache Superset: Security > Provided Roles.
Figure 9: Default setting for Guest Role at Config.py for Superset
Figure 10: Add new role to generate guest token
Figure 11: Add new user to generate guest token
At superset/superset/config.py for Superset, enable "EMBEDDED_SUPERSET" to True.
Dashboards > any dashboard > Settings > Embed dashboard
Copy the embed ID
Figure 12: Enable Embedded_Superset to True at Config.py for Superset
Figure 13: Embed dashboard option enabled after setting in Config.py
Figure 14: Embed ID in Embed dashboard
Show Title
Show Tabs
Show Chart Controls
Show Filters
Figure 15: Original dashboard without customisation
Figure 16: Show Title
Figure 17: Show Chart Controls
Figure 18: Disabling CSRF protection