diff --git a/src/embed/conversation.spec.ts b/src/embed/conversation.spec.ts index 411f9f8f..c3b00c06 100644 --- a/src/embed/conversation.spec.ts +++ b/src/embed/conversation.spec.ts @@ -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', @@ -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 = { @@ -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', diff --git a/src/embed/conversation.ts b/src/embed/conversation.ts index a9433602..80bddb09 100644 --- a/src/embed/conversation.ts +++ b/src/embed/conversation.ts @@ -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 + */ + 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; } /** diff --git a/src/types.ts b/src/types.ts index 8139de02..73909335 100644 --- a/src/types.ts +++ b/src/types.ts @@ -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 + * disabledActions} instead. * * Supported embed types: `AppEmbed`, `LiveboardEmbed`, `SearchEmbed`, `SpotterAgentEmbed`, `SpotterEmbed`, `SearchBarEmbed` * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw @@ -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 @@ -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 @@ -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', } export interface AnswerServiceType { getAnswer?: (offset: number, batchSize: number) => any;