Skip to content

Commit ecc671e

Browse files
SCAL-274111 Add hideTagFilterChips option to AppEmbed for cleaner UI (#324)
1 parent 6a522e9 commit ecc671e

File tree

4 files changed

+1076
-970
lines changed

4 files changed

+1076
-970
lines changed

src/embed/app.spec.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,51 @@ describe('App embed tests', () => {
430430
});
431431
});
432432

433+
test('Should add the hideTagFilterChips true to the iframe src', async () => {
434+
const appEmbed = new AppEmbed(getRootEl(), {
435+
...defaultViewConfig,
436+
showPrimaryNavbar: false,
437+
hideTagFilterChips: true,
438+
} as AppViewConfig);
439+
440+
appEmbed.render();
441+
await executeAfterWait(() => {
442+
expectUrlMatchesWithParams(
443+
getIFrameSrc(),
444+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}&hideTagFilterChips=true${defaultParamsPost}#/home`,
445+
);
446+
});
447+
});
448+
449+
test('Should add the hideTagFilterChips false to the iframe src', async () => {
450+
const appEmbed = new AppEmbed(getRootEl(), {
451+
...defaultViewConfig,
452+
showPrimaryNavbar: false,
453+
hideTagFilterChips: false,
454+
} as AppViewConfig);
455+
appEmbed.render();
456+
await executeAfterWait(() => {
457+
expectUrlMatchesWithParams(
458+
getIFrameSrc(),
459+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}&hideTagFilterChips=false${defaultParamsPost}#/home`,
460+
);
461+
});
462+
});
463+
464+
test('Should not add hideTagFilterChips if it is undefined', async () => {
465+
const appEmbed = new AppEmbed(getRootEl(), {
466+
...defaultViewConfig,
467+
showPrimaryNavbar: false,
468+
} as AppViewConfig);
469+
appEmbed.render();
470+
await executeAfterWait(() => {
471+
expectUrlMatchesWithParams(
472+
getIFrameSrc(),
473+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/home`,
474+
);
475+
});
476+
});
477+
433478
test('Should add enableSearchAssist flagto the iframe src', async () => {
434479
const appEmbed = new AppEmbed(getRootEl(), {
435480
...defaultViewConfig,

src/embed/app.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,26 @@ export interface AppViewConfig extends AllEmbedViewConfig {
367367
* ```
368368
*/
369369
tag?: string;
370+
/**
371+
* Hide tag filter chips that appear when content is filtered by tags.
372+
* When enabled, this automatically:
373+
* - Hides tag filter indicators/chips from the UI
374+
*
375+
* This provides a clean interface without tag-related UI elements.
376+
*
377+
* Supported embed types: `AppEmbed`
378+
* @version SDK: 1.44.0 | ThoughtSpot: 10.15.0.cl
379+
* @example
380+
* ```js
381+
* // Simple usage - automatically hides all tag-related UI
382+
* const embed = new AppEmbed('#tsEmbed', {
383+
* ... // other embed view config
384+
* tag: 'Some Tag',
385+
* hideTagFilterChips: true, // This is all you need!
386+
* });
387+
* ```
388+
*/
389+
hideTagFilterChips?: boolean;
370390
/**
371391
* The array of GUIDs to be hidden
372392
*
@@ -625,6 +645,7 @@ export class AppEmbed extends V1Embed {
625645
protected getEmbedParams() {
626646
const {
627647
tag,
648+
hideTagFilterChips,
628649
hideObjects,
629650
liveboardV2,
630651
showPrimaryNavbar,
@@ -750,6 +771,10 @@ export class AppEmbed extends V1Embed {
750771
if (isPNGInScheduledEmailsEnabled !== undefined) {
751772
params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
752773
}
774+
775+
if (hideTagFilterChips !== undefined) {
776+
params[Param.HideTagFilterChips] = hideTagFilterChips;
777+
}
753778

754779
if (isLinkParametersEnabled !== undefined) {
755780
params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;

src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4261,6 +4261,7 @@ export enum Param {
42614261
HideResult = 'hideResult',
42624262
UseLastSelectedDataSource = 'useLastSelectedSources',
42634263
Tag = 'tag',
4264+
HideTagFilterChips = 'hideTagFilterChips',
42644265
AutoLogin = 'autoLogin',
42654266
searchTokenString = 'searchTokenString',
42664267
executeSearch = 'executeSearch',

0 commit comments

Comments
 (0)