cancel
Showing results for 
Search instead for 
Did you mean: 
JeremyFriedel
Sisense Team Member
Sisense Team Member

Plugin - Hide Widget Type in Chart Type Dropdown From User Groups

 

This plugin hides widget types from the widget selection dropdown menu, for user groups set in the config of the plugin. The widget types hidden are set in the config. Widgets of that type that are pre-existing in dashboards can still be viewed and edited by all users.
 

Installation

To install this plugin, download and unzip the attachment. Then drop the HideChartTypeByGroup folder into your plugins folder (/opt/sisense/storage/plugins). Enable the plugin on the Add-ons tab in the Admin section, wait for the plugin to build, and the plugin will be enabled.

Configure

To configure this plugin, set the two parameters in the config.6.js file, chartTypesToHide, and userGroupToModify. chartTypesToHide is an array of strings of the chart names to hide in the dropdown menu, userGroupToModify is an array of group OIDs for which users belonging to those groups the charts defined in chartTypesToHide will be hidden in the dropdown menu. Below is an example of a config.6.js file:

 

export const config = {

    // Chart types to hide in the dropdown, case sensitive, include full name
    chartTypesToHide: ["Bar Chart", "BloX"],

    // Members of these groups will have this plugin modify the dropdown
    // Group unique OID, can be copied from group API or from prism.user.groupNames
    userGroupToModify: ["6532f4a99760e6cbf6e18585", "3265f4a99760e3bbe3e18517"]

}

 

 

 

 

 
Tip - Include the full name of the Chart type exactly as it appears in the dropdown to avoid potentially hiding Charts that also include the string.
 
Below is an example of the plugin hiding the Bar Chart option in the widget selection dropdown for a user that is a member of one of the groups set in userGroupToModify.
 
Screen Shot 2023-11-08 at 8.55.33 AM.pngScreen Shot 2023-11-08 at 8.53.31 AM.png
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
How did the plugin work for you? What other type of plugin are you looking to learn more about? Let me know in the comments!
Rate this article:
Comments
Alib
7 - Data Storage
7 - Data Storage

This works for the advance configuration when creating a new widget or from the edit widget. However, when creating a new widget, the list of charts still includes icons that was filtered out.

For example, I filtered the "Area Map" out from the drop down on the edit widget page, but I can still choose the icon on the new widget menu from the right panel.

How can the "Area Map" be filtered out of new widget menu side panel?

JeremyFriedel
Sisense Team Member
Sisense Team Member

Hi Alib,

Happy to hear that this plugin is helpful!

The original Sisense customer that this plugin was developed for had previously hidden the entire widget icon menu via custom plugin CSS for all users, so it was not part of the original plugin functionality.

It is possible to hide the icon for all users (not group specific) by using standard CSS rules applied by a plugin, including this plugin.

Modifying the plugin.json file of this plugin replacing the empty style attribute array with the name and file path of a CSS file  or files present in the plugin folder:

    "style": [
        "style.css"
    ],

Then creating a CSS file in the folder matching the file name and path (in this case style.css in the main plugin folder), any standard CSS rules can be applied.

In the latest version of Sisense the area chart icon icon can be removed from the new chart icon bar with the following CSS rule:

/* Hide Area Chart icon in new widget menu*/
.widget-type-wrapper[title="Area Chart"] {
    display : none !important;
}

 

If you would like to share your email via a private Community message a Google Drive link with those specific CSS changes applied to the plugin can be shared.

Version history
Last update:
‎11-08-2023 08:05 AM
Updated by: