@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/lib/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/lib/src/types.js
CHANGED
|
@@ -118,12 +118,12 @@ export var EmbedEvent;
|
|
|
118
118
|
*/
|
|
119
119
|
EmbedEvent["Load"] = "load";
|
|
120
120
|
/**
|
|
121
|
-
* Data pertaining to answer or
|
|
122
|
-
* @return data - The answer or
|
|
121
|
+
* Data pertaining to answer or Liveboard is received
|
|
122
|
+
* @return data - The answer or Liveboard data
|
|
123
123
|
*/
|
|
124
124
|
EmbedEvent["Data"] = "data";
|
|
125
125
|
/**
|
|
126
|
-
* Search/answer/
|
|
126
|
+
* Search/answer/Liveboard filters have been applied/updated
|
|
127
127
|
* @hidden
|
|
128
128
|
*/
|
|
129
129
|
EmbedEvent["FiltersChanged"] = "filtersChanged";
|
|
@@ -146,13 +146,13 @@ export var EmbedEvent;
|
|
|
146
146
|
/**
|
|
147
147
|
* A custom action has been triggered
|
|
148
148
|
* @return actionId - The id of the custom action
|
|
149
|
-
* @return data - The answer or
|
|
149
|
+
* @return data - The answer or Liveboard data
|
|
150
150
|
*/
|
|
151
151
|
EmbedEvent["CustomAction"] = "customAction";
|
|
152
152
|
/**
|
|
153
153
|
* A double click has been triggered on table/chart
|
|
154
154
|
* @return ContextMenuInputPoints - data point that is double clicked
|
|
155
|
-
* *
|
|
155
|
+
* * _Version 1.5.0 or later _
|
|
156
156
|
*/
|
|
157
157
|
EmbedEvent["VizPointDoubleClick"] = "vizPointDoubleClick";
|
|
158
158
|
/**
|
|
@@ -170,8 +170,8 @@ export var EmbedEvent;
|
|
|
170
170
|
*/
|
|
171
171
|
EmbedEvent["AuthExpire"] = "ThoughtspotAuthExpired";
|
|
172
172
|
/**
|
|
173
|
-
* The height of the embedded
|
|
174
|
-
* @return data - The height of the embedded
|
|
173
|
+
* The height of the embedded Liveboard or visualization has been computed.
|
|
174
|
+
* @return data - The height of the embedded Liveboard or visualization
|
|
175
175
|
* @hidden
|
|
176
176
|
*/
|
|
177
177
|
EmbedEvent["EmbedHeight"] = "EMBED_HEIGHT";
|
|
@@ -183,7 +183,6 @@ export var EmbedEvent;
|
|
|
183
183
|
EmbedEvent["EmbedIframeCenter"] = "EmbedIframeCenter";
|
|
184
184
|
/**
|
|
185
185
|
* Detects the route change.
|
|
186
|
-
* @hidden
|
|
187
186
|
*/
|
|
188
187
|
EmbedEvent["RouteChange"] = "ROUTE_CHANGE";
|
|
189
188
|
/**
|
|
@@ -206,12 +205,12 @@ export var EmbedEvent;
|
|
|
206
205
|
EmbedEvent["SAMLComplete"] = "samlComplete";
|
|
207
206
|
/**
|
|
208
207
|
* Emitted when any modal is opened in the app
|
|
209
|
-
* *
|
|
208
|
+
* * _Version 1.6.0 or later _
|
|
210
209
|
*/
|
|
211
210
|
EmbedEvent["DialogOpen"] = "dialog-open";
|
|
212
211
|
/**
|
|
213
212
|
* Emitted when any modal is closed in the app
|
|
214
|
-
* *
|
|
213
|
+
* * _Version 1.6.0 or later _
|
|
215
214
|
*/
|
|
216
215
|
EmbedEvent["DialogClose"] = "dialog-close";
|
|
217
216
|
})(EmbedEvent || (EmbedEvent = {}));
|
|
@@ -234,7 +233,7 @@ export var HostEvent;
|
|
|
234
233
|
* eg. { selectedPoints: []}
|
|
235
234
|
* @param columnGuid - a string guid of the column to drill by. This is optional,
|
|
236
235
|
* if not provided it will auto drill by the configured column. \
|
|
237
|
-
* *
|
|
236
|
+
* * _Version 1.5.0 or later _
|
|
238
237
|
*/
|
|
239
238
|
HostEvent["DrillDown"] = "triggerDrillDown";
|
|
240
239
|
/**
|
|
@@ -248,10 +247,10 @@ export var HostEvent;
|
|
|
248
247
|
*/
|
|
249
248
|
HostEvent["Reload"] = "reload";
|
|
250
249
|
/**
|
|
251
|
-
* Set the visible
|
|
252
|
-
* @param - an array of ids of
|
|
250
|
+
* Set the visible visualizations on a Liveboard.
|
|
251
|
+
* @param - an array of ids of visualizations to show, the ids not passed
|
|
253
252
|
* will be hidden.
|
|
254
|
-
*
|
|
253
|
+
* * _Version 1.6.0 or later _
|
|
255
254
|
*/
|
|
256
255
|
HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
|
|
257
256
|
})(HostEvent || (HostEvent = {}));
|
|
@@ -309,7 +308,7 @@ export var Param;
|
|
|
309
308
|
})(Param || (Param = {}));
|
|
310
309
|
/**
|
|
311
310
|
* The list of actions that can be performed on visual ThoughtSpot
|
|
312
|
-
* entities, such as answers and
|
|
311
|
+
* entities, such as answers and Liveboards.
|
|
313
312
|
*/
|
|
314
313
|
// eslint-disable-next-line no-shadow
|
|
315
314
|
export var Action;
|
|
@@ -321,11 +320,6 @@ export var Action;
|
|
|
321
320
|
Action["MakeACopy"] = "makeACopy";
|
|
322
321
|
Action["EditACopy"] = "editACopy";
|
|
323
322
|
Action["CopyLink"] = "embedDocument";
|
|
324
|
-
/**
|
|
325
|
-
* @hidden
|
|
326
|
-
*/
|
|
327
|
-
Action["PinboardSnapshot"] = "pinboardSnapshot";
|
|
328
|
-
Action["LiveboardSnapshot"] = "liveboardSnapshot";
|
|
329
323
|
Action["ResetLayout"] = "resetLayout";
|
|
330
324
|
Action["Schedule"] = "schedule";
|
|
331
325
|
Action["SchedulesList"] = "schedule-list";
|
|
@@ -362,7 +356,7 @@ export var Action;
|
|
|
362
356
|
* @hidden
|
|
363
357
|
*/
|
|
364
358
|
Action["PinboardInfo"] = "pinboardInfo";
|
|
365
|
-
Action["LiveboardInfo"] = "
|
|
359
|
+
Action["LiveboardInfo"] = "pinboardInfo";
|
|
366
360
|
Action["SendAnswerFeedback"] = "sendFeedback";
|
|
367
361
|
/**
|
|
368
362
|
* @deprecated Will be removed in next version
|
package/lib/src/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;GAGG;AACH,qCAAqC;AACrC,MAAM,CAAN,IAAY,QAoBX;AApBD,WAAY,QAAQ;IAChB;;OAEG;IACH,yBAAa,CAAA;IACb;;OAEG;IACH,4BAAgB,CAAA;IAChB;;OAEG;IACH,qCAAyB,CAAA;IACzB;;;;;OAKG;IACH,2BAAe,CAAA;AACnB,CAAC,EApBW,QAAQ,KAAR,QAAQ,QAoBnB;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;GAGG;AACH,qCAAqC;AACrC,MAAM,CAAN,IAAY,QAoBX;AApBD,WAAY,QAAQ;IAChB;;OAEG;IACH,yBAAa,CAAA;IACb;;OAEG;IACH,4BAAgB,CAAA;IAChB;;OAEG;IACH,qCAAyB,CAAA;IACzB;;;;;OAKG;IACH,2BAAe,CAAA;AACnB,CAAC,EApBW,QAAQ,KAAR,QAAQ,QAoBnB;AAqHD;;GAEG;AACH,qCAAqC;AACrC,MAAM,CAAN,IAAY,eAyDX;AAzDD,WAAY,eAAe;IACvB;;OAEG;IACH,4BAAS,CAAA;IACT;;OAEG;IACH,4BAAS,CAAA;IACT;;OAEG;IACH,4BAAS,CAAA;IACT;;OAEG;IACH,4BAAS,CAAA;IACT;;OAEG;IACH,4BAAS,CAAA;IACT;;OAEG;IACH,4BAAS,CAAA;IACT;;OAEG;IACH,wCAAqB,CAAA;IACrB;;OAEG;IACH,8CAA2B,CAAA;IAC3B;;OAEG;IACH,0CAAuB,CAAA;IACvB;;OAEG;IACH,4CAAyB,CAAA;IACzB;;OAEG;IACH,4CAAyB,CAAA;IACzB;;OAEG;IACH,oCAAiB,CAAA;IACjB;;OAEG;IACH,4BAAS,CAAA;IACT;;OAEG;IACH,4BAAS,CAAA;AACb,CAAC,EAzDW,eAAe,KAAf,eAAe,QAyD1B;AAsBD;;GAEG;AACH,qCAAqC;AACrC,MAAM,CAAN,IAAY,UAgHX;AAhHD,WAAY,UAAU;IAClB;;;OAGG;IACH,2BAAa,CAAA;IACb;;;OAGG;I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AA;IAC/B,iCAAuB,CAAA;IACvB,iCAAuB,CAAA;IACvB,iCAAuB,CAAA;IACvB,6BAAmB,CAAA;IACnB,6BAAmB,CAAA;IACnB,mCAAyB,CAAA;IACzB,uBAAa,CAAA;IACb,iCAAuB,CAAA;IACvB,2BAAiB,CAAA;IACjB,6BAAmB,CAAA;IACnB,+BAAqB,CAAA;IACrB,2BAAiB,CAAA;IACjB,mDAAyC,CAAA;IACzC;;OAEG;IACH,uCAA6B,CAAA;IAC7B,wCAA8B,CAAA;IAC9B,6CAAmC,CAAA;IACnC;;OAEG;IACH,uCAA6B,CAAA;IAC7B,2DAAiD,CAAA;IACjD,qBAAW,CAAA;IACX,uCAA6B,CAAA;IAC7B,uCAA6B,CAAA;IAC7B,6BAAmB,CAAA;IACnB,oDAA0C,CAAA;IAC1C,oDAA0C,CAAA;IAC1C,iEAAuD,CAAA;IACvD,8CAAoC,CAAA;IACpC,wDAA8C,CAAA;IAC9C,mDAAyC,CAAA;IACzC,6BAAmB,CAAA;IACnB,yCAA+B,CAAA;IAC/B,qDAA2C,CAAA;AAC/C,CAAC,EAhEW,MAAM,KAAN,MAAM,QAgEjB;AAQD,qCAAqC;AACrC,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACrB,sDAAqC,CAAA;IACrC,sEAAqD,CAAA;AACzD,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB"}
|
|
@@ -88,7 +88,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
|
|
|
88
88
|
pageId?: Page;
|
|
89
89
|
/**
|
|
90
90
|
* This puts a filter tag on the application. All metadata lists in the application, such as
|
|
91
|
-
*
|
|
91
|
+
* Liveboards and answers, would be filtered by this tag.
|
|
92
92
|
*/
|
|
93
93
|
tag?: string;
|
|
94
94
|
/**
|
|
@@ -103,6 +103,13 @@ declare module '@thoughtspot/visual-embed-sdk/embed/app' {
|
|
|
103
103
|
export class AppEmbed extends V1Embed {
|
|
104
104
|
protected viewConfig: AppViewConfig;
|
|
105
105
|
constructor(domSelector: DOMSelector, viewConfig: AppViewConfig);
|
|
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
|
|
@@ -144,7 +151,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/liveboard' {
|
|
|
144
151
|
/**
|
|
145
152
|
* Copyright (c) 2021
|
|
146
153
|
*
|
|
147
|
-
* Embed a ThoughtSpot
|
|
154
|
+
* Embed a ThoughtSpot Liveboard or visualization
|
|
148
155
|
* https://developers.thoughtspot.com/docs/?pageid=embed-pinboard
|
|
149
156
|
* https://developers.thoughtspot.com/docs/?pageid=embed-a-viz
|
|
150
157
|
*
|
|
@@ -154,21 +161,21 @@ declare module '@thoughtspot/visual-embed-sdk/embed/liveboard' {
|
|
|
154
161
|
import { DOMSelector } from '@thoughtspot/visual-embed-sdk/types';
|
|
155
162
|
import { V1Embed, ViewConfig } from '@thoughtspot/visual-embed-sdk/embed/ts-embed';
|
|
156
163
|
/**
|
|
157
|
-
* The configuration for the embedded
|
|
164
|
+
* The configuration for the embedded Liveboard or visualization page view.
|
|
158
165
|
* @Category Liveboards and Charts
|
|
159
166
|
*/
|
|
160
167
|
export interface LiveboardViewConfig extends ViewConfig {
|
|
161
168
|
/**
|
|
162
169
|
* If set to true, the embedded object container dynamically resizes
|
|
163
|
-
* according to the height of the
|
|
170
|
+
* according to the height of the Liveboard.
|
|
164
171
|
*/
|
|
165
172
|
fullHeight?: boolean;
|
|
166
173
|
/**
|
|
167
|
-
* This is the minimum height(in pixels) for a full height
|
|
168
|
-
* Setting this height helps resolves issues with empty
|
|
169
|
-
* other screens navigable from a
|
|
174
|
+
* This is the minimum height(in pixels) for a full height Liveboard.
|
|
175
|
+
* Setting this height helps resolves issues with empty Liveboards and
|
|
176
|
+
* other screens navigable from a Liveboard.
|
|
177
|
+
* *_since 1.5.0_
|
|
170
178
|
* @default 500
|
|
171
|
-
* * _since 1.5.0_
|
|
172
179
|
*/
|
|
173
180
|
defaultHeight?: number;
|
|
174
181
|
/**
|
|
@@ -176,7 +183,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/liveboard' {
|
|
|
176
183
|
*/
|
|
177
184
|
enableVizTransformations?: boolean;
|
|
178
185
|
/**
|
|
179
|
-
* The
|
|
186
|
+
* The Liveboard to display in the embedded view.
|
|
180
187
|
* Use either of liveboardId or pinboardId to reference the Liveboard to embed.
|
|
181
188
|
*/
|
|
182
189
|
liveboardId?: string;
|
|
@@ -186,12 +193,12 @@ declare module '@thoughtspot/visual-embed-sdk/embed/liveboard' {
|
|
|
186
193
|
*/
|
|
187
194
|
pinboardId?: string;
|
|
188
195
|
/**
|
|
189
|
-
* The visualization within the
|
|
196
|
+
* The visualization within the Liveboard to display.
|
|
190
197
|
*/
|
|
191
198
|
vizId?: string;
|
|
192
199
|
/**
|
|
193
200
|
* If set to true, all filter chips from a
|
|
194
|
-
*
|
|
201
|
+
* Liveboard page will be read-only (no X buttons)
|
|
195
202
|
*/
|
|
196
203
|
preventLiveboardFilterRemoval?: boolean;
|
|
197
204
|
/**
|
|
@@ -201,15 +208,15 @@ declare module '@thoughtspot/visual-embed-sdk/embed/liveboard' {
|
|
|
201
208
|
preventPinboardFilterRemoval?: boolean;
|
|
202
209
|
}
|
|
203
210
|
/**
|
|
204
|
-
* Embed a ThoughtSpot
|
|
211
|
+
* Embed a ThoughtSpot Liveboard or visualization
|
|
205
212
|
* @Category Liveboards and Charts
|
|
206
213
|
*/
|
|
207
214
|
export class LiveboardEmbed extends V1Embed {
|
|
208
215
|
protected viewConfig: LiveboardViewConfig;
|
|
209
216
|
constructor(domSelector: DOMSelector, viewConfig: LiveboardViewConfig);
|
|
210
217
|
/**
|
|
211
|
-
* Render an embedded ThoughtSpot
|
|
212
|
-
* @param renderOptions An object specifying the
|
|
218
|
+
* Render an embedded ThoughtSpot Liveboard or visualization
|
|
219
|
+
* @param renderOptions An object specifying the Liveboard ID,
|
|
213
220
|
* visualization ID and the runtime filters.
|
|
214
221
|
*/
|
|
215
222
|
render(): LiveboardEmbed;
|
|
@@ -421,12 +428,13 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
421
428
|
* When there are multiple embeds, queue the render of embed to start
|
|
422
429
|
* after the previous embed's render is complete. This helps in the load performance
|
|
423
430
|
* by decreasing the load on the browser.
|
|
431
|
+
* * _Version 1.5.0 or later _
|
|
424
432
|
* @default false
|
|
425
433
|
*/
|
|
426
434
|
queueMultiRenders?: boolean;
|
|
427
435
|
/**
|
|
428
436
|
* Dynamic CSS Url to be injected in the loaded application.
|
|
429
|
-
*
|
|
437
|
+
* * _Version 1.6.0 or later _
|
|
430
438
|
* @default ''
|
|
431
439
|
*/
|
|
432
440
|
customCssUrl?: string;
|
|
@@ -502,7 +510,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
502
510
|
IN = "IN"
|
|
503
511
|
}
|
|
504
512
|
/**
|
|
505
|
-
* A filter that can be applied to ThoughtSpot answers,
|
|
513
|
+
* A filter that can be applied to ThoughtSpot answers, Liveboards, or
|
|
506
514
|
* visualizations at runtime.
|
|
507
515
|
*/
|
|
508
516
|
export interface RuntimeFilter {
|
|
@@ -540,12 +548,12 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
540
548
|
*/
|
|
541
549
|
Load = "load",
|
|
542
550
|
/**
|
|
543
|
-
* Data pertaining to answer or
|
|
544
|
-
* @return data - The answer or
|
|
551
|
+
* Data pertaining to answer or Liveboard is received
|
|
552
|
+
* @return data - The answer or Liveboard data
|
|
545
553
|
*/
|
|
546
554
|
Data = "data",
|
|
547
555
|
/**
|
|
548
|
-
* Search/answer/
|
|
556
|
+
* Search/answer/Liveboard filters have been applied/updated
|
|
549
557
|
* @hidden
|
|
550
558
|
*/
|
|
551
559
|
FiltersChanged = "filtersChanged",
|
|
@@ -568,13 +576,13 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
568
576
|
/**
|
|
569
577
|
* A custom action has been triggered
|
|
570
578
|
* @return actionId - The id of the custom action
|
|
571
|
-
* @return data - The answer or
|
|
579
|
+
* @return data - The answer or Liveboard data
|
|
572
580
|
*/
|
|
573
581
|
CustomAction = "customAction",
|
|
574
582
|
/**
|
|
575
583
|
* A double click has been triggered on table/chart
|
|
576
584
|
* @return ContextMenuInputPoints - data point that is double clicked
|
|
577
|
-
* *
|
|
585
|
+
* * _Version 1.5.0 or later _
|
|
578
586
|
*/
|
|
579
587
|
VizPointDoubleClick = "vizPointDoubleClick",
|
|
580
588
|
/**
|
|
@@ -592,8 +600,8 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
592
600
|
*/
|
|
593
601
|
AuthExpire = "ThoughtspotAuthExpired",
|
|
594
602
|
/**
|
|
595
|
-
* The height of the embedded
|
|
596
|
-
* @return data - The height of the embedded
|
|
603
|
+
* The height of the embedded Liveboard or visualization has been computed.
|
|
604
|
+
* @return data - The height of the embedded Liveboard or visualization
|
|
597
605
|
* @hidden
|
|
598
606
|
*/
|
|
599
607
|
EmbedHeight = "EMBED_HEIGHT",
|
|
@@ -605,7 +613,6 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
605
613
|
EmbedIframeCenter = "EmbedIframeCenter",
|
|
606
614
|
/**
|
|
607
615
|
* Detects the route change.
|
|
608
|
-
* @hidden
|
|
609
616
|
*/
|
|
610
617
|
RouteChange = "ROUTE_CHANGE",
|
|
611
618
|
/**
|
|
@@ -628,12 +635,12 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
628
635
|
SAMLComplete = "samlComplete",
|
|
629
636
|
/**
|
|
630
637
|
* Emitted when any modal is opened in the app
|
|
631
|
-
* *
|
|
638
|
+
* * _Version 1.6.0 or later _
|
|
632
639
|
*/
|
|
633
640
|
DialogOpen = "dialog-open",
|
|
634
641
|
/**
|
|
635
642
|
* Emitted when any modal is closed in the app
|
|
636
|
-
* *
|
|
643
|
+
* * _Version 1.6.0 or later _
|
|
637
644
|
*/
|
|
638
645
|
DialogClose = "dialog-close"
|
|
639
646
|
}
|
|
@@ -654,7 +661,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
654
661
|
* eg. { selectedPoints: []}
|
|
655
662
|
* @param columnGuid - a string guid of the column to drill by. This is optional,
|
|
656
663
|
* if not provided it will auto drill by the configured column. \
|
|
657
|
-
* *
|
|
664
|
+
* * _Version 1.5.0 or later _
|
|
658
665
|
*/
|
|
659
666
|
DrillDown = "triggerDrillDown",
|
|
660
667
|
/**
|
|
@@ -668,10 +675,10 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
668
675
|
*/
|
|
669
676
|
Reload = "reload",
|
|
670
677
|
/**
|
|
671
|
-
* Set the visible
|
|
672
|
-
* @param - an array of ids of
|
|
678
|
+
* Set the visible visualizations on a Liveboard.
|
|
679
|
+
* @param - an array of ids of visualizations to show, the ids not passed
|
|
673
680
|
* will be hidden.
|
|
674
|
-
*
|
|
681
|
+
* * _Version 1.6.0 or later _
|
|
675
682
|
*/
|
|
676
683
|
SetVisibleVizs = "SetPinboardVisibleVizs"
|
|
677
684
|
}
|
|
@@ -725,7 +732,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
725
732
|
}
|
|
726
733
|
/**
|
|
727
734
|
* The list of actions that can be performed on visual ThoughtSpot
|
|
728
|
-
* entities, such as answers and
|
|
735
|
+
* entities, such as answers and Liveboards.
|
|
729
736
|
*/
|
|
730
737
|
export enum Action {
|
|
731
738
|
Save = "save",
|
|
@@ -735,11 +742,6 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
735
742
|
MakeACopy = "makeACopy",
|
|
736
743
|
EditACopy = "editACopy",
|
|
737
744
|
CopyLink = "embedDocument",
|
|
738
|
-
/**
|
|
739
|
-
* @hidden
|
|
740
|
-
*/
|
|
741
|
-
PinboardSnapshot = "pinboardSnapshot",
|
|
742
|
-
LiveboardSnapshot = "liveboardSnapshot",
|
|
743
745
|
ResetLayout = "resetLayout",
|
|
744
746
|
Schedule = "schedule",
|
|
745
747
|
SchedulesList = "schedule-list",
|
|
@@ -776,7 +778,7 @@ declare module '@thoughtspot/visual-embed-sdk/types' {
|
|
|
776
778
|
* @hidden
|
|
777
779
|
*/
|
|
778
780
|
PinboardInfo = "pinboardInfo",
|
|
779
|
-
LiveboardInfo = "
|
|
781
|
+
LiveboardInfo = "pinboardInfo",
|
|
780
782
|
SendAnswerFeedback = "sendFeedback",
|
|
781
783
|
/**
|
|
782
784
|
* @deprecated Will be removed in next version
|
|
@@ -881,7 +883,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/ts-embed' {
|
|
|
881
883
|
visibleActions?: Action[];
|
|
882
884
|
/**
|
|
883
885
|
* The list of runtime filters to apply to a search answer,
|
|
884
|
-
* visualization, or
|
|
886
|
+
* visualization, or Liveboard.
|
|
885
887
|
*/
|
|
886
888
|
runtimeFilters?: RuntimeFilter[];
|
|
887
889
|
}
|
|
@@ -920,7 +922,7 @@ declare module '@thoughtspot/visual-embed-sdk/embed/ts-embed' {
|
|
|
920
922
|
protected getBaseQueryParams(): {};
|
|
921
923
|
/**
|
|
922
924
|
* Constructs the base URL string to load v1 of the ThoughtSpot app.
|
|
923
|
-
* This is used for embedding
|
|
925
|
+
* This is used for embedding Liveboards, visualizations, and full application.
|
|
924
926
|
* @param queryString The query string to append to the URL.
|
|
925
927
|
* @param isAppEmbed A Boolean parameter to specify if you are embedding
|
|
926
928
|
* the full application.
|
|
@@ -979,15 +981,6 @@ declare module '@thoughtspot/visual-embed-sdk/embed/ts-embed' {
|
|
|
979
981
|
* @param callback A callback function
|
|
980
982
|
*/
|
|
981
983
|
on(messageType: EmbedEvent, callback: MessageCallback): typeof TsEmbed.prototype;
|
|
982
|
-
/**
|
|
983
|
-
* Navigates users to the specified application page.
|
|
984
|
-
* Use this method to navigate users from the embedded
|
|
985
|
-
* ThoughtSpot context to a specific page in your app.
|
|
986
|
-
* @param path The page path string.
|
|
987
|
-
* For example, to navigate users to a liveboard page,
|
|
988
|
-
* define the method as navigateToPage('liveboard/<liveboardId>').
|
|
989
|
-
*/
|
|
990
|
-
navigateToPage(path: string): void;
|
|
991
984
|
/**
|
|
992
985
|
* Triggers an event to the embedded app
|
|
993
986
|
* @param messageType The event type
|
package/package.json
CHANGED
package/src/embed/app.spec.ts
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
getRootEl,
|
|
9
9
|
} from '../test/test-utils';
|
|
10
10
|
import { version } from '../../package.json';
|
|
11
|
+
import * as config from '../config';
|
|
11
12
|
|
|
12
13
|
const defaultViewConfig = {
|
|
13
14
|
frameParams: {
|
|
@@ -17,6 +18,7 @@ const defaultViewConfig = {
|
|
|
17
18
|
};
|
|
18
19
|
const thoughtSpotHost = 'tshost';
|
|
19
20
|
const defaultParams = `&hostAppUrl=local-host&viewPortHeight=768&viewPortWidth=1024&sdkVersion=${version}`;
|
|
21
|
+
const defaultParamsForPinboardEmbed = `hostAppUrl=local-host&viewPortHeight=768&viewPortWidth=1024&sdkVersion=${version}`;
|
|
20
22
|
|
|
21
23
|
beforeAll(() => {
|
|
22
24
|
init({
|
|
@@ -168,4 +170,42 @@ describe('App embed tests', () => {
|
|
|
168
170
|
);
|
|
169
171
|
});
|
|
170
172
|
});
|
|
173
|
+
|
|
174
|
+
describe('Naviage to Page API', () => {
|
|
175
|
+
const path = 'pinboard/e0836cad-4fdf-42d4-bd97-567a6b2a6058';
|
|
176
|
+
beforeEach(() => {
|
|
177
|
+
jest.spyOn(config, 'getThoughtSpotHost').mockImplementation(
|
|
178
|
+
() => 'http://tshost',
|
|
179
|
+
);
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
test('when app is AppEmbed after navigateToPage function call, new path should be set to iframe', async () => {
|
|
183
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
184
|
+
frameParams: {
|
|
185
|
+
width: '100%',
|
|
186
|
+
height: '100%',
|
|
187
|
+
},
|
|
188
|
+
});
|
|
189
|
+
await appEmbed.render();
|
|
190
|
+
appEmbed.navigateToPage(path);
|
|
191
|
+
expect(getIFrameSrc()).toBe(
|
|
192
|
+
`http://${thoughtSpotHost}/?embedApp=true&primaryNavHidden=true&profileAndHelpInNavBarHidden=false&${defaultParamsForPinboardEmbed}#/${path}`,
|
|
193
|
+
);
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
test('navigateToPage function use before render', async () => {
|
|
197
|
+
spyOn(console, 'log');
|
|
198
|
+
const appEmbed = new AppEmbed(getRootEl(), {
|
|
199
|
+
frameParams: {
|
|
200
|
+
width: '100%',
|
|
201
|
+
height: '100%',
|
|
202
|
+
},
|
|
203
|
+
});
|
|
204
|
+
appEmbed.navigateToPage(path);
|
|
205
|
+
await appEmbed.render();
|
|
206
|
+
expect(console.log).toHaveBeenCalledWith(
|
|
207
|
+
'Please call render before invoking this method',
|
|
208
|
+
);
|
|
209
|
+
});
|
|
210
|
+
});
|
|
171
211
|
});
|
package/src/embed/app.ts
CHANGED
|
@@ -72,7 +72,7 @@ export interface AppViewConfig extends ViewConfig {
|
|
|
72
72
|
pageId?: Page;
|
|
73
73
|
/**
|
|
74
74
|
* This puts a filter tag on the application. All metadata lists in the application, such as
|
|
75
|
-
*
|
|
75
|
+
* Liveboards and answers, would be filtered by this tag.
|
|
76
76
|
*/
|
|
77
77
|
tag?: string;
|
|
78
78
|
/**
|
|
@@ -95,7 +95,7 @@ export class AppEmbed extends V1Embed {
|
|
|
95
95
|
|
|
96
96
|
/**
|
|
97
97
|
* Constructs a map of parameters to be passed on to the
|
|
98
|
-
* embedded
|
|
98
|
+
* embedded Liveboard or visualization.
|
|
99
99
|
*/
|
|
100
100
|
private getEmbedParams() {
|
|
101
101
|
const params = this.getBaseQueryParams();
|
|
@@ -173,6 +173,25 @@ export class AppEmbed extends V1Embed {
|
|
|
173
173
|
return path;
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
+
/**
|
|
177
|
+
* Navigate to particular page for app embed. eg:answers/pinboards/home
|
|
178
|
+
* This is used for embedding answers, pinboards, visualizations and full application only.
|
|
179
|
+
* @param path The string, set to iframe src and navigate to new page
|
|
180
|
+
* eg: appEmbed.navigateToPage('pinboards')
|
|
181
|
+
*/
|
|
182
|
+
public navigateToPage(path: string): void {
|
|
183
|
+
if (this.iFrame) {
|
|
184
|
+
const iframeSrc = this.iFrame.src;
|
|
185
|
+
const embedPath = '#/embed';
|
|
186
|
+
const currentPath = iframeSrc.includes(embedPath) ? embedPath : '#';
|
|
187
|
+
this.iFrame.src = `${
|
|
188
|
+
iframeSrc.split(currentPath)[0]
|
|
189
|
+
}${currentPath}/${path.replace(/^\/?#?\//, '')}`;
|
|
190
|
+
} else {
|
|
191
|
+
console.log('Please call render before invoking this method');
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
176
195
|
/**
|
|
177
196
|
* Renders the embedded application pages in the ThoughtSpot app.
|
|
178
197
|
* @param renderOptions An object containing the page ID
|