diff --git a/src/embed/liveboard.spec.ts b/src/embed/liveboard.spec.ts index 378c35ac..faf750f9 100644 --- a/src/embed/liveboard.spec.ts +++ b/src/embed/liveboard.spec.ts @@ -172,6 +172,23 @@ describe('Liveboard/viz embed tests', () => { }); }); + test('should enable viz oAuthPollingInterval true', async () => { + const liveboardEmbed = new LiveboardEmbed(getRootEl(), { + oAuthPollingInterval: 1000, + isForceRedirect: true, + dataSourceId: '12356', + ...defaultViewConfig, + liveboardId, + } as LiveboardViewConfig); + liveboardEmbed.render(); + await executeAfterWait(() => { + expectUrlMatchesWithParams( + getIFrameSrc(), + `http://${thoughtSpotHost}/?embedApp=true${defaultParams}&oAuthPollingInterval=1000&isForceRedirect=true&dataSourceId=12356${prefixParams}#/embed/viz/${liveboardId}`, + ); + }); + }); + test('should disable viz transformations when enableVizTransformations false', async () => { const liveboardEmbed = new LiveboardEmbed(getRootEl(), { enableVizTransformations: false, diff --git a/src/embed/liveboard.ts b/src/embed/liveboard.ts index f551eca1..17ebd9c3 100644 --- a/src/embed/liveboard.ts +++ b/src/embed/liveboard.ts @@ -338,6 +338,45 @@ export interface LiveboardViewConfig * ``` */ hideIrrelevantChipsInLiveboardTabs?: boolean; + + /** + * The Liveboard to run on regular intervals to fetch the cdw token. + * @hidden + * @version SDK: 1.35.0 | ThoughtSpot:10.6.0.cl + * @example + * ```js + * const embed = new LiveboardEmbed('#embed-container', { + * ... // other options + * oAuthPollingInterval: value in milliseconds, + * }) + */ + oAuthPollingInterval?: number; + + /** + * The Liveboard is set to force a token fetch during the initial load. + * @hidden + * @version SDK: 1.35.0 | ThoughtSpot:10.6.0.cl + * @example + * ```js + * const embed = new LiveboardEmbed('#embed-container', { + * ... // other options + * isForceRedirect: false, + * }) + */ + isForceRedirect?: boolean; + + /** + * The source connection ID for authentication. + * @hidden + * @version SDK: 1.35.0 | ThoughtSpot:10.6.0.cl + * @example + * ```js + * const embed = new LiveboardEmbed('#embed-container', { + * ... // other options + * dataSourceId: '', + * }) + */ + dataSourceId?: string; } /** @@ -399,6 +438,9 @@ export class LiveboardEmbed extends V1Embed { enable2ColumnLayout, dataPanelV2 = false, enableCustomColumnGroups = false, + oAuthPollingInterval, + isForceRedirect, + dataSourceId, } = this.viewConfig; const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval @@ -445,6 +487,18 @@ export class LiveboardEmbed extends V1Embed { params[Param.enableAskSage] = enableAskSage; } + if (oAuthPollingInterval !== undefined) { + params[Param.OauthPollingInterval] = oAuthPollingInterval; + } + + if (isForceRedirect) { + params[Param.IsForceRedirect] = isForceRedirect; + } + + if (dataSourceId !== undefined) { + params[Param.DataSourceId] = dataSourceId; + } + params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky; params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled; params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge; diff --git a/src/types.ts b/src/types.ts index 6d32dbf6..4d152bc0 100644 --- a/src/types.ts +++ b/src/types.ts @@ -3316,6 +3316,9 @@ export enum Param { IsUnifiedSearchExperienceEnabled = 'isUnifiedSearchExperienceEnabled', OverrideOrgId = 'orgId', EnableFlipTooltipToContextMenu = 'flipTooltipToContextMenuEnabled', + OauthPollingInterval = 'oAuthPollingInterval', + IsForceRedirect = 'isForceRedirect', + DataSourceId = 'dataSourceId', } /**