@thoughtspot/visual-embed-sdk 1.26.2 → 1.27.0-alpha.0
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 +1 -1
- package/cjs/package.json +1 -1
- package/cjs/src/auth.d.ts +4 -4
- package/cjs/src/auth.d.ts.map +1 -1
- package/cjs/src/auth.js +10 -4
- package/cjs/src/auth.js.map +1 -1
- package/cjs/src/embed/app.d.ts +15 -15
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +1 -1
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +28 -23
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +4 -3
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/sage.d.ts +48 -30
- package/cjs/src/embed/sage.d.ts.map +1 -1
- package/cjs/src/embed/sage.js +1 -1
- package/cjs/src/embed/sage.js.map +1 -1
- package/cjs/src/embed/search-bar.d.ts +22 -6
- package/cjs/src/embed/search-bar.d.ts.map +1 -1
- package/cjs/src/embed/search-bar.js.map +1 -1
- package/cjs/src/embed/search.d.ts +34 -19
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +7 -3
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/search.spec.js +10 -0
- package/cjs/src/embed/search.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +1 -0
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +27 -7
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +114 -0
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/react/index.spec.js +0 -12
- package/cjs/src/react/index.spec.js.map +1 -1
- package/cjs/src/types.d.ts +727 -242
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +653 -175
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.d.ts +2 -4
- package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/cjs/src/utils/graphql/answerService/answerService.js +2 -4
- package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/cjs/src/utils/processData.d.ts +6 -0
- package/cjs/src/utils/processData.d.ts.map +1 -1
- package/cjs/src/utils/processData.js +5 -1
- package/cjs/src/utils/processData.js.map +1 -1
- package/cjs/src/utils/processTrigger.js +1 -1
- package/dist/src/auth.d.ts +4 -4
- package/dist/src/auth.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +15 -15
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +28 -23
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/sage.d.ts +48 -30
- package/dist/src/embed/sage.d.ts.map +1 -1
- package/dist/src/embed/search-bar.d.ts +22 -6
- package/dist/src/embed/search-bar.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts +34 -19
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +1 -0
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/types.d.ts +727 -242
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/graphql/answerService/answerService.d.ts +2 -4
- package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/dist/src/utils/processData.d.ts +6 -0
- package/dist/src/utils/processData.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +706 -200
- package/dist/tsembed-react.js +705 -199
- package/dist/tsembed.es.js +709 -200
- package/dist/tsembed.js +707 -198
- package/dist/visual-embed-sdk-react-full.d.ts +898 -339
- package/dist/visual-embed-sdk-react.d.ts +898 -339
- package/dist/visual-embed-sdk.d.ts +898 -339
- package/lib/package.json +1 -1
- package/lib/src/auth.d.ts +4 -4
- package/lib/src/auth.d.ts.map +1 -1
- package/lib/src/auth.js +10 -4
- package/lib/src/auth.js.map +1 -1
- package/lib/src/embed/app.d.ts +15 -15
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +1 -1
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +28 -23
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +4 -3
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/sage.d.ts +48 -30
- package/lib/src/embed/sage.d.ts.map +1 -1
- package/lib/src/embed/sage.js +1 -1
- package/lib/src/embed/sage.js.map +1 -1
- package/lib/src/embed/search-bar.d.ts +22 -6
- package/lib/src/embed/search-bar.d.ts.map +1 -1
- package/lib/src/embed/search-bar.js.map +1 -1
- package/lib/src/embed/search.d.ts +34 -19
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +7 -3
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/search.spec.js +10 -0
- package/lib/src/embed/search.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +1 -0
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +28 -8
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +114 -0
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/react/index.spec.js +0 -12
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/types.d.ts +727 -242
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +653 -175
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.d.ts +2 -4
- package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
- package/lib/src/utils/graphql/answerService/answerService.js +2 -4
- package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
- package/lib/src/utils/processData.d.ts +6 -0
- package/lib/src/utils/processData.d.ts.map +1 -1
- package/lib/src/utils/processData.js +4 -1
- package/lib/src/utils/processData.js.map +1 -1
- package/lib/src/utils/processTrigger.js +1 -1
- package/lib/src/visual-embed-sdk.d.ts +898 -339
- package/package.json +1 -1
- package/src/auth.ts +10 -4
- package/src/embed/app.ts +20 -20
- package/src/embed/liveboard.ts +32 -27
- package/src/embed/sage.ts +48 -30
- package/src/embed/search-bar.tsx +22 -6
- package/src/embed/search.spec.ts +13 -0
- package/src/embed/search.ts +42 -22
- package/src/embed/ts-embed.spec.ts +132 -0
- package/src/embed/ts-embed.ts +32 -14
- package/src/react/index.spec.tsx +0 -29
- package/src/types.ts +727 -243
- package/src/utils/graphql/answerService/answerService.ts +2 -4
- package/src/utils/processData.ts +4 -1
- package/src/utils/processTrigger.ts +1 -1
- package/cjs/src/embed/TsEmbed.d.ts +0 -302
- package/cjs/src/embed/TsEmbed.d.ts.map +0 -1
- package/cjs/src/embed/TsEmbed.js +0 -851
- package/cjs/src/embed/TsEmbed.js.map +0 -1
- package/cjs/src/utils/answerService.d.ts +0 -10
- package/cjs/src/utils/answerService.d.ts.map +0 -1
- package/cjs/src/utils/answerService.js +0 -61
- package/cjs/src/utils/answerService.js.map +0 -1
- package/cjs/src/utils/answerService.spec.d.ts +0 -2
- package/cjs/src/utils/answerService.spec.d.ts.map +0 -1
- package/cjs/src/utils/answerService.spec.js +0 -31
- package/cjs/src/utils/answerService.spec.js.map +0 -1
- package/cjs/src/utils/authService/tokenisedAuthSerice.d.ts +0 -11
- package/cjs/src/utils/authService/tokenisedAuthSerice.d.ts.map +0 -1
- package/cjs/src/utils/authService/tokenisedAuthSerice.js +0 -44
- package/cjs/src/utils/authService/tokenisedAuthSerice.js.map +0 -1
- package/cjs/src/utils/authService.d.ts +0 -55
- package/cjs/src/utils/authService.d.ts.map +0 -1
- package/cjs/src/utils/authService.js +0 -139
- package/cjs/src/utils/authService.js.map +0 -1
- package/cjs/src/utils/authService.spec.d.ts +0 -2
- package/cjs/src/utils/authService.spec.d.ts.map +0 -1
- package/cjs/src/utils/authService.spec.js +0 -82
- package/cjs/src/utils/authService.spec.js.map +0 -1
- package/cjs/src/utils/graphql/graphql-request.spec.d.ts +0 -2
- package/cjs/src/utils/graphql/graphql-request.spec.d.ts.map +0 -1
- package/cjs/src/utils/graphql/graphql-request.spec.js +0 -39
- package/cjs/src/utils/graphql/graphql-request.spec.js.map +0 -1
- package/cjs/src/utils/logger.d.ts +0 -28
- package/cjs/src/utils/logger.d.ts.map +0 -1
- package/cjs/src/utils/logger.js +0 -82
- package/cjs/src/utils/logger.js.map +0 -1
- package/dist/src/utils/answerService.d.ts +0 -10
- package/dist/src/utils/answerService.d.ts.map +0 -1
- package/dist/src/utils/answerService.spec.d.ts +0 -2
- package/dist/src/utils/answerService.spec.d.ts.map +0 -1
- package/dist/src/utils/authService/tokenisedAuthSerice.d.ts +0 -11
- package/dist/src/utils/authService/tokenisedAuthSerice.d.ts.map +0 -1
- package/dist/src/utils/authService.d.ts +0 -55
- package/dist/src/utils/authService.d.ts.map +0 -1
- package/dist/src/utils/authService.spec.d.ts +0 -2
- package/dist/src/utils/authService.spec.d.ts.map +0 -1
- package/dist/src/utils/graphql/graphql-request.spec.d.ts +0 -2
- package/dist/src/utils/graphql/graphql-request.spec.d.ts.map +0 -1
- package/dist/src/utils/logger.d.ts +0 -28
- package/dist/src/utils/logger.d.ts.map +0 -1
- package/lib/src/embed/TsEmbed.d.ts +0 -302
- package/lib/src/embed/TsEmbed.d.ts.map +0 -1
- package/lib/src/embed/TsEmbed.js +0 -847
- package/lib/src/embed/TsEmbed.js.map +0 -1
- package/lib/src/utils/answerService.d.ts +0 -10
- package/lib/src/utils/answerService.d.ts.map +0 -1
- package/lib/src/utils/answerService.js +0 -57
- package/lib/src/utils/answerService.js.map +0 -1
- package/lib/src/utils/answerService.spec.d.ts +0 -2
- package/lib/src/utils/answerService.spec.d.ts.map +0 -1
- package/lib/src/utils/answerService.spec.js +0 -29
- package/lib/src/utils/answerService.spec.js.map +0 -1
- package/lib/src/utils/authService/tokenisedAuthSerice.d.ts +0 -11
- package/lib/src/utils/authService/tokenisedAuthSerice.d.ts.map +0 -1
- package/lib/src/utils/authService/tokenisedAuthSerice.js +0 -39
- package/lib/src/utils/authService/tokenisedAuthSerice.js.map +0 -1
- package/lib/src/utils/authService.d.ts +0 -55
- package/lib/src/utils/authService.d.ts.map +0 -1
- package/lib/src/utils/authService.js +0 -129
- package/lib/src/utils/authService.js.map +0 -1
- package/lib/src/utils/authService.spec.d.ts +0 -2
- package/lib/src/utils/authService.spec.d.ts.map +0 -1
- package/lib/src/utils/authService.spec.js +0 -80
- package/lib/src/utils/authService.spec.js.map +0 -1
- package/lib/src/utils/graphql/graphql-request.spec.d.ts +0 -2
- package/lib/src/utils/graphql/graphql-request.spec.d.ts.map +0 -1
- package/lib/src/utils/graphql/graphql-request.spec.js +0 -36
- package/lib/src/utils/graphql/graphql-request.spec.js.map +0 -1
- package/lib/src/utils/logger.d.ts +0 -28
- package/lib/src/utils/logger.d.ts.map +0 -1
- package/lib/src/utils/logger.js +0 -75
- package/lib/src/utils/logger.js.map +0 -1
package/package.json
CHANGED
package/src/auth.ts
CHANGED
|
@@ -72,8 +72,8 @@ export enum AuthStatus {
|
|
|
72
72
|
*/
|
|
73
73
|
LOGOUT = 'LOGOUT',
|
|
74
74
|
/**
|
|
75
|
-
* Emitted when inPopup
|
|
76
|
-
*
|
|
75
|
+
* Emitted when inPopup is true in the SAMLRedirect flow and the
|
|
76
|
+
* popup is waiting to be triggered either programmatically
|
|
77
77
|
* or by the trigger button.
|
|
78
78
|
*
|
|
79
79
|
* @version SDK: 1.19.0
|
|
@@ -126,8 +126,8 @@ export interface AuthEventEmitter {
|
|
|
126
126
|
*/
|
|
127
127
|
export enum AuthEvent {
|
|
128
128
|
/**
|
|
129
|
-
* Manually trigger the SSO popup. This is useful
|
|
130
|
-
* authStatus
|
|
129
|
+
* Manually trigger the SSO popup. This is useful when
|
|
130
|
+
* authStatus is SAMLRedirect/OIDCRedirect and inPopup is set to true
|
|
131
131
|
*/
|
|
132
132
|
TRIGGER_SSO_POPUP = 'TRIGGER_SSO_POPUP',
|
|
133
133
|
}
|
|
@@ -472,6 +472,12 @@ export const logout = async (embedConfig: EmbedConfig): Promise<boolean> => {
|
|
|
472
472
|
const { thoughtSpotHost } = embedConfig;
|
|
473
473
|
await fetchLogoutService(thoughtSpotHost);
|
|
474
474
|
resetCachedAuthToken();
|
|
475
|
+
const thoughtspotIframes = document.querySelectorAll('[data-ts-iframe=\'true\']');
|
|
476
|
+
if (thoughtspotIframes?.length) {
|
|
477
|
+
thoughtspotIframes.forEach((el) => {
|
|
478
|
+
el.parentElement.innerHTML = embedConfig.loginFailedMessage;
|
|
479
|
+
});
|
|
480
|
+
}
|
|
475
481
|
loggedInStatus = false;
|
|
476
482
|
return loggedInStatus;
|
|
477
483
|
};
|
package/src/embed/app.ts
CHANGED
|
@@ -57,43 +57,43 @@ export enum Page {
|
|
|
57
57
|
*/
|
|
58
58
|
export interface AppViewConfig extends Omit<ViewConfig, 'visibleTabs'> {
|
|
59
59
|
/**
|
|
60
|
-
* If true, the
|
|
60
|
+
* If true, the top navigation bar within the ThoughtSpot app
|
|
61
61
|
* is displayed. By default, the navigation bar is hidden.
|
|
62
|
-
* This flag also
|
|
62
|
+
* This flag also controls the homepage left navigation bar.
|
|
63
63
|
*/
|
|
64
64
|
showPrimaryNavbar?: boolean;
|
|
65
65
|
/**
|
|
66
|
-
*
|
|
67
|
-
* If showPrimaryNavbar is true,
|
|
68
|
-
* nav-
|
|
69
|
-
*
|
|
66
|
+
* Control the visibility of the left navigation bar on the Homepage.
|
|
67
|
+
* If showPrimaryNavbar is true, that is, if the Global and Homepage
|
|
68
|
+
* nav-bars are visible, this flag will only hide the homepage left nav-bar.
|
|
69
|
+
* The showPrimaryNavbar flag takes precedence over the hideHomepageLeftNav.
|
|
70
70
|
*
|
|
71
71
|
* @default false
|
|
72
72
|
* @version SDK: 1.27.0 | Thoughtspot: 9.8.0.cl
|
|
73
73
|
*/
|
|
74
74
|
hideHomepageLeftNav?: boolean;
|
|
75
75
|
/**
|
|
76
|
-
*
|
|
77
|
-
*
|
|
76
|
+
* Control the visibility of the help (?) and profile buttons on the
|
|
77
|
+
* Global nav-bar. By default, these buttons are visible on the nav-bar.
|
|
78
78
|
*/
|
|
79
79
|
disableProfileAndHelp?: boolean;
|
|
80
80
|
/**
|
|
81
|
-
*
|
|
82
|
-
*
|
|
81
|
+
* Control the visibility of the application switcher button on the nav-bar.
|
|
82
|
+
* By default, the application switcher is shown.
|
|
83
83
|
*/
|
|
84
84
|
hideApplicationSwitcher?: boolean;
|
|
85
85
|
/**
|
|
86
|
-
*
|
|
87
|
-
*
|
|
86
|
+
* Control the visibility of the Org switcher button on the nav-bar.
|
|
87
|
+
* By default, the Org switcher button is shown.
|
|
88
88
|
*/
|
|
89
89
|
hideOrgSwitcher?: boolean;
|
|
90
90
|
/**
|
|
91
|
-
* A URL path
|
|
91
|
+
* A URL path to the embedded application page
|
|
92
92
|
* If both path and pageId attributes are defined, the path definition
|
|
93
93
|
* takes precedence. This is the path post the `#/` in the URL of the standalone
|
|
94
94
|
* ThoughtSpot app. Use this to open the embedded view to a specific path.
|
|
95
95
|
*
|
|
96
|
-
* For eg, if you want the component to open to a specific
|
|
96
|
+
* For eg, if you want the component to open to a specific Liveboard
|
|
97
97
|
* you could set the path to `pinboard/<liveboardId>/tab/<tabId>`.
|
|
98
98
|
*
|
|
99
99
|
* @example
|
|
@@ -282,8 +282,10 @@ export class AppEmbed extends V1Embed {
|
|
|
282
282
|
*
|
|
283
283
|
* @param pageId The ID of the page to be embedded.
|
|
284
284
|
*/
|
|
285
|
-
|
|
286
|
-
const {
|
|
285
|
+
public getIFrameSrc(): string {
|
|
286
|
+
const {
|
|
287
|
+
pageId, path, modularHomeExperience,
|
|
288
|
+
} = this.viewConfig;
|
|
287
289
|
const pageRoute = this.formatPath(path) || this.getPageRoute(pageId, modularHomeExperience);
|
|
288
290
|
let url = `${this.getRootIframeSrc()}/${pageRoute}`;
|
|
289
291
|
|
|
@@ -301,7 +303,7 @@ export class AppEmbed extends V1Embed {
|
|
|
301
303
|
*/
|
|
302
304
|
protected updateIFrameHeight = (data: MessagePayload) => {
|
|
303
305
|
this.setIFrameHeight(Math.max(data.data, this.iFrame?.scrollHeight));
|
|
304
|
-
}
|
|
306
|
+
};
|
|
305
307
|
|
|
306
308
|
private embedIframeCenter = (data: MessagePayload, responder: any) => {
|
|
307
309
|
const obj = this.getIframeCenter();
|
|
@@ -309,9 +311,7 @@ export class AppEmbed extends V1Embed {
|
|
|
309
311
|
};
|
|
310
312
|
|
|
311
313
|
private setIframeHeightForNonEmbedLiveboard = (data: MessagePayload) => {
|
|
312
|
-
const {
|
|
313
|
-
height: frameHeight, ...restParams
|
|
314
|
-
} = this.viewConfig.frameParams || {};
|
|
314
|
+
const { height: frameHeight, ...restParams } = this.viewConfig.frameParams || {};
|
|
315
315
|
if (!data.data.currentPath.startsWith('/pinboard/')) {
|
|
316
316
|
this.setIFrameHeight(frameHeight || this.defaultHeight);
|
|
317
317
|
}
|
package/src/embed/liveboard.ts
CHANGED
|
@@ -28,7 +28,7 @@ import { V1Embed } from './ts-embed';
|
|
|
28
28
|
*
|
|
29
29
|
* @group Embed components
|
|
30
30
|
*/
|
|
31
|
-
export interface LiveboardViewConfig extends Omit<ViewConfig, 'hiddenHomepageModules' | 'hiddenHomeLeftNavItems'| 'reorderedHomepageModules'> {
|
|
31
|
+
export interface LiveboardViewConfig extends Omit<ViewConfig, 'hiddenHomepageModules' | 'hiddenHomeLeftNavItems' | 'reorderedHomepageModules'> {
|
|
32
32
|
/**
|
|
33
33
|
* If set to true, the embedded object container dynamically resizes
|
|
34
34
|
* according to the height of the Liveboard.
|
|
@@ -37,8 +37,8 @@ export interface LiveboardViewConfig extends Omit<ViewConfig, 'hiddenHomepageMod
|
|
|
37
37
|
*/
|
|
38
38
|
fullHeight?: boolean;
|
|
39
39
|
/**
|
|
40
|
-
* This is the minimum height(in pixels) for a full
|
|
41
|
-
* Setting this height helps
|
|
40
|
+
* This is the minimum height(in pixels) for a full-height Liveboard.
|
|
41
|
+
* Setting this height helps resolve issues with empty Liveboards and
|
|
42
42
|
* other screens navigable from a Liveboard.
|
|
43
43
|
*
|
|
44
44
|
* @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
|
|
@@ -51,7 +51,7 @@ export interface LiveboardViewConfig extends Omit<ViewConfig, 'hiddenHomepageMod
|
|
|
51
51
|
enableVizTransformations?: boolean;
|
|
52
52
|
/**
|
|
53
53
|
* The Liveboard to display in the embedded view.
|
|
54
|
-
* Use either
|
|
54
|
+
* Use either liveboardId or pinboardId to reference the Liveboard to embed.
|
|
55
55
|
*
|
|
56
56
|
* @version SDK: 1.3.0 | ThoughtSpot ts7.aug.cl, 7.2.1
|
|
57
57
|
*/
|
|
@@ -70,80 +70,85 @@ export interface LiveboardViewConfig extends Omit<ViewConfig, 'hiddenHomepageMod
|
|
|
70
70
|
* If set to true, all filter chips from a
|
|
71
71
|
* Liveboard page will be read-only (no X buttons)
|
|
72
72
|
*
|
|
73
|
-
* @version SDK: 1.3.0 | ThoughtSpot ts7.aug.cl, 7.2.1
|
|
73
|
+
* @version SDK: 1.3.0 | ThoughtSpot ts7.aug.cl, 7.2.1.sw
|
|
74
74
|
*/
|
|
75
75
|
preventLiveboardFilterRemoval?: boolean;
|
|
76
76
|
/**
|
|
77
|
-
* Array of
|
|
78
|
-
*
|
|
77
|
+
* Array of visualization IDs which should be visible when the Liveboard
|
|
78
|
+
* renders. This can be changed by triggering the `SetVisibleVizs`
|
|
79
79
|
* event.
|
|
80
80
|
*
|
|
81
81
|
* @version SDK: 1.9.1 | ThoughtSpot: 8.1.0.cl, 8.4.1-sw
|
|
82
82
|
*/
|
|
83
83
|
visibleVizs?: string[];
|
|
84
84
|
/**
|
|
85
|
-
* To support backward
|
|
85
|
+
* To support backward compatibility
|
|
86
86
|
*
|
|
87
87
|
* @hidden
|
|
88
88
|
*/
|
|
89
89
|
preventPinboardFilterRemoval?: boolean;
|
|
90
90
|
/**
|
|
91
|
-
* Render embedded Liveboards and visualizations in the
|
|
91
|
+
* Render embedded Liveboards and visualizations in the
|
|
92
|
+
* new Liveboard experience mode.
|
|
92
93
|
*
|
|
93
94
|
* @version SDK: 1.14.0 | ThoughtSpot: 8.6.0.cl, 8.8.1-sw
|
|
94
95
|
*/
|
|
95
96
|
liveboardV2?: boolean;
|
|
96
97
|
/**
|
|
97
|
-
*
|
|
98
|
+
* Set a Liveboard tab as an active tab.
|
|
99
|
+
* Specify the tab ID.
|
|
98
100
|
*
|
|
99
101
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1-sw
|
|
100
102
|
*/
|
|
101
103
|
activeTabId?: string;
|
|
102
104
|
/**
|
|
103
|
-
*
|
|
105
|
+
* Show or hide the tab panel of the embedded Liveboard.
|
|
104
106
|
*
|
|
105
|
-
* @version SDK: 1.25.0 | Thoughtspot: 9.6.0.cl
|
|
107
|
+
* @version SDK: 1.25.0 | Thoughtspot: 9.6.0.cl, 9.8.0.sw
|
|
106
108
|
*/
|
|
107
109
|
hideTabPanel?: boolean;
|
|
108
110
|
/**
|
|
109
|
-
* Show or hide Liveboard header
|
|
111
|
+
* Show or hide the Liveboard header.
|
|
110
112
|
*
|
|
111
|
-
* @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
113
|
+
* @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
|
|
112
114
|
* @default false
|
|
113
115
|
*/
|
|
114
116
|
hideLiveboardHeader?: boolean;
|
|
115
117
|
/**
|
|
116
|
-
* Show or hide Liveboard title
|
|
118
|
+
* Show or hide the Liveboard title.
|
|
117
119
|
*
|
|
118
|
-
* @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
120
|
+
* @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
|
|
119
121
|
* @default false
|
|
120
122
|
*/
|
|
121
123
|
showLiveboardTitle?: boolean;
|
|
122
124
|
/**
|
|
123
|
-
* Show or hide Liveboard description
|
|
125
|
+
* Show or hide the Liveboard description.
|
|
124
126
|
*
|
|
125
|
-
* @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
127
|
+
* @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
|
|
126
128
|
* @default false
|
|
127
129
|
*/
|
|
128
130
|
showLiveboardDescription?: boolean;
|
|
129
131
|
/**
|
|
130
|
-
*
|
|
132
|
+
* Control the position and visibility of
|
|
133
|
+
* the Liveboard header as the users scroll down the
|
|
134
|
+
* embedded Liveboard page.
|
|
131
135
|
*
|
|
132
136
|
* @example
|
|
133
137
|
* ```js
|
|
134
138
|
* const embed = new LiveboardEmbed('#embed', {
|
|
135
|
-
* ... // other
|
|
139
|
+
* ... // other Liveboard view config
|
|
136
140
|
* isLiveboardHeaderSticky: true,
|
|
137
141
|
* });
|
|
138
142
|
* ```
|
|
139
|
-
* @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl
|
|
143
|
+
* @version SDK: 1.26.0 | Thoughtspot: 9.7.0.cl, 9.8.0.sw
|
|
140
144
|
*/
|
|
141
145
|
isLiveboardHeaderSticky?: boolean;
|
|
142
146
|
}
|
|
143
147
|
|
|
144
148
|
/**
|
|
145
|
-
* Embed a ThoughtSpot Liveboard or
|
|
146
|
-
* waits for the authentication to complete, so
|
|
149
|
+
* Embed a ThoughtSpot Liveboard or visualization. When rendered it already
|
|
150
|
+
* waits for the authentication to complete, so you need not wait for
|
|
151
|
+
* `AuthStatus.SUCCESS`.
|
|
147
152
|
*
|
|
148
153
|
* @example
|
|
149
154
|
* ```js
|
|
@@ -256,9 +261,9 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
256
261
|
|
|
257
262
|
/**
|
|
258
263
|
* Construct the URL of the embedded ThoughtSpot Liveboard or visualization
|
|
259
|
-
* to be loaded within the
|
|
264
|
+
* to be loaded within the iFrame.
|
|
260
265
|
*/
|
|
261
|
-
private getIFrameSrc() {
|
|
266
|
+
private getIFrameSrc(): string {
|
|
262
267
|
const { vizId, activeTabId } = this.viewConfig;
|
|
263
268
|
const liveboardId = this.viewConfig.liveboardId ?? this.viewConfig.pinboardId;
|
|
264
269
|
|
|
@@ -307,7 +312,7 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
307
312
|
if (isUndefined(embedObj)) return;
|
|
308
313
|
|
|
309
314
|
const showDifferentLib = this.viewConfig.liveboardId
|
|
310
|
-
|
|
315
|
+
&& embedObj.viewConfig.liveboardId !== this.viewConfig.liveboardId;
|
|
311
316
|
|
|
312
317
|
if (showDifferentLib) {
|
|
313
318
|
const libId = this.viewConfig.liveboardId;
|
|
@@ -374,4 +379,4 @@ export class LiveboardEmbed extends V1Embed {
|
|
|
374
379
|
/**
|
|
375
380
|
* @hidden
|
|
376
381
|
*/
|
|
377
|
-
export class PinboardEmbed extends LiveboardEmbed {}
|
|
382
|
+
export class PinboardEmbed extends LiveboardEmbed { }
|
package/src/embed/sage.ts
CHANGED
|
@@ -18,14 +18,14 @@ import { V1Embed } from './ts-embed';
|
|
|
18
18
|
*/
|
|
19
19
|
export interface SearchOptions {
|
|
20
20
|
/**
|
|
21
|
-
* The query string to
|
|
21
|
+
* The query string to pass for Natural Language Search.
|
|
22
22
|
*/
|
|
23
23
|
searchQuery: string;
|
|
24
24
|
/**
|
|
25
|
-
* Boolean to
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* the
|
|
25
|
+
* Boolean to define if the search should be executed or not.
|
|
26
|
+
* If it is executed, the focus is placed on the results.
|
|
27
|
+
* If it’s not executed, the focus is placed at the end of
|
|
28
|
+
* the token string in the search bar.
|
|
29
29
|
*/
|
|
30
30
|
executeSearch?: boolean;
|
|
31
31
|
}
|
|
@@ -34,7 +34,7 @@ export interface SearchOptions {
|
|
|
34
34
|
* The configuration attributes for the embedded Natural language search view. Based on
|
|
35
35
|
* GPT and LLM.
|
|
36
36
|
*
|
|
37
|
-
* @version: SDK: 1.23.0 | ThoughtSpot: 9.
|
|
37
|
+
* @version: SDK: 1.23.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw
|
|
38
38
|
* @group Embed components
|
|
39
39
|
*/
|
|
40
40
|
export interface SageViewConfig
|
|
@@ -43,11 +43,11 @@ export interface SageViewConfig
|
|
|
43
43
|
'hiddenHomepageModules' | 'hiddenHomeLeftNavItems' | 'hiddenTabs' | 'visibleTabs' | 'reorderedHomepageModules'
|
|
44
44
|
> {
|
|
45
45
|
/**
|
|
46
|
-
* If set to true, a list of
|
|
46
|
+
* If set to true, a list of Liveboard and Answers related
|
|
47
47
|
* to the natural language search will be shown below the
|
|
48
48
|
* AI generated answer.
|
|
49
49
|
*
|
|
50
|
-
* @deprecated Currently
|
|
50
|
+
* @deprecated Currently Liveboard and Answers related
|
|
51
51
|
* to the natural language search will not be shown for sage
|
|
52
52
|
* embed
|
|
53
53
|
*/
|
|
@@ -64,57 +64,75 @@ export interface SageViewConfig
|
|
|
64
64
|
*/
|
|
65
65
|
isProductTour?: boolean;
|
|
66
66
|
/**
|
|
67
|
-
*
|
|
67
|
+
* Show or hide the search bar title.
|
|
68
68
|
*
|
|
69
|
-
* @version SDK: 1.26.0 | Thoughtspot: 9.8.0.cl
|
|
69
|
+
* @version SDK: 1.26.0 | Thoughtspot: 9.8.0.cl, 9.8.0.sw
|
|
70
70
|
*/
|
|
71
71
|
hideSearchBarTitle?: boolean;
|
|
72
72
|
/**
|
|
73
|
-
*
|
|
74
|
-
*
|
|
73
|
+
* Show or hide the Answer header, that is, the `AI Answer` title
|
|
74
|
+
* at the top of the Answer page.
|
|
75
75
|
*
|
|
76
|
-
* @version SDK: 1.26.0 | Thoughtspot: 9.
|
|
76
|
+
* @version SDK: 1.26.0 | Thoughtspot: 9.10.0.cl
|
|
77
77
|
*/
|
|
78
78
|
hideSageAnswerHeader?: boolean;
|
|
79
79
|
/**
|
|
80
|
-
*
|
|
80
|
+
* Disable the worksheet selection option.
|
|
81
81
|
*
|
|
82
|
-
* @version SDK: 1.26.0 | Thoughtspot: 9.9.0.
|
|
82
|
+
* @version SDK: 1.26.0 | Thoughtspot: 9.8.0.cl, 9.8.0.sw
|
|
83
83
|
*/
|
|
84
84
|
disableWorksheetChange?: boolean;
|
|
85
85
|
/**
|
|
86
|
-
*
|
|
86
|
+
* Hide the worksheet selection panel.
|
|
87
|
+
*
|
|
88
|
+
* @version SDK: 1.26.0 | Thoughtspot: 9.8.0.cl, 9.8.0.sw
|
|
87
89
|
*/
|
|
88
90
|
hideWorksheetSelector?: boolean;
|
|
89
91
|
/**
|
|
90
|
-
*
|
|
91
|
-
* default false
|
|
92
|
+
* Show or hide autocomplete suggestions for the search query string.
|
|
92
93
|
*
|
|
93
|
-
* @version SDK: 1.26.0 | Thoughtspot: 9.9.0.
|
|
94
|
+
* @version SDK: 1.26.0 | Thoughtspot: 9.8.0.cl, 9.8.0.sw
|
|
94
95
|
*/
|
|
95
96
|
hideAutocompleteSuggestions?: boolean;
|
|
96
97
|
/**
|
|
97
|
-
*
|
|
98
|
+
* Show or hide autocomplete suggestions for the search query string.
|
|
98
99
|
*
|
|
99
|
-
* @deprecated
|
|
100
|
-
*
|
|
100
|
+
* @deprecated
|
|
101
|
+
* Currently, the object suggestions will not be shown for Natural Language Search.
|
|
102
|
+
* You can use {@link hideAutocompleteSuggestions} instead.
|
|
101
103
|
*/
|
|
102
104
|
showObjectSuggestions?: boolean;
|
|
103
105
|
/**
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
+
* Show or hide sample questions.
|
|
107
|
+
* The sample questions are autogenerated based on the worksheet
|
|
108
|
+
* selected for the search operation.
|
|
106
109
|
*
|
|
107
|
-
* @version SDK: 1.26.0 | Thoughtspot: 9.
|
|
110
|
+
* @version SDK: 1.26.0 | Thoughtspot: 9.8.0.cl, 9.8.0.sw
|
|
108
111
|
*/
|
|
109
112
|
hideSampleQuestions?: boolean;
|
|
110
113
|
/**
|
|
111
|
-
* The data source GUID to set on load.
|
|
114
|
+
* The data source GUID (Worksheet GUID) to set on load.
|
|
112
115
|
*/
|
|
113
116
|
dataSource?: string;
|
|
114
117
|
/**
|
|
115
|
-
*
|
|
118
|
+
* Includes the following properties:
|
|
116
119
|
*
|
|
117
|
-
*
|
|
120
|
+
* `searchQuery`: The search query string to pass in the search bar.
|
|
121
|
+
* Supports Natural Language Search queries.
|
|
122
|
+
*
|
|
123
|
+
* `executeSearch`: Boolean to define if the search should be executed or not.
|
|
124
|
+
* If it is executed, the focus is placed on the results.
|
|
125
|
+
* If it’s not executed, the focus is placed at the end of
|
|
126
|
+
* the token string in the search bar.
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```js
|
|
130
|
+
* searchOptions: {
|
|
131
|
+
* searchQuery: 'average sales by country and product type',
|
|
132
|
+
* executeSearch: true,
|
|
133
|
+
* }
|
|
134
|
+
* ```
|
|
135
|
+
* @version SDK: 1.26.0 | Thoughtspot: 9.8.0.cl, 9.8.0.sw
|
|
118
136
|
*/
|
|
119
137
|
searchOptions?: SearchOptions;
|
|
120
138
|
}
|
|
@@ -129,7 +147,7 @@ export const HiddenActionItemByDefaultForSageEmbed = [
|
|
|
129
147
|
Action.Share,
|
|
130
148
|
];
|
|
131
149
|
/**
|
|
132
|
-
* Embed ThoughtSpot LLM and GPT
|
|
150
|
+
* Embed ThoughtSpot LLM and GPT-based Natural Language Search component.
|
|
133
151
|
*
|
|
134
152
|
* @version: SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl, 9.5.1-sw
|
|
135
153
|
* @group Embed components
|
|
@@ -194,7 +212,7 @@ export class SageEmbed extends V1Embed {
|
|
|
194
212
|
*
|
|
195
213
|
* @returns {string} iframe url
|
|
196
214
|
*/
|
|
197
|
-
|
|
215
|
+
public getIFrameSrc(): string {
|
|
198
216
|
const path = 'eureka';
|
|
199
217
|
const postHashObj = {};
|
|
200
218
|
const tsPostHashParams = this.getThoughtSpotPostUrlParams();
|
package/src/embed/search-bar.tsx
CHANGED
|
@@ -20,25 +20,41 @@ export interface SearchBarViewConfig
|
|
|
20
20
|
> {
|
|
21
21
|
/**
|
|
22
22
|
* The array of data source GUIDs to set on load.
|
|
23
|
-
* Only a single
|
|
23
|
+
* Only a single data source is supported currently.
|
|
24
24
|
*
|
|
25
|
-
* @deprecated Use dataSource instead
|
|
25
|
+
* @deprecated Use `dataSource` instead
|
|
26
26
|
*/
|
|
27
27
|
dataSources?: string[];
|
|
28
28
|
/**
|
|
29
29
|
* The array of data source GUIDs to set on load.
|
|
30
30
|
*
|
|
31
|
-
* @version: SDK: 1.19.0
|
|
31
|
+
* @version: SDK: 1.19.0, ThoughtSpot 9.0.0.cl, 9.0.1.sw
|
|
32
32
|
*/
|
|
33
33
|
dataSource?: string;
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* Boolean to define if the last selected data source should be used
|
|
36
36
|
*
|
|
37
|
-
* @version: SDK: 1.24.0
|
|
37
|
+
* @version: SDK: 1.24.0, ThoughtSpot 9.5.0.cl, 9.5.0.sw
|
|
38
38
|
*/
|
|
39
39
|
useLastSelectedSources?: boolean;
|
|
40
40
|
/**
|
|
41
|
-
* Configuration for search options
|
|
41
|
+
* Configuration for search options.
|
|
42
|
+
* Includes the following properties:
|
|
43
|
+
*
|
|
44
|
+
* `searchTokenString`: Search tokens to pass in the query.
|
|
45
|
+
*
|
|
46
|
+
* `executeSearch`: Boolean to define if the search should be executed or not.
|
|
47
|
+
* If it is executed, the focus is placed on the results.
|
|
48
|
+
* If it’s not executed, the focus is placed at the end of
|
|
49
|
+
* the token string in the search bar.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```js
|
|
53
|
+
* searchOptions: {
|
|
54
|
+
* searchTokenString: '[quantity purchased] [region]',
|
|
55
|
+
* executeSearch: true,
|
|
56
|
+
* }
|
|
57
|
+
* ```
|
|
42
58
|
*/
|
|
43
59
|
searchOptions?: SearchOptions;
|
|
44
60
|
}
|
package/src/embed/search.spec.ts
CHANGED
|
@@ -411,4 +411,17 @@ describe('Search embed tests', () => {
|
|
|
411
411
|
);
|
|
412
412
|
});
|
|
413
413
|
});
|
|
414
|
+
test('should set hideSearchBar to true if hideSearchBar flag is true', async () => {
|
|
415
|
+
const searchEmbed = new SearchEmbed(getRootEl(), {
|
|
416
|
+
...defaultViewConfig,
|
|
417
|
+
hideSearchBar: true,
|
|
418
|
+
});
|
|
419
|
+
searchEmbed.render();
|
|
420
|
+
await executeAfterWait(() => {
|
|
421
|
+
expectUrlMatchesWithParams(
|
|
422
|
+
getIFrameSrc(),
|
|
423
|
+
`http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&dataSourceMode=expand&enableDataPanelV2=false&useLastSelectedSources=false&hideSearchBar=true${prefixParams}#/embed/saved-answer/${answerId}`,
|
|
424
|
+
);
|
|
425
|
+
});
|
|
426
|
+
});
|
|
414
427
|
});
|