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

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

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

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

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

test('Should not add muzeChartPhase1EnabledGA to the iframe src when not specified', 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
4 changes: 4 additions & 0 deletions src/embed/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,7 @@ export class AppEmbed extends V1Embed {
showLiveboardDescription = true,
showMaskedFilterChip = false,
isLiveboardMasterpiecesEnabled = false,
muzeChartPhase1EnabledGA,
hideHomepageLeftNav = false,
modularHomeExperience = false,
isLiveboardHeaderSticky = true,
Expand Down Expand Up @@ -850,6 +851,9 @@ export class AppEmbed extends V1Embed {
params[Param.ShowLiveboardDescription] = !!showLiveboardDescription;
params[Param.ShowMaskedFilterChip] = showMaskedFilterChip;
params[Param.IsLiveboardMasterpiecesEnabled] = isLiveboardMasterpiecesEnabled;
if (muzeChartPhase1EnabledGA !== undefined) {
params[Param.MuzeChartPhase1EnabledGA] = muzeChartPhase1EnabledGA;
}
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
params[Param.IsFullAppEmbed] = true;
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
Expand Down
32 changes: 32 additions & 0 deletions src/embed/liveboard.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,38 @@ describe('Liveboard/viz embed tests', () => {
});
});

test('Should add muzeChartPhase1EnabledGA flag set to true to the iframe src', async () => {
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
...defaultViewConfig,
liveboardId,
muzeChartPhase1EnabledGA: true,
} as LiveboardViewConfig);

liveboardEmbed.render();
await executeAfterWait(() => {
expectUrlMatchesWithParams(
getIFrameSrc(),
`http://${thoughtSpotHost}/?embedApp=true${defaultParams}&muzeChartPhase1EnabledGA=true${prefixParams}#/embed/viz/${liveboardId}`,
);
});
});

test('Should add muzeChartPhase1EnabledGA flag set to false to the iframe src', async () => {
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
...defaultViewConfig,
liveboardId,
muzeChartPhase1EnabledGA: false,
} as LiveboardViewConfig);

liveboardEmbed.render();
await executeAfterWait(() => {
expectUrlMatchesWithParams(
getIFrameSrc(),
`http://${thoughtSpotHost}/?embedApp=true${defaultParams}&muzeChartPhase1EnabledGA=false${prefixParams}#/embed/viz/${liveboardId}`,
);
});
});
Comment thread
rachitshukla-ts marked this conversation as resolved.

test('Should add hideIrrelevantFiltersAtTabLevel flag to the iframe src', async () => {
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
...defaultViewConfig,
Expand Down
5 changes: 5 additions & 0 deletions src/embed/liveboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ export class LiveboardEmbed extends V1Embed {
hideIrrelevantChipsInLiveboardTabs = false,
showMaskedFilterChip = false,
isLiveboardMasterpiecesEnabled = false,
muzeChartPhase1EnabledGA,
isEnhancedFilterInteractivityEnabled = false,
enableAskSage,
enable2ColumnLayout,
Expand Down Expand Up @@ -707,6 +708,10 @@ export class LiveboardEmbed extends V1Embed {
params[Param.IsThisPeriodInDateFiltersEnabled] = isThisPeriodInDateFiltersEnabled;
}

if (muzeChartPhase1EnabledGA !== undefined) {
params[Param.MuzeChartPhase1EnabledGA] = muzeChartPhase1EnabledGA;
}

params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
Expand Down
28 changes: 28 additions & 0 deletions src/embed/search.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,34 @@ describe('Search embed tests', () => {
});
});

test('Should add muzeChartPhase1EnabledGA flag set to true to the iframe src', async () => {
const searchEmbed = new SearchEmbed(getRootEl(), {
...defaultViewConfig,
muzeChartPhase1EnabledGA: true,
});
searchEmbed.render();
await executeAfterWait(() => {
expectUrlMatchesWithParams(
getIFrameSrc(),
`http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&enableDataPanelV2=true&muzeChartPhase1EnabledGA=true&dataSourceMode=expand&useLastSelectedSources=false${prefixParams}#/embed/answer`,
);
});
});

test('Should add muzeChartPhase1EnabledGA flag set to false to the iframe src', async () => {
const searchEmbed = new SearchEmbed(getRootEl(), {
...defaultViewConfig,
muzeChartPhase1EnabledGA: false,
});
searchEmbed.render();
await executeAfterWait(() => {
expectUrlMatchesWithParams(
getIFrameSrc(),
`http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&enableDataPanelV2=true&muzeChartPhase1EnabledGA=false&dataSourceMode=expand&useLastSelectedSources=false${prefixParams}#/embed/answer`,
);
});
});
Comment thread
rachitshukla-ts marked this conversation as resolved.

test('should set dataPanelCustomGroupsAccordionInitialState to EXPAND_FIRST when passed', async () => {
const searchEmbed = new SearchBarEmbed(getRootEl() as any, {
...defaultViewConfig,
Expand Down
20 changes: 20 additions & 0 deletions src/embed/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,21 @@ export interface SearchViewConfig
* ```
*/
focusSearchBarOnRender?: boolean;
/**
* Enable or disable Muze chart phase 1 GA
*
* Supported embed types: `SearchEmbed`
* @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
* @default false
* @example
* ```js
* const embed = new SearchEmbed('#tsEmbed', {
* ... // other embed view config
* muzeChartPhase1EnabledGA: true,
* })
* ```
*/
muzeChartPhase1EnabledGA?: boolean;
}

export const HiddenActionItemByDefaultForSearchEmbed = [
Expand Down Expand Up @@ -405,6 +420,7 @@ export class SearchEmbed extends TsEmbed {
excludeSearchTokenStringFromURL,
collapseSearchBar = true,
isThisPeriodInDateFiltersEnabled,
muzeChartPhase1EnabledGA,
} = this.viewConfig;
const queryParams = this.getBaseQueryParams();

Expand Down Expand Up @@ -451,6 +467,10 @@ export class SearchEmbed extends TsEmbed {
queryParams[Param.IsThisPeriodInDateFiltersEnabled] = isThisPeriodInDateFiltersEnabled;
}

if (muzeChartPhase1EnabledGA !== undefined) {
queryParams[Param.MuzeChartPhase1EnabledGA] = muzeChartPhase1EnabledGA;
}

queryParams[Param.DataPanelV2Enabled] = dataPanelV2;
queryParams[Param.DataSourceMode] = this.getDataSourceMode();

Expand Down
17 changes: 17 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1987,6 +1987,22 @@ export interface LiveboardAppEmbedViewConfig {
* ```
*/
isLiveboardMasterpiecesEnabled?: boolean;
/**
* Enable or disable Muze chart phase 1 GA
*
* Supported embed types: `AppEmbed`, `LiveboardEmbed`
* @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
* @default false
* @example
* ```js
* // Replace <EmbedComponent> with embed component name. For example, AppEmbed or LiveboardEmbed
* const embed = new <EmbedComponent>('#tsEmbed', {
* ... // other embed view config
* muzeChartPhase1EnabledGA: true,
* })
* ```
*/
muzeChartPhase1EnabledGA?: boolean;
}

export interface AllEmbedViewConfig
Expand Down Expand Up @@ -5068,6 +5084,7 @@ export enum Param {
ShowLiveboardTitle = 'showLiveboardTitle',
ShowMaskedFilterChip = 'showMaskedFilterChip',
IsLiveboardMasterpiecesEnabled = 'isLiveboardMasterpiecesEnabled',
MuzeChartPhase1EnabledGA = 'muzeChartPhase1EnabledGA',
HiddenTabs = 'hideTabs',
VisibleTabs = 'visibleTabs',
HideTabPanel = 'hideTabPanel',
Expand Down
Loading