@thoughtspot/visual-embed-sdk 1.41.0 → 1.41.1
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/README.md +2 -4
- package/cjs/package.json +1 -1
- package/cjs/src/authToken.d.ts +1 -0
- package/cjs/src/authToken.d.ts.map +1 -1
- package/cjs/src/authToken.js +13 -3
- package/cjs/src/authToken.js.map +1 -1
- package/cjs/src/authToken.spec.js +29 -0
- package/cjs/src/authToken.spec.js.map +1 -1
- package/cjs/src/css-variables.d.ts +2 -1
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts +16 -0
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +4 -1
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +10 -0
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +2 -2
- package/cjs/src/embed/liveboard.d.ts +32 -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 +85 -11
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/sage.spec.js +20 -10
- package/cjs/src/embed/sage.spec.js.map +1 -1
- package/cjs/src/embed/search.js +1 -1
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/search.spec.js +10 -10
- package/cjs/src/embed/search.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +1 -1
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +5 -1
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/errors.d.ts +1 -0
- package/cjs/src/errors.d.ts.map +1 -1
- package/cjs/src/errors.js +1 -0
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +2 -1
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/index.spec.js +1 -1
- package/cjs/src/react/index.spec.js.map +1 -1
- package/cjs/src/types.d.ts +29 -5
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +25 -1
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils.d.ts +14 -0
- package/cjs/src/utils.d.ts.map +1 -1
- package/cjs/src/utils.js +22 -1
- package/cjs/src/utils.js.map +1 -1
- package/cjs/src/utils.spec.js +10 -0
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/{index-B_mxAan8.js → index-DQueHwfQ.js} +1 -1
- package/dist/src/authToken.d.ts +1 -0
- package/dist/src/authToken.d.ts.map +1 -1
- package/dist/src/css-variables.d.ts +2 -1
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +16 -0
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +2 -2
- package/dist/src/embed/liveboard.d.ts +32 -0
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +1 -1
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/errors.d.ts +1 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +29 -5
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils.d.ts +14 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +77 -9
- package/dist/tsembed-react.js +76 -8
- package/dist/tsembed.es.js +75 -8
- package/dist/tsembed.js +74 -7
- package/dist/visual-embed-sdk-react-full.d.ts +83 -9
- package/dist/visual-embed-sdk-react.d.ts +83 -9
- package/dist/visual-embed-sdk.d.ts +83 -9
- package/lib/package.json +1 -1
- package/lib/src/authToken.d.ts +1 -0
- package/lib/src/authToken.d.ts.map +1 -1
- package/lib/src/authToken.js +11 -2
- package/lib/src/authToken.js.map +1 -1
- package/lib/src/authToken.spec.js +30 -1
- package/lib/src/authToken.spec.js.map +1 -1
- package/lib/src/css-variables.d.ts +2 -1
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts +16 -0
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +4 -1
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +10 -0
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +2 -2
- package/lib/src/embed/liveboard.d.ts +32 -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 +85 -11
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/sage.spec.js +20 -10
- package/lib/src/embed/sage.spec.js.map +1 -1
- package/lib/src/embed/search.js +1 -1
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/search.spec.js +11 -11
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +1 -1
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +5 -1
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/errors.d.ts +1 -0
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +1 -0
- package/lib/src/errors.js.map +1 -1
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +2 -1
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +1 -1
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/types.d.ts +29 -5
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +25 -1
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils.d.ts +14 -0
- package/lib/src/utils.d.ts.map +1 -1
- package/lib/src/utils.js +20 -0
- package/lib/src/utils.js.map +1 -1
- package/lib/src/utils.spec.js +11 -1
- package/lib/src/utils.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +83 -9
- package/package.json +1 -1
- package/src/authToken.spec.ts +48 -1
- package/src/authToken.ts +13 -2
- package/src/css-variables.ts +2 -1
- package/src/embed/app.spec.ts +14 -0
- package/src/embed/app.ts +23 -1
- package/src/embed/conversation.ts +2 -2
- package/src/embed/liveboard.spec.ts +112 -14
- package/src/embed/liveboard.ts +65 -23
- package/src/embed/sage.spec.ts +24 -10
- package/src/embed/search.spec.ts +13 -14
- package/src/embed/search.ts +1 -1
- package/src/embed/ts-embed.ts +7 -1
- package/src/errors.ts +1 -0
- package/src/react/index.spec.tsx +1 -1
- package/src/react/index.tsx +4 -2
- package/src/types.ts +27 -3
- package/src/utils.spec.ts +18 -0
- package/src/utils.ts +21 -0
package/src/css-variables.ts
CHANGED
|
@@ -27,7 +27,8 @@ export interface CustomCssVariables {
|
|
|
27
27
|
* Font color of the text on toggle buttons such as
|
|
28
28
|
* **All**, **Answers**, and **Liveboards** on the Home page (Classic experience),
|
|
29
29
|
* the text color of the chart and table tiles on Home page (New modular Homepage
|
|
30
|
-
* experience),
|
|
30
|
+
* experience), title text on the AI-generated charts and tables, and object titles on
|
|
31
|
+
* list pages such as *Liveboards* and *Answers*.
|
|
31
32
|
* The default color code is #2770EF.
|
|
32
33
|
*
|
|
33
34
|
*/
|
package/src/embed/app.spec.ts
CHANGED
|
@@ -344,6 +344,20 @@ describe('App embed tests', () => {
|
|
|
344
344
|
});
|
|
345
345
|
});
|
|
346
346
|
|
|
347
|
+
test('should set isPNGInScheduledEmailsEnabled to true in url', async () => {
|
|
348
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
349
|
+
...defaultViewConfig,
|
|
350
|
+
isPNGInScheduledEmailsEnabled: true,
|
|
351
|
+
} as AppViewConfig);
|
|
352
|
+
appEmbed.render();
|
|
353
|
+
await executeAfterWait(() => {
|
|
354
|
+
expectUrlMatchesWithParams(
|
|
355
|
+
getIFrameSrc(),
|
|
356
|
+
`http://${thoughtSpotHost}/?embedApp=true&profileAndHelpInNavBarHidden=false&isPNGInScheduledEmailsEnabled=true${defaultParamsPost}#/home`,
|
|
357
|
+
);
|
|
358
|
+
});
|
|
359
|
+
});
|
|
360
|
+
|
|
347
361
|
test('should set liveboardXLSXCSVDownload to true in url', async () => {
|
|
348
362
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
349
363
|
...defaultViewConfig,
|
package/src/embed/app.ts
CHANGED
|
@@ -537,6 +537,23 @@ export interface AppViewConfig extends AllEmbedViewConfig {
|
|
|
537
537
|
*/
|
|
538
538
|
isLiveboardStylingAndGroupingEnabled?: boolean;
|
|
539
539
|
|
|
540
|
+
/**
|
|
541
|
+
* This flag is used to enable/disable the png embedding of liveboard in scheduled mails
|
|
542
|
+
*
|
|
543
|
+
* Supported embed types: `AppEmbed`, `LiveboardEmbed`
|
|
544
|
+
* @type {boolean}
|
|
545
|
+
* @version SDK: 1.42.0 | ThoughtSpot: 10.14.0.cl
|
|
546
|
+
* @example
|
|
547
|
+
* ```js
|
|
548
|
+
* // Replace <EmbedComponent> with embed component name. For example, AppEmbed or LiveboardEmbed
|
|
549
|
+
* const embed = new <EmbedComponent>('#tsEmbed', {
|
|
550
|
+
* ... // other embed view config
|
|
551
|
+
* isPNGInScheduledEmailsEnabled: true,
|
|
552
|
+
* })
|
|
553
|
+
* ```
|
|
554
|
+
*/
|
|
555
|
+
isPNGInScheduledEmailsEnabled?: boolean;
|
|
556
|
+
|
|
540
557
|
/**
|
|
541
558
|
* This flag is used to enable the full height lazy load data.
|
|
542
559
|
*
|
|
@@ -619,7 +636,7 @@ export class AppEmbed extends V1Embed {
|
|
|
619
636
|
hideOrgSwitcher,
|
|
620
637
|
enableSearchAssist,
|
|
621
638
|
fullHeight,
|
|
622
|
-
dataPanelV2 =
|
|
639
|
+
dataPanelV2 = true,
|
|
623
640
|
hideLiveboardHeader = false,
|
|
624
641
|
showLiveboardTitle = true,
|
|
625
642
|
showLiveboardDescription = true,
|
|
@@ -645,6 +662,7 @@ export class AppEmbed extends V1Embed {
|
|
|
645
662
|
coverAndFilterOptionInPDF = false,
|
|
646
663
|
liveboardXLSXCSVDownload = false,
|
|
647
664
|
isLiveboardStylingAndGroupingEnabled,
|
|
665
|
+
isPNGInScheduledEmailsEnabled = false,
|
|
648
666
|
} = this.viewConfig;
|
|
649
667
|
|
|
650
668
|
let params: any = {};
|
|
@@ -728,6 +746,10 @@ export class AppEmbed extends V1Embed {
|
|
|
728
746
|
params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
|
|
729
747
|
}
|
|
730
748
|
|
|
749
|
+
if (isPNGInScheduledEmailsEnabled !== undefined) {
|
|
750
|
+
params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
|
|
751
|
+
}
|
|
752
|
+
|
|
731
753
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
732
754
|
params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
|
|
733
755
|
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
@@ -61,8 +61,8 @@ export interface SpotterEmbedViewConfig extends Omit<BaseViewConfig, 'primaryAct
|
|
|
61
61
|
* Flag to control Data panel experience
|
|
62
62
|
*
|
|
63
63
|
* Supported embed types: `SageEmbed`, `AppEmbed`, `SearchBarEmbed`, `LiveboardEmbed`, `SearchEmbed`
|
|
64
|
-
* @default
|
|
65
|
-
* @version SDK: 1.
|
|
64
|
+
* @default true
|
|
65
|
+
* @version SDK: 1.43.0 | ThoughtSpot Cloud: 10.14.0.cl
|
|
66
66
|
* @example
|
|
67
67
|
* ```js
|
|
68
68
|
* // Replace <EmbedComponent> with embed component name. For example, SageEmbed, AppEmbed, or SearchBarEmbed
|
|
@@ -41,6 +41,16 @@ const thoughtSpotHost = 'tshost';
|
|
|
41
41
|
const prefixParams = '&isLiveboardEmbed=true';
|
|
42
42
|
const prefixParamsVizEmbed = '&isLiveboardEmbed=true&isVizEmbed=true';
|
|
43
43
|
|
|
44
|
+
const mockGetSessionInfo = (mockSessionInfo?: any) => {
|
|
45
|
+
jest.spyOn(SessionInfoService, 'getSessionInfo').mockResolvedValue(mockSessionInfo || {
|
|
46
|
+
releaseVersion: '1.0.0',
|
|
47
|
+
userGUID: '1234567890',
|
|
48
|
+
currentOrgId: 1,
|
|
49
|
+
privileges: [],
|
|
50
|
+
mixpanelToken: '1234567890',
|
|
51
|
+
})
|
|
52
|
+
};
|
|
53
|
+
|
|
44
54
|
beforeAll(() => {
|
|
45
55
|
init({
|
|
46
56
|
thoughtSpotHost,
|
|
@@ -77,7 +87,7 @@ describe('Liveboard/viz embed tests', () => {
|
|
|
77
87
|
await executeAfterWait(() => {
|
|
78
88
|
expectUrlMatchesWithParams(
|
|
79
89
|
getIFrameSrc(),
|
|
80
|
-
`http://${thoughtSpotHost}/?embedApp=true${defaultParams}${prefixParams}&enableDataPanelV2=
|
|
90
|
+
`http://${thoughtSpotHost}/?embedApp=true${defaultParams}${prefixParams}&enableDataPanelV2=true#/embed/viz/${liveboardId}`,
|
|
81
91
|
);
|
|
82
92
|
});
|
|
83
93
|
});
|
|
@@ -158,6 +168,21 @@ describe('Liveboard/viz embed tests', () => {
|
|
|
158
168
|
});
|
|
159
169
|
});
|
|
160
170
|
|
|
171
|
+
test('should set isPNGInScheduledEmailsEnabled to true in url', async () => {
|
|
172
|
+
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
|
|
173
|
+
isPNGInScheduledEmailsEnabled: true,
|
|
174
|
+
...defaultViewConfig,
|
|
175
|
+
liveboardId,
|
|
176
|
+
} as LiveboardViewConfig);
|
|
177
|
+
liveboardEmbed.render();
|
|
178
|
+
await executeAfterWait(() => {
|
|
179
|
+
expectUrlMatchesWithParams(
|
|
180
|
+
getIFrameSrc(),
|
|
181
|
+
`http://${thoughtSpotHost}/?embedApp=true${defaultParams}&isPNGInScheduledEmailsEnabled=true${prefixParams}#/embed/viz/${liveboardId}`,
|
|
182
|
+
);
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
|
|
161
186
|
test('should set visible actions as empty array', async () => {
|
|
162
187
|
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
|
|
163
188
|
visibleActions: [],
|
|
@@ -631,6 +656,8 @@ describe('Liveboard/viz embed tests', () => {
|
|
|
631
656
|
|
|
632
657
|
test('navigateToLiveboard should trigger the navigate event with the correct path', async (done) => {
|
|
633
658
|
mockMessageChannel();
|
|
659
|
+
// mock getSessionInfo
|
|
660
|
+
mockGetSessionInfo();
|
|
634
661
|
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
|
|
635
662
|
...defaultViewConfig,
|
|
636
663
|
} as LiveboardViewConfig);
|
|
@@ -641,16 +668,24 @@ describe('Liveboard/viz embed tests', () => {
|
|
|
641
668
|
postMessageToParent(iframe.contentWindow, {
|
|
642
669
|
type: EmbedEvent.APP_INIT,
|
|
643
670
|
});
|
|
671
|
+
postMessageToParent(iframe.contentWindow, {
|
|
672
|
+
type: EmbedEvent.AuthInit,
|
|
673
|
+
});
|
|
674
|
+
liveboardEmbed.navigateToLiveboard('lb1', 'viz1');
|
|
644
675
|
});
|
|
676
|
+
|
|
645
677
|
executeAfterWait(() => {
|
|
646
|
-
liveboardEmbed.navigateToLiveboard('lb1', 'viz1');
|
|
647
678
|
expect(onSpy).toHaveBeenCalledWith(HostEvent.Navigate, 'embed/viz/lb1/viz1');
|
|
648
679
|
done();
|
|
649
|
-
});
|
|
680
|
+
}, 1002);
|
|
650
681
|
});
|
|
651
682
|
|
|
652
683
|
test('navigateToLiveboard with preRender', async (done) => {
|
|
653
684
|
mockMessageChannel();
|
|
685
|
+
|
|
686
|
+
// mock getSessionInfo
|
|
687
|
+
mockGetSessionInfo();
|
|
688
|
+
|
|
654
689
|
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
|
|
655
690
|
...defaultViewConfig,
|
|
656
691
|
preRenderId: 'test',
|
|
@@ -662,12 +697,15 @@ describe('Liveboard/viz embed tests', () => {
|
|
|
662
697
|
postMessageToParent(iframe.contentWindow, {
|
|
663
698
|
type: EmbedEvent.APP_INIT,
|
|
664
699
|
});
|
|
700
|
+
postMessageToParent(iframe.contentWindow, {
|
|
701
|
+
type: EmbedEvent.AuthInit,
|
|
702
|
+
});
|
|
665
703
|
});
|
|
666
704
|
executeAfterWait(() => {
|
|
667
705
|
liveboardEmbed.navigateToLiveboard('lb1', 'viz1');
|
|
668
706
|
expect(onSpy).toHaveBeenCalledWith(HostEvent.Navigate, 'embed/viz/lb1/viz1');
|
|
669
707
|
done();
|
|
670
|
-
});
|
|
708
|
+
}, 1002);
|
|
671
709
|
});
|
|
672
710
|
test('should set runtime parametere values in url params', async () => {
|
|
673
711
|
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
|
|
@@ -689,6 +727,21 @@ describe('Liveboard/viz embed tests', () => {
|
|
|
689
727
|
});
|
|
690
728
|
});
|
|
691
729
|
|
|
730
|
+
test('should set showSpotterLimitations parameter in url params', async () => {
|
|
731
|
+
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
|
|
732
|
+
...defaultViewConfig,
|
|
733
|
+
liveboardId,
|
|
734
|
+
showSpotterLimitations: true,
|
|
735
|
+
} as LiveboardViewConfig);
|
|
736
|
+
await liveboardEmbed.render();
|
|
737
|
+
await executeAfterWait(() => {
|
|
738
|
+
expectUrlMatchesWithParams(
|
|
739
|
+
getIFrameSrc(),
|
|
740
|
+
`http://${thoughtSpotHost}/?embedApp=true${defaultParams}${prefixParams}&showSpotterLimitations=true#/embed/viz/${liveboardId}`,
|
|
741
|
+
);
|
|
742
|
+
});
|
|
743
|
+
});
|
|
744
|
+
|
|
692
745
|
test('SetActiveTab Hostevent should not trigger the navigate event with the correct path, for vizEmbed', async () => {
|
|
693
746
|
const mockProcessTrigger = jest.spyOn(tsEmbed.TsEmbed.prototype, 'trigger');
|
|
694
747
|
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
|
|
@@ -820,7 +873,6 @@ describe('Liveboard/viz embed tests', () => {
|
|
|
820
873
|
expect((document.getElementById(libEmbed.getPreRenderIds().wrapper) as any)[ts]).toEqual(
|
|
821
874
|
libEmbed,
|
|
822
875
|
);
|
|
823
|
-
|
|
824
876
|
await executeAfterWait(() => {
|
|
825
877
|
const iframe = getIFrameEl();
|
|
826
878
|
postMessageToParent(iframe.contentWindow, {
|
|
@@ -852,7 +904,7 @@ describe('Liveboard/viz embed tests', () => {
|
|
|
852
904
|
done();
|
|
853
905
|
});
|
|
854
906
|
});
|
|
855
|
-
|
|
907
|
+
|
|
856
908
|
test('it should navigateToLiveboard with liveboard id is not passed with AuthInit event', async (done) => {
|
|
857
909
|
mockMessageChannel();
|
|
858
910
|
const consoleSpy = jest.spyOn(console, 'error');
|
|
@@ -861,13 +913,7 @@ describe('Liveboard/viz embed tests', () => {
|
|
|
861
913
|
preRenderId: testPreRenderId,
|
|
862
914
|
});
|
|
863
915
|
|
|
864
|
-
|
|
865
|
-
releaseVersion: '1.0.0',
|
|
866
|
-
userGUID: '1234567890',
|
|
867
|
-
currentOrgId: 1,
|
|
868
|
-
privileges: [],
|
|
869
|
-
mixpanelToken: '1234567890',
|
|
870
|
-
});
|
|
916
|
+
mockGetSessionInfo();
|
|
871
917
|
let resizeObserverCb: any;
|
|
872
918
|
(window as any).ResizeObserver =
|
|
873
919
|
window.ResizeObserver ||
|
|
@@ -905,7 +951,6 @@ describe('Liveboard/viz embed tests', () => {
|
|
|
905
951
|
});
|
|
906
952
|
});
|
|
907
953
|
|
|
908
|
-
|
|
909
954
|
await executeAfterWait(() => {
|
|
910
955
|
const iFrame = document.getElementById(
|
|
911
956
|
libEmbed.getPreRenderIds().child,
|
|
@@ -918,6 +963,59 @@ describe('Liveboard/viz embed tests', () => {
|
|
|
918
963
|
}, 1005);
|
|
919
964
|
});
|
|
920
965
|
|
|
966
|
+
|
|
967
|
+
test('should replace existing preRender when replaceExistingPreRender is true', async () => {
|
|
968
|
+
const testPreRenderId = 'testReplacePreRender';
|
|
969
|
+
|
|
970
|
+
// Stub ResizeObserver for JSDOM
|
|
971
|
+
(window as any).ResizeObserver = (window as any).ResizeObserver
|
|
972
|
+
|| jest.fn().mockImplementation(() => ({
|
|
973
|
+
disconnect: jest.fn(),
|
|
974
|
+
observe: jest.fn(),
|
|
975
|
+
unobserve: jest.fn(),
|
|
976
|
+
}));
|
|
977
|
+
|
|
978
|
+
// Create initial embed and show preRender (this will create the
|
|
979
|
+
// preRender wrapper/child)
|
|
980
|
+
const embedA = new LiveboardEmbed(getRootEl(), {
|
|
981
|
+
preRenderId: testPreRenderId,
|
|
982
|
+
});
|
|
983
|
+
|
|
984
|
+
await embedA.showPreRender();
|
|
985
|
+
|
|
986
|
+
await waitFor(() => !!getIFrameEl());
|
|
987
|
+
|
|
988
|
+
const ids = embedA.getPreRenderIds();
|
|
989
|
+
const oldWrapper = document.getElementById(ids.wrapper);
|
|
990
|
+
const oldChild = document.getElementById(ids.child);
|
|
991
|
+
|
|
992
|
+
const tsKey = '__tsEmbed';
|
|
993
|
+
expect((oldWrapper as any)[tsKey]).toBe(embedA);
|
|
994
|
+
|
|
995
|
+
// Create a new embed instance and preRender with
|
|
996
|
+
// replaceExistingPreRender = true
|
|
997
|
+
const embedB = new LiveboardEmbed(getRootEl(), {
|
|
998
|
+
preRenderId: testPreRenderId,
|
|
999
|
+
});
|
|
1000
|
+
const prerenderGenericSpy = jest.spyOn(embedB, 'prerenderGeneric');
|
|
1001
|
+
|
|
1002
|
+
await embedB.preRender(false, true);
|
|
1003
|
+
|
|
1004
|
+
await waitFor(() => (document.getElementById(ids.wrapper) as any)?.[tsKey] === embedB);
|
|
1005
|
+
|
|
1006
|
+
const newWrapper = document.getElementById(ids.wrapper);
|
|
1007
|
+
const newChild = document.getElementById(ids.child);
|
|
1008
|
+
|
|
1009
|
+
// Should have called prerenderGeneric for the new embed instance
|
|
1010
|
+
expect(prerenderGenericSpy).toHaveBeenCalledTimes(1);
|
|
1011
|
+
|
|
1012
|
+
// Wrapper should be replaced (new wrapper element), child iframe
|
|
1013
|
+
// may be reused
|
|
1014
|
+
expect(newWrapper).not.toBe(oldWrapper);
|
|
1015
|
+
|
|
1016
|
+
// __tsEmbed on wrapper should now point to the new embed instance
|
|
1017
|
+
expect((newWrapper as any)[tsKey]).toBe(embedB);
|
|
1018
|
+
});
|
|
921
1019
|
});
|
|
922
1020
|
|
|
923
1021
|
describe('LazyLoadingForFullHeight functionality', () => {
|
package/src/embed/liveboard.ts
CHANGED
|
@@ -46,7 +46,7 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
46
46
|
* incrementally as users scroll the page to view the charts and tables.
|
|
47
47
|
*
|
|
48
48
|
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 7.2.1
|
|
49
|
-
*
|
|
49
|
+
*
|
|
50
50
|
* Supported embed types: `LiveboardEmbed`
|
|
51
51
|
* @example
|
|
52
52
|
* ```js
|
|
@@ -61,7 +61,7 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
61
61
|
* This is the minimum height(in pixels) for a full-height Liveboard.
|
|
62
62
|
* Setting this height helps resolve issues with empty Liveboards and
|
|
63
63
|
* other screens navigable from a Liveboard.
|
|
64
|
-
*
|
|
64
|
+
*
|
|
65
65
|
* Supported embed types: `LiveboardEmbed`
|
|
66
66
|
* @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
|
|
67
67
|
* @default 500
|
|
@@ -90,7 +90,7 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
90
90
|
/**
|
|
91
91
|
* The Liveboard to display in the embedded view.
|
|
92
92
|
* Use either liveboardId or pinboardId to reference the Liveboard to embed.
|
|
93
|
-
*
|
|
93
|
+
*
|
|
94
94
|
* Supported embed types: `LiveboardEmbed`
|
|
95
95
|
* @version SDK: 1.3.0 | ThoughtSpot ts7.aug.cl, 7.2.1
|
|
96
96
|
* @example
|
|
@@ -108,7 +108,7 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
108
108
|
pinboardId?: string;
|
|
109
109
|
/**
|
|
110
110
|
* The visualization within the Liveboard to display.
|
|
111
|
-
*
|
|
111
|
+
*
|
|
112
112
|
* Supported embed types: `LiveboardEmbed`
|
|
113
113
|
* @version SDK: 1.9.1 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
|
|
114
114
|
* @example
|
|
@@ -123,7 +123,7 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
123
123
|
/**
|
|
124
124
|
* If set to true, all filter chips from a
|
|
125
125
|
* Liveboard page will be read-only (no X buttons)
|
|
126
|
-
*
|
|
126
|
+
*
|
|
127
127
|
* Supported embed types: `LiveboardEmbed`
|
|
128
128
|
* @version SDK: 1.3.0 | ThoughtSpot ts7.aug.cl, 7.2.1.sw
|
|
129
129
|
* @example
|
|
@@ -139,7 +139,7 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
139
139
|
* Array of visualization IDs which should be visible when the Liveboard
|
|
140
140
|
* renders. This can be changed by triggering the `SetVisibleVizs`
|
|
141
141
|
* event.
|
|
142
|
-
*
|
|
142
|
+
*
|
|
143
143
|
* Supported embed types: `LiveboardEmbed`
|
|
144
144
|
* @version SDK: 1.9.1 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
|
|
145
145
|
* @example
|
|
@@ -161,7 +161,7 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
161
161
|
/**
|
|
162
162
|
* Render embedded Liveboards and visualizations in the
|
|
163
163
|
* new Liveboard experience mode.
|
|
164
|
-
*
|
|
164
|
+
*
|
|
165
165
|
* Supported embed types: `LiveboardEmbed`
|
|
166
166
|
* @version SDK: 1.14.0 | ThoughtSpot: 8.6.0.cl, 8.8.1-sw
|
|
167
167
|
* @example
|
|
@@ -176,7 +176,7 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
176
176
|
/**
|
|
177
177
|
* Set a Liveboard tab as an active tab.
|
|
178
178
|
* Specify the tab ID.
|
|
179
|
-
*
|
|
179
|
+
*
|
|
180
180
|
* Supported embed types: `LiveboardEmbed`
|
|
181
181
|
* @example
|
|
182
182
|
* ```js
|
|
@@ -190,7 +190,7 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
190
190
|
activeTabId?: string;
|
|
191
191
|
/**
|
|
192
192
|
* Show or hide the tab panel of the embedded Liveboard.
|
|
193
|
-
*
|
|
193
|
+
*
|
|
194
194
|
* Supported embed types: `LiveboardEmbed`
|
|
195
195
|
* @version SDK: 1.25.0 | ThoughtSpot: 9.6.0.cl, 9.8.0.sw
|
|
196
196
|
* @example
|
|
@@ -211,7 +211,7 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
211
211
|
*
|
|
212
212
|
* Since, this will show preview images, be careful that it may show
|
|
213
213
|
* undesired data to the user when using row level security.
|
|
214
|
-
*
|
|
214
|
+
*
|
|
215
215
|
* Supported embed types: `LiveboardEmbed`
|
|
216
216
|
* @example
|
|
217
217
|
* ```js
|
|
@@ -227,8 +227,8 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
227
227
|
showPreviewLoader?: boolean;
|
|
228
228
|
/**
|
|
229
229
|
* The Liveboard to run on regular intervals to fetch the cdw token.
|
|
230
|
-
*
|
|
231
|
-
* Supported embed types: `LiveboardEmbed`
|
|
230
|
+
*
|
|
231
|
+
* Supported embed types: `LiveboardEmbed`
|
|
232
232
|
* @hidden
|
|
233
233
|
* @version SDK: 1.35.0 | ThoughtSpot:10.6.0.cl
|
|
234
234
|
* @example
|
|
@@ -242,7 +242,7 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
242
242
|
|
|
243
243
|
/**
|
|
244
244
|
* The Liveboard is set to force a token fetch during the initial load.
|
|
245
|
-
*
|
|
245
|
+
*
|
|
246
246
|
* Supported embed types: `LiveboardEmbed`
|
|
247
247
|
* @hidden
|
|
248
248
|
* @version SDK: 1.35.0 | ThoughtSpot:10.6.0.cl
|
|
@@ -259,7 +259,7 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
259
259
|
* The source connection ID for authentication.
|
|
260
260
|
* @hidden
|
|
261
261
|
* @version SDK: 1.35.0 | ThoughtSpot:10.6.0.cl
|
|
262
|
-
*
|
|
262
|
+
*
|
|
263
263
|
* Supported embed types: `LiveboardEmbed`
|
|
264
264
|
* @example
|
|
265
265
|
* ```js
|
|
@@ -273,7 +273,7 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
273
273
|
* The list of tab IDs to hide from the embedded.
|
|
274
274
|
* This Tabs will be hidden from their respective LBs.
|
|
275
275
|
* Use this to hide an tabID.
|
|
276
|
-
*
|
|
276
|
+
*
|
|
277
277
|
* Supported embed types: `LiveboardEmbed`
|
|
278
278
|
* @example
|
|
279
279
|
* ```js
|
|
@@ -293,7 +293,7 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
293
293
|
* Only the tabs specified in the array will be shown in the Liveboard.
|
|
294
294
|
*
|
|
295
295
|
* Use either `visibleTabs` or `hiddenTabs`.
|
|
296
|
-
*
|
|
296
|
+
*
|
|
297
297
|
* Supported embed types: `LiveboardEmbed`
|
|
298
298
|
* @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 10.1.0.sw
|
|
299
299
|
* @example
|
|
@@ -310,7 +310,7 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
310
310
|
visibleTabs?: string[];
|
|
311
311
|
/**
|
|
312
312
|
* This flag is used to enable/disable the styling and grouping in a Liveboard
|
|
313
|
-
*
|
|
313
|
+
*
|
|
314
314
|
* Supported embed types: `LiveboardEmbed`, `AppEmbed`
|
|
315
315
|
* @type {boolean}
|
|
316
316
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
@@ -324,9 +324,25 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
324
324
|
* ```
|
|
325
325
|
*/
|
|
326
326
|
isLiveboardStylingAndGroupingEnabled?: boolean;
|
|
327
|
+
/**
|
|
328
|
+
* This flag is used to enable/disable the png embedding of liveboard in scheduled mails
|
|
329
|
+
*
|
|
330
|
+
* Supported embed types: `AppEmbed`, `LiveboardEmbed`
|
|
331
|
+
* @type {boolean}
|
|
332
|
+
* @version SDK: 1.42.0 | ThoughtSpot: 10.14.0.cl
|
|
333
|
+
* @example
|
|
334
|
+
* ```js
|
|
335
|
+
* // Replace <EmbedComponent> with embed component name. For example, AppEmbed or LiveboardEmbed
|
|
336
|
+
* const embed = new <EmbedComponent>('#tsEmbed', {
|
|
337
|
+
* ... // other embed view config
|
|
338
|
+
* isPNGInScheduledEmailsEnabled: true,
|
|
339
|
+
* })
|
|
340
|
+
* ```
|
|
341
|
+
*/
|
|
342
|
+
isPNGInScheduledEmailsEnabled?: boolean;
|
|
327
343
|
/**
|
|
328
344
|
* This flag is used to enable the full height lazy load data.
|
|
329
|
-
*
|
|
345
|
+
*
|
|
330
346
|
* @example
|
|
331
347
|
* ```js
|
|
332
348
|
* const embed = new LiveboardEmbed('#embed-container', {
|
|
@@ -335,7 +351,7 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
335
351
|
* lazyLoadingForFullHeight: true,
|
|
336
352
|
* })
|
|
337
353
|
* ```
|
|
338
|
-
*
|
|
354
|
+
*
|
|
339
355
|
* @type {boolean}
|
|
340
356
|
* @default false
|
|
341
357
|
* @version SDK: 1.40.0 | ThoughtSpot:10.12.0.cl
|
|
@@ -343,13 +359,13 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
343
359
|
lazyLoadingForFullHeight?: boolean;
|
|
344
360
|
/**
|
|
345
361
|
* The margin to be used for lazy loading.
|
|
346
|
-
*
|
|
362
|
+
*
|
|
347
363
|
* For example, if the margin is set to '10px',
|
|
348
364
|
* the visualization will be loaded 10px before the its top edge is visible in the
|
|
349
365
|
* viewport.
|
|
350
|
-
*
|
|
366
|
+
*
|
|
351
367
|
* The format is similar to CSS margin.
|
|
352
|
-
*
|
|
368
|
+
*
|
|
353
369
|
* @example
|
|
354
370
|
* ```js
|
|
355
371
|
* const embed = new LiveboardEmbed('#embed-container', {
|
|
@@ -364,6 +380,22 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
|
|
|
364
380
|
* @version SDK: 1.40.0 | ThoughtSpot:10.12.0.cl
|
|
365
381
|
*/
|
|
366
382
|
lazyLoadingMargin?: string;
|
|
383
|
+
/**
|
|
384
|
+
* showSpotterLimitations : show limitation text
|
|
385
|
+
* of the spotter underneath the chat input.
|
|
386
|
+
* default is false.
|
|
387
|
+
*
|
|
388
|
+
* @example
|
|
389
|
+
* ```js
|
|
390
|
+
* const embed = new LiveboardEmbed('#embed-container', {
|
|
391
|
+
* // ...other options
|
|
392
|
+
* showSpotterLimitations: true,
|
|
393
|
+
* })
|
|
394
|
+
* ```
|
|
395
|
+
* @type {boolean}
|
|
396
|
+
* @version SDK: 1.41.1 | ThoughtSpot: 10.5.0.cl
|
|
397
|
+
*/
|
|
398
|
+
showSpotterLimitations?: boolean;
|
|
367
399
|
}
|
|
368
400
|
|
|
369
401
|
/**
|
|
@@ -429,7 +461,7 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
429
461
|
hideIrrelevantChipsInLiveboardTabs = false,
|
|
430
462
|
enableAskSage,
|
|
431
463
|
enable2ColumnLayout,
|
|
432
|
-
dataPanelV2 =
|
|
464
|
+
dataPanelV2 = true,
|
|
433
465
|
enableCustomColumnGroups = false,
|
|
434
466
|
oAuthPollingInterval,
|
|
435
467
|
isForceRedirect,
|
|
@@ -437,6 +469,8 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
437
469
|
coverAndFilterOptionInPDF = false,
|
|
438
470
|
liveboardXLSXCSVDownload = false,
|
|
439
471
|
isLiveboardStylingAndGroupingEnabled,
|
|
472
|
+
isPNGInScheduledEmailsEnabled = false,
|
|
473
|
+
showSpotterLimitations,
|
|
440
474
|
} = this.viewConfig;
|
|
441
475
|
|
|
442
476
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
@@ -504,6 +538,14 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
504
538
|
params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
|
|
505
539
|
}
|
|
506
540
|
|
|
541
|
+
if (isPNGInScheduledEmailsEnabled !== undefined) {
|
|
542
|
+
params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
if (showSpotterLimitations !== undefined) {
|
|
546
|
+
params[Param.ShowSpotterLimitations] = showSpotterLimitations;
|
|
547
|
+
}
|
|
548
|
+
|
|
507
549
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
508
550
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
509
551
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
package/src/embed/sage.spec.ts
CHANGED
|
@@ -18,7 +18,7 @@ const defaultConfig: SageViewConfig = {
|
|
|
18
18
|
hideAutocompleteSuggestions: false,
|
|
19
19
|
hideSampleQuestions: false,
|
|
20
20
|
isProductTour: false,
|
|
21
|
-
dataPanelV2:
|
|
21
|
+
dataPanelV2: true,
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
const thoughtSpotHost = 'tshost';
|
|
@@ -43,7 +43,7 @@ describe('Sage embed tests', () => {
|
|
|
43
43
|
await executeAfterWait(() => {
|
|
44
44
|
expectUrlMatch(
|
|
45
45
|
getIFrameSrc(),
|
|
46
|
-
`http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=
|
|
46
|
+
`http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSageAnswerHeader=false&hideAction=%5B%22reportError%22%5D#/embed/eureka`,
|
|
47
47
|
);
|
|
48
48
|
});
|
|
49
49
|
});
|
|
@@ -54,7 +54,7 @@ describe('Sage embed tests', () => {
|
|
|
54
54
|
await executeAfterWait(() => {
|
|
55
55
|
expectUrlMatch(
|
|
56
56
|
getIFrameSrc(),
|
|
57
|
-
`http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=
|
|
57
|
+
`http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=true&hideSageAnswerHeader=false&hideAction=%5B%22reportError%22%5D#/embed/eureka`,
|
|
58
58
|
);
|
|
59
59
|
});
|
|
60
60
|
});
|
|
@@ -68,7 +68,7 @@ describe('Sage embed tests', () => {
|
|
|
68
68
|
await executeAfterWait(() => {
|
|
69
69
|
expectUrlMatch(
|
|
70
70
|
getIFrameSrc(),
|
|
71
|
-
`http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=
|
|
71
|
+
`http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=true&isSageEmbed=true&disableWorksheetChange=true&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSageAnswerHeader=false&hideAction=%5B%22reportError%22%5D#/embed/eureka`,
|
|
72
72
|
);
|
|
73
73
|
});
|
|
74
74
|
});
|
|
@@ -82,7 +82,7 @@ describe('Sage embed tests', () => {
|
|
|
82
82
|
await executeAfterWait(() => {
|
|
83
83
|
expectUrlMatch(
|
|
84
84
|
getIFrameSrc(),
|
|
85
|
-
`http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=
|
|
85
|
+
`http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=true&hideEurekaSuggestions=false&isProductTour=false&hideSageAnswerHeader=false&hideAction=%5B%22reportError%22%5D#/embed/eureka`,
|
|
86
86
|
);
|
|
87
87
|
});
|
|
88
88
|
});
|
|
@@ -96,7 +96,7 @@ describe('Sage embed tests', () => {
|
|
|
96
96
|
await executeAfterWait(() => {
|
|
97
97
|
expectUrlMatch(
|
|
98
98
|
getIFrameSrc(),
|
|
99
|
-
`http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=
|
|
99
|
+
`http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSageAnswerHeader=true&hideAction=%5B%22reportError%22%5D#/embed/eureka`,
|
|
100
100
|
);
|
|
101
101
|
});
|
|
102
102
|
});
|
|
@@ -110,7 +110,7 @@ describe('Sage embed tests', () => {
|
|
|
110
110
|
await executeAfterWait(() => {
|
|
111
111
|
expectUrlMatch(
|
|
112
112
|
getIFrameSrc(),
|
|
113
|
-
`http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=
|
|
113
|
+
`http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=true&isProductTour=false&hideSageAnswerHeader=false&hideAction=%5B%22reportError%22%5D#/embed/eureka`,
|
|
114
114
|
);
|
|
115
115
|
});
|
|
116
116
|
});
|
|
@@ -137,7 +137,7 @@ describe('Sage embed tests', () => {
|
|
|
137
137
|
await executeAfterWait(() => {
|
|
138
138
|
expectUrlMatch(
|
|
139
139
|
getIFrameSrc(),
|
|
140
|
-
`http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=
|
|
140
|
+
`http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSageAnswerHeader=false&hideAction=%5B%22reportError%22%5D#/embed/eureka?worksheet=worksheet-id`,
|
|
141
141
|
);
|
|
142
142
|
});
|
|
143
143
|
});
|
|
@@ -154,7 +154,7 @@ describe('Sage embed tests', () => {
|
|
|
154
154
|
await executeAfterWait(() => {
|
|
155
155
|
expectUrlMatch(
|
|
156
156
|
getIFrameSrc(),
|
|
157
|
-
`http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=
|
|
157
|
+
`http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSageAnswerHeader=false&hideAction=%5B%22reportError%22%5D#/embed/eureka?worksheet=worksheet-id&query=test%20query`,
|
|
158
158
|
);
|
|
159
159
|
});
|
|
160
160
|
});
|
|
@@ -171,7 +171,7 @@ describe('Sage embed tests', () => {
|
|
|
171
171
|
await executeAfterWait(() => {
|
|
172
172
|
expectUrlMatch(
|
|
173
173
|
getIFrameSrc(),
|
|
174
|
-
`http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=
|
|
174
|
+
`http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=true&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&hideAction=%5B%22reportError%22%5D#/embed/eureka?executeSearch=true&query=test-query`,
|
|
175
175
|
);
|
|
176
176
|
});
|
|
177
177
|
});
|
|
@@ -189,4 +189,18 @@ describe('Sage embed tests', () => {
|
|
|
189
189
|
);
|
|
190
190
|
});
|
|
191
191
|
});
|
|
192
|
+
|
|
193
|
+
test('should set enableDataPanelV2 to false if data panel v2 flag is false', async () => {
|
|
194
|
+
const sageEmbed = new SageEmbed(getRootEl(), {
|
|
195
|
+
...defaultConfig,
|
|
196
|
+
dataPanelV2: false,
|
|
197
|
+
});
|
|
198
|
+
await sageEmbed.render();
|
|
199
|
+
await executeAfterWait(() => {
|
|
200
|
+
expectUrlMatch(
|
|
201
|
+
getIFrameSrc(),
|
|
202
|
+
`http://${thoughtSpotHost}/?embedApp=true&enableDataPanelV2=false&isSageEmbed=true&disableWorksheetChange=false&hideWorksheetSelector=false&hideEurekaSuggestions=false&isProductTour=false&hideSageAnswerHeader=false&hideAction=%5B%22reportError%22%5D#/embed/eureka`,
|
|
203
|
+
);
|
|
204
|
+
});
|
|
205
|
+
});
|
|
192
206
|
});
|