Skip to content

Commit d1583e6

Browse files
SCAL-243755 - New flag to set pendo help
1 parent 61caa0a commit d1583e6

4 files changed

Lines changed: 48 additions & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@thoughtspot/visual-embed-sdk",
3-
"version": "1.36.2",
3+
"version": "1.36.3",
44
"description": "ThoughtSpot Embed SDK",
55
"module": "lib/src/index.js",
66
"main": "dist/tsembed.js",

src/embed/app.spec.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,33 @@ describe('App embed tests', () => {
509509
});
510510
});
511511

512+
test('Should add enablePendoHelp flag to the iframe src conditional on navbar', async () => {
513+
const appEmbed = new AppEmbed(getRootEl(), {
514+
...defaultViewConfig,
515+
} as AppViewConfig);
516+
517+
appEmbed.render();
518+
await executeAfterWait(() => {
519+
expectUrlMatchesWithParams(
520+
getIFrameSrc(),
521+
`http://${thoughtSpotHost}/?enablePendoHelp=true&embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false${defaultParams}${defaultParamsPost}#/home`,
522+
);
523+
});
524+
525+
const noNavEmbed = new AppEmbed(getRootEl(), {
526+
...defaultViewConfig,
527+
enablePendoHelp: false,
528+
} as AppViewConfig);
529+
530+
noNavEmbed.render();
531+
await executeAfterWait(() => {
532+
expectUrlMatchesWithParams(
533+
getIFrameSrc(),
534+
`http://${thoughtSpotHost}/?enablePendoHelp=false&embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&modularHomeExperience=false${defaultParams}${defaultParamsPost}#/home`,
535+
);
536+
});
537+
});
538+
512539
test('Should add HomePageSearchBarMode flag with object search to the iframe src', async () => {
513540
const appEmbed = new AppEmbed(getRootEl(), {
514541
...defaultViewConfig,

src/embed/app.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,20 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
137137
* ```
138138
*/
139139
disableProfileAndHelp?: boolean;
140+
/**
141+
* @version SDK: 1.36.3 | ThoughtSpot: 10.1.0.cl
142+
* @default true
143+
* Whether the help menu in the top nav bar should be served
144+
* from Pendo or ThoughtSpot's internal help items.
145+
* @example
146+
* ```js
147+
* const embed = new AppEmbed('#tsEmbed', {
148+
* ... // other options
149+
* enablePendoHelp: false,
150+
* });
151+
* ```
152+
*/
153+
enablePendoHelp?: boolean
140154
/**
141155
* Control the visibility of the application switcher button on the nav-bar.
142156
* By default, the application switcher is shown.
@@ -526,6 +540,7 @@ export class AppEmbed extends V1Embed {
526540
hideIrrelevantChipsInLiveboardTabs = false,
527541
homePageSearchBarMode,
528542
isUnifiedSearchExperienceEnabled = true,
543+
enablePendoHelp = true,
529544
} = this.viewConfig;
530545

531546
let params = {};
@@ -583,6 +598,10 @@ export class AppEmbed extends V1Embed {
583598
params[Param.HomePageSearchBarMode] = homePageSearchBarMode;
584599
}
585600

601+
if (enablePendoHelp !== undefined) {
602+
params[Param.EnablePendoHelp] = enablePendoHelp;
603+
}
604+
586605
params[Param.DataPanelV2Enabled] = dataPanelV2;
587606
params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
588607
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;

src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3417,6 +3417,7 @@ export enum Param {
34173417
HostAppUrl = 'hostAppUrl',
34183418
EnableVizTransformations = 'enableVizTransform',
34193419
EnableSearchAssist = 'enableSearchAssist',
3420+
EnablePendoHelp = 'enablePendoHelp',
34203421
HideResult = 'hideResult',
34213422
UseLastSelectedDataSource = 'useLastSelectedSources',
34223423
Tag = 'tag',

0 commit comments

Comments
 (0)