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

test('Should add the hideTagFilterChips true to the iframe src', async () => {
const appEmbed = new AppEmbed(getRootEl(), {
...defaultViewConfig,
showPrimaryNavbar: false,
hideTagFilterChips: true,
} as AppViewConfig);

appEmbed.render();
await executeAfterWait(() => {
expectUrlMatchesWithParams(
getIFrameSrc(),
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}&hideTagFilterChips=true${defaultParamsPost}#/home`,
);
});
});

test('Should add the hideTagFilterChips false to the iframe src', async () => {
const appEmbed = new AppEmbed(getRootEl(), {
...defaultViewConfig,
showPrimaryNavbar: false,
hideTagFilterChips: false,
} as AppViewConfig);
appEmbed.render();
await executeAfterWait(() => {
expectUrlMatchesWithParams(
getIFrameSrc(),
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}&hideTagFilterChips=false${defaultParamsPost}#/home`,
);
});
});

test('Should not add hideTagFilterChips if it is undefined', async () => {
const appEmbed = new AppEmbed(getRootEl(), {
...defaultViewConfig,
showPrimaryNavbar: false,
} as AppViewConfig);
appEmbed.render();
await executeAfterWait(() => {
expectUrlMatchesWithParams(
getIFrameSrc(),
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/home`,
);
});
});

test('Should add enableSearchAssist flagto the iframe src', async () => {
const appEmbed = new AppEmbed(getRootEl(), {
...defaultViewConfig,
Expand Down
25 changes: 25 additions & 0 deletions src/embed/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,26 @@ export interface AppViewConfig extends AllEmbedViewConfig {
* ```
*/
tag?: string;
/**
* Hide tag filter chips that appear when content is filtered by tags.
* When enabled, this automatically:
* - Hides tag filter indicators/chips from the UI
*
* This provides a clean interface without tag-related UI elements.
*
* Supported embed types: `AppEmbed`
* @version SDK: 1.44.0 | ThoughtSpot: 10.15.0.cl
* @example
* ```js
* // Simple usage - automatically hides all tag-related UI
* const embed = new AppEmbed('#tsEmbed', {
* ... // other embed view config
* tag: 'Some Tag',
* hideTagFilterChips: true, // This is all you need!
* });
* ```
*/
hideTagFilterChips?: boolean;
/**
* The array of GUIDs to be hidden
*
Expand Down Expand Up @@ -625,6 +645,7 @@ export class AppEmbed extends V1Embed {
protected getEmbedParams() {
const {
tag,
hideTagFilterChips,
hideObjects,
liveboardV2,
showPrimaryNavbar,
Expand Down Expand Up @@ -750,6 +771,10 @@ export class AppEmbed extends V1Embed {
if (isPNGInScheduledEmailsEnabled !== undefined) {
params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
}

if (hideTagFilterChips !== undefined) {
params[Param.HideTagFilterChips] = hideTagFilterChips;
}

if (isLinkParametersEnabled !== undefined) {
params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4261,6 +4261,7 @@ export enum Param {
HideResult = 'hideResult',
UseLastSelectedDataSource = 'useLastSelectedSources',
Tag = 'tag',
HideTagFilterChips = 'hideTagFilterChips',
AutoLogin = 'autoLogin',
searchTokenString = 'searchTokenString',
executeSearch = 'executeSearch',
Expand Down
Loading
Loading