Add Widget Script Indicator
Download: Script Indicator
Introduction
This article explains how to add an icon to indicate if a custom script exists for the widget. The icon can also act as a shortcut button to open the Script Editor page and the Widget Editor page.
Purpose/Benefits
JavaScript scripts can be added to widgets in Sisense to extend and customize functionality. Dashboard designers may find it hard to identify at a glance which widgets have a custom script attached.
This plugin adds an icon indicating that a script is present.
Steps
The following steps will walk you through the process of adding the plugin and the indicator icon.
Step 1 – Add the Plugin
Download the attachment and unzip the contents into your C:\Program Files\Sisense\PrismWeb\plugins\ folder. If you are using version 7.2 and higher unzip the contents into your C:\Program Files\Sisense\app\plugins\ folder. If the plugins folder doesn't exist, just create it.
Step 2 – Configure Settings (optional)
Open the config.js file located in the plugins folder in a text editor such as Notepad++ where you can edit the options to your liking.
The available options are:
widget_indicator_on | true, false | Display or hide the indicator icon |
open_on_click_enabled | 0,1,2 | Specify the button’s action: 0 – no action |
Notes
- The script indicator icon will only be visible to Designer and Admin roles.
Updates:
** 23/08/2017 - Console error has been found and fixed.
** 01/07/2018 - Adjust to version 7
-
Very nice!
But nowadays the Text widget does not have an edit button, but it is possible to add script into it. So we need to discover it´s widgetId in order to chenge the script. It would be very nice if scriptIconIndicator works with Text Widgets.
-
Hi David, I was debugging another plugin with Lidor Rosencovich and he realized that the Widget Script Indicator plugin was generating some unwanted errors in the console when buttonObj is undefined. He added a condition to check if buttonObj is defined to get rid of all the errors. So it's fixed on our version, but would you mind to fix the official plugin also? Thanks
-
@Aviv, if you look at the plugin script (scriptIndicator.js), here are lines 29-30:
// Check if the widget has a script and that the user is not a viewer
if (args.widget.script && !args.widget.dashboard.userAuth.base.isConsumer){You would need to remove the first condition, save the file, and restart IIS.
Please sign in to leave a comment.
Comments
13 comments