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
17 changes: 17 additions & 0 deletions src/embed/liveboard.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
54 changes: 54 additions & 0 deletions src/embed/liveboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down Expand Up @@ -399,6 +438,9 @@ export class LiveboardEmbed extends V1Embed {
enable2ColumnLayout,
dataPanelV2 = false,
enableCustomColumnGroups = false,
oAuthPollingInterval,
isForceRedirect,
dataSourceId,
} = this.viewConfig;

const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3316,6 +3316,9 @@ export enum Param {
IsUnifiedSearchExperienceEnabled = 'isUnifiedSearchExperienceEnabled',
OverrideOrgId = 'orgId',
EnableFlipTooltipToContextMenu = 'flipTooltipToContextMenuEnabled',
OauthPollingInterval = 'oAuthPollingInterval',
IsForceRedirect = 'isForceRedirect',
DataSourceId = 'dataSourceId',
}

/**
Expand Down
Loading