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
16 changes: 16 additions & 0 deletions src/embed/app.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,22 @@ describe('App embed tests', () => {
});
});

test('should set isSpotterErrorBannersEnabled to true in url via spotterChatConfig', async () => {
const appEmbed = new AppEmbed(getRootEl(), {
...defaultViewConfig,
spotterChatConfig: {
isSpotterErrorBannersEnabled: true,
},
} as AppViewConfig);
appEmbed.render();
await executeAfterWait(() => {
expectUrlMatchesWithParams(
getIFrameSrc(),
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isSpotterErrorBannersEnabled=true${defaultParamsPost}#/home`,
);
});
});

test('should set isLiveboardXLSXCSVDownloadEnabled to false in url', async () => {
const appEmbed = new AppEmbed(getRootEl(), {
...defaultViewConfig,
Expand Down
2 changes: 2 additions & 0 deletions src/embed/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@
isPNGInScheduledEmailsEnabled?: boolean;

/**
* Enables the 'what you see is what you get' PDF export for Liveboards. Each tab is rendered on a single page

Check warning on line 599 in src/embed/app.ts

View workflow job for this annotation

GitHub Actions / build

Comments may not exceed 90 characters
* following the exact UI layout, instead of splitting visualizations across multiple A4 pages.
* This feature is GA from version 26.5.0.cl. It is disabled by default in embed deployments.
*
Expand Down Expand Up @@ -965,10 +965,12 @@
const {
hideToolResponseCardBranding,
toolResponseCardBrandingLabel,
isSpotterErrorBannersEnabled,
} = spotterChatConfig;

setParamIfDefined(params, Param.HideToolResponseCardBranding, hideToolResponseCardBranding, true);
setParamIfDefined(params, Param.ToolResponseCardBrandingLabel, toolResponseCardBrandingLabel);
setParamIfDefined(params, Param.IsSpotterErrorBannersEnabled, isSpotterErrorBannersEnabled, true);
}

if (hideObjectSearch) {
Expand Down Expand Up @@ -1143,7 +1145,7 @@

private sendFullHeightLazyLoadData = () => {
const data = calculateVisibleElementData(this.iFrame);
// this should be fired only if the lazyLoadingForFullHeight and fullHeight are true

Check warning on line 1148 in src/embed/app.ts

View workflow job for this annotation

GitHub Actions / build

Comments may not exceed 80 characters
if(this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight){
this.trigger(HostEvent.VisibleEmbedCoordinates, data);
}
Expand Down
19 changes: 19 additions & 0 deletions src/embed/conversation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,25 @@ describe('ConversationEmbed', () => {
);
});

it('should set isSpotterErrorBannersEnabled to true in url via spotterChatConfig', async () => {
const viewConfig: SpotterEmbedViewConfig = {
worksheetId: 'worksheetId',
searchOptions: {
searchQuery: 'searchQuery',
},
spotterChatConfig: {
isSpotterErrorBannersEnabled: true,
},
};

const conversationEmbed = new SpotterEmbed(getRootEl(), viewConfig);
await conversationEmbed.render();
expectUrlMatchesWithParams(
getIFrameSrc(),
`http://${thoughtSpotHost}/v2/?${defaultParams}&isSpotterExperienceEnabled=true&isSpotterErrorBannersEnabled=true#/embed/insights/conv-assist?worksheet=worksheetId&query=searchQuery`,
);
});

it('should ensure deprecated ConversationEmbed class maintains same functionality as SpotterEmbed', async () => {
const viewConfig: SpotterEmbedViewConfig = {
worksheetId: 'worksheetId',
Expand Down
18 changes: 18 additions & 0 deletions src/embed/conversation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,22 @@ export interface SpotterChatViewConfig {
* External MCP tool branding is not affected.
*/
toolResponseCardBrandingLabel?: string;
/**
* Enables the new Spotter error banner UI (bucketed
* error handling with RETRY / REFRESH / NEW_CHAT /
* SUPPORT actions) inside the embedded context.
*
* When false (default), Spotter falls back to the
* legacy error display so existing embed integrations
* are not affected. Set to true to opt in to the
* new error handling experience.
*
* Supported embed types: SpotterEmbed, AppEmbed,
* LiveboardEmbed
* @version SDK: 1.49.0 | ThoughtSpot Cloud: 26.6.0.cl
* @default false
*/
isSpotterErrorBannersEnabled?: boolean;
Comment thread
animesh935 marked this conversation as resolved.
}

/**
Expand Down Expand Up @@ -450,10 +466,12 @@ export class SpotterEmbed extends TsEmbed {
const {
hideToolResponseCardBranding,
toolResponseCardBrandingLabel,
isSpotterErrorBannersEnabled,
} = spotterChatConfig;

setParamIfDefined(queryParams, Param.HideToolResponseCardBranding, hideToolResponseCardBranding, true);
setParamIfDefined(queryParams, Param.ToolResponseCardBrandingLabel, toolResponseCardBrandingLabel);
setParamIfDefined(queryParams, Param.IsSpotterErrorBannersEnabled, isSpotterErrorBannersEnabled, true);
}

return queryParams;
Expand Down
17 changes: 17 additions & 0 deletions src/embed/liveboard.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1329,6 +1329,23 @@ describe('Liveboard/viz embed tests', () => {
});
});

test('should set isSpotterErrorBannersEnabled parameter in url params via spotterChatConfig', async () => {
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
...defaultViewConfig,
liveboardId,
spotterChatConfig: {
isSpotterErrorBannersEnabled: true,
},
} as LiveboardViewConfig);
await liveboardEmbed.render();
await executeAfterWait(() => {
expectUrlMatchesWithParams(
getIFrameSrc(),
`http://${thoughtSpotHost}/?embedApp=true${defaultParams}${prefixParams}&isSpotterErrorBannersEnabled=true#/embed/viz/${liveboardId}`,
);
});
});

test('SetActiveTab Hostevent should not trigger the navigate event with the correct path, for vizEmbed', async () => {
const mockProcessTrigger = jest.spyOn(tsEmbed.TsEmbed.prototype, 'trigger');
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
Expand Down
2 changes: 2 additions & 0 deletions src/embed/liveboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@
*/
isPNGInScheduledEmailsEnabled?: boolean;
/**
* Enables the 'what you see is what you get' PDF export for Liveboards. Each tab is rendered on a single page

Check warning on line 391 in src/embed/liveboard.ts

View workflow job for this annotation

GitHub Actions / build

Comments may not exceed 90 characters
* following the exact UI layout, instead of splitting visualizations across multiple A4 pages.
* This feature is GA from version 26.5.0.cl. It is disabled by default in embed deployments.
*
Expand Down Expand Up @@ -735,10 +735,12 @@
const {
hideToolResponseCardBranding,
toolResponseCardBrandingLabel,
isSpotterErrorBannersEnabled,
} = spotterChatConfig;

setParamIfDefined(params, Param.HideToolResponseCardBranding, hideToolResponseCardBranding, true);
setParamIfDefined(params, Param.ToolResponseCardBrandingLabel, toolResponseCardBrandingLabel);
setParamIfDefined(params, Param.IsSpotterErrorBannersEnabled, isSpotterErrorBannersEnabled, true);
}

if (isLinkParametersEnabled !== undefined) {
Expand Down Expand Up @@ -826,7 +828,7 @@

private sendFullHeightLazyLoadData = () => {
const data = calculateVisibleElementData(this.iFrame);
// this should be fired only if the lazyLoadingForFullHeight and fullHeight are true

Check warning on line 831 in src/embed/liveboard.ts

View workflow job for this annotation

GitHub Actions / build

Comments may not exceed 80 characters
if(this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight){
this.trigger(HostEvent.VisibleEmbedCoordinates, data);
}
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@
* 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.

Check warning on line 966 in src/types.ts

View workflow job for this annotation

GitHub Actions / build

Comments may not exceed 90 characters
*
* 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 @@ -5955,6 +5955,7 @@
IsThisPeriodInDateFiltersEnabled = 'isThisPeriodInDateFiltersEnabled',
HideToolResponseCardBranding = 'hideToolResponseCardBranding',
ToolResponseCardBrandingLabel = 'toolResponseCardBrandingLabel',
IsSpotterErrorBannersEnabled = 'isSpotterErrorBannersEnabled',
EnableHomepageAnnouncement = 'enableHomepageAnnouncement',
EnableLiveboardDataCache = 'enableLiveboardDataCache',
}
Expand Down
Loading