Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Dashboards Programmability


(information)

Info

The following feature is available as public beta in Flex UI version 1.27 and later. To use this feature, please make sure Insights - Programmable Dashboards public beta feature is enabled in your admin interface.

(information)

Info

A developer proxy is needed for local development. Please refer to the article about Local Development.

Starting version 1.27, Flex allows users to programmatically configure the Dashboards navigation. Currently setting a filter for the Dashboards is supported.

(warning)

Warning

Please note that this feature is for convenience use only and cannot be considered a security feature. Even with filtering enabled, agents are technically still able to access the whole list of the dashboards they have permissions to view.


Terminology

terminology page anchor

To explain how the filtering works, it is important to establish some terms and explain how the navigation works.

We currently support 2 different kinds of dashboards:

  1. The Project Dashboards , which group sets of Tabs, which you can select to display a dashboard,
  2. and Analytical Dashboards , which by themselves are the dashboards.

DashboardsSidebar component

dashboardssidebar-component page anchor

This component has 2 default props that can be overridden:

  • dashboardsFilter: (dashboard) => boolean
  • dashboardTabFilter: (tab, dashboard) => boolean

These props are available under the following namespace: Flex.Insights.DashboardsSidebar.defaultProps.

dashboardsFilter

dashboardsfilter page anchor

The dashboardsFilter determines which dashboards will be available in the dropdown at the top of the sidebar and as part of the navigation. The return value from the function dictates if the particular Dashboard will be displayed or hidden.

The function takes dashboard as an argument. This can be either an Analytical Dashboard or a Project Dashboard.

If false is returned for a Project Dashboard, it will disappear from both the dropdown and from the navigation - if "All Dashboards" is selected, along with all of its tabs. If you want to hide only some of the tabs, use the dashboardTabFilter prop.

If false is returned for an Analytical Dashboard, it will be hidden from the top of the navigation, when "All Dashboards" is selected.

The dashboard argument has the following shape:


_10
identifier: string;
_10
category?: string;
_10
link?: string;
_10
title?: string;
_10
author?: string;
_10
tabs?: Array<{
_10
title: string;
_10
identifier: string;
_10
}>;
_10
widgets?: string[];

Example

example page anchor

In this example, let's say you want to hide a dashboard named "Control Center":


_10
Flex.Insights.DashboardsSidebar.defaultProps.dashboardsFilter =
_10
(dashboard) =>
_10
dashboard.title !== "Control Center"

Sometimes you might not want to hide the whole Project Dashboard, but only some of its tabs. That's when this function comes in handy.

The function takes tab and a dashboard as its arguments. Each Project Dashboard tab is checked against this filter and the return value for that tab determines if the tab should be displayed or not. The dashboard argument is the Project Dashboard which the tab is part of. This allows you to decide not only based on the tab title itself, but also by the properties of the dashboard, as displayed in the example below.

The tab argument has the following shape:


_10
title: string;
_10
identifier: string;

Let's say you want to hide a tab named Conversations which is part of the Control Center dashboard:


_10
Flex.Insights.DashboardsSidebar.defaultProps.dashboardTabFilter =
_10
(tab, dashboard) =>
_10
tab.title !== "Conversations" && dashboard.title !== "Control Center"

It might, however, be a better idea to filter directly by ID. To find out ID for any dashboard, you can follow this guide. Please note that the ID in the URL corresponds with the tab.identifier key.

Please note that setting a dashboardTabFilter has no effect on Analytical Dashboards.


Rate this page: