@thoughtspot/visual-embed-sdk 1.33.3 → 1.33.4
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 +1 -1
- package/cjs/src/embed/app.d.ts +20 -6
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +3 -2
- 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/base.spec.js +13 -1
- package/cjs/src/embed/base.spec.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +4 -0
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +13 -0
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/liveboard.js +1 -1
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +2 -2
- package/cjs/src/embed/liveboard.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 +6 -6
- package/cjs/src/embed/search.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +1 -1
- package/cjs/src/errors.d.ts +1 -0
- package/cjs/src/errors.d.ts.map +1 -1
- package/cjs/src/errors.js +10 -9
- package/cjs/src/errors.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 +34 -19
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +29 -14
- package/cjs/src/types.js.map +1 -1
- package/dist/{index-Ck3m4Sis.js → index-Cl8Rsh6W.js} +1 -1
- package/dist/src/embed/app.d.ts +20 -6
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/conversation.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/types.d.ts +34 -19
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +50 -30
- package/dist/tsembed-react.js +49 -29
- package/dist/tsembed.es.js +50 -30
- package/dist/tsembed.js +49 -29
- package/dist/visual-embed-sdk-react-full.d.ts +54 -25
- package/dist/visual-embed-sdk-react.d.ts +54 -25
- package/dist/visual-embed-sdk.d.ts +54 -25
- package/lib/package.json +1 -1
- package/lib/src/embed/app.d.ts +20 -6
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +3 -2
- 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/base.spec.js +13 -1
- package/lib/src/embed/base.spec.js.map +1 -1
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +4 -0
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +13 -0
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/liveboard.js +1 -1
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +2 -2
- package/lib/src/embed/liveboard.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 +6 -6
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +1 -1
- package/lib/src/errors.d.ts +1 -0
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +10 -9
- package/lib/src/errors.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 +34 -19
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +29 -14
- package/lib/src/types.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +54 -25
- package/package.json +1 -1
- package/src/embed/app.spec.ts +15 -0
- package/src/embed/app.ts +23 -7
- package/src/embed/base.spec.ts +13 -1
- package/src/embed/conversation.spec.ts +16 -0
- package/src/embed/conversation.ts +4 -0
- package/src/embed/liveboard.spec.ts +2 -2
- package/src/embed/liveboard.ts +1 -1
- package/src/embed/search.spec.ts +6 -6
- package/src/embed/search.ts +1 -1
- package/src/embed/ts-embed.spec.ts +1 -1
- package/src/errors.ts +10 -9
- package/src/react/index.spec.tsx +1 -1
- package/src/types.ts +32 -17
|
@@ -388,7 +388,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
|
|
|
388
388
|
*/
|
|
389
389
|
dataPanelCustomGroupsAccordionInitialState?: DataPanelCustomColumnGroupsAccordionState;
|
|
390
390
|
/**
|
|
391
|
-
* This
|
|
391
|
+
* This attribute can be used to enable the two-column layout on an embedded Liveboard
|
|
392
392
|
* @type {boolean}
|
|
393
393
|
* @default false
|
|
394
394
|
* @version SDK: 1.32.0 | ThoughtSpot:10.1.0.cl
|
|
@@ -402,17 +402,17 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
|
|
|
402
402
|
*/
|
|
403
403
|
enable2ColumnLayout?: boolean;
|
|
404
404
|
/**
|
|
405
|
-
* Flag
|
|
405
|
+
* Flag that allows using `EmbedEvent.OnBeforeGetVizDataIntercept`.
|
|
406
406
|
* @version SDK : 1.29.0 | Thoughtspot : 10.1.0.cl
|
|
407
407
|
*/
|
|
408
408
|
isOnBeforeGetVizDataInterceptEnabled?: boolean;
|
|
409
409
|
/**
|
|
410
410
|
* Flag to use home page search bar mode
|
|
411
|
-
* @version SDK : 1.33.0 | Thoughtspot : 10.
|
|
411
|
+
* @version SDK : 1.33.0 | Thoughtspot : 10.3.0.cl
|
|
412
412
|
*/
|
|
413
413
|
homePageSearchBarMode?: HomePageSearchBarMode;
|
|
414
414
|
/**
|
|
415
|
-
* This flag
|
|
415
|
+
* This flag can be used to enable the compact header in Liveboard
|
|
416
416
|
* @type {boolean}
|
|
417
417
|
* @default false
|
|
418
418
|
* @version SDK: 1.35.0 | ThoughtSpot:10.3.0.cl
|
|
@@ -426,7 +426,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
|
|
|
426
426
|
*/
|
|
427
427
|
isLiveboardCompactHeaderEnabled?: boolean;
|
|
428
428
|
/**
|
|
429
|
-
* This flag
|
|
429
|
+
* This flag can be used to show or hide the Liveboard verified icon in the compact header.
|
|
430
430
|
* @type {boolean}
|
|
431
431
|
* @default true
|
|
432
432
|
* @version SDK: 1.35.0 | ThoughtSpot:10.4.0.cl
|
|
@@ -440,7 +440,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
|
|
|
440
440
|
*/
|
|
441
441
|
showLiveboardVerifiedBadge?: boolean;
|
|
442
442
|
/**
|
|
443
|
-
* This flag
|
|
443
|
+
* This flag can be used to show or hide the re-verify banner on the Liveboard compact header
|
|
444
444
|
* @type {boolean}
|
|
445
445
|
* @default true
|
|
446
446
|
* @version SDK: 1.35.0 | ThoughtSpot:10.4.0.cl
|
|
@@ -453,6 +453,20 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
|
|
|
453
453
|
* ```
|
|
454
454
|
*/
|
|
455
455
|
showLiveboardReverifyBanner?: boolean;
|
|
456
|
+
/**
|
|
457
|
+
* This flag is used to enable unified search experience for full app embed.
|
|
458
|
+
* @type {boolean}
|
|
459
|
+
* @default true
|
|
460
|
+
* @version SDK: 1.34.0 | ThoughtSpot:10.5.0.cl
|
|
461
|
+
* @example
|
|
462
|
+
* ```js
|
|
463
|
+
* const embed = new AppEmbed('#embed-container', {
|
|
464
|
+
* ... // other options
|
|
465
|
+
* isUnifiedSearchExperienceEnabled: true,
|
|
466
|
+
* })
|
|
467
|
+
* ```
|
|
468
|
+
*/
|
|
469
|
+
isUnifiedSearchExperienceEnabled?: boolean;
|
|
456
470
|
}
|
|
457
471
|
/**
|
|
458
472
|
* Embeds full ThoughtSpot experience in a host application.
|
|
@@ -2661,7 +2675,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
2661
2675
|
*/
|
|
2662
2676
|
enableV2Shell_experimental?: boolean;
|
|
2663
2677
|
/**
|
|
2664
|
-
* To set the initial state of the search bar in case of saved
|
|
2678
|
+
* To set the initial state of the search bar in case of saved Answers.
|
|
2665
2679
|
* @default true
|
|
2666
2680
|
* @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
|
|
2667
2681
|
* @example
|
|
@@ -2674,7 +2688,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
2674
2688
|
collapseSearchBar?: boolean;
|
|
2675
2689
|
/**
|
|
2676
2690
|
* This flag can be used to disable links inside the embedded app,
|
|
2677
|
-
* and
|
|
2691
|
+
* and disable redirection of links in a new tab.
|
|
2678
2692
|
* @example
|
|
2679
2693
|
* ```js
|
|
2680
2694
|
* const embed = new LiveboardEmbed('#embed', {
|
|
@@ -2686,7 +2700,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
2686
2700
|
disableRedirectionLinksInNewTab?: boolean;
|
|
2687
2701
|
/**
|
|
2688
2702
|
* Flag to control Data panel experience
|
|
2689
|
-
* @default
|
|
2703
|
+
* @default false
|
|
2690
2704
|
* @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
|
|
2691
2705
|
* @example
|
|
2692
2706
|
* ```js
|
|
@@ -3794,22 +3808,26 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3794
3808
|
*/
|
|
3795
3809
|
Rename = "rename",
|
|
3796
3810
|
/**
|
|
3797
|
-
* Emitted if the user wants to intercept the search execution
|
|
3798
|
-
* and implement logic to decide whether to run the search or not
|
|
3799
3811
|
*
|
|
3800
|
-
*
|
|
3812
|
+
* This event can be emitted to intercept search execution initiated by
|
|
3813
|
+
* the users and implement the logic to allow or restrict search execution.
|
|
3814
|
+
* You can can also show custom error text if the search query must be
|
|
3815
|
+
* restricted due to your application or business requirements.
|
|
3816
|
+
|
|
3817
|
+
* Prerequisite: Set `isOnBeforeGetVizDataInterceptEnabled` to `true`
|
|
3801
3818
|
* for this embed event to get emitted.
|
|
3802
3819
|
* @param: payload
|
|
3803
3820
|
* @param: responder
|
|
3804
3821
|
* Contains elements that lets developers define whether ThoughtSpot
|
|
3805
|
-
*
|
|
3822
|
+
* should run the search, and if not, what error message
|
|
3823
|
+
* should be shown to the user.
|
|
3806
3824
|
*
|
|
3807
|
-
* execute: When execute returns true
|
|
3808
|
-
* When execute returns false
|
|
3825
|
+
* execute: When execute returns `true`, the search will be run.
|
|
3826
|
+
* When execute returns `false`, the search will not be executed.
|
|
3809
3827
|
*
|
|
3810
|
-
* error: Developers can customize the
|
|
3811
|
-
*
|
|
3812
|
-
* @version SDK : 1.29.0 | Thoughtspot : 10.
|
|
3828
|
+
* error: Developers can customize the error message text when `execute`
|
|
3829
|
+
* returns `false` using the error parameter in responder.
|
|
3830
|
+
* @version SDK : 1.29.0 | Thoughtspot : 10.3.0.cl
|
|
3813
3831
|
* @example
|
|
3814
3832
|
*```js
|
|
3815
3833
|
* .on(EmbedEvent.OnBeforeGetVizDataIntercept,
|
|
@@ -3849,15 +3867,15 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
3849
3867
|
*/
|
|
3850
3868
|
OnBeforeGetVizDataIntercept = "onBeforeGetVizDataIntercept",
|
|
3851
3869
|
/**
|
|
3852
|
-
* Emitted when parameter changes in an
|
|
3853
|
-
* or
|
|
3870
|
+
* Emitted when parameter changes in an Answer
|
|
3871
|
+
* or Liveboard
|
|
3854
3872
|
*
|
|
3855
3873
|
* ```js
|
|
3856
3874
|
* liveboardEmbed.on(EmbedEvent.ParameterChanged, (payload) => {
|
|
3857
3875
|
* console.log('payload', payload);
|
|
3858
3876
|
* })
|
|
3859
3877
|
*```
|
|
3860
|
-
* @version SDK : 1.29.0 | Thoughtspot : 10.
|
|
3878
|
+
* @version SDK : 1.29.0 | Thoughtspot : 10.3.0.cl
|
|
3861
3879
|
*/
|
|
3862
3880
|
ParameterChanged = "parameterChanged"
|
|
3863
3881
|
}
|
|
@@ -4587,7 +4605,8 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
4587
4605
|
*
|
|
4588
4606
|
* `values` - An array of one or several values. The value definition on the
|
|
4589
4607
|
* data type you choose to filter on. For a complete list of supported data types, see
|
|
4590
|
-
* link:https://developers.thoughtspot.com/docs/runtime-filters#_supported_data_types[Supported data types]
|
|
4608
|
+
* link:https://developers.thoughtspot.com/docs/runtime-filters#_supported_data_types[Supported data types].
|
|
4609
|
+
*
|
|
4591
4610
|
* `type` - To update filters for date time, specify the date format type.
|
|
4592
4611
|
* For more information and examples, see link:https://developers.thoughtspot.com/docs/embed-liveboard#_date_filters[Date filters].
|
|
4593
4612
|
*
|
|
@@ -4875,7 +4894,8 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
4875
4894
|
ShowLiveboardVerifiedBadge = "showLiveboardVerifiedBadge",
|
|
4876
4895
|
ShowLiveboardReverifyBanner = "showLiveboardReverifyBanner",
|
|
4877
4896
|
LiveboardHeaderV2 = "isLiveboardHeaderV2Enabled",
|
|
4878
|
-
SpotterEnabled = "isSpotterExperienceEnabled"
|
|
4897
|
+
SpotterEnabled = "isSpotterExperienceEnabled",
|
|
4898
|
+
IsUnifiedSearchExperienceEnabled = "isUnifiedSearchExperienceEnabled"
|
|
4879
4899
|
}
|
|
4880
4900
|
/**
|
|
4881
4901
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -5845,7 +5865,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
5845
5865
|
*/
|
|
5846
5866
|
AIHighlights = "AIHighlights",
|
|
5847
5867
|
/**
|
|
5848
|
-
* Action ID for edit schedule action on schedule on homepage
|
|
5868
|
+
* Action ID for edit the schedule action on schedule on homepage
|
|
5849
5869
|
* @example
|
|
5850
5870
|
* ```js
|
|
5851
5871
|
* disabledActions: [Action.EditScheduleHomepage]
|
|
@@ -5906,7 +5926,16 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
5906
5926
|
* ```
|
|
5907
5927
|
* @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
|
|
5908
5928
|
*/
|
|
5909
|
-
KPIAnalysisCTA = "kpiAnalysisCTA"
|
|
5929
|
+
KPIAnalysisCTA = "kpiAnalysisCTA",
|
|
5930
|
+
/**
|
|
5931
|
+
* Action ID for disabling chip reorder in Answer and Liveboard
|
|
5932
|
+
* @example
|
|
5933
|
+
* ```js
|
|
5934
|
+
* const disabledActions = [Action.DisableChipReorder]
|
|
5935
|
+
* ```
|
|
5936
|
+
* @version SDK: 1.35.0 | Thoughtspot: 10.5.0.cl
|
|
5937
|
+
*/
|
|
5938
|
+
DisableChipReorder = "disableChipReorder"
|
|
5910
5939
|
}
|
|
5911
5940
|
export interface AnswerServiceType {
|
|
5912
5941
|
getAnswer?: (offset: number, batchSize: number) => any;
|
package/package.json
CHANGED
package/src/embed/app.spec.ts
CHANGED
|
@@ -405,6 +405,21 @@ describe('App embed tests', () => {
|
|
|
405
405
|
});
|
|
406
406
|
});
|
|
407
407
|
|
|
408
|
+
test('Should add isUnifiedSearchExperienceEnabled flag to the iframe src', async () => {
|
|
409
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
410
|
+
...defaultViewConfig,
|
|
411
|
+
isUnifiedSearchExperienceEnabled: false,
|
|
412
|
+
} as AppViewConfig);
|
|
413
|
+
|
|
414
|
+
appEmbed.render();
|
|
415
|
+
await executeAfterWait(() => {
|
|
416
|
+
expectUrlMatchesWithParams(
|
|
417
|
+
getIFrameSrc(),
|
|
418
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&isUnifiedSearchExperienceEnabled=false${defaultParams}${defaultParamsPost}#/home`,
|
|
419
|
+
);
|
|
420
|
+
});
|
|
421
|
+
});
|
|
422
|
+
|
|
408
423
|
test('Should add showLiveboardVerifiedBadge flag to the iframe src', async () => {
|
|
409
424
|
const appEmbed = new AppEmbed(getRootEl(), {
|
|
410
425
|
...defaultViewConfig,
|
package/src/embed/app.ts
CHANGED
|
@@ -366,7 +366,7 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
366
366
|
*/
|
|
367
367
|
dataPanelCustomGroupsAccordionInitialState?: DataPanelCustomColumnGroupsAccordionState;
|
|
368
368
|
/**
|
|
369
|
-
* This
|
|
369
|
+
* This attribute can be used to enable the two-column layout on an embedded Liveboard
|
|
370
370
|
* @type {boolean}
|
|
371
371
|
* @default false
|
|
372
372
|
* @version SDK: 1.32.0 | ThoughtSpot:10.1.0.cl
|
|
@@ -380,17 +380,17 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
380
380
|
*/
|
|
381
381
|
enable2ColumnLayout?: boolean;
|
|
382
382
|
/**
|
|
383
|
-
* Flag
|
|
383
|
+
* Flag that allows using `EmbedEvent.OnBeforeGetVizDataIntercept`.
|
|
384
384
|
* @version SDK : 1.29.0 | Thoughtspot : 10.1.0.cl
|
|
385
385
|
*/
|
|
386
386
|
isOnBeforeGetVizDataInterceptEnabled?: boolean;
|
|
387
387
|
/**
|
|
388
388
|
* Flag to use home page search bar mode
|
|
389
|
-
* @version SDK : 1.33.0 | Thoughtspot : 10.
|
|
389
|
+
* @version SDK : 1.33.0 | Thoughtspot : 10.3.0.cl
|
|
390
390
|
*/
|
|
391
391
|
homePageSearchBarMode?: HomePageSearchBarMode;
|
|
392
392
|
/**
|
|
393
|
-
* This flag
|
|
393
|
+
* This flag can be used to enable the compact header in Liveboard
|
|
394
394
|
* @type {boolean}
|
|
395
395
|
* @default false
|
|
396
396
|
* @version SDK: 1.35.0 | ThoughtSpot:10.3.0.cl
|
|
@@ -404,7 +404,7 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
404
404
|
*/
|
|
405
405
|
isLiveboardCompactHeaderEnabled?: boolean;
|
|
406
406
|
/**
|
|
407
|
-
* This flag
|
|
407
|
+
* This flag can be used to show or hide the Liveboard verified icon in the compact header.
|
|
408
408
|
* @type {boolean}
|
|
409
409
|
* @default true
|
|
410
410
|
* @version SDK: 1.35.0 | ThoughtSpot:10.4.0.cl
|
|
@@ -418,7 +418,7 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
418
418
|
*/
|
|
419
419
|
showLiveboardVerifiedBadge?: boolean;
|
|
420
420
|
/**
|
|
421
|
-
* This flag
|
|
421
|
+
* This flag can be used to show or hide the re-verify banner on the Liveboard compact header
|
|
422
422
|
* @type {boolean}
|
|
423
423
|
* @default true
|
|
424
424
|
* @version SDK: 1.35.0 | ThoughtSpot:10.4.0.cl
|
|
@@ -431,6 +431,20 @@ export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
|
431
431
|
* ```
|
|
432
432
|
*/
|
|
433
433
|
showLiveboardReverifyBanner?: boolean;
|
|
434
|
+
/**
|
|
435
|
+
* This flag is used to enable unified search experience for full app embed.
|
|
436
|
+
* @type {boolean}
|
|
437
|
+
* @default true
|
|
438
|
+
* @version SDK: 1.34.0 | ThoughtSpot:10.5.0.cl
|
|
439
|
+
* @example
|
|
440
|
+
* ```js
|
|
441
|
+
* const embed = new AppEmbed('#embed-container', {
|
|
442
|
+
* ... // other options
|
|
443
|
+
* isUnifiedSearchExperienceEnabled: true,
|
|
444
|
+
* })
|
|
445
|
+
* ```
|
|
446
|
+
*/
|
|
447
|
+
isUnifiedSearchExperienceEnabled?: boolean;
|
|
434
448
|
}
|
|
435
449
|
|
|
436
450
|
/**
|
|
@@ -468,7 +482,7 @@ export class AppEmbed extends V1Embed {
|
|
|
468
482
|
hideOrgSwitcher,
|
|
469
483
|
enableSearchAssist,
|
|
470
484
|
fullHeight,
|
|
471
|
-
dataPanelV2 =
|
|
485
|
+
dataPanelV2 = false,
|
|
472
486
|
hideLiveboardHeader = false,
|
|
473
487
|
showLiveboardTitle = true,
|
|
474
488
|
showLiveboardDescription = true,
|
|
@@ -487,6 +501,7 @@ export class AppEmbed extends V1Embed {
|
|
|
487
501
|
showLiveboardVerifiedBadge = true,
|
|
488
502
|
showLiveboardReverifyBanner = true,
|
|
489
503
|
homePageSearchBarMode,
|
|
504
|
+
isUnifiedSearchExperienceEnabled = true,
|
|
490
505
|
} = this.viewConfig;
|
|
491
506
|
|
|
492
507
|
let params = {};
|
|
@@ -503,6 +518,7 @@ export class AppEmbed extends V1Embed {
|
|
|
503
518
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
504
519
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
505
520
|
params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
|
|
521
|
+
params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
|
|
506
522
|
|
|
507
523
|
params = this.getBaseQueryParams(params);
|
|
508
524
|
|
package/src/embed/base.spec.ts
CHANGED
|
@@ -56,7 +56,7 @@ describe('Base TS Embed', () => {
|
|
|
56
56
|
authEE.on(auth.AuthStatus.FAILURE, (reason) => {
|
|
57
57
|
expect(reason).toEqual(auth.AuthFailureType.NO_COOKIE_ACCESS);
|
|
58
58
|
expect(window.alert).toBeCalledWith(
|
|
59
|
-
'Third
|
|
59
|
+
'Third-party cookie access is blocked on this browser. Please allow third-party cookies for this to work properly. \nYou can use `suppressNoCookieAccessAlert` to suppress this message.',
|
|
60
60
|
);
|
|
61
61
|
done();
|
|
62
62
|
});
|
|
@@ -411,6 +411,18 @@ describe('Base TS Embed', () => {
|
|
|
411
411
|
});
|
|
412
412
|
expect(embedConfigInstance.getEmbedConfig().inPopup).toBe(false);
|
|
413
413
|
});
|
|
414
|
+
test('@P0 @SCAL-226935 embedConfig should contain correct value of customCSSUrl when added in init ', async () => {
|
|
415
|
+
index.init({
|
|
416
|
+
thoughtSpotHost,
|
|
417
|
+
authType: index.AuthType.None,
|
|
418
|
+
customizations: {
|
|
419
|
+
style: {
|
|
420
|
+
customCSSUrl: 'test.com',
|
|
421
|
+
},
|
|
422
|
+
},
|
|
423
|
+
});
|
|
424
|
+
expect(embedConfigInstance.getEmbedConfig().customizations.style.customCSSUrl).toEqual('test.com');
|
|
425
|
+
});
|
|
414
426
|
});
|
|
415
427
|
|
|
416
428
|
describe('Base without init', () => {
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
defaultParamsWithoutHiddenActions as defaultParams,
|
|
15
15
|
expectUrlMatchesWithParams,
|
|
16
16
|
} from '../test/test-utils';
|
|
17
|
+
import { ERROR_MESSAGE } from '../errors';
|
|
17
18
|
|
|
18
19
|
const thoughtSpotHost = 'tshost';
|
|
19
20
|
|
|
@@ -43,4 +44,19 @@ describe('ConversationEmbed', () => {
|
|
|
43
44
|
`http://${thoughtSpotHost}/v2/?${defaultParams}&isSpotterExperienceEnabled=true#/embed/insights/conv-assist?worksheet=worksheetId&query=searchQuery`,
|
|
44
45
|
);
|
|
45
46
|
});
|
|
47
|
+
|
|
48
|
+
it('should handle error when worksheetId is not provided', async () => {
|
|
49
|
+
const viewConfig: ConversationViewConfig = {
|
|
50
|
+
worksheetId: '',
|
|
51
|
+
searchOptions: {
|
|
52
|
+
searchQuery: 'searchQuery',
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
const conversationEmbed = new ConversationEmbed(getRootEl(), viewConfig);
|
|
56
|
+
(conversationEmbed as any).handleError = jest.fn();
|
|
57
|
+
await conversationEmbed.render();
|
|
58
|
+
expect((conversationEmbed as any).handleError).toHaveBeenCalledWith(
|
|
59
|
+
ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND,
|
|
60
|
+
);
|
|
61
|
+
});
|
|
46
62
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ERROR_MESSAGE } from '../errors';
|
|
1
2
|
import { ViewConfig, Param } from '../types';
|
|
2
3
|
import { TsEmbed } from './ts-embed';
|
|
3
4
|
import { getQueryParamString } from '../utils';
|
|
@@ -49,6 +50,9 @@ export class ConversationEmbed extends TsEmbed {
|
|
|
49
50
|
searchOptions,
|
|
50
51
|
} = this.viewConfig;
|
|
51
52
|
const path = 'insights/conv-assist';
|
|
53
|
+
if (!worksheetId) {
|
|
54
|
+
this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
|
|
55
|
+
}
|
|
52
56
|
const queryParams = this.getBaseQueryParams();
|
|
53
57
|
queryParams[Param.SpotterEnabled] = true;
|
|
54
58
|
|
|
@@ -67,7 +67,7 @@ describe('Liveboard/viz embed tests', () => {
|
|
|
67
67
|
});
|
|
68
68
|
});
|
|
69
69
|
|
|
70
|
-
test('should render liveboard with data panel v2 flag set to
|
|
70
|
+
test('should render liveboard with data panel v2 flag set to false by default', async () => {
|
|
71
71
|
const liveboardEmbed = new LiveboardEmbed(getRootEl(), {
|
|
72
72
|
...defaultViewConfig,
|
|
73
73
|
liveboardId,
|
|
@@ -76,7 +76,7 @@ describe('Liveboard/viz embed tests', () => {
|
|
|
76
76
|
await executeAfterWait(() => {
|
|
77
77
|
expectUrlMatchesWithParams(
|
|
78
78
|
getIFrameSrc(),
|
|
79
|
-
`http://${thoughtSpotHost}/?embedApp=true${defaultParams}${prefixParams}&enableDataPanelV2=
|
|
79
|
+
`http://${thoughtSpotHost}/?embedApp=true${defaultParams}${prefixParams}&enableDataPanelV2=false#/embed/viz/${liveboardId}`,
|
|
80
80
|
);
|
|
81
81
|
});
|
|
82
82
|
});
|
package/src/embed/liveboard.ts
CHANGED
package/src/embed/search.spec.ts
CHANGED
|
@@ -52,7 +52,7 @@ describe('Search embed tests', () => {
|
|
|
52
52
|
await executeAfterWait(() => {
|
|
53
53
|
expectUrlMatchesWithParams(
|
|
54
54
|
getIFrameSrc(),
|
|
55
|
-
`http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&enableDataPanelV2=
|
|
55
|
+
`http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&enableDataPanelV2=false&dataSourceMode=expand&useLastSelectedSources=false${prefixParams}#/embed/answer`,
|
|
56
56
|
);
|
|
57
57
|
});
|
|
58
58
|
});
|
|
@@ -438,7 +438,7 @@ describe('Search embed tests', () => {
|
|
|
438
438
|
await executeAfterWait(() => {
|
|
439
439
|
expectUrlMatchesWithParams(
|
|
440
440
|
getIFrameSrc(),
|
|
441
|
-
`http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSourceMode=expand&enableDataPanelV2=
|
|
441
|
+
`http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSourceMode=expand&enableDataPanelV2=false&useLastSelectedSources=true${prefixParams}#/embed/saved-answer/${answerId}`,
|
|
442
442
|
);
|
|
443
443
|
});
|
|
444
444
|
});
|
|
@@ -453,7 +453,7 @@ describe('Search embed tests', () => {
|
|
|
453
453
|
await executeAfterWait(() => {
|
|
454
454
|
expectUrlMatchesWithParams(
|
|
455
455
|
getIFrameSrc(),
|
|
456
|
-
`http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSources=[%22data-source-1%22]&dataSourceMode=expand&enableDataPanelV2=
|
|
456
|
+
`http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSources=[%22data-source-1%22]&dataSourceMode=expand&enableDataPanelV2=false&useLastSelectedSources=false${prefixParams}#/embed/saved-answer/${answerId}`,
|
|
457
457
|
);
|
|
458
458
|
});
|
|
459
459
|
});
|
|
@@ -468,7 +468,7 @@ describe('Search embed tests', () => {
|
|
|
468
468
|
await executeAfterWait(() => {
|
|
469
469
|
expectUrlMatchesWithParams(
|
|
470
470
|
getIFrameSrc(),
|
|
471
|
-
`http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSources=[%22data-source-1%22]&dataSourceMode=expand&enableDataPanelV2=
|
|
471
|
+
`http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSources=[%22data-source-1%22]&dataSourceMode=expand&enableDataPanelV2=false&useLastSelectedSources=false${prefixParams}#/embed/saved-answer/${answerId}`,
|
|
472
472
|
);
|
|
473
473
|
});
|
|
474
474
|
});
|
|
@@ -499,7 +499,7 @@ describe('Search embed tests', () => {
|
|
|
499
499
|
await executeAfterWait(() => {
|
|
500
500
|
expectUrlMatchesWithParams(
|
|
501
501
|
getIFrameSrc(),
|
|
502
|
-
`http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSourceMode=expand&enableDataPanelV2=
|
|
502
|
+
`http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSourceMode=expand&enableDataPanelV2=false&useLastSelectedSources=false&hideSearchBar=true${prefixParams}#/embed/saved-answer/${answerId}`,
|
|
503
503
|
);
|
|
504
504
|
});
|
|
505
505
|
});
|
|
@@ -514,7 +514,7 @@ describe('Search embed tests', () => {
|
|
|
514
514
|
await executeAfterWait(() => {
|
|
515
515
|
expectUrlMatchesWithParams(
|
|
516
516
|
getIFrameSrc(),
|
|
517
|
-
`http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSourceMode=expand&enableDataPanelV2=
|
|
517
|
+
`http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSourceMode=expand&enableDataPanelV2=false&useLastSelectedSources=false&dataPanelCustomGroupsAccordionInitialState=EXPAND_FIRST${prefixParams}#/embed/saved-answer/${answerId}`,
|
|
518
518
|
);
|
|
519
519
|
});
|
|
520
520
|
});
|
package/src/embed/search.ts
CHANGED
|
@@ -330,7 +330,7 @@ export class SearchEmbed extends TsEmbed {
|
|
|
330
330
|
dataSources,
|
|
331
331
|
excludeRuntimeFiltersfromURL,
|
|
332
332
|
hideSearchBar,
|
|
333
|
-
dataPanelV2 =
|
|
333
|
+
dataPanelV2 = false,
|
|
334
334
|
useLastSelectedSources = false,
|
|
335
335
|
runtimeParameters,
|
|
336
336
|
collapseSearchBarInitially = false,
|
|
@@ -1615,7 +1615,7 @@ describe('Unit test case for ts embed', () => {
|
|
|
1615
1615
|
});
|
|
1616
1616
|
libEmbed.preRender();
|
|
1617
1617
|
|
|
1618
|
-
expect(logger.error).toHaveBeenCalledWith('PreRender
|
|
1618
|
+
expect(logger.error).toHaveBeenCalledWith('PreRender ID is required for preRender');
|
|
1619
1619
|
});
|
|
1620
1620
|
|
|
1621
1621
|
it('showPreRender should preRender if not available', async () => {
|
package/src/errors.ts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
export const ERROR_MESSAGE = {
|
|
2
2
|
INVALID_THOUGHTSPOT_HOST: 'Error parsing ThoughtSpot host. Please provide a valid URL.',
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND: 'Please select a worksheet to get started',
|
|
4
|
+
LIVEBOARD_VIZ_ID_VALIDATION: 'Please select a Liveboard to embed.',
|
|
5
|
+
TRIGGER_TIMED_OUT: 'Trigger timed-out in getting a response',
|
|
6
|
+
SEARCHEMBED_BETA_WRANING_MESSAGE: 'SearchEmbed is in Beta in this release.',
|
|
7
|
+
SAGE_EMBED_BETA_WARNING_MESSAGE: 'SageEmbed is in Beta in this release.',
|
|
8
|
+
THIRD_PARTY_COOKIE_BLOCKED_ALERT: 'Third-party cookie access is blocked on this browser. Please allow third-party cookies for this to work properly. \nYou can use `suppressNoCookieAccessAlert` to suppress this message.',
|
|
9
|
+
DUPLICATE_TOKEN_ERR: 'Duplicate token. Please issue a new token every time getAuthToken callback is called. See https://developers.thoughtspot.com/docs/?pageid=embed-auth#trusted-auth-embed for more details.',
|
|
9
10
|
SDK_NOT_INITIALIZED: 'SDK not initialized',
|
|
10
|
-
SESSION_INFO_FAILED: 'Failed to get session
|
|
11
|
+
SESSION_INFO_FAILED: 'Failed to get session information',
|
|
11
12
|
INVALID_TOKEN_ERROR: 'Received invalid token from getAuthToken callback or authToken endpoint.',
|
|
12
13
|
MIXPANEL_TOKEN_NOT_FOUND: 'Mixpanel token not found in session info',
|
|
13
|
-
PRERENDER_ID_MISSING: 'PreRender
|
|
14
|
+
PRERENDER_ID_MISSING: 'PreRender ID is required for preRender',
|
|
14
15
|
SYNC_STYLE_CALLED_BEFORE_RENDER: 'PreRender should be called before using syncPreRenderStyle',
|
|
15
16
|
CSP_VIOLATION_ALERT: 'CSP violation detected. Please check the console errors for more details.',
|
|
16
|
-
CSP_FRAME_HOST_VIOLATION_LOG_MESSAGE: 'Please
|
|
17
|
+
CSP_FRAME_HOST_VIOLATION_LOG_MESSAGE: 'Please set up CSP correctly for the application to start working. For more information, see https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts. \n If the issue persists, refer to https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts',
|
|
17
18
|
MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
|
|
18
19
|
};
|
package/src/react/index.spec.tsx
CHANGED
|
@@ -56,7 +56,7 @@ describe('React Components', () => {
|
|
|
56
56
|
),
|
|
57
57
|
).toBe(true);
|
|
58
58
|
expect(getIFrameSrc(container)).toBe(
|
|
59
|
-
`http://${thoughtSpotHost}/?hostAppUrl=local-host&viewPortHeight=768&viewPortWidth=1024&sdkVersion=${version}&authType=None&blockNonEmbedFullAppAccess=true&hideAction=[%22${Action.ReportError}%22,%22editACopy%22,%22saveAsView%22,%22updateTSL%22,%22editTSL%22,%22onDeleteAnswer%22]&overrideConsoleLogs=true&clientLogLevel=ERROR&enableDataPanelV2=
|
|
59
|
+
`http://${thoughtSpotHost}/?hostAppUrl=local-host&viewPortHeight=768&viewPortWidth=1024&sdkVersion=${version}&authType=None&blockNonEmbedFullAppAccess=true&hideAction=[%22${Action.ReportError}%22,%22editACopy%22,%22saveAsView%22,%22updateTSL%22,%22editTSL%22,%22onDeleteAnswer%22]&overrideConsoleLogs=true&clientLogLevel=ERROR&enableDataPanelV2=false&dataSourceMode=hide&useLastSelectedSources=false&isSearchEmbed=true&collapseSearchBarInitially=true&enableCustomColumnGroups=false&dataPanelCustomGroupsAccordionInitialState=EXPAND_ALL#/embed/answer`,
|
|
60
60
|
);
|
|
61
61
|
});
|
|
62
62
|
|