@thoughtspot/visual-embed-sdk 1.42.1-alpha.7 → 1.42.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 +4 -3
- package/cjs/src/css-variables.d.ts +0 -48
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts +20 -0
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +9 -4
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +62 -0
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.d.ts +1 -1
- package/cjs/src/embed/conversation.d.ts +16 -0
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +5 -2
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +25 -1
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts +1 -11
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.js +0 -1
- package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +5 -1
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +46 -0
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/sage.d.ts +4 -4
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +1 -3
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +0 -2
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +14 -42
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +0 -2
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/errors.js +1 -1
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/index.d.ts +3 -3
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +1 -2
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/react/all-types-export.d.ts +1 -2
- package/cjs/src/react/all-types-export.d.ts.map +1 -1
- package/cjs/src/react/all-types-export.js +5 -3
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/react/all-types-export.spec.js +0 -8
- package/cjs/src/react/all-types-export.spec.js.map +1 -1
- package/cjs/src/react/index.d.ts +1 -2
- 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/util.d.ts +1 -0
- package/cjs/src/react/util.d.ts.map +1 -1
- package/cjs/src/types.d.ts +58 -93
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +21 -46
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/custom-actions.d.ts.map +1 -1
- package/cjs/src/utils/custom-actions.js +9 -0
- package/cjs/src/utils/custom-actions.js.map +1 -1
- package/cjs/src/utils/custom-actions.spec.js +20 -0
- package/cjs/src/utils/custom-actions.spec.js.map +1 -1
- package/cjs/src/utils/processData.d.ts +1 -1
- package/cjs/src/utils/processData.d.ts.map +1 -1
- package/cjs/src/utils/processData.js +8 -8
- package/cjs/src/utils/processData.js.map +1 -1
- package/cjs/src/utils/processData.spec.js.map +1 -1
- package/dist/{index-DvNA626T.js → index-CjbriUI0.js} +1 -1
- package/dist/src/css-variables.d.ts +0 -48
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +20 -0
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/bodyless-conversation.d.ts +1 -1
- package/dist/src/embed/conversation.d.ts +16 -0
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts +1 -11
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/sage.d.ts +4 -4
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +0 -2
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/index.d.ts +3 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/react/all-types-export.d.ts +1 -2
- package/dist/src/react/all-types-export.d.ts.map +1 -1
- package/dist/src/react/index.d.ts +1 -2
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/react/util.d.ts +1 -0
- package/dist/src/react/util.d.ts.map +1 -1
- package/dist/src/types.d.ts +58 -93
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/custom-actions.d.ts.map +1 -1
- package/dist/src/utils/processData.d.ts +1 -1
- package/dist/src/utils/processData.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +86 -222
- package/dist/tsembed-react.js +230 -442
- package/dist/tsembed.es.js +85 -222
- package/dist/tsembed.js +228 -441
- package/dist/visual-embed-sdk-react-full.d.ts +104 -160
- package/dist/visual-embed-sdk-react.d.ts +95 -155
- package/dist/visual-embed-sdk.d.ts +95 -158
- package/lib/package.json +4 -3
- package/lib/src/css-variables.d.ts +0 -48
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts +20 -0
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +9 -4
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +62 -0
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.d.ts +1 -1
- package/lib/src/embed/conversation.d.ts +16 -0
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +5 -2
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +25 -1
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +1 -11
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.js +0 -1
- package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +5 -1
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +47 -1
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/sage.d.ts +4 -4
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +1 -3
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +0 -2
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +14 -42
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +0 -2
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/errors.js +1 -1
- package/lib/src/errors.js.map +1 -1
- package/lib/src/index.d.ts +3 -3
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +2 -2
- package/lib/src/index.js.map +1 -1
- package/lib/src/react/all-types-export.d.ts +1 -2
- package/lib/src/react/all-types-export.d.ts.map +1 -1
- package/lib/src/react/all-types-export.js +2 -2
- package/lib/src/react/all-types-export.js.map +1 -1
- package/lib/src/react/all-types-export.spec.js +0 -8
- package/lib/src/react/all-types-export.spec.js.map +1 -1
- package/lib/src/react/index.d.ts +1 -2
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +4 -3
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/util.d.ts +1 -0
- package/lib/src/react/util.d.ts.map +1 -1
- package/lib/src/types.d.ts +58 -93
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +20 -45
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/custom-actions.d.ts.map +1 -1
- package/lib/src/utils/custom-actions.js +9 -0
- package/lib/src/utils/custom-actions.js.map +1 -1
- package/lib/src/utils/custom-actions.spec.js +20 -0
- package/lib/src/utils/custom-actions.spec.js.map +1 -1
- package/lib/src/utils/processData.d.ts +1 -1
- package/lib/src/utils/processData.d.ts.map +1 -1
- package/lib/src/utils/processData.js +8 -8
- package/lib/src/utils/processData.js.map +1 -1
- package/lib/src/utils/processData.spec.js.map +1 -1
- package/package.json +4 -3
- package/src/css-variables.ts +0 -58
- package/src/embed/app.spec.ts +87 -0
- package/src/embed/app.ts +35 -4
- package/src/embed/bodyless-conversation.ts +1 -1
- package/src/embed/conversation.spec.ts +35 -1
- package/src/embed/conversation.ts +22 -0
- package/src/embed/hostEventClient/contracts.ts +0 -10
- package/src/embed/liveboard.spec.ts +60 -0
- package/src/embed/liveboard.ts +9 -0
- package/src/embed/sage.ts +4 -4
- package/src/embed/search.ts +1 -3
- package/src/embed/ts-embed.spec.ts +7 -9
- package/src/embed/ts-embed.ts +31 -67
- package/src/errors.ts +1 -1
- package/src/index.ts +3 -4
- package/src/react/all-types-export.spec.ts +1 -9
- package/src/react/all-types-export.ts +8 -10
- package/src/react/index.tsx +130 -155
- package/src/types.ts +56 -94
- package/src/utils/custom-actions.spec.ts +22 -0
- package/src/utils/custom-actions.ts +11 -0
- package/src/utils/processData.spec.ts +1 -0
- package/src/utils/processData.ts +11 -11
- package/cjs/src/api-intercept.d.ts +0 -31
- package/cjs/src/api-intercept.d.ts.map +0 -1
- package/cjs/src/api-intercept.js +0 -119
- package/cjs/src/api-intercept.js.map +0 -1
- package/cjs/src/api-intercept.spec.d.ts +0 -2
- package/cjs/src/api-intercept.spec.d.ts.map +0 -1
- package/cjs/src/api-intercept.spec.js +0 -122
- package/cjs/src/api-intercept.spec.js.map +0 -1
- package/dist/index-BCC3Z072.js +0 -7371
- package/dist/index-BEzW4MDA.js +0 -7371
- package/dist/index-BaESA9rq.js +0 -7371
- package/dist/index-CFNZIcKr.js +0 -7447
- package/dist/index-CqKTa1Fe.js +0 -7447
- package/dist/index-DFnPKcjZ.js +0 -7447
- package/dist/index-DhFH7b7U.js +0 -7447
- package/dist/src/api-intercept.d.ts +0 -31
- package/dist/src/api-intercept.d.ts.map +0 -1
- package/dist/src/api-intercept.spec.d.ts +0 -2
- package/dist/src/api-intercept.spec.d.ts.map +0 -1
- package/lib/src/api-intercept.d.ts +0 -31
- package/lib/src/api-intercept.d.ts.map +0 -1
- package/lib/src/api-intercept.js +0 -112
- package/lib/src/api-intercept.js.map +0 -1
- package/lib/src/api-intercept.spec.d.ts +0 -2
- package/lib/src/api-intercept.spec.d.ts.map +0 -1
- package/lib/src/api-intercept.spec.js +0 -119
- package/lib/src/api-intercept.spec.js.map +0 -1
- package/src/api-intercept.ts +0 -139
package/src/css-variables.ts
CHANGED
|
@@ -474,36 +474,16 @@ export interface CustomCssVariables {
|
|
|
474
474
|
*/
|
|
475
475
|
'--ts-var-checkbox-background-color'?: string;
|
|
476
476
|
|
|
477
|
-
/**
|
|
478
|
-
* Height of the tiles in the Liveboard.
|
|
479
|
-
*/
|
|
480
|
-
'--ts-var-viz-tile-height'?: string;
|
|
481
|
-
|
|
482
477
|
/**
|
|
483
478
|
* Background color of the layout in the Liveboard.
|
|
484
479
|
*/
|
|
485
480
|
'--ts-var-liveboard-layout-background'?: string;
|
|
486
481
|
|
|
487
|
-
/**
|
|
488
|
-
* Font color of the title of the layout in the Liveboard.
|
|
489
|
-
*/
|
|
490
|
-
'--ts-var-liveboard-layout-title-color'?: string;
|
|
491
|
-
|
|
492
|
-
/**
|
|
493
|
-
* Font size of the title of the layout in the Liveboard.
|
|
494
|
-
*/
|
|
495
|
-
'--ts-var-liveboard-layout-title-fontsize'?: string;
|
|
496
|
-
|
|
497
482
|
/**
|
|
498
483
|
* Background color of the header in the Liveboard.
|
|
499
484
|
*/
|
|
500
485
|
'--ts-var-liveboard-header-background'?: string;
|
|
501
486
|
|
|
502
|
-
/**
|
|
503
|
-
* Font size of the header in the Liveboard.
|
|
504
|
-
*/
|
|
505
|
-
'--ts-var-liveboard-header-fontsize'?: string;
|
|
506
|
-
|
|
507
487
|
/**
|
|
508
488
|
* Font color of the header in the Liveboard.
|
|
509
489
|
*/
|
|
@@ -541,13 +521,6 @@ export interface CustomCssVariables {
|
|
|
541
521
|
*/
|
|
542
522
|
'--ts-var-liveboard-group-padding'?: string;
|
|
543
523
|
|
|
544
|
-
/**
|
|
545
|
-
* Padding of the title of the groups in the Liveboard.
|
|
546
|
-
*
|
|
547
|
-
* Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable.
|
|
548
|
-
*/
|
|
549
|
-
'--ts-var-liveboard-group-title-padding'?: string;
|
|
550
|
-
|
|
551
524
|
/**
|
|
552
525
|
* Font size of the title of the groups in the Liveboard.
|
|
553
526
|
*
|
|
@@ -576,27 +549,6 @@ export interface CustomCssVariables {
|
|
|
576
549
|
*/
|
|
577
550
|
'--ts-var-liveboard-group-tile-title-font-weight'?: string;
|
|
578
551
|
|
|
579
|
-
/**
|
|
580
|
-
* Font size of the description of the groups in the Liveboard.
|
|
581
|
-
*
|
|
582
|
-
* Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable.
|
|
583
|
-
*/
|
|
584
|
-
'--ts-var-liveboard-group-description-font-size'?: string;
|
|
585
|
-
|
|
586
|
-
/**
|
|
587
|
-
* Font weight of the description of the groups in the Liveboard.
|
|
588
|
-
*
|
|
589
|
-
* Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable.
|
|
590
|
-
*/
|
|
591
|
-
'--ts-var-liveboard-group-description-font-weight'?: string;
|
|
592
|
-
|
|
593
|
-
/**
|
|
594
|
-
* Border of the group tiles in the Liveboard.
|
|
595
|
-
*
|
|
596
|
-
* Please enable the Liveboard styling and grouping feature in your ThoughtSpot instance and then set the isLiveboardStylingAndGrouping SDK flag to true to start modifying this CSS variable.
|
|
597
|
-
*/
|
|
598
|
-
'--ts-var-liveboard-group-tile-border'?: string;
|
|
599
|
-
|
|
600
552
|
/**
|
|
601
553
|
* Padding of the group tiles in the Liveboard.
|
|
602
554
|
*
|
|
@@ -741,16 +693,6 @@ export interface CustomCssVariables {
|
|
|
741
693
|
*/
|
|
742
694
|
'--ts-var-liveboard-tile-title-fontweight'?: string;
|
|
743
695
|
|
|
744
|
-
/**
|
|
745
|
-
* Font weight of the description of the tiles in the Liveboard.
|
|
746
|
-
*/
|
|
747
|
-
'--ts-var-liveboard-tile-description-font-weight'?: string;
|
|
748
|
-
|
|
749
|
-
/**
|
|
750
|
-
* Opacity of the description of the tiles in the Liveboard.
|
|
751
|
-
*/
|
|
752
|
-
'--ts-var-liveboard-tile-description-opacity'?: string;
|
|
753
|
-
|
|
754
696
|
/**
|
|
755
697
|
* Background color of the parameter chips in the Liveboard.
|
|
756
698
|
*/
|
package/src/embed/app.spec.ts
CHANGED
|
@@ -414,6 +414,34 @@ describe('App embed tests', () => {
|
|
|
414
414
|
});
|
|
415
415
|
});
|
|
416
416
|
|
|
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
|
+
|
|
417
445
|
test('Should add the tag to the iframe src', async () => {
|
|
418
446
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
419
447
|
...defaultViewConfig,
|
|
@@ -430,6 +458,51 @@ describe('App embed tests', () => {
|
|
|
430
458
|
});
|
|
431
459
|
});
|
|
432
460
|
|
|
461
|
+
test('Should add the hideTagFilterChips true to the iframe src', async () => {
|
|
462
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
463
|
+
...defaultViewConfig,
|
|
464
|
+
showPrimaryNavbar: false,
|
|
465
|
+
hideTagFilterChips: true,
|
|
466
|
+
} as AppViewConfig);
|
|
467
|
+
|
|
468
|
+
appEmbed.render();
|
|
469
|
+
await executeAfterWait(() => {
|
|
470
|
+
expectUrlMatchesWithParams(
|
|
471
|
+
getIFrameSrc(),
|
|
472
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}&hideTagFilterChips=true${defaultParamsPost}#/home`,
|
|
473
|
+
);
|
|
474
|
+
});
|
|
475
|
+
});
|
|
476
|
+
|
|
477
|
+
test('Should add the hideTagFilterChips false to the iframe src', async () => {
|
|
478
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
479
|
+
...defaultViewConfig,
|
|
480
|
+
showPrimaryNavbar: false,
|
|
481
|
+
hideTagFilterChips: false,
|
|
482
|
+
} as AppViewConfig);
|
|
483
|
+
appEmbed.render();
|
|
484
|
+
await executeAfterWait(() => {
|
|
485
|
+
expectUrlMatchesWithParams(
|
|
486
|
+
getIFrameSrc(),
|
|
487
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}&hideTagFilterChips=false${defaultParamsPost}#/home`,
|
|
488
|
+
);
|
|
489
|
+
});
|
|
490
|
+
});
|
|
491
|
+
|
|
492
|
+
test('Should not add hideTagFilterChips if it is undefined', async () => {
|
|
493
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
494
|
+
...defaultViewConfig,
|
|
495
|
+
showPrimaryNavbar: false,
|
|
496
|
+
} as AppViewConfig);
|
|
497
|
+
appEmbed.render();
|
|
498
|
+
await executeAfterWait(() => {
|
|
499
|
+
expectUrlMatchesWithParams(
|
|
500
|
+
getIFrameSrc(),
|
|
501
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false${defaultParams}${defaultParamsPost}#/home`,
|
|
502
|
+
);
|
|
503
|
+
});
|
|
504
|
+
});
|
|
505
|
+
|
|
433
506
|
test('Should add enableSearchAssist flagto the iframe src', async () => {
|
|
434
507
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
435
508
|
...defaultViewConfig,
|
|
@@ -550,6 +623,20 @@ describe('App embed tests', () => {
|
|
|
550
623
|
});
|
|
551
624
|
});
|
|
552
625
|
|
|
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
|
+
|
|
553
640
|
test('Should add default values of flags to the iframe src', async () => {
|
|
554
641
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
555
642
|
...defaultViewConfig,
|
package/src/embed/app.ts
CHANGED
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
AllEmbedViewConfig,
|
|
20
20
|
} from '../types';
|
|
21
21
|
import { V1Embed } from './ts-embed';
|
|
22
|
-
import { getInterceptInitData } from '../api-intercept';
|
|
23
22
|
|
|
24
23
|
/**
|
|
25
24
|
* Pages within the ThoughtSpot app that can be embedded.
|
|
@@ -368,6 +367,26 @@ export interface AppViewConfig extends AllEmbedViewConfig {
|
|
|
368
367
|
* ```
|
|
369
368
|
*/
|
|
370
369
|
tag?: string;
|
|
370
|
+
/**
|
|
371
|
+
* Hide tag filter chips that appear when content is filtered by tags.
|
|
372
|
+
* When enabled, this automatically:
|
|
373
|
+
* - Hides tag filter indicators/chips from the UI
|
|
374
|
+
*
|
|
375
|
+
* This provides a clean interface without tag-related UI elements.
|
|
376
|
+
*
|
|
377
|
+
* Supported embed types: `AppEmbed`
|
|
378
|
+
* @version SDK: 1.44.0 | ThoughtSpot: 10.15.0.cl
|
|
379
|
+
* @example
|
|
380
|
+
* ```js
|
|
381
|
+
* // Simple usage - automatically hides all tag-related UI
|
|
382
|
+
* const embed = new AppEmbed('#tsEmbed', {
|
|
383
|
+
* ... // other embed view config
|
|
384
|
+
* tag: 'Some Tag',
|
|
385
|
+
* hideTagFilterChips: true, // This is all you need!
|
|
386
|
+
* });
|
|
387
|
+
* ```
|
|
388
|
+
*/
|
|
389
|
+
hideTagFilterChips?: boolean;
|
|
371
390
|
/**
|
|
372
391
|
* The array of GUIDs to be hidden
|
|
373
392
|
*
|
|
@@ -626,6 +645,7 @@ export class AppEmbed extends V1Embed {
|
|
|
626
645
|
protected getEmbedParams() {
|
|
627
646
|
const {
|
|
628
647
|
tag,
|
|
648
|
+
hideTagFilterChips,
|
|
629
649
|
hideObjects,
|
|
630
650
|
liveboardV2,
|
|
631
651
|
showPrimaryNavbar,
|
|
@@ -656,6 +676,7 @@ export class AppEmbed extends V1Embed {
|
|
|
656
676
|
showLiveboardVerifiedBadge = true,
|
|
657
677
|
showLiveboardReverifyBanner = true,
|
|
658
678
|
hideIrrelevantChipsInLiveboardTabs = false,
|
|
679
|
+
isEnhancedFilterInteractivityEnabled = false,
|
|
659
680
|
homePageSearchBarMode,
|
|
660
681
|
isUnifiedSearchExperienceEnabled = true,
|
|
661
682
|
enablePendoHelp = true,
|
|
@@ -664,6 +685,7 @@ export class AppEmbed extends V1Embed {
|
|
|
664
685
|
liveboardXLSXCSVDownload = false,
|
|
665
686
|
isLiveboardStylingAndGroupingEnabled,
|
|
666
687
|
isPNGInScheduledEmailsEnabled = false,
|
|
688
|
+
isCentralizedLiveboardFilterUXEnabled = false,
|
|
667
689
|
isLinkParametersEnabled,
|
|
668
690
|
} = this.viewConfig;
|
|
669
691
|
|
|
@@ -678,6 +700,7 @@ export class AppEmbed extends V1Embed {
|
|
|
678
700
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
679
701
|
params[Param.IsFullAppEmbed] = true;
|
|
680
702
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
703
|
+
params[Param.IsEnhancedFilterInteractivityEnabled] = isEnhancedFilterInteractivityEnabled;
|
|
681
704
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
682
705
|
params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
|
|
683
706
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
@@ -729,9 +752,7 @@ export class AppEmbed extends V1Embed {
|
|
|
729
752
|
params[Param.enableAskSage] = enableAskSage;
|
|
730
753
|
}
|
|
731
754
|
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
if (isOnBeforeGetVizDataInterceptEnabled && !enableApiIntercept) {
|
|
755
|
+
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
735
756
|
|
|
736
757
|
params[
|
|
737
758
|
Param.IsOnBeforeGetVizDataInterceptEnabled
|
|
@@ -753,11 +774,21 @@ export class AppEmbed extends V1Embed {
|
|
|
753
774
|
if (isPNGInScheduledEmailsEnabled !== undefined) {
|
|
754
775
|
params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
|
|
755
776
|
}
|
|
777
|
+
|
|
778
|
+
if (hideTagFilterChips !== undefined) {
|
|
779
|
+
params[Param.HideTagFilterChips] = hideTagFilterChips;
|
|
780
|
+
}
|
|
756
781
|
|
|
757
782
|
if (isLinkParametersEnabled !== undefined) {
|
|
758
783
|
params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
|
|
759
784
|
}
|
|
760
785
|
|
|
786
|
+
if (isCentralizedLiveboardFilterUXEnabled != undefined) {
|
|
787
|
+
params[
|
|
788
|
+
Param.isCentralizedLiveboardFilterUXEnabled
|
|
789
|
+
] = isCentralizedLiveboardFilterUXEnabled;
|
|
790
|
+
}
|
|
791
|
+
|
|
761
792
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
762
793
|
params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
|
|
763
794
|
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
@@ -10,7 +10,7 @@ import { getQueryParamString } from '../utils';
|
|
|
10
10
|
*/
|
|
11
11
|
export interface SpotterAgentEmbedViewConfig extends Omit<BaseViewConfig, 'primaryAction'> {
|
|
12
12
|
/**
|
|
13
|
-
* The ID of the
|
|
13
|
+
* The ID of the Model to use for the conversation.
|
|
14
14
|
*/
|
|
15
15
|
worksheetId: string;
|
|
16
16
|
}
|
|
@@ -148,7 +148,7 @@ describe('ConversationEmbed', () => {
|
|
|
148
148
|
searchQuery: 'searchQuery',
|
|
149
149
|
},
|
|
150
150
|
dataPanelV2: true,
|
|
151
|
-
hiddenActions: [Action.InConversationTraining]
|
|
151
|
+
hiddenActions: [Action.InConversationTraining],
|
|
152
152
|
};
|
|
153
153
|
|
|
154
154
|
const conversationEmbed = new SpotterEmbed(getRootEl(), viewConfig);
|
|
@@ -282,6 +282,40 @@ describe('ConversationEmbed', () => {
|
|
|
282
282
|
);
|
|
283
283
|
});
|
|
284
284
|
|
|
285
|
+
it('should render the conversation embed with past conversations sidebar enabled', async () => {
|
|
286
|
+
const viewConfig: SpotterEmbedViewConfig = {
|
|
287
|
+
worksheetId: 'worksheetId',
|
|
288
|
+
searchOptions: {
|
|
289
|
+
searchQuery: 'searchQuery',
|
|
290
|
+
},
|
|
291
|
+
enablePastConversationsSidebar: true,
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
const conversationEmbed = new SpotterEmbed(getRootEl(), viewConfig);
|
|
295
|
+
await conversationEmbed.render();
|
|
296
|
+
expectUrlMatchesWithParams(
|
|
297
|
+
getIFrameSrc(),
|
|
298
|
+
`http://${thoughtSpotHost}/v2/?${defaultParams}&isSpotterExperienceEnabled=true&enablePastConversationsSidebar=true#/embed/insights/conv-assist?worksheet=worksheetId&query=searchQuery`,
|
|
299
|
+
);
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
it('should render the conversation embed with past conversations sidebar disabled', async () => {
|
|
303
|
+
const viewConfig: SpotterEmbedViewConfig = {
|
|
304
|
+
worksheetId: 'worksheetId',
|
|
305
|
+
searchOptions: {
|
|
306
|
+
searchQuery: 'searchQuery',
|
|
307
|
+
},
|
|
308
|
+
enablePastConversationsSidebar: false,
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
const conversationEmbed = new SpotterEmbed(getRootEl(), viewConfig);
|
|
312
|
+
await conversationEmbed.render();
|
|
313
|
+
expectUrlMatchesWithParams(
|
|
314
|
+
getIFrameSrc(),
|
|
315
|
+
`http://${thoughtSpotHost}/v2/?${defaultParams}&isSpotterExperienceEnabled=true&enablePastConversationsSidebar=false#/embed/insights/conv-assist?worksheet=worksheetId&query=searchQuery`,
|
|
316
|
+
);
|
|
317
|
+
});
|
|
318
|
+
|
|
285
319
|
it('should ensure deprecated ConversationEmbed class maintains same functionality as SpotterEmbed', async () => {
|
|
286
320
|
const viewConfig: SpotterEmbedViewConfig = {
|
|
287
321
|
worksheetId: 'worksheetId',
|
|
@@ -164,6 +164,22 @@ export interface SpotterEmbedViewConfig extends Omit<BaseViewConfig, 'primaryAct
|
|
|
164
164
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.13.0.cl
|
|
165
165
|
*/
|
|
166
166
|
excludeRuntimeParametersfromURL?: boolean;
|
|
167
|
+
/**
|
|
168
|
+
* enablePastConversationsSidebar : Controls the visibility of the past conversations
|
|
169
|
+
* sidebar.
|
|
170
|
+
*
|
|
171
|
+
* Supported embed types: `SpotterEmbed`
|
|
172
|
+
* @default false
|
|
173
|
+
* @example
|
|
174
|
+
* ```js
|
|
175
|
+
* const embed = new SpotterEmbed('#tsEmbed', {
|
|
176
|
+
* ... //other embed view config
|
|
177
|
+
* enablePastConversationsSidebar : true,
|
|
178
|
+
* })
|
|
179
|
+
* ```
|
|
180
|
+
* @version SDK: 1.43.0 | ThoughtSpot: 10.14.0.cl
|
|
181
|
+
*/
|
|
182
|
+
enablePastConversationsSidebar?: boolean;
|
|
167
183
|
}
|
|
168
184
|
|
|
169
185
|
/**
|
|
@@ -205,6 +221,7 @@ export class SpotterEmbed extends TsEmbed {
|
|
|
205
221
|
dataPanelV2,
|
|
206
222
|
showSpotterLimitations,
|
|
207
223
|
hideSampleQuestions,
|
|
224
|
+
enablePastConversationsSidebar,
|
|
208
225
|
runtimeFilters,
|
|
209
226
|
excludeRuntimeFiltersfromURL,
|
|
210
227
|
runtimeParameters,
|
|
@@ -246,10 +263,15 @@ export class SpotterEmbed extends TsEmbed {
|
|
|
246
263
|
excludeRuntimeFiltersfromURL,
|
|
247
264
|
runtimeParameters,
|
|
248
265
|
excludeRuntimeParametersfromURL,
|
|
266
|
+
enablePastConversationsSidebar
|
|
249
267
|
} = this.viewConfig;
|
|
250
268
|
const path = 'insights/conv-assist';
|
|
251
269
|
const queryParams = this.getEmbedParamsObject();
|
|
252
270
|
|
|
271
|
+
if (!isUndefined(enablePastConversationsSidebar)) {
|
|
272
|
+
queryParams[Param.EnablePastConversationsSidebar] = !!enablePastConversationsSidebar;
|
|
273
|
+
}
|
|
274
|
+
|
|
253
275
|
let query = '';
|
|
254
276
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
255
277
|
if (queryParamsString) {
|
|
@@ -7,7 +7,6 @@ export enum UIPassthroughEvent {
|
|
|
7
7
|
GetAvailableUIPassthroughs = 'getAvailableUiPassthroughs',
|
|
8
8
|
GetAnswerConfig = 'getAnswerPageConfig',
|
|
9
9
|
GetLiveboardConfig = 'getPinboardPageConfig',
|
|
10
|
-
GetUnsavedAnswerTML = 'getUnsavedAnswerTML',
|
|
11
10
|
}
|
|
12
11
|
|
|
13
12
|
// UI Passthrough Contract
|
|
@@ -64,15 +63,6 @@ export type UIPassthroughContractBase = {
|
|
|
64
63
|
request: any;
|
|
65
64
|
response: any;
|
|
66
65
|
};
|
|
67
|
-
[UIPassthroughEvent.GetUnsavedAnswerTML]: {
|
|
68
|
-
request: {
|
|
69
|
-
sessionId?: string;
|
|
70
|
-
vizId?: string;
|
|
71
|
-
};
|
|
72
|
-
response: {
|
|
73
|
-
tml: string;
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
66
|
};
|
|
77
67
|
|
|
78
68
|
// UI Passthrough Request and Response
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
defaultParams,
|
|
17
17
|
defaultParamsWithoutHiddenActions,
|
|
18
18
|
expectUrlMatchesWithParams,
|
|
19
|
+
expectUrlToHaveParamsWithValues,
|
|
19
20
|
postMessageToParent,
|
|
20
21
|
getIFrameEl,
|
|
21
22
|
mockMessageChannel,
|
|
@@ -138,6 +139,20 @@ describe('Liveboard/viz embed tests', () => {
|
|
|
138
139
|
});
|
|
139
140
|
});
|
|
140
141
|
|
|
142
|
+
test('should set LiveboardStylePanel in visible actions', async () => {
|
|
143
|
+
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
|
|
144
|
+
visibleActions: [Action.LiveboardStylePanel],
|
|
145
|
+
...defaultViewConfig,
|
|
146
|
+
liveboardId,
|
|
147
|
+
} as LiveboardViewConfig);
|
|
148
|
+
liveboardEmbed.render();
|
|
149
|
+
await executeAfterWait(() => {
|
|
150
|
+
expectUrlToHaveParamsWithValues(getIFrameSrc(), {
|
|
151
|
+
visibleAction: JSON.stringify([Action.LiveboardStylePanel]),
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
|
|
141
156
|
test('should set enable2ColumnLayout to true in url', async () => {
|
|
142
157
|
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
|
|
143
158
|
enable2ColumnLayout: true,
|
|
@@ -168,6 +183,21 @@ describe('Liveboard/viz embed tests', () => {
|
|
|
168
183
|
});
|
|
169
184
|
});
|
|
170
185
|
|
|
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
|
+
|
|
171
201
|
test('should set isPNGInScheduledEmailsEnabled to true in url', async () => {
|
|
172
202
|
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
|
|
173
203
|
isPNGInScheduledEmailsEnabled: true,
|
|
@@ -453,6 +483,36 @@ describe('Liveboard/viz embed tests', () => {
|
|
|
453
483
|
});
|
|
454
484
|
});
|
|
455
485
|
|
|
486
|
+
test('should add isCentralizedLiveboardFilterUXEnabled flag and set value to true to the iframe src', async () => {
|
|
487
|
+
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
|
|
488
|
+
...defaultViewConfig,
|
|
489
|
+
liveboardId,
|
|
490
|
+
isCentralizedLiveboardFilterUXEnabled: true,
|
|
491
|
+
} as LiveboardViewConfig);
|
|
492
|
+
liveboardEmbed.render();
|
|
493
|
+
await executeAfterWait(() => {
|
|
494
|
+
expectUrlMatchesWithParams(
|
|
495
|
+
getIFrameSrc(),
|
|
496
|
+
`http://${thoughtSpotHost}/?embedApp=true${defaultParams}&isCentralizedLiveboardFilterUXEnabled=true${prefixParams}#/embed/viz/${liveboardId}`,
|
|
497
|
+
);
|
|
498
|
+
});
|
|
499
|
+
});
|
|
500
|
+
|
|
501
|
+
test('should add isCentralizedLiveboardFilterUXEnabled flag and set value to false to the iframe src', async () => {
|
|
502
|
+
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
|
|
503
|
+
...defaultViewConfig,
|
|
504
|
+
liveboardId,
|
|
505
|
+
isCentralizedLiveboardFilterUXEnabled: false,
|
|
506
|
+
} as LiveboardViewConfig);
|
|
507
|
+
liveboardEmbed.render();
|
|
508
|
+
await executeAfterWait(() => {
|
|
509
|
+
expectUrlMatchesWithParams(
|
|
510
|
+
getIFrameSrc(),
|
|
511
|
+
`http://${thoughtSpotHost}/?embedApp=true${defaultParams}&isCentralizedLiveboardFilterUXEnabled=false${prefixParams}#/embed/viz/${liveboardId}`,
|
|
512
|
+
);
|
|
513
|
+
});
|
|
514
|
+
});
|
|
515
|
+
|
|
456
516
|
test('should not append runtime filters in URL if excludeRuntimeFiltersfromURL is true', async () => {
|
|
457
517
|
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
|
|
458
518
|
...defaultViewConfig,
|
package/src/embed/liveboard.ts
CHANGED
|
@@ -465,6 +465,7 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
465
465
|
showLiveboardVerifiedBadge = true,
|
|
466
466
|
showLiveboardReverifyBanner = true,
|
|
467
467
|
hideIrrelevantChipsInLiveboardTabs = false,
|
|
468
|
+
isEnhancedFilterInteractivityEnabled = false,
|
|
468
469
|
enableAskSage,
|
|
469
470
|
enable2ColumnLayout,
|
|
470
471
|
dataPanelV2 = true,
|
|
@@ -477,6 +478,7 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
477
478
|
isLiveboardStylingAndGroupingEnabled,
|
|
478
479
|
isPNGInScheduledEmailsEnabled = false,
|
|
479
480
|
showSpotterLimitations,
|
|
481
|
+
isCentralizedLiveboardFilterUXEnabled = false,
|
|
480
482
|
isLinkParametersEnabled,
|
|
481
483
|
} = this.viewConfig;
|
|
482
484
|
|
|
@@ -557,11 +559,18 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
557
559
|
params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
|
|
558
560
|
}
|
|
559
561
|
|
|
562
|
+
if (isCentralizedLiveboardFilterUXEnabled !== undefined) {
|
|
563
|
+
params[
|
|
564
|
+
Param.isCentralizedLiveboardFilterUXEnabled
|
|
565
|
+
] = isCentralizedLiveboardFilterUXEnabled;
|
|
566
|
+
}
|
|
567
|
+
|
|
560
568
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
561
569
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
562
570
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
563
571
|
params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
|
|
564
572
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
573
|
+
params[Param.IsEnhancedFilterInteractivityEnabled] = isEnhancedFilterInteractivityEnabled;
|
|
565
574
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
566
575
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
567
576
|
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
package/src/embed/sage.ts
CHANGED
|
@@ -69,12 +69,12 @@ export interface SageViewConfig
|
|
|
69
69
|
*/
|
|
70
70
|
hideSageAnswerHeader?: boolean;
|
|
71
71
|
/**
|
|
72
|
-
* Disable the
|
|
72
|
+
* Disable the data source selection option.
|
|
73
73
|
* @version SDK: 1.26.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw
|
|
74
74
|
*/
|
|
75
75
|
disableWorksheetChange?: boolean;
|
|
76
76
|
/**
|
|
77
|
-
* Hide the
|
|
77
|
+
* Hide the data source selection panel.
|
|
78
78
|
* @version SDK: 1.26.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw
|
|
79
79
|
*/
|
|
80
80
|
hideWorksheetSelector?: boolean;
|
|
@@ -92,7 +92,7 @@ export interface SageViewConfig
|
|
|
92
92
|
showObjectSuggestions?: boolean;
|
|
93
93
|
/**
|
|
94
94
|
* Show or hide sample questions.
|
|
95
|
-
* The sample questions are autogenerated based on the
|
|
95
|
+
* The sample questions are autogenerated based on the data Model.
|
|
96
96
|
* selected for the search operation.
|
|
97
97
|
*
|
|
98
98
|
* Supported embed types: `SageEmbed`
|
|
@@ -107,7 +107,7 @@ export interface SageViewConfig
|
|
|
107
107
|
*/
|
|
108
108
|
hideSampleQuestions?: boolean;
|
|
109
109
|
/**
|
|
110
|
-
* The data source GUID (
|
|
110
|
+
* The data source GUID (Model GUID) to set on load.
|
|
111
111
|
*/
|
|
112
112
|
dataSource?: string;
|
|
113
113
|
/**
|
package/src/embed/search.ts
CHANGED
|
@@ -26,7 +26,6 @@ import { ERROR_MESSAGE } from '../errors';
|
|
|
26
26
|
import { getAuthPromise } from './base';
|
|
27
27
|
import { getReleaseVersion } from '../auth';
|
|
28
28
|
import { getEmbedConfig } from './embedConfig';
|
|
29
|
-
import { getInterceptInitData } from '../api-intercept';
|
|
30
29
|
|
|
31
30
|
/**
|
|
32
31
|
* Configuration for search options.
|
|
@@ -443,8 +442,7 @@ export class SearchEmbed extends TsEmbed {
|
|
|
443
442
|
queryParams[Param.HideSearchBar] = true;
|
|
444
443
|
}
|
|
445
444
|
|
|
446
|
-
|
|
447
|
-
if (isOnBeforeGetVizDataInterceptEnabled && !enableApiIntercept) {
|
|
445
|
+
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
448
446
|
|
|
449
447
|
queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
450
448
|
}
|
|
@@ -90,7 +90,6 @@ beforeAll(() => {
|
|
|
90
90
|
const customisations = {
|
|
91
91
|
style: {
|
|
92
92
|
customCSS: {},
|
|
93
|
-
customCSSUrl: undefined as string | undefined,
|
|
94
93
|
},
|
|
95
94
|
content: {},
|
|
96
95
|
};
|
|
@@ -98,7 +97,6 @@ const customisations = {
|
|
|
98
97
|
const customisationsView = {
|
|
99
98
|
style: {
|
|
100
99
|
customCSS: {},
|
|
101
|
-
customCSSUrl: undefined as string | undefined,
|
|
102
100
|
},
|
|
103
101
|
content: {
|
|
104
102
|
strings: {
|
|
@@ -1047,7 +1045,7 @@ describe('Unit test case for ts embed', () => {
|
|
|
1047
1045
|
type: EmbedEvent.APP_INIT,
|
|
1048
1046
|
data: {},
|
|
1049
1047
|
};
|
|
1050
|
-
|
|
1048
|
+
|
|
1051
1049
|
// Create a SearchEmbed with valid custom actions to test
|
|
1052
1050
|
// CustomActionsValidationResult
|
|
1053
1051
|
const searchEmbed = new SearchEmbed(getRootEl(), {
|
|
@@ -1069,7 +1067,7 @@ describe('Unit test case for ts embed', () => {
|
|
|
1069
1067
|
}
|
|
1070
1068
|
]
|
|
1071
1069
|
});
|
|
1072
|
-
|
|
1070
|
+
|
|
1073
1071
|
searchEmbed.render();
|
|
1074
1072
|
const mockPort: any = {
|
|
1075
1073
|
postMessage: jest.fn(),
|
|
@@ -1118,7 +1116,7 @@ describe('Unit test case for ts embed', () => {
|
|
|
1118
1116
|
customVariablesForThirdPartyTools: {},
|
|
1119
1117
|
},
|
|
1120
1118
|
});
|
|
1121
|
-
|
|
1119
|
+
|
|
1122
1120
|
// Verify that CustomActionsValidationResult structure is
|
|
1123
1121
|
// correct
|
|
1124
1122
|
const appInitData = mockPort.postMessage.mock.calls[0][0].data;
|
|
@@ -1139,7 +1137,7 @@ describe('Unit test case for ts embed', () => {
|
|
|
1139
1137
|
})
|
|
1140
1138
|
])
|
|
1141
1139
|
);
|
|
1142
|
-
|
|
1140
|
+
|
|
1143
1141
|
// Verify actions are sorted by name (alphabetically)
|
|
1144
1142
|
expect(appInitData.customActions[0].name).toBe('Another Valid Action');
|
|
1145
1143
|
expect(appInitData.customActions[1].name).toBe('Valid Action');
|
|
@@ -2490,7 +2488,7 @@ describe('Unit test case for ts embed', () => {
|
|
|
2490
2488
|
});
|
|
2491
2489
|
|
|
2492
2490
|
afterAll((): void => {
|
|
2493
|
-
|
|
2491
|
+
window.location = location as any;
|
|
2494
2492
|
});
|
|
2495
2493
|
|
|
2496
2494
|
it('get url params for TS', () => {
|
|
@@ -3408,7 +3406,7 @@ describe('Unit test case for ts embed', () => {
|
|
|
3408
3406
|
new Error('Auth failed'),
|
|
3409
3407
|
);
|
|
3410
3408
|
const searchEmbed = new SearchEmbed(getRootEl(), defaultViewConfig);
|
|
3411
|
-
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {
|
|
3409
|
+
const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
|
|
3412
3410
|
await searchEmbed.render();
|
|
3413
3411
|
await executeAfterWait(() => {
|
|
3414
3412
|
expect(getRootEl().innerHTML).toContain('Not logged in');
|
|
@@ -3417,7 +3415,7 @@ describe('Unit test case for ts embed', () => {
|
|
|
3417
3415
|
window.dispatchEvent(onlineEvent);
|
|
3418
3416
|
}).not.toThrow();
|
|
3419
3417
|
});
|
|
3420
|
-
|
|
3418
|
+
|
|
3421
3419
|
errorSpy.mockReset();
|
|
3422
3420
|
});
|
|
3423
3421
|
|