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
16 changes: 16 additions & 0 deletions src/embed/ts-embed.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
import {
Action, HomeLeftNavItem, RuntimeFilter, RuntimeFilterOp, HomepageModule, HostEvent,
RuntimeParameter,
Param,
} from '../types';
import {
executeAfterWait,
Expand All @@ -24,6 +25,7 @@ import {
defaultParamsForPinboardEmbed,
waitFor,
expectUrlMatchesWithParams,
expectUrlToHaveParamsWithValues,
mockMessageChannel,
createRootEleForEmbed,
} from '../test/test-utils';
Expand Down Expand Up @@ -1407,6 +1409,20 @@ describe('Unit test case for ts embed', () => {
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&numberFormatLocale=en-US&dateFormatLocale=en-IN&currencyFormat=USD${defaultParamsPost}#/home`,
);
});
it.skip('Sets the overrideOrgId param', async () => {
const overrideOrgId = 142536;
const appEmbed = new AppEmbed(getRootEl(), {
frameParams: {
width: '100%',
height: '100%',
},
overrideOrgId,
});
await appEmbed.render();
expectUrlToHaveParamsWithValues(getIFrameSrc(), {
orgId: overrideOrgId,
});
});
});

describe('When destroyed', () => {
Expand Down
4 changes: 4 additions & 0 deletions src/embed/ts-embed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ export class TsEmbed {
linkOverride,
insertInToSlide,
disableRedirectionLinksInNewTab,
overrideOrgId,
} = this.viewConfig;

if (Array.isArray(visibleActions) && Array.isArray(hiddenActions)) {
Expand Down Expand Up @@ -503,6 +504,9 @@ export class TsEmbed {
if (disableRedirectionLinksInNewTab) {
queryParams[Param.DisableRedirectionLinksInNewTab] = disableRedirectionLinksInNewTab;
}
if (overrideOrgId !== undefined) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add UTs

queryParams[Param.OverrideOrgId] = overrideOrgId;
}

queryParams[Param.OverrideNativeConsole] = true;
queryParams[Param.ClientLogLevel] = this.embedConfig.logLevel;
Expand Down
14 changes: 14 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1066,6 +1066,19 @@ export interface ViewConfig {
* ```
*/
enableCustomColumnGroups?: boolean;
/**
* View content for another org directly without having to use the org switcher
* This flag is honoured if orgPerUrl feature is enabled for the ThoughtSpot cluster
* @example
* ```js
* const embed = new LiveboardEmbed('#embed', {
* ... // other options
* overrideOrgId: 142536
* });
* ```
* @version SDK: 1.35.0 | ThoughtSpot: 10.5.0.cl
*/
overrideOrgId?: number;
}

/**
Expand Down Expand Up @@ -3262,6 +3275,7 @@ export enum Param {
LiveboardHeaderV2 = 'isLiveboardHeaderV2Enabled',
SpotterEnabled = 'isSpotterExperienceEnabled',
IsUnifiedSearchExperienceEnabled = 'isUnifiedSearchExperienceEnabled',
OverrideOrgId = 'orgId',
}

/**
Expand Down
Loading