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

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

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

test('should set defaultQueryMode to research in url', async () => {
const appEmbed = new AppEmbed(getRootEl(), {
...defaultViewConfig,
Expand Down
19 changes: 19 additions & 0 deletions src/embed/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,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 621 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 @@ -737,6 +737,21 @@
* ```
*/
updatedSpotterChatPrompt?: boolean;
/**
* showSpotterRadiance : Controls the radiance on the Spotter page.
*
* Supported embed types: `AppEmbed`
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
* @default false
* @example
* ```js
* const embed = new AppEmbed('#tsEmbed', {
* ... //other embed view config
* showSpotterRadiance : true,
* })
* ```
*/
showSpotterRadiance?: boolean;
/**
* Sets the default query mode when Spotter loads — Fast Search or
* Research Mode. Applies fresh on every new session for this embed
Expand Down Expand Up @@ -1037,6 +1052,7 @@
isCentralizedLiveboardFilterUXEnabled = false,
isLinkParametersEnabled,
updatedSpotterChatPrompt,
showSpotterRadiance,
defaultQueryMode,
enableStopAnswerGenerationEmbed,
spotterChatConfig,
Expand Down Expand Up @@ -1077,6 +1093,9 @@
if (!isUndefined(updatedSpotterChatPrompt)) {
params[Param.UpdatedSpotterChatPrompt] = !!updatedSpotterChatPrompt;
}
if (!isUndefined(showSpotterRadiance)) {
params[Param.ShowSpotterRadiance] = !!showSpotterRadiance;
}
if (!isUndefined(defaultQueryMode)) {
params[Param.DefaultQueryMode] = defaultQueryMode;
}
Expand Down Expand Up @@ -1292,7 +1311,7 @@
this.iFrame,
this.viewConfig.enableScrollableContainerLazyLoading,
);
// this should be fired only if the lazyLoadingForFullHeight and fullHeight are true

Check warning on line 1314 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
32 changes: 32 additions & 0 deletions src/embed/conversation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,38 @@ describe('ConversationEmbed', () => {
);
});

it('should render the conversation embed with spotter radiance', async () => {
const viewConfig: SpotterEmbedViewConfig = {
worksheetId: 'worksheetId',
searchOptions: {
searchQuery: 'searchQuery',
},
showSpotterRadiance: true,
};
const conversationEmbed = new SpotterEmbed(getRootEl(), viewConfig);
await conversationEmbed.render();
expectUrlMatchesWithParams(
getIFrameSrc(),
`http://${thoughtSpotHost}/v2/?${defaultParams}&isSpotterExperienceEnabled=true&showSpotterRadiance=true#/embed/insights/conv-assist?worksheet=worksheetId&query=searchQuery`,
);
});

it('should render the conversation embed with spotter radiance disabled', async () => {
const viewConfig: SpotterEmbedViewConfig = {
worksheetId: 'worksheetId',
searchOptions: {
searchQuery: 'searchQuery',
},
showSpotterRadiance: false,
};
const conversationEmbed = new SpotterEmbed(getRootEl(), viewConfig);
await conversationEmbed.render();
expectUrlMatchesWithParams(
getIFrameSrc(),
`http://${thoughtSpotHost}/v2/?${defaultParams}&isSpotterExperienceEnabled=true&showSpotterRadiance=false#/embed/insights/conv-assist?worksheet=worksheetId&query=searchQuery`,
);
});

it('should render the conversation embed with default query mode set to research', async () => {
const viewConfig: SpotterEmbedViewConfig = {
worksheetId: 'worksheetId',
Expand Down
17 changes: 17 additions & 0 deletions src/embed/conversation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,21 @@ export interface SpotterEmbedViewConfig extends Omit<BaseViewConfig, 'primaryAct
* ```
*/
updatedSpotterChatPrompt?: boolean;
/**
* showSpotterRadiance : Controls the radiance on the Spotter page.
*
* Supported embed types: `SpotterEmbed`
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
* @default false
* @example
* ```js
* const embed = new SpotterEmbed('#tsEmbed', {
* ... //other embed view config
* showSpotterRadiance : true,
* })
* ```
*/
showSpotterRadiance?: boolean;
/**
* Sets the default query mode when Spotter loads — Fast Search or
* Research Mode. Applies fresh on every new session for this embed
Expand Down Expand Up @@ -661,6 +676,7 @@ export class SpotterEmbed extends TsEmbed {
runtimeParameters,
excludeRuntimeParametersfromURL,
updatedSpotterChatPrompt,
showSpotterRadiance,
defaultQueryMode,
enableStopAnswerGenerationEmbed,
spotterChatConfig,
Expand All @@ -684,6 +700,7 @@ export class SpotterEmbed extends TsEmbed {
setParamIfDefined(queryParams, Param.ShowSpotterLimitations, showSpotterLimitations, true);
setParamIfDefined(queryParams, Param.HideSampleQuestions, hideSampleQuestions, true);
setParamIfDefined(queryParams, Param.UpdatedSpotterChatPrompt, updatedSpotterChatPrompt, true);
setParamIfDefined(queryParams, Param.ShowSpotterRadiance, showSpotterRadiance, true);
setParamIfDefined(queryParams, Param.DefaultQueryMode, defaultQueryMode);
setParamIfDefined(queryParams, Param.EnableStopAnswerGenerationEmbed, enableStopAnswerGenerationEmbed, true);

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

test('should render the liveboard embed with showSpotterRadiance', async () => {
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
...defaultViewConfig,
liveboardId,
showSpotterRadiance: true,
} as LiveboardViewConfig);
await liveboardEmbed.render();
await executeAfterWait(() => {
expectUrlMatchesWithParams(
getIFrameSrc(),
`http://${thoughtSpotHost}/?embedApp=true${defaultParams}${prefixParams}&showSpotterRadiance=true#/embed/viz/${liveboardId}`,
);
});
});
test('should render the liveboard embed with showSpotterRadiance disabled', async () => {
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
...defaultViewConfig,
liveboardId,
showSpotterRadiance: false,
} as LiveboardViewConfig);
await liveboardEmbed.render();
await executeAfterWait(() => {
expectUrlMatchesWithParams(
getIFrameSrc(),
`http://${thoughtSpotHost}/?embedApp=true${defaultParams}${prefixParams}&showSpotterRadiance=false#/embed/viz/${liveboardId}`,
);
});
});

test('should set hideToolResponseCardBranding parameter in url params via spotterChatConfig', async () => {
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
...defaultViewConfig,
Expand Down
19 changes: 19 additions & 0 deletions src/embed/liveboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,21 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
* ```
*/
updatedSpotterChatPrompt?: boolean;
/**
* showSpotterRadiance : Controls the radiance on the Spotter page.
*
* Supported embed types: `LiveboardEmbed`
* @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
* @default false
* @example
* ```js
* const embed = new LiveboardEmbed('#tsEmbed', {
* ... //other embed view config
* showSpotterRadiance : true,
* })
* ```
*/
showSpotterRadiance?: boolean;
/**
* Enables the stop answer generation button in the Spotter embed UI,
* allowing users to interrupt an ongoing answer generation.
Expand Down Expand Up @@ -703,6 +718,7 @@ export class LiveboardEmbed extends V1Embed {
isCentralizedLiveboardFilterUXEnabled = false,
isLinkParametersEnabled,
updatedSpotterChatPrompt,
showSpotterRadiance,
enableStopAnswerGenerationEmbed,
spotterChatConfig,
isThisPeriodInDateFiltersEnabled,
Expand Down Expand Up @@ -732,6 +748,9 @@ export class LiveboardEmbed extends V1Embed {
if (!isUndefined(updatedSpotterChatPrompt)) {
params[Param.UpdatedSpotterChatPrompt] = !!updatedSpotterChatPrompt;
}
if (!isUndefined(showSpotterRadiance)) {
params[Param.ShowSpotterRadiance] = !!showSpotterRadiance;
}
if (!isUndefined(enableStopAnswerGenerationEmbed)) {
params[Param.EnableStopAnswerGenerationEmbed] = !!enableStopAnswerGenerationEmbed;
}
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6547,6 +6547,7 @@ export enum Param {
isLinkParametersEnabled = 'isLinkParametersEnabled',
EnablePastConversationsSidebar = 'enablePastConversationsSidebar',
UpdatedSpotterChatPrompt = 'updatedSpotterChatPrompt',
ShowSpotterRadiance = 'showSpotterRadiance',
DefaultQueryMode = 'defaultQueryMode',
EnableStopAnswerGenerationEmbed = 'enableStopAnswerGenerationEmbed',
SpotterSidebarTitle = 'spotterSidebarTitle',
Expand Down
Loading