You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »


Introduction

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.

Figure 1: A dashboard from Apache Superset displayed in userview menu


Apache Superset Userview Menu Properties

Configure Apache Superset Dashboard Menu

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.

  • Public

  • Protected

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/

Apache Superset URL

This field is visible when "Dashboard Type" is protected. Defines the domain running Apache Superset.

Example: http://localhost:8088

Superset Username

This field is visible when "Dashboard Type" is protected. Superset user name used to create guest token. Refer to Configure Superset User Permissions 

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.

  • No

  • Yes

Show Tabs

This option is visible when "Dashboard Type" is protected. Show or hide the tabs of the dashboard.

  • No

  • Yes

Show Chart Controls

This option is visible when "Dashboard Type" is protected. Show or hide the chart controls of the dashboard.

  • No

  • Yes

Show Filters

This option is visible when "Dashboard Type" is protected. Show or hide the filter bar of the dashboard.

  • No

  • Yes



Apache Superset Dashboard Configurations

Configure All Dashboard to be Public

  1. Settings > List Roles > Edit Record for "Public" role 

  2. Add Permissions:

    1. can read on chart

    2. can read on Dashboard

    3. can dashboard on Superset

    4. can explore json on Superset

    5. all datasource access on all_datasource_access

    6. all database access on all_database_access

    7. ...and any other permissions if required





Figure 2: Edit Role for "Public"


Configure Specific Dashboard to be Public

  1. Settings > List Roles > Edit Record for "Public" role 
  2. Add Permissions:
    1. can read on chart
    2. can read on Dashboard
    3. can dashboard on Superset
    4. can explore json on Superset
    5. datasource access on [examples]
    6. database access on [examples]
    7. ...and any other permissions if required

Figure 3: Permission "datasource access on [examples]"


Figure 4: Permission "database access on [examples]"



Configure Superset User Permissions

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):

  1. Settings > List Roles > Add a new record
  2. Add Permissions:
    1. can read on SecurityRestApi
    2. can grant guest token on SecurityRestApi

Create a new user (Figure 7):

  1. Settings > List Users > Add a new record 
  2. Link Role (Role created in Figure 6)


Figure 5: Default setting for Guest Role at Config.py for Superset


Figure 6: Add new role to generate guest token


Figure 7: Add new user to generate guest token



Retrieve Superset Dashboard Embed ID

  1. At config.py for Superset, enable "EMBEDDED_SUPERSET" to True.

  2. Dashboards > any dashboard > Settings > Embed dashboard

  3. Copy the embed ID 

Figure 8: Enable Embedded_Superset to True at Config.py for Superset


Figure 9: Embed dashboard option enabled after setting in Config.py


Figure 10: Embed ID in Embed dashboard



Customising Options for Superset Dashboard before Render

  • Show Title

  • Show Tabs

  • Show Chart Controls

  • Show Filters

Figure 11: Original dashboard without customisation


Figure 12: Show Title


Figure 13: Show Chart Controls



  • No labels