Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions src/embed/conversation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,12 @@ describe('ConversationEmbed', () => {
['SpotterChatConnectorResources', Action.SpotterChatConnectorResources],
['SpotterChatConnectors', Action.SpotterChatConnectors],
['SpotterChatModeSwitcher', Action.SpotterChatModeSwitcher],
['SpotterAnalystShare', Action.SpotterAnalystShare],
['SpotterAnalystEdit', Action.SpotterAnalystEdit],
['SpotterAnalystCreate', Action.SpotterAnalystCreate],
['SpotterAnalystDelete', Action.SpotterAnalystDelete],
['SpotterAnalystMakeACopy', Action.SpotterAnalystMakeACopy],
['SpotterAnalystSidebar', Action.SpotterAnalystSidebar],
])('should render with hiddenActions for %s', async (_, action) => {
const viewConfig: SpotterEmbedViewConfig = {
worksheetId: 'worksheetId',
Expand Down Expand Up @@ -503,6 +509,12 @@ describe('ConversationEmbed', () => {
['SpotterChatConnectorResources', Action.SpotterChatConnectorResources],
['SpotterChatConnectors', Action.SpotterChatConnectors],
['SpotterChatModeSwitcher', Action.SpotterChatModeSwitcher],
['SpotterAnalystShare', Action.SpotterAnalystShare],
['SpotterAnalystEdit', Action.SpotterAnalystEdit],
['SpotterAnalystCreate', Action.SpotterAnalystCreate],
['SpotterAnalystDelete', Action.SpotterAnalystDelete],
['SpotterAnalystMakeACopy', Action.SpotterAnalystMakeACopy],
['SpotterAnalystSidebar', Action.SpotterAnalystSidebar],
])('should render with disabledActions for %s', async (_, action) => {
const disabledReason = 'testing disabled reason';
const viewConfig: SpotterEmbedViewConfig = {
Expand Down Expand Up @@ -612,6 +624,26 @@ describe('SpotterEmbed APP_INIT embedParams', () => {
expect(response.data.embedParams).toBeUndefined();
});

it('should include spotterAnalystLabel in embedParams.spotterSidebarConfig when set', async () => {
const response = await getAppInitResponse({
worksheetId: 'ws1',
spotterSidebarConfig: {
spotterAnalystLabel: 'My Analyst',
},
});
expect(response.data.embedParams.spotterSidebarConfig.spotterAnalystLabel).toBe('My Analyst');
});

it('should include spotterAnalystsLabel in embedParams.spotterSidebarConfig when set', async () => {
const response = await getAppInitResponse({
worksheetId: 'ws1',
spotterSidebarConfig: {
spotterAnalystsLabel: 'My Analysts',
},
});
expect(response.data.embedParams.spotterSidebarConfig.spotterAnalystsLabel).toBe('My Analysts');
});

it('should call handleError and exclude spotterDocumentationUrl from embedParams when URL is invalid', async () => {
const embed = new SpotterEmbed(getRootEl(), {
worksheetId: 'ws1',
Expand Down
12 changes: 12 additions & 0 deletions src/embed/conversation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,18 @@ export interface SpotterSidebarViewConfig {
* @version SDK: 1.47.0 | ThoughtSpot: 26.4.0.cl
*/
spotterNewChatButtonTitle?: string;
/**
* Custom label text for the Spotter Analyst section in the sidebar.
* @version SDK: 1.51.0 | ThoughtSpot: 26.8.0.cl
* @default Analyst
*/
Comment thread
bahetirisabh marked this conversation as resolved.
spotterAnalystLabel?: string;
/**
* Custom label text for the Spotter Analysts section in the sidebar.
* @version SDK: 1.51.0 | ThoughtSpot: 26.8.0.cl
* @default Analysts
*/
spotterAnalystsLabel?: string;
}

/**
Expand Down
81 changes: 75 additions & 6 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,8 @@ export interface BaseViewConfig extends ApiInterceptFlags {
* The list of actions to completely remove from the embedded view.
* Hidden actions are not visible to the user at all (fully removed from the UI).
* Use this when you want to remove an action entirely.
* To keep an action visible but non-interactive (grayed out), use {@link disabledActions} instead.
* To keep an action visible but non-interactive (grayed out), use {@link
Comment thread
bahetirisabh marked this conversation as resolved.
* disabledActions} instead.
*
* Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SearchEmbed`, `SpotterAgentEmbed`, `SpotterEmbed`, `SearchBarEmbed`
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
Expand All @@ -983,7 +984,8 @@ export interface BaseViewConfig extends ApiInterceptFlags {
* (...), and the contextual menu. These will be only actions that
* are visible to the user.
* Use this as an allowlist — only the actions listed here will be shown.
* All other actions will be hidden. Use either this or {@link hiddenActions}, not both.
* All other actions will be hidden. Use either this or {@link hiddenActions}, not
* both.
*
* Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SearchEmbed`, `SpotterAgentEmbed`, `SpotterEmbed`, `SearchBarEmbed`
* @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
Expand Down Expand Up @@ -3721,10 +3723,11 @@ export enum EmbedEvent {
EmbedPageContextChanged = 'EmbedPageContextChanged',

/**
* Represents a special embed event that is triggered whenever any host event is subscribed.
* Represents a special embed event that is triggered whenever any host event is
* subscribed.
*
* You can listen to this event when you need to dispatch a host event during load or render,
* particularly in situations where timing issues may occur.
* You can listen to this event when you need to dispatch a host event during load or
* render, particularly in situations where timing issues may occur.
*
* @example
* ```js
Expand Down Expand Up @@ -7933,7 +7936,73 @@ export enum Action {
* ```
* @version SDK: 1.49.0 | ThoughtSpot Cloud: 26.6.0.cl
*/
RefreshLiveboardBrowserCache = 'refreshLiveboardBrowserCache',
RefreshLiveboardBrowserCache = 'refreshLiveboardBrowserCache',
/**
* Controls visibility and disable state of the share action
* in the Spotter Analyst interface.
* @version SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
* @example
* ```js
* hiddenActions: [Action.SpotterAnalystShare]
* disabledActions: [Action.SpotterAnalystShare]
* ```
*/
SpotterAnalystShare = 'spotterAnalystShare',
/**
* Controls visibility and disable state of the edit action
* in the Spotter Analyst interface.
* @version SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
* @example
* ```js
* hiddenActions: [Action.SpotterAnalystEdit]
* disabledActions: [Action.SpotterAnalystEdit]
* ```
*/
SpotterAnalystEdit = 'spotterAnalystEdit',
/**
* Controls visibility and disable state of the create action
* in the Spotter Analyst interface.
* @version SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
* @example
* ```js
* hiddenActions: [Action.SpotterAnalystCreate]
* disabledActions: [Action.SpotterAnalystCreate]
* ```
*/
SpotterAnalystCreate = 'spotterAnalystCreate',
/**
* Controls visibility and disable state of the delete action
* in the Spotter Analyst interface.
* @version SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
* @example
* ```js
* hiddenActions: [Action.SpotterAnalystDelete]
* disabledActions: [Action.SpotterAnalystDelete]
* ```
*/
SpotterAnalystDelete = 'spotterAnalystDelete',
/**
* Controls visibility and disable state of the make a copy action
* in the Spotter Analyst interface.
* @version SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
* @example
* ```js
* hiddenActions: [Action.SpotterAnalystMakeACopy]
* disabledActions: [Action.SpotterAnalystMakeACopy]
* ```
*/
SpotterAnalystMakeACopy = 'spotterAnalystMakeACopy',
/**
* Controls visibility and disable state of the sidebar
* in the Spotter Analyst interface.
* @version SDK: 1.51.0 | ThoughtSpot Cloud: 26.8.0.cl
* @example
* ```js
* hiddenActions: [Action.SpotterAnalystSidebar]
* disabledActions: [Action.SpotterAnalystSidebar]
* ```
*/
SpotterAnalystSidebar = 'spotterAnalystSidebar',
Comment thread
bahetirisabh marked this conversation as resolved.
}
export interface AnswerServiceType {
getAnswer?: (offset: number, batchSize: number) => any;
Expand Down