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

Plugin – RemoveImageDownload – Removing Items From Sisense Menus

This article discusses a plugin (and an equivalent dashboard script) that removes the “Download as Image” option from Sisense menus. This same approach can be applied to remove any other menu option in Sisense by adjusting the relevant code.

Organizations may want to hide or remove specific menu items for several reasons:

  • Security: Prevent certain menu options from being used.
  • Enforcing Best Practices: Remove menu items not used in the standard recommended workflow
  • Streamlined UI: Hide unused menu items to simplify the user experience.

Plugin Overview

RemoveImageDownload plugin removes the “Download Image” option from all standard Sisense menus which include the:

  • Dashboard Toolbar Menu
  • Widget Context Menu (in a dashboard)
  • Direct Download Menu in the Widget Editor and Viewer

 

This is accomplished using the Sisense beforemenu event. That event runs before any standard Sisense menu is rendered, giving scripts and plugins an opportunity to modify or remove items.

The primary JavaScript file of the plugin (main.6.js) can also be used as a standalone dashboard script, simply copy and paste the code as a dashboard script.

The code works by listening to the beforemenu event, which Sisense triggers before rendering any of its menus. Within that event, the script functions filters the args.settings.items array, each “item” in this array may itself contain nested sub-items (like the “Download” submenu). The script locates the specific item or items to remove by checking parameters such as item.caption or item.command.title, and then filters the menu items out accordingly. This code design is flexible, by adjusting which string is matched in the filter logic this code can be used for any standard Sisense menu item.

 

Below is the complete code, with explanatory comments:

 

 

 

 

 

 

//
// Remove the image option from the download menu in the widget context (dashboard view)
//
prism.on("beforemenu", (ev, args) => {
    if (
        !args.settings?.name ||
        !args.settings?.scope?.widget ||
        !args.settings.name.includes("widget") ||
        !args.settings.items
    ) {
        return;
    }

    const downloadMenu = args.settings.items.find(item => item.caption === "Download");
    if (!downloadMenu?.items) {
        return;
    }

    const downloadWithoutImage = downloadMenu.items.filter(item => {
        return !(item.command && item.command.title === "dashboard.widget.commands.image.title");
    });

    if (downloadWithoutImage !== undefined) {
        downloadMenu.items = downloadWithoutImage;
    }
});

//
// Remove the "Download Image" option from the main dashboard Download menu
//
prism.on("beforemenu", (ev, args) => {
    if (
        !args.settings?.name ||
        !args.settings.name.includes("dashboard") ||
        args.settings.name.includes("widget") ||
        !args.settings.items
    ) {
        return;
    }

    const downloadMenu = args.settings.items.find(item => item.caption === "Download");
    if (!downloadMenu?.items) {
        return;
    }

    const downloadWithoutImage = downloadMenu.items.filter(item => {
        return !(item.command && item.command.title === "Download Image");
    });

    if (downloadWithoutImage !== undefined) {
        downloadMenu.items = downloadWithoutImage;
    }
});

//
// Remove the image download option from the Widget Editor UI download dropdown
//
prism.on("beforemenu", (ev, args) => {
    if (!args.settings?.items) {
        return;
    }

    args.settings.items = args.settings.items.filter(item => {
        return !(item.command && item.command.title === "dashboard.widget.commands.image.title");
    });
});

 

 

 

 

 

 

 

Plugin Readme

Below is the README for the RemoveImageDownload plugin.

 

 

 

 

 

 

 

# Remove Image Download from Menu

## Description

This plugin removes the option to download images from the widget and dashboard menu UI. It does not modify Sisense API endpoints, including the image API endpoint.

## Installation

1. **Download the plugin:**
   - Extract the compressed archive to /opt/sisense/storage/plugins/
   - Or, in Admin > System Management > File Management, upload the extracted folder to the plugins directory.

2. **Wait for the plugin to load.**

3. **Refresh the page.**

 

 

 

 

 

 

Screenshots

Below are before-and-after screenshots of the relevant Sisense menus when the plugin is enabled.

With PluginWith Plugin

 

Without PluginWithout Plugin

 

With PluginWith Plugin

Without PluginWithout Plugin

 

With PluginWith Plugin

Without PluginWithout Plugin

Further Customization and Other Use Cases

To use this code to hide additional items or different item adjust the strings checked in item.command.title or item.caption to hide or rename other menu items. Console logging the args.settings.items array temporarily can be used to find the appropriate title and caption strings.The conditionals can be modified as needed to only apply the function to a particular menu. The same beforemenu event can be used to modify Sisense menus as needed in Sisense scripts and plugins. 


The plugin is downloadable below.

 

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:
Version history
Last update:
‎02-07-2025 11:00 AM
Updated by:
Contributors