@thoughtspot/visual-embed-sdk 1.6.0-alpha.2 → 1.6.0-alpha.3
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/dist/src/embed/app.d.ts +9 -2
- package/dist/src/embed/liveboard.d.ts +19 -19
- package/dist/src/embed/liveboard.spec.d.ts +1 -0
- package/dist/src/embed/ts-embed.d.ts +2 -11
- package/dist/src/types.d.ts +18 -23
- package/dist/tsembed.es.js +48 -58
- package/dist/tsembed.js +47 -57
- package/lib/package.json +1 -1
- package/lib/src/embed/app.d.ts +9 -2
- package/lib/src/embed/app.js +18 -1
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +31 -0
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/events.spec.js +55 -2
- package/lib/src/embed/events.spec.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +19 -19
- package/lib/src/embed/liveboard.js +12 -13
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.d.ts +1 -0
- package/lib/src/embed/liveboard.spec.js +159 -0
- package/lib/src/embed/liveboard.spec.js.map +1 -0
- package/lib/src/embed/ts-embed.d.ts +2 -11
- package/lib/src/embed/ts-embed.js +2 -22
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +63 -6
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/types.d.ts +18 -23
- package/lib/src/types.js +15 -21
- package/lib/src/types.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +41 -48
- package/package.json +1 -1
- package/src/embed/app.spec.ts +40 -0
- package/src/embed/app.ts +21 -2
- package/src/embed/events.spec.ts +60 -1
- package/src/embed/liveboard.spec.ts +199 -0
- package/src/embed/liveboard.ts +21 -24
- package/src/embed/ts-embed.spec.ts +78 -5
- package/src/embed/ts-embed.ts +3 -24
- package/src/types.ts +18 -23
package/dist/src/embed/app.d.ts
CHANGED
|
@@ -67,7 +67,7 @@ export interface AppViewConfig extends ViewConfig {
|
|
|
67
67
|
pageId?: Page;
|
|
68
68
|
/**
|
|
69
69
|
* This puts a filter tag on the application. All metadata lists in the application, such as
|
|
70
|
-
*
|
|
70
|
+
* Liveboards and answers, would be filtered by this tag.
|
|
71
71
|
*/
|
|
72
72
|
tag?: string;
|
|
73
73
|
/**
|
|
@@ -84,7 +84,7 @@ export declare class AppEmbed extends V1Embed {
|
|
|
84
84
|
constructor(domSelector: DOMSelector, viewConfig: AppViewConfig);
|
|
85
85
|
/**
|
|
86
86
|
* Constructs a map of parameters to be passed on to the
|
|
87
|
-
* embedded
|
|
87
|
+
* embedded Liveboard or visualization.
|
|
88
88
|
*/
|
|
89
89
|
private getEmbedParams;
|
|
90
90
|
/**
|
|
@@ -103,6 +103,13 @@ export declare class AppEmbed extends V1Embed {
|
|
|
103
103
|
* @returns The URL path that the embedded app understands.
|
|
104
104
|
*/
|
|
105
105
|
private formatPath;
|
|
106
|
+
/**
|
|
107
|
+
* Navigate to particular page for app embed. eg:answers/pinboards/home
|
|
108
|
+
* This is used for embedding answers, pinboards, visualizations and full application only.
|
|
109
|
+
* @param path The string, set to iframe src and navigate to new page
|
|
110
|
+
* eg: appEmbed.navigateToPage('pinboards')
|
|
111
|
+
*/
|
|
112
|
+
navigateToPage(path: string): void;
|
|
106
113
|
/**
|
|
107
114
|
* Renders the embedded application pages in the ThoughtSpot app.
|
|
108
115
|
* @param renderOptions An object containing the page ID
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2021
|
|
3
3
|
*
|
|
4
|
-
* Embed a ThoughtSpot
|
|
4
|
+
* Embed a ThoughtSpot Liveboard or visualization
|
|
5
5
|
* https://developers.thoughtspot.com/docs/?pageid=embed-pinboard
|
|
6
6
|
* https://developers.thoughtspot.com/docs/?pageid=embed-a-viz
|
|
7
7
|
*
|
|
@@ -11,21 +11,21 @@
|
|
|
11
11
|
import { DOMSelector } from '../types';
|
|
12
12
|
import { V1Embed, ViewConfig } from './ts-embed';
|
|
13
13
|
/**
|
|
14
|
-
* The configuration for the embedded
|
|
14
|
+
* The configuration for the embedded Liveboard or visualization page view.
|
|
15
15
|
* @Category Liveboards and Charts
|
|
16
16
|
*/
|
|
17
17
|
export interface LiveboardViewConfig extends ViewConfig {
|
|
18
18
|
/**
|
|
19
19
|
* If set to true, the embedded object container dynamically resizes
|
|
20
|
-
* according to the height of the
|
|
20
|
+
* according to the height of the Liveboard.
|
|
21
21
|
*/
|
|
22
22
|
fullHeight?: boolean;
|
|
23
23
|
/**
|
|
24
|
-
* This is the minimum height(in pixels) for a full height
|
|
25
|
-
* Setting this height helps resolves issues with empty
|
|
26
|
-
* other screens navigable from a
|
|
24
|
+
* This is the minimum height(in pixels) for a full height Liveboard.
|
|
25
|
+
* Setting this height helps resolves issues with empty Liveboards and
|
|
26
|
+
* other screens navigable from a Liveboard.
|
|
27
|
+
* *_since 1.5.0_
|
|
27
28
|
* @default 500
|
|
28
|
-
* * _since 1.5.0_
|
|
29
29
|
*/
|
|
30
30
|
defaultHeight?: number;
|
|
31
31
|
/**
|
|
@@ -33,7 +33,7 @@ export interface LiveboardViewConfig extends ViewConfig {
|
|
|
33
33
|
*/
|
|
34
34
|
enableVizTransformations?: boolean;
|
|
35
35
|
/**
|
|
36
|
-
* The
|
|
36
|
+
* The Liveboard to display in the embedded view.
|
|
37
37
|
* Use either of liveboardId or pinboardId to reference the Liveboard to embed.
|
|
38
38
|
*/
|
|
39
39
|
liveboardId?: string;
|
|
@@ -43,12 +43,12 @@ export interface LiveboardViewConfig extends ViewConfig {
|
|
|
43
43
|
*/
|
|
44
44
|
pinboardId?: string;
|
|
45
45
|
/**
|
|
46
|
-
* The visualization within the
|
|
46
|
+
* The visualization within the Liveboard to display.
|
|
47
47
|
*/
|
|
48
48
|
vizId?: string;
|
|
49
49
|
/**
|
|
50
50
|
* If set to true, all filter chips from a
|
|
51
|
-
*
|
|
51
|
+
* Liveboard page will be read-only (no X buttons)
|
|
52
52
|
*/
|
|
53
53
|
preventLiveboardFilterRemoval?: boolean;
|
|
54
54
|
/**
|
|
@@ -58,7 +58,7 @@ export interface LiveboardViewConfig extends ViewConfig {
|
|
|
58
58
|
preventPinboardFilterRemoval?: boolean;
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
|
-
* Embed a ThoughtSpot
|
|
61
|
+
* Embed a ThoughtSpot Liveboard or visualization
|
|
62
62
|
* @Category Liveboards and Charts
|
|
63
63
|
*/
|
|
64
64
|
export declare class LiveboardEmbed extends V1Embed {
|
|
@@ -67,16 +67,16 @@ export declare class LiveboardEmbed extends V1Embed {
|
|
|
67
67
|
constructor(domSelector: DOMSelector, viewConfig: LiveboardViewConfig);
|
|
68
68
|
/**
|
|
69
69
|
* Construct a map of params to be passed on to the
|
|
70
|
-
* embedded
|
|
70
|
+
* embedded Liveboard or visualization.
|
|
71
71
|
*/
|
|
72
72
|
private getEmbedParams;
|
|
73
73
|
/**
|
|
74
|
-
* Construct the URL of the embedded ThoughtSpot
|
|
74
|
+
* Construct the URL of the embedded ThoughtSpot Liveboard or visualization
|
|
75
75
|
* to be loaded within the iframe.
|
|
76
|
-
* @param liveboardId The GUID of the
|
|
77
|
-
* @param vizId The optional GUID of a visualization within the
|
|
76
|
+
* @param liveboardId The GUID of the Liveboard.
|
|
77
|
+
* @param vizId The optional GUID of a visualization within the Liveboard.
|
|
78
78
|
* @param runtimeFilters A list of runtime filters to be applied to
|
|
79
|
-
* the
|
|
79
|
+
* the Liveboard or visualization on load.
|
|
80
80
|
*/
|
|
81
81
|
private getIFrameSrc;
|
|
82
82
|
/**
|
|
@@ -86,10 +86,10 @@ export declare class LiveboardEmbed extends V1Embed {
|
|
|
86
86
|
*/
|
|
87
87
|
private updateIFrameHeight;
|
|
88
88
|
private embedIframeCenter;
|
|
89
|
-
private
|
|
89
|
+
private setIframeHeightForNonEmbedLiveboard;
|
|
90
90
|
/**
|
|
91
|
-
* Render an embedded ThoughtSpot
|
|
92
|
-
* @param renderOptions An object specifying the
|
|
91
|
+
* Render an embedded ThoughtSpot Liveboard or visualization
|
|
92
|
+
* @param renderOptions An object specifying the Liveboard ID,
|
|
93
93
|
* visualization ID and the runtime filters.
|
|
94
94
|
*/
|
|
95
95
|
render(): LiveboardEmbed;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -64,7 +64,7 @@ export interface ViewConfig {
|
|
|
64
64
|
visibleActions?: Action[];
|
|
65
65
|
/**
|
|
66
66
|
* The list of runtime filters to apply to a search answer,
|
|
67
|
-
* visualization, or
|
|
67
|
+
* visualization, or Liveboard.
|
|
68
68
|
*/
|
|
69
69
|
runtimeFilters?: RuntimeFilter[];
|
|
70
70
|
}
|
|
@@ -162,7 +162,7 @@ export declare class TsEmbed {
|
|
|
162
162
|
protected getBaseQueryParams(): {};
|
|
163
163
|
/**
|
|
164
164
|
* Constructs the base URL string to load v1 of the ThoughtSpot app.
|
|
165
|
-
* This is used for embedding
|
|
165
|
+
* This is used for embedding Liveboards, visualizations, and full application.
|
|
166
166
|
* @param queryString The query string to append to the URL.
|
|
167
167
|
* @param isAppEmbed A Boolean parameter to specify if you are embedding
|
|
168
168
|
* the full application.
|
|
@@ -221,15 +221,6 @@ export declare class TsEmbed {
|
|
|
221
221
|
* @param callback A callback function
|
|
222
222
|
*/
|
|
223
223
|
on(messageType: EmbedEvent, callback: MessageCallback): typeof TsEmbed.prototype;
|
|
224
|
-
/**
|
|
225
|
-
* Navigates users to the specified application page.
|
|
226
|
-
* Use this method to navigate users from the embedded
|
|
227
|
-
* ThoughtSpot context to a specific page in your app.
|
|
228
|
-
* @param path The page path string.
|
|
229
|
-
* For example, to navigate users to a liveboard page,
|
|
230
|
-
* define the method as navigateToPage('liveboard/<liveboardId>').
|
|
231
|
-
*/
|
|
232
|
-
navigateToPage(path: string): void;
|
|
233
224
|
/**
|
|
234
225
|
* Triggers an event on specific Port registered against
|
|
235
226
|
* for the EmbedEvent
|
package/dist/src/types.d.ts
CHANGED
|
@@ -112,12 +112,13 @@ export interface EmbedConfig {
|
|
|
112
112
|
* When there are multiple embeds, queue the render of embed to start
|
|
113
113
|
* after the previous embed's render is complete. This helps in the load performance
|
|
114
114
|
* by decreasing the load on the browser.
|
|
115
|
+
* * _Version 1.5.0 or later _
|
|
115
116
|
* @default false
|
|
116
117
|
*/
|
|
117
118
|
queueMultiRenders?: boolean;
|
|
118
119
|
/**
|
|
119
120
|
* Dynamic CSS Url to be injected in the loaded application.
|
|
120
|
-
*
|
|
121
|
+
* * _Version 1.6.0 or later _
|
|
121
122
|
* @default ''
|
|
122
123
|
*/
|
|
123
124
|
customCssUrl?: string;
|
|
@@ -193,7 +194,7 @@ export declare enum RuntimeFilterOp {
|
|
|
193
194
|
IN = "IN"
|
|
194
195
|
}
|
|
195
196
|
/**
|
|
196
|
-
* A filter that can be applied to ThoughtSpot answers,
|
|
197
|
+
* A filter that can be applied to ThoughtSpot answers, Liveboards, or
|
|
197
198
|
* visualizations at runtime.
|
|
198
199
|
*/
|
|
199
200
|
export interface RuntimeFilter {
|
|
@@ -231,12 +232,12 @@ export declare enum EmbedEvent {
|
|
|
231
232
|
*/
|
|
232
233
|
Load = "load",
|
|
233
234
|
/**
|
|
234
|
-
* Data pertaining to answer or
|
|
235
|
-
* @return data - The answer or
|
|
235
|
+
* Data pertaining to answer or Liveboard is received
|
|
236
|
+
* @return data - The answer or Liveboard data
|
|
236
237
|
*/
|
|
237
238
|
Data = "data",
|
|
238
239
|
/**
|
|
239
|
-
* Search/answer/
|
|
240
|
+
* Search/answer/Liveboard filters have been applied/updated
|
|
240
241
|
* @hidden
|
|
241
242
|
*/
|
|
242
243
|
FiltersChanged = "filtersChanged",
|
|
@@ -259,13 +260,13 @@ export declare enum EmbedEvent {
|
|
|
259
260
|
/**
|
|
260
261
|
* A custom action has been triggered
|
|
261
262
|
* @return actionId - The id of the custom action
|
|
262
|
-
* @return data - The answer or
|
|
263
|
+
* @return data - The answer or Liveboard data
|
|
263
264
|
*/
|
|
264
265
|
CustomAction = "customAction",
|
|
265
266
|
/**
|
|
266
267
|
* A double click has been triggered on table/chart
|
|
267
268
|
* @return ContextMenuInputPoints - data point that is double clicked
|
|
268
|
-
* *
|
|
269
|
+
* * _Version 1.5.0 or later _
|
|
269
270
|
*/
|
|
270
271
|
VizPointDoubleClick = "vizPointDoubleClick",
|
|
271
272
|
/**
|
|
@@ -283,8 +284,8 @@ export declare enum EmbedEvent {
|
|
|
283
284
|
*/
|
|
284
285
|
AuthExpire = "ThoughtspotAuthExpired",
|
|
285
286
|
/**
|
|
286
|
-
* The height of the embedded
|
|
287
|
-
* @return data - The height of the embedded
|
|
287
|
+
* The height of the embedded Liveboard or visualization has been computed.
|
|
288
|
+
* @return data - The height of the embedded Liveboard or visualization
|
|
288
289
|
* @hidden
|
|
289
290
|
*/
|
|
290
291
|
EmbedHeight = "EMBED_HEIGHT",
|
|
@@ -296,7 +297,6 @@ export declare enum EmbedEvent {
|
|
|
296
297
|
EmbedIframeCenter = "EmbedIframeCenter",
|
|
297
298
|
/**
|
|
298
299
|
* Detects the route change.
|
|
299
|
-
* @hidden
|
|
300
300
|
*/
|
|
301
301
|
RouteChange = "ROUTE_CHANGE",
|
|
302
302
|
/**
|
|
@@ -319,12 +319,12 @@ export declare enum EmbedEvent {
|
|
|
319
319
|
SAMLComplete = "samlComplete",
|
|
320
320
|
/**
|
|
321
321
|
* Emitted when any modal is opened in the app
|
|
322
|
-
* *
|
|
322
|
+
* * _Version 1.6.0 or later _
|
|
323
323
|
*/
|
|
324
324
|
DialogOpen = "dialog-open",
|
|
325
325
|
/**
|
|
326
326
|
* Emitted when any modal is closed in the app
|
|
327
|
-
* *
|
|
327
|
+
* * _Version 1.6.0 or later _
|
|
328
328
|
*/
|
|
329
329
|
DialogClose = "dialog-close"
|
|
330
330
|
}
|
|
@@ -345,7 +345,7 @@ export declare enum HostEvent {
|
|
|
345
345
|
* eg. { selectedPoints: []}
|
|
346
346
|
* @param columnGuid - a string guid of the column to drill by. This is optional,
|
|
347
347
|
* if not provided it will auto drill by the configured column. \
|
|
348
|
-
* *
|
|
348
|
+
* * _Version 1.5.0 or later _
|
|
349
349
|
*/
|
|
350
350
|
DrillDown = "triggerDrillDown",
|
|
351
351
|
/**
|
|
@@ -359,10 +359,10 @@ export declare enum HostEvent {
|
|
|
359
359
|
*/
|
|
360
360
|
Reload = "reload",
|
|
361
361
|
/**
|
|
362
|
-
* Set the visible
|
|
363
|
-
* @param - an array of ids of
|
|
362
|
+
* Set the visible visualizations on a Liveboard.
|
|
363
|
+
* @param - an array of ids of visualizations to show, the ids not passed
|
|
364
364
|
* will be hidden.
|
|
365
|
-
*
|
|
365
|
+
* * _Version 1.6.0 or later _
|
|
366
366
|
*/
|
|
367
367
|
SetVisibleVizs = "SetPinboardVisibleVizs"
|
|
368
368
|
}
|
|
@@ -416,7 +416,7 @@ export declare enum Param {
|
|
|
416
416
|
}
|
|
417
417
|
/**
|
|
418
418
|
* The list of actions that can be performed on visual ThoughtSpot
|
|
419
|
-
* entities, such as answers and
|
|
419
|
+
* entities, such as answers and Liveboards.
|
|
420
420
|
*/
|
|
421
421
|
export declare enum Action {
|
|
422
422
|
Save = "save",
|
|
@@ -426,11 +426,6 @@ export declare enum Action {
|
|
|
426
426
|
MakeACopy = "makeACopy",
|
|
427
427
|
EditACopy = "editACopy",
|
|
428
428
|
CopyLink = "embedDocument",
|
|
429
|
-
/**
|
|
430
|
-
* @hidden
|
|
431
|
-
*/
|
|
432
|
-
PinboardSnapshot = "pinboardSnapshot",
|
|
433
|
-
LiveboardSnapshot = "liveboardSnapshot",
|
|
434
429
|
ResetLayout = "resetLayout",
|
|
435
430
|
Schedule = "schedule",
|
|
436
431
|
SchedulesList = "schedule-list",
|
|
@@ -467,7 +462,7 @@ export declare enum Action {
|
|
|
467
462
|
* @hidden
|
|
468
463
|
*/
|
|
469
464
|
PinboardInfo = "pinboardInfo",
|
|
470
|
-
LiveboardInfo = "
|
|
465
|
+
LiveboardInfo = "pinboardInfo",
|
|
471
466
|
SendAnswerFeedback = "sendFeedback",
|
|
472
467
|
/**
|
|
473
468
|
* @deprecated Will be removed in next version
|
package/dist/tsembed.es.js
CHANGED
|
@@ -230,12 +230,12 @@ var EmbedEvent;
|
|
|
230
230
|
*/
|
|
231
231
|
EmbedEvent["Load"] = "load";
|
|
232
232
|
/**
|
|
233
|
-
* Data pertaining to answer or
|
|
234
|
-
* @return data - The answer or
|
|
233
|
+
* Data pertaining to answer or Liveboard is received
|
|
234
|
+
* @return data - The answer or Liveboard data
|
|
235
235
|
*/
|
|
236
236
|
EmbedEvent["Data"] = "data";
|
|
237
237
|
/**
|
|
238
|
-
* Search/answer/
|
|
238
|
+
* Search/answer/Liveboard filters have been applied/updated
|
|
239
239
|
* @hidden
|
|
240
240
|
*/
|
|
241
241
|
EmbedEvent["FiltersChanged"] = "filtersChanged";
|
|
@@ -258,13 +258,13 @@ var EmbedEvent;
|
|
|
258
258
|
/**
|
|
259
259
|
* A custom action has been triggered
|
|
260
260
|
* @return actionId - The id of the custom action
|
|
261
|
-
* @return data - The answer or
|
|
261
|
+
* @return data - The answer or Liveboard data
|
|
262
262
|
*/
|
|
263
263
|
EmbedEvent["CustomAction"] = "customAction";
|
|
264
264
|
/**
|
|
265
265
|
* A double click has been triggered on table/chart
|
|
266
266
|
* @return ContextMenuInputPoints - data point that is double clicked
|
|
267
|
-
* *
|
|
267
|
+
* * _Version 1.5.0 or later _
|
|
268
268
|
*/
|
|
269
269
|
EmbedEvent["VizPointDoubleClick"] = "vizPointDoubleClick";
|
|
270
270
|
/**
|
|
@@ -282,8 +282,8 @@ var EmbedEvent;
|
|
|
282
282
|
*/
|
|
283
283
|
EmbedEvent["AuthExpire"] = "ThoughtspotAuthExpired";
|
|
284
284
|
/**
|
|
285
|
-
* The height of the embedded
|
|
286
|
-
* @return data - The height of the embedded
|
|
285
|
+
* The height of the embedded Liveboard or visualization has been computed.
|
|
286
|
+
* @return data - The height of the embedded Liveboard or visualization
|
|
287
287
|
* @hidden
|
|
288
288
|
*/
|
|
289
289
|
EmbedEvent["EmbedHeight"] = "EMBED_HEIGHT";
|
|
@@ -295,7 +295,6 @@ var EmbedEvent;
|
|
|
295
295
|
EmbedEvent["EmbedIframeCenter"] = "EmbedIframeCenter";
|
|
296
296
|
/**
|
|
297
297
|
* Detects the route change.
|
|
298
|
-
* @hidden
|
|
299
298
|
*/
|
|
300
299
|
EmbedEvent["RouteChange"] = "ROUTE_CHANGE";
|
|
301
300
|
/**
|
|
@@ -318,12 +317,12 @@ var EmbedEvent;
|
|
|
318
317
|
EmbedEvent["SAMLComplete"] = "samlComplete";
|
|
319
318
|
/**
|
|
320
319
|
* Emitted when any modal is opened in the app
|
|
321
|
-
* *
|
|
320
|
+
* * _Version 1.6.0 or later _
|
|
322
321
|
*/
|
|
323
322
|
EmbedEvent["DialogOpen"] = "dialog-open";
|
|
324
323
|
/**
|
|
325
324
|
* Emitted when any modal is closed in the app
|
|
326
|
-
* *
|
|
325
|
+
* * _Version 1.6.0 or later _
|
|
327
326
|
*/
|
|
328
327
|
EmbedEvent["DialogClose"] = "dialog-close";
|
|
329
328
|
})(EmbedEvent || (EmbedEvent = {}));
|
|
@@ -346,7 +345,7 @@ var HostEvent;
|
|
|
346
345
|
* eg. { selectedPoints: []}
|
|
347
346
|
* @param columnGuid - a string guid of the column to drill by. This is optional,
|
|
348
347
|
* if not provided it will auto drill by the configured column. \
|
|
349
|
-
* *
|
|
348
|
+
* * _Version 1.5.0 or later _
|
|
350
349
|
*/
|
|
351
350
|
HostEvent["DrillDown"] = "triggerDrillDown";
|
|
352
351
|
/**
|
|
@@ -360,10 +359,10 @@ var HostEvent;
|
|
|
360
359
|
*/
|
|
361
360
|
HostEvent["Reload"] = "reload";
|
|
362
361
|
/**
|
|
363
|
-
* Set the visible
|
|
364
|
-
* @param - an array of ids of
|
|
362
|
+
* Set the visible visualizations on a Liveboard.
|
|
363
|
+
* @param - an array of ids of visualizations to show, the ids not passed
|
|
365
364
|
* will be hidden.
|
|
366
|
-
*
|
|
365
|
+
* * _Version 1.6.0 or later _
|
|
367
366
|
*/
|
|
368
367
|
HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
|
|
369
368
|
})(HostEvent || (HostEvent = {}));
|
|
@@ -421,7 +420,7 @@ var Param;
|
|
|
421
420
|
})(Param || (Param = {}));
|
|
422
421
|
/**
|
|
423
422
|
* The list of actions that can be performed on visual ThoughtSpot
|
|
424
|
-
* entities, such as answers and
|
|
423
|
+
* entities, such as answers and Liveboards.
|
|
425
424
|
*/
|
|
426
425
|
// eslint-disable-next-line no-shadow
|
|
427
426
|
var Action;
|
|
@@ -433,11 +432,6 @@ var Action;
|
|
|
433
432
|
Action["MakeACopy"] = "makeACopy";
|
|
434
433
|
Action["EditACopy"] = "editACopy";
|
|
435
434
|
Action["CopyLink"] = "embedDocument";
|
|
436
|
-
/**
|
|
437
|
-
* @hidden
|
|
438
|
-
*/
|
|
439
|
-
Action["PinboardSnapshot"] = "pinboardSnapshot";
|
|
440
|
-
Action["LiveboardSnapshot"] = "liveboardSnapshot";
|
|
441
435
|
Action["ResetLayout"] = "resetLayout";
|
|
442
436
|
Action["Schedule"] = "schedule";
|
|
443
437
|
Action["SchedulesList"] = "schedule-list";
|
|
@@ -474,7 +468,7 @@ var Action;
|
|
|
474
468
|
* @hidden
|
|
475
469
|
*/
|
|
476
470
|
Action["PinboardInfo"] = "pinboardInfo";
|
|
477
|
-
Action["LiveboardInfo"] = "
|
|
471
|
+
Action["LiveboardInfo"] = "pinboardInfo";
|
|
478
472
|
Action["SendAnswerFeedback"] = "sendFeedback";
|
|
479
473
|
/**
|
|
480
474
|
* @deprecated Will be removed in next version
|
|
@@ -8845,7 +8839,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
|
8845
8839
|
}
|
|
8846
8840
|
}
|
|
8847
8841
|
|
|
8848
|
-
var version="1.6.0-alpha.
|
|
8842
|
+
var version="1.6.0-alpha.3";
|
|
8849
8843
|
|
|
8850
8844
|
/**
|
|
8851
8845
|
* Copyright (c) 2021
|
|
@@ -9011,7 +9005,7 @@ class TsEmbed {
|
|
|
9011
9005
|
queryParams[Param.CustomCSSUrl] = this.embedConfig.customCssUrl;
|
|
9012
9006
|
}
|
|
9013
9007
|
const { disabledActions, disabledActionReason, hiddenActions, visibleActions, } = this.viewConfig;
|
|
9014
|
-
if ((visibleActions
|
|
9008
|
+
if (Array.isArray(visibleActions) && Array.isArray(hiddenActions)) {
|
|
9015
9009
|
this.handleError('You cannot have both hidden actions and visible actions');
|
|
9016
9010
|
return queryParams;
|
|
9017
9011
|
}
|
|
@@ -9031,7 +9025,7 @@ class TsEmbed {
|
|
|
9031
9025
|
}
|
|
9032
9026
|
/**
|
|
9033
9027
|
* Constructs the base URL string to load v1 of the ThoughtSpot app.
|
|
9034
|
-
* This is used for embedding
|
|
9028
|
+
* This is used for embedding Liveboards, visualizations, and full application.
|
|
9035
9029
|
* @param queryString The query string to append to the URL.
|
|
9036
9030
|
* @param isAppEmbed A Boolean parameter to specify if you are embedding
|
|
9037
9031
|
* the full application.
|
|
@@ -9209,26 +9203,6 @@ class TsEmbed {
|
|
|
9209
9203
|
this.eventHandlerMap.set(messageType, callbacks);
|
|
9210
9204
|
return this;
|
|
9211
9205
|
}
|
|
9212
|
-
/**
|
|
9213
|
-
* Navigates users to the specified application page.
|
|
9214
|
-
* Use this method to navigate users from the embedded
|
|
9215
|
-
* ThoughtSpot context to a specific page in your app.
|
|
9216
|
-
* @param path The page path string.
|
|
9217
|
-
* For example, to navigate users to a liveboard page,
|
|
9218
|
-
* define the method as navigateToPage('liveboard/<liveboardId>').
|
|
9219
|
-
*/
|
|
9220
|
-
navigateToPage(path) {
|
|
9221
|
-
var _a;
|
|
9222
|
-
const iframeSrc = (_a = this.iFrame) === null || _a === void 0 ? void 0 : _a.src;
|
|
9223
|
-
if (iframeSrc) {
|
|
9224
|
-
const embedPath = '#/embed';
|
|
9225
|
-
const currentPath = iframeSrc.includes(embedPath) ? embedPath : '#';
|
|
9226
|
-
this.iFrame.src = `${iframeSrc.split(currentPath)[0]}${currentPath}/${path.replace(/^\/?#?\//, '')}`;
|
|
9227
|
-
}
|
|
9228
|
-
else {
|
|
9229
|
-
console.log('Please call render before invoking this method');
|
|
9230
|
-
}
|
|
9231
|
-
}
|
|
9232
9206
|
/**
|
|
9233
9207
|
* Triggers an event on specific Port registered against
|
|
9234
9208
|
* for the EmbedEvent
|
|
@@ -9349,7 +9323,7 @@ class AppEmbed extends V1Embed {
|
|
|
9349
9323
|
}
|
|
9350
9324
|
/**
|
|
9351
9325
|
* Constructs a map of parameters to be passed on to the
|
|
9352
|
-
* embedded
|
|
9326
|
+
* embedded Liveboard or visualization.
|
|
9353
9327
|
*/
|
|
9354
9328
|
getEmbedParams() {
|
|
9355
9329
|
const params = this.getBaseQueryParams();
|
|
@@ -9412,6 +9386,23 @@ class AppEmbed extends V1Embed {
|
|
|
9412
9386
|
}
|
|
9413
9387
|
return path;
|
|
9414
9388
|
}
|
|
9389
|
+
/**
|
|
9390
|
+
* Navigate to particular page for app embed. eg:answers/pinboards/home
|
|
9391
|
+
* This is used for embedding answers, pinboards, visualizations and full application only.
|
|
9392
|
+
* @param path The string, set to iframe src and navigate to new page
|
|
9393
|
+
* eg: appEmbed.navigateToPage('pinboards')
|
|
9394
|
+
*/
|
|
9395
|
+
navigateToPage(path) {
|
|
9396
|
+
if (this.iFrame) {
|
|
9397
|
+
const iframeSrc = this.iFrame.src;
|
|
9398
|
+
const embedPath = '#/embed';
|
|
9399
|
+
const currentPath = iframeSrc.includes(embedPath) ? embedPath : '#';
|
|
9400
|
+
this.iFrame.src = `${iframeSrc.split(currentPath)[0]}${currentPath}/${path.replace(/^\/?#?\//, '')}`;
|
|
9401
|
+
}
|
|
9402
|
+
else {
|
|
9403
|
+
console.log('Please call render before invoking this method');
|
|
9404
|
+
}
|
|
9405
|
+
}
|
|
9415
9406
|
/**
|
|
9416
9407
|
* Renders the embedded application pages in the ThoughtSpot app.
|
|
9417
9408
|
* @param renderOptions An object containing the page ID
|
|
@@ -9430,7 +9421,7 @@ class AppEmbed extends V1Embed {
|
|
|
9430
9421
|
/**
|
|
9431
9422
|
* Copyright (c) 2021
|
|
9432
9423
|
*
|
|
9433
|
-
* Embed a ThoughtSpot
|
|
9424
|
+
* Embed a ThoughtSpot Liveboard or visualization
|
|
9434
9425
|
* https://developers.thoughtspot.com/docs/?pageid=embed-pinboard
|
|
9435
9426
|
* https://developers.thoughtspot.com/docs/?pageid=embed-a-viz
|
|
9436
9427
|
*
|
|
@@ -9438,7 +9429,7 @@ class AppEmbed extends V1Embed {
|
|
|
9438
9429
|
* @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
|
|
9439
9430
|
*/
|
|
9440
9431
|
/**
|
|
9441
|
-
* Embed a ThoughtSpot
|
|
9432
|
+
* Embed a ThoughtSpot Liveboard or visualization
|
|
9442
9433
|
* @Category Liveboards and Charts
|
|
9443
9434
|
*/
|
|
9444
9435
|
class LiveboardEmbed extends V1Embed {
|
|
@@ -9458,16 +9449,15 @@ class LiveboardEmbed extends V1Embed {
|
|
|
9458
9449
|
const obj = this.getIframeCenter();
|
|
9459
9450
|
responder({ type: EmbedEvent.EmbedIframeCenter, data: obj });
|
|
9460
9451
|
};
|
|
9461
|
-
this.
|
|
9462
|
-
if (data.data.
|
|
9463
|
-
data.data.canvasState !== 'pinboard') {
|
|
9452
|
+
this.setIframeHeightForNonEmbedLiveboard = (data) => {
|
|
9453
|
+
if (!data.data.currentPath.startsWith('/embed/viz/')) {
|
|
9464
9454
|
this.setIFrameHeight(this.defaultHeight);
|
|
9465
9455
|
}
|
|
9466
9456
|
};
|
|
9467
9457
|
}
|
|
9468
9458
|
/**
|
|
9469
9459
|
* Construct a map of params to be passed on to the
|
|
9470
|
-
* embedded
|
|
9460
|
+
* embedded Liveboard or visualization.
|
|
9471
9461
|
*/
|
|
9472
9462
|
getEmbedParams() {
|
|
9473
9463
|
const params = this.getBaseQueryParams();
|
|
@@ -9491,12 +9481,12 @@ class LiveboardEmbed extends V1Embed {
|
|
|
9491
9481
|
return queryParams;
|
|
9492
9482
|
}
|
|
9493
9483
|
/**
|
|
9494
|
-
* Construct the URL of the embedded ThoughtSpot
|
|
9484
|
+
* Construct the URL of the embedded ThoughtSpot Liveboard or visualization
|
|
9495
9485
|
* to be loaded within the iframe.
|
|
9496
|
-
* @param liveboardId The GUID of the
|
|
9497
|
-
* @param vizId The optional GUID of a visualization within the
|
|
9486
|
+
* @param liveboardId The GUID of the Liveboard.
|
|
9487
|
+
* @param vizId The optional GUID of a visualization within the Liveboard.
|
|
9498
9488
|
* @param runtimeFilters A list of runtime filters to be applied to
|
|
9499
|
-
* the
|
|
9489
|
+
* the Liveboard or visualization on load.
|
|
9500
9490
|
*/
|
|
9501
9491
|
getIFrameSrc(liveboardId, vizId, runtimeFilters) {
|
|
9502
9492
|
const filterQuery = getFilterQuery(runtimeFilters || []);
|
|
@@ -9511,8 +9501,8 @@ class LiveboardEmbed extends V1Embed {
|
|
|
9511
9501
|
return url;
|
|
9512
9502
|
}
|
|
9513
9503
|
/**
|
|
9514
|
-
* Render an embedded ThoughtSpot
|
|
9515
|
-
* @param renderOptions An object specifying the
|
|
9504
|
+
* Render an embedded ThoughtSpot Liveboard or visualization
|
|
9505
|
+
* @param renderOptions An object specifying the Liveboard ID,
|
|
9516
9506
|
* visualization ID and the runtime filters.
|
|
9517
9507
|
*/
|
|
9518
9508
|
render() {
|
|
@@ -9523,7 +9513,7 @@ class LiveboardEmbed extends V1Embed {
|
|
|
9523
9513
|
this.handleError(ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION);
|
|
9524
9514
|
}
|
|
9525
9515
|
if (this.viewConfig.fullHeight === true) {
|
|
9526
|
-
this.on(EmbedEvent.RouteChange, this.
|
|
9516
|
+
this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
|
|
9527
9517
|
this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
|
|
9528
9518
|
this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
|
|
9529
9519
|
}
|