@thoughtspot/visual-embed-sdk 1.47.0 → 1.47.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/package.json +3 -3
- package/cjs/src/embed/app.d.ts +37 -0
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +10 -1
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +59 -0
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +9 -0
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +2 -1
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts +4 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js +2 -2
- package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +22 -0
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +7 -1
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +32 -0
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +13 -1
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +14 -0
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/types.d.ts +110 -6
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +106 -2
- package/cjs/src/types.js.map +1 -1
- package/dist/{index-Bm2Hck8q.js → index-CFZ7RDZ9.js} +1 -1
- package/dist/src/embed/app.d.ts +37 -0
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +9 -0
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts +4 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +22 -0
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +13 -1
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/types.d.ts +110 -6
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +144 -10
- package/dist/tsembed-react.js +143 -9
- package/dist/tsembed.es.js +144 -10
- package/dist/tsembed.js +143 -9
- package/dist/visual-embed-sdk-react-full.d.ts +189 -6
- package/dist/visual-embed-sdk-react.d.ts +189 -6
- package/dist/visual-embed-sdk.d.ts +189 -6
- package/lib/package.json +3 -3
- package/lib/src/embed/app.d.ts +37 -0
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +10 -1
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +59 -0
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +9 -0
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +2 -1
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +4 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.spec.js +2 -2
- package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +22 -0
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +7 -1
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +32 -0
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +13 -1
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +14 -0
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/types.d.ts +110 -6
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +106 -2
- package/lib/src/types.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +189 -6
- package/package.json +3 -3
- package/src/embed/app.spec.ts +84 -1
- package/src/embed/app.ts +51 -0
- package/src/embed/conversation.ts +11 -0
- package/src/embed/hostEventClient/contracts.ts +2 -1
- package/src/embed/hostEventClient/host-event-client.spec.ts +2 -2
- package/src/embed/liveboard.spec.ts +41 -0
- package/src/embed/liveboard.ts +31 -0
- package/src/embed/ts-embed.ts +15 -0
- package/src/types.ts +109 -2
package/src/embed/app.spec.ts
CHANGED
|
@@ -61,7 +61,7 @@ const testSetIframeHeightBehavior = (
|
|
|
61
61
|
...defaultViewConfig,
|
|
62
62
|
fullHeight: true,
|
|
63
63
|
} as AppViewConfig) as any;
|
|
64
|
-
|
|
64
|
+
|
|
65
65
|
const spySetIFrameHeight = shouldBeCalled
|
|
66
66
|
? jest.spyOn(appEmbed, 'setIFrameHeight').mockImplementation(jest.fn())
|
|
67
67
|
: jest.spyOn(appEmbed, 'setIFrameHeight');
|
|
@@ -880,6 +880,51 @@ describe('App embed tests', () => {
|
|
|
880
880
|
});
|
|
881
881
|
});
|
|
882
882
|
|
|
883
|
+
test('Should add isUnifiedSearchExperienceEnabled flag to the iframe src', async () => {
|
|
884
|
+
// Case 1: explicitly true
|
|
885
|
+
const appEmbedTrue = new AppEmbed(getRootEl(), {
|
|
886
|
+
...defaultViewConfig,
|
|
887
|
+
isUnifiedSearchExperienceEnabled: true,
|
|
888
|
+
} as AppViewConfig);
|
|
889
|
+
|
|
890
|
+
appEmbedTrue.render();
|
|
891
|
+
await executeAfterWait(() => {
|
|
892
|
+
expectUrlMatchesWithParams(
|
|
893
|
+
getIFrameSrc(),
|
|
894
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=true${defaultParams}${defaultParamsPost}#/home`,
|
|
895
|
+
);
|
|
896
|
+
});
|
|
897
|
+
appEmbedTrue.destroy();
|
|
898
|
+
|
|
899
|
+
// Case 2: explicitly false
|
|
900
|
+
const appEmbedFalse = new AppEmbed(getRootEl(), {
|
|
901
|
+
...defaultViewConfig,
|
|
902
|
+
isUnifiedSearchExperienceEnabled: false,
|
|
903
|
+
} as AppViewConfig);
|
|
904
|
+
|
|
905
|
+
appEmbedFalse.render();
|
|
906
|
+
await executeAfterWait(() => {
|
|
907
|
+
expectUrlMatchesWithParams(
|
|
908
|
+
getIFrameSrc(),
|
|
909
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=false${defaultParams}${defaultParamsPost}#/home`,
|
|
910
|
+
);
|
|
911
|
+
});
|
|
912
|
+
appEmbedFalse.destroy();
|
|
913
|
+
|
|
914
|
+
// Case 3: not provided — defaults to false
|
|
915
|
+
const appEmbedDefault = new AppEmbed(getRootEl(), {
|
|
916
|
+
...defaultViewConfig,
|
|
917
|
+
} as AppViewConfig);
|
|
918
|
+
|
|
919
|
+
appEmbedDefault.render();
|
|
920
|
+
await executeAfterWait(() => {
|
|
921
|
+
expectUrlMatchesWithParams(
|
|
922
|
+
getIFrameSrc(),
|
|
923
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=true${defaultParams}${defaultParamsPost}#/home`,
|
|
924
|
+
);
|
|
925
|
+
});
|
|
926
|
+
});
|
|
927
|
+
|
|
883
928
|
test('Should add hideIrrelevantFiltersAtTabLevel flag to the iframe src', async () => {
|
|
884
929
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
885
930
|
...defaultViewConfig,
|
|
@@ -1163,6 +1208,44 @@ describe('App embed tests', () => {
|
|
|
1163
1208
|
});
|
|
1164
1209
|
});
|
|
1165
1210
|
|
|
1211
|
+
test('should set enableLiveboardDataCache to true in url', async () => {
|
|
1212
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1213
|
+
...defaultViewConfig,
|
|
1214
|
+
enableLiveboardDataCache: true,
|
|
1215
|
+
} as AppViewConfig);
|
|
1216
|
+
appEmbed.render();
|
|
1217
|
+
await executeAfterWait(() => {
|
|
1218
|
+
expectUrlMatchesWithParams(
|
|
1219
|
+
getIFrameSrc(),
|
|
1220
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=true${defaultParamsPost}#/home`,
|
|
1221
|
+
);
|
|
1222
|
+
});
|
|
1223
|
+
});
|
|
1224
|
+
|
|
1225
|
+
test('should set enableLiveboardDataCache to false in url', async () => {
|
|
1226
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1227
|
+
...defaultViewConfig,
|
|
1228
|
+
enableLiveboardDataCache: false,
|
|
1229
|
+
} as AppViewConfig);
|
|
1230
|
+
appEmbed.render();
|
|
1231
|
+
await executeAfterWait(() => {
|
|
1232
|
+
expectUrlMatchesWithParams(
|
|
1233
|
+
getIFrameSrc(),
|
|
1234
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&enableLiveboardDataCache=false${defaultParamsPost}#/home`,
|
|
1235
|
+
);
|
|
1236
|
+
});
|
|
1237
|
+
});
|
|
1238
|
+
|
|
1239
|
+
test('should not set enableLiveboardDataCache in url when not provided', async () => {
|
|
1240
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1241
|
+
...defaultViewConfig,
|
|
1242
|
+
} as AppViewConfig);
|
|
1243
|
+
appEmbed.render();
|
|
1244
|
+
await executeAfterWait(() => {
|
|
1245
|
+
expect(getIFrameSrc()).not.toContain('enableLiveboardDataCache');
|
|
1246
|
+
});
|
|
1247
|
+
});
|
|
1248
|
+
|
|
1166
1249
|
test('Should add HomePageSearchBarMode flag with object search to the iframe src', async () => {
|
|
1167
1250
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
1168
1251
|
...defaultViewConfig,
|
package/src/embed/app.ts
CHANGED
|
@@ -534,6 +534,22 @@ export interface AppViewConfig extends AllEmbedViewConfig {
|
|
|
534
534
|
* @version SDK: 1.33.0 | ThoughtSpot: 10.3.0.cl
|
|
535
535
|
*/
|
|
536
536
|
homePageSearchBarMode?: HomePageSearchBarMode;
|
|
537
|
+
/**
|
|
538
|
+
* This flag is used to enable unified search experience for full app embed.
|
|
539
|
+
*
|
|
540
|
+
* Supported embed types: `AppEmbed`
|
|
541
|
+
* @version SDK: 1.34.0 | ThoughtSpot: 10.5.0.cl
|
|
542
|
+
* @default true
|
|
543
|
+
* @example
|
|
544
|
+
* ```js
|
|
545
|
+
* const embed = new AppEmbed('#tsEmbed', {
|
|
546
|
+
* ... // other embed view config
|
|
547
|
+
* isUnifiedSearchExperienceEnabled: true,
|
|
548
|
+
* })
|
|
549
|
+
* ```
|
|
550
|
+
*/
|
|
551
|
+
isUnifiedSearchExperienceEnabled?: boolean;
|
|
552
|
+
|
|
537
553
|
/**
|
|
538
554
|
* This flag is used to enable/disable the styling and grouping in a Liveboard. Use {@link isLiveboardMasterpiecesEnabled} instead.
|
|
539
555
|
* @deprecated This flag is deprecated.
|
|
@@ -727,6 +743,15 @@ export interface AppViewConfig extends AllEmbedViewConfig {
|
|
|
727
743
|
* ```
|
|
728
744
|
*/
|
|
729
745
|
spotterChatConfig?: SpotterChatViewConfig;
|
|
746
|
+
/**
|
|
747
|
+
* Enables the stop answer generation button in the Spotter embed UI,
|
|
748
|
+
* allowing users to interrupt an ongoing answer generation.
|
|
749
|
+
*
|
|
750
|
+
* Supported embed types: `AppEmbed`
|
|
751
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
752
|
+
* @default false
|
|
753
|
+
*/
|
|
754
|
+
enableStopAnswerGenerationEmbed?: boolean;
|
|
730
755
|
/**
|
|
731
756
|
* This is the minimum height (in pixels) for a full-height App.
|
|
732
757
|
* Setting this height helps resolve issues with empty Apps and
|
|
@@ -760,6 +785,19 @@ export interface AppViewConfig extends AllEmbedViewConfig {
|
|
|
760
785
|
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
761
786
|
*/
|
|
762
787
|
enableHomepageAnnouncement?: boolean;
|
|
788
|
+
/**
|
|
789
|
+
* If set to true, enables visualization data caching on the Liveboard.
|
|
790
|
+
* @type {boolean}
|
|
791
|
+
* @version SDK: 1.49.0 | ThoughtSpot: 26.6.0.cl
|
|
792
|
+
* @example
|
|
793
|
+
* ```js
|
|
794
|
+
* const embed = new AppEmbed('#tsEmbed', {
|
|
795
|
+
* ... // other options
|
|
796
|
+
* enableLiveboardDataCache: true,
|
|
797
|
+
* })
|
|
798
|
+
* ```
|
|
799
|
+
*/
|
|
800
|
+
enableLiveboardDataCache?: boolean;
|
|
763
801
|
}
|
|
764
802
|
|
|
765
803
|
/**
|
|
@@ -852,6 +890,7 @@ export class AppEmbed extends V1Embed {
|
|
|
852
890
|
hideIrrelevantChipsInLiveboardTabs = false,
|
|
853
891
|
isEnhancedFilterInteractivityEnabled = false,
|
|
854
892
|
homePageSearchBarMode,
|
|
893
|
+
isUnifiedSearchExperienceEnabled = true,
|
|
855
894
|
enablePendoHelp = true,
|
|
856
895
|
discoveryExperience,
|
|
857
896
|
coverAndFilterOptionInPDF = false,
|
|
@@ -862,11 +901,13 @@ export class AppEmbed extends V1Embed {
|
|
|
862
901
|
isCentralizedLiveboardFilterUXEnabled = false,
|
|
863
902
|
isLinkParametersEnabled,
|
|
864
903
|
updatedSpotterChatPrompt,
|
|
904
|
+
enableStopAnswerGenerationEmbed,
|
|
865
905
|
spotterChatConfig,
|
|
866
906
|
minimumHeight,
|
|
867
907
|
isThisPeriodInDateFiltersEnabled,
|
|
868
908
|
enableHomepageAnnouncement = false,
|
|
869
909
|
isContinuousLiveboardPDFEnabled,
|
|
910
|
+
enableLiveboardDataCache,
|
|
870
911
|
} = this.viewConfig;
|
|
871
912
|
|
|
872
913
|
let params: any = {};
|
|
@@ -886,6 +927,9 @@ export class AppEmbed extends V1Embed {
|
|
|
886
927
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
887
928
|
params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
|
|
888
929
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
930
|
+
if (isUnifiedSearchExperienceEnabled !== undefined) {
|
|
931
|
+
params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
|
|
932
|
+
}
|
|
889
933
|
params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
|
|
890
934
|
|
|
891
935
|
params = this.getBaseQueryParams(params);
|
|
@@ -893,6 +937,9 @@ export class AppEmbed extends V1Embed {
|
|
|
893
937
|
if (!isUndefined(updatedSpotterChatPrompt)) {
|
|
894
938
|
params[Param.UpdatedSpotterChatPrompt] = !!updatedSpotterChatPrompt;
|
|
895
939
|
}
|
|
940
|
+
if (!isUndefined(enableStopAnswerGenerationEmbed)) {
|
|
941
|
+
params[Param.EnableStopAnswerGenerationEmbed] = !!enableStopAnswerGenerationEmbed;
|
|
942
|
+
}
|
|
896
943
|
|
|
897
944
|
// Handle spotterChatConfig params
|
|
898
945
|
if (spotterChatConfig) {
|
|
@@ -1003,6 +1050,10 @@ export class AppEmbed extends V1Embed {
|
|
|
1003
1050
|
|
|
1004
1051
|
this.defaultHeight = minimumHeight || this.defaultHeight;
|
|
1005
1052
|
|
|
1053
|
+
if (enableLiveboardDataCache !== undefined) {
|
|
1054
|
+
params[Param.EnableLiveboardDataCache] = enableLiveboardDataCache;
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1006
1057
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
1007
1058
|
params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
|
|
1008
1059
|
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
@@ -284,6 +284,15 @@ export interface SpotterEmbedViewConfig extends Omit<BaseViewConfig, 'primaryAct
|
|
|
284
284
|
* ```
|
|
285
285
|
*/
|
|
286
286
|
updatedSpotterChatPrompt?: boolean;
|
|
287
|
+
/**
|
|
288
|
+
* Enables the stop answer generation button in the Spotter embed UI,
|
|
289
|
+
* allowing users to interrupt an ongoing answer generation.
|
|
290
|
+
*
|
|
291
|
+
* Supported embed types: `SpotterEmbed`
|
|
292
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
293
|
+
* @default false
|
|
294
|
+
*/
|
|
295
|
+
enableStopAnswerGenerationEmbed?: boolean;
|
|
287
296
|
/**
|
|
288
297
|
* Controls the visibility of the past conversations sidebar.
|
|
289
298
|
*
|
|
@@ -411,6 +420,7 @@ export class SpotterEmbed extends TsEmbed {
|
|
|
411
420
|
runtimeParameters,
|
|
412
421
|
excludeRuntimeParametersfromURL,
|
|
413
422
|
updatedSpotterChatPrompt,
|
|
423
|
+
enableStopAnswerGenerationEmbed,
|
|
414
424
|
spotterChatConfig,
|
|
415
425
|
} = this.viewConfig;
|
|
416
426
|
|
|
@@ -432,6 +442,7 @@ export class SpotterEmbed extends TsEmbed {
|
|
|
432
442
|
setParamIfDefined(queryParams, Param.ShowSpotterLimitations, showSpotterLimitations, true);
|
|
433
443
|
setParamIfDefined(queryParams, Param.HideSampleQuestions, hideSampleQuestions, true);
|
|
434
444
|
setParamIfDefined(queryParams, Param.UpdatedSpotterChatPrompt, updatedSpotterChatPrompt, true);
|
|
445
|
+
setParamIfDefined(queryParams, Param.EnableStopAnswerGenerationEmbed, enableStopAnswerGenerationEmbed, true);
|
|
435
446
|
|
|
436
447
|
// Handle spotterChatConfig params
|
|
437
448
|
if (spotterChatConfig) {
|
|
@@ -137,7 +137,8 @@ export type UIPassthroughContractBase = {
|
|
|
137
137
|
[UIPassthroughEvent.GetExportRequestForCurrentPinboard]: {
|
|
138
138
|
request: Record<string, never>;
|
|
139
139
|
response: {
|
|
140
|
-
v2Content: string;
|
|
140
|
+
data: { v2Content: string };
|
|
141
|
+
type: UIPassthroughEvent.GetExportRequestForCurrentPinboard;
|
|
141
142
|
};
|
|
142
143
|
};
|
|
143
144
|
[UIPassthroughEvent.UpdateFilters]: {
|
|
@@ -494,11 +494,11 @@ describe('HostEventClient', () => {
|
|
|
494
494
|
const { client } = createHostEventClient();
|
|
495
495
|
mockProcessTrigger
|
|
496
496
|
.mockResolvedValueOnce(mockGetAvailablePassthroughs())
|
|
497
|
-
.mockResolvedValueOnce([{ value: { v2Content: 'exportData' } }]);
|
|
497
|
+
.mockResolvedValueOnce([{ value: { data: { v2Content: 'exportData' }, type: 'getExportRequestForCurrentPinboard' } }]);
|
|
498
498
|
|
|
499
499
|
const result = await client.triggerHostEvent(HostEvent.getExportRequestForCurrentPinboard, {});
|
|
500
500
|
|
|
501
|
-
expect(result).toEqual({ v2Content: 'exportData' });
|
|
501
|
+
expect(result).toEqual({ data: { v2Content: 'exportData' }, type: 'getExportRequestForCurrentPinboard' });
|
|
502
502
|
});
|
|
503
503
|
|
|
504
504
|
it('should fall back to legacy for GetFilters when passthrough returns null', async () => {
|
|
@@ -427,6 +427,47 @@ describe('Liveboard/viz embed tests', () => {
|
|
|
427
427
|
});
|
|
428
428
|
});
|
|
429
429
|
|
|
430
|
+
test('should set enableLiveboardDataCache to true in url', async () => {
|
|
431
|
+
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
|
|
432
|
+
enableLiveboardDataCache: true,
|
|
433
|
+
...defaultViewConfig,
|
|
434
|
+
liveboardId,
|
|
435
|
+
} as LiveboardViewConfig);
|
|
436
|
+
liveboardEmbed.render();
|
|
437
|
+
await executeAfterWait(() => {
|
|
438
|
+
expectUrlMatchesWithParams(
|
|
439
|
+
getIFrameSrc(),
|
|
440
|
+
`http://${thoughtSpotHost}/?embedApp=true${defaultParams}&enableLiveboardDataCache=true${prefixParams}#/embed/viz/${liveboardId}`,
|
|
441
|
+
);
|
|
442
|
+
});
|
|
443
|
+
});
|
|
444
|
+
|
|
445
|
+
test('should set enableLiveboardDataCache to false in url', async () => {
|
|
446
|
+
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
|
|
447
|
+
enableLiveboardDataCache: false,
|
|
448
|
+
...defaultViewConfig,
|
|
449
|
+
liveboardId,
|
|
450
|
+
} as LiveboardViewConfig);
|
|
451
|
+
liveboardEmbed.render();
|
|
452
|
+
await executeAfterWait(() => {
|
|
453
|
+
expectUrlMatchesWithParams(
|
|
454
|
+
getIFrameSrc(),
|
|
455
|
+
`http://${thoughtSpotHost}/?embedApp=true${defaultParams}&enableLiveboardDataCache=false${prefixParams}#/embed/viz/${liveboardId}`,
|
|
456
|
+
);
|
|
457
|
+
});
|
|
458
|
+
});
|
|
459
|
+
|
|
460
|
+
test('should not set enableLiveboardDataCache in url when not provided', async () => {
|
|
461
|
+
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
|
|
462
|
+
...defaultViewConfig,
|
|
463
|
+
liveboardId,
|
|
464
|
+
} as LiveboardViewConfig);
|
|
465
|
+
liveboardEmbed.render();
|
|
466
|
+
await executeAfterWait(() => {
|
|
467
|
+
expect(getIFrameSrc()).not.toContain('enableLiveboardDataCache');
|
|
468
|
+
});
|
|
469
|
+
});
|
|
470
|
+
|
|
430
471
|
test('should render viz', async () => {
|
|
431
472
|
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
|
|
432
473
|
...defaultViewConfig,
|
package/src/embed/liveboard.ts
CHANGED
|
@@ -507,6 +507,15 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
507
507
|
* ```
|
|
508
508
|
*/
|
|
509
509
|
updatedSpotterChatPrompt?: boolean;
|
|
510
|
+
/**
|
|
511
|
+
* Enables the stop answer generation button in the Spotter embed UI,
|
|
512
|
+
* allowing users to interrupt an ongoing answer generation.
|
|
513
|
+
*
|
|
514
|
+
* Supported embed types: `LiveboardEmbed`
|
|
515
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
516
|
+
* @default false
|
|
517
|
+
*/
|
|
518
|
+
enableStopAnswerGenerationEmbed?: boolean;
|
|
510
519
|
/**
|
|
511
520
|
* Configuration for customizing Spotter chat UI
|
|
512
521
|
* branding in tool response cards.
|
|
@@ -525,6 +534,19 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
525
534
|
* ```
|
|
526
535
|
*/
|
|
527
536
|
spotterChatConfig?: SpotterChatViewConfig;
|
|
537
|
+
/**
|
|
538
|
+
* If set to true, enables visualization data caching on the Liveboard.
|
|
539
|
+
* @type {boolean}
|
|
540
|
+
* @version SDK: 1.49.0 | ThoughtSpot: 26.6.0.cl
|
|
541
|
+
* @example
|
|
542
|
+
* ```js
|
|
543
|
+
* const embed = new LiveboardEmbed('#embed-container', {
|
|
544
|
+
* ... // other options
|
|
545
|
+
* enableLiveboardDataCache: true,
|
|
546
|
+
* })
|
|
547
|
+
* ```
|
|
548
|
+
*/
|
|
549
|
+
enableLiveboardDataCache?: boolean;
|
|
528
550
|
}
|
|
529
551
|
|
|
530
552
|
/**
|
|
@@ -614,9 +636,11 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
614
636
|
isCentralizedLiveboardFilterUXEnabled = false,
|
|
615
637
|
isLinkParametersEnabled,
|
|
616
638
|
updatedSpotterChatPrompt,
|
|
639
|
+
enableStopAnswerGenerationEmbed,
|
|
617
640
|
spotterChatConfig,
|
|
618
641
|
isThisPeriodInDateFiltersEnabled,
|
|
619
642
|
isContinuousLiveboardPDFEnabled,
|
|
643
|
+
enableLiveboardDataCache,
|
|
620
644
|
} = this.viewConfig;
|
|
621
645
|
|
|
622
646
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
@@ -641,6 +665,9 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
641
665
|
if (!isUndefined(updatedSpotterChatPrompt)) {
|
|
642
666
|
params[Param.UpdatedSpotterChatPrompt] = !!updatedSpotterChatPrompt;
|
|
643
667
|
}
|
|
668
|
+
if (!isUndefined(enableStopAnswerGenerationEmbed)) {
|
|
669
|
+
params[Param.EnableStopAnswerGenerationEmbed] = !!enableStopAnswerGenerationEmbed;
|
|
670
|
+
}
|
|
644
671
|
if (visibleVizs) {
|
|
645
672
|
params[Param.visibleVizs] = visibleVizs;
|
|
646
673
|
}
|
|
@@ -731,6 +758,10 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
731
758
|
params[Param.IsWYSIWYGLiveboardPDFEnabled] = isContinuousLiveboardPDFEnabled;
|
|
732
759
|
}
|
|
733
760
|
|
|
761
|
+
if (enableLiveboardDataCache !== undefined) {
|
|
762
|
+
params[Param.EnableLiveboardDataCache] = enableLiveboardDataCache;
|
|
763
|
+
}
|
|
764
|
+
|
|
734
765
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
735
766
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
736
767
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
package/src/embed/ts-embed.ts
CHANGED
|
@@ -1541,6 +1541,21 @@ export class TsEmbed {
|
|
|
1541
1541
|
});
|
|
1542
1542
|
}
|
|
1543
1543
|
|
|
1544
|
+
/**
|
|
1545
|
+
* Generates the event name for a "Subscribed" embed event.
|
|
1546
|
+
*
|
|
1547
|
+
* This helper appends the "Subscribed" suffix to a given host or action event,
|
|
1548
|
+
* allowing you to listen for subscription lifecycle events in a consistent format.
|
|
1549
|
+
*
|
|
1550
|
+
* @param eventName - The host or action event to generate the subscribed event name for.
|
|
1551
|
+
* @returns The formatted event name (e.g., "Save Subscribed").
|
|
1552
|
+
*
|
|
1553
|
+
* @version SDK: 1.47.2 | ThoughtSpot: 26.3.0.cl
|
|
1554
|
+
*/
|
|
1555
|
+
public subscribedEvent(eventName: HostEvent | Action): string {
|
|
1556
|
+
return `${eventName} ${EmbedEvent.Subscribed}`;
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1544
1559
|
/**
|
|
1545
1560
|
* Creates the preRender shell
|
|
1546
1561
|
* @param showPreRenderByDefault - Show the preRender after render, hidden by default
|
package/src/types.ts
CHANGED
|
@@ -3636,6 +3636,56 @@ export enum EmbedEvent {
|
|
|
3636
3636
|
* @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl
|
|
3637
3637
|
*/
|
|
3638
3638
|
RefreshAuthToken = 'RefreshAuthToken',
|
|
3639
|
+
|
|
3640
|
+
/**
|
|
3641
|
+
* Triggered whenever the page context changes, returning the current context along with the navigation stack.
|
|
3642
|
+
* @example
|
|
3643
|
+
* ```js
|
|
3644
|
+
* embed.on(EmbedEvent.EmbedPageContextChanged, (payload) => {
|
|
3645
|
+
* console.log('payload', payload);
|
|
3646
|
+
* })
|
|
3647
|
+
* ```
|
|
3648
|
+
* @version SDK: 1.47.2 | ThoughtSpot: 26.3.0.cl
|
|
3649
|
+
*/
|
|
3650
|
+
EmbedPageContextChanged = 'EmbedPageContextChanged',
|
|
3651
|
+
|
|
3652
|
+
/**
|
|
3653
|
+
* Represents a special embed event that is triggered whenever any host event is subscribed.
|
|
3654
|
+
*
|
|
3655
|
+
* You can listen to this event when you need to dispatch a host event during load or render,
|
|
3656
|
+
* particularly in situations where timing issues may occur.
|
|
3657
|
+
*
|
|
3658
|
+
* @example
|
|
3659
|
+
* ```js
|
|
3660
|
+
* embed.on(`${HostEvent.Save} Subscribed`, () => {
|
|
3661
|
+
* // make action
|
|
3662
|
+
* });
|
|
3663
|
+
* ```
|
|
3664
|
+
*
|
|
3665
|
+
* @example
|
|
3666
|
+
* ```js
|
|
3667
|
+
* embed.on(subscribedEvent(HostEvent.Save), () => {
|
|
3668
|
+
* // make action
|
|
3669
|
+
* });
|
|
3670
|
+
* ```
|
|
3671
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.4.0.cl
|
|
3672
|
+
*/
|
|
3673
|
+
Subscribed = 'Subscribed',
|
|
3674
|
+
|
|
3675
|
+
/**
|
|
3676
|
+
* Emitted when a user clicks the **Send Test Email** button in the
|
|
3677
|
+
* Liveboard schedule modal. Requires `isSendNowLiveboardSchedulingEnabled`
|
|
3678
|
+
* to be enabled.
|
|
3679
|
+
* @example
|
|
3680
|
+
* ```js
|
|
3681
|
+
* liveboardEmbed.on(EmbedEvent.SendTestScheduleEmail, (payload) => {
|
|
3682
|
+
* console.log('Send test email', payload);
|
|
3683
|
+
* // payload: { liveboardId: string, sendToSelf: boolean }
|
|
3684
|
+
* })
|
|
3685
|
+
* ```
|
|
3686
|
+
* @version SDK: 1.48.0 | ThoughtSpot Cloud: 26.5.0.cl
|
|
3687
|
+
*/
|
|
3688
|
+
SendTestScheduleEmail = 'sendTestScheduleEmail',
|
|
3639
3689
|
}
|
|
3640
3690
|
|
|
3641
3691
|
/**
|
|
@@ -5336,7 +5386,8 @@ export enum HostEvent {
|
|
|
5336
5386
|
* ```js
|
|
5337
5387
|
* // Get parameters from liveboard context
|
|
5338
5388
|
* import { ContextType } from '@thoughtspot/visual-embed-sdk';
|
|
5339
|
-
* liveboardEmbed.trigger(HostEvent.GetParameters, {},
|
|
5389
|
+
* liveboardEmbed.trigger(HostEvent.GetParameters, {},
|
|
5390
|
+
* ContextType.Liveboard).then((parameters) => {
|
|
5340
5391
|
* console.log('parameters', parameters);
|
|
5341
5392
|
* });
|
|
5342
5393
|
* ```
|
|
@@ -5690,6 +5741,26 @@ export enum HostEvent {
|
|
|
5690
5741
|
* @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
|
|
5691
5742
|
*/
|
|
5692
5743
|
GetPageContext = 'GetPageContext',
|
|
5744
|
+
/**
|
|
5745
|
+
* Trigger the **Send Test Email** action in the Liveboard schedule modal.
|
|
5746
|
+
* Sends a test schedule email to self or all recipients.
|
|
5747
|
+
* Requires `isSendNowLiveboardSchedulingEnabled` to be enabled.
|
|
5748
|
+
* @example
|
|
5749
|
+
* ```js
|
|
5750
|
+
* liveboardEmbed.trigger(HostEvent.SendTestScheduleEmail, {
|
|
5751
|
+
* sendToSelf: true,
|
|
5752
|
+
* })
|
|
5753
|
+
* ```
|
|
5754
|
+
* @example
|
|
5755
|
+
* ```js
|
|
5756
|
+
* // Send to all recipients
|
|
5757
|
+
* liveboardEmbed.trigger(HostEvent.SendTestScheduleEmail, {
|
|
5758
|
+
* sendToSelf: false,
|
|
5759
|
+
* })
|
|
5760
|
+
* ```
|
|
5761
|
+
* @version SDK: 1.48.0 | ThoughtSpot Cloud: 26.5.0.cl
|
|
5762
|
+
*/
|
|
5763
|
+
SendTestScheduleEmail = 'sendTestScheduleEmail',
|
|
5693
5764
|
}
|
|
5694
5765
|
|
|
5695
5766
|
/**
|
|
@@ -5829,6 +5900,7 @@ export enum Param {
|
|
|
5829
5900
|
HideIrrelevantFiltersInTab = 'hideIrrelevantFiltersAtTabLevel',
|
|
5830
5901
|
IsEnhancedFilterInteractivityEnabled = 'isLiveboardPermissionV2Enabled',
|
|
5831
5902
|
SpotterEnabled = 'isSpotterExperienceEnabled',
|
|
5903
|
+
IsUnifiedSearchExperienceEnabled = 'isUnifiedSearchExperienceEnabled',
|
|
5832
5904
|
OverrideOrgId = 'orgId',
|
|
5833
5905
|
OauthPollingInterval = 'oAuthPollingInterval',
|
|
5834
5906
|
IsForceRedirect = 'isForceRedirect',
|
|
@@ -5845,10 +5917,12 @@ export enum Param {
|
|
|
5845
5917
|
IsWYSIWYGLiveboardPDFEnabled = 'isWYSIWYGLiveboardPDFEnabled',
|
|
5846
5918
|
isLiveboardXLSXCSVDownloadEnabled = 'isLiveboardXLSXCSVDownloadEnabled',
|
|
5847
5919
|
isGranularXLSXCSVSchedulesEnabled = 'isGranularXLSXCSVSchedulesEnabled',
|
|
5920
|
+
isSendNowLiveboardSchedulingEnabled = 'isSendNowLiveboardSchedulingEnabled',
|
|
5848
5921
|
isCentralizedLiveboardFilterUXEnabled = 'isCentralizedLiveboardFilterUXEnabled',
|
|
5849
5922
|
isLinkParametersEnabled = 'isLinkParametersEnabled',
|
|
5850
5923
|
EnablePastConversationsSidebar = 'enablePastConversationsSidebar',
|
|
5851
5924
|
UpdatedSpotterChatPrompt = 'updatedSpotterChatPrompt',
|
|
5925
|
+
EnableStopAnswerGenerationEmbed = 'enableStopAnswerGenerationEmbed',
|
|
5852
5926
|
SpotterSidebarTitle = 'spotterSidebarTitle',
|
|
5853
5927
|
SpotterSidebarDefaultExpanded = 'spotterSidebarDefaultExpanded',
|
|
5854
5928
|
SpotterChatRenameLabel = 'spotterChatRenameLabel',
|
|
@@ -5863,6 +5937,7 @@ export enum Param {
|
|
|
5863
5937
|
HideToolResponseCardBranding = 'hideToolResponseCardBranding',
|
|
5864
5938
|
ToolResponseCardBrandingLabel = 'toolResponseCardBrandingLabel',
|
|
5865
5939
|
EnableHomepageAnnouncement = 'enableHomepageAnnouncement',
|
|
5940
|
+
EnableLiveboardDataCache = 'enableLiveboardDataCache',
|
|
5866
5941
|
}
|
|
5867
5942
|
|
|
5868
5943
|
/**
|
|
@@ -6185,7 +6260,7 @@ export enum Action {
|
|
|
6185
6260
|
* ```js
|
|
6186
6261
|
* disabledActions: [Action.DownloadLiveboard]
|
|
6187
6262
|
* ```
|
|
6188
|
-
* @version SDK: 1.
|
|
6263
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
6189
6264
|
*/
|
|
6190
6265
|
DownloadLiveboard = 'downloadLiveboard',
|
|
6191
6266
|
/**
|
|
@@ -6198,6 +6273,26 @@ export enum Action {
|
|
|
6198
6273
|
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
6199
6274
|
*/
|
|
6200
6275
|
DownloadLiveboardAsContinuousPDF = 'downloadLiveboardAsContinuousPDF',
|
|
6276
|
+
/**
|
|
6277
|
+
* The **Download Liveboard as XLSX** menu action on a Liveboard.
|
|
6278
|
+
* Allows downloading the entire Liveboard as an XLSX file.
|
|
6279
|
+
* @example
|
|
6280
|
+
* ```js
|
|
6281
|
+
* disabledActions: [Action.DownloadLiveboardAsXlsx]
|
|
6282
|
+
* ```
|
|
6283
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
6284
|
+
*/
|
|
6285
|
+
DownloadLiveboardAsXlsx = 'downloadLiveboardAsXlsx',
|
|
6286
|
+
/**
|
|
6287
|
+
* The **Download Liveboard as CSV** menu action on a Liveboard.
|
|
6288
|
+
* Allows downloading the entire Liveboard as a CSV file.
|
|
6289
|
+
* @example
|
|
6290
|
+
* ```js
|
|
6291
|
+
* disabledActions: [Action.DownloadLiveboardAsCsv]
|
|
6292
|
+
* ```
|
|
6293
|
+
* @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
|
|
6294
|
+
*/
|
|
6295
|
+
DownloadLiveboardAsCsv = 'downloadLiveboardAsCsv',
|
|
6201
6296
|
/**
|
|
6202
6297
|
* @hidden
|
|
6203
6298
|
*/
|
|
@@ -7479,6 +7574,18 @@ export enum Action {
|
|
|
7479
7574
|
* @version SDK: 1.45.0 | ThoughtSpot: 26.4.0.cl
|
|
7480
7575
|
*/
|
|
7481
7576
|
IncludeCurrentPeriod = 'includeCurrentPeriod',
|
|
7577
|
+
/**
|
|
7578
|
+
* The **Send Test Email** button in the Liveboard schedule modal.
|
|
7579
|
+
* Allows sending a test schedule email to self or all recipients.
|
|
7580
|
+
* Requires `isSendNowLiveboardSchedulingEnabled` to be enabled.
|
|
7581
|
+
* @example
|
|
7582
|
+
* ```js
|
|
7583
|
+
* disabledActions: [Action.SendTestScheduleEmail]
|
|
7584
|
+
* hiddenActions: [Action.SendTestScheduleEmail]
|
|
7585
|
+
* ```
|
|
7586
|
+
* @version SDK: 1.48.0 | ThoughtSpot Cloud: 26.5.0.cl
|
|
7587
|
+
*/
|
|
7588
|
+
SendTestScheduleEmail = 'sendTestScheduleEmail',
|
|
7482
7589
|
}
|
|
7483
7590
|
export interface AnswerServiceType {
|
|
7484
7591
|
getAnswer?: (offset: number, batchSize: number) => any;
|