Skip to content

Commit 3f6abdc

Browse files
chinmay-tsruchI9897
authored andcommitted
SCAL-277875 Added TSE flag isEnhancedFilterInteractivityEnabled (#333)
1 parent e643477 commit 3f6abdc

File tree

6 files changed

+3473
-3422
lines changed

6 files changed

+3473
-3422
lines changed

src/embed/app.spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,20 @@ describe('App embed tests', () => {
623623
});
624624
});
625625

626+
test('Should add isLiveboardPermissionV2Enabled flag to the iframe src', async () => {
627+
const appEmbed = new AppEmbed(getRootEl(), {
628+
...defaultViewConfig,
629+
isEnhancedFilterInteractivityEnabled: false,
630+
} as AppViewConfig);
631+
appEmbed.render();
632+
await executeAfterWait(() => {
633+
expectUrlMatchesWithParams(
634+
getIFrameSrc(),
635+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isLiveboardPermissionV2Enabled=false${defaultParams}${defaultParamsPost}#/home`,
636+
);
637+
});
638+
});
639+
626640
test('Should add default values of flags to the iframe src', async () => {
627641
const appEmbed = new AppEmbed(getRootEl(), {
628642
...defaultViewConfig,

src/embed/app.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,7 @@ export class AppEmbed extends V1Embed {
676676
showLiveboardVerifiedBadge = true,
677677
showLiveboardReverifyBanner = true,
678678
hideIrrelevantChipsInLiveboardTabs = false,
679+
isEnhancedFilterInteractivityEnabled = false,
679680
homePageSearchBarMode,
680681
isUnifiedSearchExperienceEnabled = true,
681682
enablePendoHelp = true,
@@ -699,6 +700,7 @@ export class AppEmbed extends V1Embed {
699700
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
700701
params[Param.IsFullAppEmbed] = true;
701702
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
703+
params[Param.IsEnhancedFilterInteractivityEnabled] = isEnhancedFilterInteractivityEnabled;
702704
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
703705
params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
704706
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;

src/embed/liveboard.spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,21 @@ describe('Liveboard/viz embed tests', () => {
183183
});
184184
});
185185

186+
test('should set isLiveboardPermissionV2Enabled to true in url', async () => {
187+
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
188+
isEnhancedFilterInteractivityEnabled: true,
189+
...defaultViewConfig,
190+
liveboardId,
191+
} as LiveboardViewConfig);
192+
liveboardEmbed.render();
193+
await executeAfterWait(() => {
194+
expectUrlMatchesWithParams(
195+
getIFrameSrc(),
196+
`http://${thoughtSpotHost}/?embedApp=true${defaultParams}&isLiveboardPermissionV2Enabled=true${prefixParams}#/embed/viz/${liveboardId}`,
197+
);
198+
});
199+
});
200+
186201
test('should set isPNGInScheduledEmailsEnabled to true in url', async () => {
187202
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
188203
isPNGInScheduledEmailsEnabled: true,

src/embed/liveboard.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@ export class LiveboardEmbed extends V1Embed {
465465
showLiveboardVerifiedBadge = true,
466466
showLiveboardReverifyBanner = true,
467467
hideIrrelevantChipsInLiveboardTabs = false,
468+
isEnhancedFilterInteractivityEnabled = false,
468469
enableAskSage,
469470
enable2ColumnLayout,
470471
dataPanelV2 = true,
@@ -569,6 +570,7 @@ export class LiveboardEmbed extends V1Embed {
569570
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
570571
params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
571572
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
573+
params[Param.IsEnhancedFilterInteractivityEnabled] = isEnhancedFilterInteractivityEnabled;
572574
params[Param.DataPanelV2Enabled] = dataPanelV2;
573575
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
574576
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;

src/types.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1545,7 +1545,22 @@ export interface LiveboardAppEmbedViewConfig {
15451545
* ```
15461546
*/
15471547
isLinkParametersEnabled?: boolean;
1548-
1548+
1549+
/**
1550+
* This flag is used to enable or disable the enhanced filter interactivity in liveboard.
1551+
*
1552+
* Supported embed types: `AppEmbed`, `LiveboardEmbed`
1553+
* @version SDK: 1.42.0 | ThoughtSpot: 10.15.0.cl
1554+
* @example
1555+
* ```js
1556+
* // Replace <EmbedComponent> with embed component name. For example, AppEmbed or LiveboardEmbed
1557+
* const embed = new <EmbedComponent>('#tsEmbed', {
1558+
* ... // other embed view config
1559+
* isEnhancedFilterInteractivityEnabled: true,
1560+
* })
1561+
* ```
1562+
*/
1563+
isEnhancedFilterInteractivityEnabled?: boolean;
15491564
}
15501565

15511566
export interface AllEmbedViewConfig extends BaseViewConfig, SearchLiveboardCommonViewConfig, HomePageConfig, LiveboardAppEmbedViewConfig { }
@@ -4409,6 +4424,7 @@ export enum Param {
44094424
ShowLiveboardReverifyBanner = 'showLiveboardReverifyBanner',
44104425
LiveboardHeaderV2 = 'isLiveboardHeaderV2Enabled',
44114426
HideIrrelevantFiltersInTab = 'hideIrrelevantFiltersAtTabLevel',
4427+
IsEnhancedFilterInteractivityEnabled = 'isLiveboardPermissionV2Enabled',
44124428
SpotterEnabled = 'isSpotterExperienceEnabled',
44134429
IsUnifiedSearchExperienceEnabled = 'isUnifiedSearchExperienceEnabled',
44144430
OverrideOrgId = 'orgId',

0 commit comments

Comments
 (0)