Skip to content

Commit a88052e

Browse files
SCAL-265809 SDK flag to control LB filter UX v2 in TSE (#326)
1 parent 1a61268 commit a88052e

File tree

6 files changed

+1347
-1178
lines changed

6 files changed

+1347
-1178
lines changed

src/embed/app.spec.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,34 @@ describe('App embed tests', () => {
414414
});
415415
});
416416

417+
test('should set isCentralizedLiveboardFilterUXEnabled to true in url', async () => {
418+
const appEmbed = new AppEmbed(getRootEl(), {
419+
...defaultViewConfig,
420+
isCentralizedLiveboardFilterUXEnabled: true,
421+
} as AppViewConfig);
422+
appEmbed.render();
423+
await executeAfterWait(() => {
424+
expectUrlMatchesWithParams(
425+
getIFrameSrc(),
426+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=true${defaultParamsPost}#/home`,
427+
);
428+
});
429+
});
430+
431+
test('should set isCentralizedLiveboardFilterUXEnabled to false in url', async () => {
432+
const appEmbed = new AppEmbed(getRootEl(), {
433+
...defaultViewConfig,
434+
isCentralizedLiveboardFilterUXEnabled: false,
435+
} as AppViewConfig);
436+
appEmbed.render();
437+
await executeAfterWait(() => {
438+
expectUrlMatchesWithParams(
439+
getIFrameSrc(),
440+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isCentralizedLiveboardFilterUXEnabled=false${defaultParamsPost}#/home`,
441+
);
442+
});
443+
});
444+
417445
test('Should add the tag to the iframe src', async () => {
418446
const appEmbed = new AppEmbed(getRootEl(), {
419447
...defaultViewConfig,

src/embed/app.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,7 @@ export class AppEmbed extends V1Embed {
684684
liveboardXLSXCSVDownload = false,
685685
isLiveboardStylingAndGroupingEnabled,
686686
isPNGInScheduledEmailsEnabled = false,
687+
isCentralizedLiveboardFilterUXEnabled = false,
687688
isLinkParametersEnabled,
688689
} = this.viewConfig;
689690

@@ -780,6 +781,12 @@ export class AppEmbed extends V1Embed {
780781
params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
781782
}
782783

784+
if (isCentralizedLiveboardFilterUXEnabled != undefined) {
785+
params[
786+
Param.isCentralizedLiveboardFilterUXEnabled
787+
] = isCentralizedLiveboardFilterUXEnabled;
788+
}
789+
783790
params[Param.DataPanelV2Enabled] = dataPanelV2;
784791
params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
785792
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;

src/embed/liveboard.spec.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,36 @@ describe('Liveboard/viz embed tests', () => {
453453
});
454454
});
455455

456+
test('should add isCentralizedLiveboardFilterUXEnabled flag and set value to true to the iframe src', async () => {
457+
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
458+
...defaultViewConfig,
459+
liveboardId,
460+
isCentralizedLiveboardFilterUXEnabled: true,
461+
} as LiveboardViewConfig);
462+
liveboardEmbed.render();
463+
await executeAfterWait(() => {
464+
expectUrlMatchesWithParams(
465+
getIFrameSrc(),
466+
`http://${thoughtSpotHost}/?embedApp=true${defaultParams}&isCentralizedLiveboardFilterUXEnabled=true${prefixParams}#/embed/viz/${liveboardId}`,
467+
);
468+
});
469+
});
470+
471+
test('should add isCentralizedLiveboardFilterUXEnabled flag and set value to false to the iframe src', async () => {
472+
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
473+
...defaultViewConfig,
474+
liveboardId,
475+
isCentralizedLiveboardFilterUXEnabled: false,
476+
} as LiveboardViewConfig);
477+
liveboardEmbed.render();
478+
await executeAfterWait(() => {
479+
expectUrlMatchesWithParams(
480+
getIFrameSrc(),
481+
`http://${thoughtSpotHost}/?embedApp=true${defaultParams}&isCentralizedLiveboardFilterUXEnabled=false${prefixParams}#/embed/viz/${liveboardId}`,
482+
);
483+
});
484+
});
485+
456486
test('should not append runtime filters in URL if excludeRuntimeFiltersfromURL is true', async () => {
457487
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
458488
...defaultViewConfig,

src/embed/liveboard.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@ export class LiveboardEmbed extends V1Embed {
477477
isLiveboardStylingAndGroupingEnabled,
478478
isPNGInScheduledEmailsEnabled = false,
479479
showSpotterLimitations,
480+
isCentralizedLiveboardFilterUXEnabled = false,
480481
isLinkParametersEnabled,
481482
} = this.viewConfig;
482483

@@ -557,6 +558,12 @@ export class LiveboardEmbed extends V1Embed {
557558
params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
558559
}
559560

561+
if (isCentralizedLiveboardFilterUXEnabled !== undefined) {
562+
params[
563+
Param.isCentralizedLiveboardFilterUXEnabled
564+
] = isCentralizedLiveboardFilterUXEnabled;
565+
}
566+
560567
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
561568
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
562569
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;

src/types.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,6 +1512,24 @@ export interface LiveboardAppEmbedViewConfig {
15121512
* ```
15131513
*/
15141514
liveboardXLSXCSVDownload?: boolean;
1515+
/**
1516+
* This flag is used to enable or disable the new centralized Liveboard filter UX (v2).
1517+
* When enabled, a unified modal is used to manage and update multiple filters at once,
1518+
* replacing the older individual filter interactions.
1519+
* To enable this feature on your instance, contact ThoughtSpot Support.
1520+
*
1521+
* Supported embed types: `AppEmbed`, `LiveboardEmbed`
1522+
* @version SDK: 1.42.0 | ThoughtSpot: 10.15.0.cl
1523+
* @example
1524+
* ```js
1525+
* // Replace <EmbedComponent> with embed component name. For example, AppEmbed or LiveboardEmbed
1526+
* const embed = new <EmbedComponent>('#tsEmbed', {
1527+
* ... // other embed view config
1528+
* isCentralizedLiveboardFilterUXEnabled: true,
1529+
* })
1530+
* ```
1531+
*/
1532+
isCentralizedLiveboardFilterUXEnabled?: boolean;
15151533
/**
15161534
* This flag is used to enable or disable the link parameters in liveboard.
15171535
*
@@ -4366,6 +4384,7 @@ export enum Param {
43664384
RootMarginForLazyLoad = 'rootMarginForLazyLoad',
43674385
LiveboardXLSXCSVDownload = 'isLiveboardXLSXCSVDownloadEnabled',
43684386
isPNGInScheduledEmailsEnabled = 'isPNGInScheduledEmailsEnabled',
4387+
isCentralizedLiveboardFilterUXEnabled = 'isCentralizedLiveboardFilterUXEnabled',
43694388
isLinkParametersEnabled = 'isLinkParametersEnabled',
43704389
EnablePastConversationsSidebar = 'enablePastConversationsSidebar',
43714390
}

0 commit comments

Comments
 (0)