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

test('Should add homepageVersion=v4 when homePage is Focused to the iframe src', async () => {
test('Should add homepageVersion=v4 and updatedSpotterChatPrompt=true when homePage is Focused to the iframe src', async () => {
await testUrlParams(
{
...defaultViewConfig,
discoveryExperience: {
homePage: HomePage.Focused,
},
} as AppViewConfig,
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&navigationVersion=v2&homepageVersion=v4${defaultParams}${defaultParamsPost}#/home`,
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&navigationVersion=v2&homepageVersion=v4&updatedSpotterChatPrompt=true${defaultParams}${defaultParamsPost}#/home`,
);
});

test('Should respect explicit updatedSpotterChatPrompt=false even when homePage is Focused', async () => {
await testUrlParams(
{
...defaultViewConfig,
discoveryExperience: {
homePage: HomePage.Focused,
},
updatedSpotterChatPrompt: false,
} as AppViewConfig,
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false&navigationVersion=v2&homepageVersion=v4&updatedSpotterChatPrompt=false${defaultParams}${defaultParamsPost}#/home`,
);
});

Expand Down
6 changes: 6 additions & 0 deletions src/embed/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@
* ```
*/
isContinuousLiveboardPDFEnabled?: boolean;

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

View workflow job for this annotation

GitHub Actions / build

Comments may not exceed 90 characters
/**
* This flag is used to enable/disable the XLSX/CSV download option for Liveboards
*
Expand Down Expand Up @@ -1142,6 +1142,12 @@

if (discoveryExperience.homePage === HomePage.Focused) {
params[Param.HomepageVersion] = HomePage.Focused;
// The Focused (V4) homepage experience requires the updated
// Spotter chat prompt. Enable it automatically unless the
// developer has explicitly set updatedSpotterChatPrompt.
if (isUndefined(updatedSpotterChatPrompt)) {
params[Param.UpdatedSpotterChatPrompt] = true;
}
}
}

Expand Down Expand Up @@ -1231,7 +1237,7 @@
private getPageRoute(pageId: Page, modularHomeExperience = false) {
switch (pageId) {
case Page.Search:
return 'answer';

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

View workflow job for this annotation

GitHub Actions / build

Comments may not exceed 80 characters
case Page.Answers:
return modularHomeExperience ? 'home/answers' : 'answers';
case Page.Liveboards:
Expand Down
Loading