visibleActions: [Action.Save,Action.ShowUnderlyingData,Action.Download,Action.DownloadAsCSV,Action.Pin]
Customize menus
ThoughtSpot visualizations, Liveboards, and saved search answers support several actions and menu commands for various user-initiated operations. These actions appear as primary buttons, or as menu commands in More or contextual menu. When you embed a ThoughtSpot Liveboard, visualization, or the entire application experience in another app, these actions will be available to all users by default. However, your application users may not require all the available menu actions, or you might want to restrict access to certain features.
With Visual Embed SDK APIs, you can define a set of actions that your application users can access and use. The Visual Embed SDK packages support the following APIs to configure the visibility and availability of actions:
- visibleActions
-
Allows you to define a list of actions that can be made visible to your application users. If your embedded instance requires only a few actions, you can use the
visibleActions
API to add only those actions to the embedded UI. - disabledActions
-
Allows you to define a list of actions that will appear as disabled in the UI. You can also specify a reason for disabling the action. For example, your application user may require a specific privilege to schedule a Liveboard job, so you may want to disable this action and specify a reason, such as
Contact your administrator to enable this feature
. - hiddenActions
-
Allows you to hide the actions that you donβt want your users to see. If your embedded instance requires most of the actions, and you need to hide a few, you can use this API to hide only those actions.
Note
|
ThoughtSpot automatically assigns an action ID based on the name you assign to a custom action. For example, if you set the name of a custom action as |
Configuration recommendationsπ
-
Use
visibleActions
when you want to show only a small subset of actions in the embedded ThoughtSpot UI. -
The SDK doesnβt support configuring both
visibleActions
andhiddenActions
. Before you definevisibleActions
, make sure there are no hidden actions configured. -
If you want to show all menu actions to your users and hide only a few, use the
hiddenActions
attribute to hide these actions. -
If you are configuring
visibleActions
in the AppEmbed SDK package, make sure to include all the actions that you want to show on Liveboards, Visualizations, and the Saved Answers page. -
Use the appropriate action string to show or hide a UI action. For a comprehensive list of UI actions and the action strings in the SDK, see Supported actions.
Define visible actionsπ
The Visual Embed SDK packages support the visibleActions
attribute, which allows you to define an array of action strings.
For example, if you set the attribute as:
Only the actions specified in the visibleActions
attribute will appear in the embedded UI. The embedded application users can access and use the Save, Show underlying data, Download as CSV, and Pin menu actions.
If the visibleActions
attribute is set as an empty array, no actions will appear in the embedded UI.
visibleActions: []
If you set both visibleActions
and disabledActions
attributes as empty arrays, no actions will be visible in the embedded UI:
visibleActions: []
disabledActions: []
If you specify some action strings in both visibleActions
and disabledActions
attributes, the specified menu actions will appear in the embedded UI. However, users will not be able to access the actions set as disabledActions
.
In the following example, the Download, Save, Share, and Pin actions are defined as visible actions and therefore will be visible in the embedded UI. However, the Download menu action will be disabled.
visibleActions: [Action.Download,Action.Save,Action.Share,Action.Pin]
disabledActions: [Action.Download]
If you specify some action strings in the visibleActions
attribute and define hiddenActions
as an empty array, only the actions that are configured to be visible will appear in the embedded UI.
visibleActions: [Action.DownloadAsPDF,Action.DownloadAsCSV,Action.Save,Action.ShowUnderlyingData,Action.Pin]
hiddenActions: []
If the visibleActions
attribute is set as an empty array and the action strings are specified in the hiddenActions
attribute, the visibleActions
definition takes precedence. Therefore, no actions will appear in the embedded UI.
visibleActions: []
hiddenActions: [Action.DownloadAsPDF,Action.DownloadAsCSV]
If both visibleActions
and hiddenActions
attributes are defined, the SDK will return a configuration error.
visibleActions: [Action.DownloadAsPDF,Action.DownloadAsCSV,Action.Save,Action.ShowUnderlyingData,Action.Pin]
hiddenActions: [Action.DownloadAsPDF,Action.DownloadAsCSV]
If both visibleActions
and hiddenActions
attributes are defined as an empty array, the visibleActions
definition takes precedence and no actions will appear in the embedded UI.
visibleActions: []
hiddenActions: []
Disable actionsπ
If you want to restrict user access to certain actions in the embedded ThoughtSpot Liveboard, visualization, or search results page, you can disable these actions in the embed config view.
The disabledActions
attribute in the Visual Embed SDK allows you to specify one or several actions and disable these actions on a Liveboard, Answer, or visualization page.
For example, to disable the Show underlying data action from the More menu , you can specify the ShowUnderlyingData
action string in the disabledActions
attribute.
disabledActions: [Action.ShowUnderlyingData]
Similarly, to disable multiple actions, you can specify the action strings in the disabledActions
attribute.
disabledActions: [Action.AddFilter,Action.Present]
Disable a custom actionπ
ThoughtSpot allows you to create custom actions for your embedded instance in the Developer portal. If you want to disable a custom action, you can specify the ID of the custom action in the disabledActions
attribute.
For example, if a custom action is labeled as Send Email and its ID is set as send-email, specify send-email
in the disabledActions
attribute.
disabledActions: ['send-email']
Add a tooltip for disabled attributesπ
To add a tooltip for the disabled attribute, you can specify the message text string in the disabledActionReason
attribute.
disabledActionReason: "Contact your administrator to enable this action"
Hide actionsπ
The Visual Embed SDK allows you to hide specific actions that you may not want to show in the embedded UI. From the list of available actions, you can either define a list of visible actions using the visibleActions
attribute or hide specific actions that your application may not require using the hiddenActions
attribute. Configuring actions in both visibleActions
and hiddenActions
attributes leads to an error in embedded content rendition.
For example, if you want to hide only the Download and Pin actions for an embedded visualization and show all other actions, specify the attribute as shown here:
hiddenActions: [Action.Download,Action.Pin]
Hide a custom actionπ
To hide a custom action, specify the ID of the custom action in the disabledActions
attribute.
For example, if a custom action is labeled as Send Email and its ID is set as send-email, specify send-email
in the hiddenActions
attribute.
hiddenActions: ['send-email']